From 47fac352ccb467dc67eaed763e5f0b1bd6da9f9a Mon Sep 17 00:00:00 2001 From: wenty22 Date: Mon, 2 Dec 2024 14:00:28 +0800 Subject: [PATCH] Updates --- .../{index-b5a591a5.js => index-6bb4a9ca.js} | 4 +- .../{index-29dd1816.js => index-8ce158e3.js} | 173003 ++++++++------- .../{index-2bfd47a8.js => index-9916bcea.js} | 2 +- .../{index-7d1c2b92.js => index-bb743c74.js} | 4 +- .../{index-41d2f1d2.js => index-bc91246c.js} | 2 +- .../{index-87e4afbf.js => index-e4bea0fb.js} | 2 +- ...ex.es-3fcdcded.js => index.es-c3bc7551.js} | 4 +- index.html | 2 +- 8 files changed, 86516 insertions(+), 86507 deletions(-) rename assets/{index-b5a591a5.js => index-6bb4a9ca.js} (99%) rename assets/{index-29dd1816.js => index-8ce158e3.js} (90%) rename assets/{index-2bfd47a8.js => index-9916bcea.js} (99%) rename assets/{index-7d1c2b92.js => index-bb743c74.js} (99%) rename assets/{index-41d2f1d2.js => index-bc91246c.js} (99%) rename assets/{index-87e4afbf.js => index-e4bea0fb.js} (99%) rename assets/{index.es-3fcdcded.js => index.es-c3bc7551.js} (98%) diff --git a/assets/index-b5a591a5.js b/assets/index-6bb4a9ca.js similarity index 99% rename from assets/index-b5a591a5.js rename to assets/index-6bb4a9ca.js index 210cf3d..64b2c7d 100644 --- a/assets/index-b5a591a5.js +++ b/assets/index-6bb4a9ca.js @@ -1,5 +1,5 @@ -import { T as ThemeCtrl, M as ModalCtrl, R as RouterCtrl, E as ExplorerCtrl, C as CoreUtil, a as ToastCtrl, b as EventsCtrl, O as OptionsCtrl, c as ConfigCtrl } from "./index-7d1c2b92.js"; -import { ac as browser } from "./index-29dd1816.js"; +import { T as ThemeCtrl, M as ModalCtrl, R as RouterCtrl, E as ExplorerCtrl, C as CoreUtil, a as ToastCtrl, b as EventsCtrl, O as OptionsCtrl, c as ConfigCtrl } from "./index-bb743c74.js"; +import { ac as browser } from "./index-8ce158e3.js"; /** * @license * Copyright 2019 Google LLC diff --git a/assets/index-29dd1816.js b/assets/index-8ce158e3.js similarity index 90% rename from assets/index-29dd1816.js rename to assets/index-8ce158e3.js index 662a570..1615c6d 100644 --- a/assets/index-29dd1816.js +++ b/assets/index-8ce158e3.js @@ -34,16 +34,16 @@ var __privateMethod = (obj, member, method) => { __accessCheck(obj, member, "access private method"); return method; }; -var _focused, _cleanup, _setup, _a2, _online, _cleanup2, _setup2, _b, _gcTimeout, _c, _initialState, _revertState, _cache, _retryer, _defaultOptions, _abortSignalConsumed, _dispatch, dispatch_fn, _d, _queries, _e2, _observers, _mutationCache, _retryer2, _dispatch2, dispatch_fn2, _f2, _mutations, _mutationId, _g, _queryCache, _mutationCache2, _defaultOptions2, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h2, _client, _currentResult, _currentMutation, _mutateOptions, _updateResult, updateResult_fn, _notify, notify_fn, _i, _names, _data, _dataLength, _writeData, writeData_fn, _data2, _offset, _bytesRead, _parent, _maxInflation, _incrementBytesRead, incrementBytesRead_fn, _peekBytes, peekBytes_fn, _r2, _s2, _v2, _networkV, _j, _privateKey, _options, _type, _to, _data3, _nonce, _gasLimit, _gasPrice, _maxPriorityFeePerGas, _maxFeePerGas, _value, _chainId, _sig, _accessList, _maxFeePerBlobGas, _blobVersionedHashes, _kzg, _blobs, _getSerialized, getSerialized_fn, _k, _types, _fullTypes, _encoderCache, _getEncoder, getEncoder_fn, _l, _offset2, _tokens, _subTokenString, subTokenString_fn, _m, _walkAsync, walkAsync_fn, _n, _getCoder, getCoder_fn, _throwUnsupported, throwUnsupported_fn, _signingKey, _data4, _checksum, _words, _loadWords, loadWords_fn, _account, account_fn, _fromSeed, fromSeed_fn, _offset3, _tokens2, _subTokenString2, subTokenString_fn2, _walkAsync2, walkAsync_fn2, _errors, _events, _functions, _abiCoder, _getFunction, getFunction_fn, _getEvent, getEvent_fn, _types2, _fullTypes2, _encoderCache2, _getEncoder2, getEncoder_fn2, _o2, _p, _q, _r3; -function _mergeNamespaces(n4, m3) { - for (var i3 = 0; i3 < m3.length; i3++) { - const e18 = m3[i3]; +var _focused, _cleanup, _setup, _a2, _online, _cleanup2, _setup2, _b, _gcTimeout, _c, _initialState, _revertState, _cache, _retryer, _defaultOptions, _abortSignalConsumed, _dispatch, dispatch_fn, _d, _queries, _e2, _observers, _mutationCache, _retryer2, _dispatch2, dispatch_fn2, _f2, _mutations, _mutationId, _g, _queryCache, _mutationCache2, _defaultOptions2, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h2, _client, _currentResult, _currentMutation, _mutateOptions, _updateResult, updateResult_fn, _notify, notify_fn, _i, _j, _k, _l, _m, _names, _data, _dataLength, _writeData, writeData_fn, _data2, _offset, _bytesRead, _parent, _maxInflation, _incrementBytesRead, incrementBytesRead_fn, _peekBytes, peekBytes_fn, _r2, _s2, _v2, _networkV, _privateKey, _options, _type, _to, _data3, _nonce, _gasLimit, _gasPrice, _maxPriorityFeePerGas, _maxFeePerGas, _value, _chainId, _sig, _accessList, _maxFeePerBlobGas, _blobVersionedHashes, _kzg, _blobs, _getSerialized, getSerialized_fn, _n2, _types, _fullTypes, _encoderCache, _getEncoder, getEncoder_fn, _o2, _offset2, _tokens, _subTokenString, subTokenString_fn, _p, _walkAsync, walkAsync_fn, _q, _getCoder, getCoder_fn, _throwUnsupported, throwUnsupported_fn, _signingKey, _data4, _checksum, _words, _loadWords, loadWords_fn, _account, account_fn, _fromSeed, fromSeed_fn, _offset3, _tokens2, _subTokenString2, subTokenString_fn2, _walkAsync2, walkAsync_fn2, _errors, _events, _functions, _abiCoder, _getFunction, getFunction_fn, _getEvent, getEvent_fn, _types2, _fullTypes2, _encoderCache2, _getEncoder2, getEncoder_fn2; +function _mergeNamespaces(n5, m3) { + for (var i2 = 0; i2 < m3.length; i2++) { + const e18 = m3[i2]; if (typeof e18 !== "string" && !Array.isArray(e18)) { for (const k2 in e18) { - if (k2 !== "default" && !(k2 in n4)) { + if (k2 !== "default" && !(k2 in n5)) { const d4 = Object.getOwnPropertyDescriptor(e18, k2); if (d4) { - Object.defineProperty(n4, k2, d4.get ? d4 : { + Object.defineProperty(n5, k2, d4.get ? d4 : { enumerable: true, get: () => e18[k2] }); @@ -52,7 +52,7 @@ function _mergeNamespaces(n4, m3) { } } } - return Object.freeze(Object.defineProperty(n4, Symbol.toStringTag, { value: "Module" })); + return Object.freeze(Object.defineProperty(n5, Symbol.toStringTag, { value: "Module" })); } (function polyfill() { const relList = document.createElement("link").relList; @@ -99,27 +99,27 @@ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof win function getDefaultExportFromCjs$1(x3) { return x3 && x3.__esModule && Object.prototype.hasOwnProperty.call(x3, "default") ? x3["default"] : x3; } -function getAugmentedNamespace(n4) { - if (n4.__esModule) - return n4; - var f3 = n4.default; - if (typeof f3 == "function") { +function getAugmentedNamespace(n5) { + if (n5.__esModule) + return n5; + var f4 = n5.default; + if (typeof f4 == "function") { var a3 = function a4() { if (this instanceof a4) { - return Reflect.construct(f3, arguments, this.constructor); + return Reflect.construct(f4, arguments, this.constructor); } - return f3.apply(this, arguments); + return f4.apply(this, arguments); }; - a3.prototype = f3.prototype; + a3.prototype = f4.prototype; } else a3 = {}; Object.defineProperty(a3, "__esModule", { value: true }); - Object.keys(n4).forEach(function(k2) { - var d4 = Object.getOwnPropertyDescriptor(n4, k2); + Object.keys(n5).forEach(function(k2) { + var d4 = Object.getOwnPropertyDescriptor(n5, k2); Object.defineProperty(a3, k2, d4.get ? d4 : { enumerable: true, get: function() { - return n4[k2]; + return n5[k2]; } }); }); @@ -189,9 +189,9 @@ function M$4(a3, b2, e18) { if (1 === g3) c2.children = e18; else if (1 < g3) { - for (var f3 = Array(g3), m3 = 0; m3 < g3; m3++) - f3[m3] = arguments[m3 + 2]; - c2.children = f3; + for (var f4 = Array(g3), m3 = 0; m3 < g3; m3++) + f4[m3] = arguments[m3 + 2]; + c2.children = f4; } if (a3 && a3.defaultProps) for (d4 in g3 = a3.defaultProps, g3) @@ -243,12 +243,12 @@ function R$4(a3, b2, e18, d4, c2) { if (I$4(a3)) for (var g3 = 0; g3 < a3.length; g3++) { k2 = a3[g3]; - var f3 = d4 + Q$5(k2, g3); - h4 += R$4(k2, b2, e18, f3, c2); + var f4 = d4 + Q$5(k2, g3); + h4 += R$4(k2, b2, e18, f4, c2); } - else if (f3 = A$4(a3), "function" === typeof f3) - for (a3 = f3.call(a3), g3 = 0; !(k2 = a3.next()).done; ) - k2 = k2.value, f3 = d4 + Q$5(k2, g3++), h4 += R$4(k2, b2, e18, f3, c2); + else if (f4 = A$4(a3), "function" === typeof f4) + for (a3 = f4.call(a3), g3 = 0; !(k2 = a3.next()).done; ) + k2 = k2.value, f4 = d4 + Q$5(k2, g3++), h4 += R$4(k2, b2, e18, f4, c2); else if ("object" === k2) throw b2 = String(a3), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b2 ? "object with keys {" + Object.keys(a3).join(", ") + "}" : b2) + "). If you meant to render a collection of children, use an array instead."); return h4; @@ -319,15 +319,15 @@ react_production_min.cloneElement = function(a3, b2, e18) { void 0 !== b2.key && (c2 = "" + b2.key); if (a3.type && a3.type.defaultProps) var g3 = a3.type.defaultProps; - for (f3 in b2) - J$1.call(b2, f3) && !L$4.hasOwnProperty(f3) && (d4[f3] = void 0 === b2[f3] && void 0 !== g3 ? g3[f3] : b2[f3]); + for (f4 in b2) + J$1.call(b2, f4) && !L$4.hasOwnProperty(f4) && (d4[f4] = void 0 === b2[f4] && void 0 !== g3 ? g3[f4] : b2[f4]); } - var f3 = arguments.length - 2; - if (1 === f3) + var f4 = arguments.length - 2; + if (1 === f4) d4.children = e18; - else if (1 < f3) { - g3 = Array(f3); - for (var m3 = 0; m3 < f3; m3++) + else if (1 < f4) { + g3 = Array(f4); + for (var m3 = 0; m3 < f4; m3++) g3[m3] = arguments[m3 + 2]; d4.children = g3; } @@ -461,7 +461,7 @@ var scheduler_production_min = {}; * LICENSE file in the root directory of this source tree. */ (function(exports) { - function f3(a3, b2) { + function f4(a3, b2) { var c2 = a3.length; a3.push(b2); a: @@ -484,11 +484,11 @@ var scheduler_production_min = {}; a3[0] = c2; a: for (var d4 = 0, e18 = a3.length, w2 = e18 >>> 1; d4 < w2; ) { - var m3 = 2 * (d4 + 1) - 1, C3 = a3[m3], n4 = m3 + 1, x3 = a3[n4]; + var m3 = 2 * (d4 + 1) - 1, C3 = a3[m3], n5 = m3 + 1, x3 = a3[n5]; if (0 > g3(C3, c2)) - n4 < e18 && 0 > g3(x3, C3) ? (a3[d4] = x3, a3[n4] = c2, d4 = n4) : (a3[d4] = C3, a3[m3] = c2, d4 = m3); - else if (n4 < e18 && 0 > g3(x3, c2)) - a3[d4] = x3, a3[n4] = c2, d4 = n4; + n5 < e18 && 0 > g3(x3, C3) ? (a3[d4] = x3, a3[n5] = c2, d4 = n5) : (a3[d4] = C3, a3[m3] = c2, d4 = m3); + else if (n5 < e18 && 0 > g3(x3, c2)) + a3[d4] = x3, a3[n5] = c2, d4 = n5; else break a; } @@ -517,7 +517,7 @@ var scheduler_production_min = {}; if (null === b2.callback) k2(t2); else if (b2.startTime <= a3) - k2(t2), b2.sortIndex = b2.expirationTime, f3(r2, b2); + k2(t2), b2.sortIndex = b2.expirationTime, f4(r2, b2); else break; b2 = h4(t2); @@ -690,7 +690,7 @@ var scheduler_production_min = {}; } e18 = c2 + e18; a3 = { id: u2++, callback: b2, priorityLevel: a3, startTime: c2, expirationTime: e18, sortIndex: -1 }; - c2 > d4 ? (a3.sortIndex = c2, f3(t2, a3), null === h4(r2) && a3 === h4(t2) && (B2 ? (E2(L4), L4 = -1) : B2 = true, K3(H2, c2 - d4))) : (a3.sortIndex = e18, f3(r2, a3), A2 || z3 || (A2 = true, I2(J2))); + c2 > d4 ? (a3.sortIndex = c2, f4(t2, a3), null === h4(r2) && a3 === h4(t2) && (B2 ? (E2(L4), L4 = -1) : B2 = true, K3(H2, c2 - d4))) : (a3.sortIndex = e18, f4(r2, a3), A2 || z3 || (A2 = true, I2(J2))); return a3; }; exports.unstable_shouldYield = M3; @@ -783,14 +783,14 @@ function qa$3(a3, b2, c2, d4) { } return false; } -function v$7(a3, b2, c2, d4, e18, f3, g3) { +function v$7(a3, b2, c2, d4, e18, f4, g3) { this.acceptsBooleans = 2 === b2 || 3 === b2 || 4 === b2; this.attributeName = d4; this.attributeNamespace = e18; this.mustUseProperty = c2; this.propertyName = a3; this.type = b2; - this.sanitizeURL = f3; + this.sanitizeURL = f4; this.removeEmptyString = g3; } var z$6 = {}; @@ -911,13 +911,13 @@ function Oa$3(a3, b2) { } } catch (l2) { if (l2 && d4 && "string" === typeof l2.stack) { - for (var e18 = l2.stack.split("\n"), f3 = d4.stack.split("\n"), g3 = e18.length - 1, h4 = f3.length - 1; 1 <= g3 && 0 <= h4 && e18[g3] !== f3[h4]; ) + for (var e18 = l2.stack.split("\n"), f4 = d4.stack.split("\n"), g3 = e18.length - 1, h4 = f4.length - 1; 1 <= g3 && 0 <= h4 && e18[g3] !== f4[h4]; ) h4--; for (; 1 <= g3 && 0 <= h4; g3--, h4--) - if (e18[g3] !== f3[h4]) { + if (e18[g3] !== f4[h4]) { if (1 !== g3 || 1 !== h4) { do - if (g3--, h4--, 0 > h4 || e18[g3] !== f3[h4]) { + if (g3--, h4--, 0 > h4 || e18[g3] !== f4[h4]) { var k2 = "\n" + e18[g3].replace(" at new ", " at "); a3.displayName && k2.includes("") && (k2 = k2.replace("", a3.displayName)); return k2; @@ -1070,12 +1070,12 @@ function Ta$3(a3) { function Ua$3(a3) { var b2 = Ta$3(a3) ? "checked" : "value", c2 = Object.getOwnPropertyDescriptor(a3.constructor.prototype, b2), d4 = "" + a3[b2]; if (!a3.hasOwnProperty(b2) && "undefined" !== typeof c2 && "function" === typeof c2.get && "function" === typeof c2.set) { - var e18 = c2.get, f3 = c2.set; + var e18 = c2.get, f4 = c2.set; Object.defineProperty(a3, b2, { configurable: true, get: function() { return e18.call(this); }, set: function(a4) { d4 = "" + a4; - f3.call(this, a4); + f4.call(this, a4); } }); Object.defineProperty(a3, b2, { enumerable: c2.enumerable }); return { getValue: function() { @@ -1443,7 +1443,7 @@ if (ia$2) } catch (a3) { Lb = false; } -function Nb(a3, b2, c2, d4, e18, f3, g3, h4, k2) { +function Nb(a3, b2, c2, d4, e18, f4, g3, h4, k2) { var l2 = Array.prototype.slice.call(arguments, 3); try { b2.apply(c2, l2); @@ -1455,12 +1455,12 @@ var Ob = false, Pb = null, Qb = false, Rb = null, Sb = { onError: function(a3) { Ob = true; Pb = a3; } }; -function Tb(a3, b2, c2, d4, e18, f3, g3, h4, k2) { +function Tb(a3, b2, c2, d4, e18, f4, g3, h4, k2) { Ob = false; Pb = null; Nb.apply(Sb, arguments); } -function Ub(a3, b2, c2, d4, e18, f3, g3, h4, k2) { +function Ub(a3, b2, c2, d4, e18, f4, g3, h4, k2) { Tb.apply(this, arguments); if (Ob) { if (Ob) { @@ -1510,8 +1510,8 @@ function Yb(a3) { var e18 = c2.return; if (null === e18) break; - var f3 = e18.alternate; - if (null === f3) { + var f4 = e18.alternate; + if (null === f4) { d4 = e18.return; if (null !== d4) { c2 = d4; @@ -1519,45 +1519,45 @@ function Yb(a3) { } break; } - if (e18.child === f3.child) { - for (f3 = e18.child; f3; ) { - if (f3 === c2) + if (e18.child === f4.child) { + for (f4 = e18.child; f4; ) { + if (f4 === c2) return Xb(e18), a3; - if (f3 === d4) + if (f4 === d4) return Xb(e18), b2; - f3 = f3.sibling; + f4 = f4.sibling; } throw Error(p$6(188)); } if (c2.return !== d4.return) - c2 = e18, d4 = f3; + c2 = e18, d4 = f4; else { for (var g3 = false, h4 = e18.child; h4; ) { if (h4 === c2) { g3 = true; c2 = e18; - d4 = f3; + d4 = f4; break; } if (h4 === d4) { g3 = true; d4 = e18; - c2 = f3; + c2 = f4; break; } h4 = h4.sibling; } if (!g3) { - for (h4 = f3.child; h4; ) { + for (h4 = f4.child; h4; ) { if (h4 === c2) { g3 = true; - c2 = f3; + c2 = f4; d4 = e18; break; } if (h4 === d4) { g3 = true; - d4 = f3; + d4 = f4; c2 = e18; break; } @@ -1656,15 +1656,15 @@ function uc(a3, b2) { var c2 = a3.pendingLanes; if (0 === c2) return 0; - var d4 = 0, e18 = a3.suspendedLanes, f3 = a3.pingedLanes, g3 = c2 & 268435455; + var d4 = 0, e18 = a3.suspendedLanes, f4 = a3.pingedLanes, g3 = c2 & 268435455; if (0 !== g3) { var h4 = g3 & ~e18; - 0 !== h4 ? d4 = tc(h4) : (f3 &= g3, 0 !== f3 && (d4 = tc(f3))); + 0 !== h4 ? d4 = tc(h4) : (f4 &= g3, 0 !== f4 && (d4 = tc(f4))); } else - g3 = c2 & ~e18, 0 !== g3 ? d4 = tc(g3) : 0 !== f3 && (d4 = tc(f3)); + g3 = c2 & ~e18, 0 !== g3 ? d4 = tc(g3) : 0 !== f4 && (d4 = tc(f4)); if (0 === d4) return 0; - if (0 !== b2 && b2 !== d4 && 0 === (b2 & e18) && (e18 = d4 & -d4, f3 = b2 & -b2, e18 >= f3 || 16 === e18 && 0 !== (f3 & 4194240))) + if (0 !== b2 && b2 !== d4 && 0 === (b2 & e18) && (e18 = d4 & -d4, f4 = b2 & -b2, e18 >= f4 || 16 === e18 && 0 !== (f4 & 4194240))) return b2; 0 !== (d4 & 4) && (d4 |= c2 & 16); b2 = a3.entangledLanes; @@ -1715,14 +1715,14 @@ function vc(a3, b2) { } } function wc(a3, b2) { - for (var c2 = a3.suspendedLanes, d4 = a3.pingedLanes, e18 = a3.expirationTimes, f3 = a3.pendingLanes; 0 < f3; ) { - var g3 = 31 - oc(f3), h4 = 1 << g3, k2 = e18[g3]; + for (var c2 = a3.suspendedLanes, d4 = a3.pingedLanes, e18 = a3.expirationTimes, f4 = a3.pendingLanes; 0 < f4; ) { + var g3 = 31 - oc(f4), h4 = 1 << g3, k2 = e18[g3]; if (-1 === k2) { if (0 === (h4 & c2) || 0 !== (h4 & d4)) e18[g3] = vc(h4, b2); } else k2 <= b2 && (a3.expiredLanes |= h4); - f3 &= ~h4; + f4 &= ~h4; } } function xc(a3) { @@ -1758,11 +1758,11 @@ function Bc(a3, b2) { b2 = a3.entanglements; var d4 = a3.eventTimes; for (a3 = a3.expirationTimes; 0 < c2; ) { - var e18 = 31 - oc(c2), f3 = 1 << e18; + var e18 = 31 - oc(c2), f4 = 1 << e18; b2[e18] = 0; d4[e18] = -1; a3[e18] = -1; - c2 &= ~f3; + c2 &= ~f4; } } function Cc(a3, b2) { @@ -1802,9 +1802,9 @@ function Sc(a3, b2) { Pc.delete(b2.pointerId); } } -function Tc(a3, b2, c2, d4, e18, f3) { - if (null === a3 || a3.nativeEvent !== f3) - return a3 = { blockedOn: b2, domEventName: c2, eventSystemFlags: d4, nativeEvent: f3, targetContainers: [e18] }, null !== b2 && (b2 = Cb(b2), null !== b2 && Fc(b2)), a3; +function Tc(a3, b2, c2, d4, e18, f4) { + if (null === a3 || a3.nativeEvent !== f4) + return a3 = { blockedOn: b2, domEventName: c2, eventSystemFlags: d4, nativeEvent: f4, targetContainers: [e18] }, null !== b2 && (b2 = Cb(b2), null !== b2 && Fc(b2)), a3; a3.eventSystemFlags |= d4; b2 = a3.targetContainers; null !== e18 && -1 === b2.indexOf(e18) && b2.push(e18); @@ -1819,11 +1819,11 @@ function Uc(a3, b2, c2, d4, e18) { case "mouseover": return Nc = Tc(Nc, a3, b2, c2, d4, e18), true; case "pointerover": - var f3 = e18.pointerId; - Oc.set(f3, Tc(Oc.get(f3) || null, a3, b2, c2, d4, e18)); + var f4 = e18.pointerId; + Oc.set(f4, Tc(Oc.get(f4) || null, a3, b2, c2, d4, e18)); return true; case "gotpointercapture": - return f3 = e18.pointerId, Pc.set(f3, Tc(Pc.get(f3) || null, a3, b2, c2, d4, e18)), true; + return f4 = e18.pointerId, Pc.set(f4, Tc(Pc.get(f4) || null, a3, b2, c2, d4, e18)), true; } return false; } @@ -1902,21 +1902,21 @@ function bd(a3) { } var cd = ua$2.ReactCurrentBatchConfig, dd = true; function ed$1(a3, b2, c2, d4) { - var e18 = C$4, f3 = cd.transition; + var e18 = C$4, f4 = cd.transition; cd.transition = null; try { C$4 = 1, fd(a3, b2, c2, d4); } finally { - C$4 = e18, cd.transition = f3; + C$4 = e18, cd.transition = f4; } } function gd(a3, b2, c2, d4) { - var e18 = C$4, f3 = cd.transition; + var e18 = C$4, f4 = cd.transition; cd.transition = null; try { C$4 = 4, fd(a3, b2, c2, d4); } finally { - C$4 = e18, cd.transition = f3; + C$4 = e18, cd.transition = f4; } } function fd(a3, b2, c2, d4) { @@ -1928,13 +1928,13 @@ function fd(a3, b2, c2, d4) { d4.stopPropagation(); else if (Sc(a3, d4), b2 & 4 && -1 < Rc.indexOf(a3)) { for (; null !== e18; ) { - var f3 = Cb(e18); - null !== f3 && Ec(f3); - f3 = Yc(a3, b2, c2, d4); - null === f3 && hd(a3, b2, d4, id$1, c2); - if (f3 === e18) + var f4 = Cb(e18); + null !== f4 && Ec(f4); + f4 = Yc(a3, b2, c2, d4); + null === f4 && hd(a3, b2, d4, id$1, c2); + if (f4 === e18) break; - e18 = f3; + e18 = f4; } null !== e18 && d4.stopPropagation(); } else @@ -2059,11 +2059,11 @@ var kd = null, ld = null, md = null; function nd() { if (md) return md; - var a3, b2 = ld, c2 = b2.length, d4, e18 = "value" in kd ? kd.value : kd.textContent, f3 = e18.length; + var a3, b2 = ld, c2 = b2.length, d4, e18 = "value" in kd ? kd.value : kd.textContent, f4 = e18.length; for (a3 = 0; a3 < c2 && b2[a3] === e18[a3]; a3++) ; var g3 = c2 - a3; - for (d4 = 1; d4 <= g3 && b2[c2 - d4] === e18[f3 - d4]; d4++) + for (d4 = 1; d4 <= g3 && b2[c2 - d4] === e18[f4 - d4]; d4++) ; return md = e18.slice(a3, 1 < d4 ? 1 - d4 : void 0); } @@ -2080,16 +2080,16 @@ function qd() { return false; } function rd$1(a3) { - function b2(b3, d4, e18, f3, g3) { + function b2(b3, d4, e18, f4, g3) { this._reactName = b3; this._targetInst = e18; this.type = d4; - this.nativeEvent = f3; + this.nativeEvent = f4; this.target = g3; this.currentTarget = null; for (var c2 in a3) - a3.hasOwnProperty(c2) && (b3 = a3[c2], this[c2] = b3 ? b3(f3) : f3[c2]); - this.isDefaultPrevented = (null != f3.defaultPrevented ? f3.defaultPrevented : false === f3.returnValue) ? pd : qd; + a3.hasOwnProperty(c2) && (b3 = a3[c2], this[c2] = b3 ? b3(f4) : f4[c2]); + this.isDefaultPrevented = (null != f4.defaultPrevented ? f4.defaultPrevented : false === f4.returnValue) ? pd : qd; this.isPropagationStopped = qd; return this; } @@ -2394,15 +2394,15 @@ function Oe$1(a3) { c2.selectionStart = b2, c2.selectionEnd = Math.min(a3, c2.value.length); else if (a3 = (b2 = c2.ownerDocument || document) && b2.defaultView || window, a3.getSelection) { a3 = a3.getSelection(); - var e18 = c2.textContent.length, f3 = Math.min(d4.start, e18); - d4 = void 0 === d4.end ? f3 : Math.min(d4.end, e18); - !a3.extend && f3 > d4 && (e18 = d4, d4 = f3, f3 = e18); - e18 = Ke(c2, f3); + var e18 = c2.textContent.length, f4 = Math.min(d4.start, e18); + d4 = void 0 === d4.end ? f4 : Math.min(d4.end, e18); + !a3.extend && f4 > d4 && (e18 = d4, d4 = f4, f4 = e18); + e18 = Ke(c2, f4); var g3 = Ke( c2, d4 ); - e18 && g3 && (1 !== a3.rangeCount || a3.anchorNode !== e18.node || a3.anchorOffset !== e18.offset || a3.focusNode !== g3.node || a3.focusOffset !== g3.offset) && (b2 = b2.createRange(), b2.setStart(e18.node, e18.offset), a3.removeAllRanges(), f3 > d4 ? (a3.addRange(b2), a3.extend(g3.node, g3.offset)) : (b2.setEnd(g3.node, g3.offset), a3.addRange(b2))); + e18 && g3 && (1 !== a3.rangeCount || a3.anchorNode !== e18.node || a3.anchorOffset !== e18.offset || a3.focusNode !== g3.node || a3.focusOffset !== g3.offset) && (b2 = b2.createRange(), b2.setStart(e18.node, e18.offset), a3.removeAllRanges(), f4 > d4 ? (a3.addRange(b2), a3.extend(g3.node, g3.offset)) : (b2.setEnd(g3.node, g3.offset), a3.addRange(b2))); } } b2 = []; @@ -2477,15 +2477,15 @@ function se$2(a3, b2) { var d4 = a3[c2], e18 = d4.event; d4 = d4.listeners; a: { - var f3 = void 0; + var f4 = void 0; if (b2) for (var g3 = d4.length - 1; 0 <= g3; g3--) { var h4 = d4[g3], k2 = h4.instance, l2 = h4.currentTarget; h4 = h4.listener; - if (k2 !== f3 && e18.isPropagationStopped()) + if (k2 !== f4 && e18.isPropagationStopped()) break a; nf$2(e18, h4, l2); - f3 = k2; + f4 = k2; } else for (g3 = 0; g3 < d4.length; g3++) { @@ -2493,10 +2493,10 @@ function se$2(a3, b2) { k2 = h4.instance; l2 = h4.currentTarget; h4 = h4.listener; - if (k2 !== f3 && e18.isPropagationStopped()) + if (k2 !== f4 && e18.isPropagationStopped()) break a; nf$2(e18, h4, l2); - f3 = k2; + f4 = k2; } } } @@ -2542,7 +2542,7 @@ function pf$2(a3, b2, c2, d4) { d4 ? void 0 !== e18 ? a3.addEventListener(b2, c2, { capture: true, passive: e18 }) : a3.addEventListener(b2, c2, true) : void 0 !== e18 ? a3.addEventListener(b2, c2, { passive: e18 }) : a3.addEventListener(b2, c2, false); } function hd(a3, b2, c2, d4, e18) { - var f3 = d4; + var f4 = d4; if (0 === (b2 & 1) && 0 === (b2 & 2) && null !== d4) a: for (; ; ) { @@ -2568,7 +2568,7 @@ function hd(a3, b2, c2, d4, e18) { return; k2 = g3.tag; if (5 === k2 || 6 === k2) { - d4 = f3 = g3; + d4 = f4 = g3; continue a; } h4 = h4.parentNode; @@ -2577,11 +2577,11 @@ function hd(a3, b2, c2, d4, e18) { d4 = d4.return; } Jb(function() { - var d5 = f3, e19 = xb(c2), g4 = []; + var d5 = f4, e19 = xb(c2), g4 = []; a: { var h5 = df$2.get(a3); if (void 0 !== h5) { - var k3 = td, n4 = a3; + var k3 = td, n5 = a3; switch (a3) { case "keypress": if (0 === od(c2)) @@ -2591,11 +2591,11 @@ function hd(a3, b2, c2, d4, e18) { k3 = Rd; break; case "focusin": - n4 = "focus"; + n5 = "focus"; k3 = Fd; break; case "focusout": - n4 = "blur"; + n5 = "blur"; k3 = Fd; break; case "beforeblur": @@ -2670,23 +2670,23 @@ function hd(a3, b2, c2, d4, e18) { break; w2 = w2.return; } - 0 < t2.length && (h5 = new k3(h5, n4, null, c2, e19), g4.push({ event: h5, listeners: t2 })); + 0 < t2.length && (h5 = new k3(h5, n5, null, c2, e19), g4.push({ event: h5, listeners: t2 })); } } if (0 === (b2 & 7)) { a: { h5 = "mouseover" === a3 || "pointerover" === a3; k3 = "mouseout" === a3 || "pointerout" === a3; - if (h5 && c2 !== wb && (n4 = c2.relatedTarget || c2.fromElement) && (Wc(n4) || n4[uf$1])) + if (h5 && c2 !== wb && (n5 = c2.relatedTarget || c2.fromElement) && (Wc(n5) || n5[uf$1])) break a; if (k3 || h5) { h5 = e19.window === e19 ? e19 : (h5 = e19.ownerDocument) ? h5.defaultView || h5.parentWindow : window; if (k3) { - if (n4 = c2.relatedTarget || c2.toElement, k3 = d5, n4 = n4 ? Wc(n4) : null, null !== n4 && (J2 = Vb(n4), n4 !== J2 || 5 !== n4.tag && 6 !== n4.tag)) - n4 = null; + if (n5 = c2.relatedTarget || c2.toElement, k3 = d5, n5 = n5 ? Wc(n5) : null, null !== n5 && (J2 = Vb(n5), n5 !== J2 || 5 !== n5.tag && 6 !== n5.tag)) + n5 = null; } else - k3 = null, n4 = d5; - if (k3 !== n4) { + k3 = null, n5 = d5; + if (k3 !== n5) { t2 = Bd; F2 = "onMouseLeave"; x3 = "onMouseEnter"; @@ -2694,17 +2694,17 @@ function hd(a3, b2, c2, d4, e18) { if ("pointerout" === a3 || "pointerover" === a3) t2 = Td, F2 = "onPointerLeave", x3 = "onPointerEnter", w2 = "pointer"; J2 = null == k3 ? h5 : ue$2(k3); - u2 = null == n4 ? h5 : ue$2(n4); + u2 = null == n5 ? h5 : ue$2(n5); h5 = new t2(F2, w2 + "leave", k3, c2, e19); h5.target = J2; h5.relatedTarget = u2; F2 = null; - Wc(e19) === d5 && (t2 = new t2(x3, w2 + "enter", n4, c2, e19), t2.target = u2, t2.relatedTarget = J2, F2 = t2); + Wc(e19) === d5 && (t2 = new t2(x3, w2 + "enter", n5, c2, e19), t2.target = u2, t2.relatedTarget = J2, F2 = t2); J2 = F2; - if (k3 && n4) + if (k3 && n5) b: { t2 = k3; - x3 = n4; + x3 = n5; w2 = 0; for (u2 = t2; u2; u2 = vf$2(u2)) w2++; @@ -2726,7 +2726,7 @@ function hd(a3, b2, c2, d4, e18) { else t2 = null; null !== k3 && wf$2(g4, h5, k3, t2, false); - null !== n4 && null !== J2 && wf$2(g4, J2, n4, t2, true); + null !== n5 && null !== J2 && wf$2(g4, J2, n5, t2, true); } } } @@ -2806,8 +2806,8 @@ function tf$1(a3, b2, c2) { } function oe$4(a3, b2) { for (var c2 = b2 + "Capture", d4 = []; null !== a3; ) { - var e18 = a3, f3 = e18.stateNode; - 5 === e18.tag && null !== f3 && (e18 = f3, f3 = Kb(a3, c2), null != f3 && d4.unshift(tf$1(a3, f3, e18)), f3 = Kb(a3, b2), null != f3 && d4.push(tf$1(a3, f3, e18))); + var e18 = a3, f4 = e18.stateNode; + 5 === e18.tag && null !== f4 && (e18 = f4, f4 = Kb(a3, c2), null != f4 && d4.unshift(tf$1(a3, f4, e18)), f4 = Kb(a3, b2), null != f4 && d4.push(tf$1(a3, f4, e18))); a3 = a3.return; } return d4; @@ -2821,11 +2821,11 @@ function vf$2(a3) { return a3 ? a3 : null; } function wf$2(a3, b2, c2, d4, e18) { - for (var f3 = b2._reactName, g3 = []; null !== c2 && c2 !== d4; ) { + for (var f4 = b2._reactName, g3 = []; null !== c2 && c2 !== d4; ) { var h4 = c2, k2 = h4.alternate, l2 = h4.stateNode; if (null !== k2 && k2 === d4) break; - 5 === h4.tag && null !== l2 && (h4 = l2, e18 ? (k2 = Kb(c2, f3), null != k2 && g3.unshift(tf$1(c2, k2, h4))) : e18 || (k2 = Kb(c2, f3), null != k2 && g3.push(tf$1(c2, k2, h4)))); + 5 === h4.tag && null !== l2 && (h4 = l2, e18 ? (k2 = Kb(c2, f4), null != k2 && g3.unshift(tf$1(c2, k2, h4))) : e18 || (k2 = Kb(c2, f4), null != k2 && g3.push(tf$1(c2, k2, h4)))); c2 = c2.return; } 0 !== g3.length && a3.push({ event: b2, listeners: g3 }); @@ -2956,9 +2956,9 @@ function Yf$1(a3, b2) { var d4 = a3.stateNode; if (d4 && d4.__reactInternalMemoizedUnmaskedChildContext === b2) return d4.__reactInternalMemoizedMaskedChildContext; - var e18 = {}, f3; - for (f3 in c2) - e18[f3] = b2[f3]; + var e18 = {}, f4; + for (f4 in c2) + e18[f4] = b2[f4]; d4 && (a3 = a3.stateNode, a3.__reactInternalMemoizedUnmaskedChildContext = b2, a3.__reactInternalMemoizedMaskedChildContext = e18); return e18; } @@ -3048,16 +3048,16 @@ function ug(a3, b2, c2) { var e18 = 32 - oc(d4) - 1; d4 &= ~(1 << e18); c2 += 1; - var f3 = 32 - oc(b2) + e18; - if (30 < f3) { + var f4 = 32 - oc(b2) + e18; + if (30 < f4) { var g3 = e18 - e18 % 5; - f3 = (d4 & (1 << g3) - 1).toString(32); + f4 = (d4 & (1 << g3) - 1).toString(32); d4 >>= g3; e18 -= g3; rg = 1 << 32 - oc(b2) + e18 | c2 << e18 | d4; - sg = f3 + a3; + sg = f4 + a3; } else - rg = 1 << f3 | c2 << e18 | d4, sg = a3; + rg = 1 << f4 | c2 << e18 | d4, sg = a3; } function vg(a3) { null !== a3.return && (tg(a3, 1), ug(a3, 1, 0)); @@ -3185,14 +3185,14 @@ function Lg(a3, b2, c2) { } if (!d4) throw Error(p$6(147, a3)); - var e18 = d4, f3 = "" + a3; - if (null !== b2 && null !== b2.ref && "function" === typeof b2.ref && b2.ref._stringRef === f3) + var e18 = d4, f4 = "" + a3; + if (null !== b2 && null !== b2.ref && "function" === typeof b2.ref && b2.ref._stringRef === f4) return b2.ref; b2 = function(a4) { var b3 = e18.refs; - null === a4 ? delete b3[f3] : b3[f3] = a4; + null === a4 ? delete b3[f4] : b3[f4] = a4; }; - b2._stringRef = f3; + b2._stringRef = f4; return b2; } if ("string" !== typeof a3) @@ -3235,7 +3235,7 @@ function Og(a3) { a4.sibling = null; return a4; } - function f3(b3, c3, d5) { + function f4(b3, c3, d5) { b3.index = d5; if (!a3) return b3.flags |= 1048576, c3; @@ -3257,10 +3257,10 @@ function Og(a3) { return b3; } function k2(a4, b3, c3, d5) { - var f4 = c3.type; - if (f4 === ya$3) + var f5 = c3.type; + if (f5 === ya$3) return m3(a4, b3, c3.props.children, d5, c3.key); - if (null !== b3 && (b3.elementType === f4 || "object" === typeof f4 && null !== f4 && f4.$$typeof === Ha$3 && Ng(f4) === b3.type)) + if (null !== b3 && (b3.elementType === f5 || "object" === typeof f5 && null !== f5 && f5.$$typeof === Ha$3 && Ng(f5) === b3.type)) return d5 = e18(b3, c3.props), d5.ref = Lg(a4, b3, c3), d5.return = a4, d5; d5 = Rg(c3.type, c3.key, c3.props, null, a4.mode, d5); d5.ref = Lg(a4, b3, c3); @@ -3274,9 +3274,9 @@ function Og(a3) { b3.return = a4; return b3; } - function m3(a4, b3, c3, d5, f4) { + function m3(a4, b3, c3, d5, f5) { if (null === b3 || 7 !== b3.tag) - return b3 = Tg(c3, a4.mode, d5, f4), b3.return = a4, b3; + return b3 = Tg(c3, a4.mode, d5, f5), b3.return = a4, b3; b3 = e18(b3, c3); b3.return = a4; return b3; @@ -3334,8 +3334,8 @@ function Og(a3) { case wa$2: return a4 = a4.get(null === d5.key ? c3 : d5.key) || null, l2(b3, a4, d5, e19); case Ha$3: - var f4 = d5._init; - return y3(a4, b3, c3, f4(d5._payload), e19); + var f5 = d5._init; + return y3(a4, b3, c3, f5(d5._payload), e19); } if (eb$1(d5) || Ka$2(d5)) return a4 = a4.get(c3) || null, m3(b3, a4, d5, e19, null); @@ -3343,30 +3343,30 @@ function Og(a3) { } return null; } - function n4(e19, g4, h5, k3) { + function n5(e19, g4, h5, k3) { for (var l3 = null, m4 = null, u2 = g4, w2 = g4 = 0, x3 = null; null !== u2 && w2 < h5.length; w2++) { u2.index > w2 ? (x3 = u2, u2 = null) : x3 = u2.sibling; - var n5 = r2(e19, u2, h5[w2], k3); - if (null === n5) { + var n6 = r2(e19, u2, h5[w2], k3); + if (null === n6) { null === u2 && (u2 = x3); break; } - a3 && u2 && null === n5.alternate && b2(e19, u2); - g4 = f3(n5, g4, w2); - null === m4 ? l3 = n5 : m4.sibling = n5; - m4 = n5; + a3 && u2 && null === n6.alternate && b2(e19, u2); + g4 = f4(n6, g4, w2); + null === m4 ? l3 = n6 : m4.sibling = n6; + m4 = n6; u2 = x3; } if (w2 === h5.length) return c2(e19, u2), I$3 && tg(e19, w2), l3; if (null === u2) { for (; w2 < h5.length; w2++) - u2 = q2(e19, h5[w2], k3), null !== u2 && (g4 = f3(u2, g4, w2), null === m4 ? l3 = u2 : m4.sibling = u2, m4 = u2); + u2 = q2(e19, h5[w2], k3), null !== u2 && (g4 = f4(u2, g4, w2), null === m4 ? l3 = u2 : m4.sibling = u2, m4 = u2); I$3 && tg(e19, w2); return l3; } for (u2 = d4(e19, u2); w2 < h5.length; w2++) - x3 = y3(u2, e19, w2, h5[w2], k3), null !== x3 && (a3 && null !== x3.alternate && u2.delete(null === x3.key ? w2 : x3.key), g4 = f3(x3, g4, w2), null === m4 ? l3 = x3 : m4.sibling = x3, m4 = x3); + x3 = y3(u2, e19, w2, h5[w2], k3), null !== x3 && (a3 && null !== x3.alternate && u2.delete(null === x3.key ? w2 : x3.key), g4 = f4(x3, g4, w2), null === m4 ? l3 = x3 : m4.sibling = x3, m4 = x3); a3 && u2.forEach(function(a4) { return b2(e19, a4); }); @@ -3380,59 +3380,59 @@ function Og(a3) { h5 = l3.call(h5); if (null == h5) throw Error(p$6(151)); - for (var u2 = l3 = null, m4 = g4, w2 = g4 = 0, x3 = null, n5 = h5.next(); null !== m4 && !n5.done; w2++, n5 = h5.next()) { + for (var u2 = l3 = null, m4 = g4, w2 = g4 = 0, x3 = null, n6 = h5.next(); null !== m4 && !n6.done; w2++, n6 = h5.next()) { m4.index > w2 ? (x3 = m4, m4 = null) : x3 = m4.sibling; - var t3 = r2(e19, m4, n5.value, k3); + var t3 = r2(e19, m4, n6.value, k3); if (null === t3) { null === m4 && (m4 = x3); break; } a3 && m4 && null === t3.alternate && b2(e19, m4); - g4 = f3(t3, g4, w2); + g4 = f4(t3, g4, w2); null === u2 ? l3 = t3 : u2.sibling = t3; u2 = t3; m4 = x3; } - if (n5.done) + if (n6.done) return c2( e19, m4 ), I$3 && tg(e19, w2), l3; if (null === m4) { - for (; !n5.done; w2++, n5 = h5.next()) - n5 = q2(e19, n5.value, k3), null !== n5 && (g4 = f3(n5, g4, w2), null === u2 ? l3 = n5 : u2.sibling = n5, u2 = n5); + for (; !n6.done; w2++, n6 = h5.next()) + n6 = q2(e19, n6.value, k3), null !== n6 && (g4 = f4(n6, g4, w2), null === u2 ? l3 = n6 : u2.sibling = n6, u2 = n6); I$3 && tg(e19, w2); return l3; } - for (m4 = d4(e19, m4); !n5.done; w2++, n5 = h5.next()) - n5 = y3(m4, e19, w2, n5.value, k3), null !== n5 && (a3 && null !== n5.alternate && m4.delete(null === n5.key ? w2 : n5.key), g4 = f3(n5, g4, w2), null === u2 ? l3 = n5 : u2.sibling = n5, u2 = n5); + for (m4 = d4(e19, m4); !n6.done; w2++, n6 = h5.next()) + n6 = y3(m4, e19, w2, n6.value, k3), null !== n6 && (a3 && null !== n6.alternate && m4.delete(null === n6.key ? w2 : n6.key), g4 = f4(n6, g4, w2), null === u2 ? l3 = n6 : u2.sibling = n6, u2 = n6); a3 && m4.forEach(function(a4) { return b2(e19, a4); }); I$3 && tg(e19, w2); return l3; } - function J2(a4, d5, f4, h5) { - "object" === typeof f4 && null !== f4 && f4.type === ya$3 && null === f4.key && (f4 = f4.props.children); - if ("object" === typeof f4 && null !== f4) { - switch (f4.$$typeof) { + function J2(a4, d5, f5, h5) { + "object" === typeof f5 && null !== f5 && f5.type === ya$3 && null === f5.key && (f5 = f5.props.children); + if ("object" === typeof f5 && null !== f5) { + switch (f5.$$typeof) { case va$2: a: { - for (var k3 = f4.key, l3 = d5; null !== l3; ) { + for (var k3 = f5.key, l3 = d5; null !== l3; ) { if (l3.key === k3) { - k3 = f4.type; + k3 = f5.type; if (k3 === ya$3) { if (7 === l3.tag) { c2(a4, l3.sibling); - d5 = e18(l3, f4.props.children); + d5 = e18(l3, f5.props.children); d5.return = a4; a4 = d5; break a; } } else if (l3.elementType === k3 || "object" === typeof k3 && null !== k3 && k3.$$typeof === Ha$3 && Ng(k3) === l3.type) { c2(a4, l3.sibling); - d5 = e18(l3, f4.props); - d5.ref = Lg(a4, l3, f4); + d5 = e18(l3, f5.props); + d5.ref = Lg(a4, l3, f5); d5.return = a4; a4 = d5; break a; @@ -3443,16 +3443,16 @@ function Og(a3) { b2(a4, l3); l3 = l3.sibling; } - f4.type === ya$3 ? (d5 = Tg(f4.props.children, a4.mode, h5, f4.key), d5.return = a4, a4 = d5) : (h5 = Rg(f4.type, f4.key, f4.props, null, a4.mode, h5), h5.ref = Lg(a4, d5, f4), h5.return = a4, a4 = h5); + f5.type === ya$3 ? (d5 = Tg(f5.props.children, a4.mode, h5, f5.key), d5.return = a4, a4 = d5) : (h5 = Rg(f5.type, f5.key, f5.props, null, a4.mode, h5), h5.ref = Lg(a4, d5, f5), h5.return = a4, a4 = h5); } return g3(a4); case wa$2: a: { - for (l3 = f4.key; null !== d5; ) { + for (l3 = f5.key; null !== d5; ) { if (d5.key === l3) - if (4 === d5.tag && d5.stateNode.containerInfo === f4.containerInfo && d5.stateNode.implementation === f4.implementation) { + if (4 === d5.tag && d5.stateNode.containerInfo === f5.containerInfo && d5.stateNode.implementation === f5.implementation) { c2(a4, d5.sibling); - d5 = e18(d5, f4.children || []); + d5 = e18(d5, f5.children || []); d5.return = a4; a4 = d5; break a; @@ -3464,21 +3464,21 @@ function Og(a3) { b2(a4, d5); d5 = d5.sibling; } - d5 = Sg(f4, a4.mode, h5); + d5 = Sg(f5, a4.mode, h5); d5.return = a4; a4 = d5; } return g3(a4); case Ha$3: - return l3 = f4._init, J2(a4, d5, l3(f4._payload), h5); + return l3 = f5._init, J2(a4, d5, l3(f5._payload), h5); } - if (eb$1(f4)) - return n4(a4, d5, f4, h5); - if (Ka$2(f4)) - return t2(a4, d5, f4, h5); - Mg$1(a4, f4); + if (eb$1(f5)) + return n5(a4, d5, f5, h5); + if (Ka$2(f5)) + return t2(a4, d5, f5, h5); + Mg$1(a4, f5); } - return "string" === typeof f4 && "" !== f4 || "number" === typeof f4 ? (f4 = "" + f4, null !== d5 && 6 === d5.tag ? (c2(a4, d5.sibling), d5 = e18(d5, f4), d5.return = a4, a4 = d5) : (c2(a4, d5), d5 = Qg$1(f4, a4.mode, h5), d5.return = a4, a4 = d5), g3(a4)) : c2(a4, d5); + return "string" === typeof f5 && "" !== f5 || "number" === typeof f5 ? (f5 = "" + f5, null !== d5 && 6 === d5.tag ? (c2(a4, d5.sibling), d5 = e18(d5, f5), d5.return = a4, a4 = d5) : (c2(a4, d5), d5 = Qg$1(f5, a4.mode, h5), d5.return = a4, a4 = d5), g3(a4)) : c2(a4, d5); } return J2; } @@ -3577,18 +3577,18 @@ function oh(a3, b2, c2) { function ph$1(a3, b2) { var c2 = a3.updateQueue, d4 = a3.alternate; if (null !== d4 && (d4 = d4.updateQueue, c2 === d4)) { - var e18 = null, f3 = null; + var e18 = null, f4 = null; c2 = c2.firstBaseUpdate; if (null !== c2) { do { var g3 = { eventTime: c2.eventTime, lane: c2.lane, tag: c2.tag, payload: c2.payload, callback: c2.callback, next: null }; - null === f3 ? e18 = f3 = g3 : f3 = f3.next = g3; + null === f4 ? e18 = f4 = g3 : f4 = f4.next = g3; c2 = c2.next; } while (null !== c2); - null === f3 ? e18 = f3 = b2 : f3 = f3.next = b2; + null === f4 ? e18 = f4 = b2 : f4 = f4.next = b2; } else - e18 = f3 = b2; - c2 = { baseState: d4.baseState, firstBaseUpdate: e18, lastBaseUpdate: f3, shared: d4.shared, effects: d4.effects }; + e18 = f4 = b2; + c2 = { baseState: d4.baseState, firstBaseUpdate: e18, lastBaseUpdate: f4, shared: d4.shared, effects: d4.effects }; a3.updateQueue = c2; return; } @@ -3599,21 +3599,21 @@ function ph$1(a3, b2) { function qh(a3, b2, c2, d4) { var e18 = a3.updateQueue; jh = false; - var f3 = e18.firstBaseUpdate, g3 = e18.lastBaseUpdate, h4 = e18.shared.pending; + var f4 = e18.firstBaseUpdate, g3 = e18.lastBaseUpdate, h4 = e18.shared.pending; if (null !== h4) { e18.shared.pending = null; var k2 = h4, l2 = k2.next; k2.next = null; - null === g3 ? f3 = l2 : g3.next = l2; + null === g3 ? f4 = l2 : g3.next = l2; g3 = k2; var m3 = a3.alternate; null !== m3 && (m3 = m3.updateQueue, h4 = m3.lastBaseUpdate, h4 !== g3 && (null === h4 ? m3.firstBaseUpdate = l2 : h4.next = l2, m3.lastBaseUpdate = k2)); } - if (null !== f3) { + if (null !== f4) { var q2 = e18.baseState; g3 = 0; m3 = l2 = k2 = null; - h4 = f3; + h4 = f4; do { var r2 = h4.lane, y3 = h4.eventTime; if ((d4 & r2) === r2) { @@ -3626,23 +3626,23 @@ function qh(a3, b2, c2, d4) { next: null }); a: { - var n4 = a3, t2 = h4; + var n5 = a3, t2 = h4; r2 = b2; y3 = c2; switch (t2.tag) { case 1: - n4 = t2.payload; - if ("function" === typeof n4) { - q2 = n4.call(y3, q2, r2); + n5 = t2.payload; + if ("function" === typeof n5) { + q2 = n5.call(y3, q2, r2); break a; } - q2 = n4; + q2 = n5; break a; case 3: - n4.flags = n4.flags & -65537 | 128; + n5.flags = n5.flags & -65537 | 128; case 0: - n4 = t2.payload; - r2 = "function" === typeof n4 ? n4.call(y3, q2, r2) : n4; + n5 = t2.payload; + r2 = "function" === typeof n5 ? n5.call(y3, q2, r2) : n5; if (null === r2 || void 0 === r2) break a; q2 = A$3({}, q2, r2); @@ -3672,7 +3672,7 @@ function qh(a3, b2, c2, d4) { g3 |= e18.lane, e18 = e18.next; while (e18 !== b2); } else - null === f3 && (e18.shared.lanes = 0); + null === f4 && (e18.shared.lanes = 0); rh$2 |= g3; a3.lanes = g3; a3.memoizedState = q2; @@ -3774,8 +3774,8 @@ function Mh$1(a3, b2) { return false; return true; } -function Nh$1(a3, b2, c2, d4, e18, f3) { - Hh = f3; +function Nh$1(a3, b2, c2, d4, e18, f4) { + Hh = f4; M$3 = b2; b2.memoizedState = null; b2.updateQueue = null; @@ -3783,13 +3783,13 @@ function Nh$1(a3, b2, c2, d4, e18, f3) { Fh.current = null === a3 || null === a3.memoizedState ? Oh : Ph; a3 = c2(d4, e18); if (Jh) { - f3 = 0; + f4 = 0; do { Jh = false; Kh$1 = 0; - if (25 <= f3) + if (25 <= f4) throw Error(p$6(301)); - f3 += 1; + f4 += 1; O$6 = N$3 = null; b2.updateQueue = null; Fh.current = Qh; @@ -3841,20 +3841,20 @@ function Wh(a3) { if (null === c2) throw Error(p$6(311)); c2.lastRenderedReducer = a3; - var d4 = N$3, e18 = d4.baseQueue, f3 = c2.pending; - if (null !== f3) { + var d4 = N$3, e18 = d4.baseQueue, f4 = c2.pending; + if (null !== f4) { if (null !== e18) { var g3 = e18.next; - e18.next = f3.next; - f3.next = g3; + e18.next = f4.next; + f4.next = g3; } - d4.baseQueue = e18 = f3; + d4.baseQueue = e18 = f4; c2.pending = null; } if (null !== e18) { - f3 = e18.next; + f4 = e18.next; d4 = d4.baseState; - var h4 = g3 = null, k2 = null, l2 = f3; + var h4 = g3 = null, k2 = null, l2 = f4; do { var m3 = l2.lane; if ((Hh & m3) === m3) @@ -3872,7 +3872,7 @@ function Wh(a3) { rh$2 |= m3; } l2 = l2.next; - } while (null !== l2 && l2 !== f3); + } while (null !== l2 && l2 !== f4); null === k2 ? g3 = d4 : k2.next = h4; He(d4, b2.memoizedState) || (dh$1 = true); b2.memoizedState = d4; @@ -3884,7 +3884,7 @@ function Wh(a3) { if (null !== a3) { e18 = a3; do - f3 = e18.lane, M$3.lanes |= f3, rh$2 |= f3, e18 = e18.next; + f4 = e18.lane, M$3.lanes |= f4, rh$2 |= f4, e18 = e18.next; while (e18 !== a3); } else null === e18 && (c2.lanes = 0); @@ -3895,28 +3895,28 @@ function Xh(a3) { if (null === c2) throw Error(p$6(311)); c2.lastRenderedReducer = a3; - var d4 = c2.dispatch, e18 = c2.pending, f3 = b2.memoizedState; + var d4 = c2.dispatch, e18 = c2.pending, f4 = b2.memoizedState; if (null !== e18) { c2.pending = null; var g3 = e18 = e18.next; do - f3 = a3(f3, g3.action), g3 = g3.next; + f4 = a3(f4, g3.action), g3 = g3.next; while (g3 !== e18); - He(f3, b2.memoizedState) || (dh$1 = true); - b2.memoizedState = f3; - null === b2.baseQueue && (b2.baseState = f3); - c2.lastRenderedState = f3; + He(f4, b2.memoizedState) || (dh$1 = true); + b2.memoizedState = f4; + null === b2.baseQueue && (b2.baseState = f4); + c2.lastRenderedState = f4; } - return [f3, d4]; + return [f4, d4]; } function Yh() { } function Zh(a3, b2) { - var c2 = M$3, d4 = Uh(), e18 = b2(), f3 = !He(d4.memoizedState, e18); - f3 && (d4.memoizedState = e18, dh$1 = true); + var c2 = M$3, d4 = Uh(), e18 = b2(), f4 = !He(d4.memoizedState, e18); + f4 && (d4.memoizedState = e18, dh$1 = true); d4 = d4.queue; $h(ai$1.bind(null, c2, d4, a3), [a3]); - if (d4.getSnapshot !== b2 || f3 || null !== O$6 && O$6.memoizedState.tag & 1) { + if (d4.getSnapshot !== b2 || f4 || null !== O$6 && O$6.memoizedState.tag & 1) { c2.flags |= 2048; bi$3(9, ci$1.bind(null, c2, d4, e18, b2), void 0, null); if (null === Q$4) @@ -3981,17 +3981,17 @@ function ki$2(a3, b2, c2, d4) { function li$1(a3, b2, c2, d4) { var e18 = Uh(); d4 = void 0 === d4 ? null : d4; - var f3 = void 0; + var f4 = void 0; if (null !== N$3) { var g3 = N$3.memoizedState; - f3 = g3.destroy; + f4 = g3.destroy; if (null !== d4 && Mh$1(d4, g3.deps)) { - e18.memoizedState = bi$3(b2, c2, f3, d4); + e18.memoizedState = bi$3(b2, c2, f4, d4); return; } } M$3.flags |= a3; - e18.memoizedState = bi$3(1 | b2, c2, f3, d4); + e18.memoizedState = bi$3(1 | b2, c2, f4, d4); } function mi$1(a3, b2) { return ki$2(8390656, 8, a3, b2); @@ -4077,10 +4077,10 @@ function ii$1(a3, b2, c2) { if (zi$1(a3)) Ai$1(b2, e18); else { - var f3 = a3.alternate; - if (0 === a3.lanes && (null === f3 || 0 === f3.lanes) && (f3 = b2.lastRenderedReducer, null !== f3)) + var f4 = a3.alternate; + if (0 === a3.lanes && (null === f4 || 0 === f4.lanes) && (f4 = b2.lastRenderedReducer, null !== f4)) try { - var g3 = b2.lastRenderedState, h4 = f3(g3, c2); + var g3 = b2.lastRenderedState, h4 = f4(g3, c2); e18.hasEagerState = true; e18.eagerState = h4; if (He(h4, g3)) { @@ -4169,16 +4169,16 @@ var Rh$1 = { readContext: eh$1, useCallback: P$3, useContext: P$3, useEffect: P$ 0 !== (Hh & 30) || di$1(d4, b2, c2); } e18.memoizedState = c2; - var f3 = { value: c2, getSnapshot: b2 }; - e18.queue = f3; + var f4 = { value: c2, getSnapshot: b2 }; + e18.queue = f4; mi$1(ai$1.bind( null, d4, - f3, + f4, a3 ), [a3]); d4.flags |= 2048; - bi$3(9, ci$1.bind(null, d4, f3, c2, b2), void 0, null); + bi$3(9, ci$1.bind(null, d4, f4, c2, b2), void 0, null); return c2; }, useId: function() { var a3 = Th(), b2 = Q$4.identifierPrefix; @@ -4250,18 +4250,18 @@ var Ei$1 = { isMounted: function(a3) { return (a3 = a3._reactInternals) ? Vb(a3) === a3 : false; }, enqueueSetState: function(a3, b2, c2) { a3 = a3._reactInternals; - var d4 = R$3(), e18 = yi$2(a3), f3 = mh$1(d4, e18); - f3.payload = b2; - void 0 !== c2 && null !== c2 && (f3.callback = c2); - b2 = nh(a3, f3, e18); + var d4 = R$3(), e18 = yi$2(a3), f4 = mh$1(d4, e18); + f4.payload = b2; + void 0 !== c2 && null !== c2 && (f4.callback = c2); + b2 = nh(a3, f4, e18); null !== b2 && (gi$2(b2, a3, e18, d4), oh(b2, a3, e18)); }, enqueueReplaceState: function(a3, b2, c2) { a3 = a3._reactInternals; - var d4 = R$3(), e18 = yi$2(a3), f3 = mh$1(d4, e18); - f3.tag = 1; - f3.payload = b2; - void 0 !== c2 && null !== c2 && (f3.callback = c2); - b2 = nh(a3, f3, e18); + var d4 = R$3(), e18 = yi$2(a3), f4 = mh$1(d4, e18); + f4.tag = 1; + f4.payload = b2; + void 0 !== c2 && null !== c2 && (f4.callback = c2); + b2 = nh(a3, f4, e18); null !== b2 && (gi$2(b2, a3, e18, d4), oh(b2, a3, e18)); }, enqueueForceUpdate: function(a3, b2) { a3 = a3._reactInternals; @@ -4271,20 +4271,20 @@ var Ei$1 = { isMounted: function(a3) { b2 = nh(a3, e18, d4); null !== b2 && (gi$2(b2, a3, d4, c2), oh(b2, a3, d4)); } }; -function Fi$3(a3, b2, c2, d4, e18, f3, g3) { +function Fi$3(a3, b2, c2, d4, e18, f4, g3) { a3 = a3.stateNode; - return "function" === typeof a3.shouldComponentUpdate ? a3.shouldComponentUpdate(d4, f3, g3) : b2.prototype && b2.prototype.isPureReactComponent ? !Ie$1(c2, d4) || !Ie$1(e18, f3) : true; + return "function" === typeof a3.shouldComponentUpdate ? a3.shouldComponentUpdate(d4, f4, g3) : b2.prototype && b2.prototype.isPureReactComponent ? !Ie$1(c2, d4) || !Ie$1(e18, f4) : true; } function Gi$1(a3, b2, c2) { var d4 = false, e18 = Vf$1; - var f3 = b2.contextType; - "object" === typeof f3 && null !== f3 ? f3 = eh$1(f3) : (e18 = Zf(b2) ? Xf : H$1.current, d4 = b2.contextTypes, f3 = (d4 = null !== d4 && void 0 !== d4) ? Yf$1(a3, e18) : Vf$1); - b2 = new b2(c2, f3); + var f4 = b2.contextType; + "object" === typeof f4 && null !== f4 ? f4 = eh$1(f4) : (e18 = Zf(b2) ? Xf : H$1.current, d4 = b2.contextTypes, f4 = (d4 = null !== d4 && void 0 !== d4) ? Yf$1(a3, e18) : Vf$1); + b2 = new b2(c2, f4); a3.memoizedState = null !== b2.state && void 0 !== b2.state ? b2.state : null; b2.updater = Ei$1; a3.stateNode = b2; b2._reactInternals = a3; - d4 && (a3 = a3.stateNode, a3.__reactInternalMemoizedUnmaskedChildContext = e18, a3.__reactInternalMemoizedMaskedChildContext = f3); + d4 && (a3 = a3.stateNode, a3.__reactInternalMemoizedUnmaskedChildContext = e18, a3.__reactInternalMemoizedMaskedChildContext = f4); return b2; } function Hi$1(a3, b2, c2, d4) { @@ -4299,11 +4299,11 @@ function Ii$2(a3, b2, c2, d4) { e18.state = a3.memoizedState; e18.refs = {}; kh(a3); - var f3 = b2.contextType; - "object" === typeof f3 && null !== f3 ? e18.context = eh$1(f3) : (f3 = Zf(b2) ? Xf : H$1.current, e18.context = Yf$1(a3, f3)); + var f4 = b2.contextType; + "object" === typeof f4 && null !== f4 ? e18.context = eh$1(f4) : (f4 = Zf(b2) ? Xf : H$1.current, e18.context = Yf$1(a3, f4)); e18.state = a3.memoizedState; - f3 = b2.getDerivedStateFromProps; - "function" === typeof f3 && (Di$3(a3, b2, f3, c2), e18.state = a3.memoizedState); + f4 = b2.getDerivedStateFromProps; + "function" === typeof f4 && (Di$3(a3, b2, f4, c2), e18.state = a3.memoizedState); "function" === typeof b2.getDerivedStateFromProps || "function" === typeof e18.getSnapshotBeforeUpdate || "function" !== typeof e18.UNSAFE_componentWillMount && "function" !== typeof e18.componentWillMount || (b2 = e18.state, "function" === typeof e18.componentWillMount && e18.componentWillMount(), "function" === typeof e18.UNSAFE_componentWillMount && e18.UNSAFE_componentWillMount(), b2 !== e18.state && Ei$1.enqueueReplaceState(e18, e18.state, null), qh(a3, c2, e18, d4), e18.state = a3.memoizedState); "function" === typeof e18.componentDidMount && (a3.flags |= 4194308); } @@ -4314,8 +4314,8 @@ function Ji$1(a3, b2) { c2 += Pa$2(d4), d4 = d4.return; while (d4); var e18 = c2; - } catch (f3) { - e18 = "\nError generating stack: " + f3.message + "\n" + f3.stack; + } catch (f4) { + e18 = "\nError generating stack: " + f4.message + "\n" + f4.stack; } return { value: a3, source: b2, stack: e18, digest: null }; } @@ -4356,8 +4356,8 @@ function Qi$1(a3, b2, c2) { Li$1(a3, b2); }; } - var f3 = a3.stateNode; - null !== f3 && "function" === typeof f3.componentDidCatch && (c2.callback = function() { + var f4 = a3.stateNode; + null !== f4 && "function" === typeof f4.componentDidCatch && (c2.callback = function() { Li$1(a3, b2); "function" !== typeof d4 && (null === Ri$2 ? Ri$2 = /* @__PURE__ */ new Set([this]) : Ri$2.add(this)); var c3 = b2.stack; @@ -4399,9 +4399,9 @@ function Xi$1(a3, b2, c2, d4) { } function Yi$1(a3, b2, c2, d4, e18) { c2 = c2.render; - var f3 = b2.ref; + var f4 = b2.ref; ch$1(b2, e18); - d4 = Nh$1(a3, b2, c2, d4, f3, e18); + d4 = Nh$1(a3, b2, c2, d4, f4, e18); c2 = Sh$1(); if (null !== a3 && !dh$1) return b2.updateQueue = a3.updateQueue, b2.flags &= -2053, a3.lanes &= ~e18, Zi$1(a3, b2, e18); @@ -4412,33 +4412,33 @@ function Yi$1(a3, b2, c2, d4, e18) { } function $i$1(a3, b2, c2, d4, e18) { if (null === a3) { - var f3 = c2.type; - if ("function" === typeof f3 && !aj(f3) && void 0 === f3.defaultProps && null === c2.compare && void 0 === c2.defaultProps) - return b2.tag = 15, b2.type = f3, bj(a3, b2, f3, d4, e18); + var f4 = c2.type; + if ("function" === typeof f4 && !aj(f4) && void 0 === f4.defaultProps && null === c2.compare && void 0 === c2.defaultProps) + return b2.tag = 15, b2.type = f4, bj(a3, b2, f4, d4, e18); a3 = Rg(c2.type, null, d4, b2, b2.mode, e18); a3.ref = b2.ref; a3.return = b2; return b2.child = a3; } - f3 = a3.child; + f4 = a3.child; if (0 === (a3.lanes & e18)) { - var g3 = f3.memoizedProps; + var g3 = f4.memoizedProps; c2 = c2.compare; c2 = null !== c2 ? c2 : Ie$1; if (c2(g3, d4) && a3.ref === b2.ref) return Zi$1(a3, b2, e18); } b2.flags |= 1; - a3 = Pg(f3, d4); + a3 = Pg(f4, d4); a3.ref = b2.ref; a3.return = b2; return b2.child = a3; } function bj(a3, b2, c2, d4, e18) { if (null !== a3) { - var f3 = a3.memoizedProps; - if (Ie$1(f3, d4) && a3.ref === b2.ref) - if (dh$1 = false, b2.pendingProps = d4 = f3, 0 !== (a3.lanes & e18)) + var f4 = a3.memoizedProps; + if (Ie$1(f4, d4) && a3.ref === b2.ref) + if (dh$1 = false, b2.pendingProps = d4 = f4, 0 !== (a3.lanes & e18)) 0 !== (a3.flags & 131072) && (dh$1 = true); else return b2.lanes = a3.lanes, Zi$1(a3, b2, e18); @@ -4446,20 +4446,20 @@ function bj(a3, b2, c2, d4, e18) { return cj(a3, b2, c2, d4, e18); } function dj(a3, b2, c2) { - var d4 = b2.pendingProps, e18 = d4.children, f3 = null !== a3 ? a3.memoizedState : null; + var d4 = b2.pendingProps, e18 = d4.children, f4 = null !== a3 ? a3.memoizedState : null; if ("hidden" === d4.mode) if (0 === (b2.mode & 1)) b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, G$2(ej$1, fj), fj |= c2; else { if (0 === (c2 & 1073741824)) - return a3 = null !== f3 ? f3.baseLanes | c2 : c2, b2.lanes = b2.childLanes = 1073741824, b2.memoizedState = { baseLanes: a3, cachePool: null, transitions: null }, b2.updateQueue = null, G$2(ej$1, fj), fj |= a3, null; + return a3 = null !== f4 ? f4.baseLanes | c2 : c2, b2.lanes = b2.childLanes = 1073741824, b2.memoizedState = { baseLanes: a3, cachePool: null, transitions: null }, b2.updateQueue = null, G$2(ej$1, fj), fj |= a3, null; b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }; - d4 = null !== f3 ? f3.baseLanes : c2; + d4 = null !== f4 ? f4.baseLanes : c2; G$2(ej$1, fj); fj |= d4; } else - null !== f3 ? (d4 = f3.baseLanes | c2, b2.memoizedState = null) : d4 = c2, G$2(ej$1, fj), fj |= d4; + null !== f4 ? (d4 = f4.baseLanes | c2, b2.memoizedState = null) : d4 = c2, G$2(ej$1, fj), fj |= d4; Xi$1(a3, b2, e18, c2); return b2.child; } @@ -4469,10 +4469,10 @@ function gj(a3, b2) { b2.flags |= 512, b2.flags |= 2097152; } function cj(a3, b2, c2, d4, e18) { - var f3 = Zf(c2) ? Xf : H$1.current; - f3 = Yf$1(b2, f3); + var f4 = Zf(c2) ? Xf : H$1.current; + f4 = Yf$1(b2, f4); ch$1(b2, e18); - c2 = Nh$1(a3, b2, c2, d4, f3, e18); + c2 = Nh$1(a3, b2, c2, d4, f4, e18); d4 = Sh$1(); if (null !== a3 && !dh$1) return b2.updateQueue = a3.updateQueue, b2.flags &= -2053, a3.lanes &= ~e18, Zi$1(a3, b2, e18); @@ -4483,10 +4483,10 @@ function cj(a3, b2, c2, d4, e18) { } function hj(a3, b2, c2, d4, e18) { if (Zf(c2)) { - var f3 = true; + var f4 = true; cg(b2); } else - f3 = false; + f4 = false; ch$1(b2, e18); if (null === b2.stateNode) ij(a3, b2), Gi$1(b2, c2, d4), Ii$2(b2, c2, d4, e18), d4 = true; @@ -4519,21 +4519,21 @@ function hj(a3, b2, c2, d4, e18) { r2 = b2.memoizedState; g3.state = r2; qh(b2, d4, g3, e18); - var n4 = b2.memoizedState; - h4 !== q2 || r2 !== n4 || Wf$1.current || jh ? ("function" === typeof y3 && (Di$3(b2, c2, y3, d4), n4 = b2.memoizedState), (l2 = jh || Fi$3(b2, c2, l2, d4, r2, n4, k2) || false) ? (m3 || "function" !== typeof g3.UNSAFE_componentWillUpdate && "function" !== typeof g3.componentWillUpdate || ("function" === typeof g3.componentWillUpdate && g3.componentWillUpdate(d4, n4, k2), "function" === typeof g3.UNSAFE_componentWillUpdate && g3.UNSAFE_componentWillUpdate(d4, n4, k2)), "function" === typeof g3.componentDidUpdate && (b2.flags |= 4), "function" === typeof g3.getSnapshotBeforeUpdate && (b2.flags |= 1024)) : ("function" !== typeof g3.componentDidUpdate || h4 === a3.memoizedProps && r2 === a3.memoizedState || (b2.flags |= 4), "function" !== typeof g3.getSnapshotBeforeUpdate || h4 === a3.memoizedProps && r2 === a3.memoizedState || (b2.flags |= 1024), b2.memoizedProps = d4, b2.memoizedState = n4), g3.props = d4, g3.state = n4, g3.context = k2, d4 = l2) : ("function" !== typeof g3.componentDidUpdate || h4 === a3.memoizedProps && r2 === a3.memoizedState || (b2.flags |= 4), "function" !== typeof g3.getSnapshotBeforeUpdate || h4 === a3.memoizedProps && r2 === a3.memoizedState || (b2.flags |= 1024), d4 = false); + var n5 = b2.memoizedState; + h4 !== q2 || r2 !== n5 || Wf$1.current || jh ? ("function" === typeof y3 && (Di$3(b2, c2, y3, d4), n5 = b2.memoizedState), (l2 = jh || Fi$3(b2, c2, l2, d4, r2, n5, k2) || false) ? (m3 || "function" !== typeof g3.UNSAFE_componentWillUpdate && "function" !== typeof g3.componentWillUpdate || ("function" === typeof g3.componentWillUpdate && g3.componentWillUpdate(d4, n5, k2), "function" === typeof g3.UNSAFE_componentWillUpdate && g3.UNSAFE_componentWillUpdate(d4, n5, k2)), "function" === typeof g3.componentDidUpdate && (b2.flags |= 4), "function" === typeof g3.getSnapshotBeforeUpdate && (b2.flags |= 1024)) : ("function" !== typeof g3.componentDidUpdate || h4 === a3.memoizedProps && r2 === a3.memoizedState || (b2.flags |= 4), "function" !== typeof g3.getSnapshotBeforeUpdate || h4 === a3.memoizedProps && r2 === a3.memoizedState || (b2.flags |= 1024), b2.memoizedProps = d4, b2.memoizedState = n5), g3.props = d4, g3.state = n5, g3.context = k2, d4 = l2) : ("function" !== typeof g3.componentDidUpdate || h4 === a3.memoizedProps && r2 === a3.memoizedState || (b2.flags |= 4), "function" !== typeof g3.getSnapshotBeforeUpdate || h4 === a3.memoizedProps && r2 === a3.memoizedState || (b2.flags |= 1024), d4 = false); } - return jj(a3, b2, c2, d4, f3, e18); + return jj(a3, b2, c2, d4, f4, e18); } -function jj(a3, b2, c2, d4, e18, f3) { +function jj(a3, b2, c2, d4, e18, f4) { gj(a3, b2); var g3 = 0 !== (b2.flags & 128); if (!d4 && !g3) - return e18 && dg(b2, c2, false), Zi$1(a3, b2, f3); + return e18 && dg(b2, c2, false), Zi$1(a3, b2, f4); d4 = b2.stateNode; Wi$2.current = b2; var h4 = g3 && "function" !== typeof c2.getDerivedStateFromError ? null : d4.render(); b2.flags |= 1; - null !== a3 && g3 ? (b2.child = Ug(b2, a3.child, null, f3), b2.child = Ug(b2, null, h4, f3)) : Xi$1(a3, b2, h4, f3); + null !== a3 && g3 ? (b2.child = Ug(b2, a3.child, null, f4), b2.child = Ug(b2, null, h4, f4)) : Xi$1(a3, b2, h4, f4); b2.memoizedState = d4.state; e18 && dg(b2, c2, true); return b2.child; @@ -4555,10 +4555,10 @@ function nj(a3) { return { baseLanes: a3, cachePool: null, transitions: null }; } function oj(a3, b2, c2) { - var d4 = b2.pendingProps, e18 = L$3.current, f3 = false, g3 = 0 !== (b2.flags & 128), h4; + var d4 = b2.pendingProps, e18 = L$3.current, f4 = false, g3 = 0 !== (b2.flags & 128), h4; (h4 = g3) || (h4 = null !== a3 && null === a3.memoizedState ? false : 0 !== (e18 & 2)); if (h4) - f3 = true, b2.flags &= -129; + f4 = true, b2.flags &= -129; else if (null === a3 || null !== a3.memoizedState) e18 |= 1; G$2(L$3, e18 & 1); @@ -4569,35 +4569,35 @@ function oj(a3, b2, c2) { return 0 === (b2.mode & 1) ? b2.lanes = 1 : "$!" === a3.data ? b2.lanes = 8 : b2.lanes = 1073741824, null; g3 = d4.children; a3 = d4.fallback; - return f3 ? (d4 = b2.mode, f3 = b2.child, g3 = { mode: "hidden", children: g3 }, 0 === (d4 & 1) && null !== f3 ? (f3.childLanes = 0, f3.pendingProps = g3) : f3 = pj(g3, d4, 0, null), a3 = Tg(a3, d4, c2, null), f3.return = b2, a3.return = b2, f3.sibling = a3, b2.child = f3, b2.child.memoizedState = nj(c2), b2.memoizedState = mj, a3) : qj(b2, g3); + return f4 ? (d4 = b2.mode, f4 = b2.child, g3 = { mode: "hidden", children: g3 }, 0 === (d4 & 1) && null !== f4 ? (f4.childLanes = 0, f4.pendingProps = g3) : f4 = pj(g3, d4, 0, null), a3 = Tg(a3, d4, c2, null), f4.return = b2, a3.return = b2, f4.sibling = a3, b2.child = f4, b2.child.memoizedState = nj(c2), b2.memoizedState = mj, a3) : qj(b2, g3); } e18 = a3.memoizedState; if (null !== e18 && (h4 = e18.dehydrated, null !== h4)) return rj$1(a3, b2, g3, d4, h4, e18, c2); - if (f3) { - f3 = d4.fallback; + if (f4) { + f4 = d4.fallback; g3 = b2.mode; e18 = a3.child; h4 = e18.sibling; var k2 = { mode: "hidden", children: d4.children }; 0 === (g3 & 1) && b2.child !== e18 ? (d4 = b2.child, d4.childLanes = 0, d4.pendingProps = k2, b2.deletions = null) : (d4 = Pg(e18, k2), d4.subtreeFlags = e18.subtreeFlags & 14680064); - null !== h4 ? f3 = Pg(h4, f3) : (f3 = Tg(f3, g3, c2, null), f3.flags |= 2); - f3.return = b2; + null !== h4 ? f4 = Pg(h4, f4) : (f4 = Tg(f4, g3, c2, null), f4.flags |= 2); + f4.return = b2; d4.return = b2; - d4.sibling = f3; + d4.sibling = f4; b2.child = d4; - d4 = f3; - f3 = b2.child; + d4 = f4; + f4 = b2.child; g3 = a3.child.memoizedState; g3 = null === g3 ? nj(c2) : { baseLanes: g3.baseLanes | c2, cachePool: null, transitions: g3.transitions }; - f3.memoizedState = g3; - f3.childLanes = a3.childLanes & ~c2; + f4.memoizedState = g3; + f4.childLanes = a3.childLanes & ~c2; b2.memoizedState = mj; return d4; } - f3 = a3.child; - a3 = f3.sibling; - d4 = Pg(f3, { mode: "visible", children: d4.children }); + f4 = a3.child; + a3 = f4.sibling; + d4 = Pg(f4, { mode: "visible", children: d4.children }); 0 === (b2.mode & 1) && (d4.lanes = c2); d4.return = b2; d4.sibling = null; @@ -4619,25 +4619,25 @@ function sj(a3, b2, c2, d4) { b2.memoizedState = null; return a3; } -function rj$1(a3, b2, c2, d4, e18, f3, g3) { +function rj$1(a3, b2, c2, d4, e18, f4, g3) { if (c2) { if (b2.flags & 256) return b2.flags &= -257, d4 = Ki$1(Error(p$6(422))), sj(a3, b2, g3, d4); if (null !== b2.memoizedState) return b2.child = a3.child, b2.flags |= 128, null; - f3 = d4.fallback; + f4 = d4.fallback; e18 = b2.mode; d4 = pj({ mode: "visible", children: d4.children }, e18, 0, null); - f3 = Tg(f3, e18, g3, null); - f3.flags |= 2; + f4 = Tg(f4, e18, g3, null); + f4.flags |= 2; d4.return = b2; - f3.return = b2; - d4.sibling = f3; + f4.return = b2; + d4.sibling = f4; b2.child = d4; 0 !== (b2.mode & 1) && Ug(b2, a3.child, null, g3); b2.child.memoizedState = nj(g3); b2.memoizedState = mj; - return f3; + return f4; } if (0 === (b2.mode & 1)) return sj(a3, b2, g3, null); @@ -4646,8 +4646,8 @@ function rj$1(a3, b2, c2, d4, e18, f3, g3) { if (d4) var h4 = d4.dgst; d4 = h4; - f3 = Error(p$6(419)); - d4 = Ki$1(f3, d4, void 0); + f4 = Error(p$6(419)); + d4 = Ki$1(f4, d4, void 0); return sj(a3, b2, g3, d4); } h4 = 0 !== (g3 & a3.childLanes); @@ -4691,7 +4691,7 @@ function rj$1(a3, b2, c2, d4, e18, f3, g3) { e18 = 0; } e18 = 0 !== (e18 & (d4.suspendedLanes | g3)) ? 0 : e18; - 0 !== e18 && e18 !== f3.retryLane && (f3.retryLane = e18, ih(a3, e18), gi$2(d4, a3, e18, -1)); + 0 !== e18 && e18 !== f4.retryLane && (f4.retryLane = e18, ih(a3, e18), gi$2(d4, a3, e18, -1)); } tj(); d4 = Ki$1(Error(p$6(421))); @@ -4699,7 +4699,7 @@ function rj$1(a3, b2, c2, d4, e18, f3, g3) { } if ("$?" === e18.data) return b2.flags |= 128, b2.child = a3.child, b2 = uj.bind(null, a3), e18._reactRetry = b2, null; - a3 = f3.treeContext; + a3 = f4.treeContext; yg = Lf$1(e18.nextSibling); xg = b2; I$3 = true; @@ -4716,11 +4716,11 @@ function vj(a3, b2, c2) { bh$1(a3.return, b2, c2); } function wj(a3, b2, c2, d4, e18) { - var f3 = a3.memoizedState; - null === f3 ? a3.memoizedState = { isBackwards: b2, rendering: null, renderingStartTime: 0, last: d4, tail: c2, tailMode: e18 } : (f3.isBackwards = b2, f3.rendering = null, f3.renderingStartTime = 0, f3.last = d4, f3.tail = c2, f3.tailMode = e18); + var f4 = a3.memoizedState; + null === f4 ? a3.memoizedState = { isBackwards: b2, rendering: null, renderingStartTime: 0, last: d4, tail: c2, tailMode: e18 } : (f4.isBackwards = b2, f4.rendering = null, f4.renderingStartTime = 0, f4.last = d4, f4.tail = c2, f4.tailMode = e18); } function xj(a3, b2, c2) { - var d4 = b2.pendingProps, e18 = d4.revealOrder, f3 = d4.tail; + var d4 = b2.pendingProps, e18 = d4.revealOrder, f4 = d4.tail; Xi$1(a3, b2, d4.children, c2); d4 = L$3.current; if (0 !== (d4 & 2)) @@ -4761,7 +4761,7 @@ function xj(a3, b2, c2) { a3 = c2.alternate, null !== a3 && null === Ch$1(a3) && (e18 = c2), c2 = c2.sibling; c2 = e18; null === c2 ? (e18 = b2.child, b2.child = null) : (e18 = c2.sibling, c2.sibling = null); - wj(b2, false, e18, c2, f3); + wj(b2, false, e18, c2, f4); break; case "backwards": c2 = null; @@ -4777,7 +4777,7 @@ function xj(a3, b2, c2) { c2 = e18; e18 = a3; } - wj(b2, true, c2, null, f3); + wj(b2, true, c2, null, f4); break; case "together": wj(b2, false, null, null, void 0); @@ -4888,22 +4888,22 @@ Bj = function(a3, b2, c2, d4) { if (e18 !== d4) { a3 = b2.stateNode; xh$1(uh$1.current); - var f3 = null; + var f4 = null; switch (c2) { case "input": e18 = Ya$1(a3, e18); d4 = Ya$1(a3, d4); - f3 = []; + f4 = []; break; case "select": e18 = A$3({}, e18, { value: void 0 }); d4 = A$3({}, d4, { value: void 0 }); - f3 = []; + f4 = []; break; case "textarea": e18 = gb(a3, e18); d4 = gb(a3, d4); - f3 = []; + f4 = []; break; default: "function" !== typeof e18.onClick && "function" === typeof d4.onClick && (a3.onclick = Bf$2); @@ -4918,7 +4918,7 @@ Bj = function(a3, b2, c2, d4) { for (g3 in h4) h4.hasOwnProperty(g3) && (c2 || (c2 = {}), c2[g3] = ""); } else - "dangerouslySetInnerHTML" !== l2 && "children" !== l2 && "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && "autoFocus" !== l2 && (ea$3.hasOwnProperty(l2) ? f3 || (f3 = []) : (f3 = f3 || []).push(l2, null)); + "dangerouslySetInnerHTML" !== l2 && "children" !== l2 && "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && "autoFocus" !== l2 && (ea$3.hasOwnProperty(l2) ? f4 || (f4 = []) : (f4 = f4 || []).push(l2, null)); for (l2 in d4) { var k2 = d4[l2]; h4 = null != e18 ? e18[l2] : void 0; @@ -4930,15 +4930,15 @@ Bj = function(a3, b2, c2, d4) { for (g3 in k2) k2.hasOwnProperty(g3) && h4[g3] !== k2[g3] && (c2 || (c2 = {}), c2[g3] = k2[g3]); } else - c2 || (f3 || (f3 = []), f3.push( + c2 || (f4 || (f4 = []), f4.push( l2, c2 )), c2 = k2; else - "dangerouslySetInnerHTML" === l2 ? (k2 = k2 ? k2.__html : void 0, h4 = h4 ? h4.__html : void 0, null != k2 && h4 !== k2 && (f3 = f3 || []).push(l2, k2)) : "children" === l2 ? "string" !== typeof k2 && "number" !== typeof k2 || (f3 = f3 || []).push(l2, "" + k2) : "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && (ea$3.hasOwnProperty(l2) ? (null != k2 && "onScroll" === l2 && D$3("scroll", a3), f3 || h4 === k2 || (f3 = [])) : (f3 = f3 || []).push(l2, k2)); + "dangerouslySetInnerHTML" === l2 ? (k2 = k2 ? k2.__html : void 0, h4 = h4 ? h4.__html : void 0, null != k2 && h4 !== k2 && (f4 = f4 || []).push(l2, k2)) : "children" === l2 ? "string" !== typeof k2 && "number" !== typeof k2 || (f4 = f4 || []).push(l2, "" + k2) : "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && (ea$3.hasOwnProperty(l2) ? (null != k2 && "onScroll" === l2 && D$3("scroll", a3), f4 || h4 === k2 || (f4 = [])) : (f4 = f4 || []).push(l2, k2)); } - c2 && (f3 = f3 || []).push("style", c2); - var l2 = f3; + c2 && (f4 = f4 || []).push("style", c2); + var l2 = f4; if (b2.updateQueue = l2) b2.flags |= 4; } @@ -5020,9 +5020,9 @@ function Ej(a3, b2, c2) { if (Gg(b2)) { d4 = b2.stateNode; c2 = b2.type; - var f3 = b2.memoizedProps; + var f4 = b2.memoizedProps; d4[Of$2] = b2; - d4[Pf$2] = f3; + d4[Pf$2] = f4; a3 = 0 !== (b2.mode & 1); switch (c2) { case "dialog": @@ -5055,22 +5055,22 @@ function Ej(a3, b2, c2) { D$3("toggle", d4); break; case "input": - Za$1(d4, f3); + Za$1(d4, f4); D$3("invalid", d4); break; case "select": - d4._wrapperState = { wasMultiple: !!f3.multiple }; + d4._wrapperState = { wasMultiple: !!f4.multiple }; D$3("invalid", d4); break; case "textarea": - hb(d4, f3), D$3("invalid", d4); + hb(d4, f4), D$3("invalid", d4); } - ub(c2, f3); + ub(c2, f4); e18 = null; - for (var g3 in f3) - if (f3.hasOwnProperty(g3)) { - var h4 = f3[g3]; - "children" === g3 ? "string" === typeof h4 ? d4.textContent !== h4 && (true !== f3.suppressHydrationWarning && Af$2(d4.textContent, h4, a3), e18 = ["children", h4]) : "number" === typeof h4 && d4.textContent !== "" + h4 && (true !== f3.suppressHydrationWarning && Af$2( + for (var g3 in f4) + if (f4.hasOwnProperty(g3)) { + var h4 = f4[g3]; + "children" === g3 ? "string" === typeof h4 ? d4.textContent !== h4 && (true !== f4.suppressHydrationWarning && Af$2(d4.textContent, h4, a3), e18 = ["children", h4]) : "number" === typeof h4 && d4.textContent !== "" + h4 && (true !== f4.suppressHydrationWarning && Af$2( d4.textContent, h4, a3 @@ -5079,7 +5079,7 @@ function Ej(a3, b2, c2) { switch (c2) { case "input": Va$1(d4); - db(d4, f3, true); + db(d4, f4, true); break; case "textarea": Va$1(d4); @@ -5089,7 +5089,7 @@ function Ej(a3, b2, c2) { case "option": break; default: - "function" === typeof f3.onClick && (d4.onclick = Bf$2); + "function" === typeof f4.onClick && (d4.onclick = Bf$2); } d4 = e18; b2.updateQueue = d4; @@ -5163,10 +5163,10 @@ function Ej(a3, b2, c2) { } ub(c2, e18); h4 = e18; - for (f3 in h4) - if (h4.hasOwnProperty(f3)) { - var k2 = h4[f3]; - "style" === f3 ? sb(a3, k2) : "dangerouslySetInnerHTML" === f3 ? (k2 = k2 ? k2.__html : void 0, null != k2 && nb(a3, k2)) : "children" === f3 ? "string" === typeof k2 ? ("textarea" !== c2 || "" !== k2) && ob(a3, k2) : "number" === typeof k2 && ob(a3, "" + k2) : "suppressContentEditableWarning" !== f3 && "suppressHydrationWarning" !== f3 && "autoFocus" !== f3 && (ea$3.hasOwnProperty(f3) ? null != k2 && "onScroll" === f3 && D$3("scroll", a3) : null != k2 && ta$2(a3, f3, k2, g3)); + for (f4 in h4) + if (h4.hasOwnProperty(f4)) { + var k2 = h4[f4]; + "style" === f4 ? sb(a3, k2) : "dangerouslySetInnerHTML" === f4 ? (k2 = k2 ? k2.__html : void 0, null != k2 && nb(a3, k2)) : "children" === f4 ? "string" === typeof k2 ? ("textarea" !== c2 || "" !== k2) && ob(a3, k2) : "number" === typeof k2 && ob(a3, "" + k2) : "suppressContentEditableWarning" !== f4 && "suppressHydrationWarning" !== f4 && "autoFocus" !== f4 && (ea$3.hasOwnProperty(f4) ? null != k2 && "onScroll" === f4 && D$3("scroll", a3) : null != k2 && ta$2(a3, f4, k2, g3)); } switch (c2) { case "input": @@ -5182,8 +5182,8 @@ function Ej(a3, b2, c2) { break; case "select": a3.multiple = !!d4.multiple; - f3 = d4.value; - null != f3 ? fb(a3, !!d4.multiple, f3, false) : null != d4.defaultValue && fb( + f4 = d4.value; + null != f4 ? fb(a3, !!d4.multiple, f4, false) : null != d4.defaultValue && fb( a3, !!d4.multiple, d4.defaultValue, @@ -5225,7 +5225,7 @@ function Ej(a3, b2, c2) { d4 = b2.stateNode; c2 = b2.memoizedProps; d4[Of$2] = b2; - if (f3 = d4.nodeValue !== c2) { + if (f4 = d4.nodeValue !== c2) { if (a3 = xg, null !== a3) switch (a3.tag) { case 3: @@ -5235,7 +5235,7 @@ function Ej(a3, b2, c2) { true !== a3.memoizedProps.suppressHydrationWarning && Af$2(d4.nodeValue, c2, 0 !== (a3.mode & 1)); } } - f3 && (b2.flags |= 4); + f4 && (b2.flags |= 4); } else d4 = (9 === c2.nodeType ? c2 : c2.ownerDocument).createTextNode(d4), d4[Of$2] = b2, b2.stateNode = d4; } @@ -5246,23 +5246,23 @@ function Ej(a3, b2, c2) { d4 = b2.memoizedState; if (null === a3 || null !== a3.memoizedState && null !== a3.memoizedState.dehydrated) { if (I$3 && null !== yg && 0 !== (b2.mode & 1) && 0 === (b2.flags & 128)) - Hg(), Ig(), b2.flags |= 98560, f3 = false; - else if (f3 = Gg(b2), null !== d4 && null !== d4.dehydrated) { + Hg(), Ig(), b2.flags |= 98560, f4 = false; + else if (f4 = Gg(b2), null !== d4 && null !== d4.dehydrated) { if (null === a3) { - if (!f3) + if (!f4) throw Error(p$6(318)); - f3 = b2.memoizedState; - f3 = null !== f3 ? f3.dehydrated : null; - if (!f3) + f4 = b2.memoizedState; + f4 = null !== f4 ? f4.dehydrated : null; + if (!f4) throw Error(p$6(317)); - f3[Of$2] = b2; + f4[Of$2] = b2; } else Ig(), 0 === (b2.flags & 128) && (b2.memoizedState = null), b2.flags |= 4; S$5(b2); - f3 = false; + f4 = false; } else - null !== zg && (Fj(zg), zg = null), f3 = true; - if (!f3) + null !== zg && (Fj(zg), zg = null), f4 = true; + if (!f4) return b2.flags & 65536 ? b2 : null; } if (0 !== (b2.flags & 128)) @@ -5280,45 +5280,45 @@ function Ej(a3, b2, c2) { return Zf(b2.type) && $f(), S$5(b2), null; case 19: E$4(L$3); - f3 = b2.memoizedState; - if (null === f3) + f4 = b2.memoizedState; + if (null === f4) return S$5(b2), null; d4 = 0 !== (b2.flags & 128); - g3 = f3.rendering; + g3 = f4.rendering; if (null === g3) if (d4) - Dj(f3, false); + Dj(f4, false); else { if (0 !== T$4 || null !== a3 && 0 !== (a3.flags & 128)) for (a3 = b2.child; null !== a3; ) { g3 = Ch$1(a3); if (null !== g3) { b2.flags |= 128; - Dj(f3, false); + Dj(f4, false); d4 = g3.updateQueue; null !== d4 && (b2.updateQueue = d4, b2.flags |= 4); b2.subtreeFlags = 0; d4 = c2; for (c2 = b2.child; null !== c2; ) - f3 = c2, a3 = d4, f3.flags &= 14680066, g3 = f3.alternate, null === g3 ? (f3.childLanes = 0, f3.lanes = a3, f3.child = null, f3.subtreeFlags = 0, f3.memoizedProps = null, f3.memoizedState = null, f3.updateQueue = null, f3.dependencies = null, f3.stateNode = null) : (f3.childLanes = g3.childLanes, f3.lanes = g3.lanes, f3.child = g3.child, f3.subtreeFlags = 0, f3.deletions = null, f3.memoizedProps = g3.memoizedProps, f3.memoizedState = g3.memoizedState, f3.updateQueue = g3.updateQueue, f3.type = g3.type, a3 = g3.dependencies, f3.dependencies = null === a3 ? null : { lanes: a3.lanes, firstContext: a3.firstContext }), c2 = c2.sibling; + f4 = c2, a3 = d4, f4.flags &= 14680066, g3 = f4.alternate, null === g3 ? (f4.childLanes = 0, f4.lanes = a3, f4.child = null, f4.subtreeFlags = 0, f4.memoizedProps = null, f4.memoizedState = null, f4.updateQueue = null, f4.dependencies = null, f4.stateNode = null) : (f4.childLanes = g3.childLanes, f4.lanes = g3.lanes, f4.child = g3.child, f4.subtreeFlags = 0, f4.deletions = null, f4.memoizedProps = g3.memoizedProps, f4.memoizedState = g3.memoizedState, f4.updateQueue = g3.updateQueue, f4.type = g3.type, a3 = g3.dependencies, f4.dependencies = null === a3 ? null : { lanes: a3.lanes, firstContext: a3.firstContext }), c2 = c2.sibling; G$2(L$3, L$3.current & 1 | 2); return b2.child; } a3 = a3.sibling; } - null !== f3.tail && B$2() > Gj && (b2.flags |= 128, d4 = true, Dj(f3, false), b2.lanes = 4194304); + null !== f4.tail && B$2() > Gj && (b2.flags |= 128, d4 = true, Dj(f4, false), b2.lanes = 4194304); } else { if (!d4) if (a3 = Ch$1(g3), null !== a3) { - if (b2.flags |= 128, d4 = true, c2 = a3.updateQueue, null !== c2 && (b2.updateQueue = c2, b2.flags |= 4), Dj(f3, true), null === f3.tail && "hidden" === f3.tailMode && !g3.alternate && !I$3) + if (b2.flags |= 128, d4 = true, c2 = a3.updateQueue, null !== c2 && (b2.updateQueue = c2, b2.flags |= 4), Dj(f4, true), null === f4.tail && "hidden" === f4.tailMode && !g3.alternate && !I$3) return S$5(b2), null; } else - 2 * B$2() - f3.renderingStartTime > Gj && 1073741824 !== c2 && (b2.flags |= 128, d4 = true, Dj(f3, false), b2.lanes = 4194304); - f3.isBackwards ? (g3.sibling = b2.child, b2.child = g3) : (c2 = f3.last, null !== c2 ? c2.sibling = g3 : b2.child = g3, f3.last = g3); + 2 * B$2() - f4.renderingStartTime > Gj && 1073741824 !== c2 && (b2.flags |= 128, d4 = true, Dj(f4, false), b2.lanes = 4194304); + f4.isBackwards ? (g3.sibling = b2.child, b2.child = g3) : (c2 = f4.last, null !== c2 ? c2.sibling = g3 : b2.child = g3, f4.last = g3); } - if (null !== f3.tail) - return b2 = f3.tail, f3.rendering = b2, f3.tail = b2.sibling, f3.renderingStartTime = B$2(), b2.sibling = null, c2 = L$3.current, G$2(L$3, d4 ? c2 & 1 | 2 : c2 & 1), b2; + if (null !== f4.tail) + return b2 = f4.tail, f4.rendering = b2, f4.tail = b2.sibling, f4.renderingStartTime = B$2(), b2.sibling = null, c2 = L$3.current, G$2(L$3, d4 ? c2 & 1 | 2 : c2 & 1), b2; S$5(b2); return null; case 22: @@ -5398,10 +5398,10 @@ function Oj(a3, b2) { var d4 = c2.getSelection && c2.getSelection(); if (d4 && 0 !== d4.rangeCount) { c2 = d4.anchorNode; - var e18 = d4.anchorOffset, f3 = d4.focusNode; + var e18 = d4.anchorOffset, f4 = d4.focusNode; d4 = d4.focusOffset; try { - c2.nodeType, f3.nodeType; + c2.nodeType, f4.nodeType; } catch (F2) { c2 = null; break a; @@ -5411,7 +5411,7 @@ function Oj(a3, b2) { for (; ; ) { for (var y3; ; ) { q2 !== c2 || 0 !== e18 && 3 !== q2.nodeType || (h4 = g3 + e18); - q2 !== f3 || 0 !== d4 && 3 !== q2.nodeType || (k2 = g3 + d4); + q2 !== f4 || 0 !== d4 && 3 !== q2.nodeType || (k2 = g3 + d4); 3 === q2.nodeType && (g3 += q2.nodeValue.length); if (null === (y3 = q2.firstChild)) break; @@ -5422,7 +5422,7 @@ function Oj(a3, b2) { if (q2 === a3) break b; r2 === c2 && ++l2 === e18 && (h4 = g3); - r2 === f3 && ++m3 === d4 && (k2 = g3); + r2 === f4 && ++m3 === d4 && (k2 = g3); if (null !== (y3 = q2.nextSibling)) break; q2 = r2; @@ -5446,7 +5446,7 @@ function Oj(a3, b2) { for (; null !== V$3; ) { b2 = V$3; try { - var n4 = b2.alternate; + var n5 = b2.alternate; if (0 !== (b2.flags & 1024)) switch (b2.tag) { case 0: @@ -5454,8 +5454,8 @@ function Oj(a3, b2) { case 15: break; case 1: - if (null !== n4) { - var t2 = n4.memoizedProps, J2 = n4.memoizedState, x3 = b2.stateNode, w2 = x3.getSnapshotBeforeUpdate(b2.elementType === b2.type ? t2 : Ci$2(b2.type, t2), J2); + if (null !== n5) { + var t2 = n5.memoizedProps, J2 = n5.memoizedState, x3 = b2.stateNode, w2 = x3.getSnapshotBeforeUpdate(b2.elementType === b2.type ? t2 : Ci$2(b2.type, t2), J2); x3.__reactInternalSnapshotBeforeUpdate = w2; } break; @@ -5482,9 +5482,9 @@ function Oj(a3, b2) { } V$3 = b2.return; } - n4 = Nj; + n5 = Nj; Nj = false; - return n4; + return n5; } function Pj(a3, b2, c2) { var d4 = b2.updateQueue; @@ -5493,9 +5493,9 @@ function Pj(a3, b2, c2) { var e18 = d4 = d4.next; do { if ((e18.tag & a3) === a3) { - var f3 = e18.destroy; + var f4 = e18.destroy; e18.destroy = void 0; - void 0 !== f3 && Mj(b2, c2, f3); + void 0 !== f4 && Mj(b2, c2, f4); } e18 = e18.next; } while (e18 !== d4); @@ -5626,9 +5626,9 @@ function Zj(a3, b2, c2) { if (!U$2 && (d4 = c2.updateQueue, null !== d4 && (d4 = d4.lastEffect, null !== d4))) { e18 = d4 = d4.next; do { - var f3 = e18, g3 = f3.destroy; - f3 = f3.tag; - void 0 !== g3 && (0 !== (f3 & 2) ? Mj(c2, b2, g3) : 0 !== (f3 & 4) && Mj(c2, b2, g3)); + var f4 = e18, g3 = f4.destroy; + f4 = f4.tag; + void 0 !== g3 && (0 !== (f4 & 2) ? Mj(c2, b2, g3) : 0 !== (f4 & 4) && Mj(c2, b2, g3)); e18 = e18.next; } while (e18 !== d4); } @@ -5671,7 +5671,7 @@ function ck(a3, b2) { for (var d4 = 0; d4 < c2.length; d4++) { var e18 = c2[d4]; try { - var f3 = a3, g3 = b2, h4 = g3; + var f4 = a3, g3 = b2, h4 = g3; a: for (; null !== h4; ) { switch (h4.tag) { @@ -5692,7 +5692,7 @@ function ck(a3, b2) { } if (null === X$1) throw Error(p$6(160)); - Zj(f3, g3, e18); + Zj(f4, g3, e18); X$1 = null; Xj = false; var k2 = e18.alternate; @@ -5746,36 +5746,36 @@ function dk(a3, b2) { } } if (d4 & 4 && (e18 = a3.stateNode, null != e18)) { - var f3 = a3.memoizedProps, g3 = null !== c2 ? c2.memoizedProps : f3, h4 = a3.type, k2 = a3.updateQueue; + var f4 = a3.memoizedProps, g3 = null !== c2 ? c2.memoizedProps : f4, h4 = a3.type, k2 = a3.updateQueue; a3.updateQueue = null; if (null !== k2) try { - "input" === h4 && "radio" === f3.type && null != f3.name && ab(e18, f3); + "input" === h4 && "radio" === f4.type && null != f4.name && ab(e18, f4); vb(h4, g3); - var l2 = vb(h4, f3); + var l2 = vb(h4, f4); for (g3 = 0; g3 < k2.length; g3 += 2) { var m3 = k2[g3], q2 = k2[g3 + 1]; "style" === m3 ? sb(e18, q2) : "dangerouslySetInnerHTML" === m3 ? nb(e18, q2) : "children" === m3 ? ob(e18, q2) : ta$2(e18, m3, q2, l2); } switch (h4) { case "input": - bb(e18, f3); + bb(e18, f4); break; case "textarea": - ib(e18, f3); + ib(e18, f4); break; case "select": var r2 = e18._wrapperState.wasMultiple; - e18._wrapperState.wasMultiple = !!f3.multiple; - var y3 = f3.value; - null != y3 ? fb(e18, !!f3.multiple, y3, false) : r2 !== !!f3.multiple && (null != f3.defaultValue ? fb( + e18._wrapperState.wasMultiple = !!f4.multiple; + var y3 = f4.value; + null != y3 ? fb(e18, !!f4.multiple, y3, false) : r2 !== !!f4.multiple && (null != f4.defaultValue ? fb( e18, - !!f3.multiple, - f3.defaultValue, + !!f4.multiple, + f4.defaultValue, true - ) : fb(e18, !!f3.multiple, f3.multiple ? [] : "", false)); + ) : fb(e18, !!f4.multiple, f4.multiple ? [] : "", false)); } - e18[Pf$2] = f3; + e18[Pf$2] = f4; } catch (t2) { W$1(a3, a3.return, t2); } @@ -5788,9 +5788,9 @@ function dk(a3, b2) { if (null === a3.stateNode) throw Error(p$6(162)); e18 = a3.stateNode; - f3 = a3.memoizedProps; + f4 = a3.memoizedProps; try { - e18.nodeValue = f3; + e18.nodeValue = f4; } catch (t2) { W$1(a3, a3.return, t2); } @@ -5814,7 +5814,7 @@ function dk(a3, b2) { ck(b2, a3); ek$1(a3); e18 = a3.child; - e18.flags & 8192 && (f3 = null !== e18.memoizedState, e18.stateNode.isHidden = f3, !f3 || null !== e18.alternate && null !== e18.alternate.memoizedState || (fk = B$2())); + e18.flags & 8192 && (f4 = null !== e18.memoizedState, e18.stateNode.isHidden = f4, !f4 || null !== e18.alternate && null !== e18.alternate.memoizedState || (fk = B$2())); d4 & 4 && ak(a3); break; case 22: @@ -5837,12 +5837,12 @@ function dk(a3, b2) { break; case 1: Lj(r2, r2.return); - var n4 = r2.stateNode; - if ("function" === typeof n4.componentWillUnmount) { + var n5 = r2.stateNode; + if ("function" === typeof n5.componentWillUnmount) { d4 = r2; c2 = r2.return; try { - b2 = d4, n4.props = b2.memoizedProps, n4.state = b2.memoizedState, n4.componentWillUnmount(); + b2 = d4, n5.props = b2.memoizedProps, n5.state = b2.memoizedState, n5.componentWillUnmount(); } catch (t2) { W$1(d4, c2, t2); } @@ -5867,7 +5867,7 @@ function dk(a3, b2) { if (null === m3) { m3 = q2; try { - e18 = q2.stateNode, l2 ? (f3 = e18.style, "function" === typeof f3.setProperty ? f3.setProperty("display", "none", "important") : f3.display = "none") : (h4 = q2.stateNode, k2 = q2.memoizedProps.style, g3 = void 0 !== k2 && null !== k2 && k2.hasOwnProperty("display") ? k2.display : null, h4.style.display = rb$1("display", g3)); + e18 = q2.stateNode, l2 ? (f4 = e18.style, "function" === typeof f4.setProperty ? f4.setProperty("display", "none", "important") : f4.display = "none") : (h4 = q2.stateNode, k2 = q2.memoizedProps.style, g3 = void 0 !== k2 && null !== k2 && k2.hasOwnProperty("display") ? k2.display : null, h4.style.display = rb$1("display", g3)); } catch (t2) { W$1(a3, a3.return, t2); } @@ -5930,8 +5930,8 @@ function ek$1(a3) { case 5: var e18 = d4.stateNode; d4.flags & 32 && (ob(e18, ""), d4.flags &= -33); - var f3 = Uj(a3); - Wj(a3, f3, e18); + var f4 = Uj(a3); + Wj(a3, f4, e18); break; case 3: case 4: @@ -5954,7 +5954,7 @@ function hk(a3, b2, c2) { } function ik(a3, b2, c2) { for (var d4 = 0 !== (a3.mode & 1); null !== V$3; ) { - var e18 = V$3, f3 = e18.child; + var e18 = V$3, f4 = e18.child; if (22 === e18.tag && d4) { var g3 = null !== e18.memoizedState || Jj; if (!g3) { @@ -5965,15 +5965,15 @@ function ik(a3, b2, c2) { if ((U$2 = k2) && !l2) for (V$3 = e18; null !== V$3; ) g3 = V$3, k2 = g3.child, 22 === g3.tag && null !== g3.memoizedState ? jk(e18) : null !== k2 ? (k2.return = g3, V$3 = k2) : jk(e18); - for (; null !== f3; ) - V$3 = f3, ik(f3), f3 = f3.sibling; + for (; null !== f4; ) + V$3 = f4, ik(f4), f4 = f4.sibling; V$3 = e18; Jj = h4; U$2 = l2; } kk(a3); } else - 0 !== (e18.subtreeFlags & 8772) && null !== f3 ? (f3.return = e18, V$3 = f3) : kk(a3); + 0 !== (e18.subtreeFlags & 8772) && null !== f4 ? (f4.return = e18, V$3 = f4) : kk(a3); } } function kk(a3) { @@ -5998,8 +5998,8 @@ function kk(a3) { var e18 = b2.elementType === b2.type ? c2.memoizedProps : Ci$2(b2.type, c2.memoizedProps); d4.componentDidUpdate(e18, c2.memoizedState, d4.__reactInternalSnapshotBeforeUpdate); } - var f3 = b2.updateQueue; - null !== f3 && sh$1(b2, f3, d4); + var f4 = b2.updateQueue; + null !== f4 && sh$1(b2, f4, d4); break; case 3: var g3 = b2.updateQueue; @@ -6120,11 +6120,11 @@ function jk(a3) { W$1(b2, e18, k2); } } - var f3 = b2.return; + var f4 = b2.return; try { Rj(b2); } catch (k2) { - W$1(b2, f3, k2); + W$1(b2, f4, k2); } break; case 5: @@ -6228,7 +6228,7 @@ function Gk(a3, b2) { b2 = d4; var e18 = K$4; K$4 |= 2; - var f3 = Jk(); + var f4 = Jk(); if (Q$4 !== a3 || Z$1 !== b2) uk = null, Gj = B$2() + 500, Kk(a3, b2); do @@ -6240,7 +6240,7 @@ function Gk(a3, b2) { } while (1); $g(); - mk.current = f3; + mk.current = f4; K$4 = e18; null !== Y ? b2 = 0 : (Q$4 = null, Z$1 = 0, b2 = T$4); } @@ -6252,7 +6252,7 @@ function Gk(a3, b2) { Ck(a3, d4); else { e18 = a3.current.alternate; - if (0 === (d4 & 30) && !Ok(e18) && (b2 = Ik(a3, d4), 2 === b2 && (f3 = xc(a3), 0 !== f3 && (d4 = f3, b2 = Nk(a3, f3))), 1 === b2)) + if (0 === (d4 & 30) && !Ok(e18) && (b2 = Ik(a3, d4), 2 === b2 && (f4 = xc(a3), 0 !== f4 && (d4 = f4, b2 = Nk(a3, f4))), 1 === b2)) throw c2 = pk, Kk(a3, 0), Ck(a3, d4), Dk(a3, B$2()), c2; a3.finishedWork = e18; a3.finishedLanes = d4; @@ -6286,10 +6286,10 @@ function Gk(a3, b2) { b2 = a3.eventTimes; for (e18 = -1; 0 < d4; ) { var g3 = 31 - oc(d4); - f3 = 1 << g3; + f4 = 1 << g3; g3 = b2[g3]; g3 > e18 && (e18 = g3); - d4 &= ~f3; + d4 &= ~f4; } d4 = e18; d4 = B$2() - d4; @@ -6327,10 +6327,10 @@ function Ok(a3) { var c2 = b2.updateQueue; if (null !== c2 && (c2 = c2.stores, null !== c2)) for (var d4 = 0; d4 < c2.length; d4++) { - var e18 = c2[d4], f3 = e18.getSnapshot; + var e18 = c2[d4], f4 = e18.getSnapshot; e18 = e18.value; try { - if (!He(f3(), e18)) + if (!He(f4(), e18)) return false; } catch (g3) { return false; @@ -6464,10 +6464,10 @@ function Kk(a3, b2) { for (b2 = 0; b2 < fh.length; b2++) if (c2 = fh[b2], d4 = c2.interleaved, null !== d4) { c2.interleaved = null; - var e18 = d4.next, f3 = c2.pending; - if (null !== f3) { - var g3 = f3.next; - f3.next = e18; + var e18 = d4.next, f4 = c2.pending; + if (null !== f4) { + var g3 = f4.next; + f4.next = e18; d4.next = g3; } c2.pending = d4; @@ -6502,7 +6502,7 @@ function Mk(a3, b2) { break; } a: { - var f3 = a3, g3 = c2.return, h4 = c2, k2 = b2; + var f4 = a3, g3 = c2.return, h4 = c2, k2 = b2; b2 = Z$1; h4.flags |= 32768; if (null !== k2 && "object" === typeof k2 && "function" === typeof k2.then) { @@ -6514,21 +6514,21 @@ function Mk(a3, b2) { var y3 = Ui$2(g3); if (null !== y3) { y3.flags &= -257; - Vi$1(y3, g3, h4, f3, b2); - y3.mode & 1 && Si$3(f3, l2, b2); + Vi$1(y3, g3, h4, f4, b2); + y3.mode & 1 && Si$3(f4, l2, b2); b2 = y3; k2 = l2; - var n4 = b2.updateQueue; - if (null === n4) { + var n5 = b2.updateQueue; + if (null === n5) { var t2 = /* @__PURE__ */ new Set(); t2.add(k2); b2.updateQueue = t2; } else - n4.add(k2); + n5.add(k2); break a; } else { if (0 === (b2 & 1)) { - Si$3(f3, l2, b2); + Si$3(f4, l2, b2); tj(); break a; } @@ -6538,38 +6538,38 @@ function Mk(a3, b2) { var J2 = Ui$2(g3); if (null !== J2) { 0 === (J2.flags & 65536) && (J2.flags |= 256); - Vi$1(J2, g3, h4, f3, b2); + Vi$1(J2, g3, h4, f4, b2); Jg$1(Ji$1(k2, h4)); break a; } } - f3 = k2 = Ji$1(k2, h4); + f4 = k2 = Ji$1(k2, h4); 4 !== T$4 && (T$4 = 2); - null === sk ? sk = [f3] : sk.push(f3); - f3 = g3; + null === sk ? sk = [f4] : sk.push(f4); + f4 = g3; do { - switch (f3.tag) { + switch (f4.tag) { case 3: - f3.flags |= 65536; + f4.flags |= 65536; b2 &= -b2; - f3.lanes |= b2; - var x3 = Ni$1(f3, k2, b2); - ph$1(f3, x3); + f4.lanes |= b2; + var x3 = Ni$1(f4, k2, b2); + ph$1(f4, x3); break a; case 1: h4 = k2; - var w2 = f3.type, u2 = f3.stateNode; - if (0 === (f3.flags & 128) && ("function" === typeof w2.getDerivedStateFromError || null !== u2 && "function" === typeof u2.componentDidCatch && (null === Ri$2 || !Ri$2.has(u2)))) { - f3.flags |= 65536; + var w2 = f4.type, u2 = f4.stateNode; + if (0 === (f4.flags & 128) && ("function" === typeof w2.getDerivedStateFromError || null !== u2 && "function" === typeof u2.componentDidCatch && (null === Ri$2 || !Ri$2.has(u2)))) { + f4.flags |= 65536; b2 &= -b2; - f3.lanes |= b2; - var F2 = Qi$1(f3, h4, b2); - ph$1(f3, F2); + f4.lanes |= b2; + var F2 = Qi$1(f4, h4, b2); + ph$1(f4, F2); break a; } } - f3 = f3.return; - } while (null !== f3); + f4 = f4.return; + } while (null !== f4); } Sk(c2); } catch (na2) { @@ -6686,16 +6686,16 @@ function Wk(a3, b2, c2, d4) { throw Error(p$6(177)); a3.callbackNode = null; a3.callbackPriority = 0; - var f3 = c2.lanes | c2.childLanes; - Bc(a3, f3); + var f4 = c2.lanes | c2.childLanes; + Bc(a3, f4); a3 === Q$4 && (Y = Q$4 = null, Z$1 = 0); 0 === (c2.subtreeFlags & 2064) && 0 === (c2.flags & 2064) || vk || (vk = true, Fk(hc, function() { Hk(); return null; })); - f3 = 0 !== (c2.flags & 15990); - if (0 !== (c2.subtreeFlags & 15990) || f3) { - f3 = ok.transition; + f4 = 0 !== (c2.flags & 15990); + if (0 !== (c2.subtreeFlags & 15990) || f4) { + f4 = ok.transition; ok.transition = null; var g3 = C$4; C$4 = 1; @@ -6712,12 +6712,12 @@ function Wk(a3, b2, c2, d4) { dc(); K$4 = h4; C$4 = g3; - ok.transition = f3; + ok.transition = f4; } else a3.current = c2; vk && (vk = false, wk = a3, xk = e18); - f3 = a3.pendingLanes; - 0 === f3 && (Ri$2 = null); + f4 = a3.pendingLanes; + 0 === f4 && (Ri$2 = null); mc(c2.stateNode); Dk(a3, B$2()); if (null !== b2) @@ -6726,8 +6726,8 @@ function Wk(a3, b2, c2, d4) { if (Oi$2) throw Oi$2 = false, a3 = Pi$3, Pi$3 = null, a3; 0 !== (xk & 1) && 0 !== a3.tag && Hk(); - f3 = a3.pendingLanes; - 0 !== (f3 & 1) ? a3 === zk ? yk++ : (yk = 0, zk = a3) : yk = 0; + f4 = a3.pendingLanes; + 0 !== (f4 & 1) ? a3 === zk ? yk++ : (yk = 0, zk = a3) : yk = 0; jg$1(); return null; } @@ -6748,9 +6748,9 @@ function Hk() { var e18 = K$4; K$4 |= 4; for (V$3 = a3.current; null !== V$3; ) { - var f3 = V$3, g3 = f3.child; + var f4 = V$3, g3 = f4.child; if (0 !== (V$3.flags & 16)) { - var h4 = f3.deletions; + var h4 = f4.deletions; if (null !== h4) { for (var k2 = 0; k2 < h4.length; k2++) { var l2 = h4[k2]; @@ -6760,7 +6760,7 @@ function Hk() { case 0: case 11: case 15: - Pj(8, m3, f3); + Pj(8, m3, f4); } var q2 = m3.child; if (null !== q2) @@ -6783,11 +6783,11 @@ function Hk() { } } } - var n4 = f3.alternate; - if (null !== n4) { - var t2 = n4.child; + var n5 = f4.alternate; + if (null !== n5) { + var t2 = n5.child; if (null !== t2) { - n4.child = null; + n5.child = null; do { var J2 = t2.sibling; t2.sibling = null; @@ -6795,29 +6795,29 @@ function Hk() { } while (null !== t2); } } - V$3 = f3; + V$3 = f4; } } - if (0 !== (f3.subtreeFlags & 2064) && null !== g3) - g3.return = f3, V$3 = g3; + if (0 !== (f4.subtreeFlags & 2064) && null !== g3) + g3.return = f4, V$3 = g3; else b: for (; null !== V$3; ) { - f3 = V$3; - if (0 !== (f3.flags & 2048)) - switch (f3.tag) { + f4 = V$3; + if (0 !== (f4.flags & 2048)) + switch (f4.tag) { case 0: case 11: case 15: - Pj(9, f3, f3.return); + Pj(9, f4, f4.return); } - var x3 = f3.sibling; + var x3 = f4.sibling; if (null !== x3) { - x3.return = f3.return; + x3.return = f4.return; V$3 = x3; break b; } - V$3 = f3.return; + V$3 = f4.return; } } var w2 = a3.current; @@ -6956,9 +6956,9 @@ Vk = function(a3, b2, c2) { var e18 = Yf$1(b2, H$1.current); ch$1(b2, c2); e18 = Nh$1(null, b2, d4, a3, e18, c2); - var f3 = Sh$1(); + var f4 = Sh$1(); b2.flags |= 1; - "object" === typeof e18 && null !== e18 && "function" === typeof e18.render && void 0 === e18.$$typeof ? (b2.tag = 1, b2.memoizedState = null, b2.updateQueue = null, Zf(d4) ? (f3 = true, cg(b2)) : f3 = false, b2.memoizedState = null !== e18.state && void 0 !== e18.state ? e18.state : null, kh(b2), e18.updater = Ei$1, b2.stateNode = e18, e18._reactInternals = b2, Ii$2(b2, d4, a3, c2), b2 = jj(null, b2, d4, true, f3, c2)) : (b2.tag = 0, I$3 && f3 && vg(b2), Xi$1(null, b2, e18, c2), b2 = b2.child); + "object" === typeof e18 && null !== e18 && "function" === typeof e18.render && void 0 === e18.$$typeof ? (b2.tag = 1, b2.memoizedState = null, b2.updateQueue = null, Zf(d4) ? (f4 = true, cg(b2)) : f4 = false, b2.memoizedState = null !== e18.state && void 0 !== e18.state ? e18.state : null, kh(b2), e18.updater = Ei$1, b2.stateNode = e18, e18._reactInternals = b2, Ii$2(b2, d4, a3, c2), b2 = jj(null, b2, d4, true, f4, c2)) : (b2.tag = 0, I$3 && f4 && vg(b2), Xi$1(null, b2, e18, c2), b2 = b2.child); return b2; case 16: d4 = b2.elementType; @@ -7001,14 +7001,14 @@ Vk = function(a3, b2, c2) { if (null === a3) throw Error(p$6(387)); d4 = b2.pendingProps; - f3 = b2.memoizedState; - e18 = f3.element; + f4 = b2.memoizedState; + e18 = f4.element; lh$1(a3, b2); qh(b2, d4, null, c2); var g3 = b2.memoizedState; d4 = g3.element; - if (f3.isDehydrated) - if (f3 = { element: d4, isDehydrated: false, cache: g3.cache, pendingSuspenseBoundaries: g3.pendingSuspenseBoundaries, transitions: g3.transitions }, b2.updateQueue.baseState = f3, b2.memoizedState = f3, b2.flags & 256) { + if (f4.isDehydrated) + if (f4 = { element: d4, isDehydrated: false, cache: g3.cache, pendingSuspenseBoundaries: g3.pendingSuspenseBoundaries, transitions: g3.transitions }, b2.updateQueue.baseState = f4, b2.memoizedState = f4, b2.flags & 256) { e18 = Ji$1(Error(p$6(423)), b2); b2 = lj(a3, b2, d4, c2, e18); break a; @@ -7031,7 +7031,7 @@ Vk = function(a3, b2, c2) { } return b2; case 5: - return Ah$1(b2), null === a3 && Eg(b2), d4 = b2.type, e18 = b2.pendingProps, f3 = null !== a3 ? a3.memoizedProps : null, g3 = e18.children, Ef$2(d4, e18) ? g3 = null : null !== f3 && Ef$2(d4, f3) && (b2.flags |= 32), gj(a3, b2), Xi$1(a3, b2, g3, c2), b2.child; + return Ah$1(b2), null === a3 && Eg(b2), d4 = b2.type, e18 = b2.pendingProps, f4 = null !== a3 ? a3.memoizedProps : null, g3 = e18.children, Ef$2(d4, e18) ? g3 = null : null !== f4 && Ef$2(d4, f4) && (b2.flags |= 32), gj(a3, b2), Xi$1(a3, b2, g3, c2), b2.child; case 6: return null === a3 && Eg(b2), null; case 13: @@ -7050,27 +7050,27 @@ Vk = function(a3, b2, c2) { a: { d4 = b2.type._context; e18 = b2.pendingProps; - f3 = b2.memoizedProps; + f4 = b2.memoizedProps; g3 = e18.value; G$2(Wg, d4._currentValue); d4._currentValue = g3; - if (null !== f3) - if (He(f3.value, g3)) { - if (f3.children === e18.children && !Wf$1.current) { + if (null !== f4) + if (He(f4.value, g3)) { + if (f4.children === e18.children && !Wf$1.current) { b2 = Zi$1(a3, b2, c2); break a; } } else - for (f3 = b2.child, null !== f3 && (f3.return = b2); null !== f3; ) { - var h4 = f3.dependencies; + for (f4 = b2.child, null !== f4 && (f4.return = b2); null !== f4; ) { + var h4 = f4.dependencies; if (null !== h4) { - g3 = f3.child; + g3 = f4.child; for (var k2 = h4.firstContext; null !== k2; ) { if (k2.context === d4) { - if (1 === f3.tag) { + if (1 === f4.tag) { k2 = mh$1(-1, c2 & -c2); k2.tag = 2; - var l2 = f3.updateQueue; + var l2 = f4.updateQueue; if (null !== l2) { l2 = l2.shared; var m3 = l2.pending; @@ -7078,11 +7078,11 @@ Vk = function(a3, b2, c2) { l2.pending = k2; } } - f3.lanes |= c2; - k2 = f3.alternate; + f4.lanes |= c2; + k2 = f4.alternate; null !== k2 && (k2.lanes |= c2); bh$1( - f3.return, + f4.return, c2, b2 ); @@ -7091,36 +7091,36 @@ Vk = function(a3, b2, c2) { } k2 = k2.next; } - } else if (10 === f3.tag) - g3 = f3.type === b2.type ? null : f3.child; - else if (18 === f3.tag) { - g3 = f3.return; + } else if (10 === f4.tag) + g3 = f4.type === b2.type ? null : f4.child; + else if (18 === f4.tag) { + g3 = f4.return; if (null === g3) throw Error(p$6(341)); g3.lanes |= c2; h4 = g3.alternate; null !== h4 && (h4.lanes |= c2); bh$1(g3, c2, b2); - g3 = f3.sibling; + g3 = f4.sibling; } else - g3 = f3.child; + g3 = f4.child; if (null !== g3) - g3.return = f3; + g3.return = f4; else - for (g3 = f3; null !== g3; ) { + for (g3 = f4; null !== g3; ) { if (g3 === b2) { g3 = null; break; } - f3 = g3.sibling; - if (null !== f3) { - f3.return = g3.return; - g3 = f3; + f4 = g3.sibling; + if (null !== f4) { + f4.return = g3.return; + g3 = f4; break; } g3 = g3.return; } - f3 = g3; + f4 = g3; } Xi$1(a3, b2, e18.children, c2); b2 = b2.child; @@ -7194,7 +7194,7 @@ function Pg(a3, b2) { c2.ref = a3.ref; return c2; } -function Rg(a3, b2, c2, d4, e18, f3) { +function Rg(a3, b2, c2, d4, e18, f4) { var g3 = 2; d4 = a3; if ("function" === typeof a3) @@ -7205,19 +7205,19 @@ function Rg(a3, b2, c2, d4, e18, f3) { a: switch (a3) { case ya$3: - return Tg(c2.children, e18, f3, b2); + return Tg(c2.children, e18, f4, b2); case za$2: g3 = 8; e18 |= 8; break; case Aa$2: - return a3 = Bg(12, c2, b2, e18 | 2), a3.elementType = Aa$2, a3.lanes = f3, a3; + return a3 = Bg(12, c2, b2, e18 | 2), a3.elementType = Aa$2, a3.lanes = f4, a3; case Ea$2: - return a3 = Bg(13, c2, b2, e18), a3.elementType = Ea$2, a3.lanes = f3, a3; + return a3 = Bg(13, c2, b2, e18), a3.elementType = Ea$2, a3.lanes = f4, a3; case Fa$3: - return a3 = Bg(19, c2, b2, e18), a3.elementType = Fa$3, a3.lanes = f3, a3; + return a3 = Bg(19, c2, b2, e18), a3.elementType = Fa$3, a3.lanes = f4, a3; case Ia$2: - return pj(c2, e18, f3, b2); + return pj(c2, e18, f4, b2); default: if ("object" === typeof a3 && null !== a3) switch (a3.$$typeof) { @@ -7243,7 +7243,7 @@ function Rg(a3, b2, c2, d4, e18, f3) { b2 = Bg(g3, c2, b2, e18); b2.elementType = a3; b2.type = d4; - b2.lanes = f3; + b2.lanes = f4; return b2; } function Tg(a3, b2, c2, d4) { @@ -7284,14 +7284,14 @@ function al(a3, b2, c2, d4, e18) { this.onRecoverableError = e18; this.mutableSourceEagerHydrationData = null; } -function bl(a3, b2, c2, d4, e18, f3, g3, h4, k2) { +function bl(a3, b2, c2, d4, e18, f4, g3, h4, k2) { a3 = new al(a3, b2, c2, h4, k2); - 1 === b2 ? (b2 = 1, true === f3 && (b2 |= 8)) : b2 = 0; - f3 = Bg(3, null, null, b2); - a3.current = f3; - f3.stateNode = a3; - f3.memoizedState = { element: d4, isDehydrated: c2, cache: null, transitions: null, pendingSuspenseBoundaries: null }; - kh(f3); + 1 === b2 ? (b2 = 1, true === f4 && (b2 |= 8)) : b2 = 0; + f4 = Bg(3, null, null, b2); + a3.current = f4; + f4.stateNode = a3; + f4.memoizedState = { element: d4, isDehydrated: c2, cache: null, transitions: null, pendingSuspenseBoundaries: null }; + kh(f4); return a3; } function cl(a3, b2, c2) { @@ -7328,30 +7328,30 @@ function dl(a3) { } return b2; } -function el$1(a3, b2, c2, d4, e18, f3, g3, h4, k2) { - a3 = bl(c2, d4, true, a3, e18, f3, g3, h4, k2); +function el$1(a3, b2, c2, d4, e18, f4, g3, h4, k2) { + a3 = bl(c2, d4, true, a3, e18, f4, g3, h4, k2); a3.context = dl(null); c2 = a3.current; d4 = R$3(); e18 = yi$2(c2); - f3 = mh$1(d4, e18); - f3.callback = void 0 !== b2 && null !== b2 ? b2 : null; - nh(c2, f3, e18); + f4 = mh$1(d4, e18); + f4.callback = void 0 !== b2 && null !== b2 ? b2 : null; + nh(c2, f4, e18); a3.current.lanes = e18; Ac(a3, e18, d4); Dk(a3, d4); return a3; } function fl(a3, b2, c2, d4) { - var e18 = b2.current, f3 = R$3(), g3 = yi$2(e18); + var e18 = b2.current, f4 = R$3(), g3 = yi$2(e18); c2 = dl(c2); null === b2.context ? b2.context = c2 : b2.pendingContext = c2; - b2 = mh$1(f3, g3); + b2 = mh$1(f4, g3); b2.payload = { element: a3 }; d4 = void 0 === d4 ? null : d4; null !== d4 && (b2.callback = d4); a3 = nh(e18, b2, g3); - null !== a3 && (gi$2(a3, e18, g3, f3), oh(a3, e18, g3)); + null !== a3 && (gi$2(a3, e18, g3, f4), oh(a3, e18, g3)); return g3; } function gl(a3) { @@ -7426,10 +7426,10 @@ function pl() { function ql(a3, b2, c2, d4, e18) { if (e18) { if ("function" === typeof d4) { - var f3 = d4; + var f4 = d4; d4 = function() { var a4 = gl(g3); - f3.call(a4); + f4.call(a4); }; } var g3 = el$1(b2, d4, a3, 0, null, false, false, "", pl); @@ -7458,9 +7458,9 @@ function ql(a3, b2, c2, d4, e18) { return k2; } function rl$1(a3, b2, c2, d4, e18) { - var f3 = c2._reactRootContainer; - if (f3) { - var g3 = f3; + var f4 = c2._reactRootContainer; + if (f4) { + var g3 = f4; if ("function" === typeof e18) { var h4 = e18; e18 = function() { @@ -7610,9 +7610,9 @@ reactDom_production_min.hydrate = function(a3, b2, c2) { reactDom_production_min.hydrateRoot = function(a3, b2, c2) { if (!nl(a3)) throw Error(p$6(405)); - var d4 = null != c2 && c2.hydratedSources || null, e18 = false, f3 = "", g3 = kl; - null !== c2 && void 0 !== c2 && (true === c2.unstable_strictMode && (e18 = true), void 0 !== c2.identifierPrefix && (f3 = c2.identifierPrefix), void 0 !== c2.onRecoverableError && (g3 = c2.onRecoverableError)); - b2 = el$1(b2, null, a3, 1, null != c2 ? c2 : null, e18, false, f3, g3); + var d4 = null != c2 && c2.hydratedSources || null, e18 = false, f4 = "", g3 = kl; + null !== c2 && void 0 !== c2 && (true === c2.unstable_strictMode && (e18 = true), void 0 !== c2.identifierPrefix && (f4 = c2.identifierPrefix), void 0 !== c2.onRecoverableError && (g3 = c2.onRecoverableError)); + b2 = el$1(b2, null, a3, 1, null != c2 ? c2 : null, e18, false, f4, g3); a3[uf$1] = b2.current; sf(a3); if (d4) @@ -7668,6 +7668,57 @@ var m$5 = reactDomExports; createRoot = client.createRoot = m$5.createRoot; client.hydrateRoot = m$5.hydrateRoot; } +const scriptRel = "modulepreload"; +const assetsURL = function(dep, importerUrl) { + return new URL(dep, importerUrl).href; +}; +const seen = {}; +const __vitePreload = function preload(baseModule, deps, importerUrl) { + if (!deps || deps.length === 0) { + return baseModule(); + } + const links = document.getElementsByTagName("link"); + return Promise.all(deps.map((dep) => { + dep = assetsURL(dep, importerUrl); + if (dep in seen) + return; + seen[dep] = true; + const isCss = dep.endsWith(".css"); + const cssSelector = isCss ? '[rel="stylesheet"]' : ""; + const isBaseRelative = !!importerUrl; + if (isBaseRelative) { + for (let i2 = links.length - 1; i2 >= 0; i2--) { + const link2 = links[i2]; + if (link2.href === dep && (!isCss || link2.rel === "stylesheet")) { + return; + } + } + } else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) { + return; + } + const link = document.createElement("link"); + link.rel = isCss ? "stylesheet" : scriptRel; + if (!isCss) { + link.as = "script"; + link.crossOrigin = ""; + } + link.href = dep; + document.head.appendChild(link); + if (isCss) { + return new Promise((res, rej) => { + link.addEventListener("load", res); + link.addEventListener("error", () => rej(new Error(`Unable to preload CSS for ${dep}`))); + }); + } + })).then(() => baseModule()).catch((err) => { + const e18 = new Event("vite:preloadError", { cancelable: true }); + e18.payload = err; + window.dispatchEvent(e18); + if (!e18.defaultPrevented) { + throw err; + } + }); +}; const TrustWalletTransparentIcon = (props) => { return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", ...props, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("mask", { id: "mask0_3705_16119", maskUnits: "userSpaceOnUse", x: "6", y: "5", width: "28", height: "30", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M6.66699 5H33.3337V34.6187H6.66699V5Z", fill: "white" }) }), @@ -7781,18 +7832,6 @@ const trustWalletConfig = { }, spinnerColor: "#1098FC" }; -function isHex$1(value, { strict = true } = {}) { - if (!value) - return false; - if (typeof value !== "string") - return false; - return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x"); -} -function size$2(value) { - if (isHex$1(value, { strict: false })) - return Math.ceil((value.length - 2) / 2); - return value.length; -} const version$7 = "2.21.49"; let errorConfig = { getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0, @@ -7878,6 +7917,16 @@ function walk(err, fn2) { return walk(err.cause, fn2); return fn2 ? null : err; } +class IntegerOutOfRangeError extends BaseError$2 { + constructor({ max, min, signed, size: size2, value }) { + super(`Number "${value}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" }); + } +} +class SizeOverflowError extends BaseError$2 { + constructor({ givenSize, maxSize }) { + super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" }); + } +} class SizeExceedsPaddingSizeError extends BaseError$2 { constructor({ size: size2, targetSize, type: type2 }) { super(`${type2.charAt(0).toUpperCase()}${type2.slice(1).toLowerCase()} size (${size2}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" }); @@ -7910,21 +7959,92 @@ function padBytes(bytes2, { dir, size: size2 = 32 } = {}) { type: "bytes" }); const paddedBytes = new Uint8Array(size2); - for (let i3 = 0; i3 < size2; i3++) { + for (let i2 = 0; i2 < size2; i2++) { const padEnd = dir === "right"; - paddedBytes[padEnd ? i3 : size2 - i3 - 1] = bytes2[padEnd ? i3 : bytes2.length - i3 - 1]; + paddedBytes[padEnd ? i2 : size2 - i2 - 1] = bytes2[padEnd ? i2 : bytes2.length - i2 - 1]; } return paddedBytes; } -class IntegerOutOfRangeError extends BaseError$2 { - constructor({ max, min, signed, size: size2, value }) { - super(`Number "${value}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" }); +function isHex$1(value, { strict = true } = {}) { + if (!value) + return false; + if (typeof value !== "string") + return false; + return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x"); +} +function size$2(value) { + if (isHex$1(value, { strict: false })) + return Math.ceil((value.length - 2) / 2); + return value.length; +} +const encoder$1 = /* @__PURE__ */ new TextEncoder(); +function toBytes$3(value, opts = {}) { + if (typeof value === "number" || typeof value === "bigint") + return numberToBytes(value, opts); + if (typeof value === "boolean") + return boolToBytes(value, opts); + if (isHex$1(value)) + return hexToBytes$2(value, opts); + return stringToBytes$2(value, opts); +} +function boolToBytes(value, opts = {}) { + const bytes2 = new Uint8Array(1); + bytes2[0] = Number(value); + if (typeof opts.size === "number") { + assertSize(bytes2, { size: opts.size }); + return pad(bytes2, { size: opts.size }); } + return bytes2; } -class SizeOverflowError extends BaseError$2 { - constructor({ givenSize, maxSize }) { - super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" }); +const charCodeMap = { + zero: 48, + nine: 57, + A: 65, + F: 70, + a: 97, + f: 102 +}; +function charCodeToBase16(char) { + if (char >= charCodeMap.zero && char <= charCodeMap.nine) + return char - charCodeMap.zero; + if (char >= charCodeMap.A && char <= charCodeMap.F) + return char - (charCodeMap.A - 10); + if (char >= charCodeMap.a && char <= charCodeMap.f) + return char - (charCodeMap.a - 10); + return void 0; +} +function hexToBytes$2(hex_, opts = {}) { + let hex = hex_; + if (opts.size) { + assertSize(hex, { size: opts.size }); + hex = pad(hex, { dir: "right", size: opts.size }); + } + let hexString = hex.slice(2); + if (hexString.length % 2) + hexString = `0${hexString}`; + const length = hexString.length / 2; + const bytes2 = new Uint8Array(length); + for (let index2 = 0, j2 = 0; index2 < length; index2++) { + const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j2++)); + const nibbleRight = charCodeToBase16(hexString.charCodeAt(j2++)); + if (nibbleLeft === void 0 || nibbleRight === void 0) { + throw new BaseError$2(`Invalid byte sequence ("${hexString[j2 - 2]}${hexString[j2 - 1]}" in "${hexString}").`); + } + bytes2[index2] = nibbleLeft * 16 + nibbleRight; } + return bytes2; +} +function numberToBytes(value, opts) { + const hex = numberToHex(value, opts); + return hexToBytes$2(hex); +} +function stringToBytes$2(value, opts = {}) { + const bytes2 = encoder$1.encode(value); + if (typeof opts.size === "number") { + assertSize(bytes2, { size: opts.size }); + return pad(bytes2, { dir: "right", size: opts.size }); + } + return bytes2; } function assertSize(hexOrBytes, { size: size2 }) { if (size$2(hexOrBytes) > size2) @@ -7933,7 +8053,7 @@ function assertSize(hexOrBytes, { size: size2 }) { maxSize: size2 }); } -const hexes$3 = /* @__PURE__ */ Array.from({ length: 256 }, (_v3, i3) => i3.toString(16).padStart(2, "0")); +const hexes$3 = /* @__PURE__ */ Array.from({ length: 256 }, (_v3, i2) => i2.toString(16).padStart(2, "0")); function toHex$3(value, opts = {}) { if (typeof value === "number" || typeof value === "bigint") return numberToHex(value, opts); @@ -7954,8 +8074,8 @@ function boolToHex(value, opts = {}) { } function bytesToHex$3(value, opts = {}) { let string2 = ""; - for (let i3 = 0; i3 < value.length; i3++) { - string2 += hexes$3[value[i3]]; + for (let i2 = 0; i2 < value.length; i2++) { + string2 += hexes$3[value[i2]]; } const hex = `0x${string2}`; if (typeof opts.size === "number") { @@ -7992,83 +8112,54 @@ function numberToHex(value_, opts = {}) { return pad(hex, { size: size2 }); return hex; } -const encoder$1 = /* @__PURE__ */ new TextEncoder(); +const encoder = /* @__PURE__ */ new TextEncoder(); function stringToHex(value_, opts = {}) { - const value = encoder$1.encode(value_); + const value = encoder.encode(value_); return bytesToHex$3(value, opts); } -const encoder = /* @__PURE__ */ new TextEncoder(); -function toBytes$3(value, opts = {}) { - if (typeof value === "number" || typeof value === "bigint") - return numberToBytes(value, opts); - if (typeof value === "boolean") - return boolToBytes(value, opts); - if (isHex$1(value)) - return hexToBytes$2(value, opts); - return stringToBytes$2(value, opts); -} -function boolToBytes(value, opts = {}) { - const bytes2 = new Uint8Array(1); - bytes2[0] = Number(value); - if (typeof opts.size === "number") { - assertSize(bytes2, { size: opts.size }); - return pad(bytes2, { size: opts.size }); +class InvalidAddressError extends BaseError$2 { + constructor({ address: address2 }) { + super(`Address "${address2}" is invalid.`, { + metaMessages: [ + "- Address must be a hex value of 20 bytes (40 hex characters).", + "- Address must match its checksum counterpart." + ], + name: "InvalidAddressError" + }); } - return bytes2; } -const charCodeMap = { - zero: 48, - nine: 57, - A: 65, - F: 70, - a: 97, - f: 102 -}; -function charCodeToBase16(char) { - if (char >= charCodeMap.zero && char <= charCodeMap.nine) - return char - charCodeMap.zero; - if (char >= charCodeMap.A && char <= charCodeMap.F) - return char - (charCodeMap.A - 10); - if (char >= charCodeMap.a && char <= charCodeMap.f) - return char - (charCodeMap.a - 10); - return void 0; -} -function hexToBytes$2(hex_, opts = {}) { - let hex = hex_; - if (opts.size) { - assertSize(hex, { size: opts.size }); - hex = pad(hex, { dir: "right", size: opts.size }); +class LruMap extends Map { + constructor(size2) { + super(); + Object.defineProperty(this, "maxSize", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + this.maxSize = size2; } - let hexString = hex.slice(2); - if (hexString.length % 2) - hexString = `0${hexString}`; - const length = hexString.length / 2; - const bytes2 = new Uint8Array(length); - for (let index2 = 0, j2 = 0; index2 < length; index2++) { - const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j2++)); - const nibbleRight = charCodeToBase16(hexString.charCodeAt(j2++)); - if (nibbleLeft === void 0 || nibbleRight === void 0) { - throw new BaseError$2(`Invalid byte sequence ("${hexString[j2 - 2]}${hexString[j2 - 1]}" in "${hexString}").`); + get(key2) { + const value = super.get(key2); + if (super.has(key2) && value !== void 0) { + this.delete(key2); + super.set(key2, value); } - bytes2[index2] = nibbleLeft * 16 + nibbleRight; + return value; } - return bytes2; -} -function numberToBytes(value, opts) { - const hex = numberToHex(value, opts); - return hexToBytes$2(hex); -} -function stringToBytes$2(value, opts = {}) { - const bytes2 = encoder.encode(value); - if (typeof opts.size === "number") { - assertSize(bytes2, { size: opts.size }); - return pad(bytes2, { dir: "right", size: opts.size }); + set(key2, value) { + super.set(key2, value); + if (this.maxSize && this.size > this.maxSize) { + const firstKey = this.keys().next().value; + if (firstKey) + this.delete(firstKey); + } + return this; } - return bytes2; } -function number$3(n4) { - if (!Number.isSafeInteger(n4) || n4 < 0) - throw new Error(`positive integer expected, not ${n4}`); +function number$3(n5) { + if (!Number.isSafeInteger(n5) || n5 < 0) + throw new Error(`positive integer expected, not ${n5}`); } function isBytes$2(a3) { return a3 instanceof Uint8Array || a3 != null && typeof a3 === "object" && a3.constructor.name === "Uint8Array"; @@ -8094,17 +8185,17 @@ function output$2(out, instance2) { } const U32_MASK64$2 = /* @__PURE__ */ BigInt(2 ** 32 - 1); const _32n$2 = /* @__PURE__ */ BigInt(32); -function fromBig$2(n4, le2 = false) { +function fromBig$2(n5, le2 = false) { if (le2) - return { h: Number(n4 & U32_MASK64$2), l: Number(n4 >> _32n$2 & U32_MASK64$2) }; - return { h: Number(n4 >> _32n$2 & U32_MASK64$2) | 0, l: Number(n4 & U32_MASK64$2) | 0 }; + return { h: Number(n5 & U32_MASK64$2), l: Number(n5 >> _32n$2 & U32_MASK64$2) }; + return { h: Number(n5 >> _32n$2 & U32_MASK64$2) | 0, l: Number(n5 & U32_MASK64$2) | 0 }; } function split$2(lst, le2 = false) { let Ah2 = new Uint32Array(lst.length); let Al = new Uint32Array(lst.length); - for (let i3 = 0; i3 < lst.length; i3++) { - const { h: h4, l: l2 } = fromBig$2(lst[i3], le2); - [Ah2[i3], Al[i3]] = [h4, l2]; + for (let i2 = 0; i2 < lst.length; i2++) { + const { h: h4, l: l2 } = fromBig$2(lst[i2], le2); + [Ah2[i2], Al[i2]] = [h4, l2]; } return [Ah2, Al]; } @@ -8119,16 +8210,16 @@ const rotr$2 = (word, shift) => word << 32 - shift | word >>> shift; const isLE$1 = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; const byteSwap = (word) => word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255; function byteSwap32(arr) { - for (let i3 = 0; i3 < arr.length; i3++) { - arr[i3] = byteSwap(arr[i3]); + for (let i2 = 0; i2 < arr.length; i2++) { + arr[i2] = byteSwap(arr[i2]); } } -const hexes$2 = /* @__PURE__ */ Array.from({ length: 256 }, (_3, i3) => i3.toString(16).padStart(2, "0")); +const hexes$2 = /* @__PURE__ */ Array.from({ length: 256 }, (_3, i2) => i2.toString(16).padStart(2, "0")); function bytesToHex$2(bytes2) { bytes$3(bytes2); let hex = ""; - for (let i3 = 0; i3 < bytes2.length; i3++) { - hex += hexes$2[bytes2[i3]]; + for (let i2 = 0; i2 < bytes2.length; i2++) { + hex += hexes$2[bytes2[i2]]; } return hex; } @@ -8256,7 +8347,7 @@ let Keccak$1 = class Keccak extends Hash$2 { const len = data.length; for (let pos = 0; pos < len; ) { const take = Math.min(blockLen - this.pos, len - pos); - for (let i3 = 0; i3 < take; i3++) + for (let i2 = 0; i2 < take; i2++) state[this.pos++] ^= data[pos++]; if (this.pos === blockLen) this.keccak(); @@ -8338,46 +8429,6 @@ function keccak256$1(value, to_) { return bytes2; return toHex$3(bytes2); } -class InvalidAddressError extends BaseError$2 { - constructor({ address: address2 }) { - super(`Address "${address2}" is invalid.`, { - metaMessages: [ - "- Address must be a hex value of 20 bytes (40 hex characters).", - "- Address must match its checksum counterpart." - ], - name: "InvalidAddressError" - }); - } -} -class LruMap extends Map { - constructor(size2) { - super(); - Object.defineProperty(this, "maxSize", { - enumerable: true, - configurable: true, - writable: true, - value: void 0 - }); - this.maxSize = size2; - } - get(key2) { - const value = super.get(key2); - if (super.has(key2) && value !== void 0) { - this.delete(key2); - super.set(key2, value); - } - return value; - } - set(key2, value) { - super.set(key2, value); - if (this.maxSize && this.size > this.maxSize) { - const firstKey = this.keys().next().value; - if (firstKey) - this.delete(firstKey); - } - return this; - } -} const checksumAddressCache = /* @__PURE__ */ new LruMap(8192); function checksumAddress(address_, chainId) { if (checksumAddressCache.has(`${address_}.${chainId}`)) @@ -8385,12 +8436,12 @@ function checksumAddress(address_, chainId) { const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase(); const hash3 = keccak256$1(stringToBytes$2(hexAddress), "bytes"); const address2 = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split(""); - for (let i3 = 0; i3 < 40; i3 += 2) { - if (hash3[i3 >> 1] >> 4 >= 8 && address2[i3]) { - address2[i3] = address2[i3].toUpperCase(); + for (let i2 = 0; i2 < 40; i2 += 2) { + if (hash3[i2 >> 1] >> 4 >= 8 && address2[i2]) { + address2[i2] = address2[i2].toUpperCase(); } - if ((hash3[i3 >> 1] & 15) >= 8 && address2[i3 + 1]) { - address2[i3 + 1] = address2[i3 + 1].toUpperCase(); + if ((hash3[i2 >> 1] & 15) >= 8 && address2[i2 + 1]) { + address2[i2 + 1] = address2[i2 + 1].toUpperCase(); } } const result = `0x${address2.join("")}`; @@ -8820,57 +8871,6 @@ class UnknownRpcError extends RpcError { }); } } -const scriptRel = "modulepreload"; -const assetsURL = function(dep, importerUrl) { - return new URL(dep, importerUrl).href; -}; -const seen = {}; -const __vitePreload = function preload(baseModule, deps, importerUrl) { - if (!deps || deps.length === 0) { - return baseModule(); - } - const links = document.getElementsByTagName("link"); - return Promise.all(deps.map((dep) => { - dep = assetsURL(dep, importerUrl); - if (dep in seen) - return; - seen[dep] = true; - const isCss = dep.endsWith(".css"); - const cssSelector = isCss ? '[rel="stylesheet"]' : ""; - const isBaseRelative = !!importerUrl; - if (isBaseRelative) { - for (let i3 = links.length - 1; i3 >= 0; i3--) { - const link2 = links[i3]; - if (link2.href === dep && (!isCss || link2.rel === "stylesheet")) { - return; - } - } - } else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) { - return; - } - const link = document.createElement("link"); - link.rel = isCss ? "stylesheet" : scriptRel; - if (!isCss) { - link.as = "script"; - link.crossOrigin = ""; - } - link.href = dep; - document.head.appendChild(link); - if (isCss) { - return new Promise((res, rej) => { - link.addEventListener("load", res); - link.addEventListener("error", () => rej(new Error(`Unable to preload CSS for ${dep}`))); - }); - } - })).then(() => baseModule()).catch((err) => { - const e18 = new Event("vite:preloadError", { cancelable: true }); - e18.payload = err; - window.dispatchEvent(e18); - if (!e18.defaultPrevented) { - throw err; - } - }); -}; function withResolvers() { let resolve = () => void 0; let reject = () => void 0; @@ -8891,13 +8891,13 @@ function createBatchScheduler({ fn: fn2, id: id2, shouldSplitBatch, wait: wait2 fn2(args).then((data) => { if (sort && Array.isArray(data)) data.sort(sort); - for (let i3 = 0; i3 < scheduler2.length; i3++) { - const { resolve } = scheduler2[i3]; - resolve == null ? void 0 : resolve([data[i3], data]); + for (let i2 = 0; i2 < scheduler2.length; i2++) { + const { resolve } = scheduler2[i2]; + resolve == null ? void 0 : resolve([data[i2], data]); } }).catch((err) => { - for (let i3 = 0; i3 < scheduler2.length; i3++) { - const { reject } = scheduler2[i3]; + for (let i2 = 0; i2 < scheduler2.length; i2++) { + const { reject } = scheduler2[i2]; reject == null ? void 0 : reject(err); } }); @@ -8927,53 +8927,6 @@ function createBatchScheduler({ fn: fn2, id: id2, shouldSplitBatch, wait: wait2 async function wait(time2) { return new Promise((res) => setTimeout(res, time2)); } -const size$1 = 256; -let index$1 = size$1; -let buffer$2; -function uid$1(length = 11) { - if (!buffer$2 || index$1 + length > size$1 * 2) { - buffer$2 = ""; - index$1 = 0; - for (let i3 = 0; i3 < size$1; i3++) { - buffer$2 += (256 + Math.random() * 256 | 0).toString(16).substring(1); - } - } - return buffer$2.substring(index$1, index$1++ + length); -} -function createClient(parameters) { - const { batch, cacheTime = parameters.pollingInterval ?? 4e3, ccipRead, key: key2 = "base", name: name2 = "Base Client", pollingInterval = 4e3, type: type2 = "base" } = parameters; - const chain = parameters.chain; - const account = parameters.account ? parseAccount(parameters.account) : void 0; - const { config: config2, request, value } = parameters.transport({ - chain, - pollingInterval - }); - const transport = { ...config2, ...value }; - const client2 = { - account, - batch, - cacheTime, - ccipRead, - chain, - key: key2, - name: name2, - pollingInterval, - request, - transport, - type: type2, - uid: uid$1() - }; - function extend2(base3) { - return (extendFn) => { - const extended = extendFn(base3); - for (const key3 in client2) - delete extended[key3]; - const combined = { ...base3, ...extended }; - return Object.assign(combined, { extend: extend2(combined) }); - }; - } - return Object.assign(client2, { extend: extend2(client2) }); -} const promiseCache = /* @__PURE__ */ new LruMap(8192); function withDedupe(fn2, { enabled = true, id: id2 }) { if (!enabled || !id2) @@ -9110,30 +9063,14 @@ function shouldRetry(error) { } return true; } -function createTransport({ key: key2, name: name2, request, retryCount = 3, retryDelay = 150, timeout, type: type2 }, value) { - const uid2 = uid$1(); +function defineChain(chain) { return { - config: { - key: key2, - name: name2, - request, - retryCount, - retryDelay, - timeout, - type: type2 - }, - request: buildRequest(request, { retryCount, retryDelay, uid: uid2 }), - value + formatters: void 0, + fees: void 0, + serializers: void 0, + ...chain }; } -class UrlRequiredError extends BaseError$2 { - constructor() { - super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.", { - docsPath: "/docs/clients/intro", - name: "UrlRequiredError" - }); - } -} function withTimeout(fn2, { errorInstance = new Error("timed out"), timeout, signal }) { return new Promise((resolve, reject) => { (async () => { @@ -9250,77 +9187,14 @@ function getHttpRpcClient(url, options = {}) { } }; } -function http(url, config2 = {}) { - const { batch, fetchOptions, key: key2 = "http", name: name2 = "HTTP JSON-RPC", onFetchRequest, onFetchResponse, retryDelay } = config2; - return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => { - const { batchSize = 1e3, wait: wait2 = 0 } = typeof batch === "object" ? batch : {}; - const retryCount = config2.retryCount ?? retryCount_; - const timeout = timeout_ ?? config2.timeout ?? 1e4; - const url_ = url || (chain == null ? void 0 : chain.rpcUrls.default.http[0]); - if (!url_) - throw new UrlRequiredError(); - const rpcClient = getHttpRpcClient(url_, { - fetchOptions, - onRequest: onFetchRequest, - onResponse: onFetchResponse, - timeout - }); - return createTransport({ - key: key2, - name: name2, - async request({ method, params }) { - const body = { method, params }; - const { schedule } = createBatchScheduler({ - id: url_, - wait: wait2, - shouldSplitBatch(requests) { - return requests.length > batchSize; - }, - fn: (body2) => rpcClient.request({ - body: body2 - }), - sort: (a3, b2) => a3.id - b2.id - }); - const fn2 = async (body2) => batch ? schedule(body2) : [ - await rpcClient.request({ - body: body2 - }) - ]; - const [{ error, result }] = await fn2(body); - if (error) - throw new RpcRequestError({ - body, - error, - url: url_ - }); - return result; - }, - retryCount, - retryDelay, - timeout, - type: "http" - }, { - fetchOptions, - url: url_ - }); - }; -} -function defineChain(chain) { - return { - formatters: void 0, - fees: void 0, - serializers: void 0, - ...chain - }; -} const version$6 = "2.15.0"; const getVersion$1 = () => `@wagmi/core@${version$6}`; -var __classPrivateFieldGet$5 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f3) { - if (kind === "a" && !f3) +var __classPrivateFieldGet$5 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f4) { + if (kind === "a" && !f4) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f3 : kind === "a" ? f3.call(receiver) : f3 ? f3.value : state.get(receiver); + return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver); }; var _BaseError_instances, _BaseError_walk; let BaseError$1 = class BaseError2 extends Error { @@ -9454,6 +9328,132 @@ async function connect(config2, parameters) { throw error; } } +const size$1 = 256; +let index$1 = size$1; +let buffer$2; +function uid$1(length = 11) { + if (!buffer$2 || index$1 + length > size$1 * 2) { + buffer$2 = ""; + index$1 = 0; + for (let i2 = 0; i2 < size$1; i2++) { + buffer$2 += (256 + Math.random() * 256 | 0).toString(16).substring(1); + } + } + return buffer$2.substring(index$1, index$1++ + length); +} +function createClient(parameters) { + const { batch, cacheTime = parameters.pollingInterval ?? 4e3, ccipRead, key: key2 = "base", name: name2 = "Base Client", pollingInterval = 4e3, type: type2 = "base" } = parameters; + const chain = parameters.chain; + const account = parameters.account ? parseAccount(parameters.account) : void 0; + const { config: config2, request, value } = parameters.transport({ + chain, + pollingInterval + }); + const transport = { ...config2, ...value }; + const client2 = { + account, + batch, + cacheTime, + ccipRead, + chain, + key: key2, + name: name2, + pollingInterval, + request, + transport, + type: type2, + uid: uid$1() + }; + function extend2(base3) { + return (extendFn) => { + const extended = extendFn(base3); + for (const key3 in client2) + delete extended[key3]; + const combined = { ...base3, ...extended }; + return Object.assign(combined, { extend: extend2(combined) }); + }; + } + return Object.assign(client2, { extend: extend2(client2) }); +} +function createTransport({ key: key2, name: name2, request, retryCount = 3, retryDelay = 150, timeout, type: type2 }, value) { + const uid2 = uid$1(); + return { + config: { + key: key2, + name: name2, + request, + retryCount, + retryDelay, + timeout, + type: type2 + }, + request: buildRequest(request, { retryCount, retryDelay, uid: uid2 }), + value + }; +} +class UrlRequiredError extends BaseError$2 { + constructor() { + super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.", { + docsPath: "/docs/clients/intro", + name: "UrlRequiredError" + }); + } +} +function http(url, config2 = {}) { + const { batch, fetchOptions, key: key2 = "http", name: name2 = "HTTP JSON-RPC", onFetchRequest, onFetchResponse, retryDelay } = config2; + return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => { + const { batchSize = 1e3, wait: wait2 = 0 } = typeof batch === "object" ? batch : {}; + const retryCount = config2.retryCount ?? retryCount_; + const timeout = timeout_ ?? config2.timeout ?? 1e4; + const url_ = url || (chain == null ? void 0 : chain.rpcUrls.default.http[0]); + if (!url_) + throw new UrlRequiredError(); + const rpcClient = getHttpRpcClient(url_, { + fetchOptions, + onRequest: onFetchRequest, + onResponse: onFetchResponse, + timeout + }); + return createTransport({ + key: key2, + name: name2, + async request({ method, params }) { + const body = { method, params }; + const { schedule } = createBatchScheduler({ + id: url_, + wait: wait2, + shouldSplitBatch(requests) { + return requests.length > batchSize; + }, + fn: (body2) => rpcClient.request({ + body: body2 + }), + sort: (a3, b2) => a3.id - b2.id + }); + const fn2 = async (body2) => batch ? schedule(body2) : [ + await rpcClient.request({ + body: body2 + }) + ]; + const [{ error, result }] = await fn2(body); + if (error) + throw new RpcRequestError({ + body, + error, + url: url_ + }); + return result; + }, + retryCount, + retryDelay, + timeout, + type: "http" + }, { + fetchOptions, + url: url_ + }); + }; +} async function disconnect(config2, parameters = {}) { var _a3, _b2; let connector; @@ -9566,13 +9566,13 @@ function deepEqual(a3, b2) { if (a3.constructor !== b2.constructor) return false; let length; - let i3; + let i2; if (Array.isArray(a3) && Array.isArray(b2)) { length = a3.length; if (length !== b2.length) return false; - for (i3 = length; i3-- !== 0; ) - if (!deepEqual(a3[i3], b2[i3])) + for (i2 = length; i2-- !== 0; ) + if (!deepEqual(a3[i2], b2[i2])) return false; return true; } @@ -9584,11 +9584,11 @@ function deepEqual(a3, b2) { length = keys2.length; if (length !== Object.keys(b2).length) return false; - for (i3 = length; i3-- !== 0; ) - if (!Object.prototype.hasOwnProperty.call(b2, keys2[i3])) + for (i2 = length; i2-- !== 0; ) + if (!Object.prototype.hasOwnProperty.call(b2, keys2[i2])) return false; - for (i3 = length; i3-- !== 0; ) { - const key2 = keys2[i3]; + for (i2 = length; i2-- !== 0; ) { + const key2 = keys2[i2]; if (key2 && !deepEqual(a3[key2], b2[key2])) return false; } @@ -10538,8 +10538,8 @@ var eventemitter3$2 = { exports: {} }; return []; if (handlers.fn) return [handlers.fn]; - for (var i3 = 0, l2 = handlers.length, ee2 = new Array(l2); i3 < l2; i3++) { - ee2[i3] = handlers[i3].fn; + for (var i2 = 0, l2 = handlers.length, ee2 = new Array(l2); i2 < l2; i2++) { + ee2[i2] = handlers[i2].fn; } return ee2; }; @@ -10555,7 +10555,7 @@ var eventemitter3$2 = { exports: {} }; var evt = prefix ? prefix + event : event; if (!this._events[evt]) return false; - var listeners3 = this._events[evt], len = arguments.length, args, i3; + var listeners3 = this._events[evt], len = arguments.length, args, i2; if (listeners3.fn) { if (listeners3.once) this.removeListener(event, listeners3.fn, void 0, true); @@ -10573,34 +10573,34 @@ var eventemitter3$2 = { exports: {} }; case 6: return listeners3.fn.call(listeners3.context, a1, a22, a3, a4, a5), true; } - for (i3 = 1, args = new Array(len - 1); i3 < len; i3++) { - args[i3 - 1] = arguments[i3]; + for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) { + args[i2 - 1] = arguments[i2]; } listeners3.fn.apply(listeners3.context, args); } else { var length = listeners3.length, j2; - for (i3 = 0; i3 < length; i3++) { - if (listeners3[i3].once) - this.removeListener(event, listeners3[i3].fn, void 0, true); + for (i2 = 0; i2 < length; i2++) { + if (listeners3[i2].once) + this.removeListener(event, listeners3[i2].fn, void 0, true); switch (len) { case 1: - listeners3[i3].fn.call(listeners3[i3].context); + listeners3[i2].fn.call(listeners3[i2].context); break; case 2: - listeners3[i3].fn.call(listeners3[i3].context, a1); + listeners3[i2].fn.call(listeners3[i2].context, a1); break; case 3: - listeners3[i3].fn.call(listeners3[i3].context, a1, a22); + listeners3[i2].fn.call(listeners3[i2].context, a1, a22); break; case 4: - listeners3[i3].fn.call(listeners3[i3].context, a1, a22, a3); + listeners3[i2].fn.call(listeners3[i2].context, a1, a22, a3); break; default: if (!args) for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) { args[j2 - 1] = arguments[j2]; } - listeners3[i3].fn.apply(listeners3[i3].context, args); + listeners3[i2].fn.apply(listeners3[i2].context, args); } } } @@ -10626,9 +10626,9 @@ var eventemitter3$2 = { exports: {} }; clearEvent(this, evt); } } else { - for (var i3 = 0, events2 = [], length = listeners3.length; i3 < length; i3++) { - if (listeners3[i3].fn !== fn2 || once3 && !listeners3[i3].once || context && listeners3[i3].context !== context) { - events2.push(listeners3[i3]); + for (var i2 = 0, events2 = [], length = listeners3.length; i2 < length; i2++) { + if (listeners3[i2].fn !== fn2 || once3 && !listeners3[i2].once || context && listeners3[i2].context !== context) { + events2.push(listeners3[i2]); } } if (events2.length) @@ -10798,7 +10798,7 @@ function uid(length = 11) { if (!buffer$1 || index + length > size * 2) { buffer$1 = ""; index = 0; - for (let i3 = 0; i3 < size; i3++) { + for (let i2 = 0; i2 < size; i2++) { buffer$1 += (256 + Math.random() * 256 | 0).toString(16).substring(1); } } @@ -11192,79811 +11192,9117 @@ function extractRpcUrls(parameters) { const transports = ((_c2 = transport == null ? void 0 : transport.value) == null ? void 0 : _c2.transports) || [transport]; return transports.map(({ value }) => (value == null ? void 0 : value.url) || fallbackUrl); } -function Hydrate(parameters) { - const { children, config: config2, initialState: initialState2, reconnectOnMount = true } = parameters; - const { onMount } = hydrate(config2, { - initialState: initialState2, - reconnectOnMount - }); - if (!config2._internal.ssr) - onMount(); - const active = reactExports.useRef(true); - reactExports.useEffect(() => { - if (!active.current) - return; - if (!config2._internal.ssr) - return; - onMount(); - return () => { - active.current = false; - }; - }, []); - return children; -} -const WagmiContext = reactExports.createContext(void 0); -function WagmiProvider(parameters) { - const { children, config: config2 } = parameters; - const props = { value: config2 }; - return reactExports.createElement(Hydrate, parameters, reactExports.createElement(WagmiContext.Provider, props, children)); -} -const version$5 = "2.13.0"; -const getVersion = () => `wagmi@${version$5}`; -class BaseError3 extends BaseError$1 { - constructor() { - super(...arguments); - Object.defineProperty(this, "name", { - enumerable: true, - configurable: true, - writable: true, - value: "WagmiError" - }); - } - get docsBaseUrl() { - return "https://wagmi.sh/react"; - } - get version() { - return getVersion(); - } -} -class WagmiProviderNotFoundError extends BaseError3 { - constructor() { - super("`useConfig` must be used within `WagmiProvider`.", { - docsPath: "/api/WagmiProvider" - }); - Object.defineProperty(this, "name", { - enumerable: true, - configurable: true, - writable: true, - value: "WagmiProviderNotFoundError" - }); - } -} -function useConfig(parameters = {}) { - const config2 = parameters.config ?? reactExports.useContext(WagmiContext); - if (!config2) - throw new WagmiProviderNotFoundError(); - return config2; -} -var withSelector = { exports: {} }; -var withSelector_production_min = {}; -var shim = { exports: {} }; -var useSyncExternalStoreShim_production_min = {}; -/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var e$3 = reactExports; -function h$5(a3, b2) { - return a3 === b2 && (0 !== a3 || 1 / a3 === 1 / b2) || a3 !== a3 && b2 !== b2; -} -var k$2 = "function" === typeof Object.is ? Object.is : h$5, l$4 = e$3.useState, m$4 = e$3.useEffect, n$8 = e$3.useLayoutEffect, p$5 = e$3.useDebugValue; -function q$3(a3, b2) { - var d4 = b2(), f3 = l$4({ inst: { value: d4, getSnapshot: b2 } }), c2 = f3[0].inst, g3 = f3[1]; - n$8(function() { - c2.value = d4; - c2.getSnapshot = b2; - r$7(c2) && g3({ inst: c2 }); - }, [a3, d4, b2]); - m$4(function() { - r$7(c2) && g3({ inst: c2 }); - return a3(function() { - r$7(c2) && g3({ inst: c2 }); - }); - }, [a3]); - p$5(d4); - return d4; -} -function r$7(a3) { - var b2 = a3.getSnapshot; - a3 = a3.value; - try { - var d4 = b2(); - return !k$2(a3, d4); - } catch (f3) { - return true; - } -} -function t$3(a3, b2) { - return b2(); -} -var u$3 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t$3 : q$3; -useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e$3.useSyncExternalStore ? e$3.useSyncExternalStore : u$3; -{ - shim.exports = useSyncExternalStoreShim_production_min; -} -var shimExports = shim.exports; -/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var h$4 = reactExports, n$7 = shimExports; -function p$4(a3, b2) { - return a3 === b2 && (0 !== a3 || 1 / a3 === 1 / b2) || a3 !== a3 && b2 !== b2; +coinbaseWallet$1.type = "coinbaseWallet"; +function coinbaseWallet$1(parameters = {}) { + if (parameters.version === "3" || parameters.headlessMode) + return version3(parameters); + return version4(parameters); } -var q$2 = "function" === typeof Object.is ? Object.is : p$4, r$6 = n$7.useSyncExternalStore, t$2 = h$4.useRef, u$2 = h$4.useEffect, v$6 = h$4.useMemo, w$5 = h$4.useDebugValue; -withSelector_production_min.useSyncExternalStoreWithSelector = function(a3, b2, e18, l2, g3) { - var c2 = t$2(null); - if (null === c2.current) { - var f3 = { hasValue: false, value: null }; - c2.current = f3; - } else - f3 = c2.current; - c2 = v$6(function() { - function a4(a5) { - if (!c3) { - c3 = true; - d5 = a5; - a5 = l2(a5); - if (void 0 !== g3 && f3.hasValue) { - var b3 = f3.value; - if (g3(b3, a5)) - return k2 = b3; +function version4(parameters) { + let walletProvider; + let accountsChanged; + let chainChanged; + let disconnect2; + return createConnector((config2) => ({ + id: "coinbaseWalletSDK", + name: "Coinbase Wallet", + rdns: "com.coinbase.wallet", + type: coinbaseWallet$1.type, + async connect({ chainId } = {}) { + try { + const provider = await this.getProvider(); + const accounts2 = (await provider.request({ + method: "eth_requestAccounts" + })).map((x3) => getAddress$2(x3)); + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider.on("accountsChanged", accountsChanged); } - return k2 = a5; + if (!chainChanged) { + chainChanged = this.onChainChanged.bind(this); + provider.on("chainChanged", chainChanged); + } + if (!disconnect2) { + disconnect2 = this.onDisconnect.bind(this); + provider.on("disconnect", disconnect2); + } + let currentChainId = await this.getChainId(); + if (chainId && currentChainId !== chainId) { + const chain = await this.switchChain({ chainId }).catch((error) => { + if (error.code === UserRejectedRequestError.code) + throw error; + return { id: currentChainId }; + }); + currentChainId = (chain == null ? void 0 : chain.id) ?? currentChainId; + } + return { accounts: accounts2, chainId: currentChainId }; + } catch (error) { + if (/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(error.message)) + throw new UserRejectedRequestError(error); + throw error; } - b3 = k2; - if (q$2(d5, a5)) - return b3; - var e19 = l2(a5); - if (void 0 !== g3 && g3(b3, e19)) - return b3; - d5 = a5; - return k2 = e19; - } - var c3 = false, d5, k2, m3 = void 0 === e18 ? null : e18; - return [function() { - return a4(b2()); - }, null === m3 ? void 0 : function() { - return a4(m3()); - }]; - }, [b2, e18, l2, g3]); - var d4 = r$6(a3, c2[0], c2[1]); - u$2(function() { - f3.hasValue = true; - f3.value = d4; - }, [d4]); - w$5(d4); - return d4; -}; -{ - withSelector.exports = withSelector_production_min; -} -var withSelectorExports = withSelector.exports; -const isPlainObject$2 = (obj) => typeof obj === "object" && !Array.isArray(obj); -function useSyncExternalStoreWithTracked(subscribe, getSnapshot, getServerSnapshot = getSnapshot, isEqual = deepEqual) { - const trackedKeys = reactExports.useRef([]); - const result = withSelectorExports.useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, (x3) => x3, (a3, b2) => { - if (isPlainObject$2(a3) && isPlainObject$2(b2) && trackedKeys.current.length) { - for (const key2 of trackedKeys.current) { - const equal2 = isEqual(a3[key2], b2[key2]); - if (!equal2) - return false; + }, + async disconnect() { + var _a3; + const provider = await this.getProvider(); + if (accountsChanged) { + provider.removeListener("accountsChanged", accountsChanged); + accountsChanged = void 0; } - return true; - } - return isEqual(a3, b2); - }); - return reactExports.useMemo(() => { - if (isPlainObject$2(result)) { - const trackedResult = { ...result }; - let properties = {}; - for (const [key2, value] of Object.entries(trackedResult)) { - properties = { - ...properties, - [key2]: { - configurable: false, - enumerable: true, - get: () => { - if (!trackedKeys.current.includes(key2)) { - trackedKeys.current.push(key2); - } - return value; - } - } - }; + if (chainChanged) { + provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; } - Object.defineProperties(trackedResult, properties); - return trackedResult; - } - return result; - }, [result]); -} -function useAccount(parameters = {}) { - const config2 = useConfig(parameters); - return useSyncExternalStoreWithTracked((onChange) => watchAccount(config2, { onChange }), () => getAccount(config2)); -} -var Subscribable = class { - constructor() { - this.listeners = /* @__PURE__ */ new Set(); - this.subscribe = this.subscribe.bind(this); - } - subscribe(listener) { - this.listeners.add(listener); - this.onSubscribe(); - return () => { - this.listeners.delete(listener); - this.onUnsubscribe(); - }; - } - hasListeners() { - return this.listeners.size > 0; - } - onSubscribe() { - } - onUnsubscribe() { - } -}; -var isServer = typeof window === "undefined" || "Deno" in globalThis; -function noop$3() { - return void 0; -} -function functionalUpdate(updater, input) { - return typeof updater === "function" ? updater(input) : updater; -} -function isValidTimeout(value) { - return typeof value === "number" && value >= 0 && value !== Infinity; -} -function timeUntilStale(updatedAt, staleTime) { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); -} -function resolveStaleTime(staleTime, query) { - return typeof staleTime === "function" ? staleTime(query) : staleTime; -} -function resolveEnabled(enabled, query) { - return typeof enabled === "function" ? enabled(query) : enabled; -} -function matchQuery(filters, query) { - const { - type: type2 = "all", - exact, - fetchStatus, - predicate, - queryKey, - stale - } = filters; - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false; + if (disconnect2) { + provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false; - } - } - if (type2 !== "all") { - const isActive = query.isActive(); - if (type2 === "active" && !isActive) { - return false; - } - if (type2 === "inactive" && isActive) { - return false; - } - } - if (typeof stale === "boolean" && query.isStale() !== stale) { - return false; - } - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false; - } - if (predicate && !predicate(query)) { - return false; - } - return true; -} -function matchMutation(filters, mutation) { - const { exact, status, predicate, mutationKey } = filters; - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false; - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { + provider.disconnect(); + (_a3 = provider.close) == null ? void 0 : _a3.call(provider); + }, + async getAccounts() { + const provider = await this.getProvider(); + return (await provider.request({ + method: "eth_accounts" + })).map((x3) => getAddress$2(x3)); + }, + async getChainId() { + const provider = await this.getProvider(); + const chainId = await provider.request({ + method: "eth_chainId" + }); + return Number(chainId); + }, + async getProvider() { + if (!walletProvider) { + const preference = (() => { + var _a3; + if (typeof parameters.preference === "string") + return { options: parameters.preference }; + return { + ...parameters.preference, + options: ((_a3 = parameters.preference) == null ? void 0 : _a3.options) ?? "all" + }; + })(); + const { createCoinbaseWalletSDK } = await __vitePreload(() => import("./index-e4bea0fb.js"), true ? ["./index-e4bea0fb.js","./hooks.module-2202d2c9.js"] : void 0, import.meta.url); + const sdk = createCoinbaseWalletSDK({ + ...parameters, + appChainIds: config2.chains.map((x3) => x3.id), + preference + }); + walletProvider = sdk.getProvider(); + } + return walletProvider; + }, + async isAuthorized() { + try { + const accounts2 = await this.getAccounts(); + return !!accounts2.length; + } catch { return false; } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false; - } - } - if (status && mutation.state.status !== status) { - return false; - } - if (predicate && !predicate(mutation)) { - return false; - } - return true; -} -function hashQueryKeyByOptions(queryKey, options) { - const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashKey; - return hashFn(queryKey); -} -function hashKey(queryKey) { - return JSON.stringify( - queryKey, - (_3, val) => isPlainObject$1(val) ? Object.keys(val).sort().reduce((result, key2) => { - result[key2] = val[key2]; - return result; - }, {}) : val - ); -} -function partialMatchKey(a3, b2) { - if (a3 === b2) { - return true; - } - if (typeof a3 !== typeof b2) { - return false; - } - if (a3 && b2 && typeof a3 === "object" && typeof b2 === "object") { - return !Object.keys(b2).some((key2) => !partialMatchKey(a3[key2], b2[key2])); - } - return false; -} -function replaceEqualDeep(a3, b2) { - if (a3 === b2) { - return a3; - } - const array2 = isPlainArray(a3) && isPlainArray(b2); - if (array2 || isPlainObject$1(a3) && isPlainObject$1(b2)) { - const aItems = array2 ? a3 : Object.keys(a3); - const aSize = aItems.length; - const bItems = array2 ? b2 : Object.keys(b2); - const bSize = bItems.length; - const copy = array2 ? [] : {}; - let equalItems = 0; - for (let i3 = 0; i3 < bSize; i3++) { - const key2 = array2 ? i3 : bItems[i3]; - if ((!array2 && aItems.includes(key2) || array2) && a3[key2] === void 0 && b2[key2] === void 0) { - copy[key2] = void 0; - equalItems++; - } else { - copy[key2] = replaceEqualDeep(a3[key2], b2[key2]); - if (copy[key2] === a3[key2] && a3[key2] !== void 0) { - equalItems++; + }, + async switchChain({ addEthereumChainParameter, chainId }) { + var _a3, _b2, _c2, _d2; + const chain = config2.chains.find((chain2) => chain2.id === chainId); + if (!chain) + throw new SwitchChainError(new ChainNotConfiguredError()); + const provider = await this.getProvider(); + try { + await provider.request({ + method: "wallet_switchEthereumChain", + params: [{ chainId: numberToHex(chain.id) }] + }); + return chain; + } catch (error) { + if (error.code === 4902) { + try { + let blockExplorerUrls; + if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) + blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; + else + blockExplorerUrls = ((_a3 = chain.blockExplorers) == null ? void 0 : _a3.default.url) ? [(_b2 = chain.blockExplorers) == null ? void 0 : _b2.default.url] : []; + let rpcUrls; + if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) + rpcUrls = addEthereumChainParameter.rpcUrls; + else + rpcUrls = [((_d2 = chain.rpcUrls.default) == null ? void 0 : _d2.http[0]) ?? ""]; + const addEthereumChain = { + blockExplorerUrls, + chainId: numberToHex(chainId), + chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, + iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, + nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, + rpcUrls + }; + await provider.request({ + method: "wallet_addEthereumChain", + params: [addEthereumChain] + }); + return chain; + } catch (error2) { + throw new UserRejectedRequestError(error2); + } } + throw new SwitchChainError(error); + } + }, + onAccountsChanged(accounts2) { + if (accounts2.length === 0) + this.onDisconnect(); + else + config2.emitter.emit("change", { + accounts: accounts2.map((x3) => getAddress$2(x3)) + }); + }, + onChainChanged(chain) { + const chainId = Number(chain); + config2.emitter.emit("change", { chainId }); + }, + async onDisconnect(_error) { + config2.emitter.emit("disconnect"); + const provider = await this.getProvider(); + if (accountsChanged) { + provider.removeListener("accountsChanged", accountsChanged); + accountsChanged = void 0; + } + if (chainChanged) { + provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; } } - return aSize === bSize && equalItems === aSize ? a3 : copy; - } - return b2; + })); } -function shallowEqualObjects(a3, b2) { - if (!b2 || Object.keys(a3).length !== Object.keys(b2).length) { - return false; - } - for (const key2 in a3) { - if (a3[key2] !== b2[key2]) { - return false; - } - } - return true; -} -function isPlainArray(value) { - return Array.isArray(value) && value.length === Object.keys(value).length; -} -function isPlainObject$1(o2) { - if (!hasObjectPrototype(o2)) { - return false; - } - const ctor = o2.constructor; - if (ctor === void 0) { - return true; - } - const prot = ctor.prototype; - if (!hasObjectPrototype(prot)) { - return false; - } - if (!prot.hasOwnProperty("isPrototypeOf")) { - return false; - } - if (Object.getPrototypeOf(o2) !== Object.prototype) { - return false; - } - return true; -} -function hasObjectPrototype(o2) { - return Object.prototype.toString.call(o2) === "[object Object]"; -} -function sleep$3(timeout) { - return new Promise((resolve) => { - setTimeout(resolve, timeout); - }); -} -function replaceData(prevData, data, options) { - if (typeof options.structuralSharing === "function") { - return options.structuralSharing(prevData, data); - } else if (options.structuralSharing !== false) { - return replaceEqualDeep(prevData, data); - } - return data; -} -function addToEnd(items, item, max = 0) { - const newItems = [...items, item]; - return max && newItems.length > max ? newItems.slice(1) : newItems; -} -function addToStart(items, item, max = 0) { - const newItems = [item, ...items]; - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; -} -var skipToken = Symbol(); -function ensureQueryFn(options, fetchOptions) { - if (!options.queryFn && (fetchOptions == null ? void 0 : fetchOptions.initialPromise)) { - return () => fetchOptions.initialPromise; - } - if (!options.queryFn || options.queryFn === skipToken) { - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); - } - return options.queryFn; -} -var FocusManager = (_a2 = class extends Subscribable { - constructor() { - super(); - __privateAdd(this, _focused, void 0); - __privateAdd(this, _cleanup, void 0); - __privateAdd(this, _setup, void 0); - __privateSet(this, _setup, (onFocus) => { - if (!isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; +function version3(parameters) { + const reloadOnDisconnect = false; + let sdk; + let walletProvider; + let accountsChanged; + let chainChanged; + let disconnect2; + return createConnector((config2) => ({ + id: "coinbaseWalletSDK", + name: "Coinbase Wallet", + type: coinbaseWallet$1.type, + async connect({ chainId } = {}) { + try { + const provider = await this.getProvider(); + const accounts2 = (await provider.request({ + method: "eth_requestAccounts" + })).map((x3) => getAddress$2(x3)); + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider.on("accountsChanged", accountsChanged); + } + if (!chainChanged) { + chainChanged = this.onChainChanged.bind(this); + provider.on("chainChanged", chainChanged); + } + if (!disconnect2) { + disconnect2 = this.onDisconnect.bind(this); + provider.on("disconnect", disconnect2); + } + let currentChainId = await this.getChainId(); + if (chainId && currentChainId !== chainId) { + const chain = await this.switchChain({ chainId }).catch((error) => { + if (error.code === UserRejectedRequestError.code) + throw error; + return { id: currentChainId }; + }); + currentChainId = (chain == null ? void 0 : chain.id) ?? currentChainId; + } + return { accounts: accounts2, chainId: currentChainId }; + } catch (error) { + if (/(user closed modal|accounts received is empty|user denied account)/i.test(error.message)) + throw new UserRejectedRequestError(error); + throw error; } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup)) { - this.setEventListener(__privateGet(this, _setup)); - } - } - onUnsubscribe() { - var _a3; - if (!this.hasListeners()) { - (_a3 = __privateGet(this, _cleanup)) == null ? void 0 : _a3.call(this); - __privateSet(this, _cleanup, void 0); - } - } - setEventListener(setup) { - var _a3; - __privateSet(this, _setup, setup); - (_a3 = __privateGet(this, _cleanup)) == null ? void 0 : _a3.call(this); - __privateSet(this, _cleanup, setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); + }, + async disconnect() { + const provider = await this.getProvider(); + if (accountsChanged) { + provider.removeListener("accountsChanged", accountsChanged); + accountsChanged = void 0; } - })); - } - setFocused(focused) { - const changed = __privateGet(this, _focused) !== focused; - if (changed) { - __privateSet(this, _focused, focused); - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - var _a3; - if (typeof __privateGet(this, _focused) === "boolean") { - return __privateGet(this, _focused); - } - return ((_a3 = globalThis.document) == null ? void 0 : _a3.visibilityState) !== "hidden"; - } -}, _focused = new WeakMap(), _cleanup = new WeakMap(), _setup = new WeakMap(), _a2); -var focusManager = new FocusManager(); -var OnlineManager = (_b = class extends Subscribable { - constructor() { - super(); - __privateAdd(this, _online, true); - __privateAdd(this, _cleanup2, void 0); - __privateAdd(this, _setup2, void 0); - __privateSet(this, _setup2, (onOnline) => { - if (!isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; + if (chainChanged) { + provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup2)) { - this.setEventListener(__privateGet(this, _setup2)); - } - } - onUnsubscribe() { - var _a3; - if (!this.hasListeners()) { - (_a3 = __privateGet(this, _cleanup2)) == null ? void 0 : _a3.call(this); - __privateSet(this, _cleanup2, void 0); - } - } - setEventListener(setup) { - var _a3; - __privateSet(this, _setup2, setup); - (_a3 = __privateGet(this, _cleanup2)) == null ? void 0 : _a3.call(this); - __privateSet(this, _cleanup2, setup(this.setOnline.bind(this))); - } - setOnline(online) { - const changed = __privateGet(this, _online) !== online; - if (changed) { - __privateSet(this, _online, online); - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return __privateGet(this, _online); - } -}, _online = new WeakMap(), _cleanup2 = new WeakMap(), _setup2 = new WeakMap(), _b); -var onlineManager = new OnlineManager(); -function defaultRetryDelay(failureCount) { - return Math.min(1e3 * 2 ** failureCount, 3e4); -} -function canFetch(networkMode) { - return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; -} -var CancelledError = class extends Error { - constructor(options) { - super("CancelledError"); - this.revert = options == null ? void 0 : options.revert; - this.silent = options == null ? void 0 : options.silent; - } -}; -function isCancelledError(value) { - return value instanceof CancelledError; -} -function createRetryer(config2) { - let isRetryCancelled = false; - let failureCount = 0; - let isResolved = false; - let continueFn; - let promiseResolve; - let promiseReject; - const promise = new Promise((outerResolve, outerReject) => { - promiseResolve = outerResolve; - promiseReject = outerReject; - }); - const cancel = (cancelOptions) => { - var _a3; - if (!isResolved) { - reject(new CancelledError(cancelOptions)); - (_a3 = config2.abort) == null ? void 0 : _a3.call(config2); - } - }; - const cancelRetry = () => { - isRetryCancelled = true; - }; - const continueRetry = () => { - isRetryCancelled = false; - }; - const canContinue = () => focusManager.isFocused() && (config2.networkMode === "always" || onlineManager.isOnline()) && config2.canRun(); - const canStart = () => canFetch(config2.networkMode) && config2.canRun(); - const resolve = (value) => { - var _a3; - if (!isResolved) { - isResolved = true; - (_a3 = config2.onSuccess) == null ? void 0 : _a3.call(config2, value); - continueFn == null ? void 0 : continueFn(); - promiseResolve(value); - } - }; - const reject = (value) => { - var _a3; - if (!isResolved) { - isResolved = true; - (_a3 = config2.onError) == null ? void 0 : _a3.call(config2, value); - continueFn == null ? void 0 : continueFn(); - promiseReject(value); - } - }; - const pause = () => { - return new Promise((continueResolve) => { - var _a3; - continueFn = (value) => { - if (isResolved || canContinue()) { - continueResolve(value); - } - }; - (_a3 = config2.onPause) == null ? void 0 : _a3.call(config2); - }).then(() => { - var _a3; - continueFn = void 0; - if (!isResolved) { - (_a3 = config2.onContinue) == null ? void 0 : _a3.call(config2); + if (disconnect2) { + provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; } - }); - }; - const run2 = () => { - if (isResolved) { - return; - } - let promiseOrValue; - const initialPromise = failureCount === 0 ? config2.initialPromise : void 0; - try { - promiseOrValue = initialPromise ?? config2.fn(); - } catch (error) { - promiseOrValue = Promise.reject(error); - } - Promise.resolve(promiseOrValue).then(resolve).catch((error) => { + provider.disconnect(); + provider.close(); + }, + async getAccounts() { + const provider = await this.getProvider(); + return (await provider.request({ + method: "eth_accounts" + })).map((x3) => getAddress$2(x3)); + }, + async getChainId() { + const provider = await this.getProvider(); + const chainId = await provider.request({ + method: "eth_chainId" + }); + return Number(chainId); + }, + async getProvider() { var _a3; - if (isResolved) { - return; + if (!walletProvider) { + const CoinbaseWalletSDK = await (async () => { + const { default: SDK } = await __vitePreload(() => import("./index-bc91246c.js").then((n5) => n5.i), true ? ["./index-bc91246c.js","./hooks.module-2202d2c9.js"] : void 0, import.meta.url); + if (typeof SDK !== "function" && typeof SDK.default === "function") + return SDK.default; + return SDK; + })(); + sdk = new CoinbaseWalletSDK({ ...parameters, reloadOnDisconnect }); + const walletExtensionChainId = (_a3 = sdk.walletExtension) == null ? void 0 : _a3.getChainId(); + const chain = config2.chains.find((chain2) => parameters.chainId ? chain2.id === parameters.chainId : chain2.id === walletExtensionChainId) || config2.chains[0]; + const chainId = parameters.chainId || (chain == null ? void 0 : chain.id); + const jsonRpcUrl = parameters.jsonRpcUrl || (chain == null ? void 0 : chain.rpcUrls.default.http[0]); + walletProvider = sdk.makeWeb3Provider(jsonRpcUrl, chainId); } - const retry = config2.retry ?? (isServer ? 0 : 3); - const retryDelay = config2.retryDelay ?? defaultRetryDelay; - const delay2 = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; - const shouldRetry2 = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); - if (isRetryCancelled || !shouldRetry2) { - reject(error); - return; + return walletProvider; + }, + async isAuthorized() { + try { + const accounts2 = await this.getAccounts(); + return !!accounts2.length; + } catch { + return false; } - failureCount++; - (_a3 = config2.onFail) == null ? void 0 : _a3.call(config2, failureCount, error); - sleep$3(delay2).then(() => { - return canContinue() ? void 0 : pause(); - }).then(() => { - if (isRetryCancelled) { - reject(error); - } else { - run2(); + }, + async switchChain({ addEthereumChainParameter, chainId }) { + var _a3, _b2, _c2, _d2; + const chain = config2.chains.find((chain2) => chain2.id === chainId); + if (!chain) + throw new SwitchChainError(new ChainNotConfiguredError()); + const provider = await this.getProvider(); + try { + await provider.request({ + method: "wallet_switchEthereumChain", + params: [{ chainId: numberToHex(chain.id) }] + }); + return chain; + } catch (error) { + if (error.code === 4902) { + try { + let blockExplorerUrls; + if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) + blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; + else + blockExplorerUrls = ((_a3 = chain.blockExplorers) == null ? void 0 : _a3.default.url) ? [(_b2 = chain.blockExplorers) == null ? void 0 : _b2.default.url] : []; + let rpcUrls; + if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) + rpcUrls = addEthereumChainParameter.rpcUrls; + else + rpcUrls = [((_d2 = chain.rpcUrls.default) == null ? void 0 : _d2.http[0]) ?? ""]; + const addEthereumChain = { + blockExplorerUrls, + chainId: numberToHex(chainId), + chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, + iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, + nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, + rpcUrls + }; + await provider.request({ + method: "wallet_addEthereumChain", + params: [addEthereumChain] + }); + return chain; + } catch (error2) { + throw new UserRejectedRequestError(error2); + } } - }); - }); - }; - return { - promise, - cancel, - continue: () => { - continueFn == null ? void 0 : continueFn(); - return promise; + throw new SwitchChainError(error); + } }, - cancelRetry, - continueRetry, - canStart, - start: () => { - if (canStart()) { - run2(); - } else { - pause().then(run2); + onAccountsChanged(accounts2) { + if (accounts2.length === 0) + this.onDisconnect(); + else + config2.emitter.emit("change", { + accounts: accounts2.map((x3) => getAddress$2(x3)) + }); + }, + onChainChanged(chain) { + const chainId = Number(chain); + config2.emitter.emit("change", { chainId }); + }, + async onDisconnect(_error) { + config2.emitter.emit("disconnect"); + const provider = await this.getProvider(); + if (accountsChanged) { + provider.removeListener("accountsChanged", accountsChanged); + accountsChanged = void 0; + } + if (chainChanged) { + provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; } - return promise; } - }; + })); } -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = (cb2) => setTimeout(cb2, 0); - const setScheduler = (fn2) => { - scheduleFn = fn2; - }; - const batch = (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); +walletConnect$1.type = "walletConnect"; +function walletConnect$1(parameters) { + const isNewChainsStale = parameters.isNewChainsStale ?? true; + let provider_; + let providerPromise; + const NAMESPACE = "eip155"; + let accountsChanged; + let chainChanged; + let connect2; + let displayUri; + let sessionDelete; + let disconnect2; + return createConnector((config2) => ({ + id: "walletConnect", + name: "WalletConnect", + type: walletConnect$1.type, + async setup() { + const provider = await this.getProvider().catch(() => null); + if (!provider) + return; + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider.on("connect", connect2); } - } - return result; - }; - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const batchCalls = (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); + if (!sessionDelete) { + sessionDelete = this.onSessionDelete.bind(this); + provider.on("session_delete", sessionDelete); + } + }, + async connect({ chainId, ...rest } = {}) { + var _a3, _b2; + try { + const provider = await this.getProvider(); + if (!provider) + throw new ProviderNotFoundError(); + if (!displayUri) { + displayUri = this.onDisplayUri; + provider.on("display_uri", displayUri); + } + let targetChainId = chainId; + if (!targetChainId) { + const state = await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem("state")) ?? {}; + const isChainSupported = config2.chains.some((x3) => x3.id === state.chainId); + if (isChainSupported) + targetChainId = state.chainId; + else + targetChainId = (_b2 = config2.chains[0]) == null ? void 0 : _b2.id; + } + if (!targetChainId) + throw new Error("No chains found on connector."); + const isChainsStale = await this.isChainsStale(); + if (provider.session && isChainsStale) + await provider.disconnect(); + if (!provider.session || isChainsStale) { + const optionalChains = config2.chains.filter((chain) => chain.id !== targetChainId).map((optionalChain) => optionalChain.id); + await provider.connect({ + optionalChains: [targetChainId, ...optionalChains], + ..."pairingTopic" in rest ? { pairingTopic: rest.pairingTopic } : {} + }); + this.setRequestedChainsIds(config2.chains.map((x3) => x3.id)); + } + const accounts2 = (await provider.enable()).map((x3) => getAddress$2(x3)); + const currentChainId = await this.getChainId(); + if (displayUri) { + provider.removeListener("display_uri", displayUri); + displayUri = void 0; + } + if (connect2) { + provider.removeListener("connect", connect2); + connect2 = void 0; + } + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider.on("accountsChanged", accountsChanged); + } + if (!chainChanged) { + chainChanged = this.onChainChanged.bind(this); + provider.on("chainChanged", chainChanged); + } + if (!disconnect2) { + disconnect2 = this.onDisconnect.bind(this); + provider.on("disconnect", disconnect2); + } + if (!sessionDelete) { + sessionDelete = this.onSessionDelete.bind(this); + provider.on("session_delete", sessionDelete); + } + return { accounts: accounts2, chainId: currentChainId }; + } catch (error) { + if (/(user rejected|connection request reset)/i.test(error == null ? void 0 : error.message)) { + throw new UserRejectedRequestError(error); + } + throw error; + } + }, + async disconnect() { + const provider = await this.getProvider(); + try { + await (provider == null ? void 0 : provider.disconnect()); + } catch (error) { + if (!/No matching key/i.test(error.message)) + throw error; + } finally { + if (chainChanged) { + provider == null ? void 0 : provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider == null ? void 0 : provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; + } + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider == null ? void 0 : provider.on("connect", connect2); + } + if (accountsChanged) { + provider == null ? void 0 : provider.removeListener("accountsChanged", accountsChanged); + accountsChanged = void 0; + } + if (sessionDelete) { + provider == null ? void 0 : provider.removeListener("session_delete", sessionDelete); + sessionDelete = void 0; + } + this.setRequestedChainsIds([]); + } + }, + async getAccounts() { + const provider = await this.getProvider(); + return provider.accounts.map((x3) => getAddress$2(x3)); + }, + async getProvider({ chainId } = {}) { + var _a3; + async function initProvider() { + const optionalChains = config2.chains.map((x3) => x3.id); + if (!optionalChains.length) + return; + const { EthereumProvider: EthereumProvider2 } = await __vitePreload(() => import("./index.es-c3bc7551.js"), true ? [] : void 0, import.meta.url); + return await EthereumProvider2.init({ + ...parameters, + disableProviderPing: true, + optionalChains, + projectId: parameters.projectId, + rpcMap: Object.fromEntries(config2.chains.map((chain) => { + const [url] = extractRpcUrls({ + chain, + transports: config2.transports + }); + return [chain.id, url]; + })), + showQrModal: parameters.showQrModal ?? true + }); + } + if (!provider_) { + if (!providerPromise) + providerPromise = initProvider(); + provider_ = await providerPromise; + provider_ == null ? void 0 : provider_.events.setMaxListeners(Number.POSITIVE_INFINITY); + } + if (chainId) + await ((_a3 = this.switchChain) == null ? void 0 : _a3.call(this, { chainId })); + return provider_; + }, + async getChainId() { + const provider = await this.getProvider(); + return provider.chainId; + }, + async isAuthorized() { + try { + const [accounts2, provider] = await Promise.all([ + this.getAccounts(), + this.getProvider() + ]); + if (!accounts2.length) + return false; + const isChainsStale = await this.isChainsStale(); + if (isChainsStale && provider.session) { + await provider.disconnect().catch(() => { + }); + return false; + } + return true; + } catch { + return false; + } + }, + async switchChain({ addEthereumChainParameter, chainId }) { + var _a3, _b2, _c2; + const provider = await this.getProvider(); + if (!provider) + throw new ProviderNotFoundError(); + const chain = config2.chains.find((x3) => x3.id === chainId); + if (!chain) + throw new SwitchChainError(new ChainNotConfiguredError()); + try { + await Promise.all([ + new Promise((resolve) => { + const listener = ({ chainId: currentChainId }) => { + if (currentChainId === chainId) { + config2.emitter.off("change", listener); + resolve(); + } + }; + config2.emitter.on("change", listener); + }), + provider.request({ + method: "wallet_switchEthereumChain", + params: [{ chainId: numberToHex(chainId) }] + }) + ]); + const requestedChains = await this.getRequestedChainsIds(); + this.setRequestedChainsIds([...requestedChains, chainId]); + return chain; + } catch (err) { + const error = err; + if (/(user rejected)/i.test(error.message)) + throw new UserRejectedRequestError(error); + try { + let blockExplorerUrls; + if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) + blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; + else + blockExplorerUrls = ((_a3 = chain.blockExplorers) == null ? void 0 : _a3.default.url) ? [(_b2 = chain.blockExplorers) == null ? void 0 : _b2.default.url] : []; + let rpcUrls; + if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) + rpcUrls = addEthereumChainParameter.rpcUrls; + else + rpcUrls = [...chain.rpcUrls.default.http]; + const addEthereumChain = { + blockExplorerUrls, + chainId: numberToHex(chainId), + chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, + iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, + nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, + rpcUrls + }; + await provider.request({ + method: "wallet_addEthereumChain", + params: [addEthereumChain] }); + const requestedChains = await this.getRequestedChainsIds(); + this.setRequestedChainsIds([...requestedChains, chainId]); + return chain; + } catch (error2) { + throw new UserRejectedRequestError(error2); + } + } + }, + onAccountsChanged(accounts2) { + if (accounts2.length === 0) + this.onDisconnect(); + else + config2.emitter.emit("change", { + accounts: accounts2.map((x3) => getAddress$2(x3)) }); + }, + onChainChanged(chain) { + const chainId = Number(chain); + config2.emitter.emit("change", { chainId }); + }, + async onConnect(connectInfo) { + const chainId = Number(connectInfo.chainId); + const accounts2 = await this.getAccounts(); + config2.emitter.emit("connect", { accounts: accounts2, chainId }); + }, + async onDisconnect(_error) { + this.setRequestedChainsIds([]); + config2.emitter.emit("disconnect"); + const provider = await this.getProvider(); + if (accountsChanged) { + provider.removeListener("accountsChanged", accountsChanged); + accountsChanged = void 0; + } + if (chainChanged) { + provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; + } + if (sessionDelete) { + provider.removeListener("session_delete", sessionDelete); + sessionDelete = void 0; + } + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider.on("connect", connect2); + } + }, + onDisplayUri(uri) { + config2.emitter.emit("message", { type: "display_uri", data: uri }); + }, + onSessionDelete() { + this.onDisconnect(); + }, + getNamespaceChainsIds() { + var _a3, _b2, _c2; + if (!provider_) + return []; + const chainIds = (_c2 = (_b2 = (_a3 = provider_.session) == null ? void 0 : _a3.namespaces[NAMESPACE]) == null ? void 0 : _b2.accounts) == null ? void 0 : _c2.map((account) => Number.parseInt(account.split(":")[1] || "")); + return chainIds ?? []; + }, + async getRequestedChainsIds() { + var _a3; + return await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem(this.requestedChainsStorageKey)) ?? []; + }, + /** + * Checks if the target chains match the chains that were + * initially requested by the connector for the WalletConnect session. + * If there is a mismatch, this means that the chains on the connector + * are considered stale, and need to be revalidated at a later point (via + * connection). + * + * There may be a scenario where a dapp adds a chain to the + * connector later on, however, this chain will not have been approved or rejected + * by the wallet. In this case, the chain is considered stale. + */ + async isChainsStale() { + if (!isNewChainsStale) + return false; + const connectorChains = config2.chains.map((x3) => x3.id); + const namespaceChains = this.getNamespaceChainsIds(); + if (namespaceChains.length && !namespaceChains.some((id2) => connectorChains.includes(id2))) + return false; + const requestedChains = await this.getRequestedChainsIds(); + return !connectorChains.every((id2) => requestedChains.includes(id2)); + }, + async setRequestedChainsIds(chains) { + var _a3; + await ((_a3 = config2.storage) == null ? void 0 : _a3.setItem(this.requestedChainsStorageKey, chains)); + }, + get requestedChainsStorageKey() { + return `${this.id}.requestedChains`; + } + })); +} +var hash$6 = {}; +var utils$t = {}; +var minimalisticAssert = assert$i; +function assert$i(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); +} +assert$i.equal = function assertEqual(l2, r2, msg) { + if (l2 != r2) + throw new Error(msg || "Assertion failed: " + l2 + " != " + r2); +}; +var inherits_browser = { exports: {} }; +if (typeof Object.create === "function") { + inherits_browser.exports = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } }); } }; - const setNotifyFunction = (fn2) => { - notifyFn = fn2; - }; - const setBatchNotifyFunction = (fn2) => { - batchNotifyFn = fn2; - }; - return { - batch, - batchCalls, - schedule, - setNotifyFunction, - setBatchNotifyFunction, - setScheduler +} else { + inherits_browser.exports = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } }; } -var notifyManager = createNotifyManager(); -var Removable = (_c = class { - constructor() { - __privateAdd(this, _gcTimeout, void 0); +var inherits_browserExports = inherits_browser.exports; +var assert$h = minimalisticAssert; +var inherits$4 = inherits_browserExports; +utils$t.inherits = inherits$4; +function isSurrogatePair$1(msg, i2) { + if ((msg.charCodeAt(i2) & 64512) !== 55296) { + return false; } - destroy() { - this.clearGcTimeout(); + if (i2 < 0 || i2 + 1 >= msg.length) { + return false; } - scheduleGc() { - this.clearGcTimeout(); - if (isValidTimeout(this.gcTime)) { - __privateSet(this, _gcTimeout, setTimeout(() => { - this.optionalRemove(); - }, this.gcTime)); + return (msg.charCodeAt(i2 + 1) & 64512) === 56320; +} +function toArray$1(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg === "string") { + if (!enc) { + var p3 = 0; + for (var i2 = 0; i2 < msg.length; i2++) { + var c2 = msg.charCodeAt(i2); + if (c2 < 128) { + res[p3++] = c2; + } else if (c2 < 2048) { + res[p3++] = c2 >> 6 | 192; + res[p3++] = c2 & 63 | 128; + } else if (isSurrogatePair$1(msg, i2)) { + c2 = 65536 + ((c2 & 1023) << 10) + (msg.charCodeAt(++i2) & 1023); + res[p3++] = c2 >> 18 | 240; + res[p3++] = c2 >> 12 & 63 | 128; + res[p3++] = c2 >> 6 & 63 | 128; + res[p3++] = c2 & 63 | 128; + } else { + res[p3++] = c2 >> 12 | 224; + res[p3++] = c2 >> 6 & 63 | 128; + res[p3++] = c2 & 63 | 128; + } + } + } else if (enc === "hex") { + msg = msg.replace(/[^a-z0-9]+/ig, ""); + if (msg.length % 2 !== 0) + msg = "0" + msg; + for (i2 = 0; i2 < msg.length; i2 += 2) + res.push(parseInt(msg[i2] + msg[i2 + 1], 16)); } + } else { + for (i2 = 0; i2 < msg.length; i2++) + res[i2] = msg[i2] | 0; } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) - ); + return res; +} +utils$t.toArray = toArray$1; +function toHex$2(msg) { + var res = ""; + for (var i2 = 0; i2 < msg.length; i2++) + res += zero2(msg[i2].toString(16)); + return res; +} +utils$t.toHex = toHex$2; +function htonl(w2) { + var res = w2 >>> 24 | w2 >>> 8 & 65280 | w2 << 8 & 16711680 | (w2 & 255) << 24; + return res >>> 0; +} +utils$t.htonl = htonl; +function toHex32(msg, endian) { + var res = ""; + for (var i2 = 0; i2 < msg.length; i2++) { + var w2 = msg[i2]; + if (endian === "little") + w2 = htonl(w2); + res += zero8(w2.toString(16)); } - clearGcTimeout() { - if (__privateGet(this, _gcTimeout)) { - clearTimeout(__privateGet(this, _gcTimeout)); - __privateSet(this, _gcTimeout, void 0); + return res; +} +utils$t.toHex32 = toHex32; +function zero2(word) { + if (word.length === 1) + return "0" + word; + else + return word; +} +utils$t.zero2 = zero2; +function zero8(word) { + if (word.length === 7) + return "0" + word; + else if (word.length === 6) + return "00" + word; + else if (word.length === 5) + return "000" + word; + else if (word.length === 4) + return "0000" + word; + else if (word.length === 3) + return "00000" + word; + else if (word.length === 2) + return "000000" + word; + else if (word.length === 1) + return "0000000" + word; + else + return word; +} +utils$t.zero8 = zero8; +function join32(msg, start, end, endian) { + var len = end - start; + assert$h(len % 4 === 0); + var res = new Array(len / 4); + for (var i2 = 0, k2 = start; i2 < res.length; i2++, k2 += 4) { + var w2; + if (endian === "big") + w2 = msg[k2] << 24 | msg[k2 + 1] << 16 | msg[k2 + 2] << 8 | msg[k2 + 3]; + else + w2 = msg[k2 + 3] << 24 | msg[k2 + 2] << 16 | msg[k2 + 1] << 8 | msg[k2]; + res[i2] = w2 >>> 0; + } + return res; +} +utils$t.join32 = join32; +function split32(msg, endian) { + var res = new Array(msg.length * 4); + for (var i2 = 0, k2 = 0; i2 < msg.length; i2++, k2 += 4) { + var m3 = msg[i2]; + if (endian === "big") { + res[k2] = m3 >>> 24; + res[k2 + 1] = m3 >>> 16 & 255; + res[k2 + 2] = m3 >>> 8 & 255; + res[k2 + 3] = m3 & 255; + } else { + res[k2 + 3] = m3 >>> 24; + res[k2 + 2] = m3 >>> 16 & 255; + res[k2 + 1] = m3 >>> 8 & 255; + res[k2] = m3 & 255; } } -}, _gcTimeout = new WeakMap(), _c); -var Query = (_d = class extends Removable { - constructor(config2) { - super(); - __privateAdd(this, _dispatch); - __privateAdd(this, _initialState, void 0); - __privateAdd(this, _revertState, void 0); - __privateAdd(this, _cache, void 0); - __privateAdd(this, _retryer, void 0); - __privateAdd(this, _defaultOptions, void 0); - __privateAdd(this, _abortSignalConsumed, void 0); - __privateSet(this, _abortSignalConsumed, false); - __privateSet(this, _defaultOptions, config2.defaultOptions); - this.setOptions(config2.options); - this.observers = []; - __privateSet(this, _cache, config2.cache); - this.queryKey = config2.queryKey; - this.queryHash = config2.queryHash; - __privateSet(this, _initialState, getDefaultState$1(this.options)); - this.state = config2.state ?? __privateGet(this, _initialState); - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - var _a3; - return (_a3 = __privateGet(this, _retryer)) == null ? void 0 : _a3.promise; - } - setOptions(options) { - this.options = { ...__privateGet(this, _defaultOptions), ...options }; - this.updateGcTime(this.options.gcTime); - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - __privateGet(this, _cache).remove(this); - } - } - setData(newData, options) { - const data = replaceData(this.state.data, newData, this.options); - __privateMethod(this, _dispatch, dispatch_fn).call(this, { - data, - type: "success", - dataUpdatedAt: options == null ? void 0 : options.updatedAt, - manual: options == null ? void 0 : options.manual - }); - return data; - } - setState(state, setStateOptions) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); - } - cancel(options) { - var _a3, _b2; - const promise = (_a3 = __privateGet(this, _retryer)) == null ? void 0 : _a3.promise; - (_b2 = __privateGet(this, _retryer)) == null ? void 0 : _b2.cancel(options); - return promise ? promise.then(noop$3).catch(noop$3) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(__privateGet(this, _initialState)); - } - isActive() { - return this.observers.some( - (observer) => resolveEnabled(observer.options.enabled, this) !== false - ); - } - isDisabled() { - return this.getObserversCount() > 0 && !this.isActive(); - } - isStale() { - if (this.state.isInvalidated) { - return true; - } - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0; - } - isStaleByTime(staleTime = 0) { - return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - var _a3; - const observer = this.observers.find((x3) => x3.shouldFetchOnWindowFocus()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a3 = __privateGet(this, _retryer)) == null ? void 0 : _a3.continue(); - } - onOnline() { - var _a3; - const observer = this.observers.find((x3) => x3.shouldFetchOnReconnect()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a3 = __privateGet(this, _retryer)) == null ? void 0 : _a3.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); - } + return res; +} +utils$t.split32 = split32; +function rotr32$1(w2, b2) { + return w2 >>> b2 | w2 << 32 - b2; +} +utils$t.rotr32 = rotr32$1; +function rotl32$2(w2, b2) { + return w2 << b2 | w2 >>> 32 - b2; +} +utils$t.rotl32 = rotl32$2; +function sum32$3(a3, b2) { + return a3 + b2 >>> 0; +} +utils$t.sum32 = sum32$3; +function sum32_3$1(a3, b2, c2) { + return a3 + b2 + c2 >>> 0; +} +utils$t.sum32_3 = sum32_3$1; +function sum32_4$2(a3, b2, c2, d4) { + return a3 + b2 + c2 + d4 >>> 0; +} +utils$t.sum32_4 = sum32_4$2; +function sum32_5$2(a3, b2, c2, d4, e18) { + return a3 + b2 + c2 + d4 + e18 >>> 0; +} +utils$t.sum32_5 = sum32_5$2; +function sum64$1(buf, pos, ah2, al2) { + var bh2 = buf[pos]; + var bl2 = buf[pos + 1]; + var lo2 = al2 + bl2 >>> 0; + var hi2 = (lo2 < al2 ? 1 : 0) + ah2 + bh2; + buf[pos] = hi2 >>> 0; + buf[pos + 1] = lo2; +} +utils$t.sum64 = sum64$1; +function sum64_hi$1(ah2, al2, bh2, bl2) { + var lo2 = al2 + bl2 >>> 0; + var hi2 = (lo2 < al2 ? 1 : 0) + ah2 + bh2; + return hi2 >>> 0; +} +utils$t.sum64_hi = sum64_hi$1; +function sum64_lo$1(ah2, al2, bh2, bl2) { + var lo2 = al2 + bl2; + return lo2 >>> 0; +} +utils$t.sum64_lo = sum64_lo$1; +function sum64_4_hi$1(ah2, al2, bh2, bl2, ch2, cl2, dh2, dl2) { + var carry = 0; + var lo2 = al2; + lo2 = lo2 + bl2 >>> 0; + carry += lo2 < al2 ? 1 : 0; + lo2 = lo2 + cl2 >>> 0; + carry += lo2 < cl2 ? 1 : 0; + lo2 = lo2 + dl2 >>> 0; + carry += lo2 < dl2 ? 1 : 0; + var hi2 = ah2 + bh2 + ch2 + dh2 + carry; + return hi2 >>> 0; +} +utils$t.sum64_4_hi = sum64_4_hi$1; +function sum64_4_lo$1(ah2, al2, bh2, bl2, ch2, cl2, dh2, dl2) { + var lo2 = al2 + bl2 + cl2 + dl2; + return lo2 >>> 0; +} +utils$t.sum64_4_lo = sum64_4_lo$1; +function sum64_5_hi$1(ah2, al2, bh2, bl2, ch2, cl2, dh2, dl2, eh2, el2) { + var carry = 0; + var lo2 = al2; + lo2 = lo2 + bl2 >>> 0; + carry += lo2 < al2 ? 1 : 0; + lo2 = lo2 + cl2 >>> 0; + carry += lo2 < cl2 ? 1 : 0; + lo2 = lo2 + dl2 >>> 0; + carry += lo2 < dl2 ? 1 : 0; + lo2 = lo2 + el2 >>> 0; + carry += lo2 < el2 ? 1 : 0; + var hi2 = ah2 + bh2 + ch2 + dh2 + eh2 + carry; + return hi2 >>> 0; +} +utils$t.sum64_5_hi = sum64_5_hi$1; +function sum64_5_lo$1(ah2, al2, bh2, bl2, ch2, cl2, dh2, dl2, eh2, el2) { + var lo2 = al2 + bl2 + cl2 + dl2 + el2; + return lo2 >>> 0; +} +utils$t.sum64_5_lo = sum64_5_lo$1; +function rotr64_hi$1(ah2, al2, num) { + var r2 = al2 << 32 - num | ah2 >>> num; + return r2 >>> 0; +} +utils$t.rotr64_hi = rotr64_hi$1; +function rotr64_lo$1(ah2, al2, num) { + var r2 = ah2 << 32 - num | al2 >>> num; + return r2 >>> 0; +} +utils$t.rotr64_lo = rotr64_lo$1; +function shr64_hi$1(ah2, al2, num) { + return ah2 >>> num; +} +utils$t.shr64_hi = shr64_hi$1; +function shr64_lo$1(ah2, al2, num) { + var r2 = ah2 << 32 - num | al2 >>> num; + return r2 >>> 0; +} +utils$t.shr64_lo = shr64_lo$1; +var common$5 = {}; +var utils$s = utils$t; +var assert$g = minimalisticAssert; +function BlockHash$4() { + 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; +} +common$5.BlockHash = BlockHash$4; +BlockHash$4.prototype.update = function update(msg, enc) { + msg = utils$s.toArray(msg, enc); + if (!this.pending) + this.pending = msg; + else + this.pending = this.pending.concat(msg); + this.pendingTotal += msg.length; + if (this.pending.length >= this._delta8) { + msg = this.pending; + var r2 = msg.length % this._delta8; + this.pending = msg.slice(msg.length - r2, msg.length); + if (this.pending.length === 0) + this.pending = null; + msg = utils$s.join32(msg, 0, msg.length - r2, this.endian); + for (var i2 = 0; i2 < msg.length; i2 += this._delta32) + this._update(msg, i2, i2 + this._delta32); } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x3) => x3 !== observer); - if (!this.observers.length) { - if (__privateGet(this, _retryer)) { - if (__privateGet(this, _abortSignalConsumed)) { - __privateGet(this, _retryer).cancel({ revert: true }); - } else { - __privateGet(this, _retryer).cancelRetry(); - } - } - this.scheduleGc(); - } - __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); - } + return this; +}; +BlockHash$4.prototype.digest = function digest(enc) { + this.update(this._pad()); + assert$g(this.pending === null); + return this._digest(enc); +}; +BlockHash$4.prototype._pad = function pad2() { + var len = this.pendingTotal; + var bytes2 = this._delta8; + var k2 = bytes2 - (len + this.padLength) % bytes2; + var res = new Array(k2 + this.padLength); + res[0] = 128; + for (var i2 = 1; i2 < k2; i2++) + res[i2] = 0; + len <<= 3; + if (this.endian === "big") { + for (var t2 = 8; t2 < this.padLength; t2++) + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = len >>> 24 & 255; + res[i2++] = len >>> 16 & 255; + res[i2++] = len >>> 8 & 255; + res[i2++] = len & 255; + } else { + res[i2++] = len & 255; + res[i2++] = len >>> 8 & 255; + res[i2++] = len >>> 16 & 255; + res[i2++] = len >>> 24 & 255; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + for (t2 = 8; t2 < this.padLength; t2++) + res[i2++] = 0; } - getObserversCount() { - return this.observers.length; + return res; +}; +var sha = {}; +var common$4 = {}; +var utils$r = utils$t; +var rotr32 = utils$r.rotr32; +function ft_1$1(s2, x3, y3, z3) { + if (s2 === 0) + return ch32$1(x3, y3, z3); + if (s2 === 1 || s2 === 3) + return p32(x3, y3, z3); + if (s2 === 2) + return maj32$1(x3, y3, z3); +} +common$4.ft_1 = ft_1$1; +function ch32$1(x3, y3, z3) { + return x3 & y3 ^ ~x3 & z3; +} +common$4.ch32 = ch32$1; +function maj32$1(x3, y3, z3) { + return x3 & y3 ^ x3 & z3 ^ y3 & z3; +} +common$4.maj32 = maj32$1; +function p32(x3, y3, z3) { + return x3 ^ y3 ^ z3; +} +common$4.p32 = p32; +function s0_256$1(x3) { + return rotr32(x3, 2) ^ rotr32(x3, 13) ^ rotr32(x3, 22); +} +common$4.s0_256 = s0_256$1; +function s1_256$1(x3) { + return rotr32(x3, 6) ^ rotr32(x3, 11) ^ rotr32(x3, 25); +} +common$4.s1_256 = s1_256$1; +function g0_256$1(x3) { + return rotr32(x3, 7) ^ rotr32(x3, 18) ^ x3 >>> 3; +} +common$4.g0_256 = g0_256$1; +function g1_256$1(x3) { + return rotr32(x3, 17) ^ rotr32(x3, 19) ^ x3 >>> 10; +} +common$4.g1_256 = g1_256$1; +var utils$q = utils$t; +var common$3 = common$5; +var shaCommon$1 = common$4; +var rotl32$1 = utils$q.rotl32; +var sum32$2 = utils$q.sum32; +var sum32_5$1 = utils$q.sum32_5; +var ft_1 = shaCommon$1.ft_1; +var BlockHash$3 = common$3.BlockHash; +var sha1_K = [ + 1518500249, + 1859775393, + 2400959708, + 3395469782 +]; +function SHA1() { + if (!(this instanceof SHA1)) + return new SHA1(); + BlockHash$3.call(this); + this.h = [ + 1732584193, + 4023233417, + 2562383102, + 271733878, + 3285377520 + ]; + this.W = new Array(80); +} +utils$q.inherits(SHA1, BlockHash$3); +var _1 = SHA1; +SHA1.blockSize = 512; +SHA1.outSize = 160; +SHA1.hmacStrength = 80; +SHA1.padLength = 64; +SHA1.prototype._update = function _update(msg, start) { + var W2 = this.W; + for (var i2 = 0; i2 < 16; i2++) + W2[i2] = msg[start + i2]; + for (; i2 < W2.length; i2++) + W2[i2] = rotl32$1(W2[i2 - 3] ^ W2[i2 - 8] ^ W2[i2 - 14] ^ W2[i2 - 16], 1); + var a3 = this.h[0]; + var b2 = this.h[1]; + var c2 = this.h[2]; + var d4 = this.h[3]; + var e18 = this.h[4]; + for (i2 = 0; i2 < W2.length; i2++) { + var s2 = ~~(i2 / 20); + var t2 = sum32_5$1(rotl32$1(a3, 5), ft_1(s2, b2, c2, d4), e18, W2[i2], sha1_K[s2]); + e18 = d4; + d4 = c2; + c2 = rotl32$1(b2, 30); + b2 = a3; + a3 = t2; } - invalidate() { - if (!this.state.isInvalidated) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "invalidate" }); - } + this.h[0] = sum32$2(this.h[0], a3); + this.h[1] = sum32$2(this.h[1], b2); + this.h[2] = sum32$2(this.h[2], c2); + this.h[3] = sum32$2(this.h[3], d4); + this.h[4] = sum32$2(this.h[4], e18); +}; +SHA1.prototype._digest = function digest2(enc) { + if (enc === "hex") + return utils$q.toHex32(this.h, "big"); + else + return utils$q.split32(this.h, "big"); +}; +var utils$p = utils$t; +var common$2 = common$5; +var shaCommon = common$4; +var assert$f = minimalisticAssert; +var sum32$1 = utils$p.sum32; +var sum32_4$1 = utils$p.sum32_4; +var sum32_5 = utils$p.sum32_5; +var ch32 = shaCommon.ch32; +var maj32 = shaCommon.maj32; +var s0_256 = shaCommon.s0_256; +var s1_256 = shaCommon.s1_256; +var g0_256 = shaCommon.g0_256; +var g1_256 = shaCommon.g1_256; +var BlockHash$2 = common$2.BlockHash; +var sha256_K = [ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 +]; +function SHA256$4() { + if (!(this instanceof SHA256$4)) + return new SHA256$4(); + BlockHash$2.call(this); + this.h = [ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]; + this.k = sha256_K; + this.W = new Array(64); +} +utils$p.inherits(SHA256$4, BlockHash$2); +var _256 = SHA256$4; +SHA256$4.blockSize = 512; +SHA256$4.outSize = 256; +SHA256$4.hmacStrength = 192; +SHA256$4.padLength = 64; +SHA256$4.prototype._update = function _update2(msg, start) { + var W2 = this.W; + for (var i2 = 0; i2 < 16; i2++) + W2[i2] = msg[start + i2]; + for (; i2 < W2.length; i2++) + W2[i2] = sum32_4$1(g1_256(W2[i2 - 2]), W2[i2 - 7], g0_256(W2[i2 - 15]), W2[i2 - 16]); + var a3 = this.h[0]; + var b2 = this.h[1]; + var c2 = this.h[2]; + var d4 = this.h[3]; + var e18 = this.h[4]; + var f4 = this.h[5]; + var g3 = this.h[6]; + var h4 = this.h[7]; + assert$f(this.k.length === W2.length); + for (i2 = 0; i2 < W2.length; i2++) { + var T12 = sum32_5(h4, s1_256(e18), ch32(e18, f4, g3), this.k[i2], W2[i2]); + var T22 = sum32$1(s0_256(a3), maj32(a3, b2, c2)); + h4 = g3; + g3 = f4; + f4 = e18; + e18 = sum32$1(d4, T12); + d4 = c2; + c2 = b2; + b2 = a3; + a3 = sum32$1(T12, T22); } - fetch(options, fetchOptions) { - var _a3, _b2, _c2; - if (this.state.fetchStatus !== "idle") { - if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { - this.cancel({ silent: true }); - } else if (__privateGet(this, _retryer)) { - __privateGet(this, _retryer).continueRetry(); - return __privateGet(this, _retryer).promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x3) => x3.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - __privateSet(this, _abortSignalConsumed, true); - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = ensureQueryFn(this.options, fetchOptions); - const queryFnContext = { - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext); - __privateSet(this, _abortSignalConsumed, false); - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const context = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - state: this.state, - fetchFn - }; - addSignalProperty(context); - (_a3 = this.options.behavior) == null ? void 0 : _a3.onFetch( - context, - this - ); - __privateSet(this, _revertState, this.state); - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_b2 = context.fetchOptions) == null ? void 0 : _b2.meta)) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "fetch", meta: (_c2 = context.fetchOptions) == null ? void 0 : _c2.meta }); - } - const onError = (error) => { - var _a4, _b3, _c3, _d2; - if (!(isCancelledError(error) && error.silent)) { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { - type: "error", - error - }); - } - if (!isCancelledError(error)) { - (_b3 = (_a4 = __privateGet(this, _cache).config).onError) == null ? void 0 : _b3.call( - _a4, - error, - this - ); - (_d2 = (_c3 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d2.call( - _c3, - this.state.data, - error, - this - ); - } - if (!this.isFetchingOptimistic) { - this.scheduleGc(); - } - this.isFetchingOptimistic = false; - }; - __privateSet(this, _retryer, createRetryer({ - initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, - fn: context.fetchFn, - abort: abortController.abort.bind(abortController), - onSuccess: (data) => { - var _a4, _b3, _c3, _d2; - if (data === void 0) { - onError(new Error(`${this.queryHash} data is undefined`)); - return; - } - this.setData(data); - (_b3 = (_a4 = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _b3.call(_a4, data, this); - (_d2 = (_c3 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d2.call( - _c3, - data, - this.state.error, - this - ); - if (!this.isFetchingOptimistic) { - this.scheduleGc(); - } - this.isFetchingOptimistic = false; - }, - onError, - onFail: (failureCount, error) => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "pause" }); - }, - onContinue: () => { - __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - })); - return __privateGet(this, _retryer).start(); - } -}, _initialState = new WeakMap(), _revertState = new WeakMap(), _cache = new WeakMap(), _retryer = new WeakMap(), _defaultOptions = new WeakMap(), _abortSignalConsumed = new WeakMap(), _dispatch = new WeakSet(), dispatch_fn = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - return { - ...state, - data: action.data, - dataUpdateCount: state.dataUpdateCount + 1, - dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success", - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - case "error": - const error = action.error; - if (isCancelledError(error) && error.revert && __privateGet(this, _revertState)) { - return { ...__privateGet(this, _revertState), fetchStatus: "idle" }; - } - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error" - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - __privateGet(this, _cache).notify({ query: this, type: "updated", action }); - }); -}, _d); -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; + this.h[0] = sum32$1(this.h[0], a3); + this.h[1] = sum32$1(this.h[1], b2); + this.h[2] = sum32$1(this.h[2], c2); + this.h[3] = sum32$1(this.h[3], d4); + this.h[4] = sum32$1(this.h[4], e18); + this.h[5] = sum32$1(this.h[5], f4); + this.h[6] = sum32$1(this.h[6], g3); + this.h[7] = sum32$1(this.h[7], h4); +}; +SHA256$4.prototype._digest = function digest3(enc) { + if (enc === "hex") + return utils$p.toHex32(this.h, "big"); + else + return utils$p.split32(this.h, "big"); +}; +var utils$o = utils$t; +var SHA256$3 = _256; +function SHA224() { + if (!(this instanceof SHA224)) + return new SHA224(); + SHA256$3.call(this); + this.h = [ + 3238371032, + 914150663, + 812702999, + 4144912697, + 4290775857, + 1750603025, + 1694076839, + 3204075428 + ]; } -function getDefaultState$1(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; +utils$o.inherits(SHA224, SHA256$3); +var _224 = SHA224; +SHA224.blockSize = 512; +SHA224.outSize = 224; +SHA224.hmacStrength = 192; +SHA224.padLength = 64; +SHA224.prototype._digest = function digest4(enc) { + if (enc === "hex") + return utils$o.toHex32(this.h.slice(0, 7), "big"); + else + return utils$o.split32(this.h.slice(0, 7), "big"); +}; +var utils$n = utils$t; +var common$1 = common$5; +var assert$e = minimalisticAssert; +var rotr64_hi = utils$n.rotr64_hi; +var rotr64_lo = utils$n.rotr64_lo; +var shr64_hi = utils$n.shr64_hi; +var shr64_lo = utils$n.shr64_lo; +var sum64 = utils$n.sum64; +var sum64_hi = utils$n.sum64_hi; +var sum64_lo = utils$n.sum64_lo; +var sum64_4_hi = utils$n.sum64_4_hi; +var sum64_4_lo = utils$n.sum64_4_lo; +var sum64_5_hi = utils$n.sum64_5_hi; +var sum64_5_lo = utils$n.sum64_5_lo; +var BlockHash$1 = common$1.BlockHash; +var sha512_K = [ + 1116352408, + 3609767458, + 1899447441, + 602891725, + 3049323471, + 3964484399, + 3921009573, + 2173295548, + 961987163, + 4081628472, + 1508970993, + 3053834265, + 2453635748, + 2937671579, + 2870763221, + 3664609560, + 3624381080, + 2734883394, + 310598401, + 1164996542, + 607225278, + 1323610764, + 1426881987, + 3590304994, + 1925078388, + 4068182383, + 2162078206, + 991336113, + 2614888103, + 633803317, + 3248222580, + 3479774868, + 3835390401, + 2666613458, + 4022224774, + 944711139, + 264347078, + 2341262773, + 604807628, + 2007800933, + 770255983, + 1495990901, + 1249150122, + 1856431235, + 1555081692, + 3175218132, + 1996064986, + 2198950837, + 2554220882, + 3999719339, + 2821834349, + 766784016, + 2952996808, + 2566594879, + 3210313671, + 3203337956, + 3336571891, + 1034457026, + 3584528711, + 2466948901, + 113926993, + 3758326383, + 338241895, + 168717936, + 666307205, + 1188179964, + 773529912, + 1546045734, + 1294757372, + 1522805485, + 1396182291, + 2643833823, + 1695183700, + 2343527390, + 1986661051, + 1014477480, + 2177026350, + 1206759142, + 2456956037, + 344077627, + 2730485921, + 1290863460, + 2820302411, + 3158454273, + 3259730800, + 3505952657, + 3345764771, + 106217008, + 3516065817, + 3606008344, + 3600352804, + 1432725776, + 4094571909, + 1467031594, + 275423344, + 851169720, + 430227734, + 3100823752, + 506948616, + 1363258195, + 659060556, + 3750685593, + 883997877, + 3785050280, + 958139571, + 3318307427, + 1322822218, + 3812723403, + 1537002063, + 2003034995, + 1747873779, + 3602036899, + 1955562222, + 1575990012, + 2024104815, + 1125592928, + 2227730452, + 2716904306, + 2361852424, + 442776044, + 2428436474, + 593698344, + 2756734187, + 3733110249, + 3204031479, + 2999351573, + 3329325298, + 3815920427, + 3391569614, + 3928383900, + 3515267271, + 566280711, + 3940187606, + 3454069534, + 4118630271, + 4000239992, + 116418474, + 1914138554, + 174292421, + 2731055270, + 289380356, + 3203993006, + 460393269, + 320620315, + 685471733, + 587496836, + 852142971, + 1086792851, + 1017036298, + 365543100, + 1126000580, + 2618297676, + 1288033470, + 3409855158, + 1501505948, + 4234509866, + 1607167915, + 987167468, + 1816402316, + 1246189591 +]; +function SHA512$3() { + if (!(this instanceof SHA512$3)) + return new SHA512$3(); + BlockHash$1.call(this); + this.h = [ + 1779033703, + 4089235720, + 3144134277, + 2227873595, + 1013904242, + 4271175723, + 2773480762, + 1595750129, + 1359893119, + 2917565137, + 2600822924, + 725511199, + 528734635, + 4215389547, + 1541459225, + 327033209 + ]; + this.k = sha512_K; + this.W = new Array(160); } -var QueryCache = (_e2 = class extends Subscribable { - constructor(config2 = {}) { - super(); - __privateAdd(this, _queries, void 0); - this.config = config2; - __privateSet(this, _queries, /* @__PURE__ */ new Map()); - } - build(client2, options, state) { - const queryKey = options.queryKey; - const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); - let query = this.get(queryHash); - if (!query) { - query = new Query({ - cache: this, - queryKey, - queryHash, - options: client2.defaultQueryOptions(options), - state, - defaultOptions: client2.getQueryDefaults(queryKey) - }); - this.add(query); - } - return query; - } - add(query) { - if (!__privateGet(this, _queries).has(query.queryHash)) { - __privateGet(this, _queries).set(query.queryHash, query); - this.notify({ - type: "added", - query - }); - } +utils$n.inherits(SHA512$3, BlockHash$1); +var _512 = SHA512$3; +SHA512$3.blockSize = 1024; +SHA512$3.outSize = 512; +SHA512$3.hmacStrength = 192; +SHA512$3.padLength = 128; +SHA512$3.prototype._prepareBlock = function _prepareBlock(msg, start) { + var W2 = this.W; + for (var i2 = 0; i2 < 32; i2++) + W2[i2] = msg[start + i2]; + for (; i2 < W2.length; i2 += 2) { + var c0_hi = g1_512_hi(W2[i2 - 4], W2[i2 - 3]); + var c0_lo = g1_512_lo(W2[i2 - 4], W2[i2 - 3]); + var c1_hi = W2[i2 - 14]; + var c1_lo = W2[i2 - 13]; + var c2_hi = g0_512_hi(W2[i2 - 30], W2[i2 - 29]); + var c2_lo = g0_512_lo(W2[i2 - 30], W2[i2 - 29]); + var c3_hi = W2[i2 - 32]; + var c3_lo = W2[i2 - 31]; + W2[i2] = sum64_4_hi( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo + ); + W2[i2 + 1] = sum64_4_lo( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo + ); } - remove(query) { - const queryInMap = __privateGet(this, _queries).get(query.queryHash); - if (queryInMap) { - query.destroy(); - if (queryInMap === query) { - __privateGet(this, _queries).delete(query.queryHash); - } - this.notify({ type: "removed", query }); - } - } - clear() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query); - }); - }); - } - get(queryHash) { - return __privateGet(this, _queries).get(queryHash); - } - getAll() { - return [...__privateGet(this, _queries).values()]; - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (query) => matchQuery(defaultedFilters, query) - ); - } - findAll(filters = {}) { - const queries = this.getAll(); - return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - onFocus() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus(); - }); - }); - } - onOnline() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline(); - }); - }); - } -}, _queries = new WeakMap(), _e2); -var Mutation = (_f2 = class extends Removable { - constructor(config2) { - super(); - __privateAdd(this, _dispatch2); - __privateAdd(this, _observers, void 0); - __privateAdd(this, _mutationCache, void 0); - __privateAdd(this, _retryer2, void 0); - this.mutationId = config2.mutationId; - __privateSet(this, _mutationCache, config2.mutationCache); - __privateSet(this, _observers, []); - this.state = config2.state || getDefaultState(); - this.setOptions(config2.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!__privateGet(this, _observers).includes(observer)) { - __privateGet(this, _observers).push(observer); - this.clearGcTimeout(); - __privateGet(this, _mutationCache).notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - __privateSet(this, _observers, __privateGet(this, _observers).filter((x3) => x3 !== observer)); - this.scheduleGc(); - __privateGet(this, _mutationCache).notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!__privateGet(this, _observers).length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - __privateGet(this, _mutationCache).remove(this); - } - } - } - continue() { - var _a3; - return ((_a3 = __privateGet(this, _retryer2)) == null ? void 0 : _a3.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - var _a3, _b2, _c2, _d2, _e3, _f3, _g2, _h3, _i3, _j2, _k2, _l2, _m2, _n3, _o3, _p2, _q2, _r4, _s3, _t2; - __privateSet(this, _retryer2, createRetryer({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables); - }, - onFail: (failureCount, error) => { - __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "pause" }); - }, - onContinue: () => { - __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "continue" }); - }, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => __privateGet(this, _mutationCache).canRun(this) - })); - const restored = this.state.status === "pending"; - const isPaused = !__privateGet(this, _retryer2).canStart(); - try { - if (!restored) { - __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "pending", variables, isPaused }); - await ((_b2 = (_a3 = __privateGet(this, _mutationCache).config).onMutate) == null ? void 0 : _b2.call( - _a3, - variables, - this - )); - const context = await ((_d2 = (_c2 = this.options).onMutate) == null ? void 0 : _d2.call(_c2, variables)); - if (context !== this.state.context) { - __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await __privateGet(this, _retryer2).start(); - await ((_f3 = (_e3 = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _f3.call( - _e3, - data, - variables, - this.state.context, - this - )); - await ((_h3 = (_g2 = this.options).onSuccess) == null ? void 0 : _h3.call(_g2, data, variables, this.state.context)); - await ((_j2 = (_i3 = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _j2.call( - _i3, - data, - null, - this.state.variables, - this.state.context, - this - )); - await ((_l2 = (_k2 = this.options).onSettled) == null ? void 0 : _l2.call(_k2, data, null, variables, this.state.context)); - __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "success", data }); - return data; - } catch (error) { - try { - await ((_n3 = (_m2 = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _n3.call( - _m2, - error, - variables, - this.state.context, - this - )); - await ((_p2 = (_o3 = this.options).onError) == null ? void 0 : _p2.call( - _o3, - error, - variables, - this.state.context - )); - await ((_r4 = (_q2 = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _r4.call( - _q2, - void 0, - error, - this.state.variables, - this.state.context, - this - )); - await ((_t2 = (_s3 = this.options).onSettled) == null ? void 0 : _t2.call( - _s3, - void 0, - error, - variables, - this.state.context - )); - throw error; - } finally { - __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "error", error }); - } - } finally { - __privateGet(this, _mutationCache).runNext(this); - } - } -}, _observers = new WeakMap(), _mutationCache = new WeakMap(), _retryer2 = new WeakMap(), _dispatch2 = new WeakSet(), dispatch_fn2 = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - __privateGet(this, _observers).forEach((observer) => { - observer.onMutationUpdate(action); - }); - __privateGet(this, _mutationCache).notify({ - mutation: this, - type: "updated", - action - }); - }); -}, _f2); -function getDefaultState() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} -var MutationCache = (_g = class extends Subscribable { - constructor(config2 = {}) { - super(); - __privateAdd(this, _mutations, void 0); - __privateAdd(this, _mutationId, void 0); - this.config = config2; - __privateSet(this, _mutations, /* @__PURE__ */ new Map()); - __privateSet(this, _mutationId, Date.now()); - } - build(client2, options, state) { - const mutation = new Mutation({ - mutationCache: this, - mutationId: ++__privateWrapper(this, _mutationId)._, - options: client2.defaultMutationOptions(options), - state - }); - this.add(mutation); - return mutation; - } - add(mutation) { - const scope = scopeFor(mutation); - const mutations = __privateGet(this, _mutations).get(scope) ?? []; - mutations.push(mutation); - __privateGet(this, _mutations).set(scope, mutations); - this.notify({ type: "added", mutation }); - } - remove(mutation) { - var _a3; - const scope = scopeFor(mutation); - if (__privateGet(this, _mutations).has(scope)) { - const mutations = (_a3 = __privateGet(this, _mutations).get(scope)) == null ? void 0 : _a3.filter((x3) => x3 !== mutation); - if (mutations) { - if (mutations.length === 0) { - __privateGet(this, _mutations).delete(scope); - } else { - __privateGet(this, _mutations).set(scope, mutations); - } - } - } - this.notify({ type: "removed", mutation }); - } - canRun(mutation) { - var _a3; - const firstPendingMutation = (_a3 = __privateGet(this, _mutations).get(scopeFor(mutation))) == null ? void 0 : _a3.find((m3) => m3.state.status === "pending"); - return !firstPendingMutation || firstPendingMutation === mutation; - } - runNext(mutation) { - var _a3; - const foundMutation = (_a3 = __privateGet(this, _mutations).get(scopeFor(mutation))) == null ? void 0 : _a3.find((m3) => m3 !== mutation && m3.state.isPaused); - return (foundMutation == null ? void 0 : foundMutation.continue()) ?? Promise.resolve(); - } - clear() { - notifyManager.batch(() => { - this.getAll().forEach((mutation) => { - this.remove(mutation); - }); - }); - } - getAll() { - return [...__privateGet(this, _mutations).values()].flat(); - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (mutation) => matchMutation(defaultedFilters, mutation) +}; +SHA512$3.prototype._update = function _update3(msg, start) { + this._prepareBlock(msg, start); + var W2 = this.W; + var ah2 = this.h[0]; + var al2 = this.h[1]; + var bh2 = this.h[2]; + var bl2 = this.h[3]; + var ch2 = this.h[4]; + var cl2 = this.h[5]; + var dh2 = this.h[6]; + var dl2 = this.h[7]; + var eh2 = this.h[8]; + var el2 = this.h[9]; + var fh2 = this.h[10]; + var fl2 = this.h[11]; + var gh2 = this.h[12]; + var gl2 = this.h[13]; + var hh2 = this.h[14]; + var hl2 = this.h[15]; + assert$e(this.k.length === W2.length); + for (var i2 = 0; i2 < W2.length; i2 += 2) { + var c0_hi = hh2; + var c0_lo = hl2; + var c1_hi = s1_512_hi(eh2, el2); + var c1_lo = s1_512_lo(eh2, el2); + var c2_hi = ch64_hi(eh2, el2, fh2, fl2, gh2); + var c2_lo = ch64_lo(eh2, el2, fh2, fl2, gh2, gl2); + var c3_hi = this.k[i2]; + var c3_lo = this.k[i2 + 1]; + var c4_hi = W2[i2]; + var c4_lo = W2[i2 + 1]; + var T1_hi = sum64_5_hi( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo, + c4_hi, + c4_lo ); - } - findAll(filters = {}) { - return this.getAll().filter((mutation) => matchMutation(filters, mutation)); - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - resumePausedMutations() { - const pausedMutations = this.getAll().filter((x3) => x3.state.isPaused); - return notifyManager.batch( - () => Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(noop$3)) - ) + var T1_lo = sum64_5_lo( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo, + c4_hi, + c4_lo ); + c0_hi = s0_512_hi(ah2, al2); + c0_lo = s0_512_lo(ah2, al2); + c1_hi = maj64_hi(ah2, al2, bh2, bl2, ch2); + c1_lo = maj64_lo(ah2, al2, bh2, bl2, ch2, cl2); + var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); + var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); + hh2 = gh2; + hl2 = gl2; + gh2 = fh2; + gl2 = fl2; + fh2 = eh2; + fl2 = el2; + eh2 = sum64_hi(dh2, dl2, T1_hi, T1_lo); + el2 = sum64_lo(dl2, dl2, T1_hi, T1_lo); + dh2 = ch2; + dl2 = cl2; + ch2 = bh2; + cl2 = bl2; + bh2 = ah2; + bl2 = al2; + ah2 = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); + al2 = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); } -}, _mutations = new WeakMap(), _mutationId = new WeakMap(), _g); -function scopeFor(mutation) { - var _a3; - return ((_a3 = mutation.options.scope) == null ? void 0 : _a3.id) ?? String(mutation.mutationId); + sum64(this.h, 0, ah2, al2); + sum64(this.h, 2, bh2, bl2); + sum64(this.h, 4, ch2, cl2); + sum64(this.h, 6, dh2, dl2); + sum64(this.h, 8, eh2, el2); + sum64(this.h, 10, fh2, fl2); + sum64(this.h, 12, gh2, gl2); + sum64(this.h, 14, hh2, hl2); +}; +SHA512$3.prototype._digest = function digest5(enc) { + if (enc === "hex") + return utils$n.toHex32(this.h, "big"); + else + return utils$n.split32(this.h, "big"); +}; +function ch64_hi(xh2, xl, yh2, yl, zh2) { + var r2 = xh2 & yh2 ^ ~xh2 & zh2; + if (r2 < 0) + r2 += 4294967296; + return r2; } -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - const fetchFn = async () => { - var _a3, _b2, _c2, _d2, _e3; - const options = context.options; - const direction = (_c2 = (_b2 = (_a3 = context.fetchOptions) == null ? void 0 : _a3.meta) == null ? void 0 : _b2.fetchMore) == null ? void 0 : _c2.direction; - const oldPages = ((_d2 = context.state.data) == null ? void 0 : _d2.pages) || []; - const oldPageParams = ((_e3 = context.state.data) == null ? void 0 : _e3.pageParams) || []; - const empty = { pages: [], pageParams: [] }; - let cancelled = false; - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - if (context.signal.aborted) { - cancelled = true; - } else { - context.signal.addEventListener("abort", () => { - cancelled = true; - }); - } - return context.signal; - } - }); - }; - const queryFn = ensureQueryFn(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const queryFnContext = { - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext); - const page = await queryFn( - queryFnContext - ); - const { maxPages } = context.options; - const addTo = previous ? addToStart : addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - let result; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - result = await fetchPage( - empty, - oldPageParams[0] ?? options.initialPageParam - ); - const remainingPages = pages ?? oldPages.length; - for (let i3 = 1; i3 < remainingPages; i3++) { - const param = getNextPageParam(options, result); - if (param == null) { - break; - } - result = await fetchPage(result, param); - } - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - var _a3, _b2; - return (_b2 = (_a3 = context.options).persister) == null ? void 0 : _b2.call( - _a3, - fetchFn, - { - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; +function ch64_lo(xh2, xl, yh2, yl, zh2, zl) { + var r2 = xl & yl ^ ~xl & zl; + if (r2 < 0) + r2 += 4294967296; + return r2; } -function getPreviousPageParam(options, { pages, pageParams }) { - var _a3; - return pages.length > 0 ? (_a3 = options.getPreviousPageParam) == null ? void 0 : _a3.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; +function maj64_hi(xh2, xl, yh2, yl, zh2) { + var r2 = xh2 & yh2 ^ xh2 & zh2 ^ yh2 & zh2; + if (r2 < 0) + r2 += 4294967296; + return r2; } -var QueryClient = (_h2 = class { - constructor(config2 = {}) { - __privateAdd(this, _queryCache, void 0); - __privateAdd(this, _mutationCache2, void 0); - __privateAdd(this, _defaultOptions2, void 0); - __privateAdd(this, _queryDefaults, void 0); - __privateAdd(this, _mutationDefaults, void 0); - __privateAdd(this, _mountCount, void 0); - __privateAdd(this, _unsubscribeFocus, void 0); - __privateAdd(this, _unsubscribeOnline, void 0); - __privateSet(this, _queryCache, config2.queryCache || new QueryCache()); - __privateSet(this, _mutationCache2, config2.mutationCache || new MutationCache()); - __privateSet(this, _defaultOptions2, config2.defaultOptions || {}); - __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mountCount, 0); - } - mount() { - __privateWrapper(this, _mountCount)._++; - if (__privateGet(this, _mountCount) !== 1) - return; - __privateSet(this, _unsubscribeFocus, focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onFocus(); - } - })); - __privateSet(this, _unsubscribeOnline, onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onOnline(); - } - })); - } - unmount() { - var _a3, _b2; - __privateWrapper(this, _mountCount)._--; - if (__privateGet(this, _mountCount) !== 0) - return; - (_a3 = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a3.call(this); - __privateSet(this, _unsubscribeFocus, void 0); - (_b2 = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b2.call(this); - __privateSet(this, _unsubscribeOnline, void 0); - } - isFetching(filters) { - return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return __privateGet(this, _mutationCache2).findAll({ ...filters, status: "pending" }).length; - } - getQueryData(queryKey) { - var _a3; - const options = this.defaultQueryOptions({ queryKey }); - return (_a3 = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a3.state.data; - } - ensureQueryData(options) { - const cachedData = this.getQueryData(options.queryKey); - if (cachedData === void 0) - return this.fetchQuery(options); - else { - const defaultedOptions = this.defaultQueryOptions(options); - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - } - getQueriesData(filters) { - return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = __privateGet(this, _queryCache).get( - defaultedOptions.queryHash - ); - const prevData = query == null ? void 0 : query.state.data; - const data = functionalUpdate(updater, prevData); - if (data === void 0) { - return void 0; - } - return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - var _a3; - const options = this.defaultQueryOptions({ queryKey }); - return (_a3 = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a3.state; - } - removeQueries(filters) { - const queryCache = __privateGet(this, _queryCache); - notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = __privateGet(this, _queryCache); - const refetchFilters = { - type: "active", - ...filters - }; - return notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries(refetchFilters, options); - }); - } - cancelQueries(filters = {}, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(noop$3).catch(noop$3); - } - invalidateQueries(filters = {}, options = {}) { - return notifyManager.batch(() => { - __privateGet(this, _queryCache).findAll(filters).forEach((query) => { - query.invalidate(); - }); - if (filters.refetchType === "none") { - return Promise.resolve(); - } - const refetchFilters = { - ...filters, - type: filters.refetchType ?? filters.type ?? "active" - }; - return this.refetchQueries(refetchFilters, options); - }); - } - refetchQueries(filters = {}, options) { - const fetchOptions = { - ...options, - cancelRefetch: (options == null ? void 0 : options.cancelRefetch) ?? true - }; - const promises = notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(noop$3); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(noop$3); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - return query.isStaleByTime( - resolveStaleTime(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(noop$3).catch(noop$3); - } - fetchInfiniteQuery(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(noop$3).catch(noop$3); - } - resumePausedMutations() { - if (onlineManager.isOnline()) { - return __privateGet(this, _mutationCache2).resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return __privateGet(this, _queryCache); - } - getMutationCache() { - return __privateGet(this, _mutationCache2); - } - getDefaultOptions() { - return __privateGet(this, _defaultOptions2); - } - setDefaultOptions(options) { - __privateSet(this, _defaultOptions2, options); - } - setQueryDefaults(queryKey, options) { - __privateGet(this, _queryDefaults).set(hashKey(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults2 = [...__privateGet(this, _queryDefaults).values()]; - let result = {}; - defaults2.forEach((queryDefault) => { - if (partialMatchKey(queryKey, queryDefault.queryKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - __privateGet(this, _mutationDefaults).set(hashKey(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults2 = [...__privateGet(this, _mutationDefaults).values()]; - let result = {}; - defaults2.forEach((queryDefault) => { - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { - result = { ...result, ...queryDefault.defaultOptions }; - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...__privateGet(this, _defaultOptions2).queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = hashQueryKeyByOptions( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options == null ? void 0 : options._defaulted) { - return options; - } - return { - ...__privateGet(this, _defaultOptions2).mutations, - ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - __privateGet(this, _queryCache).clear(); - __privateGet(this, _mutationCache2).clear(); - } -}, _queryCache = new WeakMap(), _mutationCache2 = new WeakMap(), _defaultOptions2 = new WeakMap(), _queryDefaults = new WeakMap(), _mutationDefaults = new WeakMap(), _mountCount = new WeakMap(), _unsubscribeFocus = new WeakMap(), _unsubscribeOnline = new WeakMap(), _h2); -var MutationObserver$1 = (_i = class extends Subscribable { - constructor(client2, options) { - super(); - __privateAdd(this, _updateResult); - __privateAdd(this, _notify); - __privateAdd(this, _client, void 0); - __privateAdd(this, _currentResult, void 0); - __privateAdd(this, _currentMutation, void 0); - __privateAdd(this, _mutateOptions, void 0); - __privateSet(this, _client, client2); - this.setOptions(options); - this.bindMethods(); - __privateMethod(this, _updateResult, updateResult_fn).call(this); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - var _a3; - const prevOptions = this.options; - this.options = __privateGet(this, _client).defaultMutationOptions(options); - if (!shallowEqualObjects(this.options, prevOptions)) { - __privateGet(this, _client).getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: __privateGet(this, _currentMutation), - observer: this - }); - } - if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { - this.reset(); - } else if (((_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.state.status) === "pending") { - __privateGet(this, _currentMutation).setOptions(this.options); - } - } - onUnsubscribe() { - var _a3; - if (!this.hasListeners()) { - (_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.removeObserver(this); - } - } - onMutationUpdate(action) { - __privateMethod(this, _updateResult, updateResult_fn).call(this); - __privateMethod(this, _notify, notify_fn).call(this, action); - } - getCurrentResult() { - return __privateGet(this, _currentResult); - } - reset() { - var _a3; - (_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.removeObserver(this); - __privateSet(this, _currentMutation, void 0); - __privateMethod(this, _updateResult, updateResult_fn).call(this); - __privateMethod(this, _notify, notify_fn).call(this); - } - mutate(variables, options) { - var _a3; - __privateSet(this, _mutateOptions, options); - (_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.removeObserver(this); - __privateSet(this, _currentMutation, __privateGet(this, _client).getMutationCache().build(__privateGet(this, _client), this.options)); - __privateGet(this, _currentMutation).addObserver(this); - return __privateGet(this, _currentMutation).execute(variables); - } -}, _client = new WeakMap(), _currentResult = new WeakMap(), _currentMutation = new WeakMap(), _mutateOptions = new WeakMap(), _updateResult = new WeakSet(), updateResult_fn = function() { - var _a3; - const state = ((_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.state) ?? getDefaultState(); - __privateSet(this, _currentResult, { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }); -}, _notify = new WeakSet(), notify_fn = function(action) { - notifyManager.batch(() => { - var _a3, _b2, _c2, _d2, _e3, _f3, _g2, _h3; - if (__privateGet(this, _mutateOptions) && this.hasListeners()) { - const variables = __privateGet(this, _currentResult).variables; - const context = __privateGet(this, _currentResult).context; - if ((action == null ? void 0 : action.type) === "success") { - (_b2 = (_a3 = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b2.call(_a3, action.data, variables, context); - (_d2 = (_c2 = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d2.call(_c2, action.data, null, variables, context); - } else if ((action == null ? void 0 : action.type) === "error") { - (_f3 = (_e3 = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f3.call(_e3, action.error, variables, context); - (_h3 = (_g2 = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h3.call( - _g2, - void 0, - action.error, - variables, - context - ); - } - } - this.listeners.forEach((listener) => { - listener(__privateGet(this, _currentResult)); - }); - }); -}, _i); -function connectMutationOptions(config2) { - return { - mutationFn(variables) { - return connect(config2, variables); - }, - mutationKey: ["connect"] - }; +function maj64_lo(xh2, xl, yh2, yl, zh2, zl) { + var r2 = xl & yl ^ xl & zl ^ yl & zl; + if (r2 < 0) + r2 += 4294967296; + return r2; } -function disconnectMutationOptions(config2) { - return { - mutationFn(variables) { - return disconnect(config2, variables); - }, - mutationKey: ["disconnect"] - }; +function s0_512_hi(xh2, xl) { + var c0_hi = rotr64_hi(xh2, xl, 28); + var c1_hi = rotr64_hi(xl, xh2, 2); + var c2_hi = rotr64_hi(xl, xh2, 7); + var r2 = c0_hi ^ c1_hi ^ c2_hi; + if (r2 < 0) + r2 += 4294967296; + return r2; } -var QueryClientContext = reactExports.createContext( - void 0 -); -var useQueryClient = (queryClient2) => { - const client2 = reactExports.useContext(QueryClientContext); - if (queryClient2) { - return queryClient2; - } - if (!client2) { - throw new Error("No QueryClient set, use QueryClientProvider to set one"); - } - return client2; -}; -var QueryClientProvider = ({ - client: client2, - children -}) => { - reactExports.useEffect(() => { - client2.mount(); - return () => { - client2.unmount(); - }; - }, [client2]); - return /* @__PURE__ */ jsxRuntimeExports.jsx(QueryClientContext.Provider, { value: client2, children }); -}; -function shouldThrowError(throwError2, params) { - if (typeof throwError2 === "function") { - return throwError2(...params); - } - return !!throwError2; +function s0_512_lo(xh2, xl) { + var c0_lo = rotr64_lo(xh2, xl, 28); + var c1_lo = rotr64_lo(xl, xh2, 2); + var c2_lo = rotr64_lo(xl, xh2, 7); + var r2 = c0_lo ^ c1_lo ^ c2_lo; + if (r2 < 0) + r2 += 4294967296; + return r2; } -function noop$2() { +function s1_512_hi(xh2, xl) { + var c0_hi = rotr64_hi(xh2, xl, 14); + var c1_hi = rotr64_hi(xh2, xl, 18); + var c2_hi = rotr64_hi(xl, xh2, 9); + var r2 = c0_hi ^ c1_hi ^ c2_hi; + if (r2 < 0) + r2 += 4294967296; + return r2; } -function useMutation(options, queryClient2) { - const client2 = useQueryClient(queryClient2); - const [observer] = reactExports.useState( - () => new MutationObserver$1( - client2, - options - ) - ); - reactExports.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = reactExports.useSyncExternalStore( - reactExports.useCallback( - (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = reactExports.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(noop$2); - }, - [observer] - ); - if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; +function s1_512_lo(xh2, xl) { + var c0_lo = rotr64_lo(xh2, xl, 14); + var c1_lo = rotr64_lo(xh2, xl, 18); + var c2_lo = rotr64_lo(xl, xh2, 9); + var r2 = c0_lo ^ c1_lo ^ c2_lo; + if (r2 < 0) + r2 += 4294967296; + return r2; } -function useConnectors(parameters = {}) { - const config2 = useConfig(parameters); - return reactExports.useSyncExternalStore((onChange) => watchConnectors(config2, { onChange }), () => getConnectors(config2), () => getConnectors(config2)); +function g0_512_hi(xh2, xl) { + var c0_hi = rotr64_hi(xh2, xl, 1); + var c1_hi = rotr64_hi(xh2, xl, 8); + var c2_hi = shr64_hi(xh2, xl, 7); + var r2 = c0_hi ^ c1_hi ^ c2_hi; + if (r2 < 0) + r2 += 4294967296; + return r2; } -function useConnect(parameters = {}) { - const { mutation } = parameters; - const config2 = useConfig(parameters); - const mutationOptions = connectMutationOptions(config2); - const { mutate, mutateAsync, ...result } = useMutation({ - ...mutation, - ...mutationOptions - }); - reactExports.useEffect(() => { - return config2.subscribe(({ status }) => status, (status, previousStatus) => { - if (previousStatus === "connected" && status === "disconnected") - result.reset(); - }); - }, [config2, result.reset]); - return { - ...result, - connect: mutate, - connectAsync: mutateAsync, - connectors: useConnectors({ config: config2 }) - }; +function g0_512_lo(xh2, xl) { + var c0_lo = rotr64_lo(xh2, xl, 1); + var c1_lo = rotr64_lo(xh2, xl, 8); + var c2_lo = shr64_lo(xh2, xl, 7); + var r2 = c0_lo ^ c1_lo ^ c2_lo; + if (r2 < 0) + r2 += 4294967296; + return r2; } -function useConnections(parameters = {}) { - const config2 = useConfig(parameters); - return reactExports.useSyncExternalStore((onChange) => watchConnections(config2, { onChange }), () => getConnections(config2), () => getConnections(config2)); +function g1_512_hi(xh2, xl) { + var c0_hi = rotr64_hi(xh2, xl, 19); + var c1_hi = rotr64_hi(xl, xh2, 29); + var c2_hi = shr64_hi(xh2, xl, 6); + var r2 = c0_hi ^ c1_hi ^ c2_hi; + if (r2 < 0) + r2 += 4294967296; + return r2; } -function useDisconnect(parameters = {}) { - const { mutation } = parameters; - const config2 = useConfig(parameters); - const mutationOptions = disconnectMutationOptions(config2); - const { mutate, mutateAsync, ...result } = useMutation({ - ...mutation, - ...mutationOptions - }); - return { - ...result, - connectors: useConnections({ config: config2 }).map((connection) => connection.connector), - disconnect: mutate, - disconnectAsync: mutateAsync - }; +function g1_512_lo(xh2, xl) { + var c0_lo = rotr64_lo(xh2, xl, 19); + var c1_lo = rotr64_lo(xl, xh2, 29); + var c2_lo = shr64_lo(xh2, xl, 6); + var r2 = c0_lo ^ c1_lo ^ c2_lo; + if (r2 < 0) + r2 += 4294967296; + return r2; } -coinbaseWallet$1.type = "coinbaseWallet"; -function coinbaseWallet$1(parameters = {}) { - if (parameters.version === "3" || parameters.headlessMode) - return version3(parameters); - return version4(parameters); +var utils$m = utils$t; +var SHA512$2 = _512; +function SHA384() { + if (!(this instanceof SHA384)) + return new SHA384(); + SHA512$2.call(this); + this.h = [ + 3418070365, + 3238371032, + 1654270250, + 914150663, + 2438529370, + 812702999, + 355462360, + 4144912697, + 1731405415, + 4290775857, + 2394180231, + 1750603025, + 3675008525, + 1694076839, + 1203062813, + 3204075428 + ]; } -function version4(parameters) { - let walletProvider; - let accountsChanged; - let chainChanged; - let disconnect2; - return createConnector((config2) => ({ - id: "coinbaseWalletSDK", - name: "Coinbase Wallet", - rdns: "com.coinbase.wallet", - type: coinbaseWallet$1.type, - async connect({ chainId } = {}) { - try { - const provider = await this.getProvider(); - const accounts2 = (await provider.request({ - method: "eth_requestAccounts" - })).map((x3) => getAddress$2(x3)); - if (!accountsChanged) { - accountsChanged = this.onAccountsChanged.bind(this); - provider.on("accountsChanged", accountsChanged); - } - if (!chainChanged) { - chainChanged = this.onChainChanged.bind(this); - provider.on("chainChanged", chainChanged); - } - if (!disconnect2) { - disconnect2 = this.onDisconnect.bind(this); - provider.on("disconnect", disconnect2); - } - let currentChainId = await this.getChainId(); - if (chainId && currentChainId !== chainId) { - const chain = await this.switchChain({ chainId }).catch((error) => { - if (error.code === UserRejectedRequestError.code) - throw error; - return { id: currentChainId }; - }); - currentChainId = (chain == null ? void 0 : chain.id) ?? currentChainId; - } - return { accounts: accounts2, chainId: currentChainId }; - } catch (error) { - if (/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(error.message)) - throw new UserRejectedRequestError(error); - throw error; - } - }, - async disconnect() { - var _a3; - const provider = await this.getProvider(); - if (accountsChanged) { - provider.removeListener("accountsChanged", accountsChanged); - accountsChanged = void 0; - } - if (chainChanged) { - provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; - } - if (disconnect2) { - provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; - } - provider.disconnect(); - (_a3 = provider.close) == null ? void 0 : _a3.call(provider); - }, - async getAccounts() { - const provider = await this.getProvider(); - return (await provider.request({ - method: "eth_accounts" - })).map((x3) => getAddress$2(x3)); - }, - async getChainId() { - const provider = await this.getProvider(); - const chainId = await provider.request({ - method: "eth_chainId" - }); - return Number(chainId); - }, - async getProvider() { - if (!walletProvider) { - const preference = (() => { - var _a3; - if (typeof parameters.preference === "string") - return { options: parameters.preference }; - return { - ...parameters.preference, - options: ((_a3 = parameters.preference) == null ? void 0 : _a3.options) ?? "all" - }; - })(); - const { createCoinbaseWalletSDK } = await __vitePreload(() => import("./index-87e4afbf.js"), true ? ["./index-87e4afbf.js","./hooks.module-2202d2c9.js"] : void 0, import.meta.url); - const sdk = createCoinbaseWalletSDK({ - ...parameters, - appChainIds: config2.chains.map((x3) => x3.id), - preference - }); - walletProvider = sdk.getProvider(); - } - return walletProvider; - }, - async isAuthorized() { - try { - const accounts2 = await this.getAccounts(); - return !!accounts2.length; - } catch { - return false; - } - }, - async switchChain({ addEthereumChainParameter, chainId }) { - var _a3, _b2, _c2, _d2; - const chain = config2.chains.find((chain2) => chain2.id === chainId); - if (!chain) - throw new SwitchChainError(new ChainNotConfiguredError()); - const provider = await this.getProvider(); - try { - await provider.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId: numberToHex(chain.id) }] - }); - return chain; - } catch (error) { - if (error.code === 4902) { - try { - let blockExplorerUrls; - if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) - blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; - else - blockExplorerUrls = ((_a3 = chain.blockExplorers) == null ? void 0 : _a3.default.url) ? [(_b2 = chain.blockExplorers) == null ? void 0 : _b2.default.url] : []; - let rpcUrls; - if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) - rpcUrls = addEthereumChainParameter.rpcUrls; - else - rpcUrls = [((_d2 = chain.rpcUrls.default) == null ? void 0 : _d2.http[0]) ?? ""]; - const addEthereumChain = { - blockExplorerUrls, - chainId: numberToHex(chainId), - chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, - iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, - nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, - rpcUrls - }; - await provider.request({ - method: "wallet_addEthereumChain", - params: [addEthereumChain] - }); - return chain; - } catch (error2) { - throw new UserRejectedRequestError(error2); - } - } - throw new SwitchChainError(error); - } - }, - onAccountsChanged(accounts2) { - if (accounts2.length === 0) - this.onDisconnect(); - else - config2.emitter.emit("change", { - accounts: accounts2.map((x3) => getAddress$2(x3)) - }); - }, - onChainChanged(chain) { - const chainId = Number(chain); - config2.emitter.emit("change", { chainId }); - }, - async onDisconnect(_error) { - config2.emitter.emit("disconnect"); - const provider = await this.getProvider(); - if (accountsChanged) { - provider.removeListener("accountsChanged", accountsChanged); - accountsChanged = void 0; - } - if (chainChanged) { - provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; - } - if (disconnect2) { - provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; - } - } - })); +utils$m.inherits(SHA384, SHA512$2); +var _384 = SHA384; +SHA384.blockSize = 1024; +SHA384.outSize = 384; +SHA384.hmacStrength = 192; +SHA384.padLength = 128; +SHA384.prototype._digest = function digest6(enc) { + if (enc === "hex") + return utils$m.toHex32(this.h.slice(0, 12), "big"); + else + return utils$m.split32(this.h.slice(0, 12), "big"); +}; +sha.sha1 = _1; +sha.sha224 = _224; +sha.sha256 = _256; +sha.sha384 = _384; +sha.sha512 = _512; +var ripemd = {}; +var utils$l = utils$t; +var common = common$5; +var rotl32 = utils$l.rotl32; +var sum32 = utils$l.sum32; +var sum32_3 = utils$l.sum32_3; +var sum32_4 = utils$l.sum32_4; +var BlockHash = common.BlockHash; +function RIPEMD160$1() { + if (!(this instanceof RIPEMD160$1)) + return new RIPEMD160$1(); + BlockHash.call(this); + this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + this.endian = "little"; } -function version3(parameters) { - const reloadOnDisconnect = false; - let sdk; - let walletProvider; - let accountsChanged; - let chainChanged; - let disconnect2; - return createConnector((config2) => ({ - id: "coinbaseWalletSDK", - name: "Coinbase Wallet", - type: coinbaseWallet$1.type, - async connect({ chainId } = {}) { - try { - const provider = await this.getProvider(); - const accounts2 = (await provider.request({ - method: "eth_requestAccounts" - })).map((x3) => getAddress$2(x3)); - if (!accountsChanged) { - accountsChanged = this.onAccountsChanged.bind(this); - provider.on("accountsChanged", accountsChanged); - } - if (!chainChanged) { - chainChanged = this.onChainChanged.bind(this); - provider.on("chainChanged", chainChanged); - } - if (!disconnect2) { - disconnect2 = this.onDisconnect.bind(this); - provider.on("disconnect", disconnect2); - } - let currentChainId = await this.getChainId(); - if (chainId && currentChainId !== chainId) { - const chain = await this.switchChain({ chainId }).catch((error) => { - if (error.code === UserRejectedRequestError.code) - throw error; - return { id: currentChainId }; - }); - currentChainId = (chain == null ? void 0 : chain.id) ?? currentChainId; - } - return { accounts: accounts2, chainId: currentChainId }; - } catch (error) { - if (/(user closed modal|accounts received is empty|user denied account)/i.test(error.message)) - throw new UserRejectedRequestError(error); - throw error; - } - }, - async disconnect() { - const provider = await this.getProvider(); - if (accountsChanged) { - provider.removeListener("accountsChanged", accountsChanged); - accountsChanged = void 0; - } - if (chainChanged) { - provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; - } - if (disconnect2) { - provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; - } - provider.disconnect(); - provider.close(); - }, - async getAccounts() { - const provider = await this.getProvider(); - return (await provider.request({ - method: "eth_accounts" - })).map((x3) => getAddress$2(x3)); - }, - async getChainId() { - const provider = await this.getProvider(); - const chainId = await provider.request({ - method: "eth_chainId" - }); - return Number(chainId); - }, - async getProvider() { - var _a3; - if (!walletProvider) { - const CoinbaseWalletSDK = await (async () => { - const { default: SDK } = await __vitePreload(() => import("./index-41d2f1d2.js").then((n4) => n4.i), true ? ["./index-41d2f1d2.js","./hooks.module-2202d2c9.js"] : void 0, import.meta.url); - if (typeof SDK !== "function" && typeof SDK.default === "function") - return SDK.default; - return SDK; - })(); - sdk = new CoinbaseWalletSDK({ ...parameters, reloadOnDisconnect }); - const walletExtensionChainId = (_a3 = sdk.walletExtension) == null ? void 0 : _a3.getChainId(); - const chain = config2.chains.find((chain2) => parameters.chainId ? chain2.id === parameters.chainId : chain2.id === walletExtensionChainId) || config2.chains[0]; - const chainId = parameters.chainId || (chain == null ? void 0 : chain.id); - const jsonRpcUrl = parameters.jsonRpcUrl || (chain == null ? void 0 : chain.rpcUrls.default.http[0]); - walletProvider = sdk.makeWeb3Provider(jsonRpcUrl, chainId); - } - return walletProvider; - }, - async isAuthorized() { - try { - const accounts2 = await this.getAccounts(); - return !!accounts2.length; - } catch { - return false; - } - }, - async switchChain({ addEthereumChainParameter, chainId }) { - var _a3, _b2, _c2, _d2; - const chain = config2.chains.find((chain2) => chain2.id === chainId); - if (!chain) - throw new SwitchChainError(new ChainNotConfiguredError()); - const provider = await this.getProvider(); - try { - await provider.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId: numberToHex(chain.id) }] - }); - return chain; - } catch (error) { - if (error.code === 4902) { - try { - let blockExplorerUrls; - if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) - blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; - else - blockExplorerUrls = ((_a3 = chain.blockExplorers) == null ? void 0 : _a3.default.url) ? [(_b2 = chain.blockExplorers) == null ? void 0 : _b2.default.url] : []; - let rpcUrls; - if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) - rpcUrls = addEthereumChainParameter.rpcUrls; - else - rpcUrls = [((_d2 = chain.rpcUrls.default) == null ? void 0 : _d2.http[0]) ?? ""]; - const addEthereumChain = { - blockExplorerUrls, - chainId: numberToHex(chainId), - chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, - iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, - nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, - rpcUrls - }; - await provider.request({ - method: "wallet_addEthereumChain", - params: [addEthereumChain] - }); - return chain; - } catch (error2) { - throw new UserRejectedRequestError(error2); - } - } - throw new SwitchChainError(error); - } - }, - onAccountsChanged(accounts2) { - if (accounts2.length === 0) - this.onDisconnect(); - else - config2.emitter.emit("change", { - accounts: accounts2.map((x3) => getAddress$2(x3)) - }); - }, - onChainChanged(chain) { - const chainId = Number(chain); - config2.emitter.emit("change", { chainId }); - }, - async onDisconnect(_error) { - config2.emitter.emit("disconnect"); - const provider = await this.getProvider(); - if (accountsChanged) { - provider.removeListener("accountsChanged", accountsChanged); - accountsChanged = void 0; - } - if (chainChanged) { - provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; - } - if (disconnect2) { - provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; - } - } - })); -} -walletConnect$1.type = "walletConnect"; -function walletConnect$1(parameters) { - const isNewChainsStale = parameters.isNewChainsStale ?? true; - let provider_; - let providerPromise; - const NAMESPACE = "eip155"; - let accountsChanged; - let chainChanged; - let connect2; - let displayUri; - let sessionDelete; - let disconnect2; - return createConnector((config2) => ({ - id: "walletConnect", - name: "WalletConnect", - type: walletConnect$1.type, - async setup() { - const provider = await this.getProvider().catch(() => null); - if (!provider) - return; - if (!connect2) { - connect2 = this.onConnect.bind(this); - provider.on("connect", connect2); - } - if (!sessionDelete) { - sessionDelete = this.onSessionDelete.bind(this); - provider.on("session_delete", sessionDelete); - } - }, - async connect({ chainId, ...rest } = {}) { - var _a3, _b2; - try { - const provider = await this.getProvider(); - if (!provider) - throw new ProviderNotFoundError(); - if (!displayUri) { - displayUri = this.onDisplayUri; - provider.on("display_uri", displayUri); - } - let targetChainId = chainId; - if (!targetChainId) { - const state = await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem("state")) ?? {}; - const isChainSupported = config2.chains.some((x3) => x3.id === state.chainId); - if (isChainSupported) - targetChainId = state.chainId; - else - targetChainId = (_b2 = config2.chains[0]) == null ? void 0 : _b2.id; - } - if (!targetChainId) - throw new Error("No chains found on connector."); - const isChainsStale = await this.isChainsStale(); - if (provider.session && isChainsStale) - await provider.disconnect(); - if (!provider.session || isChainsStale) { - const optionalChains = config2.chains.filter((chain) => chain.id !== targetChainId).map((optionalChain) => optionalChain.id); - await provider.connect({ - optionalChains: [targetChainId, ...optionalChains], - ..."pairingTopic" in rest ? { pairingTopic: rest.pairingTopic } : {} - }); - this.setRequestedChainsIds(config2.chains.map((x3) => x3.id)); - } - const accounts2 = (await provider.enable()).map((x3) => getAddress$2(x3)); - const currentChainId = await this.getChainId(); - if (displayUri) { - provider.removeListener("display_uri", displayUri); - displayUri = void 0; - } - if (connect2) { - provider.removeListener("connect", connect2); - connect2 = void 0; - } - if (!accountsChanged) { - accountsChanged = this.onAccountsChanged.bind(this); - provider.on("accountsChanged", accountsChanged); - } - if (!chainChanged) { - chainChanged = this.onChainChanged.bind(this); - provider.on("chainChanged", chainChanged); - } - if (!disconnect2) { - disconnect2 = this.onDisconnect.bind(this); - provider.on("disconnect", disconnect2); - } - if (!sessionDelete) { - sessionDelete = this.onSessionDelete.bind(this); - provider.on("session_delete", sessionDelete); - } - return { accounts: accounts2, chainId: currentChainId }; - } catch (error) { - if (/(user rejected|connection request reset)/i.test(error == null ? void 0 : error.message)) { - throw new UserRejectedRequestError(error); - } - throw error; - } - }, - async disconnect() { - const provider = await this.getProvider(); - try { - await (provider == null ? void 0 : provider.disconnect()); - } catch (error) { - if (!/No matching key/i.test(error.message)) - throw error; - } finally { - if (chainChanged) { - provider == null ? void 0 : provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; - } - if (disconnect2) { - provider == null ? void 0 : provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; - } - if (!connect2) { - connect2 = this.onConnect.bind(this); - provider == null ? void 0 : provider.on("connect", connect2); - } - if (accountsChanged) { - provider == null ? void 0 : provider.removeListener("accountsChanged", accountsChanged); - accountsChanged = void 0; - } - if (sessionDelete) { - provider == null ? void 0 : provider.removeListener("session_delete", sessionDelete); - sessionDelete = void 0; - } - this.setRequestedChainsIds([]); - } - }, - async getAccounts() { - const provider = await this.getProvider(); - return provider.accounts.map((x3) => getAddress$2(x3)); - }, - async getProvider({ chainId } = {}) { - var _a3; - async function initProvider() { - const optionalChains = config2.chains.map((x3) => x3.id); - if (!optionalChains.length) - return; - const { EthereumProvider: EthereumProvider2 } = await __vitePreload(() => import("./index.es-3fcdcded.js"), true ? [] : void 0, import.meta.url); - return await EthereumProvider2.init({ - ...parameters, - disableProviderPing: true, - optionalChains, - projectId: parameters.projectId, - rpcMap: Object.fromEntries(config2.chains.map((chain) => { - const [url] = extractRpcUrls({ - chain, - transports: config2.transports - }); - return [chain.id, url]; - })), - showQrModal: parameters.showQrModal ?? true - }); - } - if (!provider_) { - if (!providerPromise) - providerPromise = initProvider(); - provider_ = await providerPromise; - provider_ == null ? void 0 : provider_.events.setMaxListeners(Number.POSITIVE_INFINITY); - } - if (chainId) - await ((_a3 = this.switchChain) == null ? void 0 : _a3.call(this, { chainId })); - return provider_; - }, - async getChainId() { - const provider = await this.getProvider(); - return provider.chainId; - }, - async isAuthorized() { - try { - const [accounts2, provider] = await Promise.all([ - this.getAccounts(), - this.getProvider() - ]); - if (!accounts2.length) - return false; - const isChainsStale = await this.isChainsStale(); - if (isChainsStale && provider.session) { - await provider.disconnect().catch(() => { - }); - return false; - } - return true; - } catch { - return false; - } - }, - async switchChain({ addEthereumChainParameter, chainId }) { - var _a3, _b2, _c2; - const provider = await this.getProvider(); - if (!provider) - throw new ProviderNotFoundError(); - const chain = config2.chains.find((x3) => x3.id === chainId); - if (!chain) - throw new SwitchChainError(new ChainNotConfiguredError()); - try { - await Promise.all([ - new Promise((resolve) => { - const listener = ({ chainId: currentChainId }) => { - if (currentChainId === chainId) { - config2.emitter.off("change", listener); - resolve(); - } - }; - config2.emitter.on("change", listener); - }), - provider.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId: numberToHex(chainId) }] - }) - ]); - const requestedChains = await this.getRequestedChainsIds(); - this.setRequestedChainsIds([...requestedChains, chainId]); - return chain; - } catch (err) { - const error = err; - if (/(user rejected)/i.test(error.message)) - throw new UserRejectedRequestError(error); - try { - let blockExplorerUrls; - if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) - blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; - else - blockExplorerUrls = ((_a3 = chain.blockExplorers) == null ? void 0 : _a3.default.url) ? [(_b2 = chain.blockExplorers) == null ? void 0 : _b2.default.url] : []; - let rpcUrls; - if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) - rpcUrls = addEthereumChainParameter.rpcUrls; - else - rpcUrls = [...chain.rpcUrls.default.http]; - const addEthereumChain = { - blockExplorerUrls, - chainId: numberToHex(chainId), - chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, - iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, - nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, - rpcUrls - }; - await provider.request({ - method: "wallet_addEthereumChain", - params: [addEthereumChain] - }); - const requestedChains = await this.getRequestedChainsIds(); - this.setRequestedChainsIds([...requestedChains, chainId]); - return chain; - } catch (error2) { - throw new UserRejectedRequestError(error2); - } - } - }, - onAccountsChanged(accounts2) { - if (accounts2.length === 0) - this.onDisconnect(); - else - config2.emitter.emit("change", { - accounts: accounts2.map((x3) => getAddress$2(x3)) - }); - }, - onChainChanged(chain) { - const chainId = Number(chain); - config2.emitter.emit("change", { chainId }); - }, - async onConnect(connectInfo) { - const chainId = Number(connectInfo.chainId); - const accounts2 = await this.getAccounts(); - config2.emitter.emit("connect", { accounts: accounts2, chainId }); - }, - async onDisconnect(_error) { - this.setRequestedChainsIds([]); - config2.emitter.emit("disconnect"); - const provider = await this.getProvider(); - if (accountsChanged) { - provider.removeListener("accountsChanged", accountsChanged); - accountsChanged = void 0; - } - if (chainChanged) { - provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; - } - if (disconnect2) { - provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; - } - if (sessionDelete) { - provider.removeListener("session_delete", sessionDelete); - sessionDelete = void 0; - } - if (!connect2) { - connect2 = this.onConnect.bind(this); - provider.on("connect", connect2); - } - }, - onDisplayUri(uri) { - config2.emitter.emit("message", { type: "display_uri", data: uri }); - }, - onSessionDelete() { - this.onDisconnect(); - }, - getNamespaceChainsIds() { - var _a3, _b2, _c2; - if (!provider_) - return []; - const chainIds = (_c2 = (_b2 = (_a3 = provider_.session) == null ? void 0 : _a3.namespaces[NAMESPACE]) == null ? void 0 : _b2.accounts) == null ? void 0 : _c2.map((account) => Number.parseInt(account.split(":")[1] || "")); - return chainIds ?? []; - }, - async getRequestedChainsIds() { - var _a3; - return await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem(this.requestedChainsStorageKey)) ?? []; - }, - /** - * Checks if the target chains match the chains that were - * initially requested by the connector for the WalletConnect session. - * If there is a mismatch, this means that the chains on the connector - * are considered stale, and need to be revalidated at a later point (via - * connection). - * - * There may be a scenario where a dapp adds a chain to the - * connector later on, however, this chain will not have been approved or rejected - * by the wallet. In this case, the chain is considered stale. - */ - async isChainsStale() { - if (!isNewChainsStale) - return false; - const connectorChains = config2.chains.map((x3) => x3.id); - const namespaceChains = this.getNamespaceChainsIds(); - if (namespaceChains.length && !namespaceChains.some((id2) => connectorChains.includes(id2))) - return false; - const requestedChains = await this.getRequestedChainsIds(); - return !connectorChains.every((id2) => requestedChains.includes(id2)); - }, - async setRequestedChainsIds(chains) { - var _a3; - await ((_a3 = config2.storage) == null ? void 0 : _a3.setItem(this.requestedChainsStorageKey, chains)); - }, - get requestedChainsStorageKey() { - return `${this.id}.requestedChains`; - } - })); -} -var hash$6 = {}; -var utils$t = {}; -var minimalisticAssert = assert$i; -function assert$i(val, msg) { - if (!val) - throw new Error(msg || "Assertion failed"); -} -assert$i.equal = function assertEqual(l2, r2, msg) { - if (l2 != r2) - throw new Error(msg || "Assertion failed: " + l2 + " != " + r2); -}; -var inherits_browser = { exports: {} }; -if (typeof Object.create === "function") { - inherits_browser.exports = function inherits2(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - } - }; -} else { - inherits_browser.exports = function inherits2(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - var TempCtor = function() { - }; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - }; -} -var inherits_browserExports = inherits_browser.exports; -var assert$h = minimalisticAssert; -var inherits$4 = inherits_browserExports; -utils$t.inherits = inherits$4; -function isSurrogatePair$1(msg, i3) { - if ((msg.charCodeAt(i3) & 64512) !== 55296) { - return false; - } - if (i3 < 0 || i3 + 1 >= msg.length) { - return false; +utils$l.inherits(RIPEMD160$1, BlockHash); +ripemd.ripemd160 = RIPEMD160$1; +RIPEMD160$1.blockSize = 512; +RIPEMD160$1.outSize = 160; +RIPEMD160$1.hmacStrength = 192; +RIPEMD160$1.padLength = 64; +RIPEMD160$1.prototype._update = function update2(msg, start) { + var A2 = this.h[0]; + var B2 = this.h[1]; + var C3 = this.h[2]; + var D2 = this.h[3]; + var E2 = this.h[4]; + var Ah2 = A2; + var Bh2 = B2; + var Ch2 = C3; + var Dh2 = D2; + var Eh2 = E2; + for (var j2 = 0; j2 < 80; j2++) { + var T9 = sum32( + rotl32( + sum32_4(A2, f$6(j2, B2, C3, D2), msg[r$7[j2] + start], K$3(j2)), + s$3[j2] + ), + E2 + ); + A2 = E2; + E2 = D2; + D2 = rotl32(C3, 10); + C3 = B2; + B2 = T9; + T9 = sum32( + rotl32( + sum32_4(Ah2, f$6(79 - j2, Bh2, Ch2, Dh2), msg[rh$1[j2] + start], Kh(j2)), + sh[j2] + ), + Eh2 + ); + Ah2 = Eh2; + Eh2 = Dh2; + Dh2 = rotl32(Ch2, 10); + Ch2 = Bh2; + Bh2 = T9; } - return (msg.charCodeAt(i3 + 1) & 64512) === 56320; + T9 = sum32_3(this.h[1], C3, Dh2); + this.h[1] = sum32_3(this.h[2], D2, Eh2); + this.h[2] = sum32_3(this.h[3], E2, Ah2); + this.h[3] = sum32_3(this.h[4], A2, Bh2); + this.h[4] = sum32_3(this.h[0], B2, Ch2); + this.h[0] = T9; +}; +RIPEMD160$1.prototype._digest = function digest7(enc) { + if (enc === "hex") + return utils$l.toHex32(this.h, "little"); + else + return utils$l.split32(this.h, "little"); +}; +function f$6(j2, x3, y3, z3) { + if (j2 <= 15) + return x3 ^ y3 ^ z3; + else if (j2 <= 31) + return x3 & y3 | ~x3 & z3; + else if (j2 <= 47) + return (x3 | ~y3) ^ z3; + else if (j2 <= 63) + return x3 & z3 | y3 & ~z3; + else + return x3 ^ (y3 | ~z3); } -function toArray$1(msg, enc) { - if (Array.isArray(msg)) - return msg.slice(); - if (!msg) - return []; - var res = []; - if (typeof msg === "string") { - if (!enc) { - var p3 = 0; - for (var i3 = 0; i3 < msg.length; i3++) { - var c2 = msg.charCodeAt(i3); - if (c2 < 128) { - res[p3++] = c2; - } else if (c2 < 2048) { - res[p3++] = c2 >> 6 | 192; - res[p3++] = c2 & 63 | 128; - } else if (isSurrogatePair$1(msg, i3)) { - c2 = 65536 + ((c2 & 1023) << 10) + (msg.charCodeAt(++i3) & 1023); - res[p3++] = c2 >> 18 | 240; - res[p3++] = c2 >> 12 & 63 | 128; - res[p3++] = c2 >> 6 & 63 | 128; - res[p3++] = c2 & 63 | 128; - } else { - res[p3++] = c2 >> 12 | 224; - res[p3++] = c2 >> 6 & 63 | 128; - res[p3++] = c2 & 63 | 128; - } - } - } else if (enc === "hex") { - msg = msg.replace(/[^a-z0-9]+/ig, ""); - if (msg.length % 2 !== 0) - msg = "0" + msg; - for (i3 = 0; i3 < msg.length; i3 += 2) - res.push(parseInt(msg[i3] + msg[i3 + 1], 16)); - } - } else { - for (i3 = 0; i3 < msg.length; i3++) - res[i3] = msg[i3] | 0; - } - return res; +function K$3(j2) { + if (j2 <= 15) + return 0; + else if (j2 <= 31) + return 1518500249; + else if (j2 <= 47) + return 1859775393; + else if (j2 <= 63) + return 2400959708; + else + return 2840853838; } -utils$t.toArray = toArray$1; -function toHex$2(msg) { - var res = ""; - for (var i3 = 0; i3 < msg.length; i3++) - res += zero2(msg[i3].toString(16)); - return res; +function Kh(j2) { + if (j2 <= 15) + return 1352829926; + else if (j2 <= 31) + return 1548603684; + else if (j2 <= 47) + return 1836072691; + else if (j2 <= 63) + return 2053994217; + else + return 0; } -utils$t.toHex = toHex$2; -function htonl(w2) { - var res = w2 >>> 24 | w2 >>> 8 & 65280 | w2 << 8 & 16711680 | (w2 & 255) << 24; - return res >>> 0; +var r$7 = [ + 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 rh$1 = [ + 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 s$3 = [ + 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 sh = [ + 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 +]; +var utils$k = utils$t; +var assert$d = minimalisticAssert; +function Hmac(hash3, key2, enc) { + if (!(this instanceof Hmac)) + return new Hmac(hash3, key2, enc); + this.Hash = hash3; + this.blockSize = hash3.blockSize / 8; + this.outSize = hash3.outSize / 8; + this.inner = null; + this.outer = null; + this._init(utils$k.toArray(key2, enc)); } -utils$t.htonl = htonl; -function toHex32(msg, endian) { - var res = ""; - for (var i3 = 0; i3 < msg.length; i3++) { - var w2 = msg[i3]; - if (endian === "little") - w2 = htonl(w2); - res += zero8(w2.toString(16)); +var hmac$4 = Hmac; +Hmac.prototype._init = function init(key2) { + if (key2.length > this.blockSize) + key2 = new this.Hash().update(key2).digest(); + assert$d(key2.length <= this.blockSize); + for (var i2 = key2.length; i2 < this.blockSize; i2++) + key2.push(0); + for (i2 = 0; i2 < key2.length; i2++) + key2[i2] ^= 54; + this.inner = new this.Hash().update(key2); + for (i2 = 0; i2 < key2.length; i2++) + key2[i2] ^= 106; + this.outer = new this.Hash().update(key2); +}; +Hmac.prototype.update = function update3(msg, enc) { + this.inner.update(msg, enc); + return this; +}; +Hmac.prototype.digest = function digest8(enc) { + this.outer.update(this.inner.digest()); + return this.outer.digest(enc); +}; +(function(exports) { + var hash3 = exports; + hash3.utils = utils$t; + hash3.common = common$5; + hash3.sha = sha; + hash3.ripemd = ripemd; + hash3.hmac = hmac$4; + hash3.sha1 = hash3.sha.sha1; + hash3.sha256 = hash3.sha.sha256; + hash3.sha224 = hash3.sha.sha224; + hash3.sha384 = hash3.sha.sha384; + hash3.sha512 = hash3.sha.sha512; + hash3.ripemd160 = hash3.ripemd.ripemd160; +})(hash$6); +const hash$5 = /* @__PURE__ */ getDefaultExportFromCjs$1(hash$6); +const eB = /* @__PURE__ */ _mergeNamespaces({ + __proto__: null, + default: hash$5 +}, [hash$6]); +const _hasBuffer = typeof Buffer === "function"; +const _TD = typeof TextDecoder === "function" ? new TextDecoder() : void 0; +const _TE = typeof TextEncoder === "function" ? new TextEncoder() : void 0; +const b64ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; +const b64chs = Array.prototype.slice.call(b64ch); +const b64tab = ((a3) => { + let tab = {}; + a3.forEach((c2, i2) => tab[c2] = i2); + return tab; +})(b64chs); +const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/; +const _fromCC = String.fromCharCode.bind(String); +const _U8Afrom = typeof Uint8Array.from === "function" ? Uint8Array.from.bind(Uint8Array) : (it2) => new Uint8Array(Array.prototype.slice.call(it2, 0)); +const _mkUriSafe = (src2) => src2.replace(/=/g, "").replace(/[+\/]/g, (m02) => m02 == "+" ? "-" : "_"); +const _tidyB64 = (s2) => s2.replace(/[^A-Za-z0-9\+\/]/g, ""); +const btoaPolyfill = (bin) => { + let u322, c02, c1, c2, asc = ""; + const pad3 = bin.length % 3; + for (let i2 = 0; i2 < bin.length; ) { + if ((c02 = bin.charCodeAt(i2++)) > 255 || (c1 = bin.charCodeAt(i2++)) > 255 || (c2 = bin.charCodeAt(i2++)) > 255) + throw new TypeError("invalid character found"); + u322 = c02 << 16 | c1 << 8 | c2; + asc += b64chs[u322 >> 18 & 63] + b64chs[u322 >> 12 & 63] + b64chs[u322 >> 6 & 63] + b64chs[u322 & 63]; } - return res; + return pad3 ? asc.slice(0, pad3 - 3) + "===".substring(pad3) : asc; +}; +const _btoa = typeof btoa === "function" ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, "binary").toString("base64") : btoaPolyfill; +const _fromUint8Array = _hasBuffer ? (u8a2) => Buffer.from(u8a2).toString("base64") : (u8a2) => { + const maxargs = 4096; + let strs = []; + for (let i2 = 0, l2 = u8a2.length; i2 < l2; i2 += maxargs) { + strs.push(_fromCC.apply(null, u8a2.subarray(i2, i2 + maxargs))); + } + return _btoa(strs.join("")); +}; +const cb_utob = (c2) => { + if (c2.length < 2) { + var cc2 = c2.charCodeAt(0); + return cc2 < 128 ? c2 : cc2 < 2048 ? _fromCC(192 | cc2 >>> 6) + _fromCC(128 | cc2 & 63) : _fromCC(224 | cc2 >>> 12 & 15) + _fromCC(128 | cc2 >>> 6 & 63) + _fromCC(128 | cc2 & 63); + } else { + var cc2 = 65536 + (c2.charCodeAt(0) - 55296) * 1024 + (c2.charCodeAt(1) - 56320); + return _fromCC(240 | cc2 >>> 18 & 7) + _fromCC(128 | cc2 >>> 12 & 63) + _fromCC(128 | cc2 >>> 6 & 63) + _fromCC(128 | cc2 & 63); + } +}; +const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; +const utob = (u2) => u2.replace(re_utob, cb_utob); +const _encode$1 = _hasBuffer ? (s2) => Buffer.from(s2, "utf8").toString("base64") : _TE ? (s2) => _fromUint8Array(_TE.encode(s2)) : (s2) => _btoa(utob(s2)); +const encode$5 = (src2, urlsafe = false) => urlsafe ? _mkUriSafe(_encode$1(src2)) : _encode$1(src2); +const encodeURI$1 = (src2) => encode$5(src2, true); +const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g; +const cb_btou = (cccc) => { + switch (cccc.length) { + case 4: + var cp = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset2 = cp - 65536; + return _fromCC((offset2 >>> 10) + 55296) + _fromCC((offset2 & 1023) + 56320); + case 3: + return _fromCC((15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2)); + default: + return _fromCC((31 & cccc.charCodeAt(0)) << 6 | 63 & cccc.charCodeAt(1)); + } +}; +const btou = (b2) => b2.replace(re_btou, cb_btou); +const atobPolyfill = (asc) => { + asc = asc.replace(/\s+/g, ""); + if (!b64re.test(asc)) + throw new TypeError("malformed base64."); + asc += "==".slice(2 - (asc.length & 3)); + let u24, bin = "", r1, r2; + for (let i2 = 0; i2 < asc.length; ) { + u24 = b64tab[asc.charAt(i2++)] << 18 | b64tab[asc.charAt(i2++)] << 12 | (r1 = b64tab[asc.charAt(i2++)]) << 6 | (r2 = b64tab[asc.charAt(i2++)]); + bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255); + } + return bin; +}; +const _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill; +const _toUint8Array = _hasBuffer ? (a3) => _U8Afrom(Buffer.from(a3, "base64")) : (a3) => _U8Afrom(_atob(a3).split("").map((c2) => c2.charCodeAt(0))); +const _decode$1 = _hasBuffer ? (a3) => Buffer.from(a3, "base64").toString("utf8") : _TD ? (a3) => _TD.decode(_toUint8Array(a3)) : (a3) => btou(_atob(a3)); +const _unURI = (a3) => _tidyB64(a3.replace(/[-_]/g, (m02) => m02 == "-" ? "+" : "/")); +const decode$4 = (src2) => _decode$1(_unURI(src2)); +function e$3(e18, r2) { + if (r2 == null || r2 > e18.length) + r2 = e18.length; + for (var t2 = 0, n5 = new Array(r2); t2 < r2; t2++) + n5[t2] = e18[t2]; + return n5; } -utils$t.toHex32 = toHex32; -function zero2(word) { - if (word.length === 1) - return "0" + word; - else - return word; +function r$6(r2) { + if (Array.isArray(r2)) + return e$3(r2); } -utils$t.zero2 = zero2; -function zero8(word) { - if (word.length === 7) - return "0" + word; - else if (word.length === 6) - return "00" + word; - else if (word.length === 5) - return "000" + word; - else if (word.length === 4) - return "0000" + word; - else if (word.length === 3) - return "00000" + word; - else if (word.length === 2) - return "000000" + word; - else if (word.length === 1) - return "0000000" + word; - else - return word; +function t$3(e18) { + if (e18 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return e18; } -utils$t.zero8 = zero8; -function join32(msg, start, end, endian) { - var len = end - start; - assert$h(len % 4 === 0); - var res = new Array(len / 4); - for (var i3 = 0, k2 = start; i3 < res.length; i3++, k2 += 4) { - var w2; - if (endian === "big") - w2 = msg[k2] << 24 | msg[k2 + 1] << 16 | msg[k2 + 2] << 8 | msg[k2 + 3]; - else - w2 = msg[k2 + 3] << 24 | msg[k2 + 2] << 16 | msg[k2 + 1] << 8 | msg[k2]; - res[i3] = w2 >>> 0; +function n$8(e18, r2) { + if (!(e18 instanceof r2)) { + throw new TypeError("Cannot call a class as a function"); } - return res; } -utils$t.join32 = join32; -function split32(msg, endian) { - var res = new Array(msg.length * 4); - for (var i3 = 0, k2 = 0; i3 < msg.length; i3++, k2 += 4) { - var m3 = msg[i3]; - if (endian === "big") { - res[k2] = m3 >>> 24; - res[k2 + 1] = m3 >>> 16 & 255; - res[k2 + 2] = m3 >>> 8 & 255; - res[k2 + 3] = m3 & 255; - } else { - res[k2 + 3] = m3 >>> 24; - res[k2 + 2] = m3 >>> 16 & 255; - res[k2 + 1] = m3 >>> 8 & 255; - res[k2] = m3 & 255; - } +function o$2(e18, r2, t2) { + if (O$4()) { + o$2 = Reflect.construct; + } else { + o$2 = function e19(e19, r3, t3) { + var n5 = [null]; + n5.push.apply(n5, r3); + var o2 = Function.bind.apply(e19, n5); + var i2 = new o2(); + if (t3) + m$4(i2, t3.prototype); + return i2; + }; } - return res; + return o$2.apply(null, arguments); } -utils$t.split32 = split32; -function rotr32$1(w2, b2) { - return w2 >>> b2 | w2 << 32 - b2; +function i$6(e18, r2) { + for (var t2 = 0; t2 < r2.length; t2++) { + var n5 = r2[t2]; + n5.enumerable = n5.enumerable || false; + n5.configurable = true; + if ("value" in n5) + n5.writable = true; + Object.defineProperty(e18, n5.key, n5); + } } -utils$t.rotr32 = rotr32$1; -function rotl32$2(w2, b2) { - return w2 << b2 | w2 >>> 32 - b2; +function a$2(e18, r2, t2) { + if (r2) + i$6(e18.prototype, r2); + if (t2) + i$6(e18, t2); + return e18; } -utils$t.rotl32 = rotl32$2; -function sum32$3(a3, b2) { - return a3 + b2 >>> 0; +function s$2(e18, r2, t2) { + if (r2 in e18) { + Object.defineProperty(e18, r2, { value: t2, enumerable: true, configurable: true, writable: true }); + } else { + e18[r2] = t2; + } + return e18; } -utils$t.sum32 = sum32$3; -function sum32_3$1(a3, b2, c2) { - return a3 + b2 + c2 >>> 0; +function u$3(e18) { + u$3 = Object.setPrototypeOf ? Object.getPrototypeOf : function e19(e19) { + return e19.__proto__ || Object.getPrototypeOf(e19); + }; + return u$3(e18); } -utils$t.sum32_3 = sum32_3$1; -function sum32_4$2(a3, b2, c2, d4) { - return a3 + b2 + c2 + d4 >>> 0; +function c$4(e18, r2) { + if (typeof r2 !== "function" && r2 !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + e18.prototype = Object.create(r2 && r2.prototype, { constructor: { value: e18, writable: true, configurable: true } }); + if (r2) + m$4(e18, r2); } -utils$t.sum32_4 = sum32_4$2; -function sum32_5$2(a3, b2, c2, d4, e18) { - return a3 + b2 + c2 + d4 + e18 >>> 0; +function f$5(e18, r2) { + if (r2 != null && typeof Symbol !== "undefined" && r2[Symbol.hasInstance]) { + return !!r2[Symbol.hasInstance](e18); + } else { + return e18 instanceof r2; + } } -utils$t.sum32_5 = sum32_5$2; -function sum64$1(buf, pos, ah2, al2) { - var bh2 = buf[pos]; - var bl2 = buf[pos + 1]; - var lo2 = al2 + bl2 >>> 0; - var hi2 = (lo2 < al2 ? 1 : 0) + ah2 + bh2; - buf[pos] = hi2 >>> 0; - buf[pos + 1] = lo2; +function l$4(e18) { + return Function.toString.call(e18).indexOf("[native code]") !== -1; } -utils$t.sum64 = sum64$1; -function sum64_hi$1(ah2, al2, bh2, bl2) { - var lo2 = al2 + bl2 >>> 0; - var hi2 = (lo2 < al2 ? 1 : 0) + ah2 + bh2; - return hi2 >>> 0; +function p$5(e18) { + if (typeof Symbol !== "undefined" && e18[Symbol.iterator] != null || e18["@@iterator"] != null) + return Array.from(e18); } -utils$t.sum64_hi = sum64_hi$1; -function sum64_lo$1(ah2, al2, bh2, bl2) { - var lo2 = al2 + bl2; - return lo2 >>> 0; +function d$3() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -utils$t.sum64_lo = sum64_lo$1; -function sum64_4_hi$1(ah2, al2, bh2, bl2, ch2, cl2, dh2, dl2) { - var carry = 0; - var lo2 = al2; - lo2 = lo2 + bl2 >>> 0; - carry += lo2 < al2 ? 1 : 0; - lo2 = lo2 + cl2 >>> 0; - carry += lo2 < cl2 ? 1 : 0; - lo2 = lo2 + dl2 >>> 0; - carry += lo2 < dl2 ? 1 : 0; - var hi2 = ah2 + bh2 + ch2 + dh2 + carry; - return hi2 >>> 0; +function v$6(e18) { + for (var r2 = 1; r2 < arguments.length; r2++) { + var t2 = arguments[r2] != null ? arguments[r2] : {}; + var n5 = Object.keys(t2); + if (typeof Object.getOwnPropertySymbols === "function") { + n5 = n5.concat(Object.getOwnPropertySymbols(t2).filter(function(e19) { + return Object.getOwnPropertyDescriptor(t2, e19).enumerable; + })); + } + n5.forEach(function(r3) { + s$2(e18, r3, t2[r3]); + }); + } + return e18; } -utils$t.sum64_4_hi = sum64_4_hi$1; -function sum64_4_lo$1(ah2, al2, bh2, bl2, ch2, cl2, dh2, dl2) { - var lo2 = al2 + bl2 + cl2 + dl2; - return lo2 >>> 0; +function h$5(e18, r2) { + var t2 = Object.keys(e18); + if (Object.getOwnPropertySymbols) { + var n5 = Object.getOwnPropertySymbols(e18); + if (r2) { + n5 = n5.filter(function(r3) { + return Object.getOwnPropertyDescriptor(e18, r3).enumerable; + }); + } + t2.push.apply(t2, n5); + } + return t2; } -utils$t.sum64_4_lo = sum64_4_lo$1; -function sum64_5_hi$1(ah2, al2, bh2, bl2, ch2, cl2, dh2, dl2, eh2, el2) { - var carry = 0; - var lo2 = al2; - lo2 = lo2 + bl2 >>> 0; - carry += lo2 < al2 ? 1 : 0; - lo2 = lo2 + cl2 >>> 0; - carry += lo2 < cl2 ? 1 : 0; - lo2 = lo2 + dl2 >>> 0; - carry += lo2 < dl2 ? 1 : 0; - lo2 = lo2 + el2 >>> 0; - carry += lo2 < el2 ? 1 : 0; - var hi2 = ah2 + bh2 + ch2 + dh2 + eh2 + carry; - return hi2 >>> 0; +function y$4(e18, r2) { + r2 = r2 != null ? r2 : {}; + if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(e18, Object.getOwnPropertyDescriptors(r2)); + } else { + h$5(Object(r2)).forEach(function(t2) { + Object.defineProperty(e18, t2, Object.getOwnPropertyDescriptor(r2, t2)); + }); + } + return e18; } -utils$t.sum64_5_hi = sum64_5_hi$1; -function sum64_5_lo$1(ah2, al2, bh2, bl2, ch2, cl2, dh2, dl2, eh2, el2) { - var lo2 = al2 + bl2 + cl2 + dl2 + el2; - return lo2 >>> 0; +function g$3(e18, r2) { + if (r2 && (w$5(r2) === "object" || typeof r2 === "function")) { + return r2; + } + return t$3(e18); } -utils$t.sum64_5_lo = sum64_5_lo$1; -function rotr64_hi$1(ah2, al2, num) { - var r2 = al2 << 32 - num | ah2 >>> num; - return r2 >>> 0; +function m$4(e18, r2) { + m$4 = Object.setPrototypeOf || function e19(e19, r3) { + e19.__proto__ = r3; + return e19; + }; + return m$4(e18, r2); } -utils$t.rotr64_hi = rotr64_hi$1; -function rotr64_lo$1(ah2, al2, num) { - var r2 = ah2 << 32 - num | al2 >>> num; - return r2 >>> 0; +function b$3(e18) { + return r$6(e18) || p$5(e18) || R$2(e18) || d$3(); } -utils$t.rotr64_lo = rotr64_lo$1; -function shr64_hi$1(ah2, al2, num) { - return ah2 >>> num; +function w$5(e18) { + "@swc/helpers - typeof"; + return e18 && typeof Symbol !== "undefined" && e18.constructor === Symbol ? "symbol" : typeof e18; } -utils$t.shr64_hi = shr64_hi$1; -function shr64_lo$1(ah2, al2, num) { - var r2 = ah2 << 32 - num | al2 >>> num; - return r2 >>> 0; +function R$2(r2, t2) { + if (!r2) + return; + if (typeof r2 === "string") + return e$3(r2, t2); + var n5 = Object.prototype.toString.call(r2).slice(8, -1); + if (n5 === "Object" && r2.constructor) + n5 = r2.constructor.name; + if (n5 === "Map" || n5 === "Set") + return Array.from(n5); + if (n5 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n5)) + return e$3(r2, t2); } -utils$t.shr64_lo = shr64_lo$1; -var common$5 = {}; -var utils$s = utils$t; -var assert$g = minimalisticAssert; -function BlockHash$4() { - 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; +function E$3(e18) { + var r2 = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0; + E$3 = function e19(e19) { + if (e19 === null || !l$4(e19)) + return e19; + if (typeof e19 !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof r2 !== "undefined") { + if (r2.has(e19)) + return r2.get(e19); + r2.set(e19, t2); + } + function t2() { + return o$2(e19, arguments, u$3(this).constructor); + } + t2.prototype = Object.create(e19.prototype, { constructor: { value: t2, enumerable: false, writable: true, configurable: true } }); + return m$4(t2, e19); + }; + return E$3(e18); } -common$5.BlockHash = BlockHash$4; -BlockHash$4.prototype.update = function update(msg, enc) { - msg = utils$s.toArray(msg, enc); - if (!this.pending) - this.pending = msg; - else - this.pending = this.pending.concat(msg); - this.pendingTotal += msg.length; - if (this.pending.length >= this._delta8) { - msg = this.pending; - var r2 = msg.length % this._delta8; - this.pending = msg.slice(msg.length - r2, msg.length); - if (this.pending.length === 0) - this.pending = null; - msg = utils$s.join32(msg, 0, msg.length - r2, this.endian); - for (var i3 = 0; i3 < msg.length; i3 += this._delta32) - this._update(msg, i3, i3 + this._delta32); +function O$4() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e18) { + return false; } - return this; -}; -BlockHash$4.prototype.digest = function digest(enc) { - this.update(this._pad()); - assert$g(this.pending === null); - return this._digest(enc); +} +function _$3(e18) { + var r2 = O$4(); + return function t2() { + var t3 = u$3(e18), n5; + if (r2) { + var o2 = u$3(this).constructor; + n5 = Reflect.construct(t3, arguments, o2); + } else { + n5 = t3.apply(this, arguments); + } + return g$3(this, n5); + }; +} +var A$2 = Object.defineProperty; +var S$4 = function(e18, r2, t2) { + return r2 in e18 ? A$2(e18, r2, { enumerable: true, configurable: true, writable: true, value: t2 }) : e18[r2] = t2; }; -BlockHash$4.prototype._pad = function pad2() { - var len = this.pendingTotal; - var bytes2 = this._delta8; - var k2 = bytes2 - (len + this.padLength) % bytes2; - var res = new Array(k2 + this.padLength); - res[0] = 128; - for (var i3 = 1; i3 < k2; i3++) - res[i3] = 0; - len <<= 3; - if (this.endian === "big") { - for (var t2 = 8; t2 < this.padLength; t2++) - res[i3++] = 0; - res[i3++] = 0; - res[i3++] = 0; - res[i3++] = 0; - res[i3++] = 0; - res[i3++] = len >>> 24 & 255; - res[i3++] = len >>> 16 & 255; - res[i3++] = len >>> 8 & 255; - res[i3++] = len & 255; - } else { - res[i3++] = len & 255; - res[i3++] = len >>> 8 & 255; - res[i3++] = len >>> 16 & 255; - res[i3++] = len >>> 24 & 255; - res[i3++] = 0; - res[i3++] = 0; - res[i3++] = 0; - res[i3++] = 0; - for (t2 = 8; t2 < this.padLength; t2++) - res[i3++] = 0; - } - return res; +var x$4 = function(e18, r2, t2) { + return S$4(e18, (typeof r2 === "undefined" ? "undefined" : w$5(r2)) != "symbol" ? r2 + "" : r2, t2), t2; }; -var sha = {}; -var common$4 = {}; -var utils$r = utils$t; -var rotr32 = utils$r.rotr32; -function ft_1$1(s2, x3, y3, z3) { - if (s2 === 0) - return ch32$1(x3, y3, z3); - if (s2 === 1 || s2 === 3) - return p32(x3, y3, z3); - if (s2 === 2) - return maj32$1(x3, y3, z3); +var N$2; +var I$2 = "PARSE_ERROR", P$2 = "INVALID_REQUEST", T$3 = "METHOD_NOT_FOUND", C$3 = "INVALID_PARAMS", j$5 = "INTERNAL_ERROR", D$2 = "SERVER_ERROR", U$1 = [-32700, -32600, -32601, -32602, -32603], M$2 = (N$2 = {}, s$2(N$2, I$2, { code: -32700, message: "Parse error" }), s$2(N$2, P$2, { code: -32600, message: "Invalid Request" }), s$2(N$2, T$3, { code: -32601, message: "Method not found" }), s$2(N$2, C$3, { code: -32602, message: "Invalid params" }), s$2(N$2, j$5, { code: -32603, message: "Internal error" }), s$2(N$2, D$2, { code: -32e3, message: "Server error" }), N$2), B$1 = D$2; +function J(e18) { + return U$1.includes(e18); } -common$4.ft_1 = ft_1$1; -function ch32$1(x3, y3, z3) { - return x3 & y3 ^ ~x3 & z3; +function H(e18) { + return Object.keys(M$2).includes(e18) ? M$2[e18] : M$2[B$1]; } -common$4.ch32 = ch32$1; -function maj32$1(x3, y3, z3) { - return x3 & y3 ^ x3 & z3 ^ y3 & z3; +function V$2(e18) { + var r2 = Object.values(M$2).find(function(r3) { + return r3.code === e18; + }); + return r2 || M$2[B$1]; } -common$4.maj32 = maj32$1; -function p32(x3, y3, z3) { - return x3 ^ y3 ^ z3; +function z$5(e18, r2, t2) { + return e18.message.includes("getaddrinfo ENOTFOUND") || e18.message.includes("connect ECONNREFUSED") ? new Error("Unavailable ".concat(t2, " RPC url at ").concat(r2)) : e18; } -common$4.p32 = p32; -function s0_256$1(x3) { - return rotr32(x3, 2) ^ rotr32(x3, 13) ^ rotr32(x3, 22); +function W() { + var e18 = Date.now() * Math.pow(10, 3), r2 = Math.floor(Math.random() * Math.pow(10, 3)); + return e18 + r2; } -common$4.s0_256 = s0_256$1; -function s1_256$1(x3) { - return rotr32(x3, 6) ^ rotr32(x3, 11) ^ rotr32(x3, 25); +function q$3() { + return function(e18, r2) { + for (r2 = e18 = ""; e18++ < 36; r2 += e18 * 51 & 52 ? (e18 ^ 15 ? 8 ^ Math.random() * (e18 ^ 20 ? 16 : 4) : 4).toString(16) : "-") + ; + return r2; + }(); } -common$4.s1_256 = s1_256$1; -function g0_256$1(x3) { - return rotr32(x3, 7) ^ rotr32(x3, 18) ^ x3 >>> 3; +function G$1(e18, r2, t2) { + return { id: t2 || W(), jsonrpc: "2.0", method: e18, params: r2 || [] }; } -common$4.g0_256 = g0_256$1; -function g1_256$1(x3) { - return rotr32(x3, 17) ^ rotr32(x3, 19) ^ x3 >>> 10; +function Q$3(e18, r2, t2) { + return { id: e18, jsonrpc: "2.0", error: X(r2, t2) }; } -common$4.g1_256 = g1_256$1; -var utils$q = utils$t; -var common$3 = common$5; -var shaCommon$1 = common$4; -var rotl32$1 = utils$q.rotl32; -var sum32$2 = utils$q.sum32; -var sum32_5$1 = utils$q.sum32_5; -var ft_1 = shaCommon$1.ft_1; -var BlockHash$3 = common$3.BlockHash; -var sha1_K = [ - 1518500249, - 1859775393, - 2400959708, - 3395469782 -]; -function SHA1() { - if (!(this instanceof SHA1)) - return new SHA1(); - BlockHash$3.call(this); - this.h = [ - 1732584193, - 4023233417, - 2562383102, - 271733878, - 3285377520 - ]; - this.W = new Array(80); +function X(e18, r2) { + return (typeof e18 === "undefined" ? "undefined" : w$5(e18)) > "u" ? H(j$5) : (typeof e18 == "string" && (e18 = y$4(v$6({}, H(D$2)), { message: e18 })), (typeof r2 === "undefined" ? "undefined" : w$5(r2)) < "u" && (e18.data = r2), J(e18.code) && (e18 = V$2(e18.code)), e18); } -utils$q.inherits(SHA1, BlockHash$3); -var _1 = SHA1; -SHA1.blockSize = 512; -SHA1.outSize = 160; -SHA1.hmacStrength = 80; -SHA1.padLength = 64; -SHA1.prototype._update = function _update(msg, start) { - var W2 = this.W; - for (var i3 = 0; i3 < 16; i3++) - W2[i3] = msg[start + i3]; - for (; i3 < W2.length; i3++) - W2[i3] = rotl32$1(W2[i3 - 3] ^ W2[i3 - 8] ^ W2[i3 - 14] ^ W2[i3 - 16], 1); - var a3 = this.h[0]; - var b2 = this.h[1]; - var c2 = this.h[2]; - var d4 = this.h[3]; - var e18 = this.h[4]; - for (i3 = 0; i3 < W2.length; i3++) { - var s2 = ~~(i3 / 20); - var t2 = sum32_5$1(rotl32$1(a3, 5), ft_1(s2, b2, c2, d4), e18, W2[i3], sha1_K[s2]); - e18 = d4; - d4 = c2; - c2 = rotl32$1(b2, 30); - b2 = a3; - a3 = t2; +function ee$2(e18) { + return "result" in e18; +} +var et$2 = "^https?:"; +function eo$1(e18) { + var r2 = e18.match(new RegExp(/^\w+:/, "gi")); + if (!(!r2 || !r2.length)) + return r2[0]; +} +function ei$1(e18, r2) { + var t2 = eo$1(e18); + return (typeof t2 === "undefined" ? "undefined" : w$5(t2)) > "u" ? false : new RegExp(r2).test(t2); +} +function ea$2(e18) { + return ei$1(e18, et$2); +} +var ec$1 = { 1: "mainnet", 3: "ropsten", 4: "rinkeby", 5: "goerli", 42: "kovan" }, ef$2 = ["eth_requestAccounts", "eth_accounts", "eth_chainId", "eth_signTransaction", "eth_sendTransaction", "eth_sign", "personal_sign", "eth_signTypedData", "eth_signTypedData_v1", "eth_signTypedData_v2", "eth_signTypedData_v3", "eth_signTypedData_v4", "wallet_switchEthereumChain", "wallet_watchAsset"]; +function el(e18, r2) { + var t2, n5 = ec$1[e18]; + return typeof n5 == "string" && (t2 = "https://".concat(n5, ".infura.io/v3/").concat(r2)), t2; +} +function ep(e18) { + if (typeof e18 != "string") + throw new Error("Cannot safe json parse value of type ".concat(typeof e18 === "undefined" ? "undefined" : w$5(e18))); + try { + return JSON.parse(e18); + } catch (r2) { + return e18; } - this.h[0] = sum32$2(this.h[0], a3); - this.h[1] = sum32$2(this.h[1], b2); - this.h[2] = sum32$2(this.h[2], c2); - this.h[3] = sum32$2(this.h[3], d4); - this.h[4] = sum32$2(this.h[4], e18); -}; -SHA1.prototype._digest = function digest2(enc) { - if (enc === "hex") - return utils$q.toHex32(this.h, "big"); - else - return utils$q.split32(this.h, "big"); -}; -var utils$p = utils$t; -var common$2 = common$5; -var shaCommon = common$4; -var assert$f = minimalisticAssert; -var sum32$1 = utils$p.sum32; -var sum32_4$1 = utils$p.sum32_4; -var sum32_5 = utils$p.sum32_5; -var ch32 = shaCommon.ch32; -var maj32 = shaCommon.maj32; -var s0_256 = shaCommon.s0_256; -var s1_256 = shaCommon.s1_256; -var g0_256 = shaCommon.g0_256; -var g1_256 = shaCommon.g1_256; -var BlockHash$2 = common$2.BlockHash; -var sha256_K = [ - 1116352408, - 1899447441, - 3049323471, - 3921009573, - 961987163, - 1508970993, - 2453635748, - 2870763221, - 3624381080, - 310598401, - 607225278, - 1426881987, - 1925078388, - 2162078206, - 2614888103, - 3248222580, - 3835390401, - 4022224774, - 264347078, - 604807628, - 770255983, - 1249150122, - 1555081692, - 1996064986, - 2554220882, - 2821834349, - 2952996808, - 3210313671, - 3336571891, - 3584528711, - 113926993, - 338241895, - 666307205, - 773529912, - 1294757372, - 1396182291, - 1695183700, - 1986661051, - 2177026350, - 2456956037, - 2730485921, - 2820302411, - 3259730800, - 3345764771, - 3516065817, - 3600352804, - 4094571909, - 275423344, - 430227734, - 506948616, - 659060556, - 883997877, - 958139571, - 1322822218, - 1537002063, - 1747873779, - 1955562222, - 2024104815, - 2227730452, - 2361852424, - 2428436474, - 2756734187, - 3204031479, - 3329325298 -]; -function SHA256$4() { - if (!(this instanceof SHA256$4)) - return new SHA256$4(); - BlockHash$2.call(this); - this.h = [ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 - ]; - this.k = sha256_K; - this.W = new Array(64); } -utils$p.inherits(SHA256$4, BlockHash$2); -var _256 = SHA256$4; -SHA256$4.blockSize = 512; -SHA256$4.outSize = 256; -SHA256$4.hmacStrength = 192; -SHA256$4.padLength = 64; -SHA256$4.prototype._update = function _update2(msg, start) { - var W2 = this.W; - for (var i3 = 0; i3 < 16; i3++) - W2[i3] = msg[start + i3]; - for (; i3 < W2.length; i3++) - W2[i3] = sum32_4$1(g1_256(W2[i3 - 2]), W2[i3 - 7], g0_256(W2[i3 - 15]), W2[i3 - 16]); - var a3 = this.h[0]; - var b2 = this.h[1]; - var c2 = this.h[2]; - var d4 = this.h[3]; - var e18 = this.h[4]; - var f3 = this.h[5]; - var g3 = this.h[6]; - var h4 = this.h[7]; - assert$f(this.k.length === W2.length); - for (i3 = 0; i3 < W2.length; i3++) { - var T12 = sum32_5(h4, s1_256(e18), ch32(e18, f3, g3), this.k[i3], W2[i3]); - var T22 = sum32$1(s0_256(a3), maj32(a3, b2, c2)); - h4 = g3; - g3 = f3; - f3 = e18; - e18 = sum32$1(d4, T12); - d4 = c2; - c2 = b2; - b2 = a3; - a3 = sum32$1(T12, T22); - } - this.h[0] = sum32$1(this.h[0], a3); - this.h[1] = sum32$1(this.h[1], b2); - this.h[2] = sum32$1(this.h[2], c2); - this.h[3] = sum32$1(this.h[3], d4); - this.h[4] = sum32$1(this.h[4], e18); - this.h[5] = sum32$1(this.h[5], f3); - this.h[6] = sum32$1(this.h[6], g3); - this.h[7] = sum32$1(this.h[7], h4); -}; -SHA256$4.prototype._digest = function digest3(enc) { - if (enc === "hex") - return utils$p.toHex32(this.h, "big"); - else - return utils$p.split32(this.h, "big"); -}; -var utils$o = utils$t; -var SHA256$3 = _256; -function SHA224() { - if (!(this instanceof SHA224)) - return new SHA224(); - SHA256$3.call(this); - this.h = [ - 3238371032, - 914150663, - 812702999, - 4144912697, - 4290775857, - 1750603025, - 1694076839, - 3204075428 - ]; +function ed(e18) { + return typeof e18 == "string" ? e18 : JSON.stringify(e18); } -utils$o.inherits(SHA224, SHA256$3); -var _224 = SHA224; -SHA224.blockSize = 512; -SHA224.outSize = 224; -SHA224.hmacStrength = 192; -SHA224.padLength = 64; -SHA224.prototype._digest = function digest4(enc) { - if (enc === "hex") - return utils$o.toHex32(this.h.slice(0, 7), "big"); - else - return utils$o.split32(this.h.slice(0, 7), "big"); -}; -var utils$n = utils$t; -var common$1 = common$5; -var assert$e = minimalisticAssert; -var rotr64_hi = utils$n.rotr64_hi; -var rotr64_lo = utils$n.rotr64_lo; -var shr64_hi = utils$n.shr64_hi; -var shr64_lo = utils$n.shr64_lo; -var sum64 = utils$n.sum64; -var sum64_hi = utils$n.sum64_hi; -var sum64_lo = utils$n.sum64_lo; -var sum64_4_hi = utils$n.sum64_4_hi; -var sum64_4_lo = utils$n.sum64_4_lo; -var sum64_5_hi = utils$n.sum64_5_hi; -var sum64_5_lo = utils$n.sum64_5_lo; -var BlockHash$1 = common$1.BlockHash; -var sha512_K = [ - 1116352408, - 3609767458, - 1899447441, - 602891725, - 3049323471, - 3964484399, - 3921009573, - 2173295548, - 961987163, - 4081628472, - 1508970993, - 3053834265, - 2453635748, - 2937671579, - 2870763221, - 3664609560, - 3624381080, - 2734883394, - 310598401, - 1164996542, - 607225278, - 1323610764, - 1426881987, - 3590304994, - 1925078388, - 4068182383, - 2162078206, - 991336113, - 2614888103, - 633803317, - 3248222580, - 3479774868, - 3835390401, - 2666613458, - 4022224774, - 944711139, - 264347078, - 2341262773, - 604807628, - 2007800933, - 770255983, - 1495990901, - 1249150122, - 1856431235, - 1555081692, - 3175218132, - 1996064986, - 2198950837, - 2554220882, - 3999719339, - 2821834349, - 766784016, - 2952996808, - 2566594879, - 3210313671, - 3203337956, - 3336571891, - 1034457026, - 3584528711, - 2466948901, - 113926993, - 3758326383, - 338241895, - 168717936, - 666307205, - 1188179964, - 773529912, - 1546045734, - 1294757372, - 1522805485, - 1396182291, - 2643833823, - 1695183700, - 2343527390, - 1986661051, - 1014477480, - 2177026350, - 1206759142, - 2456956037, - 344077627, - 2730485921, - 1290863460, - 2820302411, - 3158454273, - 3259730800, - 3505952657, - 3345764771, - 106217008, - 3516065817, - 3606008344, - 3600352804, - 1432725776, - 4094571909, - 1467031594, - 275423344, - 851169720, - 430227734, - 3100823752, - 506948616, - 1363258195, - 659060556, - 3750685593, - 883997877, - 3785050280, - 958139571, - 3318307427, - 1322822218, - 3812723403, - 1537002063, - 2003034995, - 1747873779, - 3602036899, - 1955562222, - 1575990012, - 2024104815, - 1125592928, - 2227730452, - 2716904306, - 2361852424, - 442776044, - 2428436474, - 593698344, - 2756734187, - 3733110249, - 3204031479, - 2999351573, - 3329325298, - 3815920427, - 3391569614, - 3928383900, - 3515267271, - 566280711, - 3940187606, - 3454069534, - 4118630271, - 4000239992, - 116418474, - 1914138554, - 174292421, - 2731055270, - 289380356, - 3203993006, - 460393269, - 320620315, - 685471733, - 587496836, - 852142971, - 1086792851, - 1017036298, - 365543100, - 1126000580, - 2618297676, - 1288033470, - 3409855158, - 1501505948, - 4234509866, - 1607167915, - 987167468, - 1816402316, - 1246189591 -]; -function SHA512$3() { - if (!(this instanceof SHA512$3)) - return new SHA512$3(); - BlockHash$1.call(this); - this.h = [ - 1779033703, - 4089235720, - 3144134277, - 2227873595, - 1013904242, - 4271175723, - 2773480762, - 1595750129, - 1359893119, - 2917565137, - 2600822924, - 725511199, - 528734635, - 4215389547, - 1541459225, - 327033209 - ]; - this.k = sha512_K; - this.W = new Array(160); +function ev$1(e18, r2) { + var t2, n5 = el(e18, r2.infuraId); + return r2.custom && r2.custom[e18] ? t2 = r2.custom[e18] : n5 && (t2 = n5), t2; } -utils$n.inherits(SHA512$3, BlockHash$1); -var _512 = SHA512$3; -SHA512$3.blockSize = 1024; -SHA512$3.outSize = 512; -SHA512$3.hmacStrength = 192; -SHA512$3.padLength = 128; -SHA512$3.prototype._prepareBlock = function _prepareBlock(msg, start) { - var W2 = this.W; - for (var i3 = 0; i3 < 32; i3++) - W2[i3] = msg[start + i3]; - for (; i3 < W2.length; i3 += 2) { - var c0_hi = g1_512_hi(W2[i3 - 4], W2[i3 - 3]); - var c0_lo = g1_512_lo(W2[i3 - 4], W2[i3 - 3]); - var c1_hi = W2[i3 - 14]; - var c1_lo = W2[i3 - 13]; - var c2_hi = g0_512_hi(W2[i3 - 30], W2[i3 - 29]); - var c2_lo = g0_512_lo(W2[i3 - 30], W2[i3 - 29]); - var c3_hi = W2[i3 - 32]; - var c3_lo = W2[i3 - 31]; - W2[i3] = sum64_4_hi( - c0_hi, - c0_lo, - c1_hi, - c1_lo, - c2_hi, - c2_lo, - c3_hi, - c3_lo - ); - W2[i3 + 1] = sum64_4_lo( - c0_hi, - c0_lo, - c1_hi, - c1_lo, - c2_hi, - c2_lo, - c3_hi, - c3_lo - ); - } -}; -SHA512$3.prototype._update = function _update3(msg, start) { - this._prepareBlock(msg, start); - var W2 = this.W; - var ah2 = this.h[0]; - var al2 = this.h[1]; - var bh2 = this.h[2]; - var bl2 = this.h[3]; - var ch2 = this.h[4]; - var cl2 = this.h[5]; - var dh2 = this.h[6]; - var dl2 = this.h[7]; - var eh2 = this.h[8]; - var el2 = this.h[9]; - var fh2 = this.h[10]; - var fl2 = this.h[11]; - var gh2 = this.h[12]; - var gl2 = this.h[13]; - var hh2 = this.h[14]; - var hl2 = this.h[15]; - assert$e(this.k.length === W2.length); - for (var i3 = 0; i3 < W2.length; i3 += 2) { - var c0_hi = hh2; - var c0_lo = hl2; - var c1_hi = s1_512_hi(eh2, el2); - var c1_lo = s1_512_lo(eh2, el2); - var c2_hi = ch64_hi(eh2, el2, fh2, fl2, gh2); - var c2_lo = ch64_lo(eh2, el2, fh2, fl2, gh2, gl2); - var c3_hi = this.k[i3]; - var c3_lo = this.k[i3 + 1]; - var c4_hi = W2[i3]; - var c4_lo = W2[i3 + 1]; - var T1_hi = sum64_5_hi( - c0_hi, - c0_lo, - c1_hi, - c1_lo, - c2_hi, - c2_lo, - c3_hi, - c3_lo, - c4_hi, - c4_lo - ); - var T1_lo = sum64_5_lo( - c0_hi, - c0_lo, - c1_hi, - c1_lo, - c2_hi, - c2_lo, - c3_hi, - c3_lo, - c4_hi, - c4_lo - ); - c0_hi = s0_512_hi(ah2, al2); - c0_lo = s0_512_lo(ah2, al2); - c1_hi = maj64_hi(ah2, al2, bh2, bl2, ch2); - c1_lo = maj64_lo(ah2, al2, bh2, bl2, ch2, cl2); - var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); - var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); - hh2 = gh2; - hl2 = gl2; - gh2 = fh2; - gl2 = fl2; - fh2 = eh2; - fl2 = el2; - eh2 = sum64_hi(dh2, dl2, T1_hi, T1_lo); - el2 = sum64_lo(dl2, dl2, T1_hi, T1_lo); - dh2 = ch2; - dl2 = cl2; - ch2 = bh2; - cl2 = bl2; - bh2 = ah2; - bl2 = al2; - ah2 = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); - al2 = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); - } - sum64(this.h, 0, ah2, al2); - sum64(this.h, 2, bh2, bl2); - sum64(this.h, 4, ch2, cl2); - sum64(this.h, 6, dh2, dl2); - sum64(this.h, 8, eh2, el2); - sum64(this.h, 10, fh2, fl2); - sum64(this.h, 12, gh2, gl2); - sum64(this.h, 14, hh2, hl2); -}; -SHA512$3.prototype._digest = function digest5(enc) { - if (enc === "hex") - return utils$n.toHex32(this.h, "big"); - else - return utils$n.split32(this.h, "big"); -}; -function ch64_hi(xh2, xl, yh2, yl, zh2) { - var r2 = xh2 & yh2 ^ ~xh2 & zh2; - if (r2 < 0) - r2 += 4294967296; - return r2; +function eh() { + return (typeof process === "undefined" ? "undefined" : w$5(process)) < "u" && w$5(process.versions) < "u" && w$5(process.versions.node) < "u"; } -function ch64_lo(xh2, xl, yh2, yl, zh2, zl) { - var r2 = xl & yl ^ ~xl & zl; - if (r2 < 0) - r2 += 4294967296; - return r2; +function ey(e18) { + return typeof e18 == "string" ? Number.parseInt(e18, e18.trim().substring(0, 2) === "0x" ? 16 : 10) : (typeof e18 === "undefined" ? "undefined" : w$5(e18)) == "bigint" ? Number(e18) : e18; } -function maj64_hi(xh2, xl, yh2, yl, zh2) { - var r2 = xh2 & yh2 ^ xh2 & zh2 ^ yh2 & zh2; - if (r2 < 0) - r2 += 4294967296; - return r2; +var eg = "hex", em = "utf8"; +function eb(e18) { + return e18.replace(/^0x/, ""); } -function maj64_lo(xh2, xl, yh2, yl, zh2, zl) { - var r2 = xl & yl ^ xl & zl ^ yl & zl; - if (r2 < 0) - r2 += 4294967296; - return r2; +function ew(e18) { + return eE(Buffer.from(eb(e18), eg)); } -function s0_512_hi(xh2, xl) { - var c0_hi = rotr64_hi(xh2, xl, 28); - var c1_hi = rotr64_hi(xl, xh2, 2); - var c2_hi = rotr64_hi(xl, xh2, 7); - var r2 = c0_hi ^ c1_hi ^ c2_hi; - if (r2 < 0) - r2 += 4294967296; - return r2; +function eR(e18) { + var r2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + return eO(eA(e18), r2); } -function s0_512_lo(xh2, xl) { - var c0_lo = rotr64_lo(xh2, xl, 28); - var c1_lo = rotr64_lo(xl, xh2, 2); - var c2_lo = rotr64_lo(xl, xh2, 7); - var r2 = c0_lo ^ c1_lo ^ c2_lo; - if (r2 < 0) - r2 += 4294967296; - return r2; +function eE(e18) { + return new Uint8Array(e18); } -function s1_512_hi(xh2, xl) { - var c0_hi = rotr64_hi(xh2, xl, 14); - var c1_hi = rotr64_hi(xh2, xl, 18); - var c2_hi = rotr64_hi(xl, xh2, 9); - var r2 = c0_hi ^ c1_hi ^ c2_hi; - if (r2 < 0) - r2 += 4294967296; - return r2; +function eO(e18) { + var r2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var t2 = e18.toString(eg); + return r2 ? eS(t2) : t2; } -function s1_512_lo(xh2, xl) { - var c0_lo = rotr64_lo(xh2, xl, 14); - var c1_lo = rotr64_lo(xh2, xl, 18); - var c2_lo = rotr64_lo(xl, xh2, 9); - var r2 = c0_lo ^ c1_lo ^ c2_lo; - if (r2 < 0) - r2 += 4294967296; - return r2; +function e_(e18) { + return ArrayBuffer.isView(e18) ? Buffer.from(e18.buffer, e18.byteOffset, e18.byteLength) : Buffer.from(e18); } -function g0_512_hi(xh2, xl) { - var c0_hi = rotr64_hi(xh2, xl, 1); - var c1_hi = rotr64_hi(xh2, xl, 8); - var c2_hi = shr64_hi(xh2, xl, 7); - var r2 = c0_hi ^ c1_hi ^ c2_hi; - if (r2 < 0) - r2 += 4294967296; - return r2; +function eA(e18) { + return e_(e18); } -function g0_512_lo(xh2, xl) { - var c0_lo = rotr64_lo(xh2, xl, 1); - var c1_lo = rotr64_lo(xh2, xl, 8); - var c2_lo = shr64_lo(xh2, xl, 7); - var r2 = c0_lo ^ c1_lo ^ c2_lo; - if (r2 < 0) - r2 += 4294967296; - return r2; +function eS(e18) { + return e18.startsWith("0x") ? e18 : "0x".concat(e18); } -function g1_512_hi(xh2, xl) { - var c0_hi = rotr64_hi(xh2, xl, 19); - var c1_hi = rotr64_hi(xl, xh2, 29); - var c2_hi = shr64_hi(xh2, xl, 6); - var r2 = c0_hi ^ c1_hi ^ c2_hi; - if (r2 < 0) - r2 += 4294967296; - return r2; +function ex() { + for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { + r2[t2] = arguments[t2]; + } + var n5 = []; + return r2.forEach(function(e19) { + return n5 = n5.concat(Array.from(e19)); + }), new Uint8Array(b$3(n5)); } -function g1_512_lo(xh2, xl) { - var c0_lo = rotr64_lo(xh2, xl, 19); - var c1_lo = rotr64_lo(xl, xh2, 29); - var c2_lo = shr64_lo(xh2, xl, 6); - var r2 = c0_lo ^ c1_lo ^ c2_lo; - if (r2 < 0) - r2 += 4294967296; - return r2; +function eN(e18) { + return eE(Buffer.from(e18, em)); } -var utils$m = utils$t; -var SHA512$2 = _512; -function SHA384() { - if (!(this instanceof SHA384)) - return new SHA384(); - SHA512$2.call(this); - this.h = [ - 3418070365, - 3238371032, - 1654270250, - 914150663, - 2438529370, - 812702999, - 355462360, - 4144912697, - 1731405415, - 4290775857, - 2394180231, - 1750603025, - 3675008525, - 1694076839, - 1203062813, - 3204075428 - ]; +function eI(e18) { + return Buffer.from(e18, em); } -utils$m.inherits(SHA384, SHA512$2); -var _384 = SHA384; -SHA384.blockSize = 1024; -SHA384.outSize = 384; -SHA384.hmacStrength = 192; -SHA384.padLength = 128; -SHA384.prototype._digest = function digest6(enc) { - if (enc === "hex") - return utils$m.toHex32(this.h.slice(0, 12), "big"); - else - return utils$m.split32(this.h.slice(0, 12), "big"); +function eP(e18) { + return e18.toString(em); +} +function eT(e18) { + return eP(eA(e18)); +} +function eC(e18) { + var r2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + return eO(eI(e18), r2); +} +function ej(e18) { + return ew(e18).buffer; +} +function eD(e18, r2) { + return eR(new Uint8Array(e18), !r2); +} +function eU(e18) { + return eE(e18).buffer; +} +function ek(e18) { + return eA(new Uint8Array(e18)); +} +function eM(e18) { + var r2 = "0x0"; + return typeof e18 == "number" && (r2 = "0x".concat(e18.toString(16))), typeof e18 == "string" && (e18.startsWith("0x") ? r2 = e18 : r2 = "0x0"), r2; +} +var eL = { 16: 10, 24: 12, 32: 14 }, eJ = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145], eK = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22], eH = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125], eV = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986], eF = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766], ez = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126], eW = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436], eq = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890], eG = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935], eZ = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600], eQ = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480], eX = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795], eY = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855], e$ = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150], e1 = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925]; +function e2(e18) { + return parseInt("".concat(e18)) === e18; +} +function e3(e18) { + if (!e2(e18.length)) + return false; + for (var r2 = 0; r2 < e18.length; r2++) + if (!e2(e18[r2]) || e18[r2] < 0 || e18[r2] > 255) + return false; + return true; +} +function e4(e18) { + return new Uint8Array(e18); +} +function e0$1(e18) { + var r2 = []; + for (var t2 = 0; t2 < e18.length; t2 += 4) + r2.push(e18[t2] << 24 | e18[t2 + 1] << 16 | e18[t2 + 2] << 8 | e18[t2 + 3]); + return r2; +} +function e5(e18, r2) { + if (e18.buffer && e18.name === "Uint8Array") + return r2 && (e18.slice ? e18 = e18.slice() : e18 = Array.prototype.slice.call(e18)), e18; + if (Array.isArray(e18)) { + if (!e3(e18)) + throw new Error("Array contains invalid value"); + return new Uint8Array(e18); + } + if (e2(e18.length) && e3(e18)) + return new Uint8Array(e18); + throw new Error("unsupported array-like object"); +} +function e7(e18, r2, t2, n5, o2) { + (n5 != null || o2 != null) && (e18.slice ? e18 = e18.slice(n5, o2) : e18 = Array.prototype.slice.call(e18, n5, o2)), r2.set(e18, t2); +} +var e6 = function() { + function e18(r2) { + n$8(this, e18); + x$4(this, "key"); + x$4(this, "_Ke"); + x$4(this, "_Kd"); + this.key = e5(r2, true), this._prepare(); + } + a$2(e18, [{ key: "_prepare", value: function e19() { + var e20 = eL[this.key.length]; + if (e20 == null) + throw new Error("invalid key size (must be 16, 24 or 32 bytes)"); + this._Ke = [], this._Kd = []; + for (var r2 = 0; r2 <= e20; r2++) + this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]); + var t2 = (e20 + 1) * 4, n5 = this.key.length / 4, o2 = e0$1(this.key), i2; + for (var a3 = 0; a3 < n5; a3++) + i2 = a3 >> 2, this._Ke[i2][a3 % 4] = o2[a3], this._Kd[e20 - i2][a3 % 4] = o2[a3]; + var s2 = 0, u2 = n5, c2; + for (; u2 < t2; ) { + if (c2 = o2[n5 - 1], o2[0] ^= eK[c2 >> 16 & 255] << 24 ^ eK[c2 >> 8 & 255] << 16 ^ eK[c2 & 255] << 8 ^ eK[c2 >> 24 & 255] ^ eJ[s2] << 24, s2 += 1, n5 != 8) + for (var f4 = 1; f4 < n5; f4++) + o2[f4] ^= o2[f4 - 1]; + else { + for (var l2 = 1; l2 < n5 / 2; l2++) + o2[l2] ^= o2[l2 - 1]; + c2 = o2[n5 / 2 - 1], o2[n5 / 2] ^= eK[c2 & 255] ^ eK[c2 >> 8 & 255] << 8 ^ eK[c2 >> 16 & 255] << 16 ^ eK[c2 >> 24 & 255] << 24; + for (var p3 = n5 / 2 + 1; p3 < n5; p3++) + o2[p3] ^= o2[p3 - 1]; + } + var d4 = 0, v6 = void 0, h4 = void 0; + for (; d4 < n5 && u2 < t2; ) + v6 = u2 >> 2, h4 = u2 % 4, this._Ke[v6][h4] = o2[d4], this._Kd[e20 - v6][h4] = o2[d4++], u2++; + } + for (var y3 = 1; y3 < e20; y3++) + for (var g3 = 0; g3 < 4; g3++) + c2 = this._Kd[y3][g3], this._Kd[y3][g3] = eX[c2 >> 24 & 255] ^ eY[c2 >> 16 & 255] ^ e$[c2 >> 8 & 255] ^ e1[c2 & 255]; + } }, { key: "encrypt", value: function e19(e19) { + if (e19.length != 16) + throw new Error("invalid plaintext size (must be 16 bytes)"); + var r2 = this._Ke.length - 1, t2 = [0, 0, 0, 0], n5 = e0$1(e19); + for (var o2 = 0; o2 < 4; o2++) + n5[o2] ^= this._Ke[0][o2]; + for (var i2 = 1; i2 < r2; i2++) { + for (var a3 = 0; a3 < 4; a3++) + t2[a3] = eV[n5[a3] >> 24 & 255] ^ eF[n5[(a3 + 1) % 4] >> 16 & 255] ^ ez[n5[(a3 + 2) % 4] >> 8 & 255] ^ eW[n5[(a3 + 3) % 4] & 255] ^ this._Ke[i2][a3]; + n5 = t2.slice(); + } + var s2 = e4(16), u2; + for (var c2 = 0; c2 < 4; c2++) + u2 = this._Ke[r2][c2], s2[4 * c2] = (eK[n5[c2] >> 24 & 255] ^ u2 >> 24) & 255, s2[4 * c2 + 1] = (eK[n5[(c2 + 1) % 4] >> 16 & 255] ^ u2 >> 16) & 255, s2[4 * c2 + 2] = (eK[n5[(c2 + 2) % 4] >> 8 & 255] ^ u2 >> 8) & 255, s2[4 * c2 + 3] = (eK[n5[(c2 + 3) % 4] & 255] ^ u2) & 255; + return s2; + } }, { key: "decrypt", value: function e19(e19) { + if (e19.length != 16) + throw new Error("invalid ciphertext size (must be 16 bytes)"); + var r2 = this._Kd.length - 1, t2 = [0, 0, 0, 0], n5 = e0$1(e19); + for (var o2 = 0; o2 < 4; o2++) + n5[o2] ^= this._Kd[0][o2]; + for (var i2 = 1; i2 < r2; i2++) { + for (var a3 = 0; a3 < 4; a3++) + t2[a3] = eq[n5[a3] >> 24 & 255] ^ eG[n5[(a3 + 3) % 4] >> 16 & 255] ^ eZ[n5[(a3 + 2) % 4] >> 8 & 255] ^ eQ[n5[(a3 + 1) % 4] & 255] ^ this._Kd[i2][a3]; + n5 = t2.slice(); + } + var s2 = e4(16), u2; + for (var c2 = 0; c2 < 4; c2++) + u2 = this._Kd[r2][c2], s2[4 * c2] = (eH[n5[c2] >> 24 & 255] ^ u2 >> 24) & 255, s2[4 * c2 + 1] = (eH[n5[(c2 + 3) % 4] >> 16 & 255] ^ u2 >> 16) & 255, s2[4 * c2 + 2] = (eH[n5[(c2 + 2) % 4] >> 8 & 255] ^ u2 >> 8) & 255, s2[4 * c2 + 3] = (eH[n5[(c2 + 1) % 4] & 255] ^ u2) & 255; + return s2; + } }]); + return e18; +}(), e8 = function() { + function e18(r2, t2) { + n$8(this, e18); + x$4(this, "_aes"); + x$4(this, "_lastCipherblock"); + if (!t2) + t2 = new Uint8Array(16); + else if (t2.length != 16) + throw new Error("invalid initialation vector size (must be 16 bytes)"); + this._lastCipherblock = e5(t2, true), this._aes = new e6(r2); + } + a$2(e18, [{ key: "encrypt", value: function e19(e19) { + if (e19 = e5(e19), e19.length % 16 !== 0) + throw new Error("invalid plaintext size (must be multiple of 16 bytes)"); + var r2 = e4(e19.length), t2 = e4(16); + for (var n5 = 0; n5 < e19.length; n5 += 16) { + e7(e19, t2, 0, n5, n5 + 16); + for (var o2 = 0; o2 < 16; o2++) + t2[o2] ^= this._lastCipherblock[o2]; + this._lastCipherblock = this._aes.encrypt(t2), e7(this._lastCipherblock, r2, n5); + } + return r2; + } }, { key: "decrypt", value: function e19(e19) { + if (e19 = e5(e19), e19.length % 16 !== 0) + throw new Error("invalid ciphertext size (must be multiple of 16 bytes)"); + var r2 = e4(e19.length), t2 = e4(16); + for (var n5 = 0; n5 < e19.length; n5 += 16) { + e7(e19, t2, 0, n5, n5 + 16), t2 = this._aes.decrypt(t2); + for (var o2 = 0; o2 < 16; o2++) + r2[n5 + o2] = t2[o2] ^ this._lastCipherblock[o2]; + e7(e19, this._lastCipherblock, 0, n5, n5 + 16); + } + return r2; + } }]); + return e18; +}(); +var e9 = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]], re$2 = { pad: function e(e) { + var r2 = e9[e.byteLength % 16 || 0], t2 = new Uint8Array(e.byteLength + r2.length); + return t2.set(e), t2.set(r2, e.byteLength), t2; +}, unpad: function e10(e10) { + return e10.subarray(0, e10.byteLength - e10[e10.byteLength - 1]); +} }; +var rr$3 = "sha256"; +function rt$2(e18, r2, t2) { + var n5 = new e8(r2, e18), o2 = re$2.pad(t2), i2 = n5.encrypt(o2); + return new Uint8Array(i2); +} +function rn$2(e18, r2, t2) { + var n5 = new e8(r2, e18).decrypt(t2), o2 = new Uint8Array(n5); + return re$2.unpad(o2); +} +function ro$1(e18, r2) { + var t2 = hash$6.hmac(eB[rr$3], e18).update(r2).digest("hex"); + return ew(t2); +} +function ri$1(e18) { + for (var r2 = new Uint8Array(e18), t2 = 0; t2 < e18; ++t2) + r2[t2] = Math.floor(256 * Math.random()); + return eA(r2); +} +function ra$2(e18) { + var r2 = ri$1(e18); + return eE(r2); +} +function rs(e18) { + var r2 = (e18 || 256) / 8, t2 = ra$2(r2); + return eU(eA(t2)); +} +function ru$1(e18, r2) { + var t2 = ew(e18.data), n5 = ew(e18.iv), o2 = ew(e18.hmac), i2 = eR(o2, false), a3 = ex(t2, n5), s2 = ro$1(r2, a3), u2 = eR(s2, false); + return eb(i2) === eb(u2); +} +function rc(e18, r2, t2) { + var n5 = eE(ek(r2)), o2 = t2 || rs(128), i2 = eE(ek(o2)), a3 = eR(i2, false), s2 = JSON.stringify(e18), u2 = eN(s2), c2 = rt$2(i2, n5, u2), f4 = eR(c2, false), l2 = ex(c2, i2), p3 = ro$1(n5, l2), d4 = eR(p3, false); + return { data: f4, hmac: d4, iv: a3 }; +} +function rf$2(e18, r2) { + var t2 = eE(ek(r2)); + if (!t2) + throw new Error("Missing key: required for decryption"); + if (!ru$1(e18, t2)) + return null; + var n5 = ew(e18.data), o2 = ew(e18.iv), i2 = rn$2(o2, t2, n5), a3 = eT(i2), s2; + try { + s2 = JSON.parse(a3); + } catch (e19) { + return null; + } + return s2; +} +function rl(e18) { + var r2 = null; + try { + var t2 = window.localStorage.getItem(e18); + t2 && (r2 = JSON.parse(t2)); + } catch (e19) { + r2 = null; + } + return r2; +} +function rp(e18) { + try { + window.localStorage.removeItem(e18); + } catch (e19) { + } +} +function rd(e18, r2) { + try { + window.localStorage.setItem(e18, JSON.stringify(r2)); + } catch (e19) { + } +} +var rh = function e11() { + var r2 = this; + n$8(this, e11); + x$4(this, "events", new O$5()); + x$4(this, "on", function(e18, t2) { + return r2.events.on(e18, t2); + }); + x$4(this, "once", function(e18, t2) { + return r2.events.once(e18, t2); + }); + x$4(this, "off", function(e18, t2) { + return r2.events.off(e18, t2); + }); + x$4(this, "removeListener", function(e18, t2) { + return r2.events.removeListener(e18, t2); + }); + x$4(this, "removeAllListeners", function() { + return r2.events.removeAllListeners(); + }); }; -sha.sha1 = _1; -sha.sha224 = _224; -sha.sha256 = _256; -sha.sha384 = _384; -sha.sha512 = _512; -var ripemd = {}; -var utils$l = utils$t; -var common = common$5; -var rotl32 = utils$l.rotl32; -var sum32 = utils$l.sum32; -var sum32_3 = utils$l.sum32_3; -var sum32_4 = utils$l.sum32_4; -var BlockHash = common.BlockHash; -function RIPEMD160$1() { - if (!(this instanceof RIPEMD160$1)) - return new RIPEMD160$1(); - BlockHash.call(this); - this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; - this.endian = "little"; +var rm = { error: function e12() { + for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { + r2[t2] = arguments[t2]; + } + var n5; + (n5 = console).error.apply(n5, ["[ERROR]"].concat(b$3(r2))); +}, warn: function e13() { + for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { + r2[t2] = arguments[t2]; + } + var n5; + (n5 = console).warn.apply(n5, ["[WARN]"].concat(b$3(r2))); +}, info: function e14() { + for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { + r2[t2] = arguments[t2]; + } + var n5; + (n5 = console).info.apply(n5, ["[INFO]"].concat(b$3(r2))); +}, debug: function e15() { + for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { + r2[t2] = arguments[t2]; + } + var n5; + (n5 = console).log.apply(n5, ["[DEBUG]"].concat(b$3(r2))); +} }; +var rb = (typeof window === "undefined" ? "undefined" : w$5(window)) < "u"; +function rw() { + var e18 = document.getElementsByTagName("link"), r2 = []; + for (var t2 = 0; t2 < e18.length; t2++) { + var n5 = e18[t2], o2 = n5.getAttribute("rel"); + if (o2 && o2.toLowerCase().indexOf("icon") > -1) { + var i2 = n5.getAttribute("href"); + if (i2) + if (i2.toLowerCase().indexOf("https:") === -1 && i2.toLowerCase().indexOf("http:") === -1 && i2.indexOf("//") !== 0) { + var a3 = location.protocol + "//" + location.host; + if (i2.indexOf("/") === 0) + a3 += i2; + else { + var s2 = location.pathname.split("/"); + s2.pop(); + var u2 = s2.join("/"); + a3 += u2 + "/" + i2; + } + r2.push(a3); + } else if (i2.indexOf("//") === 0) { + var c2 = location.protocol + i2; + r2.push(c2); + } else + r2.push(i2); + } + } + return r2; } -utils$l.inherits(RIPEMD160$1, BlockHash); -ripemd.ripemd160 = RIPEMD160$1; -RIPEMD160$1.blockSize = 512; -RIPEMD160$1.outSize = 160; -RIPEMD160$1.hmacStrength = 192; -RIPEMD160$1.padLength = 64; -RIPEMD160$1.prototype._update = function update2(msg, start) { - var A2 = this.h[0]; - var B2 = this.h[1]; - var C3 = this.h[2]; - var D2 = this.h[3]; - var E2 = this.h[4]; - var Ah2 = A2; - var Bh2 = B2; - var Ch2 = C3; - var Dh2 = D2; - var Eh2 = E2; - for (var j2 = 0; j2 < 80; j2++) { - var T9 = sum32( - rotl32( - sum32_4(A2, f$6(j2, B2, C3, D2), msg[r$5[j2] + start], K$3(j2)), - s$3[j2] - ), - E2 - ); - A2 = E2; - E2 = D2; - D2 = rotl32(C3, 10); - C3 = B2; - B2 = T9; - T9 = sum32( - rotl32( - sum32_4(Ah2, f$6(79 - j2, Bh2, Ch2, Dh2), msg[rh$1[j2] + start], Kh(j2)), - sh[j2] - ), - Eh2 - ); - Ah2 = Eh2; - Eh2 = Dh2; - Dh2 = rotl32(Ch2, 10); - Ch2 = Bh2; - Bh2 = T9; +function rR() { + var e18 = function(e19) { + var r3 = o2[e19], n6 = ["itemprop", "property", "name"].map(function(e20) { + return r3.getAttribute(e20); + }).filter(function(e20) { + return e20 ? t2.includes(e20) : false; + }); + if (n6.length && n6) { + var i3 = r3.getAttribute("content"); + if (i3) + return { v: i3 }; + } + }; + for (var r2 = arguments.length, t2 = new Array(r2), n5 = 0; n5 < r2; n5++) { + t2[n5] = arguments[n5]; } - T9 = sum32_3(this.h[1], C3, Dh2); - this.h[1] = sum32_3(this.h[2], D2, Eh2); - this.h[2] = sum32_3(this.h[3], E2, Ah2); - this.h[3] = sum32_3(this.h[4], A2, Bh2); - this.h[4] = sum32_3(this.h[0], B2, Ch2); - this.h[0] = T9; + var o2 = document.getElementsByTagName("meta"); + for (var i2 = 0; i2 < o2.length; i2++) { + var a3 = e18(i2); + if (w$5(a3) === "object") + return a3.v; + } + return ""; +} +function rE() { + var e18 = rR("name", "og:site_name", "og:title", "twitter:title"); + return e18 || (e18 = document.title), e18; +} +function rO() { + return rR("description", "og:description", "twitter:description", "keywords"); +} +function r_() { + if (!rb) + return; + var e18 = rE(), r2 = rO(), t2 = location.origin, n5 = rw(); + return { description: r2, url: t2, icons: n5, name: e18 }; +} +var rA = function e16(e16) { + c$4(o2, e16); + var r2 = _$3(o2); + function o2(e18, i2) { + n$8(this, o2); + var a3; + a3 = r2.call(this, i2); + x$4(t$3(a3), "code"); + a3.code = e18, Object.setPrototypeOf(t$3(a3), (f$5(this, o2) ? this.constructor : void 0).prototype); + return a3; + } + a$2(o2, [{ key: "toString", value: function e18() { + return "".concat(this.message, " (").concat(this.code, ")"); + } }]); + return o2; +}(E$3(Error)); +var rS = { CLOSE_MODAL: { code: 100001, message: "[binance-w3w] User closed modal" }, REJECT_SESSION: { code: 100002, message: "[binance-w3w] User rejected connection" }, PROVIDER_NOT_READY: { code: 100003, message: "[binance-w3w] Provider is not ready" }, CONNECTING: { code: 100004, message: "[binance-w3w] Already processing session request. Please wait" }, CONNECTED: { code: 100005, message: "[binance-w3w] Already connected" } }, rx = { REJECT_ERR: { code: 200001, message: "[binance-w3w] User rejected the operation" }, METHOD_NOT_SUPPORT: { code: 200002, message: "[binance-w3w] Does not support calling method" }, MISSING_RESPONSE: { code: 200003, message: "[binance-w3w] Missing JSON RPC response" }, INVALID_PARAM: { code: 200004, message: "[binance-w3w] Invalid request param" } }, rN = { INTERNAL_ERR: { code: 300001, message: "[binance-w3w] Internal error" } }; +var rP = function() { + return !!(w$5(window.navigator) > "u" ? "" : navigator.userAgent).match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i); +}, rT = function() { + return !!navigator.userAgent.match(/Android/i); +}, rC = function(e18, r2) { + var t2 = "appId=xoqXxUSMRccLCrZNRebmzj&startPagePath=L3BhZ2VzL2Rhc2hib2FyZC1uZXcvaW5kZXg="; + if (r2) { + var n5 = encodeURI$1("wc=".concat(encodeURIComponent(r2), "&isDeepLink=true&id=").concat(+/* @__PURE__ */ new Date())); + t2 = "".concat(t2, "&startPageQuery=").concat(n5); + } + var o2 = "//app.binance.com"; + return e18 ? "bnc:".concat(o2, "/mp/app?").concat(t2) : "https:".concat(o2, "/?_dp=").concat(encodeURI$1("/mp/app?".concat(t2))); +}, rj = function(e18) { + var r2 = rP(), t2 = rC(true, e18); + if (!r2) + return; + var n5 = document.createElement("a"); + n5.href = t2, document.body.appendChild(n5), n5.click(), document.body.removeChild(n5); }; -RIPEMD160$1.prototype._digest = function digest7(enc) { - if (enc === "hex") - return utils$l.toHex32(this.h, "little"); - else - return utils$l.split32(this.h, "little"); +var rD = function() { + try { + var e18, r2; + return ((r2 = window) === null || r2 === void 0 ? void 0 : (e18 = r2.ethereum) === null || e18 === void 0 ? void 0 : e18.isBinance) === true; + } catch (e19) { + return false; + } }; -function f$6(j2, x3, y3, z3) { - if (j2 <= 15) - return x3 ^ y3 ^ z3; - else if (j2 <= 31) - return x3 & y3 | ~x3 & z3; - else if (j2 <= 47) - return (x3 | ~y3) ^ z3; - else if (j2 <= 63) - return x3 & z3 | y3 & ~z3; - else - return x3 ^ (y3 | ~z3); +function Hydrate(parameters) { + const { children, config: config2, initialState: initialState2, reconnectOnMount = true } = parameters; + const { onMount } = hydrate(config2, { + initialState: initialState2, + reconnectOnMount + }); + if (!config2._internal.ssr) + onMount(); + const active = reactExports.useRef(true); + reactExports.useEffect(() => { + if (!active.current) + return; + if (!config2._internal.ssr) + return; + onMount(); + return () => { + active.current = false; + }; + }, []); + return children; } -function K$3(j2) { - if (j2 <= 15) - return 0; - else if (j2 <= 31) - return 1518500249; - else if (j2 <= 47) - return 1859775393; - else if (j2 <= 63) - return 2400959708; - else - return 2840853838; +const WagmiContext = reactExports.createContext(void 0); +function WagmiProvider(parameters) { + const { children, config: config2 } = parameters; + const props = { value: config2 }; + return reactExports.createElement(Hydrate, parameters, reactExports.createElement(WagmiContext.Provider, props, children)); } -function Kh(j2) { - if (j2 <= 15) - return 1352829926; - else if (j2 <= 31) - return 1548603684; - else if (j2 <= 47) - return 1836072691; - else if (j2 <= 63) - return 2053994217; - else - return 0; +const version$5 = "2.13.0"; +const getVersion = () => `wagmi@${version$5}`; +class BaseError3 extends BaseError$1 { + constructor() { + super(...arguments); + Object.defineProperty(this, "name", { + enumerable: true, + configurable: true, + writable: true, + value: "WagmiError" + }); + } + get docsBaseUrl() { + return "https://wagmi.sh/react"; + } + get version() { + return getVersion(); + } } -var r$5 = [ - 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 rh$1 = [ - 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 s$3 = [ - 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 sh = [ - 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 -]; -var utils$k = utils$t; -var assert$d = minimalisticAssert; -function Hmac(hash3, key2, enc) { - if (!(this instanceof Hmac)) - return new Hmac(hash3, key2, enc); - this.Hash = hash3; - this.blockSize = hash3.blockSize / 8; - this.outSize = hash3.outSize / 8; - this.inner = null; - this.outer = null; - this._init(utils$k.toArray(key2, enc)); -} -var hmac$4 = Hmac; -Hmac.prototype._init = function init(key2) { - if (key2.length > this.blockSize) - key2 = new this.Hash().update(key2).digest(); - assert$d(key2.length <= this.blockSize); - for (var i3 = key2.length; i3 < this.blockSize; i3++) - key2.push(0); - for (i3 = 0; i3 < key2.length; i3++) - key2[i3] ^= 54; - this.inner = new this.Hash().update(key2); - for (i3 = 0; i3 < key2.length; i3++) - key2[i3] ^= 106; - this.outer = new this.Hash().update(key2); -}; -Hmac.prototype.update = function update3(msg, enc) { - this.inner.update(msg, enc); - return this; -}; -Hmac.prototype.digest = function digest8(enc) { - this.outer.update(this.inner.digest()); - return this.outer.digest(enc); -}; -(function(exports) { - var hash3 = exports; - hash3.utils = utils$t; - hash3.common = common$5; - hash3.sha = sha; - hash3.ripemd = ripemd; - hash3.hmac = hmac$4; - hash3.sha1 = hash3.sha.sha1; - hash3.sha256 = hash3.sha.sha256; - hash3.sha224 = hash3.sha.sha224; - hash3.sha384 = hash3.sha.sha384; - hash3.sha512 = hash3.sha.sha512; - hash3.ripemd160 = hash3.ripemd.ripemd160; -})(hash$6); -const hash$5 = /* @__PURE__ */ getDefaultExportFromCjs$1(hash$6); -const eB = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: hash$5 -}, [hash$6]); -const _hasBuffer = typeof Buffer === "function"; -const _TD = typeof TextDecoder === "function" ? new TextDecoder() : void 0; -const _TE = typeof TextEncoder === "function" ? new TextEncoder() : void 0; -const b64ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; -const b64chs = Array.prototype.slice.call(b64ch); -const b64tab = ((a3) => { - let tab = {}; - a3.forEach((c2, i3) => tab[c2] = i3); - return tab; -})(b64chs); -const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/; -const _fromCC = String.fromCharCode.bind(String); -const _U8Afrom = typeof Uint8Array.from === "function" ? Uint8Array.from.bind(Uint8Array) : (it2) => new Uint8Array(Array.prototype.slice.call(it2, 0)); -const _mkUriSafe = (src2) => src2.replace(/=/g, "").replace(/[+\/]/g, (m02) => m02 == "+" ? "-" : "_"); -const _tidyB64 = (s2) => s2.replace(/[^A-Za-z0-9\+\/]/g, ""); -const btoaPolyfill = (bin) => { - let u322, c02, c1, c2, asc = ""; - const pad3 = bin.length % 3; - for (let i3 = 0; i3 < bin.length; ) { - if ((c02 = bin.charCodeAt(i3++)) > 255 || (c1 = bin.charCodeAt(i3++)) > 255 || (c2 = bin.charCodeAt(i3++)) > 255) - throw new TypeError("invalid character found"); - u322 = c02 << 16 | c1 << 8 | c2; - asc += b64chs[u322 >> 18 & 63] + b64chs[u322 >> 12 & 63] + b64chs[u322 >> 6 & 63] + b64chs[u322 & 63]; - } - return pad3 ? asc.slice(0, pad3 - 3) + "===".substring(pad3) : asc; -}; -const _btoa = typeof btoa === "function" ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, "binary").toString("base64") : btoaPolyfill; -const _fromUint8Array = _hasBuffer ? (u8a2) => Buffer.from(u8a2).toString("base64") : (u8a2) => { - const maxargs = 4096; - let strs = []; - for (let i3 = 0, l2 = u8a2.length; i3 < l2; i3 += maxargs) { - strs.push(_fromCC.apply(null, u8a2.subarray(i3, i3 + maxargs))); - } - return _btoa(strs.join("")); -}; -const cb_utob = (c2) => { - if (c2.length < 2) { - var cc2 = c2.charCodeAt(0); - return cc2 < 128 ? c2 : cc2 < 2048 ? _fromCC(192 | cc2 >>> 6) + _fromCC(128 | cc2 & 63) : _fromCC(224 | cc2 >>> 12 & 15) + _fromCC(128 | cc2 >>> 6 & 63) + _fromCC(128 | cc2 & 63); - } else { - var cc2 = 65536 + (c2.charCodeAt(0) - 55296) * 1024 + (c2.charCodeAt(1) - 56320); - return _fromCC(240 | cc2 >>> 18 & 7) + _fromCC(128 | cc2 >>> 12 & 63) + _fromCC(128 | cc2 >>> 6 & 63) + _fromCC(128 | cc2 & 63); - } -}; -const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; -const utob = (u2) => u2.replace(re_utob, cb_utob); -const _encode$1 = _hasBuffer ? (s2) => Buffer.from(s2, "utf8").toString("base64") : _TE ? (s2) => _fromUint8Array(_TE.encode(s2)) : (s2) => _btoa(utob(s2)); -const encode$5 = (src2, urlsafe = false) => urlsafe ? _mkUriSafe(_encode$1(src2)) : _encode$1(src2); -const encodeURI$1 = (src2) => encode$5(src2, true); -const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g; -const cb_btou = (cccc) => { - switch (cccc.length) { - case 4: - var cp = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset2 = cp - 65536; - return _fromCC((offset2 >>> 10) + 55296) + _fromCC((offset2 & 1023) + 56320); - case 3: - return _fromCC((15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2)); - default: - return _fromCC((31 & cccc.charCodeAt(0)) << 6 | 63 & cccc.charCodeAt(1)); - } -}; -const btou = (b2) => b2.replace(re_btou, cb_btou); -const atobPolyfill = (asc) => { - asc = asc.replace(/\s+/g, ""); - if (!b64re.test(asc)) - throw new TypeError("malformed base64."); - asc += "==".slice(2 - (asc.length & 3)); - let u24, bin = "", r1, r2; - for (let i3 = 0; i3 < asc.length; ) { - u24 = b64tab[asc.charAt(i3++)] << 18 | b64tab[asc.charAt(i3++)] << 12 | (r1 = b64tab[asc.charAt(i3++)]) << 6 | (r2 = b64tab[asc.charAt(i3++)]); - bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255); - } - return bin; -}; -const _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill; -const _toUint8Array = _hasBuffer ? (a3) => _U8Afrom(Buffer.from(a3, "base64")) : (a3) => _U8Afrom(_atob(a3).split("").map((c2) => c2.charCodeAt(0))); -const _decode$1 = _hasBuffer ? (a3) => Buffer.from(a3, "base64").toString("utf8") : _TD ? (a3) => _TD.decode(_toUint8Array(a3)) : (a3) => btou(_atob(a3)); -const _unURI = (a3) => _tidyB64(a3.replace(/[-_]/g, (m02) => m02 == "-" ? "+" : "/")); -const decode$4 = (src2) => _decode$1(_unURI(src2)); -function e$2(e18, r2) { - if (r2 == null || r2 > e18.length) - r2 = e18.length; - for (var t2 = 0, n4 = new Array(r2); t2 < r2; t2++) - n4[t2] = e18[t2]; - return n4; -} -function r$4(r2) { - if (Array.isArray(r2)) - return e$2(r2); -} -function t$1(e18) { - if (e18 === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return e18; -} -function n$6(e18, r2) { - if (!(e18 instanceof r2)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function o$2(e18, r2, t2) { - if (O$4()) { - o$2 = Reflect.construct; - } else { - o$2 = function e19(e19, r3, t3) { - var n4 = [null]; - n4.push.apply(n4, r3); - var o2 = Function.bind.apply(e19, n4); - var i3 = new o2(); - if (t3) - m$3(i3, t3.prototype); - return i3; - }; - } - return o$2.apply(null, arguments); -} -function i$6(e18, r2) { - for (var t2 = 0; t2 < r2.length; t2++) { - var n4 = r2[t2]; - n4.enumerable = n4.enumerable || false; - n4.configurable = true; - if ("value" in n4) - n4.writable = true; - Object.defineProperty(e18, n4.key, n4); +class WagmiProviderNotFoundError extends BaseError3 { + constructor() { + super("`useConfig` must be used within `WagmiProvider`.", { + docsPath: "/api/WagmiProvider" + }); + Object.defineProperty(this, "name", { + enumerable: true, + configurable: true, + writable: true, + value: "WagmiProviderNotFoundError" + }); } } -function a$2(e18, r2, t2) { - if (r2) - i$6(e18.prototype, r2); - if (t2) - i$6(e18, t2); - return e18; +function useConfig(parameters = {}) { + const config2 = parameters.config ?? reactExports.useContext(WagmiContext); + if (!config2) + throw new WagmiProviderNotFoundError(); + return config2; } -function s$2(e18, r2, t2) { - if (r2 in e18) { - Object.defineProperty(e18, r2, { value: t2, enumerable: true, configurable: true, writable: true }); - } else { - e18[r2] = t2; - } - return e18; +var withSelector = { exports: {} }; +var withSelector_production_min = {}; +var shim = { exports: {} }; +var useSyncExternalStoreShim_production_min = {}; +/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var e$2 = reactExports; +function h$4(a3, b2) { + return a3 === b2 && (0 !== a3 || 1 / a3 === 1 / b2) || a3 !== a3 && b2 !== b2; } -function u$1(e18) { - u$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function e19(e19) { - return e19.__proto__ || Object.getPrototypeOf(e19); - }; - return u$1(e18); +var k$2 = "function" === typeof Object.is ? Object.is : h$4, l$3 = e$2.useState, m$3 = e$2.useEffect, n$7 = e$2.useLayoutEffect, p$4 = e$2.useDebugValue; +function q$2(a3, b2) { + var d4 = b2(), f4 = l$3({ inst: { value: d4, getSnapshot: b2 } }), c2 = f4[0].inst, g3 = f4[1]; + n$7(function() { + c2.value = d4; + c2.getSnapshot = b2; + r$5(c2) && g3({ inst: c2 }); + }, [a3, d4, b2]); + m$3(function() { + r$5(c2) && g3({ inst: c2 }); + return a3(function() { + r$5(c2) && g3({ inst: c2 }); + }); + }, [a3]); + p$4(d4); + return d4; } -function c$4(e18, r2) { - if (typeof r2 !== "function" && r2 !== null) { - throw new TypeError("Super expression must either be null or a function"); +function r$5(a3) { + var b2 = a3.getSnapshot; + a3 = a3.value; + try { + var d4 = b2(); + return !k$2(a3, d4); + } catch (f4) { + return true; } - e18.prototype = Object.create(r2 && r2.prototype, { constructor: { value: e18, writable: true, configurable: true } }); - if (r2) - m$3(e18, r2); } -function f$5(e18, r2) { - if (r2 != null && typeof Symbol !== "undefined" && r2[Symbol.hasInstance]) { - return !!r2[Symbol.hasInstance](e18); - } else { - return e18 instanceof r2; - } +function t$2(a3, b2) { + return b2(); } -function l$3(e18) { - return Function.toString.call(e18).indexOf("[native code]") !== -1; +var u$2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t$2 : q$2; +useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e$2.useSyncExternalStore ? e$2.useSyncExternalStore : u$2; +{ + shim.exports = useSyncExternalStoreShim_production_min; } -function p$3(e18) { - if (typeof Symbol !== "undefined" && e18[Symbol.iterator] != null || e18["@@iterator"] != null) - return Array.from(e18); +var shimExports = shim.exports; +/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var h$3 = reactExports, n$6 = shimExports; +function p$3(a3, b2) { + return a3 === b2 && (0 !== a3 || 1 / a3 === 1 / b2) || a3 !== a3 && b2 !== b2; } -function d$3() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} -function v$5(e18) { - for (var r2 = 1; r2 < arguments.length; r2++) { - var t2 = arguments[r2] != null ? arguments[r2] : {}; - var n4 = Object.keys(t2); - if (typeof Object.getOwnPropertySymbols === "function") { - n4 = n4.concat(Object.getOwnPropertySymbols(t2).filter(function(e19) { - return Object.getOwnPropertyDescriptor(t2, e19).enumerable; - })); +var q$1 = "function" === typeof Object.is ? Object.is : p$3, r$4 = n$6.useSyncExternalStore, t$1 = h$3.useRef, u$1 = h$3.useEffect, v$5 = h$3.useMemo, w$4 = h$3.useDebugValue; +withSelector_production_min.useSyncExternalStoreWithSelector = function(a3, b2, e18, l2, g3) { + var c2 = t$1(null); + if (null === c2.current) { + var f4 = { hasValue: false, value: null }; + c2.current = f4; + } else + f4 = c2.current; + c2 = v$5(function() { + function a4(a5) { + if (!c3) { + c3 = true; + d5 = a5; + a5 = l2(a5); + if (void 0 !== g3 && f4.hasValue) { + var b3 = f4.value; + if (g3(b3, a5)) + return k2 = b3; + } + return k2 = a5; + } + b3 = k2; + if (q$1(d5, a5)) + return b3; + var e19 = l2(a5); + if (void 0 !== g3 && g3(b3, e19)) + return b3; + d5 = a5; + return k2 = e19; } - n4.forEach(function(r3) { - s$2(e18, r3, t2[r3]); - }); - } - return e18; + var c3 = false, d5, k2, m3 = void 0 === e18 ? null : e18; + return [function() { + return a4(b2()); + }, null === m3 ? void 0 : function() { + return a4(m3()); + }]; + }, [b2, e18, l2, g3]); + var d4 = r$4(a3, c2[0], c2[1]); + u$1(function() { + f4.hasValue = true; + f4.value = d4; + }, [d4]); + w$4(d4); + return d4; +}; +{ + withSelector.exports = withSelector_production_min; } -function h$3(e18, r2) { - var t2 = Object.keys(e18); - if (Object.getOwnPropertySymbols) { - var n4 = Object.getOwnPropertySymbols(e18); - if (r2) { - n4 = n4.filter(function(r3) { - return Object.getOwnPropertyDescriptor(e18, r3).enumerable; - }); +var withSelectorExports = withSelector.exports; +const isPlainObject$2 = (obj) => typeof obj === "object" && !Array.isArray(obj); +function useSyncExternalStoreWithTracked(subscribe, getSnapshot, getServerSnapshot = getSnapshot, isEqual = deepEqual) { + const trackedKeys = reactExports.useRef([]); + const result = withSelectorExports.useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, (x3) => x3, (a3, b2) => { + if (isPlainObject$2(a3) && isPlainObject$2(b2) && trackedKeys.current.length) { + for (const key2 of trackedKeys.current) { + const equal2 = isEqual(a3[key2], b2[key2]); + if (!equal2) + return false; + } + return true; } - t2.push.apply(t2, n4); - } - return t2; + return isEqual(a3, b2); + }); + return reactExports.useMemo(() => { + if (isPlainObject$2(result)) { + const trackedResult = { ...result }; + let properties = {}; + for (const [key2, value] of Object.entries(trackedResult)) { + properties = { + ...properties, + [key2]: { + configurable: false, + enumerable: true, + get: () => { + if (!trackedKeys.current.includes(key2)) { + trackedKeys.current.push(key2); + } + return value; + } + } + }; + } + Object.defineProperties(trackedResult, properties); + return trackedResult; + } + return result; + }, [result]); } -function y$4(e18, r2) { - r2 = r2 != null ? r2 : {}; - if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(e18, Object.getOwnPropertyDescriptors(r2)); - } else { - h$3(Object(r2)).forEach(function(t2) { - Object.defineProperty(e18, t2, Object.getOwnPropertyDescriptor(r2, t2)); - }); - } - return e18; +function useAccount(parameters = {}) { + const config2 = useConfig(parameters); + return useSyncExternalStoreWithTracked((onChange) => watchAccount(config2, { onChange }), () => getAccount(config2)); } -function g$3(e18, r2) { - if (r2 && (w$4(r2) === "object" || typeof r2 === "function")) { - return r2; +var Subscribable = class { + constructor() { + this.listeners = /* @__PURE__ */ new Set(); + this.subscribe = this.subscribe.bind(this); + } + subscribe(listener) { + this.listeners.add(listener); + this.onSubscribe(); + return () => { + this.listeners.delete(listener); + this.onUnsubscribe(); + }; + } + hasListeners() { + return this.listeners.size > 0; + } + onSubscribe() { + } + onUnsubscribe() { } - return t$1(e18); +}; +var isServer = typeof window === "undefined" || "Deno" in globalThis; +function noop$3() { + return void 0; } -function m$3(e18, r2) { - m$3 = Object.setPrototypeOf || function e19(e19, r3) { - e19.__proto__ = r3; - return e19; - }; - return m$3(e18, r2); +function functionalUpdate(updater, input) { + return typeof updater === "function" ? updater(input) : updater; } -function b$3(e18) { - return r$4(e18) || p$3(e18) || R$2(e18) || d$3(); +function isValidTimeout(value) { + return typeof value === "number" && value >= 0 && value !== Infinity; } -function w$4(e18) { - "@swc/helpers - typeof"; - return e18 && typeof Symbol !== "undefined" && e18.constructor === Symbol ? "symbol" : typeof e18; +function timeUntilStale(updatedAt, staleTime) { + return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); } -function R$2(r2, t2) { - if (!r2) - return; - if (typeof r2 === "string") - return e$2(r2, t2); - var n4 = Object.prototype.toString.call(r2).slice(8, -1); - if (n4 === "Object" && r2.constructor) - n4 = r2.constructor.name; - if (n4 === "Map" || n4 === "Set") - return Array.from(n4); - if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4)) - return e$2(r2, t2); +function resolveStaleTime(staleTime, query) { + return typeof staleTime === "function" ? staleTime(query) : staleTime; } -function E$3(e18) { - var r2 = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0; - E$3 = function e19(e19) { - if (e19 === null || !l$3(e19)) - return e19; - if (typeof e19 !== "function") { - throw new TypeError("Super expression must either be null or a function"); +function resolveEnabled(enabled, query) { + return typeof enabled === "function" ? enabled(query) : enabled; +} +function matchQuery(filters, query) { + const { + type: type2 = "all", + exact, + fetchStatus, + predicate, + queryKey, + stale + } = filters; + if (queryKey) { + if (exact) { + if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { + return false; + } + } else if (!partialMatchKey(query.queryKey, queryKey)) { + return false; } - if (typeof r2 !== "undefined") { - if (r2.has(e19)) - return r2.get(e19); - r2.set(e19, t2); + } + if (type2 !== "all") { + const isActive = query.isActive(); + if (type2 === "active" && !isActive) { + return false; } - function t2() { - return o$2(e19, arguments, u$1(this).constructor); + if (type2 === "inactive" && isActive) { + return false; } - t2.prototype = Object.create(e19.prototype, { constructor: { value: t2, enumerable: false, writable: true, configurable: true } }); - return m$3(t2, e19); - }; - return E$3(e18); -} -function O$4() { - if (typeof Reflect === "undefined" || !Reflect.construct) + } + if (typeof stale === "boolean" && query.isStale() !== stale) { return false; - if (Reflect.construct.sham) + } + if (fetchStatus && fetchStatus !== query.state.fetchStatus) { return false; - if (typeof Proxy === "function") - return true; - try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); - return true; - } catch (e18) { + } + if (predicate && !predicate(query)) { return false; } + return true; } -function _$3(e18) { - var r2 = O$4(); - return function t2() { - var t3 = u$1(e18), n4; - if (r2) { - var o2 = u$1(this).constructor; - n4 = Reflect.construct(t3, arguments, o2); - } else { - n4 = t3.apply(this, arguments); +function matchMutation(filters, mutation) { + const { exact, status, predicate, mutationKey } = filters; + if (mutationKey) { + if (!mutation.options.mutationKey) { + return false; + } + if (exact) { + if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { + return false; + } + } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { + return false; } - return g$3(this, n4); - }; -} -var A$2 = Object.defineProperty; -var S$4 = function(e18, r2, t2) { - return r2 in e18 ? A$2(e18, r2, { enumerable: true, configurable: true, writable: true, value: t2 }) : e18[r2] = t2; -}; -var x$4 = function(e18, r2, t2) { - return S$4(e18, (typeof r2 === "undefined" ? "undefined" : w$4(r2)) != "symbol" ? r2 + "" : r2, t2), t2; -}; -var N$2; -var I$2 = "PARSE_ERROR", P$2 = "INVALID_REQUEST", T$3 = "METHOD_NOT_FOUND", C$3 = "INVALID_PARAMS", j$5 = "INTERNAL_ERROR", D$2 = "SERVER_ERROR", U$1 = [-32700, -32600, -32601, -32602, -32603], M$2 = (N$2 = {}, s$2(N$2, I$2, { code: -32700, message: "Parse error" }), s$2(N$2, P$2, { code: -32600, message: "Invalid Request" }), s$2(N$2, T$3, { code: -32601, message: "Method not found" }), s$2(N$2, C$3, { code: -32602, message: "Invalid params" }), s$2(N$2, j$5, { code: -32603, message: "Internal error" }), s$2(N$2, D$2, { code: -32e3, message: "Server error" }), N$2), B$1 = D$2; -function J(e18) { - return U$1.includes(e18); -} -function H(e18) { - return Object.keys(M$2).includes(e18) ? M$2[e18] : M$2[B$1]; -} -function V$2(e18) { - var r2 = Object.values(M$2).find(function(r3) { - return r3.code === e18; - }); - return r2 || M$2[B$1]; -} -function z$5(e18, r2, t2) { - return e18.message.includes("getaddrinfo ENOTFOUND") || e18.message.includes("connect ECONNREFUSED") ? new Error("Unavailable ".concat(t2, " RPC url at ").concat(r2)) : e18; -} -function W() { - var e18 = Date.now() * Math.pow(10, 3), r2 = Math.floor(Math.random() * Math.pow(10, 3)); - return e18 + r2; -} -function q$1() { - return function(e18, r2) { - for (r2 = e18 = ""; e18++ < 36; r2 += e18 * 51 & 52 ? (e18 ^ 15 ? 8 ^ Math.random() * (e18 ^ 20 ? 16 : 4) : 4).toString(16) : "-") - ; - return r2; - }(); -} -function G$1(e18, r2, t2) { - return { id: t2 || W(), jsonrpc: "2.0", method: e18, params: r2 || [] }; -} -function Q$3(e18, r2, t2) { - return { id: e18, jsonrpc: "2.0", error: X(r2, t2) }; -} -function X(e18, r2) { - return (typeof e18 === "undefined" ? "undefined" : w$4(e18)) > "u" ? H(j$5) : (typeof e18 == "string" && (e18 = y$4(v$5({}, H(D$2)), { message: e18 })), (typeof r2 === "undefined" ? "undefined" : w$4(r2)) < "u" && (e18.data = r2), J(e18.code) && (e18 = V$2(e18.code)), e18); -} -function ee$2(e18) { - return "result" in e18; -} -var et$2 = "^https?:"; -function eo$1(e18) { - var r2 = e18.match(new RegExp(/^\w+:/, "gi")); - if (!(!r2 || !r2.length)) - return r2[0]; -} -function ei$1(e18, r2) { - var t2 = eo$1(e18); - return (typeof t2 === "undefined" ? "undefined" : w$4(t2)) > "u" ? false : new RegExp(r2).test(t2); -} -function ea$2(e18) { - return ei$1(e18, et$2); -} -var ec$1 = { 1: "mainnet", 3: "ropsten", 4: "rinkeby", 5: "goerli", 42: "kovan" }, ef$2 = ["eth_requestAccounts", "eth_accounts", "eth_chainId", "eth_signTransaction", "eth_sendTransaction", "eth_sign", "personal_sign", "eth_signTypedData", "eth_signTypedData_v1", "eth_signTypedData_v2", "eth_signTypedData_v3", "eth_signTypedData_v4", "wallet_switchEthereumChain", "wallet_watchAsset"]; -function el(e18, r2) { - var t2, n4 = ec$1[e18]; - return typeof n4 == "string" && (t2 = "https://".concat(n4, ".infura.io/v3/").concat(r2)), t2; -} -function ep(e18) { - if (typeof e18 != "string") - throw new Error("Cannot safe json parse value of type ".concat(typeof e18 === "undefined" ? "undefined" : w$4(e18))); - try { - return JSON.parse(e18); - } catch (r2) { - return e18; } -} -function ed(e18) { - return typeof e18 == "string" ? e18 : JSON.stringify(e18); -} -function ev$1(e18, r2) { - var t2, n4 = el(e18, r2.infuraId); - return r2.custom && r2.custom[e18] ? t2 = r2.custom[e18] : n4 && (t2 = n4), t2; -} -function eh() { - return (typeof process === "undefined" ? "undefined" : w$4(process)) < "u" && w$4(process.versions) < "u" && w$4(process.versions.node) < "u"; -} -function ey(e18) { - return typeof e18 == "string" ? Number.parseInt(e18, e18.trim().substring(0, 2) === "0x" ? 16 : 10) : (typeof e18 === "undefined" ? "undefined" : w$4(e18)) == "bigint" ? Number(e18) : e18; -} -var eg = "hex", em = "utf8"; -function eb(e18) { - return e18.replace(/^0x/, ""); -} -function ew(e18) { - return eE(Buffer.from(eb(e18), eg)); -} -function eR(e18) { - var r2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; - return eO(eA(e18), r2); -} -function eE(e18) { - return new Uint8Array(e18); -} -function eO(e18) { - var r2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; - var t2 = e18.toString(eg); - return r2 ? eS(t2) : t2; -} -function e_(e18) { - return ArrayBuffer.isView(e18) ? Buffer.from(e18.buffer, e18.byteOffset, e18.byteLength) : Buffer.from(e18); -} -function eA(e18) { - return e_(e18); -} -function eS(e18) { - return e18.startsWith("0x") ? e18 : "0x".concat(e18); -} -function ex() { - for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { - r2[t2] = arguments[t2]; + if (status && mutation.state.status !== status) { + return false; } - var n4 = []; - return r2.forEach(function(e19) { - return n4 = n4.concat(Array.from(e19)); - }), new Uint8Array(b$3(n4)); -} -function eN(e18) { - return eE(Buffer.from(e18, em)); -} -function eI(e18) { - return Buffer.from(e18, em); -} -function eP(e18) { - return e18.toString(em); -} -function eT(e18) { - return eP(eA(e18)); -} -function eC(e18) { - var r2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; - return eO(eI(e18), r2); + if (predicate && !predicate(mutation)) { + return false; + } + return true; } -function ej(e18) { - return ew(e18).buffer; +function hashQueryKeyByOptions(queryKey, options) { + const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashKey; + return hashFn(queryKey); } -function eD(e18, r2) { - return eR(new Uint8Array(e18), !r2); +function hashKey(queryKey) { + return JSON.stringify( + queryKey, + (_3, val) => isPlainObject$1(val) ? Object.keys(val).sort().reduce((result, key2) => { + result[key2] = val[key2]; + return result; + }, {}) : val + ); } -function eU(e18) { - return eE(e18).buffer; +function partialMatchKey(a3, b2) { + if (a3 === b2) { + return true; + } + if (typeof a3 !== typeof b2) { + return false; + } + if (a3 && b2 && typeof a3 === "object" && typeof b2 === "object") { + return !Object.keys(b2).some((key2) => !partialMatchKey(a3[key2], b2[key2])); + } + return false; } -function ek(e18) { - return eA(new Uint8Array(e18)); +function replaceEqualDeep(a3, b2) { + if (a3 === b2) { + return a3; + } + const array2 = isPlainArray(a3) && isPlainArray(b2); + if (array2 || isPlainObject$1(a3) && isPlainObject$1(b2)) { + const aItems = array2 ? a3 : Object.keys(a3); + const aSize = aItems.length; + const bItems = array2 ? b2 : Object.keys(b2); + const bSize = bItems.length; + const copy = array2 ? [] : {}; + let equalItems = 0; + for (let i2 = 0; i2 < bSize; i2++) { + const key2 = array2 ? i2 : bItems[i2]; + if ((!array2 && aItems.includes(key2) || array2) && a3[key2] === void 0 && b2[key2] === void 0) { + copy[key2] = void 0; + equalItems++; + } else { + copy[key2] = replaceEqualDeep(a3[key2], b2[key2]); + if (copy[key2] === a3[key2] && a3[key2] !== void 0) { + equalItems++; + } + } + } + return aSize === bSize && equalItems === aSize ? a3 : copy; + } + return b2; } -function eM(e18) { - var r2 = "0x0"; - return typeof e18 == "number" && (r2 = "0x".concat(e18.toString(16))), typeof e18 == "string" && (e18.startsWith("0x") ? r2 = e18 : r2 = "0x0"), r2; +function shallowEqualObjects(a3, b2) { + if (!b2 || Object.keys(a3).length !== Object.keys(b2).length) { + return false; + } + for (const key2 in a3) { + if (a3[key2] !== b2[key2]) { + return false; + } + } + return true; } -var eL = { 16: 10, 24: 12, 32: 14 }, eJ = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145], eK = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22], eH = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125], eV = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986], eF = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766], ez = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126], eW = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436], eq = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890], eG = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935], eZ = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600], eQ = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480], eX = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795], eY = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855], e$ = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150], e1 = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925]; -function e2(e18) { - return parseInt("".concat(e18)) === e18; +function isPlainArray(value) { + return Array.isArray(value) && value.length === Object.keys(value).length; } -function e3(e18) { - if (!e2(e18.length)) +function isPlainObject$1(o2) { + if (!hasObjectPrototype(o2)) { return false; - for (var r2 = 0; r2 < e18.length; r2++) - if (!e2(e18[r2]) || e18[r2] < 0 || e18[r2] > 255) - return false; + } + const ctor = o2.constructor; + if (ctor === void 0) { + return true; + } + const prot = ctor.prototype; + if (!hasObjectPrototype(prot)) { + return false; + } + if (!prot.hasOwnProperty("isPrototypeOf")) { + return false; + } + if (Object.getPrototypeOf(o2) !== Object.prototype) { + return false; + } return true; } -function e4(e18) { - return new Uint8Array(e18); +function hasObjectPrototype(o2) { + return Object.prototype.toString.call(o2) === "[object Object]"; } -function e0$1(e18) { - var r2 = []; - for (var t2 = 0; t2 < e18.length; t2 += 4) - r2.push(e18[t2] << 24 | e18[t2 + 1] << 16 | e18[t2 + 2] << 8 | e18[t2 + 3]); - return r2; +function sleep$3(timeout) { + return new Promise((resolve) => { + setTimeout(resolve, timeout); + }); } -function e5(e18, r2) { - if (e18.buffer && e18.name === "Uint8Array") - return r2 && (e18.slice ? e18 = e18.slice() : e18 = Array.prototype.slice.call(e18)), e18; - if (Array.isArray(e18)) { - if (!e3(e18)) - throw new Error("Array contains invalid value"); - return new Uint8Array(e18); +function replaceData(prevData, data, options) { + if (typeof options.structuralSharing === "function") { + return options.structuralSharing(prevData, data); + } else if (options.structuralSharing !== false) { + return replaceEqualDeep(prevData, data); } - if (e2(e18.length) && e3(e18)) - return new Uint8Array(e18); - throw new Error("unsupported array-like object"); + return data; } -function e7(e18, r2, t2, n4, o2) { - (n4 != null || o2 != null) && (e18.slice ? e18 = e18.slice(n4, o2) : e18 = Array.prototype.slice.call(e18, n4, o2)), r2.set(e18, t2); +function addToEnd(items, item, max = 0) { + const newItems = [...items, item]; + return max && newItems.length > max ? newItems.slice(1) : newItems; } -var e6 = function() { - function e18(r2) { - n$6(this, e18); - x$4(this, "key"); - x$4(this, "_Ke"); - x$4(this, "_Kd"); - this.key = e5(r2, true), this._prepare(); +function addToStart(items, item, max = 0) { + const newItems = [item, ...items]; + return max && newItems.length > max ? newItems.slice(0, -1) : newItems; +} +var skipToken = Symbol(); +function ensureQueryFn(options, fetchOptions) { + if (!options.queryFn && (fetchOptions == null ? void 0 : fetchOptions.initialPromise)) { + return () => fetchOptions.initialPromise; } - a$2(e18, [{ key: "_prepare", value: function e19() { - var e20 = eL[this.key.length]; - if (e20 == null) - throw new Error("invalid key size (must be 16, 24 or 32 bytes)"); - this._Ke = [], this._Kd = []; - for (var r2 = 0; r2 <= e20; r2++) - this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]); - var t2 = (e20 + 1) * 4, n4 = this.key.length / 4, o2 = e0$1(this.key), i3; - for (var a3 = 0; a3 < n4; a3++) - i3 = a3 >> 2, this._Ke[i3][a3 % 4] = o2[a3], this._Kd[e20 - i3][a3 % 4] = o2[a3]; - var s2 = 0, u2 = n4, c2; - for (; u2 < t2; ) { - if (c2 = o2[n4 - 1], o2[0] ^= eK[c2 >> 16 & 255] << 24 ^ eK[c2 >> 8 & 255] << 16 ^ eK[c2 & 255] << 8 ^ eK[c2 >> 24 & 255] ^ eJ[s2] << 24, s2 += 1, n4 != 8) - for (var f3 = 1; f3 < n4; f3++) - o2[f3] ^= o2[f3 - 1]; - else { - for (var l2 = 1; l2 < n4 / 2; l2++) - o2[l2] ^= o2[l2 - 1]; - c2 = o2[n4 / 2 - 1], o2[n4 / 2] ^= eK[c2 & 255] ^ eK[c2 >> 8 & 255] << 8 ^ eK[c2 >> 16 & 255] << 16 ^ eK[c2 >> 24 & 255] << 24; - for (var p3 = n4 / 2 + 1; p3 < n4; p3++) - o2[p3] ^= o2[p3 - 1]; - } - var d4 = 0, v6 = void 0, h4 = void 0; - for (; d4 < n4 && u2 < t2; ) - v6 = u2 >> 2, h4 = u2 % 4, this._Ke[v6][h4] = o2[d4], this._Kd[e20 - v6][h4] = o2[d4++], u2++; - } - for (var y3 = 1; y3 < e20; y3++) - for (var g3 = 0; g3 < 4; g3++) - c2 = this._Kd[y3][g3], this._Kd[y3][g3] = eX[c2 >> 24 & 255] ^ eY[c2 >> 16 & 255] ^ e$[c2 >> 8 & 255] ^ e1[c2 & 255]; - } }, { key: "encrypt", value: function e19(e19) { - if (e19.length != 16) - throw new Error("invalid plaintext size (must be 16 bytes)"); - var r2 = this._Ke.length - 1, t2 = [0, 0, 0, 0], n4 = e0$1(e19); - for (var o2 = 0; o2 < 4; o2++) - n4[o2] ^= this._Ke[0][o2]; - for (var i3 = 1; i3 < r2; i3++) { - for (var a3 = 0; a3 < 4; a3++) - t2[a3] = eV[n4[a3] >> 24 & 255] ^ eF[n4[(a3 + 1) % 4] >> 16 & 255] ^ ez[n4[(a3 + 2) % 4] >> 8 & 255] ^ eW[n4[(a3 + 3) % 4] & 255] ^ this._Ke[i3][a3]; - n4 = t2.slice(); - } - var s2 = e4(16), u2; - for (var c2 = 0; c2 < 4; c2++) - u2 = this._Ke[r2][c2], s2[4 * c2] = (eK[n4[c2] >> 24 & 255] ^ u2 >> 24) & 255, s2[4 * c2 + 1] = (eK[n4[(c2 + 1) % 4] >> 16 & 255] ^ u2 >> 16) & 255, s2[4 * c2 + 2] = (eK[n4[(c2 + 2) % 4] >> 8 & 255] ^ u2 >> 8) & 255, s2[4 * c2 + 3] = (eK[n4[(c2 + 3) % 4] & 255] ^ u2) & 255; - return s2; - } }, { key: "decrypt", value: function e19(e19) { - if (e19.length != 16) - throw new Error("invalid ciphertext size (must be 16 bytes)"); - var r2 = this._Kd.length - 1, t2 = [0, 0, 0, 0], n4 = e0$1(e19); - for (var o2 = 0; o2 < 4; o2++) - n4[o2] ^= this._Kd[0][o2]; - for (var i3 = 1; i3 < r2; i3++) { - for (var a3 = 0; a3 < 4; a3++) - t2[a3] = eq[n4[a3] >> 24 & 255] ^ eG[n4[(a3 + 3) % 4] >> 16 & 255] ^ eZ[n4[(a3 + 2) % 4] >> 8 & 255] ^ eQ[n4[(a3 + 1) % 4] & 255] ^ this._Kd[i3][a3]; - n4 = t2.slice(); - } - var s2 = e4(16), u2; - for (var c2 = 0; c2 < 4; c2++) - u2 = this._Kd[r2][c2], s2[4 * c2] = (eH[n4[c2] >> 24 & 255] ^ u2 >> 24) & 255, s2[4 * c2 + 1] = (eH[n4[(c2 + 3) % 4] >> 16 & 255] ^ u2 >> 16) & 255, s2[4 * c2 + 2] = (eH[n4[(c2 + 2) % 4] >> 8 & 255] ^ u2 >> 8) & 255, s2[4 * c2 + 3] = (eH[n4[(c2 + 1) % 4] & 255] ^ u2) & 255; - return s2; - } }]); - return e18; -}(), e8 = function() { - function e18(r2, t2) { - n$6(this, e18); - x$4(this, "_aes"); - x$4(this, "_lastCipherblock"); - if (!t2) - t2 = new Uint8Array(16); - else if (t2.length != 16) - throw new Error("invalid initialation vector size (must be 16 bytes)"); - this._lastCipherblock = e5(t2, true), this._aes = new e6(r2); + if (!options.queryFn || options.queryFn === skipToken) { + return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); } - a$2(e18, [{ key: "encrypt", value: function e19(e19) { - if (e19 = e5(e19), e19.length % 16 !== 0) - throw new Error("invalid plaintext size (must be multiple of 16 bytes)"); - var r2 = e4(e19.length), t2 = e4(16); - for (var n4 = 0; n4 < e19.length; n4 += 16) { - e7(e19, t2, 0, n4, n4 + 16); - for (var o2 = 0; o2 < 16; o2++) - t2[o2] ^= this._lastCipherblock[o2]; - this._lastCipherblock = this._aes.encrypt(t2), e7(this._lastCipherblock, r2, n4); - } - return r2; - } }, { key: "decrypt", value: function e19(e19) { - if (e19 = e5(e19), e19.length % 16 !== 0) - throw new Error("invalid ciphertext size (must be multiple of 16 bytes)"); - var r2 = e4(e19.length), t2 = e4(16); - for (var n4 = 0; n4 < e19.length; n4 += 16) { - e7(e19, t2, 0, n4, n4 + 16), t2 = this._aes.decrypt(t2); - for (var o2 = 0; o2 < 16; o2++) - r2[n4 + o2] = t2[o2] ^ this._lastCipherblock[o2]; - e7(e19, this._lastCipherblock, 0, n4, n4 + 16); - } - return r2; - } }]); - return e18; -}(); -var e9 = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]], re$2 = { pad: function e(e) { - var r2 = e9[e.byteLength % 16 || 0], t2 = new Uint8Array(e.byteLength + r2.length); - return t2.set(e), t2.set(r2, e.byteLength), t2; -}, unpad: function e10(e10) { - return e10.subarray(0, e10.byteLength - e10[e10.byteLength - 1]); -} }; -var rr$3 = "sha256"; -function rt$2(e18, r2, t2) { - var n4 = new e8(r2, e18), o2 = re$2.pad(t2), i3 = n4.encrypt(o2); - return new Uint8Array(i3); -} -function rn$2(e18, r2, t2) { - var n4 = new e8(r2, e18).decrypt(t2), o2 = new Uint8Array(n4); - return re$2.unpad(o2); -} -function ro$1(e18, r2) { - var t2 = hash$6.hmac(eB[rr$3], e18).update(r2).digest("hex"); - return ew(t2); -} -function ri$1(e18) { - for (var r2 = new Uint8Array(e18), t2 = 0; t2 < e18; ++t2) - r2[t2] = Math.floor(256 * Math.random()); - return eA(r2); -} -function ra$2(e18) { - var r2 = ri$1(e18); - return eE(r2); -} -function rs(e18) { - var r2 = (e18 || 256) / 8, t2 = ra$2(r2); - return eU(eA(t2)); -} -function ru$1(e18, r2) { - var t2 = ew(e18.data), n4 = ew(e18.iv), o2 = ew(e18.hmac), i3 = eR(o2, false), a3 = ex(t2, n4), s2 = ro$1(r2, a3), u2 = eR(s2, false); - return eb(i3) === eb(u2); -} -function rc(e18, r2, t2) { - var n4 = eE(ek(r2)), o2 = t2 || rs(128), i3 = eE(ek(o2)), a3 = eR(i3, false), s2 = JSON.stringify(e18), u2 = eN(s2), c2 = rt$2(i3, n4, u2), f3 = eR(c2, false), l2 = ex(c2, i3), p3 = ro$1(n4, l2), d4 = eR(p3, false); - return { data: f3, hmac: d4, iv: a3 }; + return options.queryFn; } -function rf$2(e18, r2) { - var t2 = eE(ek(r2)); - if (!t2) - throw new Error("Missing key: required for decryption"); - if (!ru$1(e18, t2)) - return null; - var n4 = ew(e18.data), o2 = ew(e18.iv), i3 = rn$2(o2, t2, n4), a3 = eT(i3), s2; - try { - s2 = JSON.parse(a3); - } catch (e19) { - return null; +var FocusManager = (_a2 = class extends Subscribable { + constructor() { + super(); + __privateAdd(this, _focused, void 0); + __privateAdd(this, _cleanup, void 0); + __privateAdd(this, _setup, void 0); + __privateSet(this, _setup, (onFocus) => { + if (!isServer && window.addEventListener) { + const listener = () => onFocus(); + window.addEventListener("visibilitychange", listener, false); + return () => { + window.removeEventListener("visibilitychange", listener); + }; + } + return; + }); } - return s2; -} -function rl(e18) { - var r2 = null; - try { - var t2 = window.localStorage.getItem(e18); - t2 && (r2 = JSON.parse(t2)); - } catch (e19) { - r2 = null; + onSubscribe() { + if (!__privateGet(this, _cleanup)) { + this.setEventListener(__privateGet(this, _setup)); + } } - return r2; -} -function rp(e18) { - try { - window.localStorage.removeItem(e18); - } catch (e19) { + onUnsubscribe() { + var _a3; + if (!this.hasListeners()) { + (_a3 = __privateGet(this, _cleanup)) == null ? void 0 : _a3.call(this); + __privateSet(this, _cleanup, void 0); + } } -} -function rd(e18, r2) { - try { - window.localStorage.setItem(e18, JSON.stringify(r2)); - } catch (e19) { + setEventListener(setup) { + var _a3; + __privateSet(this, _setup, setup); + (_a3 = __privateGet(this, _cleanup)) == null ? void 0 : _a3.call(this); + __privateSet(this, _cleanup, setup((focused) => { + if (typeof focused === "boolean") { + this.setFocused(focused); + } else { + this.onFocus(); + } + })); } -} -var rh = function e11() { - var r2 = this; - n$6(this, e11); - x$4(this, "events", new O$5()); - x$4(this, "on", function(e18, t2) { - return r2.events.on(e18, t2); - }); - x$4(this, "once", function(e18, t2) { - return r2.events.once(e18, t2); - }); - x$4(this, "off", function(e18, t2) { - return r2.events.off(e18, t2); - }); - x$4(this, "removeListener", function(e18, t2) { - return r2.events.removeListener(e18, t2); - }); - x$4(this, "removeAllListeners", function() { - return r2.events.removeAllListeners(); - }); -}; -var rm = { error: function e12() { - for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { - r2[t2] = arguments[t2]; + setFocused(focused) { + const changed = __privateGet(this, _focused) !== focused; + if (changed) { + __privateSet(this, _focused, focused); + this.onFocus(); + } } - var n4; - (n4 = console).error.apply(n4, ["[ERROR]"].concat(b$3(r2))); -}, warn: function e13() { - for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { - r2[t2] = arguments[t2]; + onFocus() { + const isFocused = this.isFocused(); + this.listeners.forEach((listener) => { + listener(isFocused); + }); } - var n4; - (n4 = console).warn.apply(n4, ["[WARN]"].concat(b$3(r2))); -}, info: function e14() { - for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { - r2[t2] = arguments[t2]; + isFocused() { + var _a3; + if (typeof __privateGet(this, _focused) === "boolean") { + return __privateGet(this, _focused); + } + return ((_a3 = globalThis.document) == null ? void 0 : _a3.visibilityState) !== "hidden"; } - var n4; - (n4 = console).info.apply(n4, ["[INFO]"].concat(b$3(r2))); -}, debug: function e15() { - for (var e18 = arguments.length, r2 = new Array(e18), t2 = 0; t2 < e18; t2++) { - r2[t2] = arguments[t2]; +}, _focused = new WeakMap(), _cleanup = new WeakMap(), _setup = new WeakMap(), _a2); +var focusManager = new FocusManager(); +var OnlineManager = (_b = class extends Subscribable { + constructor() { + super(); + __privateAdd(this, _online, true); + __privateAdd(this, _cleanup2, void 0); + __privateAdd(this, _setup2, void 0); + __privateSet(this, _setup2, (onOnline) => { + if (!isServer && window.addEventListener) { + const onlineListener = () => onOnline(true); + const offlineListener = () => onOnline(false); + window.addEventListener("online", onlineListener, false); + window.addEventListener("offline", offlineListener, false); + return () => { + window.removeEventListener("online", onlineListener); + window.removeEventListener("offline", offlineListener); + }; + } + return; + }); } - var n4; - (n4 = console).log.apply(n4, ["[DEBUG]"].concat(b$3(r2))); -} }; -var rb = (typeof window === "undefined" ? "undefined" : w$4(window)) < "u"; -function rw() { - var e18 = document.getElementsByTagName("link"), r2 = []; - for (var t2 = 0; t2 < e18.length; t2++) { - var n4 = e18[t2], o2 = n4.getAttribute("rel"); - if (o2 && o2.toLowerCase().indexOf("icon") > -1) { - var i3 = n4.getAttribute("href"); - if (i3) - if (i3.toLowerCase().indexOf("https:") === -1 && i3.toLowerCase().indexOf("http:") === -1 && i3.indexOf("//") !== 0) { - var a3 = location.protocol + "//" + location.host; - if (i3.indexOf("/") === 0) - a3 += i3; - else { - var s2 = location.pathname.split("/"); - s2.pop(); - var u2 = s2.join("/"); - a3 += u2 + "/" + i3; - } - r2.push(a3); - } else if (i3.indexOf("//") === 0) { - var c2 = location.protocol + i3; - r2.push(c2); - } else - r2.push(i3); + onSubscribe() { + if (!__privateGet(this, _cleanup2)) { + this.setEventListener(__privateGet(this, _setup2)); } } - return r2; -} -function rR() { - var e18 = function(e19) { - var r3 = o2[e19], n5 = ["itemprop", "property", "name"].map(function(e20) { - return r3.getAttribute(e20); - }).filter(function(e20) { - return e20 ? t2.includes(e20) : false; - }); - if (n5.length && n5) { - var i4 = r3.getAttribute("content"); - if (i4) - return { v: i4 }; + onUnsubscribe() { + var _a3; + if (!this.hasListeners()) { + (_a3 = __privateGet(this, _cleanup2)) == null ? void 0 : _a3.call(this); + __privateSet(this, _cleanup2, void 0); } - }; - for (var r2 = arguments.length, t2 = new Array(r2), n4 = 0; n4 < r2; n4++) { - t2[n4] = arguments[n4]; } - var o2 = document.getElementsByTagName("meta"); - for (var i3 = 0; i3 < o2.length; i3++) { - var a3 = e18(i3); - if (w$4(a3) === "object") - return a3.v; + setEventListener(setup) { + var _a3; + __privateSet(this, _setup2, setup); + (_a3 = __privateGet(this, _cleanup2)) == null ? void 0 : _a3.call(this); + __privateSet(this, _cleanup2, setup(this.setOnline.bind(this))); } - return ""; -} -function rE() { - var e18 = rR("name", "og:site_name", "og:title", "twitter:title"); - return e18 || (e18 = document.title), e18; -} -function rO() { - return rR("description", "og:description", "twitter:description", "keywords"); -} -function r_() { - if (!rb) - return; - var e18 = rE(), r2 = rO(), t2 = location.origin, n4 = rw(); - return { description: r2, url: t2, icons: n4, name: e18 }; -} -var rA = function e16(e16) { - c$4(o2, e16); - var r2 = _$3(o2); - function o2(e18, i3) { - n$6(this, o2); - var a3; - a3 = r2.call(this, i3); - x$4(t$1(a3), "code"); - a3.code = e18, Object.setPrototypeOf(t$1(a3), (f$5(this, o2) ? this.constructor : void 0).prototype); - return a3; + setOnline(online) { + const changed = __privateGet(this, _online) !== online; + if (changed) { + __privateSet(this, _online, online); + this.listeners.forEach((listener) => { + listener(online); + }); + } } - a$2(o2, [{ key: "toString", value: function e18() { - return "".concat(this.message, " (").concat(this.code, ")"); - } }]); - return o2; -}(E$3(Error)); -var rS = { CLOSE_MODAL: { code: 100001, message: "[binance-w3w] User closed modal" }, REJECT_SESSION: { code: 100002, message: "[binance-w3w] User rejected connection" }, PROVIDER_NOT_READY: { code: 100003, message: "[binance-w3w] Provider is not ready" }, CONNECTING: { code: 100004, message: "[binance-w3w] Already processing session request. Please wait" }, CONNECTED: { code: 100005, message: "[binance-w3w] Already connected" } }, rx = { REJECT_ERR: { code: 200001, message: "[binance-w3w] User rejected the operation" }, METHOD_NOT_SUPPORT: { code: 200002, message: "[binance-w3w] Does not support calling method" }, MISSING_RESPONSE: { code: 200003, message: "[binance-w3w] Missing JSON RPC response" }, INVALID_PARAM: { code: 200004, message: "[binance-w3w] Invalid request param" } }, rN = { INTERNAL_ERR: { code: 300001, message: "[binance-w3w] Internal error" } }; -var rP = function() { - return !!(w$4(window.navigator) > "u" ? "" : navigator.userAgent).match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i); -}, rT = function() { - return !!navigator.userAgent.match(/Android/i); -}, rC = function(e18, r2) { - var t2 = "appId=xoqXxUSMRccLCrZNRebmzj&startPagePath=L3BhZ2VzL2Rhc2hib2FyZC1uZXcvaW5kZXg="; - if (r2) { - var n4 = encodeURI$1("wc=".concat(encodeURIComponent(r2), "&isDeepLink=true&id=").concat(+/* @__PURE__ */ new Date())); - t2 = "".concat(t2, "&startPageQuery=").concat(n4); + isOnline() { + return __privateGet(this, _online); } - var o2 = "//app.binance.com"; - return e18 ? "bnc:".concat(o2, "/mp/app?").concat(t2) : "https:".concat(o2, "/?_dp=").concat(encodeURI$1("/mp/app?".concat(t2))); -}, rj = function(e18) { - var r2 = rP(), t2 = rC(true, e18); - if (!r2) - return; - var n4 = document.createElement("a"); - n4.href = t2, document.body.appendChild(n4), n4.click(), document.body.removeChild(n4); -}; -var rD = function() { - try { - var e18, r2; - return ((r2 = window) === null || r2 === void 0 ? void 0 : (e18 = r2.ethereum) === null || e18 === void 0 ? void 0 : e18.isBinance) === true; - } catch (e19) { - return false; +}, _online = new WeakMap(), _cleanup2 = new WeakMap(), _setup2 = new WeakMap(), _b); +var onlineManager = new OnlineManager(); +function defaultRetryDelay(failureCount) { + return Math.min(1e3 * 2 ** failureCount, 3e4); +} +function canFetch(networkMode) { + return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; +} +var CancelledError = class extends Error { + constructor(options) { + super("CancelledError"); + this.revert = options == null ? void 0 : options.revert; + this.silent = options == null ? void 0 : options.silent; } }; -function n$5(n4, e18, t2, r2, i3, c2, o2) { - try { - var s2 = n4[c2](o2); - var a3 = s2.value; - } catch (n5) { - t2(n5); - return; - } - if (s2.done) { - e18(a3); - } else { - Promise.resolve(a3).then(r2, i3); - } +function isCancelledError(value) { + return value instanceof CancelledError; } -function e$1(e18) { - return function() { - var t2 = this, r2 = arguments; - return new Promise(function(i3, c2) { - var o2 = e18.apply(t2, r2); - function s2(e19) { - n$5(o2, i3, c2, s2, a3, "next", e19); - } - function a3(e19) { - n$5(o2, i3, c2, s2, a3, "throw", e19); +function createRetryer(config2) { + let isRetryCancelled = false; + let failureCount = 0; + let isResolved = false; + let continueFn; + let promiseResolve; + let promiseReject; + const promise = new Promise((outerResolve, outerReject) => { + promiseResolve = outerResolve; + promiseReject = outerReject; + }); + const cancel = (cancelOptions) => { + var _a3; + if (!isResolved) { + reject(new CancelledError(cancelOptions)); + (_a3 = config2.abort) == null ? void 0 : _a3.call(config2); + } + }; + const cancelRetry = () => { + isRetryCancelled = true; + }; + const continueRetry = () => { + isRetryCancelled = false; + }; + const canContinue = () => focusManager.isFocused() && (config2.networkMode === "always" || onlineManager.isOnline()) && config2.canRun(); + const canStart = () => canFetch(config2.networkMode) && config2.canRun(); + const resolve = (value) => { + var _a3; + if (!isResolved) { + isResolved = true; + (_a3 = config2.onSuccess) == null ? void 0 : _a3.call(config2, value); + continueFn == null ? void 0 : continueFn(); + promiseResolve(value); + } + }; + const reject = (value) => { + var _a3; + if (!isResolved) { + isResolved = true; + (_a3 = config2.onError) == null ? void 0 : _a3.call(config2, value); + continueFn == null ? void 0 : continueFn(); + promiseReject(value); + } + }; + const pause = () => { + return new Promise((continueResolve) => { + var _a3; + continueFn = (value) => { + if (isResolved || canContinue()) { + continueResolve(value); + } + }; + (_a3 = config2.onPause) == null ? void 0 : _a3.call(config2); + }).then(() => { + var _a3; + continueFn = void 0; + if (!isResolved) { + (_a3 = config2.onContinue) == null ? void 0 : _a3.call(config2); } - s2(void 0); }); }; -} -function t(n4, e18, t2) { - if (e18 in n4) { - Object.defineProperty(n4, e18, { value: t2, enumerable: true, configurable: true, writable: true }); - } else { - n4[e18] = t2; - } - return n4; -} -function r$3(n4) { - for (var e18 = 1; e18 < arguments.length; e18++) { - var r2 = arguments[e18] != null ? arguments[e18] : {}; - var i3 = Object.keys(r2); - if (typeof Object.getOwnPropertySymbols === "function") { - i3 = i3.concat(Object.getOwnPropertySymbols(r2).filter(function(n5) { - return Object.getOwnPropertyDescriptor(r2, n5).enumerable; - })); + const run2 = () => { + if (isResolved) { + return; + } + let promiseOrValue; + const initialPromise = failureCount === 0 ? config2.initialPromise : void 0; + try { + promiseOrValue = initialPromise ?? config2.fn(); + } catch (error) { + promiseOrValue = Promise.reject(error); } - i3.forEach(function(e19) { - t(n4, e19, r2[e19]); + Promise.resolve(promiseOrValue).then(resolve).catch((error) => { + var _a3; + if (isResolved) { + return; + } + const retry = config2.retry ?? (isServer ? 0 : 3); + const retryDelay = config2.retryDelay ?? defaultRetryDelay; + const delay2 = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; + const shouldRetry2 = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); + if (isRetryCancelled || !shouldRetry2) { + reject(error); + return; + } + failureCount++; + (_a3 = config2.onFail) == null ? void 0 : _a3.call(config2, failureCount, error); + sleep$3(delay2).then(() => { + return canContinue() ? void 0 : pause(); + }).then(() => { + if (isRetryCancelled) { + reject(error); + } else { + run2(); + } + }); }); - } - return n4; + }; + return { + promise, + cancel, + continue: () => { + continueFn == null ? void 0 : continueFn(); + return promise; + }, + cancelRetry, + continueRetry, + canStart, + start: () => { + if (canStart()) { + run2(); + } else { + pause().then(run2); + } + return promise; + } + }; } -function i$5(n4, e18) { - var t2 = Object.keys(n4); - if (Object.getOwnPropertySymbols) { - var r2 = Object.getOwnPropertySymbols(n4); - if (e18) { - r2 = r2.filter(function(e19) { - return Object.getOwnPropertyDescriptor(n4, e19).enumerable; +function createNotifyManager() { + let queue = []; + let transactions = 0; + let notifyFn = (callback) => { + callback(); + }; + let batchNotifyFn = (callback) => { + callback(); + }; + let scheduleFn = (cb2) => setTimeout(cb2, 0); + const setScheduler = (fn2) => { + scheduleFn = fn2; + }; + const batch = (callback) => { + let result; + transactions++; + try { + result = callback(); + } finally { + transactions--; + if (!transactions) { + flush(); + } + } + return result; + }; + const schedule = (callback) => { + if (transactions) { + queue.push(callback); + } else { + scheduleFn(() => { + notifyFn(callback); }); } - t2.push.apply(t2, r2); - } - return t2; -} -function c$3(n4, e18) { - e18 = e18 != null ? e18 : {}; - if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(n4, Object.getOwnPropertyDescriptors(e18)); - } else { - i$5(Object(e18)).forEach(function(t2) { - Object.defineProperty(n4, t2, Object.getOwnPropertyDescriptor(e18, t2)); - }); - } - return n4; -} -function o$1(n4) { - "@swc/helpers - typeof"; - return n4 && typeof Symbol !== "undefined" && n4.constructor === Symbol ? "symbol" : typeof n4; -} -function s$1(n4, e18) { - var t2, r2, i3, c2, o2 = { label: 0, sent: function() { - if (i3[0] & 1) - throw i3[1]; - return i3[1]; - }, trys: [], ops: [] }; - return c2 = { next: s2(0), "throw": s2(1), "return": s2(2) }, typeof Symbol === "function" && (c2[Symbol.iterator] = function() { - return this; - }), c2; - function s2(n5) { - return function(e19) { - return a3([n5, e19]); + }; + const batchCalls = (callback) => { + return (...args) => { + schedule(() => { + callback(...args); + }); }; - } - function a3(c3) { - if (t2) - throw new TypeError("Generator is already executing."); - while (o2) - try { - if (t2 = 1, r2 && (i3 = c3[0] & 2 ? r2["return"] : c3[0] ? r2["throw"] || ((i3 = r2["return"]) && i3.call(r2), 0) : r2.next) && !(i3 = i3.call(r2, c3[1])).done) - return i3; - if (r2 = 0, i3) - c3 = [c3[0] & 2, i3.value]; - switch (c3[0]) { - case 0: - case 1: - i3 = c3; - break; - case 4: - o2.label++; - return { value: c3[1], done: false }; - case 5: - o2.label++; - r2 = c3[1]; - c3 = [0]; - continue; - case 7: - c3 = o2.ops.pop(); - o2.trys.pop(); - continue; - default: - if (!(i3 = o2.trys, i3 = i3.length > 0 && i3[i3.length - 1]) && (c3[0] === 6 || c3[0] === 2)) { - o2 = 0; - continue; - } - if (c3[0] === 3 && (!i3 || c3[1] > i3[0] && c3[1] < i3[3])) { - o2.label = c3[1]; - break; - } - if (c3[0] === 6 && o2.label < i3[1]) { - o2.label = i3[1]; - i3 = c3; - break; - } - if (i3 && o2.label < i3[2]) { - o2.label = i3[2]; - o2.ops.push(c3); - break; - } - if (i3[2]) - o2.ops.pop(); - o2.trys.pop(); - continue; - } - c3 = e18.call(n4, o2); - } catch (n5) { - c3 = [6, n5]; - r2 = 0; - } finally { - t2 = i3 = 0; - } - if (c3[0] & 5) - throw c3[1]; - return { value: c3[0] ? c3[1] : void 0, done: true }; - } -} -v$4.type = "binanceWallet"; -function v$4() { - var n4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - var i3; - return createConnector(function(a3) { - return { id: "BinanceW3WSDK", name: "Binance Web3 Wallet", type: v$4.type, setup: function n5() { - return e$1(function() { - var n6; - return s$1(this, function(e18) { - switch (e18.label) { - case 0: - return [4, this.getProvider()]; - case 1: - n6 = e18.sent(); - n6 && n6.on("connect", this.onConnect.bind(this)); - return [2]; - } - }); - }).apply(this); - }, connect: function t2() { - var t3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r2 = t3.chainId; - return e$1(function() { - var e18, t4, i4; - return s$1(this, function(c2) { - switch (c2.label) { - case 0: - r2 = r2 !== null && r2 !== void 0 ? r2 : 56; - return [4, this.getProvider({ chainId: r2 })]; - case 1: - e18 = c2.sent(); - e18.on("accountsChanged", this.onAccountsChanged.bind(this)), e18.on("chainChanged", this.onChainChanged.bind(this)), e18.on("disconnect", this.onDisconnect.bind(this)), setTimeout(function() { - return a3.emitter.emit("message", { type: "connecting" }); - }, 0), e18.setLng(n4.lng || "en"); - return [4, e18.enable()]; - case 2: - t4 = c2.sent().map(function(n5) { - return getAddress$2(n5); - }); - return [4, this.getChainId()]; - case 3: - i4 = c2.sent(); - return [2, { accounts: t4, chainId: i4 }]; - } - }); - }).apply(this); - }, disconnect: function n5() { - return e$1(function() { - var n6; - return s$1(this, function(e18) { - switch (e18.label) { - case 0: - return [4, this.getProvider()]; - case 1: - n6 = e18.sent(); - n6.disconnect(), n6.removeListener("accountsChanged", this.onAccountsChanged), n6.removeListener("chainChanged", this.onChainChanged), n6.removeListener("disconnect", this.onDisconnect); - return [2]; - } - }); - }).apply(this); - }, getAccounts: function n5() { - return e$1(function() { - return s$1(this, function(n6) { - switch (n6.label) { - case 0: - return [4, this.getProvider()]; - case 1: - return [4, n6.sent().request({ method: "eth_accounts" })]; - case 2: - return [2, n6.sent().map(function(n7) { - return getAddress$2(n7); - })]; - } - }); - }).apply(this); - }, getChainId: function n5() { - return e$1(function() { - var n6, e18, t2, r2; - return s$1(this, function(i4) { - switch (i4.label) { - case 0: - return [4, this.getProvider()]; - case 1: - e18 = i4.sent(); - if (!((n6 = e18.chainId) !== null && n6 !== void 0)) - return [3, 2]; - r2 = n6; - return [3, 4]; - case 2: - return [4, e18 === null || e18 === void 0 ? void 0 : e18.request({ method: "eth_chainId" })]; - case 3: - r2 = i4.sent(); - i4.label = 4; - case 4: - t2 = r2; - return [2, ey(t2)]; - } - }); - }).apply(this); - }, getProvider: function u2() { - var u3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, h4 = u3.chainId; - return e$1(function() { - var e18, u4, l2, f3, d4; - return s$1(this, function(s2) { - switch (s2.label) { - case 0: - if ((typeof window === "undefined" ? "undefined" : o$1(window)) > "u") - return [2]; - return [4, __vitePreload(() => import("./index-2bfd47a8.js"), true ? [] : void 0, import.meta.url)]; - case 1: - l2 = s2.sent().default, f3 = h4 || ((e18 = a3.chains[0]) === null || e18 === void 0 ? void 0 : e18.id), d4 = n4.infuraId ? {} : a3.chains.reduce(function(n5, e19) { - return c$3(r$3({}, n5), t({}, e19.id, e19.rpcUrls.default.http[0])); - }, {}); - return [2, (i3 = new l2(c$3(r$3({}, n4), { chainId: f3, rpc: r$3({}, d4, (u4 = this.options) === null || u4 === void 0 ? void 0 : u4.rpc) })), i3)]; - } - }); - }).apply(this); - }, isAuthorized: function n5() { - return e$1(function() { - return s$1(this, function(e18) { - switch (e18.label) { - case 0: - e18.trys.push([0, 2, , 3]); - return [4, this.getAccounts()]; - case 1: - return [2, e18.sent().length > 0]; - case 2: - e18.sent(); - return [2, false]; - case 3: - return [2]; - } - }); - }).apply(this); - }, switchChain: function n5(n5) { - var t2 = n5.chainId; - return e$1(function() { - var n6, e18, r2, i4, c2; - return s$1(this, function(o2) { - switch (o2.label) { - case 0: - n6 = a3.chains.find(function(n7) { - return n7.id === t2; - }); - if (!n6) - throw new SwitchChainError(new ChainNotConfiguredError()); - return [4, this.getProvider()]; - case 1: - e18 = o2.sent(), r2 = numberToHex(n6.id); - o2.label = 2; - case 2: - o2.trys.push([2, 4, , 5]); - return [4, Promise.race([e18.request({ method: "wallet_switchEthereumChain", params: [{ chainId: r2 }] }), new Promise(function(n7) { - return a3.emitter.once("change", function(e19) { - var r3 = e19.chainId; - r3 === t2 && n7(t2); - }); - })])]; - case 3: - return [2, (o2.sent(), n6)]; - case 4: - i4 = o2.sent(); - c2 = typeof i4 == "string" ? i4 : i4 === null || i4 === void 0 ? void 0 : i4.message; - throw /user rejected request/i.test(c2) ? new UserRejectedRequestError(i4) : new SwitchChainError(i4); - case 5: - return [2]; - } - }); - }).apply(this); - }, onAccountsChanged: function n5(n5) { - n5.length === 0 ? a3.emitter.emit("disconnect") : a3.emitter.emit("change", { accounts: n5.map(function(n6) { - return getAddress$2(n6); - }) }); - }, onChainChanged: function n5(n5) { - var e18 = ey(n5); - a3.emitter.emit("change", { chainId: e18 }); - }, onConnect: function n5(n5) { - return e$1(function() { - var e18, t2, r2; - return s$1(this, function(i4) { - switch (i4.label) { - case 0: - return [4, this.getAccounts()]; - case 1: - e18 = i4.sent(); - if (e18.length === 0) - return [2]; - t2 = ey(n5.chainId); - a3.emitter.emit("connect", { accounts: e18, chainId: t2 }); - return [4, this.getProvider()]; - case 2: - r2 = i4.sent(); - r2 && (r2.removeListener("connect", this.onConnect.bind(this)), r2.on("accountsChanged", this.onAccountsChanged.bind(this)), r2.on("chainChanged", this.onChainChanged), r2.on("disconnect", this.onDisconnect.bind(this))); - return [2]; - } - }); - }).apply(this); - }, onDisconnect: function n5(n5) { - return e$1(function() { - var n6; - return s$1(this, function(e18) { - switch (e18.label) { - case 0: - a3.emitter.emit("disconnect"); - return [4, this.getProvider()]; - case 1: - n6 = e18.sent(); - n6.removeListener("accountsChanged", this.onAccountsChanged.bind(this)), n6.removeListener("chainChanged", this.onChainChanged), n6.removeListener("disconnect", this.onDisconnect.bind(this)), n6.on("connect", this.onConnect.bind(this)); - return [2]; - } + }; + const flush = () => { + const originalQueue = queue; + queue = []; + if (originalQueue.length) { + scheduleFn(() => { + batchNotifyFn(() => { + originalQueue.forEach((callback) => { + notifyFn(callback); + }); }); - }).apply(this); - } }; - }); -} -var m$2 = function() { - return rD() ? injected$1 : v$4; -}; -function getEvmInjectedProvider(flag) { - if (typeof window === "undefined" || typeof window.ethereum === "undefined") - return; - const providers2 = window.ethereum.providers; - return providers2 ? providers2.find((provider) => provider[flag]) : window.ethereum[flag] ? window.ethereum : void 0; -} -function hasEvmInjectedProvider(flag) { - return Boolean(getEvmInjectedProvider(flag)); -} -function getRecentConnectorId() { - if (typeof window === "undefined") - return; - const recentConnectorId = window.localStorage.getItem("wagmi.recentConnectorId"); - if (recentConnectorId) - return JSON.parse(recentConnectorId); + }); + } + }; + const setNotifyFunction = (fn2) => { + notifyFn = fn2; + }; + const setBatchNotifyFunction = (fn2) => { + batchNotifyFn = fn2; + }; + return { + batch, + batchCalls, + schedule, + setNotifyFunction, + setBatchNotifyFunction, + setScheduler + }; } -injected.type = "injected"; -function injected(parameters = {}) { - const { shimDisconnect = true, unstable_shimAsyncInject } = parameters; - function getTarget() { - const target = parameters.target; - if (typeof target === "function") { - const result = target(); - if (result) - return result; +var notifyManager = createNotifyManager(); +var Removable = (_c = class { + constructor() { + __privateAdd(this, _gcTimeout, void 0); + } + destroy() { + this.clearGcTimeout(); + } + scheduleGc() { + this.clearGcTimeout(); + if (isValidTimeout(this.gcTime)) { + __privateSet(this, _gcTimeout, setTimeout(() => { + this.optionalRemove(); + }, this.gcTime)); } - if (typeof target === "object") - return target; - if (typeof target === "string") - return { - ...targetMap[target] ?? { - id: target, - name: `${target[0].toUpperCase()}${target.slice(1)}`, - provider: `is${target[0].toUpperCase()}${target.slice(1)}` - } - }; - return { - id: "injected", - name: "Injected", - async provider(window2) { - return window2 == null ? void 0 : window2.ethereum; - } - }; } - let accountsChanged; - let chainChanged; - let connect2; - let disconnect2; - return createConnector((config2) => ({ - get icon() { - return getTarget().icon; - }, - get id() { - return getTarget().id; - }, - get name() { - return getTarget().name; - }, - /** @deprecated */ - get supportsSimulation() { + updateGcTime(newGcTime) { + this.gcTime = Math.max( + this.gcTime || 0, + newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) + ); + } + clearGcTimeout() { + if (__privateGet(this, _gcTimeout)) { + clearTimeout(__privateGet(this, _gcTimeout)); + __privateSet(this, _gcTimeout, void 0); + } + } +}, _gcTimeout = new WeakMap(), _c); +var Query = (_d = class extends Removable { + constructor(config2) { + super(); + __privateAdd(this, _dispatch); + __privateAdd(this, _initialState, void 0); + __privateAdd(this, _revertState, void 0); + __privateAdd(this, _cache, void 0); + __privateAdd(this, _retryer, void 0); + __privateAdd(this, _defaultOptions, void 0); + __privateAdd(this, _abortSignalConsumed, void 0); + __privateSet(this, _abortSignalConsumed, false); + __privateSet(this, _defaultOptions, config2.defaultOptions); + this.setOptions(config2.options); + this.observers = []; + __privateSet(this, _cache, config2.cache); + this.queryKey = config2.queryKey; + this.queryHash = config2.queryHash; + __privateSet(this, _initialState, getDefaultState$1(this.options)); + this.state = config2.state ?? __privateGet(this, _initialState); + this.scheduleGc(); + } + get meta() { + return this.options.meta; + } + get promise() { + var _a3; + return (_a3 = __privateGet(this, _retryer)) == null ? void 0 : _a3.promise; + } + setOptions(options) { + this.options = { ...__privateGet(this, _defaultOptions), ...options }; + this.updateGcTime(this.options.gcTime); + } + optionalRemove() { + if (!this.observers.length && this.state.fetchStatus === "idle") { + __privateGet(this, _cache).remove(this); + } + } + setData(newData, options) { + const data = replaceData(this.state.data, newData, this.options); + __privateMethod(this, _dispatch, dispatch_fn).call(this, { + data, + type: "success", + dataUpdatedAt: options == null ? void 0 : options.updatedAt, + manual: options == null ? void 0 : options.manual + }); + return data; + } + setState(state, setStateOptions) { + __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); + } + cancel(options) { + var _a3, _b2; + const promise = (_a3 = __privateGet(this, _retryer)) == null ? void 0 : _a3.promise; + (_b2 = __privateGet(this, _retryer)) == null ? void 0 : _b2.cancel(options); + return promise ? promise.then(noop$3).catch(noop$3) : Promise.resolve(); + } + destroy() { + super.destroy(); + this.cancel({ silent: true }); + } + reset() { + this.destroy(); + this.setState(__privateGet(this, _initialState)); + } + isActive() { + return this.observers.some( + (observer) => resolveEnabled(observer.options.enabled, this) !== false + ); + } + isDisabled() { + return this.getObserversCount() > 0 && !this.isActive(); + } + isStale() { + if (this.state.isInvalidated) { return true; - }, - type: injected.type, - async setup() { - const provider = await this.getProvider(); - if ((provider == null ? void 0 : provider.on) && parameters.target) { - if (!connect2) { - connect2 = this.onConnect.bind(this); - provider.on("connect", connect2); - } - if (!accountsChanged) { - accountsChanged = this.onAccountsChanged.bind(this); - provider.on("accountsChanged", accountsChanged); - } - } - }, - async connect({ chainId, isReconnecting: isReconnecting2 } = {}) { - var _a3, _b2, _c2, _d2, _e3, _f3; - const provider = await this.getProvider(); - if (!provider) - throw new ProviderNotFoundError(); - let accounts2 = []; - if (isReconnecting2) - accounts2 = await this.getAccounts().catch(() => []); - else if (shimDisconnect) { - try { - const permissions = await provider.request({ - method: "wallet_requestPermissions", - params: [{ eth_accounts: {} }] - }); - accounts2 = (_d2 = (_c2 = (_b2 = (_a3 = permissions[0]) == null ? void 0 : _a3.caveats) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.value) == null ? void 0 : _d2.map((x3) => getAddress$2(x3)); - if (accounts2.length > 0) { - const sortedAccounts = await this.getAccounts(); - accounts2 = sortedAccounts; + } + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => observer.getCurrentResult().isStale + ); + } + return this.state.data === void 0; + } + isStaleByTime(staleTime = 0) { + return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime); + } + onFocus() { + var _a3; + const observer = this.observers.find((x3) => x3.shouldFetchOnWindowFocus()); + observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); + (_a3 = __privateGet(this, _retryer)) == null ? void 0 : _a3.continue(); + } + onOnline() { + var _a3; + const observer = this.observers.find((x3) => x3.shouldFetchOnReconnect()); + observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); + (_a3 = __privateGet(this, _retryer)) == null ? void 0 : _a3.continue(); + } + addObserver(observer) { + if (!this.observers.includes(observer)) { + this.observers.push(observer); + this.clearGcTimeout(); + __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); + } + } + removeObserver(observer) { + if (this.observers.includes(observer)) { + this.observers = this.observers.filter((x3) => x3 !== observer); + if (!this.observers.length) { + if (__privateGet(this, _retryer)) { + if (__privateGet(this, _abortSignalConsumed)) { + __privateGet(this, _retryer).cancel({ revert: true }); + } else { + __privateGet(this, _retryer).cancelRetry(); } - } catch (err) { - const error = err; - if (error.code === UserRejectedRequestError.code) - throw new UserRejectedRequestError(error); - if (error.code === ResourceUnavailableRpcError.code) - throw error; } + this.scheduleGc(); } - try { - if (!(accounts2 == null ? void 0 : accounts2.length) && !isReconnecting2) { - const requestedAccounts = await provider.request({ - method: "eth_requestAccounts" - }); - accounts2 = requestedAccounts.map((x3) => getAddress$2(x3)); + __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); + } + } + getObserversCount() { + return this.observers.length; + } + invalidate() { + if (!this.state.isInvalidated) { + __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "invalidate" }); + } + } + fetch(options, fetchOptions) { + var _a3, _b2, _c2; + if (this.state.fetchStatus !== "idle") { + if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { + this.cancel({ silent: true }); + } else if (__privateGet(this, _retryer)) { + __privateGet(this, _retryer).continueRetry(); + return __privateGet(this, _retryer).promise; + } + } + if (options) { + this.setOptions(options); + } + if (!this.options.queryFn) { + const observer = this.observers.find((x3) => x3.options.queryFn); + if (observer) { + this.setOptions(observer.options); + } + } + const abortController = new AbortController(); + const addSignalProperty = (object) => { + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + __privateSet(this, _abortSignalConsumed, true); + return abortController.signal; } - if (connect2) { - provider.removeListener("connect", connect2); - connect2 = void 0; - } - if (!accountsChanged) { - accountsChanged = this.onAccountsChanged.bind(this); - provider.on("accountsChanged", accountsChanged); - } - if (!chainChanged) { - chainChanged = this.onChainChanged.bind(this); - provider.on("chainChanged", chainChanged); - } - if (!disconnect2) { - disconnect2 = this.onDisconnect.bind(this); - provider.on("disconnect", disconnect2); - } - let currentChainId = await this.getChainId(); - if (chainId && currentChainId !== chainId) { - const chain = await this.switchChain({ chainId }).catch((error) => { - if (error.code === UserRejectedRequestError.code) - throw error; - return { id: currentChainId }; - }); - currentChainId = (chain == null ? void 0 : chain.id) ?? currentChainId; - } - if (shimDisconnect) - await ((_e3 = config2.storage) == null ? void 0 : _e3.removeItem(`${this.id}.disconnected`)); - if (!parameters.target) - await ((_f3 = config2.storage) == null ? void 0 : _f3.setItem("injected.connected", true)); - return { accounts: accounts2, chainId: currentChainId }; - } catch (err) { - const error = err; - if (error.code === UserRejectedRequestError.code) - throw new UserRejectedRequestError(error); - if (error.code === ResourceUnavailableRpcError.code) - throw new ResourceUnavailableRpcError(error); - throw error; - } - }, - async disconnect() { - var _a3, _b2; - const provider = await this.getProvider(); - if (!provider) - throw new ProviderNotFoundError(); - if (chainChanged) { - provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; - } - if (disconnect2) { - provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; - } - if (!connect2) { - connect2 = this.onConnect.bind(this); - provider.on("connect", connect2); + }); + }; + const fetchFn = () => { + const queryFn = ensureQueryFn(this.options, fetchOptions); + const queryFnContext = { + queryKey: this.queryKey, + meta: this.meta + }; + addSignalProperty(queryFnContext); + __privateSet(this, _abortSignalConsumed, false); + if (this.options.persister) { + return this.options.persister( + queryFn, + queryFnContext, + this + ); } - try { - if (this.id !== "trust") { - await withTimeout( - () => ( - // TODO: Remove explicit type for viem@3 - provider.request({ - // `'wallet_revokePermissions'` added in `viem@2.10.3` - method: "wallet_revokePermissions", - params: [{ eth_accounts: {} }] - }) - ), - { timeout: 100 } - ); - } - } catch { + return queryFn(queryFnContext); + }; + const context = { + fetchOptions, + options: this.options, + queryKey: this.queryKey, + state: this.state, + fetchFn + }; + addSignalProperty(context); + (_a3 = this.options.behavior) == null ? void 0 : _a3.onFetch( + context, + this + ); + __privateSet(this, _revertState, this.state); + if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_b2 = context.fetchOptions) == null ? void 0 : _b2.meta)) { + __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "fetch", meta: (_c2 = context.fetchOptions) == null ? void 0 : _c2.meta }); + } + const onError = (error) => { + var _a4, _b3, _c3, _d2; + if (!(isCancelledError(error) && error.silent)) { + __privateMethod(this, _dispatch, dispatch_fn).call(this, { + type: "error", + error + }); } - if (shimDisconnect) { - await ((_a3 = config2.storage) == null ? void 0 : _a3.setItem(`${this.id}.disconnected`, true)); + if (!isCancelledError(error)) { + (_b3 = (_a4 = __privateGet(this, _cache).config).onError) == null ? void 0 : _b3.call( + _a4, + error, + this + ); + (_d2 = (_c3 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d2.call( + _c3, + this.state.data, + error, + this + ); } - if (!parameters.target) - await ((_b2 = config2.storage) == null ? void 0 : _b2.removeItem("injected.connected")); - }, - async getAccounts() { - const provider = await this.getProvider(); - if (!provider) - throw new ProviderNotFoundError(); - const accounts2 = await provider.request({ method: "eth_accounts" }); - return accounts2.map((x3) => getAddress$2(x3)); - }, - async getChainId() { - const provider = await this.getProvider(); - if (!provider) - throw new ProviderNotFoundError(); - const hexChainId = await provider.request({ method: "eth_chainId" }); - return Number(hexChainId); - }, - async getProvider() { - if (typeof window === "undefined") - return void 0; - let provider; - const target = getTarget(); - if (typeof target.provider === "function") - provider = await target.provider(window); - else if (typeof target.provider === "string") - provider = findProvider(window, target.provider); - else - provider = target.provider; - if (provider && !provider.removeListener) { - if ("off" in provider && typeof provider.off === "function") - provider.removeListener = provider.off; - else - provider.removeListener = () => { - }; + if (!this.isFetchingOptimistic) { + this.scheduleGc(); } - return provider; - }, - async isAuthorized() { - var _a3, _b2; - try { - const isRecentConnector = getRecentConnectorId() === this.id; - const disconnected = await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem(`${this.id}.disconnected`)); - const isDisconnected = !shimDisconnect || !isRecentConnector || disconnected === true; - if (isDisconnected) - return false; - if (!parameters.target) { - const connected = await ((_b2 = config2.storage) == null ? void 0 : _b2.getItem("injected.connected")); - if (!connected) - return false; + this.isFetchingOptimistic = false; + }; + __privateSet(this, _retryer, createRetryer({ + initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, + fn: context.fetchFn, + abort: abortController.abort.bind(abortController), + onSuccess: (data) => { + var _a4, _b3, _c3, _d2; + if (data === void 0) { + onError(new Error(`${this.queryHash} data is undefined`)); + return; } - const provider = await this.getProvider(); - if (!provider) { - if (unstable_shimAsyncInject !== void 0 && unstable_shimAsyncInject !== false) { - const handleEthereum = async () => { - if (typeof window !== "undefined") - window.removeEventListener("ethereum#initialized", handleEthereum); - const provider2 = await this.getProvider(); - return !!provider2; - }; - const timeout = typeof unstable_shimAsyncInject === "number" ? unstable_shimAsyncInject : 1e3; - const res = await Promise.race([ - ...typeof window !== "undefined" ? [ - new Promise( - (resolve) => window.addEventListener( - "ethereum#initialized", - () => resolve(handleEthereum()), - { once: true } - ) - ) - ] : [], - new Promise( - (resolve) => setTimeout(() => resolve(handleEthereum()), timeout) - ) - ]); - if (res) - return true; - } - throw new ProviderNotFoundError(); + this.setData(data); + (_b3 = (_a4 = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _b3.call(_a4, data, this); + (_d2 = (_c3 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d2.call( + _c3, + data, + this.state.error, + this + ); + if (!this.isFetchingOptimistic) { + this.scheduleGc(); } - const accounts2 = await withRetry(() => this.getAccounts()); - return !!accounts2.length; - } catch { - return false; - } - }, - async switchChain({ addEthereumChainParameter, chainId }) { - var _a3, _b2, _c2, _d2; - const provider = await this.getProvider(); - if (!provider) - throw new ProviderNotFoundError(); - const chain = config2.chains.find((x3) => x3.id === chainId); - if (!chain) - throw new SwitchChainError(new ChainNotConfiguredError()); - const promise = new Promise((resolve) => { - const listener = (data) => { - if ("chainId" in data && data.chainId === chainId) { - config2.emitter.off("change", listener); - resolve(); - } + this.isFetchingOptimistic = false; + }, + onError, + onFail: (failureCount, error) => { + __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "failed", failureCount, error }); + }, + onPause: () => { + __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "pause" }); + }, + onContinue: () => { + __privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "continue" }); + }, + retry: context.options.retry, + retryDelay: context.options.retryDelay, + networkMode: context.options.networkMode, + canRun: () => true + })); + return __privateGet(this, _retryer).start(); + } +}, _initialState = new WeakMap(), _revertState = new WeakMap(), _cache = new WeakMap(), _retryer = new WeakMap(), _defaultOptions = new WeakMap(), _abortSignalConsumed = new WeakMap(), _dispatch = new WeakSet(), dispatch_fn = function(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + fetchFailureCount: action.failureCount, + fetchFailureReason: action.error }; - config2.emitter.on("change", listener); - }); - try { - await Promise.all([ - provider.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId: numberToHex(chainId) }] - }).then(async () => { - const currentChainId = await this.getChainId(); - if (currentChainId === chainId) - config2.emitter.emit("change", { chainId }); - }), - promise - ]); - return chain; - } catch (err) { - const error = err; - if (Number(error.code) === 4902 || // Unwrapping for MetaMask Mobile - // https://github.com/MetaMask/metamask-mobile/issues/2944#issuecomment-976988719 - ((_b2 = (_a3 = error == null ? void 0 : error.data) == null ? void 0 : _a3.originalError) == null ? void 0 : _b2.code) === 4902) { - try { - const { default: blockExplorer, ...blockExplorers } = chain.blockExplorers ?? {}; - let blockExplorerUrls; - if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) - blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; - else if (blockExplorer) - blockExplorerUrls = [ - blockExplorer.url, - ...Object.values(blockExplorers).map((x3) => x3.url) - ]; - let rpcUrls; - if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) - rpcUrls = addEthereumChainParameter.rpcUrls; - else - rpcUrls = [((_d2 = chain.rpcUrls.default) == null ? void 0 : _d2.http[0]) ?? ""]; - const addEthereumChain = { - blockExplorerUrls, - chainId: numberToHex(chainId), - chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, - iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, - nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, - rpcUrls - }; - await Promise.all([ - provider.request({ - method: "wallet_addEthereumChain", - params: [addEthereumChain] - }).then(async () => { - const currentChainId = await this.getChainId(); - if (currentChainId === chainId) - config2.emitter.emit("change", { chainId }); - else - throw new UserRejectedRequestError( - new Error("User rejected switch after adding network.") - ); - }), - promise - ]); - return chain; - } catch (error2) { - throw new UserRejectedRequestError(error2); + case "pause": + return { + ...state, + fetchStatus: "paused" + }; + case "continue": + return { + ...state, + fetchStatus: "fetching" + }; + case "fetch": + return { + ...state, + ...fetchState(state.data, this.options), + fetchMeta: action.meta ?? null + }; + case "success": + return { + ...state, + data: action.data, + dataUpdateCount: state.dataUpdateCount + 1, + dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), + error: null, + isInvalidated: false, + status: "success", + ...!action.manual && { + fetchStatus: "idle", + fetchFailureCount: 0, + fetchFailureReason: null } + }; + case "error": + const error = action.error; + if (isCancelledError(error) && error.revert && __privateGet(this, _revertState)) { + return { ...__privateGet(this, _revertState), fetchStatus: "idle" }; } - if (error.code === UserRejectedRequestError.code) - throw new UserRejectedRequestError(error); - throw new SwitchChainError(error); - } - }, - async onAccountsChanged(accounts2) { - var _a3; - const isRecentConnector = getRecentConnectorId() === this.id; - if (this.id === "trust" && !isRecentConnector) - return; - if (accounts2.length === 0) - this.onDisconnect(); - else if (config2.emitter.listenerCount("connect")) { - const chainId = (await this.getChainId()).toString(); - this.onConnect({ chainId }); - if (shimDisconnect) - await ((_a3 = config2.storage) == null ? void 0 : _a3.removeItem(`${this.id}.disconnected`)); - } else - config2.emitter.emit("change", { - accounts: accounts2.map((x3) => getAddress$2(x3)) - }); - }, - onChainChanged(chain) { - const chainId = Number(chain); - config2.emitter.emit("change", { chainId }); - }, - async onConnect(connectInfo) { - const accounts2 = await this.getAccounts(); - if (accounts2.length === 0) - return; - const chainId = Number(connectInfo.chainId); - config2.emitter.emit("connect", { accounts: accounts2, chainId }); - const provider = await this.getProvider(); - if (provider) { - if (connect2) { - provider.removeListener("connect", connect2); - connect2 = void 0; - } - if (!accountsChanged) { - accountsChanged = this.onAccountsChanged.bind(this); - provider.on("accountsChanged", accountsChanged); - } - if (!chainChanged) { - chainChanged = this.onChainChanged.bind(this); - provider.on("chainChanged", chainChanged); - } - if (!disconnect2) { - disconnect2 = this.onDisconnect.bind(this); - provider.on("disconnect", disconnect2); - } - } - }, - async onDisconnect(error) { - const provider = await this.getProvider(); - if (error && error.code === 1013) { - if (provider && !!(await this.getAccounts()).length) - return; - } - config2.emitter.emit("disconnect"); - if (provider) { - if (chainChanged) { - provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; - } - if (disconnect2) { - provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; - } - if (!connect2) { - connect2 = this.onConnect.bind(this); - provider.on("connect", connect2); - } - } + return { + ...state, + error, + errorUpdateCount: state.errorUpdateCount + 1, + errorUpdatedAt: Date.now(), + fetchFailureCount: state.fetchFailureCount + 1, + fetchFailureReason: error, + fetchStatus: "idle", + status: "error" + }; + case "invalidate": + return { + ...state, + isInvalidated: true + }; + case "setState": + return { + ...state, + ...action.state + }; } - })); -} -const targetMap = { - coinbaseWallet: { - id: "coinbaseWallet", - name: "Coinbase Wallet", - async provider(window2) { - if (window2 == null ? void 0 : window2.coinbaseWalletExtension) - return window2.coinbaseWalletExtension; - return findProvider(window2, "isCoinbaseWallet"); + }; + this.state = reducer(this.state); + notifyManager.batch(() => { + this.observers.forEach((observer) => { + observer.onQueryUpdate(); + }); + __privateGet(this, _cache).notify({ query: this, type: "updated", action }); + }); +}, _d); +function fetchState(data, options) { + return { + fetchFailureCount: 0, + fetchFailureReason: null, + fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", + ...data === void 0 && { + error: null, + status: "pending" } - }, - metaMask: { - id: "metaMask", - name: "MetaMask", - async provider(window2) { - return findProvider(window2, (provider) => { - if (!provider.isMetaMask) - return false; - if (provider.isBraveWallet && !provider._events && !provider._state) - return false; - const flags = [ - "isApexWallet", - "isAvalanche", - "isBitKeep", - "isBlockWallet", - "isKuCoinWallet", - "isMathWallet", - "isOkxWallet", - "isOKExWallet", - "isOneInchIOSWallet", - "isOneInchAndroidWallet", - "isOpera", - "isPortal", - "isRabby", - "isTokenPocket", - "isTokenary", - "isUniswapWallet", - "isZerion" - ]; - for (const flag of flags) - if (provider[flag]) - return false; - return true; - }); - } - }, - phantom: { - id: "phantom", - name: "Phantom", - async provider(window2) { - var _a3, _b2; - if ((_a3 = window2 == null ? void 0 : window2.phantom) == null ? void 0 : _a3.ethereum) - return (_b2 = window2.phantom) == null ? void 0 : _b2.ethereum; - return findProvider(window2, "isPhantom"); - } - } -}; -function findProvider(window2, select2) { - function isProvider(provider) { - if (typeof select2 === "function") - return select2(provider); - if (typeof select2 === "string") - return provider[select2]; - return true; - } - const ethereum = window2.ethereum; - if (ethereum == null ? void 0 : ethereum.providers) - return ethereum.providers.find((provider) => isProvider(provider)); - if (ethereum && isProvider(ethereum)) - return ethereum; - return void 0; -} -function isAndroid() { - return typeof navigator !== "undefined" && /android/i.test(navigator.userAgent); -} -function isSmallIOS() { - return typeof navigator !== "undefined" && /iPhone|iPod/.test(navigator.userAgent); -} -function isLargeIOS() { - return typeof navigator !== "undefined" && (/iPad/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1); -} -function isIOS() { - return isSmallIOS() || isLargeIOS(); -} -function isMobile() { - return isAndroid() || isIOS(); -} -function isPC() { - return !isMobile(); -} -function isBrowser$1() { - return !isTMA(); -} -function isTMA() { - if (typeof window === "undefined") { - return false; - } - const check = (host) => { - return typeof host !== "undefined" && "TelegramWebviewProxy" in host && "postEvent" in host.TelegramWebviewProxy && typeof host.TelegramWebviewProxy.postEvent === "function"; }; - return check(window); -} -async function sleep$2(duration = 1e3) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(null); - }, duration); - }); -} -async function openLink$1(uri, target = "_self") { - if (!uri) - return; - const finalTarget = isTMA() ? "_blank" : target; - window.open(uri, finalTarget, "noopener noreferrer"); } -function trustWallet(props = {}) { - const { connectorOptions, ...restProps } = props; +function getDefaultState$1(options) { + const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; + const hasData = data !== void 0; + const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; return { - ...trustWalletConfig, - id: "trust", - walletType: "evm", - showQRCode: false, - platforms: ["tg-android", "tg-ios", "tg-pc", "browser-android", "browser-ios", "browser-pc"], - isInstalled() { - return !!getProvider$1(); - }, - getDeepLink() { - const encodedUrl = encodeURIComponent(window.location.href); - return `https://link.trustwallet.com/open_url?coin_id=60&url=${encodedUrl}`; - }, - getUri(uri) { - let encodedUri = encodeURIComponent(uri); - if (isTMA() && isAndroid()) { - encodedUri = encodeURIComponent(encodedUri); - } - return `https://link.trustwallet.com/wc?uri=${encodedUri}`; - }, - getCreateConnectorFn() { - let isReady = false; - return injected({ - shimDisconnect: true, - target: { - id: trustWallet().id, - name: trustWallet().name, - async provider() { - if (!isReady) { - await sleep$2(); - } - isReady = true; - return getProvider$1(); - } - }, - ...connectorOptions - }); - }, - ...restProps + data, + dataUpdateCount: 0, + dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, + error: null, + errorUpdateCount: 0, + errorUpdatedAt: 0, + fetchFailureCount: 0, + fetchFailureReason: null, + fetchMeta: null, + isInvalidated: false, + status: hasData ? "success" : "pending", + fetchStatus: "idle" }; } -function getProvider$1() { - var _a3; - if (typeof window === "undefined") - return; - if (!((_a3 = window == null ? void 0 : window.trustwallet) == null ? void 0 : _a3.request)) - return; - return window.trustwallet ?? window.trustWallet ?? getEvmInjectedProvider("isTrust"); -} -const WalletConnectTransparentIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", ...props, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("g", { clipPath: "url(#clip0_3705_10415)", children: /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M11.9465 14.9229C16.3942 10.581 23.605 10.581 28.0527 14.9229L28.5879 15.4454C28.8103 15.6625 28.8103 16.0145 28.5879 16.2316L26.7568 18.0191C26.6457 18.1276 26.4654 18.1276 26.3542 18.0191L25.6176 17.3C22.5149 14.271 17.4843 14.271 14.3816 17.3L13.5928 18.0701C13.4816 18.1786 13.3013 18.1786 13.1901 18.0701L11.359 16.2826C11.1367 16.0655 11.1367 15.7135 11.359 15.4964L11.9465 14.9229ZM31.8395 18.6197L33.4691 20.2105C33.6915 20.4276 33.6915 20.7796 33.4691 20.9967L26.1209 28.1703C25.8986 28.3874 25.538 28.3874 25.3156 28.1703L20.1003 23.079C20.0447 23.0247 19.9546 23.0247 19.899 23.079L14.6838 28.1703C14.4614 28.3874 14.1008 28.3874 13.8785 28.1703L6.53007 20.9966C6.30769 20.7795 6.30769 20.4276 6.53007 20.2105L8.15972 18.6196C8.38209 18.4025 8.74264 18.4025 8.96502 18.6196L14.1804 23.7109C14.236 23.7652 14.3261 23.7652 14.3817 23.7109L19.5969 18.6196C19.8192 18.4025 20.1798 18.4025 20.4021 18.6195L25.6175 23.7109C25.6732 23.7652 25.7633 23.7652 25.8188 23.7109L31.0342 18.6197C31.2565 18.4026 31.6171 18.4026 31.8395 18.6197Z", - fill: "#3396FF" - } - ) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("clipPath", { id: "clip0_3705_10415", children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: "40", height: "40", fill: "white" }) }) }) - ] }); -}; -const WalletConnectIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 68 68", fill: "none", ...props, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: "68", height: "68", rx: "16", fill: "#3396FF" }), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M20.0995 25.2382C27.7768 17.7435 40.224 17.7435 47.9013 25.2382L48.8252 26.1402C49.209 26.5149 49.209 27.1225 48.8252 27.4972L45.6645 30.5828C45.4726 30.7702 45.1614 30.7702 44.9694 30.5828L43.6979 29.3416C38.3422 24.113 29.6586 24.113 24.3029 29.3416L22.9412 30.6708C22.7493 30.8582 22.438 30.8582 22.2461 30.6708L19.0854 27.5853C18.7016 27.2105 18.7016 26.603 19.0854 26.2282L20.0995 25.2382ZM54.4379 31.6195L57.2509 34.3655C57.6348 34.7403 57.6348 35.3478 57.2509 35.7226L44.5667 48.1054C44.1829 48.4801 43.5606 48.4801 43.1766 48.1054L34.1742 39.317C34.0782 39.2233 33.9227 39.2233 33.8267 39.317L24.8244 48.1054C24.4406 48.4801 23.8182 48.4801 23.4344 48.1054L10.7498 35.7225C10.3659 35.3477 10.3659 34.7402 10.7498 34.3654L13.5629 31.6193C13.9467 31.2446 14.5691 31.2446 14.9529 31.6193L23.9556 40.4077C24.0515 40.5015 24.207 40.5015 24.303 40.4077L33.3052 31.6193C33.689 31.2446 34.3114 31.2446 34.6952 31.6192L43.6978 40.4077C43.7939 40.5015 43.9494 40.5015 44.0453 40.4077L53.0478 31.6195C53.4316 31.2447 54.054 31.2447 54.4379 31.6195Z", - fill: "white" - } - ) - ] }); -}; -const walletConnectConfig = { - name: "WalletConnect", - logos: { - default: /* @__PURE__ */ jsxRuntimeExports.jsx(WalletConnectIcon, {}), - transparent: /* @__PURE__ */ jsxRuntimeExports.jsx(WalletConnectTransparentIcon, {}) - }, - downloadUrls: { - default: void 0 +var QueryCache = (_e2 = class extends Subscribable { + constructor(config2 = {}) { + super(); + __privateAdd(this, _queries, void 0); + this.config = config2; + __privateSet(this, _queries, /* @__PURE__ */ new Map()); } -}; -let evmGlobalData = {}; -const setEvmGlobalData = (value) => { - evmGlobalData = { - ...evmGlobalData, - ...value - }; -}; -const getEvmGlobalData = () => { - return evmGlobalData; -}; -function walletConnect(props = {}) { - const { connectorOptions, ...restProps } = props; - return { - ...walletConnectConfig, - id: "walletConnect", - walletType: "evm", - showQRCode: !(connectorOptions == null ? void 0 : connectorOptions.showQrModal), - platforms: ["tg-android", "tg-ios", "tg-pc", "browser-android", "browser-ios", "browser-pc"], - isInstalled() { - return true; - }, - getDeepLink() { - return void 0; - }, - getUri(uri) { - return uri; - }, - getCreateConnectorFn() { - const { walletConnectProjectId, metadata } = getEvmGlobalData(); - const hasAllAppData = (metadata == null ? void 0 : metadata.name) && metadata.icon && metadata.description && metadata.url; - if (!walletConnectProjectId) { - throw new Error("walletConnectProjectId is required."); - } - return walletConnect$1({ - // https://github.com/WalletConnect/walletconnect-monorepo/issues/2830 - relayUrl: "wss://relay.walletconnect.org", - projectId: walletConnectProjectId, - metadata: hasAllAppData ? { - name: metadata.name, - description: metadata.description, - url: metadata.url, - icons: [metadata.icon] - } : void 0, - qrModalOptions: { - explorerRecommendedWalletIds: [ - "8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4", - "c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96", - "4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0" - ] - }, - ...connectorOptions, - showQrModal: true - }); - }, - ...restProps - }; -} -function isWalletConnect(id2) { - return id2 === walletConnect().id; -} -const BinanceWeb3WalletTransparentIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx(BinanceWeb3WalletIcon, { width: 40, height: 40, ...props }); -}; -const BinanceWeb3WalletIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 68 68", fill: "none", ...props, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M0 18.1333C0 8.11857 8.11857 0 18.1333 0H49.8667C59.8814 0 68 8.11857 68 18.1333V49.8667C68 59.8814 59.8814 68 49.8667 68H18.1333C8.11857 68 0 59.8814 0 49.8667V18.1333Z", - fill: "#0B0E11" - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M24.7562 30.201L34.0001 20.9572L43.2487 30.2059L48.6274 24.8269L34.0001 10.1992L19.3774 24.8221L24.7562 30.201ZM15.5792 28.6199L20.958 33.9987L15.5789 39.3778L10.2002 33.999L15.5792 28.6199ZM24.7562 37.7973L34.0001 47.0409L43.2485 37.7927L48.6303 43.1688L48.6274 43.1715L34.0001 57.7992L19.3772 43.1763L19.3697 43.1689L24.7562 37.7973ZM57.8002 33.9997L52.4215 39.3785L47.0427 33.9997L52.4215 28.6209L57.8002 33.9997Z", - fill: "#F0B90B" - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M39.4555 33.9965H39.458L33.9999 28.5382L28.5391 33.9991L28.5465 34.0067L33.9999 39.4601L39.4606 33.9991L39.4555 33.9965Z", - fill: "#F0B90B" - } - ) - ] }); -}; -const binanceWeb3WalletConfig = { - name: "Binance Web3 Wallet", - logos: { - default: /* @__PURE__ */ jsxRuntimeExports.jsx(BinanceWeb3WalletIcon, {}), - transparent: /* @__PURE__ */ jsxRuntimeExports.jsx(BinanceWeb3WalletTransparentIcon, {}) - }, - downloadUrls: { - default: "https://www.binance.com/en/web3wallet" - }, - spinnerColor: void 0 -}; -function binanceWeb3Wallet(props = {}) { - const { connectorOptions, ...restProps } = props; - return { - ...binanceWeb3WalletConfig, - id: "binanceWeb3Wallet", - walletType: "evm", - showQRCode: false, - platforms: ["tg-android", "tg-ios", "tg-pc", "browser-android", "browser-ios", "browser-pc"], - isInstalled() { - return true; - }, - getDeepLink() { - return void 0; - }, - getUri() { - return void 0; - }, - getCreateConnectorFn() { - const connector = m$2(); - return connector({ - ...connectorOptions + build(client2, options, state) { + const queryKey = options.queryKey; + const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); + let query = this.get(queryHash); + if (!query) { + query = new Query({ + cache: this, + queryKey, + queryHash, + options: client2.defaultQueryOptions(options), + state, + defaultOptions: client2.getQueryDefaults(queryKey) }); - }, - ...restProps - }; -} -var buffer = {}; -var base64Js = {}; -base64Js.byteLength = byteLength; -base64Js.toByteArray = toByteArray; -base64Js.fromByteArray = fromByteArray; -var lookup = []; -var revLookup = []; -var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; -var code$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -for (var i$4 = 0, len = code$1.length; i$4 < len; ++i$4) { - lookup[i$4] = code$1[i$4]; - revLookup[code$1.charCodeAt(i$4)] = i$4; -} -revLookup["-".charCodeAt(0)] = 62; -revLookup["_".charCodeAt(0)] = 63; -function getLens(b64) { - var len = b64.length; - if (len % 4 > 0) { - throw new Error("Invalid string. Length must be a multiple of 4"); + this.add(query); + } + return query; } - var validLen = b64.indexOf("="); - if (validLen === -1) - validLen = len; - var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; - return [validLen, placeHoldersLen]; -} -function byteLength(b64) { - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; -} -function _byteLength(b64, validLen, placeHoldersLen) { - return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; -} -function toByteArray(b64) { - var tmp; - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); - var curByte = 0; - var len = placeHoldersLen > 0 ? validLen - 4 : validLen; - var i3; - for (i3 = 0; i3 < len; i3 += 4) { - tmp = revLookup[b64.charCodeAt(i3)] << 18 | revLookup[b64.charCodeAt(i3 + 1)] << 12 | revLookup[b64.charCodeAt(i3 + 2)] << 6 | revLookup[b64.charCodeAt(i3 + 3)]; - arr[curByte++] = tmp >> 16 & 255; - arr[curByte++] = tmp >> 8 & 255; - arr[curByte++] = tmp & 255; + add(query) { + if (!__privateGet(this, _queries).has(query.queryHash)) { + __privateGet(this, _queries).set(query.queryHash, query); + this.notify({ + type: "added", + query + }); + } } - if (placeHoldersLen === 2) { - tmp = revLookup[b64.charCodeAt(i3)] << 2 | revLookup[b64.charCodeAt(i3 + 1)] >> 4; - arr[curByte++] = tmp & 255; + remove(query) { + const queryInMap = __privateGet(this, _queries).get(query.queryHash); + if (queryInMap) { + query.destroy(); + if (queryInMap === query) { + __privateGet(this, _queries).delete(query.queryHash); + } + this.notify({ type: "removed", query }); + } } - if (placeHoldersLen === 1) { - tmp = revLookup[b64.charCodeAt(i3)] << 10 | revLookup[b64.charCodeAt(i3 + 1)] << 4 | revLookup[b64.charCodeAt(i3 + 2)] >> 2; - arr[curByte++] = tmp >> 8 & 255; - arr[curByte++] = tmp & 255; + clear() { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + this.remove(query); + }); + }); } - return arr; -} -function tripletToBase64(num) { - return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; -} -function encodeChunk(uint8, start, end) { - var tmp; - var output2 = []; - for (var i3 = start; i3 < end; i3 += 3) { - tmp = (uint8[i3] << 16 & 16711680) + (uint8[i3 + 1] << 8 & 65280) + (uint8[i3 + 2] & 255); - output2.push(tripletToBase64(tmp)); + get(queryHash) { + return __privateGet(this, _queries).get(queryHash); } - return output2.join(""); -} -function fromByteArray(uint8) { - var tmp; - var len = uint8.length; - var extraBytes = len % 3; - var parts = []; - var maxChunkLength = 16383; - for (var i3 = 0, len2 = len - extraBytes; i3 < len2; i3 += maxChunkLength) { - parts.push(encodeChunk(uint8, i3, i3 + maxChunkLength > len2 ? len2 : i3 + maxChunkLength)); + getAll() { + return [...__privateGet(this, _queries).values()]; } - if (extraBytes === 1) { - tmp = uint8[len - 1]; - parts.push( - lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" - ); - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1]; - parts.push( - lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (query) => matchQuery(defaultedFilters, query) ); } - return parts.join(""); -} -var ieee754 = {}; -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -ieee754.read = function(buffer2, offset2, isLE2, mLen, nBytes) { - var e18, m3; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i3 = isLE2 ? nBytes - 1 : 0; - var d4 = isLE2 ? -1 : 1; - var s2 = buffer2[offset2 + i3]; - i3 += d4; - e18 = s2 & (1 << -nBits) - 1; - s2 >>= -nBits; - nBits += eLen; - for (; nBits > 0; e18 = e18 * 256 + buffer2[offset2 + i3], i3 += d4, nBits -= 8) { - } - m3 = e18 & (1 << -nBits) - 1; - e18 >>= -nBits; - nBits += mLen; - for (; nBits > 0; m3 = m3 * 256 + buffer2[offset2 + i3], i3 += d4, nBits -= 8) { - } - if (e18 === 0) { - e18 = 1 - eBias; - } else if (e18 === eMax) { - return m3 ? NaN : (s2 ? -1 : 1) * Infinity; - } else { - m3 = m3 + Math.pow(2, mLen); - e18 = e18 - eBias; + findAll(filters = {}) { + const queries = this.getAll(); + return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; } - return (s2 ? -1 : 1) * m3 * Math.pow(2, e18 - mLen); -}; -ieee754.write = function(buffer2, value, offset2, isLE2, mLen, nBytes) { - var e18, m3, c2; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt2 = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; - var i3 = isLE2 ? 0 : nBytes - 1; - var d4 = isLE2 ? 1 : -1; - var s2 = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - value = Math.abs(value); - if (isNaN(value) || value === Infinity) { - m3 = isNaN(value) ? 1 : 0; - e18 = eMax; - } else { - e18 = Math.floor(Math.log(value) / Math.LN2); - if (value * (c2 = Math.pow(2, -e18)) < 1) { - e18--; - c2 *= 2; - } - if (e18 + eBias >= 1) { - value += rt2 / c2; - } else { - value += rt2 * Math.pow(2, 1 - eBias); - } - if (value * c2 >= 2) { - e18++; - c2 /= 2; - } - if (e18 + eBias >= eMax) { - m3 = 0; - e18 = eMax; - } else if (e18 + eBias >= 1) { - m3 = (value * c2 - 1) * Math.pow(2, mLen); - e18 = e18 + eBias; - } else { - m3 = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e18 = 0; - } + notify(event) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); } - for (; mLen >= 8; buffer2[offset2 + i3] = m3 & 255, i3 += d4, m3 /= 256, mLen -= 8) { + onFocus() { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onFocus(); + }); + }); } - e18 = e18 << mLen | m3; - eLen += mLen; - for (; eLen > 0; buffer2[offset2 + i3] = e18 & 255, i3 += d4, e18 /= 256, eLen -= 8) { + onOnline() { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onOnline(); + }); + }); } - buffer2[offset2 + i3 - d4] |= s2 * 128; -}; -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -(function(exports) { - const base642 = base64Js; - const ieee754$1 = ieee754; - const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; - exports.Buffer = Buffer2; - exports.SlowBuffer = SlowBuffer; - exports.INSPECT_MAX_BYTES = 50; - const K_MAX_LENGTH = 2147483647; - exports.kMaxLength = K_MAX_LENGTH; - Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); - if (!Buffer2.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." - ); +}, _queries = new WeakMap(), _e2); +var Mutation = (_f2 = class extends Removable { + constructor(config2) { + super(); + __privateAdd(this, _dispatch2); + __privateAdd(this, _observers, void 0); + __privateAdd(this, _mutationCache, void 0); + __privateAdd(this, _retryer2, void 0); + this.mutationId = config2.mutationId; + __privateSet(this, _mutationCache, config2.mutationCache); + __privateSet(this, _observers, []); + this.state = config2.state || getDefaultState(); + this.setOptions(config2.options); + this.scheduleGc(); } - function typedArraySupport() { - try { - const arr = new Uint8Array(1); - const proto2 = { foo: function() { - return 42; - } }; - Object.setPrototypeOf(proto2, Uint8Array.prototype); - Object.setPrototypeOf(arr, proto2); - return arr.foo() === 42; - } catch (e18) { - return false; - } + setOptions(options) { + this.options = options; + this.updateGcTime(this.options.gcTime); } - Object.defineProperty(Buffer2.prototype, "parent", { - enumerable: true, - get: function() { - if (!Buffer2.isBuffer(this)) - return void 0; - return this.buffer; - } - }); - Object.defineProperty(Buffer2.prototype, "offset", { - enumerable: true, - get: function() { - if (!Buffer2.isBuffer(this)) - return void 0; - return this.byteOffset; - } - }); - function createBuffer(length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"'); + get meta() { + return this.options.meta; + } + addObserver(observer) { + if (!__privateGet(this, _observers).includes(observer)) { + __privateGet(this, _observers).push(observer); + this.clearGcTimeout(); + __privateGet(this, _mutationCache).notify({ + type: "observerAdded", + mutation: this, + observer + }); } - const buf = new Uint8Array(length); - Object.setPrototypeOf(buf, Buffer2.prototype); - return buf; } - function Buffer2(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - if (typeof encodingOrOffset === "string") { - throw new TypeError( - 'The "string" argument must be of type string. Received type number' - ); + removeObserver(observer) { + __privateSet(this, _observers, __privateGet(this, _observers).filter((x3) => x3 !== observer)); + this.scheduleGc(); + __privateGet(this, _mutationCache).notify({ + type: "observerRemoved", + mutation: this, + observer + }); + } + optionalRemove() { + if (!__privateGet(this, _observers).length) { + if (this.state.status === "pending") { + this.scheduleGc(); + } else { + __privateGet(this, _mutationCache).remove(this); } - return allocUnsafe2(arg); } - return from2(arg, encodingOrOffset, length); } - Buffer2.poolSize = 8192; - function from2(value, encodingOrOffset, length) { - if (typeof value === "string") { - return fromString2(value, encodingOrOffset); - } - if (ArrayBuffer.isView(value)) { - return fromArrayView(value); - } - if (value == null) { - throw new TypeError( - "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value - ); - } - if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { - return fromArrayBuffer(value, encodingOrOffset, length); - } - if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { - return fromArrayBuffer(value, encodingOrOffset, length); - } - if (typeof value === "number") { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number' - ); - } - const valueOf = value.valueOf && value.valueOf(); - if (valueOf != null && valueOf !== value) { - return Buffer2.from(valueOf, encodingOrOffset, length); - } - const b2 = fromObject(value); - if (b2) - return b2; - if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { - return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length); - } - throw new TypeError( - "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value - ); + continue() { + var _a3; + return ((_a3 = __privateGet(this, _retryer2)) == null ? void 0 : _a3.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before + this.execute(this.state.variables); } - Buffer2.from = function(value, encodingOrOffset, length) { - return from2(value, encodingOrOffset, length); - }; - Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); - Object.setPrototypeOf(Buffer2, Uint8Array); - function assertSize2(size2) { - if (typeof size2 !== "number") { - throw new TypeError('"size" argument must be of type number'); - } else if (size2 < 0) { - throw new RangeError('The value "' + size2 + '" is invalid for option "size"'); + async execute(variables) { + var _a3, _b2, _c2, _d2, _e3, _f3, _g2, _h3, _i2, _j2, _k2, _l2, _m2, _n3, _o3, _p2, _q2, _r3, _s3, _t2; + __privateSet(this, _retryer2, createRetryer({ + fn: () => { + if (!this.options.mutationFn) { + return Promise.reject(new Error("No mutationFn found")); + } + return this.options.mutationFn(variables); + }, + onFail: (failureCount, error) => { + __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "failed", failureCount, error }); + }, + onPause: () => { + __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "pause" }); + }, + onContinue: () => { + __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "continue" }); + }, + retry: this.options.retry ?? 0, + retryDelay: this.options.retryDelay, + networkMode: this.options.networkMode, + canRun: () => __privateGet(this, _mutationCache).canRun(this) + })); + const restored = this.state.status === "pending"; + const isPaused = !__privateGet(this, _retryer2).canStart(); + try { + if (!restored) { + __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "pending", variables, isPaused }); + await ((_b2 = (_a3 = __privateGet(this, _mutationCache).config).onMutate) == null ? void 0 : _b2.call( + _a3, + variables, + this + )); + const context = await ((_d2 = (_c2 = this.options).onMutate) == null ? void 0 : _d2.call(_c2, variables)); + if (context !== this.state.context) { + __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { + type: "pending", + context, + variables, + isPaused + }); + } + } + const data = await __privateGet(this, _retryer2).start(); + await ((_f3 = (_e3 = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _f3.call( + _e3, + data, + variables, + this.state.context, + this + )); + await ((_h3 = (_g2 = this.options).onSuccess) == null ? void 0 : _h3.call(_g2, data, variables, this.state.context)); + await ((_j2 = (_i2 = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _j2.call( + _i2, + data, + null, + this.state.variables, + this.state.context, + this + )); + await ((_l2 = (_k2 = this.options).onSettled) == null ? void 0 : _l2.call(_k2, data, null, variables, this.state.context)); + __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "success", data }); + return data; + } catch (error) { + try { + await ((_n3 = (_m2 = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _n3.call( + _m2, + error, + variables, + this.state.context, + this + )); + await ((_p2 = (_o3 = this.options).onError) == null ? void 0 : _p2.call( + _o3, + error, + variables, + this.state.context + )); + await ((_r3 = (_q2 = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _r3.call( + _q2, + void 0, + error, + this.state.variables, + this.state.context, + this + )); + await ((_t2 = (_s3 = this.options).onSettled) == null ? void 0 : _t2.call( + _s3, + void 0, + error, + variables, + this.state.context + )); + throw error; + } finally { + __privateMethod(this, _dispatch2, dispatch_fn2).call(this, { type: "error", error }); + } + } finally { + __privateGet(this, _mutationCache).runNext(this); } } - function alloc(size2, fill, encoding2) { - assertSize2(size2); - if (size2 <= 0) { - return createBuffer(size2); - } - if (fill !== void 0) { - return typeof encoding2 === "string" ? createBuffer(size2).fill(fill, encoding2) : createBuffer(size2).fill(fill); +}, _observers = new WeakMap(), _mutationCache = new WeakMap(), _retryer2 = new WeakMap(), _dispatch2 = new WeakSet(), dispatch_fn2 = function(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + failureCount: action.failureCount, + failureReason: action.error + }; + case "pause": + return { + ...state, + isPaused: true + }; + case "continue": + return { + ...state, + isPaused: false + }; + case "pending": + return { + ...state, + context: action.context, + data: void 0, + failureCount: 0, + failureReason: null, + error: null, + isPaused: action.isPaused, + status: "pending", + variables: action.variables, + submittedAt: Date.now() + }; + case "success": + return { + ...state, + data: action.data, + failureCount: 0, + failureReason: null, + error: null, + status: "success", + isPaused: false + }; + case "error": + return { + ...state, + data: void 0, + error: action.error, + failureCount: state.failureCount + 1, + failureReason: action.error, + isPaused: false, + status: "error" + }; } - return createBuffer(size2); - } - Buffer2.alloc = function(size2, fill, encoding2) { - return alloc(size2, fill, encoding2); - }; - function allocUnsafe2(size2) { - assertSize2(size2); - return createBuffer(size2 < 0 ? 0 : checked(size2) | 0); - } - Buffer2.allocUnsafe = function(size2) { - return allocUnsafe2(size2); }; - Buffer2.allocUnsafeSlow = function(size2) { - return allocUnsafe2(size2); + this.state = reducer(this.state); + notifyManager.batch(() => { + __privateGet(this, _observers).forEach((observer) => { + observer.onMutationUpdate(action); + }); + __privateGet(this, _mutationCache).notify({ + mutation: this, + type: "updated", + action + }); + }); +}, _f2); +function getDefaultState() { + return { + context: void 0, + data: void 0, + error: null, + failureCount: 0, + failureReason: null, + isPaused: false, + status: "idle", + variables: void 0, + submittedAt: 0 }; - function fromString2(string2, encoding2) { - if (typeof encoding2 !== "string" || encoding2 === "") { - encoding2 = "utf8"; - } - if (!Buffer2.isEncoding(encoding2)) { - throw new TypeError("Unknown encoding: " + encoding2); - } - const length = byteLength2(string2, encoding2) | 0; - let buf = createBuffer(length); - const actual = buf.write(string2, encoding2); - if (actual !== length) { - buf = buf.slice(0, actual); - } - return buf; - } - function fromArrayLike(array2) { - const length = array2.length < 0 ? 0 : checked(array2.length) | 0; - const buf = createBuffer(length); - for (let i3 = 0; i3 < length; i3 += 1) { - buf[i3] = array2[i3] & 255; - } - return buf; +} +var MutationCache = (_g = class extends Subscribable { + constructor(config2 = {}) { + super(); + __privateAdd(this, _mutations, void 0); + __privateAdd(this, _mutationId, void 0); + this.config = config2; + __privateSet(this, _mutations, /* @__PURE__ */ new Map()); + __privateSet(this, _mutationId, Date.now()); } - function fromArrayView(arrayView) { - if (isInstance(arrayView, Uint8Array)) { - const copy = new Uint8Array(arrayView); - return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); - } - return fromArrayLike(arrayView); + build(client2, options, state) { + const mutation = new Mutation({ + mutationCache: this, + mutationId: ++__privateWrapper(this, _mutationId)._, + options: client2.defaultMutationOptions(options), + state + }); + this.add(mutation); + return mutation; } - function fromArrayBuffer(array2, byteOffset, length) { - if (byteOffset < 0 || array2.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds'); - } - if (array2.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds'); - } - let buf; - if (byteOffset === void 0 && length === void 0) { - buf = new Uint8Array(array2); - } else if (length === void 0) { - buf = new Uint8Array(array2, byteOffset); - } else { - buf = new Uint8Array(array2, byteOffset, length); - } - Object.setPrototypeOf(buf, Buffer2.prototype); - return buf; + add(mutation) { + const scope = scopeFor(mutation); + const mutations = __privateGet(this, _mutations).get(scope) ?? []; + mutations.push(mutation); + __privateGet(this, _mutations).set(scope, mutations); + this.notify({ type: "added", mutation }); } - function fromObject(obj) { - if (Buffer2.isBuffer(obj)) { - const len = checked(obj.length) | 0; - const buf = createBuffer(len); - if (buf.length === 0) { - return buf; - } - obj.copy(buf, 0, 0, len); - return buf; - } - if (obj.length !== void 0) { - if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { - return createBuffer(0); + remove(mutation) { + var _a3; + const scope = scopeFor(mutation); + if (__privateGet(this, _mutations).has(scope)) { + const mutations = (_a3 = __privateGet(this, _mutations).get(scope)) == null ? void 0 : _a3.filter((x3) => x3 !== mutation); + if (mutations) { + if (mutations.length === 0) { + __privateGet(this, _mutations).delete(scope); + } else { + __privateGet(this, _mutations).set(scope, mutations); + } } - return fromArrayLike(obj); - } - if (obj.type === "Buffer" && Array.isArray(obj.data)) { - return fromArrayLike(obj.data); } + this.notify({ type: "removed", mutation }); } - function checked(length) { - if (length >= K_MAX_LENGTH) { - throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); - } - return length | 0; + canRun(mutation) { + var _a3; + const firstPendingMutation = (_a3 = __privateGet(this, _mutations).get(scopeFor(mutation))) == null ? void 0 : _a3.find((m3) => m3.state.status === "pending"); + return !firstPendingMutation || firstPendingMutation === mutation; } - function SlowBuffer(length) { - if (+length != length) { - length = 0; - } - return Buffer2.alloc(+length); + runNext(mutation) { + var _a3; + const foundMutation = (_a3 = __privateGet(this, _mutations).get(scopeFor(mutation))) == null ? void 0 : _a3.find((m3) => m3 !== mutation && m3.state.isPaused); + return (foundMutation == null ? void 0 : foundMutation.continue()) ?? Promise.resolve(); } - Buffer2.isBuffer = function isBuffer2(b2) { - return b2 != null && b2._isBuffer === true && b2 !== Buffer2.prototype; - }; - Buffer2.compare = function compare2(a3, b2) { - if (isInstance(a3, Uint8Array)) - a3 = Buffer2.from(a3, a3.offset, a3.byteLength); - if (isInstance(b2, Uint8Array)) - b2 = Buffer2.from(b2, b2.offset, b2.byteLength); - if (!Buffer2.isBuffer(a3) || !Buffer2.isBuffer(b2)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' - ); - } - if (a3 === b2) - return 0; - let x3 = a3.length; - let y3 = b2.length; - for (let i3 = 0, len = Math.min(x3, y3); i3 < len; ++i3) { - if (a3[i3] !== b2[i3]) { - x3 = a3[i3]; - y3 = b2[i3]; - break; - } - } - if (x3 < y3) - return -1; - if (y3 < x3) - return 1; - return 0; - }; - Buffer2.isEncoding = function isEncoding(encoding2) { - switch (String(encoding2).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; - } - }; - Buffer2.concat = function concat2(list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers'); - } - if (list.length === 0) { - return Buffer2.alloc(0); - } - let i3; - if (length === void 0) { - length = 0; - for (i3 = 0; i3 < list.length; ++i3) { - length += list[i3].length; - } - } - const buffer2 = Buffer2.allocUnsafe(length); - let pos = 0; - for (i3 = 0; i3 < list.length; ++i3) { - let buf = list[i3]; - if (isInstance(buf, Uint8Array)) { - if (pos + buf.length > buffer2.length) { - if (!Buffer2.isBuffer(buf)) - buf = Buffer2.from(buf); - buf.copy(buffer2, pos); + clear() { + notifyManager.batch(() => { + this.getAll().forEach((mutation) => { + this.remove(mutation); + }); + }); + } + getAll() { + return [...__privateGet(this, _mutations).values()].flat(); + } + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (mutation) => matchMutation(defaultedFilters, mutation) + ); + } + findAll(filters = {}) { + return this.getAll().filter((mutation) => matchMutation(filters, mutation)); + } + notify(event) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); + } + resumePausedMutations() { + const pausedMutations = this.getAll().filter((x3) => x3.state.isPaused); + return notifyManager.batch( + () => Promise.all( + pausedMutations.map((mutation) => mutation.continue().catch(noop$3)) + ) + ); + } +}, _mutations = new WeakMap(), _mutationId = new WeakMap(), _g); +function scopeFor(mutation) { + var _a3; + return ((_a3 = mutation.options.scope) == null ? void 0 : _a3.id) ?? String(mutation.mutationId); +} +function infiniteQueryBehavior(pages) { + return { + onFetch: (context, query) => { + const fetchFn = async () => { + var _a3, _b2, _c2, _d2, _e3; + const options = context.options; + const direction = (_c2 = (_b2 = (_a3 = context.fetchOptions) == null ? void 0 : _a3.meta) == null ? void 0 : _b2.fetchMore) == null ? void 0 : _c2.direction; + const oldPages = ((_d2 = context.state.data) == null ? void 0 : _d2.pages) || []; + const oldPageParams = ((_e3 = context.state.data) == null ? void 0 : _e3.pageParams) || []; + const empty = { pages: [], pageParams: [] }; + let cancelled = false; + const addSignalProperty = (object) => { + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + if (context.signal.aborted) { + cancelled = true; + } else { + context.signal.addEventListener("abort", () => { + cancelled = true; + }); + } + return context.signal; + } + }); + }; + const queryFn = ensureQueryFn(context.options, context.fetchOptions); + const fetchPage = async (data, param, previous) => { + if (cancelled) { + return Promise.reject(); + } + if (param == null && data.pages.length) { + return Promise.resolve(data); + } + const queryFnContext = { + queryKey: context.queryKey, + pageParam: param, + direction: previous ? "backward" : "forward", + meta: context.options.meta + }; + addSignalProperty(queryFnContext); + const page = await queryFn( + queryFnContext + ); + const { maxPages } = context.options; + const addTo = previous ? addToStart : addToEnd; + return { + pages: addTo(data.pages, page, maxPages), + pageParams: addTo(data.pageParams, param, maxPages) + }; + }; + let result; + if (direction && oldPages.length) { + const previous = direction === "backward"; + const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; + const oldData = { + pages: oldPages, + pageParams: oldPageParams + }; + const param = pageParamFn(options, oldData); + result = await fetchPage(oldData, param, previous); } else { - Uint8Array.prototype.set.call( - buffer2, - buf, - pos + result = await fetchPage( + empty, + oldPageParams[0] ?? options.initialPageParam ); + const remainingPages = pages ?? oldPages.length; + for (let i2 = 1; i2 < remainingPages; i2++) { + const param = getNextPageParam(options, result); + if (param == null) { + break; + } + result = await fetchPage(result, param); + } } - } else if (!Buffer2.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers'); + return result; + }; + if (context.options.persister) { + context.fetchFn = () => { + var _a3, _b2; + return (_b2 = (_a3 = context.options).persister) == null ? void 0 : _b2.call( + _a3, + fetchFn, + { + queryKey: context.queryKey, + meta: context.options.meta, + signal: context.signal + }, + query + ); + }; } else { - buf.copy(buffer2, pos); + context.fetchFn = fetchFn; } - pos += buf.length; } - return buffer2; }; - function byteLength2(string2, encoding2) { - if (Buffer2.isBuffer(string2)) { - return string2.length; - } - if (ArrayBuffer.isView(string2) || isInstance(string2, ArrayBuffer)) { - return string2.byteLength; - } - if (typeof string2 !== "string") { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string2 - ); - } - const len = string2.length; - const mustMatch = arguments.length > 2 && arguments[2] === true; - if (!mustMatch && len === 0) - return 0; - let loweredCase = false; - for (; ; ) { - switch (encoding2) { - case "ascii": - case "latin1": - case "binary": - return len; - case "utf8": - case "utf-8": - return utf8ToBytes2(string2).length; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return len * 2; - case "hex": - return len >>> 1; - case "base64": - return base64ToBytes(string2).length; - default: - if (loweredCase) { - return mustMatch ? -1 : utf8ToBytes2(string2).length; - } - encoding2 = ("" + encoding2).toLowerCase(); - loweredCase = true; +} +function getNextPageParam(options, { pages, pageParams }) { + const lastIndex = pages.length - 1; + return pages.length > 0 ? options.getNextPageParam( + pages[lastIndex], + pages, + pageParams[lastIndex], + pageParams + ) : void 0; +} +function getPreviousPageParam(options, { pages, pageParams }) { + var _a3; + return pages.length > 0 ? (_a3 = options.getPreviousPageParam) == null ? void 0 : _a3.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; +} +var QueryClient = (_h2 = class { + constructor(config2 = {}) { + __privateAdd(this, _queryCache, void 0); + __privateAdd(this, _mutationCache2, void 0); + __privateAdd(this, _defaultOptions2, void 0); + __privateAdd(this, _queryDefaults, void 0); + __privateAdd(this, _mutationDefaults, void 0); + __privateAdd(this, _mountCount, void 0); + __privateAdd(this, _unsubscribeFocus, void 0); + __privateAdd(this, _unsubscribeOnline, void 0); + __privateSet(this, _queryCache, config2.queryCache || new QueryCache()); + __privateSet(this, _mutationCache2, config2.mutationCache || new MutationCache()); + __privateSet(this, _defaultOptions2, config2.defaultOptions || {}); + __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); + __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); + __privateSet(this, _mountCount, 0); + } + mount() { + __privateWrapper(this, _mountCount)._++; + if (__privateGet(this, _mountCount) !== 1) + return; + __privateSet(this, _unsubscribeFocus, focusManager.subscribe(async (focused) => { + if (focused) { + await this.resumePausedMutations(); + __privateGet(this, _queryCache).onFocus(); } - } + })); + __privateSet(this, _unsubscribeOnline, onlineManager.subscribe(async (online) => { + if (online) { + await this.resumePausedMutations(); + __privateGet(this, _queryCache).onOnline(); + } + })); } - Buffer2.byteLength = byteLength2; - function slowToString(encoding2, start, end) { - let loweredCase = false; - if (start === void 0 || start < 0) { - start = 0; - } - if (start > this.length) { - return ""; + unmount() { + var _a3, _b2; + __privateWrapper(this, _mountCount)._--; + if (__privateGet(this, _mountCount) !== 0) + return; + (_a3 = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a3.call(this); + __privateSet(this, _unsubscribeFocus, void 0); + (_b2 = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b2.call(this); + __privateSet(this, _unsubscribeOnline, void 0); + } + isFetching(filters) { + return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; + } + isMutating(filters) { + return __privateGet(this, _mutationCache2).findAll({ ...filters, status: "pending" }).length; + } + getQueryData(queryKey) { + var _a3; + const options = this.defaultQueryOptions({ queryKey }); + return (_a3 = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a3.state.data; + } + ensureQueryData(options) { + const cachedData = this.getQueryData(options.queryKey); + if (cachedData === void 0) + return this.fetchQuery(options); + else { + const defaultedOptions = this.defaultQueryOptions(options); + const query = __privateGet(this, _queryCache).build(this, defaultedOptions); + if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { + void this.prefetchQuery(defaultedOptions); + } + return Promise.resolve(cachedData); } - if (end === void 0 || end > this.length) { - end = this.length; + } + getQueriesData(filters) { + return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { + const data = state.data; + return [queryKey, data]; + }); + } + setQueryData(queryKey, updater, options) { + const defaultedOptions = this.defaultQueryOptions({ queryKey }); + const query = __privateGet(this, _queryCache).get( + defaultedOptions.queryHash + ); + const prevData = query == null ? void 0 : query.state.data; + const data = functionalUpdate(updater, prevData); + if (data === void 0) { + return void 0; } - if (end <= 0) { - return ""; + return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); + } + setQueriesData(filters, updater, options) { + return notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ + queryKey, + this.setQueryData(queryKey, updater, options) + ]) + ); + } + getQueryState(queryKey) { + var _a3; + const options = this.defaultQueryOptions({ queryKey }); + return (_a3 = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a3.state; + } + removeQueries(filters) { + const queryCache = __privateGet(this, _queryCache); + notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + queryCache.remove(query); + }); + }); + } + resetQueries(filters, options) { + const queryCache = __privateGet(this, _queryCache); + const refetchFilters = { + type: "active", + ...filters + }; + return notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + query.reset(); + }); + return this.refetchQueries(refetchFilters, options); + }); + } + cancelQueries(filters = {}, cancelOptions = {}) { + const defaultedCancelOptions = { revert: true, ...cancelOptions }; + const promises = notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) + ); + return Promise.all(promises).then(noop$3).catch(noop$3); + } + invalidateQueries(filters = {}, options = {}) { + return notifyManager.batch(() => { + __privateGet(this, _queryCache).findAll(filters).forEach((query) => { + query.invalidate(); + }); + if (filters.refetchType === "none") { + return Promise.resolve(); + } + const refetchFilters = { + ...filters, + type: filters.refetchType ?? filters.type ?? "active" + }; + return this.refetchQueries(refetchFilters, options); + }); + } + refetchQueries(filters = {}, options) { + const fetchOptions = { + ...options, + cancelRefetch: (options == null ? void 0 : options.cancelRefetch) ?? true + }; + const promises = notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled()).map((query) => { + let promise = query.fetch(void 0, fetchOptions); + if (!fetchOptions.throwOnError) { + promise = promise.catch(noop$3); + } + return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; + }) + ); + return Promise.all(promises).then(noop$3); + } + fetchQuery(options) { + const defaultedOptions = this.defaultQueryOptions(options); + if (defaultedOptions.retry === void 0) { + defaultedOptions.retry = false; } - end >>>= 0; - start >>>= 0; - if (end <= start) { - return ""; + const query = __privateGet(this, _queryCache).build(this, defaultedOptions); + return query.isStaleByTime( + resolveStaleTime(defaultedOptions.staleTime, query) + ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); + } + prefetchQuery(options) { + return this.fetchQuery(options).then(noop$3).catch(noop$3); + } + fetchInfiniteQuery(options) { + options.behavior = infiniteQueryBehavior(options.pages); + return this.fetchQuery(options); + } + prefetchInfiniteQuery(options) { + return this.fetchInfiniteQuery(options).then(noop$3).catch(noop$3); + } + resumePausedMutations() { + if (onlineManager.isOnline()) { + return __privateGet(this, _mutationCache2).resumePausedMutations(); } - if (!encoding2) - encoding2 = "utf8"; - while (true) { - switch (encoding2) { - case "hex": - return hexSlice(this, start, end); - case "utf8": - case "utf-8": - return utf8Slice(this, start, end); - case "ascii": - return asciiSlice(this, start, end); - case "latin1": - case "binary": - return latin1Slice(this, start, end); - case "base64": - return base64Slice(this, start, end); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return utf16leSlice(this, start, end); - default: - if (loweredCase) - throw new TypeError("Unknown encoding: " + encoding2); - encoding2 = (encoding2 + "").toLowerCase(); - loweredCase = true; + return Promise.resolve(); + } + getQueryCache() { + return __privateGet(this, _queryCache); + } + getMutationCache() { + return __privateGet(this, _mutationCache2); + } + getDefaultOptions() { + return __privateGet(this, _defaultOptions2); + } + setDefaultOptions(options) { + __privateSet(this, _defaultOptions2, options); + } + setQueryDefaults(queryKey, options) { + __privateGet(this, _queryDefaults).set(hashKey(queryKey), { + queryKey, + defaultOptions: options + }); + } + getQueryDefaults(queryKey) { + const defaults2 = [...__privateGet(this, _queryDefaults).values()]; + let result = {}; + defaults2.forEach((queryDefault) => { + if (partialMatchKey(queryKey, queryDefault.queryKey)) { + result = { ...result, ...queryDefault.defaultOptions }; } - } + }); + return result; } - Buffer2.prototype._isBuffer = true; - function swap(b2, n4, m3) { - const i3 = b2[n4]; - b2[n4] = b2[m3]; - b2[m3] = i3; + setMutationDefaults(mutationKey, options) { + __privateGet(this, _mutationDefaults).set(hashKey(mutationKey), { + mutationKey, + defaultOptions: options + }); } - Buffer2.prototype.swap16 = function swap16() { - const len = this.length; - if (len % 2 !== 0) { - throw new RangeError("Buffer size must be a multiple of 16-bits"); + getMutationDefaults(mutationKey) { + const defaults2 = [...__privateGet(this, _mutationDefaults).values()]; + let result = {}; + defaults2.forEach((queryDefault) => { + if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { + result = { ...result, ...queryDefault.defaultOptions }; + } + }); + return result; + } + defaultQueryOptions(options) { + if (options._defaulted) { + return options; } - for (let i3 = 0; i3 < len; i3 += 2) { - swap(this, i3, i3 + 1); + const defaultedOptions = { + ...__privateGet(this, _defaultOptions2).queries, + ...this.getQueryDefaults(options.queryKey), + ...options, + _defaulted: true + }; + if (!defaultedOptions.queryHash) { + defaultedOptions.queryHash = hashQueryKeyByOptions( + defaultedOptions.queryKey, + defaultedOptions + ); } - return this; - }; - Buffer2.prototype.swap32 = function swap32() { - const len = this.length; - if (len % 4 !== 0) { - throw new RangeError("Buffer size must be a multiple of 32-bits"); + if (defaultedOptions.refetchOnReconnect === void 0) { + defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; } - for (let i3 = 0; i3 < len; i3 += 4) { - swap(this, i3, i3 + 3); - swap(this, i3 + 1, i3 + 2); + if (defaultedOptions.throwOnError === void 0) { + defaultedOptions.throwOnError = !!defaultedOptions.suspense; } - return this; - }; - Buffer2.prototype.swap64 = function swap64() { - const len = this.length; - if (len % 8 !== 0) { - throw new RangeError("Buffer size must be a multiple of 64-bits"); + if (!defaultedOptions.networkMode && defaultedOptions.persister) { + defaultedOptions.networkMode = "offlineFirst"; } - for (let i3 = 0; i3 < len; i3 += 8) { - swap(this, i3, i3 + 7); - swap(this, i3 + 1, i3 + 6); - swap(this, i3 + 2, i3 + 5); - swap(this, i3 + 3, i3 + 4); + if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) { + defaultedOptions.enabled = false; } - return this; - }; - Buffer2.prototype.toString = function toString3() { - const length = this.length; - if (length === 0) - return ""; - if (arguments.length === 0) - return utf8Slice(this, 0, length); - return slowToString.apply(this, arguments); - }; - Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; - Buffer2.prototype.equals = function equals2(b2) { - if (!Buffer2.isBuffer(b2)) - throw new TypeError("Argument must be a Buffer"); - if (this === b2) - return true; - return Buffer2.compare(this, b2) === 0; - }; - Buffer2.prototype.inspect = function inspect6() { - let str = ""; - const max = exports.INSPECT_MAX_BYTES; - str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); - if (this.length > max) - str += " ... "; - return ""; - }; - if (customInspectSymbol) { - Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + return defaultedOptions; } - Buffer2.prototype.compare = function compare2(target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer2.from(target, target.offset, target.byteLength); - } - if (!Buffer2.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target - ); - } - if (start === void 0) { - start = 0; - } - if (end === void 0) { - end = target ? target.length : 0; - } - if (thisStart === void 0) { - thisStart = 0; - } - if (thisEnd === void 0) { - thisEnd = this.length; - } - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError("out of range index"); - } - if (thisStart >= thisEnd && start >= end) { - return 0; - } - if (thisStart >= thisEnd) { - return -1; - } - if (start >= end) { - return 1; - } - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - if (this === target) - return 0; - let x3 = thisEnd - thisStart; - let y3 = end - start; - const len = Math.min(x3, y3); - const thisCopy = this.slice(thisStart, thisEnd); - const targetCopy = target.slice(start, end); - for (let i3 = 0; i3 < len; ++i3) { - if (thisCopy[i3] !== targetCopy[i3]) { - x3 = thisCopy[i3]; - y3 = targetCopy[i3]; - break; - } - } - if (x3 < y3) - return -1; - if (y3 < x3) - return 1; - return 0; - }; - function bidirectionalIndexOf(buffer2, val, byteOffset, encoding2, dir) { - if (buffer2.length === 0) - return -1; - if (typeof byteOffset === "string") { - encoding2 = byteOffset; - byteOffset = 0; - } else if (byteOffset > 2147483647) { - byteOffset = 2147483647; - } else if (byteOffset < -2147483648) { - byteOffset = -2147483648; - } - byteOffset = +byteOffset; - if (numberIsNaN(byteOffset)) { - byteOffset = dir ? 0 : buffer2.length - 1; - } - if (byteOffset < 0) - byteOffset = buffer2.length + byteOffset; - if (byteOffset >= buffer2.length) { - if (dir) - return -1; - else - byteOffset = buffer2.length - 1; - } else if (byteOffset < 0) { - if (dir) - byteOffset = 0; - else - return -1; - } - if (typeof val === "string") { - val = Buffer2.from(val, encoding2); - } - if (Buffer2.isBuffer(val)) { - if (val.length === 0) { - return -1; - } - return arrayIndexOf(buffer2, val, byteOffset, encoding2, dir); - } else if (typeof val === "number") { - val = val & 255; - if (typeof Uint8Array.prototype.indexOf === "function") { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer2, val, byteOffset); - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset); - } - } - return arrayIndexOf(buffer2, [val], byteOffset, encoding2, dir); + defaultMutationOptions(options) { + if (options == null ? void 0 : options._defaulted) { + return options; } - throw new TypeError("val must be string, number or Buffer"); + return { + ...__privateGet(this, _defaultOptions2).mutations, + ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), + ...options, + _defaulted: true + }; } - function arrayIndexOf(arr, val, byteOffset, encoding2, dir) { - let indexSize = 1; - let arrLength = arr.length; - let valLength = val.length; - if (encoding2 !== void 0) { - encoding2 = String(encoding2).toLowerCase(); - if (encoding2 === "ucs2" || encoding2 === "ucs-2" || encoding2 === "utf16le" || encoding2 === "utf-16le") { - if (arr.length < 2 || val.length < 2) { - return -1; - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - function read(buf, i4) { - if (indexSize === 1) { - return buf[i4]; - } else { - return buf.readUInt16BE(i4 * indexSize); - } - } - let i3; - if (dir) { - let foundIndex = -1; - for (i3 = byteOffset; i3 < arrLength; i3++) { - if (read(arr, i3) === read(val, foundIndex === -1 ? 0 : i3 - foundIndex)) { - if (foundIndex === -1) - foundIndex = i3; - if (i3 - foundIndex + 1 === valLength) - return foundIndex * indexSize; - } else { - if (foundIndex !== -1) - i3 -= i3 - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) - byteOffset = arrLength - valLength; - for (i3 = byteOffset; i3 >= 0; i3--) { - let found = true; - for (let j2 = 0; j2 < valLength; j2++) { - if (read(arr, i3 + j2) !== read(val, j2)) { - found = false; - break; - } - } - if (found) - return i3; - } - } - return -1; + clear() { + __privateGet(this, _queryCache).clear(); + __privateGet(this, _mutationCache2).clear(); } - Buffer2.prototype.includes = function includes2(val, byteOffset, encoding2) { - return this.indexOf(val, byteOffset, encoding2) !== -1; - }; - Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding2) { - return bidirectionalIndexOf(this, val, byteOffset, encoding2, true); - }; - Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding2) { - return bidirectionalIndexOf(this, val, byteOffset, encoding2, false); - }; - function hexWrite(buf, string2, offset2, length) { - offset2 = Number(offset2) || 0; - const remaining = buf.length - offset2; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } +}, _queryCache = new WeakMap(), _mutationCache2 = new WeakMap(), _defaultOptions2 = new WeakMap(), _queryDefaults = new WeakMap(), _mutationDefaults = new WeakMap(), _mountCount = new WeakMap(), _unsubscribeFocus = new WeakMap(), _unsubscribeOnline = new WeakMap(), _h2); +var MutationObserver$1 = (_i = class extends Subscribable { + constructor(client2, options) { + super(); + __privateAdd(this, _updateResult); + __privateAdd(this, _notify); + __privateAdd(this, _client, void 0); + __privateAdd(this, _currentResult, void 0); + __privateAdd(this, _currentMutation, void 0); + __privateAdd(this, _mutateOptions, void 0); + __privateSet(this, _client, client2); + this.setOptions(options); + this.bindMethods(); + __privateMethod(this, _updateResult, updateResult_fn).call(this); + } + bindMethods() { + this.mutate = this.mutate.bind(this); + this.reset = this.reset.bind(this); + } + setOptions(options) { + var _a3; + const prevOptions = this.options; + this.options = __privateGet(this, _client).defaultMutationOptions(options); + if (!shallowEqualObjects(this.options, prevOptions)) { + __privateGet(this, _client).getMutationCache().notify({ + type: "observerOptionsUpdated", + mutation: __privateGet(this, _currentMutation), + observer: this + }); } - const strLen = string2.length; - if (length > strLen / 2) { - length = strLen / 2; + if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { + this.reset(); + } else if (((_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.state.status) === "pending") { + __privateGet(this, _currentMutation).setOptions(this.options); } - let i3; - for (i3 = 0; i3 < length; ++i3) { - const parsed = parseInt(string2.substr(i3 * 2, 2), 16); - if (numberIsNaN(parsed)) - return i3; - buf[offset2 + i3] = parsed; + } + onUnsubscribe() { + var _a3; + if (!this.hasListeners()) { + (_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.removeObserver(this); } - return i3; } - function utf8Write(buf, string2, offset2, length) { - return blitBuffer(utf8ToBytes2(string2, buf.length - offset2), buf, offset2, length); + onMutationUpdate(action) { + __privateMethod(this, _updateResult, updateResult_fn).call(this); + __privateMethod(this, _notify, notify_fn).call(this, action); } - function asciiWrite(buf, string2, offset2, length) { - return blitBuffer(asciiToBytes(string2), buf, offset2, length); + getCurrentResult() { + return __privateGet(this, _currentResult); } - function base64Write(buf, string2, offset2, length) { - return blitBuffer(base64ToBytes(string2), buf, offset2, length); + reset() { + var _a3; + (_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.removeObserver(this); + __privateSet(this, _currentMutation, void 0); + __privateMethod(this, _updateResult, updateResult_fn).call(this); + __privateMethod(this, _notify, notify_fn).call(this); } - function ucs2Write(buf, string2, offset2, length) { - return blitBuffer(utf16leToBytes(string2, buf.length - offset2), buf, offset2, length); + mutate(variables, options) { + var _a3; + __privateSet(this, _mutateOptions, options); + (_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.removeObserver(this); + __privateSet(this, _currentMutation, __privateGet(this, _client).getMutationCache().build(__privateGet(this, _client), this.options)); + __privateGet(this, _currentMutation).addObserver(this); + return __privateGet(this, _currentMutation).execute(variables); } - Buffer2.prototype.write = function write3(string2, offset2, length, encoding2) { - if (offset2 === void 0) { - encoding2 = "utf8"; - length = this.length; - offset2 = 0; - } else if (length === void 0 && typeof offset2 === "string") { - encoding2 = offset2; - length = this.length; - offset2 = 0; - } else if (isFinite(offset2)) { - offset2 = offset2 >>> 0; - if (isFinite(length)) { - length = length >>> 0; - if (encoding2 === void 0) - encoding2 = "utf8"; - } else { - encoding2 = length; - length = void 0; - } - } else { - throw new Error( - "Buffer.write(string, encoding, offset[, length]) is no longer supported" - ); - } - const remaining = this.length - offset2; - if (length === void 0 || length > remaining) - length = remaining; - if (string2.length > 0 && (length < 0 || offset2 < 0) || offset2 > this.length) { - throw new RangeError("Attempt to write outside buffer bounds"); - } - if (!encoding2) - encoding2 = "utf8"; - let loweredCase = false; - for (; ; ) { - switch (encoding2) { - case "hex": - return hexWrite(this, string2, offset2, length); - case "utf8": - case "utf-8": - return utf8Write(this, string2, offset2, length); - case "ascii": - case "latin1": - case "binary": - return asciiWrite(this, string2, offset2, length); - case "base64": - return base64Write(this, string2, offset2, length); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return ucs2Write(this, string2, offset2, length); - default: - if (loweredCase) - throw new TypeError("Unknown encoding: " + encoding2); - encoding2 = ("" + encoding2).toLowerCase(); - loweredCase = true; +}, _client = new WeakMap(), _currentResult = new WeakMap(), _currentMutation = new WeakMap(), _mutateOptions = new WeakMap(), _updateResult = new WeakSet(), updateResult_fn = function() { + var _a3; + const state = ((_a3 = __privateGet(this, _currentMutation)) == null ? void 0 : _a3.state) ?? getDefaultState(); + __privateSet(this, _currentResult, { + ...state, + isPending: state.status === "pending", + isSuccess: state.status === "success", + isError: state.status === "error", + isIdle: state.status === "idle", + mutate: this.mutate, + reset: this.reset + }); +}, _notify = new WeakSet(), notify_fn = function(action) { + notifyManager.batch(() => { + var _a3, _b2, _c2, _d2, _e3, _f3, _g2, _h3; + if (__privateGet(this, _mutateOptions) && this.hasListeners()) { + const variables = __privateGet(this, _currentResult).variables; + const context = __privateGet(this, _currentResult).context; + if ((action == null ? void 0 : action.type) === "success") { + (_b2 = (_a3 = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b2.call(_a3, action.data, variables, context); + (_d2 = (_c2 = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d2.call(_c2, action.data, null, variables, context); + } else if ((action == null ? void 0 : action.type) === "error") { + (_f3 = (_e3 = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f3.call(_e3, action.error, variables, context); + (_h3 = (_g2 = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h3.call( + _g2, + void 0, + action.error, + variables, + context + ); } } + this.listeners.forEach((listener) => { + listener(__privateGet(this, _currentResult)); + }); + }); +}, _i); +function connectMutationOptions(config2) { + return { + mutationFn(variables) { + return connect(config2, variables); + }, + mutationKey: ["connect"] }; - Buffer2.prototype.toJSON = function toJSON3() { - return { - type: "Buffer", - data: Array.prototype.slice.call(this._arr || this, 0) - }; +} +function disconnectMutationOptions(config2) { + return { + mutationFn(variables) { + return disconnect(config2, variables); + }, + mutationKey: ["disconnect"] }; - function base64Slice(buf, start, end) { - if (start === 0 && end === buf.length) { - return base642.fromByteArray(buf); - } else { - return base642.fromByteArray(buf.slice(start, end)); - } - } - function utf8Slice(buf, start, end) { - end = Math.min(buf.length, end); - const res = []; - let i3 = start; - while (i3 < end) { - const firstByte = buf[i3]; - let codePoint = null; - let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; - if (i3 + bytesPerSequence <= end) { - let secondByte, thirdByte, fourthByte, tempCodePoint; - switch (bytesPerSequence) { - case 1: - if (firstByte < 128) { - codePoint = firstByte; - } - break; - case 2: - secondByte = buf[i3 + 1]; - if ((secondByte & 192) === 128) { - tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; - if (tempCodePoint > 127) { - codePoint = tempCodePoint; - } - } - break; - case 3: - secondByte = buf[i3 + 1]; - thirdByte = buf[i3 + 2]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; - if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { - codePoint = tempCodePoint; - } - } - break; - case 4: - secondByte = buf[i3 + 1]; - thirdByte = buf[i3 + 2]; - fourthByte = buf[i3 + 3]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; - if (tempCodePoint > 65535 && tempCodePoint < 1114112) { - codePoint = tempCodePoint; - } - } - } - } - if (codePoint === null) { - codePoint = 65533; - bytesPerSequence = 1; - } else if (codePoint > 65535) { - codePoint -= 65536; - res.push(codePoint >>> 10 & 1023 | 55296); - codePoint = 56320 | codePoint & 1023; - } - res.push(codePoint); - i3 += bytesPerSequence; - } - return decodeCodePointsArray(res); - } - const MAX_ARGUMENTS_LENGTH = 4096; - function decodeCodePointsArray(codePoints) { - const len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints); - } - let res = ""; - let i3 = 0; - while (i3 < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i3, i3 += MAX_ARGUMENTS_LENGTH) - ); - } - return res; +} +var QueryClientContext = reactExports.createContext( + void 0 +); +var useQueryClient = (queryClient2) => { + const client2 = reactExports.useContext(QueryClientContext); + if (queryClient2) { + return queryClient2; } - function asciiSlice(buf, start, end) { - let ret = ""; - end = Math.min(buf.length, end); - for (let i3 = start; i3 < end; ++i3) { - ret += String.fromCharCode(buf[i3] & 127); - } - return ret; + if (!client2) { + throw new Error("No QueryClient set, use QueryClientProvider to set one"); } - function latin1Slice(buf, start, end) { - let ret = ""; - end = Math.min(buf.length, end); - for (let i3 = start; i3 < end; ++i3) { - ret += String.fromCharCode(buf[i3]); - } - return ret; + return client2; +}; +var QueryClientProvider = ({ + client: client2, + children +}) => { + reactExports.useEffect(() => { + client2.mount(); + return () => { + client2.unmount(); + }; + }, [client2]); + return /* @__PURE__ */ jsxRuntimeExports.jsx(QueryClientContext.Provider, { value: client2, children }); +}; +function shouldThrowError(throwError2, params) { + if (typeof throwError2 === "function") { + return throwError2(...params); } - function hexSlice(buf, start, end) { - const len = buf.length; - if (!start || start < 0) - start = 0; - if (!end || end < 0 || end > len) - end = len; - let out = ""; - for (let i3 = start; i3 < end; ++i3) { - out += hexSliceLookupTable[buf[i3]]; - } - return out; + return !!throwError2; +} +function noop$2() { +} +function useMutation(options, queryClient2) { + const client2 = useQueryClient(queryClient2); + const [observer] = reactExports.useState( + () => new MutationObserver$1( + client2, + options + ) + ); + reactExports.useEffect(() => { + observer.setOptions(options); + }, [observer, options]); + const result = reactExports.useSyncExternalStore( + reactExports.useCallback( + (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), + [observer] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + const mutate = reactExports.useCallback( + (variables, mutateOptions) => { + observer.mutate(variables, mutateOptions).catch(noop$2); + }, + [observer] + ); + if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { + throw result.error; } - function utf16leSlice(buf, start, end) { - const bytes2 = buf.slice(start, end); - let res = ""; - for (let i3 = 0; i3 < bytes2.length - 1; i3 += 2) { - res += String.fromCharCode(bytes2[i3] + bytes2[i3 + 1] * 256); - } - return res; - } - Buffer2.prototype.slice = function slice(start, end) { - const len = this.length; - start = ~~start; - end = end === void 0 ? len : ~~end; - if (start < 0) { - start += len; - if (start < 0) - start = 0; - } else if (start > len) { - start = len; - } - if (end < 0) { - end += len; - if (end < 0) - end = 0; - } else if (end > len) { - end = len; - } - if (end < start) - end = start; - const newBuf = this.subarray(start, end); - Object.setPrototypeOf(newBuf, Buffer2.prototype); - return newBuf; - }; - function checkOffset(offset2, ext, length) { - if (offset2 % 1 !== 0 || offset2 < 0) - throw new RangeError("offset is not uint"); - if (offset2 + ext > length) - throw new RangeError("Trying to access beyond buffer length"); - } - Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset2, byteLength3, noAssert) { - offset2 = offset2 >>> 0; - byteLength3 = byteLength3 >>> 0; - if (!noAssert) - checkOffset(offset2, byteLength3, this.length); - let val = this[offset2]; - let mul6 = 1; - let i3 = 0; - while (++i3 < byteLength3 && (mul6 *= 256)) { - val += this[offset2 + i3] * mul6; - } - return val; - }; - Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset2, byteLength3, noAssert) { - offset2 = offset2 >>> 0; - byteLength3 = byteLength3 >>> 0; - if (!noAssert) { - checkOffset(offset2, byteLength3, this.length); - } - let val = this[offset2 + --byteLength3]; - let mul6 = 1; - while (byteLength3 > 0 && (mul6 *= 256)) { - val += this[offset2 + --byteLength3] * mul6; - } - return val; - }; - Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 1, this.length); - return this[offset2]; - }; - Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 2, this.length); - return this[offset2] | this[offset2 + 1] << 8; - }; - Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 2, this.length); - return this[offset2] << 8 | this[offset2 + 1]; - }; - Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 4, this.length); - return (this[offset2] | this[offset2 + 1] << 8 | this[offset2 + 2] << 16) + this[offset2 + 3] * 16777216; - }; - Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 4, this.length); - return this[offset2] * 16777216 + (this[offset2 + 1] << 16 | this[offset2 + 2] << 8 | this[offset2 + 3]); - }; - Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset2) { - offset2 = offset2 >>> 0; - validateNumber(offset2, "offset"); - const first = this[offset2]; - const last = this[offset2 + 7]; - if (first === void 0 || last === void 0) { - boundsError(offset2, this.length - 8); - } - const lo2 = first + this[++offset2] * 2 ** 8 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 24; - const hi2 = this[++offset2] + this[++offset2] * 2 ** 8 + this[++offset2] * 2 ** 16 + last * 2 ** 24; - return BigInt(lo2) + (BigInt(hi2) << BigInt(32)); - }); - Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset2) { - offset2 = offset2 >>> 0; - validateNumber(offset2, "offset"); - const first = this[offset2]; - const last = this[offset2 + 7]; - if (first === void 0 || last === void 0) { - boundsError(offset2, this.length - 8); - } - const hi2 = first * 2 ** 24 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 8 + this[++offset2]; - const lo2 = this[++offset2] * 2 ** 24 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 8 + last; - return (BigInt(hi2) << BigInt(32)) + BigInt(lo2); + return { ...result, mutate, mutateAsync: result.mutate }; +} +function useConnectors(parameters = {}) { + const config2 = useConfig(parameters); + return reactExports.useSyncExternalStore((onChange) => watchConnectors(config2, { onChange }), () => getConnectors(config2), () => getConnectors(config2)); +} +function useConnect(parameters = {}) { + const { mutation } = parameters; + const config2 = useConfig(parameters); + const mutationOptions = connectMutationOptions(config2); + const { mutate, mutateAsync, ...result } = useMutation({ + ...mutation, + ...mutationOptions }); - Buffer2.prototype.readIntLE = function readIntLE(offset2, byteLength3, noAssert) { - offset2 = offset2 >>> 0; - byteLength3 = byteLength3 >>> 0; - if (!noAssert) - checkOffset(offset2, byteLength3, this.length); - let val = this[offset2]; - let mul6 = 1; - let i3 = 0; - while (++i3 < byteLength3 && (mul6 *= 256)) { - val += this[offset2 + i3] * mul6; - } - mul6 *= 128; - if (val >= mul6) - val -= Math.pow(2, 8 * byteLength3); - return val; - }; - Buffer2.prototype.readIntBE = function readIntBE(offset2, byteLength3, noAssert) { - offset2 = offset2 >>> 0; - byteLength3 = byteLength3 >>> 0; - if (!noAssert) - checkOffset(offset2, byteLength3, this.length); - let i3 = byteLength3; - let mul6 = 1; - let val = this[offset2 + --i3]; - while (i3 > 0 && (mul6 *= 256)) { - val += this[offset2 + --i3] * mul6; - } - mul6 *= 128; - if (val >= mul6) - val -= Math.pow(2, 8 * byteLength3); - return val; - }; - Buffer2.prototype.readInt8 = function readInt8(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 1, this.length); - if (!(this[offset2] & 128)) - return this[offset2]; - return (255 - this[offset2] + 1) * -1; - }; - Buffer2.prototype.readInt16LE = function readInt16LE2(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 2, this.length); - const val = this[offset2] | this[offset2 + 1] << 8; - return val & 32768 ? val | 4294901760 : val; - }; - Buffer2.prototype.readInt16BE = function readInt16BE2(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 2, this.length); - const val = this[offset2 + 1] | this[offset2] << 8; - return val & 32768 ? val | 4294901760 : val; - }; - Buffer2.prototype.readInt32LE = function readInt32LE2(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 4, this.length); - return this[offset2] | this[offset2 + 1] << 8 | this[offset2 + 2] << 16 | this[offset2 + 3] << 24; - }; - Buffer2.prototype.readInt32BE = function readInt32BE2(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 4, this.length); - return this[offset2] << 24 | this[offset2 + 1] << 16 | this[offset2 + 2] << 8 | this[offset2 + 3]; + reactExports.useEffect(() => { + return config2.subscribe(({ status }) => status, (status, previousStatus) => { + if (previousStatus === "connected" && status === "disconnected") + result.reset(); + }); + }, [config2, result.reset]); + return { + ...result, + connect: mutate, + connectAsync: mutateAsync, + connectors: useConnectors({ config: config2 }) }; - Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset2) { - offset2 = offset2 >>> 0; - validateNumber(offset2, "offset"); - const first = this[offset2]; - const last = this[offset2 + 7]; - if (first === void 0 || last === void 0) { - boundsError(offset2, this.length - 8); - } - const val = this[offset2 + 4] + this[offset2 + 5] * 2 ** 8 + this[offset2 + 6] * 2 ** 16 + (last << 24); - return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset2] * 2 ** 8 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 24); - }); - Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset2) { - offset2 = offset2 >>> 0; - validateNumber(offset2, "offset"); - const first = this[offset2]; - const last = this[offset2 + 7]; - if (first === void 0 || last === void 0) { - boundsError(offset2, this.length - 8); - } - const val = (first << 24) + // Overflow - this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 8 + this[++offset2]; - return (BigInt(val) << BigInt(32)) + BigInt(this[++offset2] * 2 ** 24 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 8 + last); +} +function useConnections(parameters = {}) { + const config2 = useConfig(parameters); + return reactExports.useSyncExternalStore((onChange) => watchConnections(config2, { onChange }), () => getConnections(config2), () => getConnections(config2)); +} +function useDisconnect(parameters = {}) { + const { mutation } = parameters; + const config2 = useConfig(parameters); + const mutationOptions = disconnectMutationOptions(config2); + const { mutate, mutateAsync, ...result } = useMutation({ + ...mutation, + ...mutationOptions }); - Buffer2.prototype.readFloatLE = function readFloatLE(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 4, this.length); - return ieee754$1.read(this, offset2, true, 23, 4); - }; - Buffer2.prototype.readFloatBE = function readFloatBE(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 4, this.length); - return ieee754$1.read(this, offset2, false, 23, 4); - }; - Buffer2.prototype.readDoubleLE = function readDoubleLE(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 8, this.length); - return ieee754$1.read(this, offset2, true, 52, 8); - }; - Buffer2.prototype.readDoubleBE = function readDoubleBE(offset2, noAssert) { - offset2 = offset2 >>> 0; - if (!noAssert) - checkOffset(offset2, 8, this.length); - return ieee754$1.read(this, offset2, false, 52, 8); - }; - function checkInt(buf, value, offset2, ext, max, min) { - if (!Buffer2.isBuffer(buf)) - throw new TypeError('"buffer" argument must be a Buffer instance'); - if (value > max || value < min) - throw new RangeError('"value" argument is out of bounds'); - if (offset2 + ext > buf.length) - throw new RangeError("Index out of range"); - } - Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset2, byteLength3, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - byteLength3 = byteLength3 >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength3) - 1; - checkInt(this, value, offset2, byteLength3, maxBytes, 0); - } - let mul6 = 1; - let i3 = 0; - this[offset2] = value & 255; - while (++i3 < byteLength3 && (mul6 *= 256)) { - this[offset2 + i3] = value / mul6 & 255; - } - return offset2 + byteLength3; - }; - Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset2, byteLength3, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - byteLength3 = byteLength3 >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength3) - 1; - checkInt(this, value, offset2, byteLength3, maxBytes, 0); - } - let i3 = byteLength3 - 1; - let mul6 = 1; - this[offset2 + i3] = value & 255; - while (--i3 >= 0 && (mul6 *= 256)) { - this[offset2 + i3] = value / mul6 & 255; - } - return offset2 + byteLength3; - }; - Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 1, 255, 0); - this[offset2] = value & 255; - return offset2 + 1; - }; - Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 2, 65535, 0); - this[offset2] = value & 255; - this[offset2 + 1] = value >>> 8; - return offset2 + 2; - }; - Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 2, 65535, 0); - this[offset2] = value >>> 8; - this[offset2 + 1] = value & 255; - return offset2 + 2; - }; - Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 4, 4294967295, 0); - this[offset2 + 3] = value >>> 24; - this[offset2 + 2] = value >>> 16; - this[offset2 + 1] = value >>> 8; - this[offset2] = value & 255; - return offset2 + 4; - }; - Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 4, 4294967295, 0); - this[offset2] = value >>> 24; - this[offset2 + 1] = value >>> 16; - this[offset2 + 2] = value >>> 8; - this[offset2 + 3] = value & 255; - return offset2 + 4; + return { + ...result, + connectors: useConnections({ config: config2 }).map((connection) => connection.connector), + disconnect: mutate, + disconnectAsync: mutateAsync }; - function wrtBigUInt64LE(buf, value, offset2, min, max) { - checkIntBI(value, min, max, buf, offset2, 7); - let lo2 = Number(value & BigInt(4294967295)); - buf[offset2++] = lo2; - lo2 = lo2 >> 8; - buf[offset2++] = lo2; - lo2 = lo2 >> 8; - buf[offset2++] = lo2; - lo2 = lo2 >> 8; - buf[offset2++] = lo2; - let hi2 = Number(value >> BigInt(32) & BigInt(4294967295)); - buf[offset2++] = hi2; - hi2 = hi2 >> 8; - buf[offset2++] = hi2; - hi2 = hi2 >> 8; - buf[offset2++] = hi2; - hi2 = hi2 >> 8; - buf[offset2++] = hi2; - return offset2; +} +function n$5(n5, e18, t2, r2, i2, c2, o2) { + try { + var s2 = n5[c2](o2); + var a3 = s2.value; + } catch (n6) { + t2(n6); + return; } - function wrtBigUInt64BE(buf, value, offset2, min, max) { - checkIntBI(value, min, max, buf, offset2, 7); - let lo2 = Number(value & BigInt(4294967295)); - buf[offset2 + 7] = lo2; - lo2 = lo2 >> 8; - buf[offset2 + 6] = lo2; - lo2 = lo2 >> 8; - buf[offset2 + 5] = lo2; - lo2 = lo2 >> 8; - buf[offset2 + 4] = lo2; - let hi2 = Number(value >> BigInt(32) & BigInt(4294967295)); - buf[offset2 + 3] = hi2; - hi2 = hi2 >> 8; - buf[offset2 + 2] = hi2; - hi2 = hi2 >> 8; - buf[offset2 + 1] = hi2; - hi2 = hi2 >> 8; - buf[offset2] = hi2; - return offset2 + 8; + if (s2.done) { + e18(a3); + } else { + Promise.resolve(a3).then(r2, i2); } - Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset2 = 0) { - return wrtBigUInt64LE(this, value, offset2, BigInt(0), BigInt("0xffffffffffffffff")); - }); - Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset2 = 0) { - return wrtBigUInt64BE(this, value, offset2, BigInt(0), BigInt("0xffffffffffffffff")); - }); - Buffer2.prototype.writeIntLE = function writeIntLE(value, offset2, byteLength3, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) { - const limit = Math.pow(2, 8 * byteLength3 - 1); - checkInt(this, value, offset2, byteLength3, limit - 1, -limit); - } - let i3 = 0; - let mul6 = 1; - let sub = 0; - this[offset2] = value & 255; - while (++i3 < byteLength3 && (mul6 *= 256)) { - if (value < 0 && sub === 0 && this[offset2 + i3 - 1] !== 0) { - sub = 1; +} +function e$1(e18) { + return function() { + var t2 = this, r2 = arguments; + return new Promise(function(i2, c2) { + var o2 = e18.apply(t2, r2); + function s2(e19) { + n$5(o2, i2, c2, s2, a3, "next", e19); } - this[offset2 + i3] = (value / mul6 >> 0) - sub & 255; - } - return offset2 + byteLength3; - }; - Buffer2.prototype.writeIntBE = function writeIntBE(value, offset2, byteLength3, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) { - const limit = Math.pow(2, 8 * byteLength3 - 1); - checkInt(this, value, offset2, byteLength3, limit - 1, -limit); - } - let i3 = byteLength3 - 1; - let mul6 = 1; - let sub = 0; - this[offset2 + i3] = value & 255; - while (--i3 >= 0 && (mul6 *= 256)) { - if (value < 0 && sub === 0 && this[offset2 + i3 + 1] !== 0) { - sub = 1; + function a3(e19) { + n$5(o2, i2, c2, s2, a3, "throw", e19); } - this[offset2 + i3] = (value / mul6 >> 0) - sub & 255; - } - return offset2 + byteLength3; - }; - Buffer2.prototype.writeInt8 = function writeInt8(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 1, 127, -128); - if (value < 0) - value = 255 + value + 1; - this[offset2] = value & 255; - return offset2 + 1; - }; - Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 2, 32767, -32768); - this[offset2] = value & 255; - this[offset2 + 1] = value >>> 8; - return offset2 + 2; - }; - Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 2, 32767, -32768); - this[offset2] = value >>> 8; - this[offset2 + 1] = value & 255; - return offset2 + 2; - }; - Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 4, 2147483647, -2147483648); - this[offset2] = value & 255; - this[offset2 + 1] = value >>> 8; - this[offset2 + 2] = value >>> 16; - this[offset2 + 3] = value >>> 24; - return offset2 + 4; - }; - Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset2, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) - checkInt(this, value, offset2, 4, 2147483647, -2147483648); - if (value < 0) - value = 4294967295 + value + 1; - this[offset2] = value >>> 24; - this[offset2 + 1] = value >>> 16; - this[offset2 + 2] = value >>> 8; - this[offset2 + 3] = value & 255; - return offset2 + 4; + s2(void 0); + }); }; - Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset2 = 0) { - return wrtBigUInt64LE(this, value, offset2, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); - }); - Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset2 = 0) { - return wrtBigUInt64BE(this, value, offset2, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); - }); - function checkIEEE754(buf, value, offset2, ext, max, min) { - if (offset2 + ext > buf.length) - throw new RangeError("Index out of range"); - if (offset2 < 0) - throw new RangeError("Index out of range"); +} +function t(n5, e18, t2) { + if (e18 in n5) { + Object.defineProperty(n5, e18, { value: t2, enumerable: true, configurable: true, writable: true }); + } else { + n5[e18] = t2; } - function writeFloat(buf, value, offset2, littleEndian, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset2, 4); + return n5; +} +function r$3(n5) { + for (var e18 = 1; e18 < arguments.length; e18++) { + var r2 = arguments[e18] != null ? arguments[e18] : {}; + var i2 = Object.keys(r2); + if (typeof Object.getOwnPropertySymbols === "function") { + i2 = i2.concat(Object.getOwnPropertySymbols(r2).filter(function(n6) { + return Object.getOwnPropertyDescriptor(r2, n6).enumerable; + })); } - ieee754$1.write(buf, value, offset2, littleEndian, 23, 4); - return offset2 + 4; + i2.forEach(function(e19) { + t(n5, e19, r2[e19]); + }); } - Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset2, noAssert) { - return writeFloat(this, value, offset2, true, noAssert); - }; - Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset2, noAssert) { - return writeFloat(this, value, offset2, false, noAssert); - }; - function writeDouble(buf, value, offset2, littleEndian, noAssert) { - value = +value; - offset2 = offset2 >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset2, 8); + return n5; +} +function i$5(n5, e18) { + var t2 = Object.keys(n5); + if (Object.getOwnPropertySymbols) { + var r2 = Object.getOwnPropertySymbols(n5); + if (e18) { + r2 = r2.filter(function(e19) { + return Object.getOwnPropertyDescriptor(n5, e19).enumerable; + }); } - ieee754$1.write(buf, value, offset2, littleEndian, 52, 8); - return offset2 + 8; + t2.push.apply(t2, r2); } - Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset2, noAssert) { - return writeDouble(this, value, offset2, true, noAssert); - }; - Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset2, noAssert) { - return writeDouble(this, value, offset2, false, noAssert); - }; - Buffer2.prototype.copy = function copy(target, targetStart, start, end) { - if (!Buffer2.isBuffer(target)) - throw new TypeError("argument should be a Buffer"); - if (!start) - start = 0; - if (!end && end !== 0) - end = this.length; - if (targetStart >= target.length) - targetStart = target.length; - if (!targetStart) - targetStart = 0; - if (end > 0 && end < start) - end = start; - if (end === start) - return 0; - if (target.length === 0 || this.length === 0) - return 0; - if (targetStart < 0) { - throw new RangeError("targetStart out of bounds"); - } - if (start < 0 || start >= this.length) - throw new RangeError("Index out of range"); - if (end < 0) - throw new RangeError("sourceEnd out of bounds"); - if (end > this.length) - end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - const len = end - start; - if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { - this.copyWithin(targetStart, start, end); - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart - ); - } - return len; - }; - Buffer2.prototype.fill = function fill(val, start, end, encoding2) { - if (typeof val === "string") { - if (typeof start === "string") { - encoding2 = start; - start = 0; - end = this.length; - } else if (typeof end === "string") { - encoding2 = end; - end = this.length; - } - if (encoding2 !== void 0 && typeof encoding2 !== "string") { - throw new TypeError("encoding must be a string"); - } - if (typeof encoding2 === "string" && !Buffer2.isEncoding(encoding2)) { - throw new TypeError("Unknown encoding: " + encoding2); - } - if (val.length === 1) { - const code2 = val.charCodeAt(0); - if (encoding2 === "utf8" && code2 < 128 || encoding2 === "latin1") { - val = code2; - } - } - } else if (typeof val === "number") { - val = val & 255; - } else if (typeof val === "boolean") { - val = Number(val); - } - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError("Out of range index"); - } - if (end <= start) { - return this; - } - start = start >>> 0; - end = end === void 0 ? this.length : end >>> 0; - if (!val) - val = 0; - let i3; - if (typeof val === "number") { - for (i3 = start; i3 < end; ++i3) { - this[i3] = val; - } - } else { - const bytes2 = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding2); - const len = bytes2.length; - if (len === 0) { - throw new TypeError('The value "' + val + '" is invalid for argument "value"'); - } - for (i3 = 0; i3 < end - start; ++i3) { - this[i3 + start] = bytes2[i3 % len]; - } - } + return t2; +} +function c$3(n5, e18) { + e18 = e18 != null ? e18 : {}; + if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(n5, Object.getOwnPropertyDescriptors(e18)); + } else { + i$5(Object(e18)).forEach(function(t2) { + Object.defineProperty(n5, t2, Object.getOwnPropertyDescriptor(e18, t2)); + }); + } + return n5; +} +function o$1(n5) { + "@swc/helpers - typeof"; + return n5 && typeof Symbol !== "undefined" && n5.constructor === Symbol ? "symbol" : typeof n5; +} +function s$1(n5, e18) { + var t2, r2, i2, c2, o2 = { label: 0, sent: function() { + if (i2[0] & 1) + throw i2[1]; + return i2[1]; + }, trys: [], ops: [] }; + return c2 = { next: s2(0), "throw": s2(1), "return": s2(2) }, typeof Symbol === "function" && (c2[Symbol.iterator] = function() { return this; - }; - const errors = {}; - function E2(sym, getMessage, Base2) { - errors[sym] = class NodeError extends Base2 { - constructor() { - super(); - Object.defineProperty(this, "message", { - value: getMessage.apply(this, arguments), - writable: true, - configurable: true - }); - this.name = `${this.name} [${sym}]`; - this.stack; - delete this.name; - } - get code() { - return sym; - } - set code(value) { - Object.defineProperty(this, "code", { - configurable: true, - enumerable: true, - value, - writable: true - }); - } - toString() { - return `${this.name} [${sym}]: ${this.message}`; - } + }), c2; + function s2(n6) { + return function(e19) { + return a3([n6, e19]); }; } - E2( - "ERR_BUFFER_OUT_OF_BOUNDS", - function(name2) { - if (name2) { - return `${name2} is outside of buffer bounds`; - } - return "Attempt to access memory outside buffer bounds"; - }, - RangeError - ); - E2( - "ERR_INVALID_ARG_TYPE", - function(name2, actual) { - return `The "${name2}" argument must be of type number. Received type ${typeof actual}`; - }, - TypeError - ); - E2( - "ERR_OUT_OF_RANGE", - function(str, range, input) { - let msg = `The value of "${str}" is out of range.`; - let received = input; - if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { - received = addNumericalSeparator(String(input)); - } else if (typeof input === "bigint") { - received = String(input); - if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { - received = addNumericalSeparator(received); + function a3(c3) { + if (t2) + throw new TypeError("Generator is already executing."); + while (o2) + try { + if (t2 = 1, r2 && (i2 = c3[0] & 2 ? r2["return"] : c3[0] ? r2["throw"] || ((i2 = r2["return"]) && i2.call(r2), 0) : r2.next) && !(i2 = i2.call(r2, c3[1])).done) + return i2; + if (r2 = 0, i2) + c3 = [c3[0] & 2, i2.value]; + switch (c3[0]) { + case 0: + case 1: + i2 = c3; + break; + case 4: + o2.label++; + return { value: c3[1], done: false }; + case 5: + o2.label++; + r2 = c3[1]; + c3 = [0]; + continue; + case 7: + c3 = o2.ops.pop(); + o2.trys.pop(); + continue; + default: + if (!(i2 = o2.trys, i2 = i2.length > 0 && i2[i2.length - 1]) && (c3[0] === 6 || c3[0] === 2)) { + o2 = 0; + continue; + } + if (c3[0] === 3 && (!i2 || c3[1] > i2[0] && c3[1] < i2[3])) { + o2.label = c3[1]; + break; + } + if (c3[0] === 6 && o2.label < i2[1]) { + o2.label = i2[1]; + i2 = c3; + break; + } + if (i2 && o2.label < i2[2]) { + o2.label = i2[2]; + o2.ops.push(c3); + break; + } + if (i2[2]) + o2.ops.pop(); + o2.trys.pop(); + continue; } - received += "n"; + c3 = e18.call(n5, o2); + } catch (n6) { + c3 = [6, n6]; + r2 = 0; + } finally { + t2 = i2 = 0; } - msg += ` It must be ${range}. Received ${received}`; - return msg; - }, - RangeError - ); - function addNumericalSeparator(val) { - let res = ""; - let i3 = val.length; - const start = val[0] === "-" ? 1 : 0; - for (; i3 >= start + 4; i3 -= 3) { - res = `_${val.slice(i3 - 3, i3)}${res}`; - } - return `${val.slice(0, i3)}${res}`; + if (c3[0] & 5) + throw c3[1]; + return { value: c3[0] ? c3[1] : void 0, done: true }; } - function checkBounds(buf, offset2, byteLength3) { - validateNumber(offset2, "offset"); - if (buf[offset2] === void 0 || buf[offset2 + byteLength3] === void 0) { - boundsError(offset2, buf.length - (byteLength3 + 1)); - } +} +v$4.type = "binanceWallet"; +function v$4() { + var n5 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + var i2; + return createConnector(function(a3) { + return { id: "BinanceW3WSDK", name: "Binance Web3 Wallet", type: v$4.type, setup: function n6() { + return e$1(function() { + var n7; + return s$1(this, function(e18) { + switch (e18.label) { + case 0: + return [4, this.getProvider()]; + case 1: + n7 = e18.sent(); + n7 && n7.on("connect", this.onConnect.bind(this)); + return [2]; + } + }); + }).apply(this); + }, connect: function t2() { + var t3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r2 = t3.chainId; + return e$1(function() { + var e18, t4, i3; + return s$1(this, function(c2) { + switch (c2.label) { + case 0: + r2 = r2 !== null && r2 !== void 0 ? r2 : 56; + return [4, this.getProvider({ chainId: r2 })]; + case 1: + e18 = c2.sent(); + e18.on("accountsChanged", this.onAccountsChanged.bind(this)), e18.on("chainChanged", this.onChainChanged.bind(this)), e18.on("disconnect", this.onDisconnect.bind(this)), setTimeout(function() { + return a3.emitter.emit("message", { type: "connecting" }); + }, 0), e18.setLng(n5.lng || "en"); + return [4, e18.enable()]; + case 2: + t4 = c2.sent().map(function(n6) { + return getAddress$2(n6); + }); + return [4, this.getChainId()]; + case 3: + i3 = c2.sent(); + return [2, { accounts: t4, chainId: i3 }]; + } + }); + }).apply(this); + }, disconnect: function n6() { + return e$1(function() { + var n7; + return s$1(this, function(e18) { + switch (e18.label) { + case 0: + return [4, this.getProvider()]; + case 1: + n7 = e18.sent(); + n7.disconnect(), n7.removeListener("accountsChanged", this.onAccountsChanged), n7.removeListener("chainChanged", this.onChainChanged), n7.removeListener("disconnect", this.onDisconnect); + return [2]; + } + }); + }).apply(this); + }, getAccounts: function n6() { + return e$1(function() { + return s$1(this, function(n7) { + switch (n7.label) { + case 0: + return [4, this.getProvider()]; + case 1: + return [4, n7.sent().request({ method: "eth_accounts" })]; + case 2: + return [2, n7.sent().map(function(n8) { + return getAddress$2(n8); + })]; + } + }); + }).apply(this); + }, getChainId: function n6() { + return e$1(function() { + var n7, e18, t2, r2; + return s$1(this, function(i3) { + switch (i3.label) { + case 0: + return [4, this.getProvider()]; + case 1: + e18 = i3.sent(); + if (!((n7 = e18.chainId) !== null && n7 !== void 0)) + return [3, 2]; + r2 = n7; + return [3, 4]; + case 2: + return [4, e18 === null || e18 === void 0 ? void 0 : e18.request({ method: "eth_chainId" })]; + case 3: + r2 = i3.sent(); + i3.label = 4; + case 4: + t2 = r2; + return [2, ey(t2)]; + } + }); + }).apply(this); + }, getProvider: function u2() { + var u3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, h4 = u3.chainId; + return e$1(function() { + var e18, u4, l2, f4, d4; + return s$1(this, function(s2) { + switch (s2.label) { + case 0: + if ((typeof window === "undefined" ? "undefined" : o$1(window)) > "u") + return [2]; + return [4, __vitePreload(() => import("./index-9916bcea.js"), true ? [] : void 0, import.meta.url)]; + case 1: + l2 = s2.sent().default, f4 = h4 || ((e18 = a3.chains[0]) === null || e18 === void 0 ? void 0 : e18.id), d4 = n5.infuraId ? {} : a3.chains.reduce(function(n6, e19) { + return c$3(r$3({}, n6), t({}, e19.id, e19.rpcUrls.default.http[0])); + }, {}); + return [2, (i2 = new l2(c$3(r$3({}, n5), { chainId: f4, rpc: r$3({}, d4, (u4 = this.options) === null || u4 === void 0 ? void 0 : u4.rpc) })), i2)]; + } + }); + }).apply(this); + }, isAuthorized: function n6() { + return e$1(function() { + return s$1(this, function(e18) { + switch (e18.label) { + case 0: + e18.trys.push([0, 2, , 3]); + return [4, this.getAccounts()]; + case 1: + return [2, e18.sent().length > 0]; + case 2: + e18.sent(); + return [2, false]; + case 3: + return [2]; + } + }); + }).apply(this); + }, switchChain: function n6(n6) { + var t2 = n6.chainId; + return e$1(function() { + var n7, e18, r2, i3, c2; + return s$1(this, function(o2) { + switch (o2.label) { + case 0: + n7 = a3.chains.find(function(n8) { + return n8.id === t2; + }); + if (!n7) + throw new SwitchChainError(new ChainNotConfiguredError()); + return [4, this.getProvider()]; + case 1: + e18 = o2.sent(), r2 = numberToHex(n7.id); + o2.label = 2; + case 2: + o2.trys.push([2, 4, , 5]); + return [4, Promise.race([e18.request({ method: "wallet_switchEthereumChain", params: [{ chainId: r2 }] }), new Promise(function(n8) { + return a3.emitter.once("change", function(e19) { + var r3 = e19.chainId; + r3 === t2 && n8(t2); + }); + })])]; + case 3: + return [2, (o2.sent(), n7)]; + case 4: + i3 = o2.sent(); + c2 = typeof i3 == "string" ? i3 : i3 === null || i3 === void 0 ? void 0 : i3.message; + throw /user rejected request/i.test(c2) ? new UserRejectedRequestError(i3) : new SwitchChainError(i3); + case 5: + return [2]; + } + }); + }).apply(this); + }, onAccountsChanged: function n6(n6) { + n6.length === 0 ? a3.emitter.emit("disconnect") : a3.emitter.emit("change", { accounts: n6.map(function(n7) { + return getAddress$2(n7); + }) }); + }, onChainChanged: function n6(n6) { + var e18 = ey(n6); + a3.emitter.emit("change", { chainId: e18 }); + }, onConnect: function n6(n6) { + return e$1(function() { + var e18, t2, r2; + return s$1(this, function(i3) { + switch (i3.label) { + case 0: + return [4, this.getAccounts()]; + case 1: + e18 = i3.sent(); + if (e18.length === 0) + return [2]; + t2 = ey(n6.chainId); + a3.emitter.emit("connect", { accounts: e18, chainId: t2 }); + return [4, this.getProvider()]; + case 2: + r2 = i3.sent(); + r2 && (r2.removeListener("connect", this.onConnect.bind(this)), r2.on("accountsChanged", this.onAccountsChanged.bind(this)), r2.on("chainChanged", this.onChainChanged), r2.on("disconnect", this.onDisconnect.bind(this))); + return [2]; + } + }); + }).apply(this); + }, onDisconnect: function n6(n6) { + return e$1(function() { + var n7; + return s$1(this, function(e18) { + switch (e18.label) { + case 0: + a3.emitter.emit("disconnect"); + return [4, this.getProvider()]; + case 1: + n7 = e18.sent(); + n7.removeListener("accountsChanged", this.onAccountsChanged.bind(this)), n7.removeListener("chainChanged", this.onChainChanged), n7.removeListener("disconnect", this.onDisconnect.bind(this)), n7.on("connect", this.onConnect.bind(this)); + return [2]; + } + }); + }).apply(this); + } }; + }); +} +var m$2 = function() { + return rD() ? injected$1 : v$4; +}; +var events = { exports: {} }; +var R$1 = typeof Reflect === "object" ? Reflect : null; +var ReflectApply = R$1 && typeof R$1.apply === "function" ? R$1.apply : function ReflectApply2(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); +}; +var ReflectOwnKeys; +if (R$1 && typeof R$1.ownKeys === "function") { + ReflectOwnKeys = R$1.ownKeys; +} else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys2(target) { + return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target)); + }; +} else { + ReflectOwnKeys = function ReflectOwnKeys2(target) { + return Object.getOwnPropertyNames(target); + }; +} +function ProcessEmitWarning(warning) { + if (console && console.warn) + console.warn(warning); +} +var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) { + return value !== value; +}; +function EventEmitter$3() { + EventEmitter$3.init.call(this); +} +events.exports = EventEmitter$3; +events.exports.once = once2; +EventEmitter$3.EventEmitter = EventEmitter$3; +EventEmitter$3.prototype._events = void 0; +EventEmitter$3.prototype._eventsCount = 0; +EventEmitter$3.prototype._maxListeners = void 0; +var defaultMaxListeners = 10; +function checkListener(listener) { + if (typeof listener !== "function") { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); } - function checkIntBI(value, min, max, buf, offset2, byteLength3) { - if (value > max || value < min) { - const n4 = typeof min === "bigint" ? "n" : ""; - let range; - if (byteLength3 > 3) { - if (min === 0 || min === BigInt(0)) { - range = `>= 0${n4} and < 2${n4} ** ${(byteLength3 + 1) * 8}${n4}`; - } else { - range = `>= -(2${n4} ** ${(byteLength3 + 1) * 8 - 1}${n4}) and < 2 ** ${(byteLength3 + 1) * 8 - 1}${n4}`; - } - } else { - range = `>= ${min}${n4} and <= ${max}${n4}`; - } - throw new errors.ERR_OUT_OF_RANGE("value", range, value); +} +Object.defineProperty(EventEmitter$3, "defaultMaxListeners", { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + "."); } - checkBounds(buf, offset2, byteLength3); + defaultMaxListeners = arg; } - function validateNumber(value, name2) { - if (typeof value !== "number") { - throw new errors.ERR_INVALID_ARG_TYPE(name2, "number", value); - } +}); +EventEmitter$3.init = function() { + if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) { + this._events = /* @__PURE__ */ Object.create(null); + this._eventsCount = 0; } - function boundsError(value, length, type2) { - if (Math.floor(value) !== value) { - validateNumber(value, type2); - throw new errors.ERR_OUT_OF_RANGE(type2 || "offset", "an integer", value); - } - if (length < 0) { - throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); - } - throw new errors.ERR_OUT_OF_RANGE( - type2 || "offset", - `>= ${type2 ? 1 : 0} and <= ${length}`, - value - ); + this._maxListeners = this._maxListeners || void 0; +}; +EventEmitter$3.prototype.setMaxListeners = function setMaxListeners(n5) { + if (typeof n5 !== "number" || n5 < 0 || NumberIsNaN(n5)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n5 + "."); } - const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; - function base64clean(str) { - str = str.split("=")[0]; - str = str.trim().replace(INVALID_BASE64_RE, ""); - if (str.length < 2) - return ""; - while (str.length % 4 !== 0) { - str = str + "="; + this._maxListeners = n5; + return this; +}; +function _getMaxListeners(that) { + if (that._maxListeners === void 0) + return EventEmitter$3.defaultMaxListeners; + return that._maxListeners; +} +EventEmitter$3.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); +}; +EventEmitter$3.prototype.emit = function emit(type2) { + var args = []; + for (var i2 = 1; i2 < arguments.length; i2++) + args.push(arguments[i2]); + var doError = type2 === "error"; + var events2 = this._events; + if (events2 !== void 0) + doError = doError && events2.error === void 0; + else if (!doError) + return false; + if (doError) { + var er2; + if (args.length > 0) + er2 = args[0]; + if (er2 instanceof Error) { + throw er2; } - return str; + var err = new Error("Unhandled error." + (er2 ? " (" + er2.message + ")" : "")); + err.context = er2; + throw err; } - function utf8ToBytes2(string2, units) { - units = units || Infinity; - let codePoint; - const length = string2.length; - let leadSurrogate = null; - const bytes2 = []; - for (let i3 = 0; i3 < length; ++i3) { - codePoint = string2.charCodeAt(i3); - if (codePoint > 55295 && codePoint < 57344) { - if (!leadSurrogate) { - if (codePoint > 56319) { - if ((units -= 3) > -1) - bytes2.push(239, 191, 189); - continue; - } else if (i3 + 1 === length) { - if ((units -= 3) > -1) - bytes2.push(239, 191, 189); - continue; - } - leadSurrogate = codePoint; - continue; - } - if (codePoint < 56320) { - if ((units -= 3) > -1) - bytes2.push(239, 191, 189); - leadSurrogate = codePoint; - continue; - } - codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; - } else if (leadSurrogate) { - if ((units -= 3) > -1) - bytes2.push(239, 191, 189); - } - leadSurrogate = null; - if (codePoint < 128) { - if ((units -= 1) < 0) - break; - bytes2.push(codePoint); - } else if (codePoint < 2048) { - if ((units -= 2) < 0) - break; - bytes2.push( - codePoint >> 6 | 192, - codePoint & 63 | 128 - ); - } else if (codePoint < 65536) { - if ((units -= 3) < 0) - break; - bytes2.push( - codePoint >> 12 | 224, - codePoint >> 6 & 63 | 128, - codePoint & 63 | 128 - ); - } else if (codePoint < 1114112) { - if ((units -= 4) < 0) - break; - bytes2.push( - codePoint >> 18 | 240, - codePoint >> 12 & 63 | 128, - codePoint >> 6 & 63 | 128, - codePoint & 63 | 128 - ); - } else { - throw new Error("Invalid code point"); - } - } - return bytes2; + var handler = events2[type2]; + if (handler === void 0) + return false; + if (typeof handler === "function") { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners3 = arrayClone(handler, len); + for (var i2 = 0; i2 < len; ++i2) + ReflectApply(listeners3[i2], this, args); } - function asciiToBytes(str) { - const byteArray = []; - for (let i3 = 0; i3 < str.length; ++i3) { - byteArray.push(str.charCodeAt(i3) & 255); + return true; +}; +function _addListener(target, type2, listener, prepend) { + var m3; + var events2; + var existing; + checkListener(listener); + events2 = target._events; + if (events2 === void 0) { + events2 = target._events = /* @__PURE__ */ Object.create(null); + target._eventsCount = 0; + } else { + if (events2.newListener !== void 0) { + target.emit( + "newListener", + type2, + listener.listener ? listener.listener : listener + ); + events2 = target._events; } - return byteArray; + existing = events2[type2]; } - function utf16leToBytes(str, units) { - let c2, hi2, lo2; - const byteArray = []; - for (let i3 = 0; i3 < str.length; ++i3) { - if ((units -= 2) < 0) - break; - c2 = str.charCodeAt(i3); - hi2 = c2 >> 8; - lo2 = c2 % 256; - byteArray.push(lo2); - byteArray.push(hi2); + if (existing === void 0) { + existing = events2[type2] = listener; + ++target._eventsCount; + } else { + if (typeof existing === "function") { + existing = events2[type2] = prepend ? [listener, existing] : [existing, listener]; + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + m3 = _getMaxListeners(target); + if (m3 > 0 && existing.length > m3 && !existing.warned) { + existing.warned = true; + var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type2) + " listeners added. Use emitter.setMaxListeners() to increase limit"); + w2.name = "MaxListenersExceededWarning"; + w2.emitter = target; + w2.type = type2; + w2.count = existing.length; + ProcessEmitWarning(w2); } - return byteArray; } - function base64ToBytes(str) { - return base642.toByteArray(base64clean(str)); + return target; +} +EventEmitter$3.prototype.addListener = function addListener(type2, listener) { + return _addListener(this, type2, listener, false); +}; +EventEmitter$3.prototype.on = EventEmitter$3.prototype.addListener; +EventEmitter$3.prototype.prependListener = function prependListener(type2, listener) { + return _addListener(this, type2, listener, true); +}; +function onceWrapper() { + 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 blitBuffer(src2, dst, offset2, length) { - let i3; - for (i3 = 0; i3 < length; ++i3) { - if (i3 + offset2 >= dst.length || i3 >= src2.length) +} +function _onceWrap(target, type2, listener) { + var state = { fired: false, wrapFn: void 0, target, type: type2, listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} +EventEmitter$3.prototype.once = function once(type2, listener) { + checkListener(listener); + this.on(type2, _onceWrap(this, type2, listener)); + return this; +}; +EventEmitter$3.prototype.prependOnceListener = function prependOnceListener(type2, listener) { + checkListener(listener); + this.prependListener(type2, _onceWrap(this, type2, listener)); + return this; +}; +EventEmitter$3.prototype.removeListener = function removeListener(type2, listener) { + var list, events2, position, i2, originalListener; + checkListener(listener); + events2 = this._events; + if (events2 === void 0) + return this; + list = events2[type2]; + if (list === void 0) + return this; + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = /* @__PURE__ */ Object.create(null); + else { + delete events2[type2]; + if (events2.removeListener) + this.emit("removeListener", type2, list.listener || listener); + } + } else if (typeof list !== "function") { + position = -1; + for (i2 = list.length - 1; i2 >= 0; i2--) { + if (list[i2] === listener || list[i2].listener === listener) { + originalListener = list[i2].listener; + position = i2; break; - dst[i3 + offset2] = src2[i3]; + } } - return i3; - } - function isInstance(obj, type2) { - return obj instanceof type2 || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type2.name; - } - function numberIsNaN(obj) { - return obj !== obj; + if (position < 0) + return this; + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + if (list.length === 1) + events2[type2] = list[0]; + if (events2.removeListener !== void 0) + this.emit("removeListener", type2, originalListener || listener); } - const hexSliceLookupTable = function() { - const alphabet2 = "0123456789abcdef"; - const table = new Array(256); - for (let i3 = 0; i3 < 16; ++i3) { - const i16 = i3 * 16; - for (let j2 = 0; j2 < 16; ++j2) { - table[i16 + j2] = alphabet2[i3] + alphabet2[j2]; - } + return this; +}; +EventEmitter$3.prototype.off = EventEmitter$3.prototype.removeListener; +EventEmitter$3.prototype.removeAllListeners = function removeAllListeners(type2) { + var listeners3, events2, i2; + events2 = this._events; + if (events2 === void 0) + return this; + if (events2.removeListener === void 0) { + if (arguments.length === 0) { + this._events = /* @__PURE__ */ Object.create(null); + this._eventsCount = 0; + } else if (events2[type2] !== void 0) { + if (--this._eventsCount === 0) + this._events = /* @__PURE__ */ Object.create(null); + else + delete events2[type2]; } - return table; - }(); - function defineBigIntMethod(fn2) { - return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn2; + return this; } - function BufferBigIntNotDefined() { - throw new Error("BigInt not supported"); + if (arguments.length === 0) { + var keys2 = Object.keys(events2); + var key2; + for (i2 = 0; i2 < keys2.length; ++i2) { + key2 = keys2[i2]; + if (key2 === "removeListener") + continue; + this.removeAllListeners(key2); + } + this.removeAllListeners("removeListener"); + this._events = /* @__PURE__ */ Object.create(null); + this._eventsCount = 0; + return this; } -})(buffer); -function number$2(n4) { - if (!Number.isSafeInteger(n4) || n4 < 0) - throw new Error(`positive integer expected, not ${n4}`); -} -function isBytes$1(a3) { - return a3 instanceof Uint8Array || a3 != null && typeof a3 === "object" && a3.constructor.name === "Uint8Array"; -} -function bytes$2(b2, ...lengths) { - if (!isBytes$1(b2)) - throw new Error("Uint8Array expected"); - if (lengths.length > 0 && !lengths.includes(b2.length)) - throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b2.length}`); -} -function hash$4(h4) { - if (typeof h4 !== "function" || typeof h4.create !== "function") - throw new Error("Hash should be wrapped by utils.wrapConstructor"); - number$2(h4.outputLen); - number$2(h4.blockLen); -} -function exists$1(instance2, checkFinished = true) { - if (instance2.destroyed) - throw new Error("Hash instance has been destroyed"); - if (checkFinished && instance2.finished) - throw new Error("Hash#digest() has already been called"); -} -function output$1(out, instance2) { - bytes$2(out); - const min = instance2.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); + listeners3 = events2[type2]; + if (typeof listeners3 === "function") { + this.removeListener(type2, listeners3); + } else if (listeners3 !== void 0) { + for (i2 = listeners3.length - 1; i2 >= 0; i2--) { + this.removeListener(type2, listeners3[i2]); + } } + return this; +}; +function _listeners(target, type2, unwrap) { + var events2 = target._events; + if (events2 === void 0) + return []; + var evlistener = events2[type2]; + if (evlistener === void 0) + return []; + if (typeof evlistener === "function") + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); } -const crypto$6 = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const createView$1 = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -const rotr$1 = (word, shift) => word << 32 - shift | word >>> shift; -new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; -function utf8ToBytes$3(str) { - if (typeof str !== "string") - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); -} -function toBytes$1(data) { - if (typeof data === "string") - data = utf8ToBytes$3(data); - bytes$2(data); - return data; -} -function concatBytes$3(...arrays) { - let sum = 0; - for (let i3 = 0; i3 < arrays.length; i3++) { - const a3 = arrays[i3]; - bytes$2(a3); - sum += a3.length; +EventEmitter$3.prototype.listeners = function listeners(type2) { + return _listeners(this, type2, true); +}; +EventEmitter$3.prototype.rawListeners = function rawListeners(type2) { + return _listeners(this, type2, false); +}; +EventEmitter$3.listenerCount = function(emitter, type2) { + if (typeof emitter.listenerCount === "function") { + return emitter.listenerCount(type2); + } else { + return listenerCount.call(emitter, type2); } - const res = new Uint8Array(sum); - for (let i3 = 0, pad3 = 0; i3 < arrays.length; i3++) { - const a3 = arrays[i3]; - res.set(a3, pad3); - pad3 += a3.length; +}; +EventEmitter$3.prototype.listenerCount = listenerCount; +function listenerCount(type2) { + var events2 = this._events; + if (events2 !== void 0) { + var evlistener = events2[type2]; + if (typeof evlistener === "function") { + return 1; + } else if (evlistener !== void 0) { + return evlistener.length; + } } - return res; + return 0; } -let Hash$1 = class Hash2 { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } +EventEmitter$3.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; }; -function wrapConstructor$1(hashCons) { - const hashC = (msg) => hashCons().update(toBytes$1(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -function randomBytes$3(bytesLength = 32) { - if (crypto$6 && typeof crypto$6.getRandomValues === "function") { - return crypto$6.getRandomValues(new Uint8Array(bytesLength)); - } - throw new Error("crypto.getRandomValues must be defined"); +function arrayClone(arr, n5) { + var copy = new Array(n5); + for (var i2 = 0; i2 < n5; ++i2) + copy[i2] = arr[i2]; + return copy; } -function setBigUint64$1(view, byteOffset, value, isLE2) { - if (typeof view.setBigUint64 === "function") - return view.setBigUint64(byteOffset, value, isLE2); - const _32n2 = BigInt(32); - const _u32_max = BigInt(4294967295); - const wh2 = Number(value >> _32n2 & _u32_max); - const wl = Number(value & _u32_max); - const h4 = isLE2 ? 4 : 0; - const l2 = isLE2 ? 0 : 4; - view.setUint32(byteOffset + h4, wh2, isLE2); - view.setUint32(byteOffset + l2, wl, isLE2); +function spliceOne(list, index2) { + for (; index2 + 1 < list.length; index2++) + list[index2] = list[index2 + 1]; + list.pop(); } -const Chi$1 = (a3, b2, c2) => a3 & b2 ^ ~a3 & c2; -const Maj$1 = (a3, b2, c2) => a3 & b2 ^ a3 & c2 ^ b2 & c2; -class HashMD extends Hash$1 { - constructor(blockLen, outputLen, padOffset, isLE2) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE2; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView$1(this.buffer); +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i2 = 0; i2 < ret.length; ++i2) { + ret[i2] = arr[i2].listener || arr[i2]; } - update(data) { - exists$1(this); - const { view, buffer: buffer2, blockLen } = this; - data = toBytes$1(data); - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - if (take === blockLen) { - const dataView = createView$1(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer2.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; + return ret; +} +function once2(emitter, name2) { + return new Promise(function(resolve, reject) { + function errorListener(err) { + emitter.removeListener(name2, resolver); + reject(err); + } + function resolver() { + if (typeof emitter.removeListener === "function") { + emitter.removeListener("error", errorListener); } + resolve([].slice.call(arguments)); } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - exists$1(this); - output$1(out, this); - this.finished = true; - const { buffer: buffer2, view, blockLen, isLE: isLE2 } = this; - let { pos } = this; - buffer2[pos++] = 128; - this.buffer.subarray(pos).fill(0); - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; + eventTargetAgnosticAddListener(emitter, name2, resolver, { once: true }); + if (name2 !== "error") { + addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); } - for (let i3 = pos; i3 < blockLen; i3++) - buffer2[i3] = 0; - setBigUint64$1(view, blockLen - 8, BigInt(this.length * 8), isLE2); - this.process(view, 0); - const oview = createView$1(out); - const len = this.outputLen; - if (len % 4) - throw new Error("_sha2: outputLen should be aligned to 32bit"); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error("_sha2: outputLen bigger than state"); - for (let i3 = 0; i3 < outLen; i3++) - oview.setUint32(4 * i3, state[i3], isLE2); - } - digest() { - const { buffer: buffer2, outputLen } = this; - this.digestInto(buffer2); - const res = buffer2.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to2) { - to2 || (to2 = new this.constructor()); - to2.set(...this.get()); - const { blockLen, buffer: buffer2, length, finished: finished2, destroyed, pos } = this; - to2.length = length; - to2.pos = pos; - to2.finished = finished2; - to2.destroyed = destroyed; - if (length % blockLen) - to2.buffer.set(buffer2); - return to2; - } -} -const U32_MASK64$1 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n$1 = /* @__PURE__ */ BigInt(32); -function fromBig$1(n4, le2 = false) { - if (le2) - return { h: Number(n4 & U32_MASK64$1), l: Number(n4 >> _32n$1 & U32_MASK64$1) }; - return { h: Number(n4 >> _32n$1 & U32_MASK64$1) | 0, l: Number(n4 & U32_MASK64$1) | 0 }; + }); } -function split$1(lst, le2 = false) { - let Ah2 = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i3 = 0; i3 < lst.length; i3++) { - const { h: h4, l: l2 } = fromBig$1(lst[i3], le2); - [Ah2[i3], Al[i3]] = [h4, l2]; +function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === "function") { + eventTargetAgnosticAddListener(emitter, "error", handler, flags); } - return [Ah2, Al]; } -const toBig$1 = (h4, l2) => BigInt(h4 >>> 0) << _32n$1 | BigInt(l2 >>> 0); -const shrSH$1 = (h4, _l2, s2) => h4 >>> s2; -const shrSL$1 = (h4, l2, s2) => h4 << 32 - s2 | l2 >>> s2; -const rotrSH$1 = (h4, l2, s2) => h4 >>> s2 | l2 << 32 - s2; -const rotrSL$1 = (h4, l2, s2) => h4 << 32 - s2 | l2 >>> s2; -const rotrBH$1 = (h4, l2, s2) => h4 << 64 - s2 | l2 >>> s2 - 32; -const rotrBL$1 = (h4, l2, s2) => h4 >>> s2 - 32 | l2 << 64 - s2; -const rotr32H$1 = (_h3, l2) => l2; -const rotr32L$1 = (h4, _l2) => h4; -const rotlSH$1 = (h4, l2, s2) => h4 << s2 | l2 >>> 32 - s2; -const rotlSL$1 = (h4, l2, s2) => l2 << s2 | h4 >>> 32 - s2; -const rotlBH$1 = (h4, l2, s2) => l2 << s2 - 32 | h4 >>> 64 - s2; -const rotlBL$1 = (h4, l2, s2) => h4 << s2 - 32 | l2 >>> 64 - s2; -function add$1(Ah2, Al, Bh2, Bl) { - const l2 = (Al >>> 0) + (Bl >>> 0); - return { h: Ah2 + Bh2 + (l2 / 2 ** 32 | 0) | 0, l: l2 | 0 }; +function eventTargetAgnosticAddListener(emitter, name2, listener, flags) { + if (typeof emitter.on === "function") { + if (flags.once) { + emitter.once(name2, listener); + } else { + emitter.on(name2, listener); + } + } else if (typeof emitter.addEventListener === "function") { + emitter.addEventListener(name2, function wrapListener(arg) { + if (flags.once) { + emitter.removeEventListener(name2, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } } -const add3L$1 = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H$1 = (low, Ah2, Bh2, Ch2) => Ah2 + Bh2 + Ch2 + (low / 2 ** 32 | 0) | 0; -const add4L$1 = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H$1 = (low, Ah2, Bh2, Ch2, Dh2) => Ah2 + Bh2 + Ch2 + Dh2 + (low / 2 ** 32 | 0) | 0; -const add5L$1 = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H$1 = (low, Ah2, Bh2, Ch2, Dh2, Eh2) => Ah2 + Bh2 + Ch2 + Dh2 + Eh2 + (low / 2 ** 32 | 0) | 0; -const u64$3 = { - fromBig: fromBig$1, - split: split$1, - toBig: toBig$1, - shrSH: shrSH$1, - shrSL: shrSL$1, - rotrSH: rotrSH$1, - rotrSL: rotrSL$1, - rotrBH: rotrBH$1, - rotrBL: rotrBL$1, - rotr32H: rotr32H$1, - rotr32L: rotr32L$1, - rotlSH: rotlSH$1, - rotlSL: rotlSL$1, - rotlBH: rotlBH$1, - rotlBL: rotlBL$1, - add: add$1, - add3L: add3L$1, - add3H: add3H$1, - add4L: add4L$1, - add4H: add4H$1, - add5H: add5H$1, - add5L: add5L$1 +var eventsExports = events.exports; +const Jg = /* @__PURE__ */ getDefaultExportFromCjs$1(eventsExports); +var __spreadArray = globalThis && globalThis.__spreadArray || function(to2, from2, pack2) { + if (pack2 || arguments.length === 2) + for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) { + if (ar2 || !(i2 in from2)) { + if (!ar2) + ar2 = Array.prototype.slice.call(from2, 0, i2); + ar2[i2] = from2[i2]; + } + } + return to2.concat(ar2 || Array.prototype.slice.call(from2)); }; -const u64$4 = u64$3; -const [SHA512_Kh$1, SHA512_Kl$1] = /* @__PURE__ */ (() => u64$4.split([ - "0x428a2f98d728ae22", - "0x7137449123ef65cd", - "0xb5c0fbcfec4d3b2f", - "0xe9b5dba58189dbbc", - "0x3956c25bf348b538", - "0x59f111f1b605d019", - "0x923f82a4af194f9b", - "0xab1c5ed5da6d8118", - "0xd807aa98a3030242", - "0x12835b0145706fbe", - "0x243185be4ee4b28c", - "0x550c7dc3d5ffb4e2", - "0x72be5d74f27b896f", - "0x80deb1fe3b1696b1", - "0x9bdc06a725c71235", - "0xc19bf174cf692694", - "0xe49b69c19ef14ad2", - "0xefbe4786384f25e3", - "0x0fc19dc68b8cd5b5", - "0x240ca1cc77ac9c65", - "0x2de92c6f592b0275", - "0x4a7484aa6ea6e483", - "0x5cb0a9dcbd41fbd4", - "0x76f988da831153b5", - "0x983e5152ee66dfab", - "0xa831c66d2db43210", - "0xb00327c898fb213f", - "0xbf597fc7beef0ee4", - "0xc6e00bf33da88fc2", - "0xd5a79147930aa725", - "0x06ca6351e003826f", - "0x142929670a0e6e70", - "0x27b70a8546d22ffc", - "0x2e1b21385c26c926", - "0x4d2c6dfc5ac42aed", - "0x53380d139d95b3df", - "0x650a73548baf63de", - "0x766a0abb3c77b2a8", - "0x81c2c92e47edaee6", - "0x92722c851482353b", - "0xa2bfe8a14cf10364", - "0xa81a664bbc423001", - "0xc24b8b70d0f89791", - "0xc76c51a30654be30", - "0xd192e819d6ef5218", - "0xd69906245565a910", - "0xf40e35855771202a", - "0x106aa07032bbd1b8", - "0x19a4c116b8d2d0c8", - "0x1e376c085141ab53", - "0x2748774cdf8eeb99", - "0x34b0bcb5e19b48a8", - "0x391c0cb3c5c95a63", - "0x4ed8aa4ae3418acb", - "0x5b9cca4f7763e373", - "0x682e6ff3d6b2b8a3", - "0x748f82ee5defb2fc", - "0x78a5636f43172f60", - "0x84c87814a1f0ab72", - "0x8cc702081a6439ec", - "0x90befffa23631e28", - "0xa4506cebde82bde9", - "0xbef9a3f7b2c67915", - "0xc67178f2e372532b", - "0xca273eceea26619c", - "0xd186b8c721c0c207", - "0xeada7dd6cde0eb1e", - "0xf57d4f7fee6ed178", - "0x06f067aa72176fba", - "0x0a637dc5a2c898a6", - "0x113f9804bef90dae", - "0x1b710b35131c471b", - "0x28db77f523047d84", - "0x32caab7b40c72493", - "0x3c9ebe0a15c9bebc", - "0x431d67c49c100d4c", - "0x4cc5d4becb3e42b6", - "0x597f299cfc657e2a", - "0x5fcb6fab3ad6faec", - "0x6c44198c4a475817" -].map((n4) => BigInt(n4))))(); -const SHA512_W_H$1 = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L$1 = /* @__PURE__ */ new Uint32Array(80); -let SHA512$1 = class SHA512 extends HashMD { - constructor() { - super(128, 64, 16, false); - this.Ah = 1779033703 | 0; - this.Al = 4089235720 | 0; - this.Bh = 3144134277 | 0; - this.Bl = 2227873595 | 0; - this.Ch = 1013904242 | 0; - this.Cl = 4271175723 | 0; - this.Dh = 2773480762 | 0; - this.Dl = 1595750129 | 0; - this.Eh = 1359893119 | 0; - this.El = 2917565137 | 0; - this.Fh = 2600822924 | 0; - this.Fl = 725511199 | 0; - this.Gh = 528734635 | 0; - this.Gl = 4215389547 | 0; - this.Hh = 1541459225 | 0; - this.Hl = 327033209 | 0; - } - // prettier-ignore - get() { - const { Ah: Ah2, Al, Bh: Bh2, Bl, Ch: Ch2, Cl, Dh: Dh2, Dl, Eh: Eh2, El, Fh: Fh2, Fl, Gh: Gh2, Gl, Hh: Hh2, Hl } = this; - return [Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl]; - } - // prettier-ignore - set(Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl) { - this.Ah = Ah2 | 0; - this.Al = Al | 0; - this.Bh = Bh2 | 0; - this.Bl = Bl | 0; - this.Ch = Ch2 | 0; - this.Cl = Cl | 0; - this.Dh = Dh2 | 0; - this.Dl = Dl | 0; - this.Eh = Eh2 | 0; - this.El = El | 0; - this.Fh = Fh2 | 0; - this.Fl = Fl | 0; - this.Gh = Gh2 | 0; - this.Gl = Gl | 0; - this.Hh = Hh2 | 0; - this.Hl = Hl | 0; - } - process(view, offset2) { - for (let i3 = 0; i3 < 16; i3++, offset2 += 4) { - SHA512_W_H$1[i3] = view.getUint32(offset2); - SHA512_W_L$1[i3] = view.getUint32(offset2 += 4); +var BrowserInfo = ( + /** @class */ + function() { + function BrowserInfo2(name2, version2, os2) { + this.name = name2; + this.version = version2; + this.os = os2; + this.type = "browser"; } - for (let i3 = 16; i3 < 80; i3++) { - const W15h = SHA512_W_H$1[i3 - 15] | 0; - const W15l = SHA512_W_L$1[i3 - 15] | 0; - const s0h = u64$4.rotrSH(W15h, W15l, 1) ^ u64$4.rotrSH(W15h, W15l, 8) ^ u64$4.shrSH(W15h, W15l, 7); - const s0l = u64$4.rotrSL(W15h, W15l, 1) ^ u64$4.rotrSL(W15h, W15l, 8) ^ u64$4.shrSL(W15h, W15l, 7); - const W2h = SHA512_W_H$1[i3 - 2] | 0; - const W2l = SHA512_W_L$1[i3 - 2] | 0; - const s1h = u64$4.rotrSH(W2h, W2l, 19) ^ u64$4.rotrBH(W2h, W2l, 61) ^ u64$4.shrSH(W2h, W2l, 6); - const s1l = u64$4.rotrSL(W2h, W2l, 19) ^ u64$4.rotrBL(W2h, W2l, 61) ^ u64$4.shrSL(W2h, W2l, 6); - const SUMl = u64$4.add4L(s0l, s1l, SHA512_W_L$1[i3 - 7], SHA512_W_L$1[i3 - 16]); - const SUMh = u64$4.add4H(SUMl, s0h, s1h, SHA512_W_H$1[i3 - 7], SHA512_W_H$1[i3 - 16]); - SHA512_W_H$1[i3] = SUMh | 0; - SHA512_W_L$1[i3] = SUMl | 0; + return BrowserInfo2; + }() +); +var NodeInfo = ( + /** @class */ + function() { + function NodeInfo2(version2) { + this.version = version2; + this.type = "node"; + this.name = "node"; + this.os = process.platform; } - let { Ah: Ah2, Al, Bh: Bh2, Bl, Ch: Ch2, Cl, Dh: Dh2, Dl, Eh: Eh2, El, Fh: Fh2, Fl, Gh: Gh2, Gl, Hh: Hh2, Hl } = this; - for (let i3 = 0; i3 < 80; i3++) { - const sigma1h = u64$4.rotrSH(Eh2, El, 14) ^ u64$4.rotrSH(Eh2, El, 18) ^ u64$4.rotrBH(Eh2, El, 41); - const sigma1l = u64$4.rotrSL(Eh2, El, 14) ^ u64$4.rotrSL(Eh2, El, 18) ^ u64$4.rotrBL(Eh2, El, 41); - const CHIh = Eh2 & Fh2 ^ ~Eh2 & Gh2; - const CHIl = El & Fl ^ ~El & Gl; - const T1ll = u64$4.add5L(Hl, sigma1l, CHIl, SHA512_Kl$1[i3], SHA512_W_L$1[i3]); - const T1h = u64$4.add5H(T1ll, Hh2, sigma1h, CHIh, SHA512_Kh$1[i3], SHA512_W_H$1[i3]); - const T1l = T1ll | 0; - const sigma0h = u64$4.rotrSH(Ah2, Al, 28) ^ u64$4.rotrBH(Ah2, Al, 34) ^ u64$4.rotrBH(Ah2, Al, 39); - const sigma0l = u64$4.rotrSL(Ah2, Al, 28) ^ u64$4.rotrBL(Ah2, Al, 34) ^ u64$4.rotrBL(Ah2, Al, 39); - const MAJh = Ah2 & Bh2 ^ Ah2 & Ch2 ^ Bh2 & Ch2; - const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; - Hh2 = Gh2 | 0; - Hl = Gl | 0; - Gh2 = Fh2 | 0; - Gl = Fl | 0; - Fh2 = Eh2 | 0; - Fl = El | 0; - ({ h: Eh2, l: El } = u64$4.add(Dh2 | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh2 = Ch2 | 0; - Dl = Cl | 0; - Ch2 = Bh2 | 0; - Cl = Bl | 0; - Bh2 = Ah2 | 0; - Bl = Al | 0; - const All = u64$4.add3L(T1l, sigma0l, MAJl); - Ah2 = u64$4.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; + return NodeInfo2; + }() +); +var SearchBotDeviceInfo = ( + /** @class */ + function() { + function SearchBotDeviceInfo2(name2, version2, os2, bot) { + this.name = name2; + this.version = version2; + this.os = os2; + this.bot = bot; + this.type = "bot-device"; } - ({ h: Ah2, l: Al } = u64$4.add(this.Ah | 0, this.Al | 0, Ah2 | 0, Al | 0)); - ({ h: Bh2, l: Bl } = u64$4.add(this.Bh | 0, this.Bl | 0, Bh2 | 0, Bl | 0)); - ({ h: Ch2, l: Cl } = u64$4.add(this.Ch | 0, this.Cl | 0, Ch2 | 0, Cl | 0)); - ({ h: Dh2, l: Dl } = u64$4.add(this.Dh | 0, this.Dl | 0, Dh2 | 0, Dl | 0)); - ({ h: Eh2, l: El } = u64$4.add(this.Eh | 0, this.El | 0, Eh2 | 0, El | 0)); - ({ h: Fh2, l: Fl } = u64$4.add(this.Fh | 0, this.Fl | 0, Fh2 | 0, Fl | 0)); - ({ h: Gh2, l: Gl } = u64$4.add(this.Gh | 0, this.Gl | 0, Gh2 | 0, Gl | 0)); - ({ h: Hh2, l: Hl } = u64$4.add(this.Hh | 0, this.Hl | 0, Hh2 | 0, Hl | 0)); - this.set(Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl); + return SearchBotDeviceInfo2; + }() +); +var BotInfo = ( + /** @class */ + function() { + function BotInfo2() { + this.type = "bot"; + this.bot = true; + this.name = "bot"; + this.version = null; + this.os = null; + } + return BotInfo2; + }() +); +var ReactNativeInfo = ( + /** @class */ + function() { + function ReactNativeInfo2() { + this.type = "react-native"; + this.name = "react-native"; + this.version = null; + this.os = null; + } + return ReactNativeInfo2; + }() +); +var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/; +var SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/; +var REQUIRED_VERSION_PARTS = 3; +var userAgentRules = [ + ["aol", /AOLShield\/([0-9\._]+)/], + ["edge", /Edge\/([0-9\._]+)/], + ["edge-ios", /EdgiOS\/([0-9\._]+)/], + ["yandexbrowser", /YaBrowser\/([0-9\._]+)/], + ["kakaotalk", /KAKAOTALK\s([0-9\.]+)/], + ["samsung", /SamsungBrowser\/([0-9\.]+)/], + ["silk", /\bSilk\/([0-9._-]+)\b/], + ["miui", /MiuiBrowser\/([0-9\.]+)$/], + ["beaker", /BeakerBrowser\/([0-9\.]+)/], + ["edge-chromium", /EdgA?\/([0-9\.]+)/], + [ + "chromium-webview", + /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/ + ], + ["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], + ["phantomjs", /PhantomJS\/([0-9\.]+)(:?\s|$)/], + ["crios", /CriOS\/([0-9\.]+)(:?\s|$)/], + ["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/], + ["fxios", /FxiOS\/([0-9\.]+)/], + ["opera-mini", /Opera Mini.*Version\/([0-9\.]+)/], + ["opera", /Opera\/([0-9\.]+)(?:\s|$)/], + ["opera", /OPR\/([0-9\.]+)(:?\s|$)/], + ["pie", /^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/], + ["pie", /^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/], + ["netfront", /^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/], + ["ie", /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], + ["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], + ["ie", /MSIE\s(7\.0)/], + ["bb10", /BB10;\sTouch.*Version\/([0-9\.]+)/], + ["android", /Android\s([0-9\.]+)/], + ["ios", /Version\/([0-9\._]+).*Mobile.*Safari.*/], + ["safari", /Version\/([0-9\._]+).*Safari/], + ["facebook", /FB[AS]V\/([0-9\.]+)/], + ["instagram", /Instagram\s([0-9\.]+)/], + ["ios-webview", /AppleWebKit\/([0-9\.]+).*Mobile/], + ["ios-webview", /AppleWebKit\/([0-9\.]+).*Gecko\)$/], + ["curl", /^curl\/([0-9\.]+)$/], + ["searchbot", SEARCHBOX_UA_REGEX] +]; +var operatingSystemRules = [ + ["iOS", /iP(hone|od|ad)/], + ["Android OS", /Android/], + ["BlackBerry OS", /BlackBerry|BB10/], + ["Windows Mobile", /IEMobile/], + ["Amazon OS", /Kindle/], + ["Windows 3.11", /Win16/], + ["Windows 95", /(Windows 95)|(Win95)|(Windows_95)/], + ["Windows 98", /(Windows 98)|(Win98)/], + ["Windows 2000", /(Windows NT 5.0)|(Windows 2000)/], + ["Windows XP", /(Windows NT 5.1)|(Windows XP)/], + ["Windows Server 2003", /(Windows NT 5.2)/], + ["Windows Vista", /(Windows NT 6.0)/], + ["Windows 7", /(Windows NT 6.1)/], + ["Windows 8", /(Windows NT 6.2)/], + ["Windows 8.1", /(Windows NT 6.3)/], + ["Windows 10", /(Windows NT 10.0)/], + ["Windows ME", /Windows ME/], + ["Windows CE", /Windows CE|WinCE|Microsoft Pocket Internet Explorer/], + ["Open BSD", /OpenBSD/], + ["Sun OS", /SunOS/], + ["Chrome OS", /CrOS/], + ["Linux", /(Linux)|(X11)/], + ["Mac OS", /(Mac_PowerPC)|(Macintosh)/], + ["QNX", /QNX/], + ["BeOS", /BeOS/], + ["OS/2", /OS\/2/] +]; +function detect(userAgent) { + if (!!userAgent) { + return parseUserAgent(userAgent); } - roundClean() { - SHA512_W_H$1.fill(0); - SHA512_W_L$1.fill(0); + if (typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative") { + return new ReactNativeInfo(); } - destroy() { - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + if (typeof navigator !== "undefined") { + return parseUserAgent(navigator.userAgent); } -}; -const sha512$2 = /* @__PURE__ */ wrapConstructor$1(() => new SHA512$1()); -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _0n$9 = /* @__PURE__ */ BigInt(0); -const _1n$c = /* @__PURE__ */ BigInt(1); -const _2n$8 = /* @__PURE__ */ BigInt(2); -function isBytes(a3) { - return a3 instanceof Uint8Array || a3 != null && typeof a3 === "object" && a3.constructor.name === "Uint8Array"; + return getNodeVersion(); } -function abytes(item) { - if (!isBytes(item)) - throw new Error("Uint8Array expected"); +function matchUserAgent(ua2) { + return ua2 !== "" && userAgentRules.reduce(function(matched, _a3) { + var browser2 = _a3[0], regex2 = _a3[1]; + if (matched) { + return matched; + } + var uaMatch = regex2.exec(ua2); + return !!uaMatch && [browser2, uaMatch]; + }, false); } -const hexes$1 = /* @__PURE__ */ Array.from({ length: 256 }, (_3, i3) => i3.toString(16).padStart(2, "0")); -function bytesToHex$1(bytes2) { - abytes(bytes2); - let hex = ""; - for (let i3 = 0; i3 < bytes2.length; i3++) { - hex += hexes$1[bytes2[i3]]; +function parseUserAgent(ua2) { + var matchedRule = matchUserAgent(ua2); + if (!matchedRule) { + return null; } - return hex; -} -function numberToHexUnpadded$1(num) { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; -} -function hexToNumber$1(hex) { - if (typeof hex !== "string") - throw new Error("hex string expected, got " + typeof hex); - return BigInt(hex === "" ? "0" : `0x${hex}`); -} -const asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 }; -function asciiToBase16(char) { - if (char >= asciis._0 && char <= asciis._9) - return char - asciis._0; - if (char >= asciis._A && char <= asciis._F) - return char - (asciis._A - 10); - if (char >= asciis._a && char <= asciis._f) - return char - (asciis._a - 10); - return; -} -function hexToBytes$1(hex) { - if (typeof hex !== "string") - throw new Error("hex string expected, got " + typeof hex); - const hl2 = hex.length; - const al2 = hl2 / 2; - if (hl2 % 2) - throw new Error("padded hex string expected, got unpadded hex of length " + hl2); - const array2 = new Uint8Array(al2); - for (let ai2 = 0, hi2 = 0; ai2 < al2; ai2++, hi2 += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi2)); - const n22 = asciiToBase16(hex.charCodeAt(hi2 + 1)); - if (n1 === void 0 || n22 === void 0) { - const char = hex[hi2] + hex[hi2 + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi2); - } - array2[ai2] = n1 * 16 + n22; + var name2 = matchedRule[0], match = matchedRule[1]; + if (name2 === "searchbot") { + return new BotInfo(); } - return array2; -} -function bytesToNumberBE$1(bytes2) { - return hexToNumber$1(bytesToHex$1(bytes2)); -} -function bytesToNumberLE$1(bytes2) { - abytes(bytes2); - return hexToNumber$1(bytesToHex$1(Uint8Array.from(bytes2).reverse())); -} -function numberToBytesBE$1(n4, len) { - return hexToBytes$1(n4.toString(16).padStart(len * 2, "0")); -} -function numberToBytesLE$1(n4, len) { - return numberToBytesBE$1(n4, len).reverse(); -} -function numberToVarBytesBE$1(n4) { - return hexToBytes$1(numberToHexUnpadded$1(n4)); -} -function ensureBytes$1(title, hex, expectedLength) { - let res; - if (typeof hex === "string") { - try { - res = hexToBytes$1(hex); - } catch (e18) { - throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e18}`); + var versionParts = match[1] && match[1].split(".").join("_").split("_").slice(0, 3); + if (versionParts) { + if (versionParts.length < REQUIRED_VERSION_PARTS) { + versionParts = __spreadArray(__spreadArray([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true); } - } else if (isBytes(hex)) { - res = Uint8Array.from(hex); } else { - throw new Error(`${title} must be hex string or Uint8Array`); + versionParts = []; } - const len = res.length; - if (typeof expectedLength === "number" && len !== expectedLength) - throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); - return res; + var version2 = versionParts.join("."); + var os2 = detectOS(ua2); + var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua2); + if (searchBotMatch && searchBotMatch[1]) { + return new SearchBotDeviceInfo(name2, version2, os2, searchBotMatch[1]); + } + return new BrowserInfo(name2, version2, os2); } -function concatBytes$2(...arrays) { - let sum = 0; - for (let i3 = 0; i3 < arrays.length; i3++) { - const a3 = arrays[i3]; - abytes(a3); - sum += a3.length; +function detectOS(ua2) { + for (var ii2 = 0, count = operatingSystemRules.length; ii2 < count; ii2++) { + var _a3 = operatingSystemRules[ii2], os2 = _a3[0], regex2 = _a3[1]; + var match = regex2.exec(ua2); + if (match) { + return os2; + } } - const res = new Uint8Array(sum); - for (let i3 = 0, pad3 = 0; i3 < arrays.length; i3++) { - const a3 = arrays[i3]; - res.set(a3, pad3); - pad3 += a3.length; + return null; +} +function getNodeVersion() { + var isNode = typeof process !== "undefined" && process.version; + return isNode ? new NodeInfo(process.version.slice(1)) : null; +} +function createVersionParts(count) { + var output2 = []; + for (var ii2 = 0; ii2 < count; ii2++) { + output2.push("0"); } - return res; + return output2; } -function equalBytes$1(a3, b2) { - if (a3.length !== b2.length) - return false; - let diff = 0; - for (let i3 = 0; i3 < a3.length; i3++) - diff |= a3[i3] ^ b2[i3]; - return diff === 0; +var cjs$3 = {}; +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +var extendStatics = function(d4, b2) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b3) { + d5.__proto__ = b3; + } || function(d5, b3) { + for (var p3 in b3) + if (b3.hasOwnProperty(p3)) + d5[p3] = b3[p3]; + }; + return extendStatics(d4, b2); +}; +function __extends(d4, b2) { + extendStatics(d4, b2); + function __() { + this.constructor = d4; + } + d4.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __()); } -function utf8ToBytes$2(str) { - if (typeof str !== "string") - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); +var __assign = function() { + __assign = Object.assign || function __assign2(t2) { + for (var s2, i2 = 1, n5 = arguments.length; i2 < n5; i2++) { + s2 = arguments[i2]; + for (var p3 in s2) + if (Object.prototype.hasOwnProperty.call(s2, p3)) + t2[p3] = s2[p3]; + } + return t2; + }; + return __assign.apply(this, arguments); +}; +function __rest$1(s2, e18) { + var t2 = {}; + for (var p3 in s2) + if (Object.prototype.hasOwnProperty.call(s2, p3) && e18.indexOf(p3) < 0) + t2[p3] = s2[p3]; + if (s2 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i2 = 0, p3 = Object.getOwnPropertySymbols(s2); i2 < p3.length; i2++) { + if (e18.indexOf(p3[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p3[i2])) + t2[p3[i2]] = s2[p3[i2]]; + } + return t2; } -function bitLen$1(n4) { - let len; - for (len = 0; n4 > _0n$9; n4 >>= _1n$c, len += 1) - ; - return len; +function __decorate$1(decorators, target, key2, desc) { + var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d4; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r2 = Reflect.decorate(decorators, target, key2, desc); + else + for (var i2 = decorators.length - 1; i2 >= 0; i2--) + if (d4 = decorators[i2]) + r2 = (c2 < 3 ? d4(r2) : c2 > 3 ? d4(target, key2, r2) : d4(target, key2)) || r2; + return c2 > 3 && r2 && Object.defineProperty(target, key2, r2), r2; } -function bitGet$1(n4, pos) { - return n4 >> BigInt(pos) & _1n$c; +function __param(paramIndex, decorator) { + return function(target, key2) { + decorator(target, key2, paramIndex); + }; } -function bitSet$1(n4, pos, value) { - return n4 | (value ? _1n$c : _0n$9) << BigInt(pos); +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); } -const bitMask$1 = (n4) => (_2n$8 << BigInt(n4 - 1)) - _1n$c; -const u8n$1 = (data) => new Uint8Array(data); -const u8fr$1 = (arr) => Uint8Array.from(arr); -function createHmacDrbg$1(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== "number" || hashLen < 2) - throw new Error("hashLen must be a number"); - if (typeof qByteLen !== "number" || qByteLen < 2) - throw new Error("qByteLen must be a number"); - if (typeof hmacFn !== "function") - throw new Error("hmacFn must be a function"); - let v6 = u8n$1(hashLen); - let k2 = u8n$1(hashLen); - let i3 = 0; - const reset = () => { - v6.fill(1); - k2.fill(0); - i3 = 0; - }; - const h4 = (...b2) => hmacFn(k2, v6, ...b2); - const reseed2 = (seed = u8n$1()) => { - k2 = h4(u8fr$1([0]), seed); - v6 = h4(); - if (seed.length === 0) - return; - k2 = h4(u8fr$1([1]), seed); - v6 = h4(); - }; - const gen2 = () => { - if (i3++ >= 1e3) - throw new Error("drbg: tried 1000 values"); - let len = 0; - const out = []; - while (len < qByteLen) { - v6 = h4(); - const sl2 = v6.slice(); - out.push(sl2); - len += v6.length; +function __awaiter$6(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve) { + resolve(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e18) { + reject(e18); + } } - return concatBytes$2(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed2(seed); - let res = void 0; - while (!(res = pred(gen2()))) - reseed2(); - reset(); - return res; - }; - return genUntil; -} -const validatorFns$1 = { - bigint: (val) => typeof val === "bigint", - function: (val) => typeof val === "function", - boolean: (val) => typeof val === "boolean", - string: (val) => typeof val === "string", - stringOrUint8Array: (val) => typeof val === "string" || isBytes(val), - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen) -}; -function validateObject$1(object, validators2, optValidators = {}) { - const checkField = (fieldName, type2, isOptional) => { - const checkVal = validatorFns$1[type2]; - if (typeof checkVal !== "function") - throw new Error(`Invalid validator "${type2}", expected function`); - const val = object[fieldName]; - if (isOptional && val === void 0) - return; - if (!checkVal(val, object)) { - throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type2}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e18) { + reject(e18); + } } - }; - for (const [fieldName, type2] of Object.entries(validators2)) - checkField(fieldName, type2, false); - for (const [fieldName, type2] of Object.entries(optValidators)) - checkField(fieldName, type2, true); - return object; -} -const ut$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - abytes, - bitGet: bitGet$1, - bitLen: bitLen$1, - bitMask: bitMask$1, - bitSet: bitSet$1, - bytesToHex: bytesToHex$1, - bytesToNumberBE: bytesToNumberBE$1, - bytesToNumberLE: bytesToNumberLE$1, - concatBytes: concatBytes$2, - createHmacDrbg: createHmacDrbg$1, - ensureBytes: ensureBytes$1, - equalBytes: equalBytes$1, - hexToBytes: hexToBytes$1, - hexToNumber: hexToNumber$1, - isBytes, - numberToBytesBE: numberToBytesBE$1, - numberToBytesLE: numberToBytesLE$1, - numberToHexUnpadded: numberToHexUnpadded$1, - numberToVarBytesBE: numberToVarBytesBE$1, - utf8ToBytes: utf8ToBytes$2, - validateObject: validateObject$1 -}, Symbol.toStringTag, { value: "Module" })); -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _0n$8 = BigInt(0), _1n$b = BigInt(1), _2n$7 = BigInt(2), _3n$3 = BigInt(3); -const _4n$1 = BigInt(4), _5n$2 = BigInt(5), _8n$3 = BigInt(8); -BigInt(9); -BigInt(16); -function mod$1(a3, b2) { - const result = a3 % b2; - return result >= _0n$8 ? result : b2 + result; + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); } -function pow$1(num, power, modulo) { - if (modulo <= _0n$8 || power < _0n$8) - throw new Error("Expected power/modulo > 0"); - if (modulo === _1n$b) - return _0n$8; - let res = _1n$b; - while (power > _0n$8) { - if (power & _1n$b) - res = res * num % modulo; - num = num * num % modulo; - power >>= _1n$b; +function __generator(thisArg, body) { + var _3 = { label: 0, sent: function() { + if (t2[0] & 1) + throw t2[1]; + return t2[1]; + }, trys: [], ops: [] }, f4, y3, t2, g3; + return g3 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g3[Symbol.iterator] = function() { + return this; + }), g3; + function verb(n5) { + return function(v6) { + return step([n5, v6]); + }; + } + function step(op) { + if (f4) + throw new TypeError("Generator is already executing."); + while (_3) + try { + if (f4 = 1, y3 && (t2 = op[0] & 2 ? y3["return"] : op[0] ? y3["throw"] || ((t2 = y3["return"]) && t2.call(y3), 0) : y3.next) && !(t2 = t2.call(y3, op[1])).done) + return t2; + if (y3 = 0, t2) + op = [op[0] & 2, t2.value]; + switch (op[0]) { + case 0: + case 1: + t2 = op; + break; + case 4: + _3.label++; + return { value: op[1], done: false }; + case 5: + _3.label++; + y3 = op[1]; + op = [0]; + continue; + case 7: + op = _3.ops.pop(); + _3.trys.pop(); + continue; + default: + if (!(t2 = _3.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _3 = 0; + continue; + } + if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) { + _3.label = op[1]; + break; + } + if (op[0] === 6 && _3.label < t2[1]) { + _3.label = t2[1]; + t2 = op; + break; + } + if (t2 && _3.label < t2[2]) { + _3.label = t2[2]; + _3.ops.push(op); + break; + } + if (t2[2]) + _3.ops.pop(); + _3.trys.pop(); + continue; + } + op = body.call(thisArg, _3); + } catch (e18) { + op = [6, e18]; + y3 = 0; + } finally { + f4 = t2 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } - return res; } -function pow2$1(x3, power, modulo) { - let res = x3; - while (power-- > _0n$8) { - res *= res; - res %= modulo; +function __createBinding$1(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; +} +function __exportStar(m3, exports) { + for (var p3 in m3) + if (p3 !== "default" && !exports.hasOwnProperty(p3)) + exports[p3] = m3[p3]; +} +function __values(o2) { + var s2 = typeof Symbol === "function" && Symbol.iterator, m3 = s2 && o2[s2], i2 = 0; + if (m3) + return m3.call(o2); + if (o2 && typeof o2.length === "number") + return { + next: function() { + if (o2 && i2 >= o2.length) + o2 = void 0; + return { value: o2 && o2[i2++], done: !o2 }; + } + }; + throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read(o2, n5) { + var m3 = typeof Symbol === "function" && o2[Symbol.iterator]; + if (!m3) + return o2; + var i2 = m3.call(o2), r2, ar2 = [], e18; + try { + while ((n5 === void 0 || n5-- > 0) && !(r2 = i2.next()).done) + ar2.push(r2.value); + } catch (error) { + e18 = { error }; + } finally { + try { + if (r2 && !r2.done && (m3 = i2["return"])) + m3.call(i2); + } finally { + if (e18) + throw e18.error; + } } - return res; + return ar2; } -function invert$1(number2, modulo) { - if (number2 === _0n$8 || modulo <= _0n$8) { - throw new Error(`invert: expected positive integers, got n=${number2} mod=${modulo}`); +function __spread() { + for (var ar2 = [], i2 = 0; i2 < arguments.length; i2++) + ar2 = ar2.concat(__read(arguments[i2])); + return ar2; +} +function __spreadArrays() { + for (var s2 = 0, i2 = 0, il2 = arguments.length; i2 < il2; i2++) + s2 += arguments[i2].length; + for (var r2 = Array(s2), k2 = 0, i2 = 0; i2 < il2; i2++) + for (var a3 = arguments[i2], j2 = 0, jl2 = a3.length; j2 < jl2; j2++, k2++) + r2[k2] = a3[j2]; + return r2; +} +function __await(v6) { + return this instanceof __await ? (this.v = v6, this) : new __await(v6); +} +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g3 = generator.apply(thisArg, _arguments || []), i2, q2 = []; + return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2; + function verb(n5) { + if (g3[n5]) + i2[n5] = function(v6) { + return new Promise(function(a3, b2) { + q2.push([n5, v6, a3, b2]) > 1 || resume(n5, v6); + }); + }; } - let a3 = mod$1(number2, modulo); - let b2 = modulo; - let x3 = _0n$8, u2 = _1n$b; - while (a3 !== _0n$8) { - const q2 = b2 / a3; - const r2 = b2 % a3; - const m3 = x3 - u2 * q2; - b2 = a3, a3 = r2, x3 = u2, u2 = m3; + function resume(n5, v6) { + try { + step(g3[n5](v6)); + } catch (e18) { + settle2(q2[0][3], e18); + } + } + function step(r2) { + r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle2(q2[0][2], r2); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle2(f4, v6) { + if (f4(v6), q2.shift(), q2.length) + resume(q2[0][0], q2[0][1]); } - const gcd = b2; - if (gcd !== _1n$b) - throw new Error("invert: does not exist"); - return mod$1(x3, modulo); } -function tonelliShanks$1(P2) { - const legendreC = (P2 - _1n$b) / _2n$7; - let Q2, S4, Z2; - for (Q2 = P2 - _1n$b, S4 = 0; Q2 % _2n$7 === _0n$8; Q2 /= _2n$7, S4++) - ; - for (Z2 = _2n$7; Z2 < P2 && pow$1(Z2, legendreC, P2) !== P2 - _1n$b; Z2++) - ; - if (S4 === 1) { - const p1div4 = (P2 + _1n$b) / _4n$1; - return function tonelliFast(Fp2, n4) { - const root = Fp2.pow(n4, p1div4); - if (!Fp2.eql(Fp2.sqr(root), n4)) - throw new Error("Cannot find square root"); - return root; - }; +function __asyncDelegator(o2) { + var i2, p3; + return i2 = {}, verb("next"), verb("throw", function(e18) { + throw e18; + }), verb("return"), i2[Symbol.iterator] = function() { + return this; + }, i2; + function verb(n5, f4) { + i2[n5] = o2[n5] ? function(v6) { + return (p3 = !p3) ? { value: __await(o2[n5](v6)), done: n5 === "return" } : f4 ? f4(v6) : v6; + } : f4; } - const Q1div2 = (Q2 + _1n$b) / _2n$7; - return function tonelliSlow(Fp2, n4) { - if (Fp2.pow(n4, legendreC) === Fp2.neg(Fp2.ONE)) - throw new Error("Cannot find square root"); - let r2 = S4; - let g3 = Fp2.pow(Fp2.mul(Fp2.ONE, Z2), Q2); - let x3 = Fp2.pow(n4, Q1div2); - let b2 = Fp2.pow(n4, Q2); - while (!Fp2.eql(b2, Fp2.ONE)) { - if (Fp2.eql(b2, Fp2.ZERO)) - return Fp2.ZERO; - let m3 = 1; - for (let t2 = Fp2.sqr(b2); m3 < r2; m3++) { - if (Fp2.eql(t2, Fp2.ONE)) - break; - t2 = Fp2.sqr(t2); - } - const ge2 = Fp2.pow(g3, _1n$b << BigInt(r2 - m3 - 1)); - g3 = Fp2.sqr(ge2); - x3 = Fp2.mul(x3, ge2); - b2 = Fp2.mul(b2, g3); - r2 = m3; - } - return x3; - }; } -function FpSqrt$1(P2) { - if (P2 % _4n$1 === _3n$3) { - const p1div4 = (P2 + _1n$b) / _4n$1; - return function sqrt3mod4(Fp2, n4) { - const root = Fp2.pow(n4, p1div4); - if (!Fp2.eql(Fp2.sqr(root), n4)) - throw new Error("Cannot find square root"); - return root; +function __asyncValues(o2) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m3 = o2[Symbol.asyncIterator], i2; + return m3 ? m3.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2); + function verb(n5) { + i2[n5] = o2[n5] && function(v6) { + return new Promise(function(resolve, reject) { + v6 = o2[n5](v6), settle2(resolve, reject, v6.done, v6.value); + }); }; } - if (P2 % _8n$3 === _5n$2) { - const c1 = (P2 - _5n$2) / _8n$3; - return function sqrt5mod8(Fp2, n4) { - const n22 = Fp2.mul(n4, _2n$7); - const v6 = Fp2.pow(n22, c1); - const nv2 = Fp2.mul(n4, v6); - const i3 = Fp2.mul(Fp2.mul(nv2, _2n$7), v6); - const root = Fp2.mul(nv2, Fp2.sub(i3, Fp2.ONE)); - if (!Fp2.eql(Fp2.sqr(root), n4)) - throw new Error("Cannot find square root"); - return root; - }; + function settle2(resolve, reject, d4, v6) { + Promise.resolve(v6).then(function(v7) { + resolve({ value: v7, done: d4 }); + }, reject); } - return tonelliShanks$1(P2); } -const isNegativeLE = (num, modulo) => (mod$1(num, modulo) & _1n$b) === _1n$b; -const FIELD_FIELDS$1 = [ - "create", - "isValid", - "is0", - "neg", - "inv", - "sqrt", - "sqr", - "eql", - "add", - "sub", - "mul", - "pow", - "div", - "addN", - "subN", - "mulN", - "sqrN" -]; -function validateField$1(field) { - const initial = { - ORDER: "bigint", - MASK: "bigint", - BYTES: "isSafeInteger", - BITS: "isSafeInteger" - }; - const opts = FIELD_FIELDS$1.reduce((map, val) => { - map[val] = "function"; - return map; - }, initial); - return validateObject$1(field, opts); +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; } -function FpPow$1(f3, num, power) { - if (power < _0n$8) - throw new Error("Expected power > 0"); - if (power === _0n$8) - return f3.ONE; - if (power === _1n$b) - return num; - let p3 = f3.ONE; - let d4 = num; - while (power > _0n$8) { - if (power & _1n$b) - p3 = f3.mul(p3, d4); - d4 = f3.sqr(d4); - power >>= _1n$b; +function __importStar$1(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result = {}; + if (mod2 != null) { + for (var k2 in mod2) + if (Object.hasOwnProperty.call(mod2, k2)) + result[k2] = mod2[k2]; } - return p3; + result.default = mod2; + return result; } -function FpInvertBatch$1(f3, nums) { - const tmp = new Array(nums.length); - const lastMultiplied = nums.reduce((acc, num, i3) => { - if (f3.is0(num)) - return acc; - tmp[i3] = acc; - return f3.mul(acc, num); - }, f3.ONE); - const inverted = f3.inv(lastMultiplied); - nums.reduceRight((acc, num, i3) => { - if (f3.is0(num)) - return acc; - tmp[i3] = f3.mul(acc, tmp[i3]); - return f3.mul(acc, num); - }, inverted); - return tmp; +function __importDefault$1(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; } -function nLength$1(n4, nBitLength) { - const _nBitLength = nBitLength !== void 0 ? nBitLength : n4.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; +function __classPrivateFieldGet$4(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); } -function Field$1(ORDER, bitLen2, isLE2 = false, redef = {}) { - if (ORDER <= _0n$8) - throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); - const { nBitLength: BITS, nByteLength: BYTES } = nLength$1(ORDER, bitLen2); - if (BYTES > 2048) - throw new Error("Field lengths over 2048 bytes are not supported"); - const sqrtP = FpSqrt$1(ORDER); - const f3 = Object.freeze({ - ORDER, - BITS, - BYTES, - MASK: bitMask$1(BITS), - ZERO: _0n$8, - ONE: _1n$b, - create: (num) => mod$1(num, ORDER), - isValid: (num) => { - if (typeof num !== "bigint") - throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); - return _0n$8 <= num && num < ORDER; - }, - is0: (num) => num === _0n$8, - isOdd: (num) => (num & _1n$b) === _1n$b, - neg: (num) => mod$1(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod$1(num * num, ORDER), - add: (lhs, rhs) => mod$1(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod$1(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod$1(lhs * rhs, ORDER), - pow: (num, power) => FpPow$1(f3, num, power), - div: (lhs, rhs) => mod$1(lhs * invert$1(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert$1(num, ORDER), - sqrt: redef.sqrt || ((n4) => sqrtP(f3, n4)), - invertBatch: (lst) => FpInvertBatch$1(f3, lst), - // TODO: do we really need constant cmov? - // We don't have const-time bigints anyway, so probably will be not very useful - cmov: (a3, b2, c2) => c2 ? b2 : a3, - toBytes: (num) => isLE2 ? numberToBytesLE$1(num, BYTES) : numberToBytesBE$1(num, BYTES), - fromBytes: (bytes2) => { - if (bytes2.length !== BYTES) - throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes2.length}`); - return isLE2 ? bytesToNumberLE$1(bytes2) : bytesToNumberBE$1(bytes2); - } - }); - return Object.freeze(f3); +function __classPrivateFieldSet$4(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; } -function getFieldBytesLength$1(fieldOrder) { - if (typeof fieldOrder !== "bigint") - throw new Error("field order must be bigint"); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); +const tslib_es6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + get __assign() { + return __assign; + }, + __asyncDelegator, + __asyncGenerator, + __asyncValues, + __await, + __awaiter: __awaiter$6, + __classPrivateFieldGet: __classPrivateFieldGet$4, + __classPrivateFieldSet: __classPrivateFieldSet$4, + __createBinding: __createBinding$1, + __decorate: __decorate$1, + __exportStar, + __extends, + __generator, + __importDefault: __importDefault$1, + __importStar: __importStar$1, + __makeTemplateObject, + __metadata, + __param, + __read, + __rest: __rest$1, + __spread, + __spreadArrays, + __values +}, Symbol.toStringTag, { value: "Module" })); +const require$$0$2 = /* @__PURE__ */ getAugmentedNamespace(tslib_es6); +var utils$j = {}; +var delay = {}; +var hasRequiredDelay; +function requireDelay() { + if (hasRequiredDelay) + return delay; + hasRequiredDelay = 1; + Object.defineProperty(delay, "__esModule", { value: true }); + delay.delay = void 0; + function delay$1(timeout) { + return new Promise((resolve) => { + setTimeout(() => { + resolve(true); + }, timeout); + }); + } + delay.delay = delay$1; + return delay; } -function getMinHashLength$1(fieldOrder) { - const length = getFieldBytesLength$1(fieldOrder); - return length + Math.ceil(length / 2); +var convert = {}; +var constants = {}; +var misc = {}; +var hasRequiredMisc; +function requireMisc() { + if (hasRequiredMisc) + return misc; + hasRequiredMisc = 1; + Object.defineProperty(misc, "__esModule", { value: true }); + misc.ONE_THOUSAND = misc.ONE_HUNDRED = void 0; + misc.ONE_HUNDRED = 100; + misc.ONE_THOUSAND = 1e3; + return misc; } -function mapHashToField$1(key2, fieldOrder, isLE2 = false) { - const len = key2.length; - const fieldLen = getFieldBytesLength$1(fieldOrder); - const minLen = getMinHashLength$1(fieldOrder); - if (len < 16 || len < minLen || len > 1024) - throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); - const num = isLE2 ? bytesToNumberBE$1(key2) : bytesToNumberLE$1(key2); - const reduced = mod$1(num, fieldOrder - _1n$b) + _1n$b; - return isLE2 ? numberToBytesLE$1(reduced, fieldLen) : numberToBytesBE$1(reduced, fieldLen); +var time = {}; +var hasRequiredTime; +function requireTime() { + if (hasRequiredTime) + return time; + hasRequiredTime = 1; + (function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ONE_YEAR = exports.FOUR_WEEKS = exports.THREE_WEEKS = exports.TWO_WEEKS = exports.ONE_WEEK = exports.THIRTY_DAYS = exports.SEVEN_DAYS = exports.FIVE_DAYS = exports.THREE_DAYS = exports.ONE_DAY = exports.TWENTY_FOUR_HOURS = exports.TWELVE_HOURS = exports.SIX_HOURS = exports.THREE_HOURS = exports.ONE_HOUR = exports.SIXTY_MINUTES = exports.THIRTY_MINUTES = exports.TEN_MINUTES = exports.FIVE_MINUTES = exports.ONE_MINUTE = exports.SIXTY_SECONDS = exports.THIRTY_SECONDS = exports.TEN_SECONDS = exports.FIVE_SECONDS = exports.ONE_SECOND = void 0; + exports.ONE_SECOND = 1; + exports.FIVE_SECONDS = 5; + exports.TEN_SECONDS = 10; + exports.THIRTY_SECONDS = 30; + exports.SIXTY_SECONDS = 60; + exports.ONE_MINUTE = exports.SIXTY_SECONDS; + exports.FIVE_MINUTES = exports.ONE_MINUTE * 5; + exports.TEN_MINUTES = exports.ONE_MINUTE * 10; + exports.THIRTY_MINUTES = exports.ONE_MINUTE * 30; + exports.SIXTY_MINUTES = exports.ONE_MINUTE * 60; + exports.ONE_HOUR = exports.SIXTY_MINUTES; + exports.THREE_HOURS = exports.ONE_HOUR * 3; + exports.SIX_HOURS = exports.ONE_HOUR * 6; + exports.TWELVE_HOURS = exports.ONE_HOUR * 12; + exports.TWENTY_FOUR_HOURS = exports.ONE_HOUR * 24; + exports.ONE_DAY = exports.TWENTY_FOUR_HOURS; + exports.THREE_DAYS = exports.ONE_DAY * 3; + exports.FIVE_DAYS = exports.ONE_DAY * 5; + exports.SEVEN_DAYS = exports.ONE_DAY * 7; + exports.THIRTY_DAYS = exports.ONE_DAY * 30; + exports.ONE_WEEK = exports.SEVEN_DAYS; + exports.TWO_WEEKS = exports.ONE_WEEK * 2; + exports.THREE_WEEKS = exports.ONE_WEEK * 3; + exports.FOUR_WEEKS = exports.ONE_WEEK * 4; + exports.ONE_YEAR = exports.ONE_DAY * 365; + })(time); + return time; } -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _0n$7 = BigInt(0); -const _1n$a = BigInt(1); -function wNAF$1(c2, bits) { - const constTimeNegate = (condition, item) => { - const neg4 = item.negate(); - return condition ? neg4 : item; - }; - const opts = (W2) => { - const windows = Math.ceil(bits / W2) + 1; - const windowSize = 2 ** (W2 - 1); - return { windows, windowSize }; - }; - return { - constTimeNegate, - // non-const time multiplication ladder - unsafeLadder(elm, n4) { - let p3 = c2.ZERO; - let d4 = elm; - while (n4 > _0n$7) { - if (n4 & _1n$a) - p3 = p3.add(d4); - d4 = d4.double(); - n4 >>= _1n$a; +var hasRequiredConstants; +function requireConstants() { + if (hasRequiredConstants) + return constants; + hasRequiredConstants = 1; + (function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = require$$0$2; + tslib_1.__exportStar(requireMisc(), exports); + tslib_1.__exportStar(requireTime(), exports); + })(constants); + return constants; +} +var hasRequiredConvert; +function requireConvert() { + if (hasRequiredConvert) + return convert; + hasRequiredConvert = 1; + Object.defineProperty(convert, "__esModule", { value: true }); + convert.fromMiliseconds = convert.toMiliseconds = void 0; + const constants_1 = requireConstants(); + function toMiliseconds(seconds) { + return seconds * constants_1.ONE_THOUSAND; + } + convert.toMiliseconds = toMiliseconds; + function fromMiliseconds(miliseconds) { + return Math.floor(miliseconds / constants_1.ONE_THOUSAND); + } + convert.fromMiliseconds = fromMiliseconds; + return convert; +} +var hasRequiredUtils; +function requireUtils() { + if (hasRequiredUtils) + return utils$j; + hasRequiredUtils = 1; + (function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = require$$0$2; + tslib_1.__exportStar(requireDelay(), exports); + tslib_1.__exportStar(requireConvert(), exports); + })(utils$j); + return utils$j; +} +var watch$2 = {}; +var hasRequiredWatch$1; +function requireWatch$1() { + if (hasRequiredWatch$1) + return watch$2; + hasRequiredWatch$1 = 1; + Object.defineProperty(watch$2, "__esModule", { value: true }); + watch$2.Watch = void 0; + class Watch { + constructor() { + this.timestamps = /* @__PURE__ */ new Map(); + } + start(label) { + if (this.timestamps.has(label)) { + throw new Error(`Watch already started for label: ${label}`); } - return p3; - }, - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(elm, W2) { - const { windows, windowSize } = opts(W2); - const points = []; - let p3 = elm; - let base3 = p3; - for (let window2 = 0; window2 < windows; window2++) { - base3 = p3; - points.push(base3); - for (let i3 = 1; i3 < windowSize; i3++) { - base3 = base3.add(p3); - points.push(base3); - } - p3 = base3.double(); + this.timestamps.set(label, { started: Date.now() }); + } + stop(label) { + const timestamp = this.get(label); + if (typeof timestamp.elapsed !== "undefined") { + throw new Error(`Watch already stopped for label: ${label}`); } - return points; - }, - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * @param W window size - * @param precomputes precomputed tables - * @param n scalar (we don't check here, but should be less than curve order) - * @returns real and fake (for const-time) points - */ - wNAF(W2, precomputes, n4) { - const { windows, windowSize } = opts(W2); - let p3 = c2.ZERO; - let f3 = c2.BASE; - const mask2 = BigInt(2 ** W2 - 1); - const maxNumber = 2 ** W2; - const shiftBy = BigInt(W2); - for (let window2 = 0; window2 < windows; window2++) { - const offset2 = window2 * windowSize; - let wbits = Number(n4 & mask2); - n4 >>= shiftBy; - if (wbits > windowSize) { - wbits -= maxNumber; - n4 += _1n$a; - } - const offset1 = offset2; - const offset22 = offset2 + Math.abs(wbits) - 1; - const cond1 = window2 % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - f3 = f3.add(constTimeNegate(cond1, precomputes[offset1])); - } else { - p3 = p3.add(constTimeNegate(cond2, precomputes[offset22])); + const elapsed = Date.now() - timestamp.started; + this.timestamps.set(label, { started: timestamp.started, elapsed }); + } + get(label) { + const timestamp = this.timestamps.get(label); + if (typeof timestamp === "undefined") { + throw new Error(`No timestamp found for label: ${label}`); + } + return timestamp; + } + elapsed(label) { + const timestamp = this.get(label); + const elapsed = timestamp.elapsed || Date.now() - timestamp.started; + return elapsed; + } + } + watch$2.Watch = Watch; + watch$2.default = Watch; + return watch$2; +} +var types = {}; +var watch$1 = {}; +var hasRequiredWatch; +function requireWatch() { + if (hasRequiredWatch) + return watch$1; + hasRequiredWatch = 1; + Object.defineProperty(watch$1, "__esModule", { value: true }); + watch$1.IWatch = void 0; + class IWatch { + } + watch$1.IWatch = IWatch; + return watch$1; +} +var hasRequiredTypes; +function requireTypes() { + if (hasRequiredTypes) + return types; + hasRequiredTypes = 1; + (function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = require$$0$2; + tslib_1.__exportStar(requireWatch(), exports); + })(types); + return types; +} +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = require$$0$2; + tslib_1.__exportStar(requireUtils(), exports); + tslib_1.__exportStar(requireWatch$1(), exports); + tslib_1.__exportStar(requireTypes(), exports); + tslib_1.__exportStar(requireConstants(), exports); +})(cjs$3); +var cjs$2 = {}; +Object.defineProperty(cjs$2, "__esModule", { value: true }); +cjs$2.getLocalStorage = cjs$2.getLocalStorageOrThrow = cjs$2.getCrypto = cjs$2.getCryptoOrThrow = getLocation_1 = cjs$2.getLocation = cjs$2.getLocationOrThrow = getNavigator_1 = cjs$2.getNavigator = cjs$2.getNavigatorOrThrow = getDocument_1 = cjs$2.getDocument = cjs$2.getDocumentOrThrow = cjs$2.getFromWindowOrThrow = cjs$2.getFromWindow = void 0; +function getFromWindow(name2) { + let res = void 0; + if (typeof window !== "undefined" && typeof window[name2] !== "undefined") { + res = window[name2]; + } + return res; +} +cjs$2.getFromWindow = getFromWindow; +function getFromWindowOrThrow(name2) { + const res = getFromWindow(name2); + if (!res) { + throw new Error(`${name2} is not defined in Window`); + } + return res; +} +cjs$2.getFromWindowOrThrow = getFromWindowOrThrow; +function getDocumentOrThrow() { + return getFromWindowOrThrow("document"); +} +cjs$2.getDocumentOrThrow = getDocumentOrThrow; +function getDocument() { + return getFromWindow("document"); +} +var getDocument_1 = cjs$2.getDocument = getDocument; +function getNavigatorOrThrow() { + return getFromWindowOrThrow("navigator"); +} +cjs$2.getNavigatorOrThrow = getNavigatorOrThrow; +function getNavigator() { + return getFromWindow("navigator"); +} +var getNavigator_1 = cjs$2.getNavigator = getNavigator; +function getLocationOrThrow() { + return getFromWindowOrThrow("location"); +} +cjs$2.getLocationOrThrow = getLocationOrThrow; +function getLocation() { + return getFromWindow("location"); +} +var getLocation_1 = cjs$2.getLocation = getLocation; +function getCryptoOrThrow() { + return getFromWindowOrThrow("crypto"); +} +cjs$2.getCryptoOrThrow = getCryptoOrThrow; +function getCrypto() { + return getFromWindow("crypto"); +} +cjs$2.getCrypto = getCrypto; +function getLocalStorageOrThrow() { + return getFromWindowOrThrow("localStorage"); +} +cjs$2.getLocalStorageOrThrow = getLocalStorageOrThrow; +function getLocalStorage() { + return getFromWindow("localStorage"); +} +cjs$2.getLocalStorage = getLocalStorage; +var cjs$1 = {}; +Object.defineProperty(cjs$1, "__esModule", { value: true }); +var getWindowMetadata_1 = cjs$1.getWindowMetadata = void 0; +const window_getters_1 = cjs$2; +function getWindowMetadata() { + let doc; + let loc; + try { + doc = window_getters_1.getDocumentOrThrow(); + loc = window_getters_1.getLocationOrThrow(); + } catch (e18) { + return null; + } + function getIcons() { + const links = doc.getElementsByTagName("link"); + const icons2 = []; + for (let i2 = 0; i2 < links.length; i2++) { + const link = links[i2]; + const rel = link.getAttribute("rel"); + if (rel) { + if (rel.toLowerCase().indexOf("icon") > -1) { + const href = link.getAttribute("href"); + if (href) { + if (href.toLowerCase().indexOf("https:") === -1 && href.toLowerCase().indexOf("http:") === -1 && href.indexOf("//") !== 0) { + let absoluteHref = loc.protocol + "//" + loc.host; + if (href.indexOf("/") === 0) { + absoluteHref += href; + } else { + const path = loc.pathname.split("/"); + path.pop(); + const finalPath = path.join("/"); + absoluteHref += finalPath + "/" + href; + } + icons2.push(absoluteHref); + } else if (href.indexOf("//") === 0) { + const absoluteUrl = loc.protocol + href; + icons2.push(absoluteUrl); + } else { + icons2.push(href); + } + } } } - return { p: p3, f: f3 }; - }, - wNAFCached(P2, precomputesMap, n4, transform) { - const W2 = P2._WINDOW_SIZE || 1; - let comp = precomputesMap.get(P2); - if (!comp) { - comp = this.precomputeWindow(P2, W2); - if (W2 !== 1) { - precomputesMap.set(P2, transform(comp)); + } + return icons2; + } + function getWindowMetadataOfAny(...args) { + const metaTags = doc.getElementsByTagName("meta"); + for (let i2 = 0; i2 < metaTags.length; i2++) { + const tag = metaTags[i2]; + const attributes = ["itemprop", "property", "name"].map((target) => tag.getAttribute(target)).filter((attr) => { + if (attr) { + return args.includes(attr); + } + return false; + }); + if (attributes.length && attributes) { + const content = tag.getAttribute("content"); + if (content) { + return content; } } - return this.wNAF(W2, comp, n4); } + return ""; + } + function getName() { + let name3 = getWindowMetadataOfAny("name", "og:site_name", "og:title", "twitter:title"); + if (!name3) { + name3 = doc.title; + } + return name3; + } + function getDescription() { + const description3 = getWindowMetadataOfAny("description", "og:description", "twitter:description", "keywords"); + return description3; + } + const name2 = getName(); + const description2 = getDescription(); + const url = loc.origin; + const icons = getIcons(); + const meta = { + description: description2, + url, + icons, + name: name2 }; + return meta; } -function validateBasic$1(curve2) { - validateField$1(curve2.Fp); - validateObject$1(curve2, { - n: "bigint", - h: "bigint", - Gx: "field", - Gy: "field" - }, { - nBitLength: "isSafeInteger", - nByteLength: "isSafeInteger" - }); - return Object.freeze({ - ...nLength$1(curve2.n, curve2.nBitLength), - ...curve2, - ...{ p: curve2.Fp.ORDER } - }); +getWindowMetadata_1 = cjs$1.getWindowMetadata = getWindowMetadata; +var queryString = {}; +var strictUriEncode = (str) => encodeURIComponent(str).replace(/[!'()*]/g, (x3) => `%${x3.charCodeAt(0).toString(16).toUpperCase()}`); +var token = "%[a-f0-9]{2}"; +var singleMatcher = new RegExp("(" + token + ")|([^%]+?)", "gi"); +var multiMatcher = new RegExp("(" + token + ")+", "gi"); +function decodeComponents(components, split2) { + try { + return [decodeURIComponent(components.join(""))]; + } catch (err) { + } + if (components.length === 1) { + return components; + } + split2 = split2 || 1; + var left = components.slice(0, split2); + var right = components.slice(split2); + return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); } -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _0n$6 = BigInt(0), _1n$9 = BigInt(1), _2n$6 = BigInt(2), _8n$2 = BigInt(8); -const VERIFY_DEFAULT = { zip215: true }; -function validateOpts$2(curve2) { - const opts = validateBasic$1(curve2); - validateObject$1(curve2, { - hash: "function", - a: "bigint", - d: "bigint", - randomBytes: "function" - }, { - adjustScalarBytes: "function", - domain: "function", - uvRatio: "function", - mapToCurve: "function" - }); - return Object.freeze({ ...opts }); +function decode$3(input) { + try { + return decodeURIComponent(input); + } catch (err) { + var tokens = input.match(singleMatcher) || []; + for (var i2 = 1; i2 < tokens.length; i2++) { + input = decodeComponents(tokens, i2).join(""); + tokens = input.match(singleMatcher) || []; + } + return input; + } } -function twistedEdwards(curveDef) { - const CURVE = validateOpts$2(curveDef); - const { Fp: Fp2, n: CURVE_ORDER, prehash, hash: cHash, randomBytes: randomBytes2, nByteLength, h: cofactor } = CURVE; - const MASK = _2n$6 << BigInt(nByteLength * 8) - _1n$9; - const modP = Fp2.create; - const uvRatio2 = CURVE.uvRatio || ((u2, v6) => { +function customDecodeURIComponent(input) { + var replaceMap = { + "%FE%FF": "��", + "%FF%FE": "��" + }; + var match = multiMatcher.exec(input); + while (match) { try { - return { isValid: true, value: Fp2.sqrt(u2 * Fp2.inv(v6)) }; - } catch (e18) { - return { isValid: false, value: _0n$6 }; + replaceMap[match[0]] = decodeURIComponent(match[0]); + } catch (err) { + var result = decode$3(match[0]); + if (result !== match[0]) { + replaceMap[match[0]] = result; + } } - }); - const adjustScalarBytes2 = CURVE.adjustScalarBytes || ((bytes2) => bytes2); - const domain = CURVE.domain || ((data, ctx, phflag) => { - if (ctx.length || phflag) - throw new Error("Contexts/pre-hash are not supported"); - return data; - }); - const inBig = (n4) => typeof n4 === "bigint" && _0n$6 < n4; - const inRange2 = (n4, max) => inBig(n4) && inBig(max) && n4 < max; - const in0MaskRange = (n4) => n4 === _0n$6 || inRange2(n4, MASK); - function assertInRange(n4, max) { - if (inRange2(n4, max)) - return n4; - throw new Error(`Expected valid scalar < ${max}, got ${typeof n4} ${n4}`); + match = multiMatcher.exec(input); } - function assertGE0(n4) { - return n4 === _0n$6 ? n4 : assertInRange(n4, CURVE_ORDER); + replaceMap["%C2"] = "�"; + var entries = Object.keys(replaceMap); + for (var i2 = 0; i2 < entries.length; i2++) { + var key2 = entries[i2]; + input = input.replace(new RegExp(key2, "g"), replaceMap[key2]); } - const pointPrecomputes = /* @__PURE__ */ new Map(); - function isPoint2(other) { - if (!(other instanceof Point2)) - throw new Error("ExtendedPoint expected"); + return input; +} +var decodeUriComponent = function(encodedURI) { + if (typeof encodedURI !== "string") { + throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof encodedURI + "`"); } - class Point2 { - constructor(ex2, ey2, ez2, et2) { - this.ex = ex2; - this.ey = ey2; - this.ez = ez2; - this.et = et2; - if (!in0MaskRange(ex2)) - throw new Error("x required"); - if (!in0MaskRange(ey2)) - throw new Error("y required"); - if (!in0MaskRange(ez2)) - throw new Error("z required"); - if (!in0MaskRange(et2)) - throw new Error("t required"); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - static fromAffine(p3) { - if (p3 instanceof Point2) - throw new Error("extended point not allowed"); - const { x: x3, y: y3 } = p3 || {}; - if (!in0MaskRange(x3) || !in0MaskRange(y3)) - throw new Error("invalid affine point"); - return new Point2(x3, y3, _1n$9, modP(x3 * y3)); + try { + encodedURI = encodedURI.replace(/\+/g, " "); + return decodeURIComponent(encodedURI); + } catch (err) { + return customDecodeURIComponent(encodedURI); + } +}; +var splitOnFirst = (string2, separator) => { + if (!(typeof string2 === "string" && typeof separator === "string")) { + throw new TypeError("Expected the arguments to be of type `string`"); + } + if (separator === "") { + return [string2]; + } + const separatorIndex = string2.indexOf(separator); + if (separatorIndex === -1) { + return [string2]; + } + return [ + string2.slice(0, separatorIndex), + string2.slice(separatorIndex + separator.length) + ]; +}; +var filterObj = function(obj, predicate) { + var ret = {}; + var keys2 = Object.keys(obj); + var isArr = Array.isArray(predicate); + for (var i2 = 0; i2 < keys2.length; i2++) { + var key2 = keys2[i2]; + var val = obj[key2]; + if (isArr ? predicate.indexOf(key2) !== -1 : predicate(key2, val, obj)) { + ret[key2] = val; } - static normalizeZ(points) { - const toInv = Fp2.invertBatch(points.map((p3) => p3.ez)); - return points.map((p3, i3) => p3.toAffine(toInv[i3])).map(Point2.fromAffine); + } + return ret; +}; +(function(exports) { + const strictUriEncode$1 = strictUriEncode; + const decodeComponent = decodeUriComponent; + const splitOnFirst$1 = splitOnFirst; + const filterObject = filterObj; + const isNullOrUndefined = (value) => value === null || value === void 0; + const encodeFragmentIdentifier = Symbol("encodeFragmentIdentifier"); + function encoderForArrayFormat(options) { + switch (options.arrayFormat) { + case "index": + return (key2) => (result, value) => { + const index2 = result.length; + if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { + return result; + } + if (value === null) { + return [...result, [encode5(key2, options), "[", index2, "]"].join("")]; + } + return [ + ...result, + [encode5(key2, options), "[", encode5(index2, options), "]=", encode5(value, options)].join("") + ]; + }; + case "bracket": + return (key2) => (result, value) => { + if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { + return result; + } + if (value === null) { + return [...result, [encode5(key2, options), "[]"].join("")]; + } + return [...result, [encode5(key2, options), "[]=", encode5(value, options)].join("")]; + }; + case "colon-list-separator": + return (key2) => (result, value) => { + if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { + return result; + } + if (value === null) { + return [...result, [encode5(key2, options), ":list="].join("")]; + } + return [...result, [encode5(key2, options), ":list=", encode5(value, options)].join("")]; + }; + case "comma": + case "separator": + case "bracket-separator": { + const keyValueSep = options.arrayFormat === "bracket-separator" ? "[]=" : "="; + return (key2) => (result, value) => { + if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { + return result; + } + value = value === null ? "" : value; + if (result.length === 0) { + return [[encode5(key2, options), keyValueSep, encode5(value, options)].join("")]; + } + return [[result, encode5(value, options)].join(options.arrayFormatSeparator)]; + }; + } + default: + return (key2) => (result, value) => { + if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { + return result; + } + if (value === null) { + return [...result, encode5(key2, options)]; + } + return [...result, [encode5(key2, options), "=", encode5(value, options)].join("")]; + }; } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); + } + function parserForArrayFormat(options) { + let result; + switch (options.arrayFormat) { + case "index": + return (key2, value, accumulator) => { + result = /\[(\d*)\]$/.exec(key2); + key2 = key2.replace(/\[\d*\]$/, ""); + if (!result) { + accumulator[key2] = value; + return; + } + if (accumulator[key2] === void 0) { + accumulator[key2] = {}; + } + accumulator[key2][result[1]] = value; + }; + case "bracket": + return (key2, value, accumulator) => { + result = /(\[\])$/.exec(key2); + key2 = key2.replace(/\[\]$/, ""); + if (!result) { + accumulator[key2] = value; + return; + } + if (accumulator[key2] === void 0) { + accumulator[key2] = [value]; + return; + } + accumulator[key2] = [].concat(accumulator[key2], value); + }; + case "colon-list-separator": + return (key2, value, accumulator) => { + result = /(:list)$/.exec(key2); + key2 = key2.replace(/:list$/, ""); + if (!result) { + accumulator[key2] = value; + return; + } + if (accumulator[key2] === void 0) { + accumulator[key2] = [value]; + return; + } + accumulator[key2] = [].concat(accumulator[key2], value); + }; + case "comma": + case "separator": + return (key2, value, accumulator) => { + const isArray2 = typeof value === "string" && value.includes(options.arrayFormatSeparator); + const isEncodedArray = typeof value === "string" && !isArray2 && decode3(value, options).includes(options.arrayFormatSeparator); + value = isEncodedArray ? decode3(value, options) : value; + const newValue = isArray2 || isEncodedArray ? value.split(options.arrayFormatSeparator).map((item) => decode3(item, options)) : value === null ? value : decode3(value, options); + accumulator[key2] = newValue; + }; + case "bracket-separator": + return (key2, value, accumulator) => { + const isArray2 = /(\[\])$/.test(key2); + key2 = key2.replace(/\[\]$/, ""); + if (!isArray2) { + accumulator[key2] = value ? decode3(value, options) : value; + return; + } + const arrayValue = value === null ? [] : value.split(options.arrayFormatSeparator).map((item) => decode3(item, options)); + if (accumulator[key2] === void 0) { + accumulator[key2] = arrayValue; + return; + } + accumulator[key2] = [].concat(accumulator[key2], arrayValue); + }; + default: + return (key2, value, accumulator) => { + if (accumulator[key2] === void 0) { + accumulator[key2] = value; + return; + } + accumulator[key2] = [].concat(accumulator[key2], value); + }; } - // Not required for fromHex(), which always creates valid points. - // Could be useful for fromAffine(). - assertValidity() { - const { a: a3, d: d4 } = CURVE; - if (this.is0()) - throw new Error("bad point: ZERO"); - const { ex: X2, ey: Y2, ez: Z2, et: T9 } = this; - const X22 = modP(X2 * X2); - const Y22 = modP(Y2 * Y2); - const Z22 = modP(Z2 * Z2); - const Z4 = modP(Z22 * Z22); - const aX2 = modP(X22 * a3); - const left = modP(Z22 * modP(aX2 + Y22)); - const right = modP(Z4 + modP(d4 * modP(X22 * Y22))); - if (left !== right) - throw new Error("bad point: equation left != right (1)"); - const XY = modP(X2 * Y2); - const ZT = modP(Z2 * T9); - if (XY !== ZT) - throw new Error("bad point: equation left != right (2)"); + } + function validateArrayFormatSeparator(value) { + if (typeof value !== "string" || value.length !== 1) { + throw new TypeError("arrayFormatSeparator must be single character string"); } - // Compare one point to another. - equals(other) { - isPoint2(other); - const { ex: X1, ey: Y1, ez: Z1 } = this; - const { ex: X2, ey: Y2, ez: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; + } + function encode5(value, options) { + if (options.encode) { + return options.strict ? strictUriEncode$1(value) : encodeURIComponent(value); } - is0() { - return this.equals(Point2.ZERO); + return value; + } + function decode3(value, options) { + if (options.decode) { + return decodeComponent(value); } - negate() { - return new Point2(modP(-this.ex), this.ey, this.ez, modP(-this.et)); + return value; + } + function keysSorter(input) { + if (Array.isArray(input)) { + return input.sort(); } - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double() { - const { a: a3 } = CURVE; - const { ex: X1, ey: Y1, ez: Z1 } = this; - const A2 = modP(X1 * X1); - const B2 = modP(Y1 * Y1); - const C3 = modP(_2n$6 * modP(Z1 * Z1)); - const D2 = modP(a3 * A2); - const x1y1 = X1 + Y1; - const E2 = modP(modP(x1y1 * x1y1) - A2 - B2); - const G3 = D2 + B2; - const F2 = G3 - C3; - const H2 = D2 - B2; - const X3 = modP(E2 * F2); - const Y3 = modP(G3 * H2); - const T32 = modP(E2 * H2); - const Z3 = modP(F2 * G3); - return new Point2(X3, Y3, Z3, T32); + if (typeof input === "object") { + return keysSorter(Object.keys(input)).sort((a3, b2) => Number(a3) - Number(b2)).map((key2) => input[key2]); } - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other) { - isPoint2(other); - const { a: a3, d: d4 } = CURVE; - const { ex: X1, ey: Y1, ez: Z1, et: T12 } = this; - const { ex: X2, ey: Y2, ez: Z2, et: T22 } = other; - if (a3 === BigInt(-1)) { - const A3 = modP((Y1 - X1) * (Y2 + X2)); - const B3 = modP((Y1 + X1) * (Y2 - X2)); - const F3 = modP(B3 - A3); - if (F3 === _0n$6) - return this.double(); - const C4 = modP(Z1 * _2n$6 * T22); - const D3 = modP(T12 * _2n$6 * Z2); - const E3 = D3 + C4; - const G4 = B3 + A3; - const H3 = D3 - C4; - const X32 = modP(E3 * F3); - const Y32 = modP(G4 * H3); - const T33 = modP(E3 * H3); - const Z32 = modP(F3 * G4); - return new Point2(X32, Y32, Z32, T33); - } - const A2 = modP(X1 * X2); - const B2 = modP(Y1 * Y2); - const C3 = modP(T12 * d4 * T22); - const D2 = modP(Z1 * Z2); - const E2 = modP((X1 + Y1) * (X2 + Y2) - A2 - B2); - const F2 = D2 - C3; - const G3 = D2 + C3; - const H2 = modP(B2 - a3 * A2); - const X3 = modP(E2 * F2); - const Y3 = modP(G3 * H2); - const T32 = modP(E2 * H2); - const Z3 = modP(F2 * G3); - return new Point2(X3, Y3, Z3, T32); + return input; + } + function removeHash(input) { + const hashStart = input.indexOf("#"); + if (hashStart !== -1) { + input = input.slice(0, hashStart); } - subtract(other) { - return this.add(other.negate()); + return input; + } + function getHash2(url) { + let hash3 = ""; + const hashStart = url.indexOf("#"); + if (hashStart !== -1) { + hash3 = url.slice(hashStart); } - wNAF(n4) { - return wnaf.wNAFCached(this, pointPrecomputes, n4, Point2.normalizeZ); + return hash3; + } + function extract(input) { + input = removeHash(input); + const queryStart = input.indexOf("?"); + if (queryStart === -1) { + return ""; } - // Constant-time multiplication. - multiply(scalar) { - const { p: p3, f: f3 } = this.wNAF(assertInRange(scalar, CURVE_ORDER)); - return Point2.normalizeZ([p3, f3])[0]; + return input.slice(queryStart + 1); + } + function parseValue(value, options) { + if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === "string" && value.trim() !== "")) { + value = Number(value); + } else if (options.parseBooleans && value !== null && (value.toLowerCase() === "true" || value.toLowerCase() === "false")) { + value = value.toLowerCase() === "true"; } - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - multiplyUnsafe(scalar) { - let n4 = assertGE0(scalar); - if (n4 === _0n$6) - return I2; - if (this.equals(I2) || n4 === _1n$9) - return this; - if (this.equals(G2)) - return this.wNAF(n4).p; - return wnaf.unsafeLadder(this, n4); + return value; + } + function parse2(query, options) { + options = Object.assign({ + decode: true, + sort: true, + arrayFormat: "none", + arrayFormatSeparator: ",", + parseNumbers: false, + parseBooleans: false + }, options); + validateArrayFormatSeparator(options.arrayFormatSeparator); + const formatter = parserForArrayFormat(options); + const ret = /* @__PURE__ */ Object.create(null); + if (typeof query !== "string") { + return ret; } - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder() { - return this.multiplyUnsafe(cofactor).is0(); + query = query.trim().replace(/^[?#&]/, ""); + if (!query) { + return ret; } - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree() { - return wnaf.unsafeLadder(this, CURVE_ORDER).is0(); + for (const param of query.split("&")) { + if (param === "") { + continue; + } + let [key2, value] = splitOnFirst$1(options.decode ? param.replace(/\+/g, " ") : param, "="); + value = value === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(options.arrayFormat) ? value : decode3(value, options); + formatter(decode3(key2, options), value, ret); } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(iz) { - const { ex: x3, ey: y3, ez: z3 } = this; - const is0 = this.is0(); - if (iz == null) - iz = is0 ? _8n$2 : Fp2.inv(z3); - const ax = modP(x3 * iz); - const ay = modP(y3 * iz); - const zz = modP(z3 * iz); - if (is0) - return { x: _0n$6, y: _1n$9 }; - if (zz !== _1n$9) - throw new Error("invZ was invalid"); - return { x: ax, y: ay }; + for (const key2 of Object.keys(ret)) { + const value = ret[key2]; + if (typeof value === "object" && value !== null) { + for (const k2 of Object.keys(value)) { + value[k2] = parseValue(value[k2], options); + } + } else { + ret[key2] = parseValue(value, options); + } } - clearCofactor() { - const { h: cofactor2 } = CURVE; - if (cofactor2 === _1n$9) - return this; - return this.multiplyUnsafe(cofactor2); + if (options.sort === false) { + return ret; } - // Converts hash string or Uint8Array to Point. - // Uses algo from RFC8032 5.1.3. - static fromHex(hex, zip215 = false) { - const { d: d4, a: a3 } = CURVE; - const len = Fp2.BYTES; - hex = ensureBytes$1("pointHex", hex, len); - const normed = hex.slice(); - const lastByte = hex[len - 1]; - normed[len - 1] = lastByte & ~128; - const y3 = bytesToNumberLE$1(normed); - if (y3 === _0n$6) - ; - else { - if (zip215) - assertInRange(y3, MASK); - else - assertInRange(y3, Fp2.ORDER); + return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key2) => { + const value = ret[key2]; + if (Boolean(value) && typeof value === "object" && !Array.isArray(value)) { + result[key2] = keysSorter(value); + } else { + result[key2] = value; } - const y22 = modP(y3 * y3); - const u2 = modP(y22 - _1n$9); - const v6 = modP(d4 * y22 - a3); - let { isValid: isValid2, value: x3 } = uvRatio2(u2, v6); - if (!isValid2) - throw new Error("Point.fromHex: invalid y coordinate"); - const isXOdd = (x3 & _1n$9) === _1n$9; - const isLastByteOdd = (lastByte & 128) !== 0; - if (!zip215 && x3 === _0n$6 && isLastByteOdd) - throw new Error("Point.fromHex: x=0 and x_0=1"); - if (isLastByteOdd !== isXOdd) - x3 = modP(-x3); - return Point2.fromAffine({ x: x3, y: y3 }); - } - static fromPrivateKey(privKey) { - return getExtendedPublicKey(privKey).point; + return result; + }, /* @__PURE__ */ Object.create(null)); + } + exports.extract = extract; + exports.parse = parse2; + exports.stringify = (object, options) => { + if (!object) { + return ""; } - toRawBytes() { - const { x: x3, y: y3 } = this.toAffine(); - const bytes2 = numberToBytesLE$1(y3, Fp2.BYTES); - bytes2[bytes2.length - 1] |= x3 & _1n$9 ? 128 : 0; - return bytes2; + options = Object.assign({ + encode: true, + strict: true, + arrayFormat: "none", + arrayFormatSeparator: "," + }, options); + validateArrayFormatSeparator(options.arrayFormatSeparator); + const shouldFilter = (key2) => options.skipNull && isNullOrUndefined(object[key2]) || options.skipEmptyString && object[key2] === ""; + const formatter = encoderForArrayFormat(options); + const objectCopy = {}; + for (const key2 of Object.keys(object)) { + if (!shouldFilter(key2)) { + objectCopy[key2] = object[key2]; + } } - toHex() { - return bytesToHex$1(this.toRawBytes()); + const keys2 = Object.keys(objectCopy); + if (options.sort !== false) { + keys2.sort(options.sort); } - } - Point2.BASE = new Point2(CURVE.Gx, CURVE.Gy, _1n$9, modP(CURVE.Gx * CURVE.Gy)); - Point2.ZERO = new Point2(_0n$6, _1n$9, _1n$9, _0n$6); - const { BASE: G2, ZERO: I2 } = Point2; - const wnaf = wNAF$1(Point2, nByteLength * 8); - function modN(a3) { - return mod$1(a3, CURVE_ORDER); - } - function modN_LE(hash3) { - return modN(bytesToNumberLE$1(hash3)); - } - function getExtendedPublicKey(key2) { - const len = nByteLength; - key2 = ensureBytes$1("private key", key2, len); - const hashed = ensureBytes$1("hashed private key", cHash(key2), 2 * len); - const head = adjustScalarBytes2(hashed.slice(0, len)); - const prefix = hashed.slice(len, 2 * len); - const scalar = modN_LE(head); - const point5 = G2.multiply(scalar); - const pointBytes = point5.toRawBytes(); - return { head, prefix, scalar, point: point5, pointBytes }; - } - function getPublicKey(privKey) { - return getExtendedPublicKey(privKey).pointBytes; - } - function hashDomainToScalar(context = new Uint8Array(), ...msgs) { - const msg = concatBytes$2(...msgs); - return modN_LE(cHash(domain(msg, ensureBytes$1("context", context), !!prehash))); - } - function sign6(msg, privKey, options = {}) { - msg = ensureBytes$1("message", msg); - if (prehash) - msg = prehash(msg); - const { prefix, scalar, pointBytes } = getExtendedPublicKey(privKey); - const r2 = hashDomainToScalar(options.context, prefix, msg); - const R3 = G2.multiply(r2).toRawBytes(); - const k2 = hashDomainToScalar(options.context, R3, pointBytes, msg); - const s2 = modN(r2 + k2 * scalar); - assertGE0(s2); - const res = concatBytes$2(R3, numberToBytesLE$1(s2, Fp2.BYTES)); - return ensureBytes$1("result", res, nByteLength * 2); - } - const verifyOpts = VERIFY_DEFAULT; - function verify6(sig, msg, publicKey2, options = verifyOpts) { - const { context, zip215 } = options; - const len = Fp2.BYTES; - sig = ensureBytes$1("signature", sig, 2 * len); - msg = ensureBytes$1("message", msg); - if (prehash) - msg = prehash(msg); - const s2 = bytesToNumberLE$1(sig.slice(len, 2 * len)); - let A2, R3, SB; - try { - A2 = Point2.fromHex(publicKey2, zip215); - R3 = Point2.fromHex(sig.slice(0, len), zip215); - SB = G2.multiplyUnsafe(s2); - } catch (error) { - return false; + return keys2.map((key2) => { + const value = object[key2]; + if (value === void 0) { + return ""; + } + if (value === null) { + return encode5(key2, options); + } + if (Array.isArray(value)) { + if (value.length === 0 && options.arrayFormat === "bracket-separator") { + return encode5(key2, options) + "[]"; + } + return value.reduce(formatter(key2), []).join("&"); + } + return encode5(key2, options) + "=" + encode5(value, options); + }).filter((x3) => x3.length > 0).join("&"); + }; + exports.parseUrl = (url, options) => { + options = Object.assign({ + decode: true + }, options); + const [url_, hash3] = splitOnFirst$1(url, "#"); + return Object.assign( + { + url: url_.split("?")[0] || "", + query: parse2(extract(url), options) + }, + options && options.parseFragmentIdentifier && hash3 ? { fragmentIdentifier: decode3(hash3, options) } : {} + ); + }; + exports.stringifyUrl = (object, options) => { + options = Object.assign({ + encode: true, + strict: true, + [encodeFragmentIdentifier]: true + }, options); + const url = removeHash(object.url).split("?")[0] || ""; + const queryFromUrl = exports.extract(object.url); + const parsedQueryFromUrl = exports.parse(queryFromUrl, { sort: false }); + const query = Object.assign(parsedQueryFromUrl, object.query); + let queryString2 = exports.stringify(query, options); + if (queryString2) { + queryString2 = `?${queryString2}`; } - if (!zip215 && A2.isSmallOrder()) - return false; - const k2 = hashDomainToScalar(context, R3.toRawBytes(), A2.toRawBytes(), msg); - const RkA = R3.add(A2.multiplyUnsafe(k2)); - return RkA.subtract(SB).clearCofactor().equals(Point2.ZERO); - } - G2._setWindowSize(8); - const utils2 = { - getExtendedPublicKey, - // ed25519 private keys are uniform 32b. No need to check for modulo bias, like in secp256k1. - randomPrivateKey: () => randomBytes2(Fp2.BYTES), - /** - * We're doing scalar multiplication (used in getPublicKey etc) with precomputed BASE_POINT - * values. This slows down first getPublicKey() by milliseconds (see Speed section), - * but allows to speed-up subsequent getPublicKey() calls up to 20x. - * @param windowSize 2, 4, 8, 16 - */ - precompute(windowSize = 8, point5 = Point2.BASE) { - point5._setWindowSize(windowSize); - point5.multiply(BigInt(3)); - return point5; + let hash3 = getHash2(object.url); + if (object.fragmentIdentifier) { + hash3 = `#${options[encodeFragmentIdentifier] ? encode5(object.fragmentIdentifier, options) : object.fragmentIdentifier}`; } + return `${url}${queryString2}${hash3}`; }; - return { - CURVE, - getPublicKey, - sign: sign6, - verify: verify6, - ExtendedPoint: Point2, - utils: utils2 + exports.pick = (input, filter2, options) => { + options = Object.assign({ + parseFragmentIdentifier: true, + [encodeFragmentIdentifier]: false + }, options); + const { url, query, fragmentIdentifier } = exports.parseUrl(input, options); + return exports.stringifyUrl({ + url, + query: filterObject(query, filter2), + fragmentIdentifier + }, options); + }; + exports.exclude = (input, filter2, options) => { + const exclusionFilter = Array.isArray(filter2) ? (key2) => !filter2.includes(key2) : (key2, value) => !filter2(key2, value); + return exports.pick(input, exclusionFilter, options); + }; +})(queryString); +var chacha20poly1305 = {}; +var chacha = {}; +var binary = {}; +var int = {}; +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + function imulShim(a3, b2) { + var ah2 = a3 >>> 16 & 65535, al2 = a3 & 65535; + var bh2 = b2 >>> 16 & 65535, bl2 = b2 & 65535; + return al2 * bl2 + (ah2 * bl2 + al2 * bh2 << 16 >>> 0) | 0; + } + exports.mul = Math.imul || imulShim; + function add6(a3, b2) { + return a3 + b2 | 0; + } + exports.add = add6; + function sub(a3, b2) { + return a3 - b2 | 0; + } + exports.sub = sub; + function rotl2(x3, n5) { + return x3 << n5 | x3 >>> 32 - n5; + } + exports.rotl = rotl2; + function rotr2(x3, n5) { + return x3 << 32 - n5 | x3 >>> n5; + } + exports.rotr = rotr2; + function isIntegerShim(n5) { + return typeof n5 === "number" && isFinite(n5) && Math.floor(n5) === n5; + } + exports.isInteger = Number.isInteger || isIntegerShim; + exports.MAX_SAFE_INTEGER = 9007199254740991; + exports.isSafeInteger = function(n5) { + return exports.isInteger(n5) && (n5 >= -exports.MAX_SAFE_INTEGER && n5 <= exports.MAX_SAFE_INTEGER); }; +})(int); +Object.defineProperty(binary, "__esModule", { value: true }); +var int_1 = int; +function readInt16BE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + return (array2[offset2 + 0] << 8 | array2[offset2 + 1]) << 16 >> 16; } -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const ED25519_P = BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"); -const ED25519_SQRT_M1 = /* @__PURE__ */ BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"); -BigInt(0); -const _1n$8 = BigInt(1), _2n$5 = BigInt(2); -BigInt(3); -const _5n$1 = BigInt(5), _8n$1 = BigInt(8); -function ed25519_pow_2_252_3(x3) { - const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); - const P2 = ED25519_P; - const x22 = x3 * x3 % P2; - const b2 = x22 * x3 % P2; - const b4 = pow2$1(b2, _2n$5, P2) * b2 % P2; - const b5 = pow2$1(b4, _1n$8, P2) * x3 % P2; - const b10 = pow2$1(b5, _5n$1, P2) * b5 % P2; - const b20 = pow2$1(b10, _10n, P2) * b10 % P2; - const b40 = pow2$1(b20, _20n, P2) * b20 % P2; - const b80 = pow2$1(b40, _40n, P2) * b40 % P2; - const b160 = pow2$1(b80, _80n, P2) * b80 % P2; - const b240 = pow2$1(b160, _80n, P2) * b80 % P2; - const b250 = pow2$1(b240, _10n, P2) * b10 % P2; - const pow_p_5_8 = pow2$1(b250, _2n$5, P2) * x3 % P2; - return { pow_p_5_8, b2 }; +binary.readInt16BE = readInt16BE; +function readUint16BE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + return (array2[offset2 + 0] << 8 | array2[offset2 + 1]) >>> 0; } -function adjustScalarBytes(bytes2) { - bytes2[0] &= 248; - bytes2[31] &= 127; - bytes2[31] |= 64; - return bytes2; +binary.readUint16BE = readUint16BE; +function readInt16LE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + return (array2[offset2 + 1] << 8 | array2[offset2]) << 16 >> 16; } -function uvRatio(u2, v6) { - const P2 = ED25519_P; - const v32 = mod$1(v6 * v6 * v6, P2); - const v7 = mod$1(v32 * v32 * v6, P2); - const pow3 = ed25519_pow_2_252_3(u2 * v7).pow_p_5_8; - let x3 = mod$1(u2 * v32 * pow3, P2); - const vx2 = mod$1(v6 * x3 * x3, P2); - const root1 = x3; - const root2 = mod$1(x3 * ED25519_SQRT_M1, P2); - const useRoot1 = vx2 === u2; - const useRoot2 = vx2 === mod$1(-u2, P2); - const noRoot = vx2 === mod$1(-u2 * ED25519_SQRT_M1, P2); - if (useRoot1) - x3 = root1; - if (useRoot2 || noRoot) - x3 = root2; - if (isNegativeLE(x3, P2)) - x3 = mod$1(-x3, P2); - return { isValid: useRoot1 || useRoot2, value: x3 }; +binary.readInt16LE = readInt16LE; +function readUint16LE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + return (array2[offset2 + 1] << 8 | array2[offset2]) >>> 0; } -const Fp$2 = /* @__PURE__ */ (() => Field$1(ED25519_P, void 0, true))(); -const ed25519Defaults = /* @__PURE__ */ (() => ({ - // Param: a - a: BigInt(-1), - // Fp.create(-1) is proper; our way still works and is faster - // d is equal to -121665/121666 over finite field. - // Negative number is P - number, and division is invert(number, P) - d: BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"), - // Finite field 𝔽p over which we'll do calculations; 2n**255n - 19n - Fp: Fp$2, - // Subgroup order: how many points curve has - // 2n**252n + 27742317777372353535851937790883648493n; - n: BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"), - // Cofactor - h: _8n$1, - // Base point (x, y) aka generator point - Gx: BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"), - Gy: BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"), - hash: sha512$2, - randomBytes: randomBytes$3, - adjustScalarBytes, - // dom2 - // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. - // Constant-time, u/√v - uvRatio -}))(); -const ed25519$1 = /* @__PURE__ */ (() => twistedEdwards(ed25519Defaults))(); -var bn$2 = { exports: {} }; -const __viteBrowserExternal = {}; -const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - default: __viteBrowserExternal -}, Symbol.toStringTag, { value: "Module" })); -const require$$3 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1); -bn$2.exports; -(function(module) { - (function(module2, exports) { - function assert2(val, msg) { - if (!val) - throw new Error(msg || "Assertion failed"); - } - function inherits2(ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function() { - }; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - function BN2(number2, base3, endian) { - if (BN2.isBN(number2)) { - return number2; - } - this.negative = 0; - this.words = null; - this.length = 0; - this.red = null; - if (number2 !== null) { - if (base3 === "le" || base3 === "be") { - endian = base3; - base3 = 10; - } - this._init(number2 || 0, base3 || 10, endian || "be"); - } - } - if (typeof module2 === "object") { - module2.exports = BN2; - } else { - exports.BN = BN2; - } - BN2.BN = BN2; - BN2.wordSize = 26; - var Buffer2; - try { - if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { - Buffer2 = window.Buffer; - } else { - Buffer2 = require$$3.Buffer; - } - } catch (e18) { - } - BN2.isBN = function isBN(num) { - if (num instanceof BN2) { - return true; - } - return num !== null && typeof num === "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words); - }; - BN2.max = function max(left, right) { - if (left.cmp(right) > 0) - return left; - return right; - }; - BN2.min = function min(left, right) { - if (left.cmp(right) < 0) - return left; - return right; - }; - BN2.prototype._init = function init3(number2, base3, endian) { - if (typeof number2 === "number") { - return this._initNumber(number2, base3, endian); - } - if (typeof number2 === "object") { - return this._initArray(number2, base3, endian); - } - if (base3 === "hex") { - base3 = 16; - } - assert2(base3 === (base3 | 0) && base3 >= 2 && base3 <= 36); - number2 = number2.toString().replace(/\s+/g, ""); - var start = 0; - if (number2[0] === "-") { - start++; - this.negative = 1; - } - if (start < number2.length) { - if (base3 === 16) { - this._parseHex(number2, start, endian); - } else { - this._parseBase(number2, base3, start); - if (endian === "le") { - this._initArray(this.toArray(), base3, endian); - } - } - } - }; - BN2.prototype._initNumber = function _initNumber(number2, base3, endian) { - if (number2 < 0) { - this.negative = 1; - number2 = -number2; - } - if (number2 < 67108864) { - this.words = [number2 & 67108863]; - this.length = 1; - } else if (number2 < 4503599627370496) { - this.words = [ - number2 & 67108863, - number2 / 67108864 & 67108863 - ]; - this.length = 2; - } else { - assert2(number2 < 9007199254740992); - this.words = [ - number2 & 67108863, - number2 / 67108864 & 67108863, - 1 - ]; - this.length = 3; - } - if (endian !== "le") - return; - this._initArray(this.toArray(), base3, endian); - }; - BN2.prototype._initArray = function _initArray(number2, base3, endian) { - assert2(typeof number2.length === "number"); - if (number2.length <= 0) { - this.words = [0]; - this.length = 1; - return this; - } - this.length = Math.ceil(number2.length / 3); - this.words = new Array(this.length); - for (var i3 = 0; i3 < this.length; i3++) { - this.words[i3] = 0; - } - var j2, w2; - var off = 0; - if (endian === "be") { - for (i3 = number2.length - 1, j2 = 0; i3 >= 0; i3 -= 3) { - w2 = number2[i3] | number2[i3 - 1] << 8 | number2[i3 - 2] << 16; - this.words[j2] |= w2 << off & 67108863; - this.words[j2 + 1] = w2 >>> 26 - off & 67108863; - off += 24; - if (off >= 26) { - off -= 26; - j2++; - } - } - } else if (endian === "le") { - for (i3 = 0, j2 = 0; i3 < number2.length; i3 += 3) { - w2 = number2[i3] | number2[i3 + 1] << 8 | number2[i3 + 2] << 16; - this.words[j2] |= w2 << off & 67108863; - this.words[j2 + 1] = w2 >>> 26 - off & 67108863; - off += 24; - if (off >= 26) { - off -= 26; - j2++; - } - } - } - return this._strip(); - }; - function parseHex4Bits(string2, index2) { - var c2 = string2.charCodeAt(index2); - if (c2 >= 48 && c2 <= 57) { - return c2 - 48; - } else if (c2 >= 65 && c2 <= 70) { - return c2 - 55; - } else if (c2 >= 97 && c2 <= 102) { - return c2 - 87; - } else { - assert2(false, "Invalid character in " + string2); - } - } - function parseHexByte(string2, lowerBound, index2) { - var r2 = parseHex4Bits(string2, index2); - if (index2 - 1 >= lowerBound) { - r2 |= parseHex4Bits(string2, index2 - 1) << 4; - } - return r2; - } - BN2.prototype._parseHex = function _parseHex(number2, start, endian) { - this.length = Math.ceil((number2.length - start) / 6); - this.words = new Array(this.length); - for (var i3 = 0; i3 < this.length; i3++) { - this.words[i3] = 0; - } - var off = 0; - var j2 = 0; - var w2; - if (endian === "be") { - for (i3 = number2.length - 1; i3 >= start; i3 -= 2) { - w2 = parseHexByte(number2, start, i3) << off; - this.words[j2] |= w2 & 67108863; - if (off >= 18) { - off -= 18; - j2 += 1; - this.words[j2] |= w2 >>> 26; - } else { - off += 8; - } - } - } else { - var parseLength = number2.length - start; - for (i3 = parseLength % 2 === 0 ? start + 1 : start; i3 < number2.length; i3 += 2) { - w2 = parseHexByte(number2, start, i3) << off; - this.words[j2] |= w2 & 67108863; - if (off >= 18) { - off -= 18; - j2 += 1; - this.words[j2] |= w2 >>> 26; - } else { - off += 8; - } - } - } - this._strip(); - }; - function parseBase(str, start, end, mul6) { - var r2 = 0; - var b2 = 0; - var len = Math.min(str.length, end); - for (var i3 = start; i3 < len; i3++) { - var c2 = str.charCodeAt(i3) - 48; - r2 *= mul6; - if (c2 >= 49) { - b2 = c2 - 49 + 10; - } else if (c2 >= 17) { - b2 = c2 - 17 + 10; - } else { - b2 = c2; - } - assert2(c2 >= 0 && b2 < mul6, "Invalid character"); - r2 += b2; - } - return r2; - } - BN2.prototype._parseBase = function _parseBase(number2, base3, start) { - this.words = [0]; - this.length = 1; - for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base3) { - limbLen++; - } - limbLen--; - limbPow = limbPow / base3 | 0; - var total = number2.length - start; - var mod2 = total % limbLen; - var end = Math.min(total, total - mod2) + start; - var word = 0; - for (var i3 = start; i3 < end; i3 += limbLen) { - word = parseBase(number2, i3, i3 + limbLen, base3); - this.imuln(limbPow); - if (this.words[0] + word < 67108864) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - if (mod2 !== 0) { - var pow3 = 1; - word = parseBase(number2, i3, number2.length, base3); - for (i3 = 0; i3 < mod2; i3++) { - pow3 *= base3; - } - this.imuln(pow3); - if (this.words[0] + word < 67108864) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - this._strip(); - }; - BN2.prototype.copy = function copy(dest) { - dest.words = new Array(this.length); - for (var i3 = 0; i3 < this.length; i3++) { - dest.words[i3] = this.words[i3]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - function move(dest, src2) { - dest.words = src2.words; - dest.length = src2.length; - dest.negative = src2.negative; - dest.red = src2.red; - } - BN2.prototype._move = function _move(dest) { - move(dest, this); - }; - BN2.prototype.clone = function clone2() { - var r2 = new BN2(null); - this.copy(r2); - return r2; - }; - BN2.prototype._expand = function _expand(size2) { - while (this.length < size2) { - this.words[this.length++] = 0; - } - return this; - }; - BN2.prototype._strip = function strip() { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - BN2.prototype._normSign = function _normSign() { - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") { - try { - BN2.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect6; - } catch (e18) { - BN2.prototype.inspect = inspect6; - } - } else { - BN2.prototype.inspect = inspect6; +binary.readUint16LE = readUint16LE; +function writeUint16BE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(2); + } + if (offset2 === void 0) { + offset2 = 0; + } + out[offset2 + 0] = value >>> 8; + out[offset2 + 1] = value >>> 0; + return out; +} +binary.writeUint16BE = writeUint16BE; +binary.writeInt16BE = writeUint16BE; +function writeUint16LE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(2); + } + if (offset2 === void 0) { + offset2 = 0; + } + out[offset2 + 0] = value >>> 0; + out[offset2 + 1] = value >>> 8; + return out; +} +binary.writeUint16LE = writeUint16LE; +binary.writeInt16LE = writeUint16LE; +function readInt32BE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + return array2[offset2] << 24 | array2[offset2 + 1] << 16 | array2[offset2 + 2] << 8 | array2[offset2 + 3]; +} +binary.readInt32BE = readInt32BE; +function readUint32BE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + return (array2[offset2] << 24 | array2[offset2 + 1] << 16 | array2[offset2 + 2] << 8 | array2[offset2 + 3]) >>> 0; +} +binary.readUint32BE = readUint32BE; +function readInt32LE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + return array2[offset2 + 3] << 24 | array2[offset2 + 2] << 16 | array2[offset2 + 1] << 8 | array2[offset2]; +} +binary.readInt32LE = readInt32LE; +function readUint32LE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + return (array2[offset2 + 3] << 24 | array2[offset2 + 2] << 16 | array2[offset2 + 1] << 8 | array2[offset2]) >>> 0; +} +binary.readUint32LE = readUint32LE; +function writeUint32BE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(4); + } + if (offset2 === void 0) { + offset2 = 0; + } + out[offset2 + 0] = value >>> 24; + out[offset2 + 1] = value >>> 16; + out[offset2 + 2] = value >>> 8; + out[offset2 + 3] = value >>> 0; + return out; +} +binary.writeUint32BE = writeUint32BE; +binary.writeInt32BE = writeUint32BE; +function writeUint32LE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(4); + } + if (offset2 === void 0) { + offset2 = 0; + } + out[offset2 + 0] = value >>> 0; + out[offset2 + 1] = value >>> 8; + out[offset2 + 2] = value >>> 16; + out[offset2 + 3] = value >>> 24; + return out; +} +binary.writeUint32LE = writeUint32LE; +binary.writeInt32LE = writeUint32LE; +function readInt64BE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + var hi2 = readInt32BE(array2, offset2); + var lo2 = readInt32BE(array2, offset2 + 4); + return hi2 * 4294967296 + lo2 - (lo2 >> 31) * 4294967296; +} +binary.readInt64BE = readInt64BE; +function readUint64BE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + var hi2 = readUint32BE(array2, offset2); + var lo2 = readUint32BE(array2, offset2 + 4); + return hi2 * 4294967296 + lo2; +} +binary.readUint64BE = readUint64BE; +function readInt64LE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + var lo2 = readInt32LE(array2, offset2); + var hi2 = readInt32LE(array2, offset2 + 4); + return hi2 * 4294967296 + lo2 - (lo2 >> 31) * 4294967296; +} +binary.readInt64LE = readInt64LE; +function readUint64LE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + var lo2 = readUint32LE(array2, offset2); + var hi2 = readUint32LE(array2, offset2 + 4); + return hi2 * 4294967296 + lo2; +} +binary.readUint64LE = readUint64LE; +function writeUint64BE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(8); + } + if (offset2 === void 0) { + offset2 = 0; + } + writeUint32BE(value / 4294967296 >>> 0, out, offset2); + writeUint32BE(value >>> 0, out, offset2 + 4); + return out; +} +binary.writeUint64BE = writeUint64BE; +binary.writeInt64BE = writeUint64BE; +function writeUint64LE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(8); + } + if (offset2 === void 0) { + offset2 = 0; + } + writeUint32LE(value >>> 0, out, offset2); + writeUint32LE(value / 4294967296 >>> 0, out, offset2 + 4); + return out; +} +binary.writeUint64LE = writeUint64LE; +binary.writeInt64LE = writeUint64LE; +function readUintBE(bitLength, array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + if (bitLength % 8 !== 0) { + throw new Error("readUintBE supports only bitLengths divisible by 8"); + } + if (bitLength / 8 > array2.length - offset2) { + throw new Error("readUintBE: array is too short for the given bitLength"); + } + var result = 0; + var mul6 = 1; + for (var i2 = bitLength / 8 + offset2 - 1; i2 >= offset2; i2--) { + result += array2[i2] * mul6; + mul6 *= 256; + } + return result; +} +binary.readUintBE = readUintBE; +function readUintLE(bitLength, array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + if (bitLength % 8 !== 0) { + throw new Error("readUintLE supports only bitLengths divisible by 8"); + } + if (bitLength / 8 > array2.length - offset2) { + throw new Error("readUintLE: array is too short for the given bitLength"); + } + var result = 0; + var mul6 = 1; + for (var i2 = offset2; i2 < offset2 + bitLength / 8; i2++) { + result += array2[i2] * mul6; + mul6 *= 256; + } + return result; +} +binary.readUintLE = readUintLE; +function writeUintBE(bitLength, value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(bitLength / 8); + } + if (offset2 === void 0) { + offset2 = 0; + } + if (bitLength % 8 !== 0) { + throw new Error("writeUintBE supports only bitLengths divisible by 8"); + } + if (!int_1.isSafeInteger(value)) { + throw new Error("writeUintBE value must be an integer"); + } + var div = 1; + for (var i2 = bitLength / 8 + offset2 - 1; i2 >= offset2; i2--) { + out[i2] = value / div & 255; + div *= 256; + } + return out; +} +binary.writeUintBE = writeUintBE; +function writeUintLE(bitLength, value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(bitLength / 8); + } + if (offset2 === void 0) { + offset2 = 0; + } + if (bitLength % 8 !== 0) { + throw new Error("writeUintLE supports only bitLengths divisible by 8"); + } + if (!int_1.isSafeInteger(value)) { + throw new Error("writeUintLE value must be an integer"); + } + var div = 1; + for (var i2 = offset2; i2 < offset2 + bitLength / 8; i2++) { + out[i2] = value / div & 255; + div *= 256; + } + return out; +} +binary.writeUintLE = writeUintLE; +function readFloat32BE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); + return view.getFloat32(offset2); +} +binary.readFloat32BE = readFloat32BE; +function readFloat32LE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); + return view.getFloat32(offset2, true); +} +binary.readFloat32LE = readFloat32LE; +function readFloat64BE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); + return view.getFloat64(offset2); +} +binary.readFloat64BE = readFloat64BE; +function readFloat64LE(array2, offset2) { + if (offset2 === void 0) { + offset2 = 0; + } + var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); + return view.getFloat64(offset2, true); +} +binary.readFloat64LE = readFloat64LE; +function writeFloat32BE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(4); + } + if (offset2 === void 0) { + offset2 = 0; + } + var view = new DataView(out.buffer, out.byteOffset, out.byteLength); + view.setFloat32(offset2, value); + return out; +} +binary.writeFloat32BE = writeFloat32BE; +function writeFloat32LE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(4); + } + if (offset2 === void 0) { + offset2 = 0; + } + var view = new DataView(out.buffer, out.byteOffset, out.byteLength); + view.setFloat32(offset2, value, true); + return out; +} +binary.writeFloat32LE = writeFloat32LE; +function writeFloat64BE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(8); + } + if (offset2 === void 0) { + offset2 = 0; + } + var view = new DataView(out.buffer, out.byteOffset, out.byteLength); + view.setFloat64(offset2, value); + return out; +} +binary.writeFloat64BE = writeFloat64BE; +function writeFloat64LE(value, out, offset2) { + if (out === void 0) { + out = new Uint8Array(8); + } + if (offset2 === void 0) { + offset2 = 0; + } + var view = new DataView(out.buffer, out.byteOffset, out.byteLength); + view.setFloat64(offset2, value, true); + return out; +} +binary.writeFloat64LE = writeFloat64LE; +var wipe$1 = {}; +Object.defineProperty(wipe$1, "__esModule", { value: true }); +function wipe(array2) { + for (var i2 = 0; i2 < array2.length; i2++) { + array2[i2] = 0; + } + return array2; +} +wipe$1.wipe = wipe; +Object.defineProperty(chacha, "__esModule", { value: true }); +var binary_1 = binary; +var wipe_1$3 = wipe$1; +var ROUNDS = 20; +function core(out, input, key2) { + var j02 = 1634760805; + var j1 = 857760878; + var j2 = 2036477234; + var j3 = 1797285236; + var j4 = key2[3] << 24 | key2[2] << 16 | key2[1] << 8 | key2[0]; + var j5 = key2[7] << 24 | key2[6] << 16 | key2[5] << 8 | key2[4]; + var j6 = key2[11] << 24 | key2[10] << 16 | key2[9] << 8 | key2[8]; + var j7 = key2[15] << 24 | key2[14] << 16 | key2[13] << 8 | key2[12]; + var j8 = key2[19] << 24 | key2[18] << 16 | key2[17] << 8 | key2[16]; + var j9 = key2[23] << 24 | key2[22] << 16 | key2[21] << 8 | key2[20]; + var j10 = key2[27] << 24 | key2[26] << 16 | key2[25] << 8 | key2[24]; + var j11 = key2[31] << 24 | key2[30] << 16 | key2[29] << 8 | key2[28]; + var j12 = input[3] << 24 | input[2] << 16 | input[1] << 8 | input[0]; + var j13 = input[7] << 24 | input[6] << 16 | input[5] << 8 | input[4]; + var j14 = input[11] << 24 | input[10] << 16 | input[9] << 8 | input[8]; + var j15 = input[15] << 24 | input[14] << 16 | input[13] << 8 | input[12]; + var x02 = j02; + var x1 = j1; + var x22 = j2; + var x3 = j3; + var x4 = j4; + var x5 = j5; + var x6 = j6; + var x7 = j7; + var x8 = j8; + var x9 = j9; + var x10 = j10; + var x11 = j11; + var x12 = j12; + var x13 = j13; + var x14 = j14; + var x15 = j15; + for (var i2 = 0; i2 < ROUNDS; i2 += 2) { + x02 = x02 + x4 | 0; + x12 ^= x02; + x12 = x12 >>> 32 - 16 | x12 << 16; + x8 = x8 + x12 | 0; + x4 ^= x8; + x4 = x4 >>> 32 - 12 | x4 << 12; + x1 = x1 + x5 | 0; + x13 ^= x1; + x13 = x13 >>> 32 - 16 | x13 << 16; + x9 = x9 + x13 | 0; + x5 ^= x9; + x5 = x5 >>> 32 - 12 | x5 << 12; + x22 = x22 + x6 | 0; + x14 ^= x22; + x14 = x14 >>> 32 - 16 | x14 << 16; + x10 = x10 + x14 | 0; + x6 ^= x10; + x6 = x6 >>> 32 - 12 | x6 << 12; + x3 = x3 + x7 | 0; + x15 ^= x3; + x15 = x15 >>> 32 - 16 | x15 << 16; + x11 = x11 + x15 | 0; + x7 ^= x11; + x7 = x7 >>> 32 - 12 | x7 << 12; + x22 = x22 + x6 | 0; + x14 ^= x22; + x14 = x14 >>> 32 - 8 | x14 << 8; + x10 = x10 + x14 | 0; + x6 ^= x10; + x6 = x6 >>> 32 - 7 | x6 << 7; + x3 = x3 + x7 | 0; + x15 ^= x3; + x15 = x15 >>> 32 - 8 | x15 << 8; + x11 = x11 + x15 | 0; + x7 ^= x11; + x7 = x7 >>> 32 - 7 | x7 << 7; + x1 = x1 + x5 | 0; + x13 ^= x1; + x13 = x13 >>> 32 - 8 | x13 << 8; + x9 = x9 + x13 | 0; + x5 ^= x9; + x5 = x5 >>> 32 - 7 | x5 << 7; + x02 = x02 + x4 | 0; + x12 ^= x02; + x12 = x12 >>> 32 - 8 | x12 << 8; + x8 = x8 + x12 | 0; + x4 ^= x8; + x4 = x4 >>> 32 - 7 | x4 << 7; + x02 = x02 + x5 | 0; + x15 ^= x02; + x15 = x15 >>> 32 - 16 | x15 << 16; + x10 = x10 + x15 | 0; + x5 ^= x10; + x5 = x5 >>> 32 - 12 | x5 << 12; + x1 = x1 + x6 | 0; + x12 ^= x1; + x12 = x12 >>> 32 - 16 | x12 << 16; + x11 = x11 + x12 | 0; + x6 ^= x11; + x6 = x6 >>> 32 - 12 | x6 << 12; + x22 = x22 + x7 | 0; + x13 ^= x22; + x13 = x13 >>> 32 - 16 | x13 << 16; + x8 = x8 + x13 | 0; + x7 ^= x8; + x7 = x7 >>> 32 - 12 | x7 << 12; + x3 = x3 + x4 | 0; + x14 ^= x3; + x14 = x14 >>> 32 - 16 | x14 << 16; + x9 = x9 + x14 | 0; + x4 ^= x9; + x4 = x4 >>> 32 - 12 | x4 << 12; + x22 = x22 + x7 | 0; + x13 ^= x22; + x13 = x13 >>> 32 - 8 | x13 << 8; + x8 = x8 + x13 | 0; + x7 ^= x8; + x7 = x7 >>> 32 - 7 | x7 << 7; + x3 = x3 + x4 | 0; + x14 ^= x3; + x14 = x14 >>> 32 - 8 | x14 << 8; + x9 = x9 + x14 | 0; + x4 ^= x9; + x4 = x4 >>> 32 - 7 | x4 << 7; + x1 = x1 + x6 | 0; + x12 ^= x1; + x12 = x12 >>> 32 - 8 | x12 << 8; + x11 = x11 + x12 | 0; + x6 ^= x11; + x6 = x6 >>> 32 - 7 | x6 << 7; + x02 = x02 + x5 | 0; + x15 ^= x02; + x15 = x15 >>> 32 - 8 | x15 << 8; + x10 = x10 + x15 | 0; + x5 ^= x10; + x5 = x5 >>> 32 - 7 | x5 << 7; + } + binary_1.writeUint32LE(x02 + j02 | 0, out, 0); + binary_1.writeUint32LE(x1 + j1 | 0, out, 4); + binary_1.writeUint32LE(x22 + j2 | 0, out, 8); + binary_1.writeUint32LE(x3 + j3 | 0, out, 12); + binary_1.writeUint32LE(x4 + j4 | 0, out, 16); + binary_1.writeUint32LE(x5 + j5 | 0, out, 20); + binary_1.writeUint32LE(x6 + j6 | 0, out, 24); + binary_1.writeUint32LE(x7 + j7 | 0, out, 28); + binary_1.writeUint32LE(x8 + j8 | 0, out, 32); + binary_1.writeUint32LE(x9 + j9 | 0, out, 36); + binary_1.writeUint32LE(x10 + j10 | 0, out, 40); + binary_1.writeUint32LE(x11 + j11 | 0, out, 44); + binary_1.writeUint32LE(x12 + j12 | 0, out, 48); + binary_1.writeUint32LE(x13 + j13 | 0, out, 52); + binary_1.writeUint32LE(x14 + j14 | 0, out, 56); + binary_1.writeUint32LE(x15 + j15 | 0, out, 60); +} +function streamXOR(key2, nonce, src2, dst, nonceInplaceCounterLength) { + if (nonceInplaceCounterLength === void 0) { + nonceInplaceCounterLength = 0; + } + if (key2.length !== 32) { + throw new Error("ChaCha: key size must be 32 bytes"); + } + if (dst.length < src2.length) { + throw new Error("ChaCha: destination is shorter than source"); + } + var nc2; + var counterLength; + if (nonceInplaceCounterLength === 0) { + if (nonce.length !== 8 && nonce.length !== 12) { + throw new Error("ChaCha nonce must be 8 or 12 bytes"); } - function inspect6() { - return (this.red ? ""; + nc2 = new Uint8Array(16); + counterLength = nc2.length - nonce.length; + nc2.set(nonce, counterLength); + } else { + if (nonce.length !== 16) { + throw new Error("ChaCha nonce with counter must be 16 bytes"); } - var zeros = [ - "", - "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 groupSizes = [ - 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 groupBases = [ - 0, - 0, - 33554432, - 43046721, - 16777216, - 48828125, - 60466176, - 40353607, - 16777216, - 43046721, - 1e7, - 19487171, - 35831808, - 62748517, - 7529536, - 11390625, - 16777216, - 24137569, - 34012224, - 47045881, - 64e6, - 4084101, - 5153632, - 6436343, - 7962624, - 9765625, - 11881376, - 14348907, - 17210368, - 20511149, - 243e5, - 28629151, - 33554432, - 39135393, - 45435424, - 52521875, - 60466176 - ]; - BN2.prototype.toString = function toString3(base3, padding2) { - base3 = base3 || 10; - padding2 = padding2 | 0 || 1; - var out; - if (base3 === 16 || base3 === "hex") { - out = ""; - var off = 0; - var carry = 0; - for (var i3 = 0; i3 < this.length; i3++) { - var w2 = this.words[i3]; - var word = ((w2 << off | carry) & 16777215).toString(16); - carry = w2 >>> 24 - off & 16777215; - off += 2; - if (off >= 26) { - off -= 26; - i3--; - } - if (carry !== 0 || i3 !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } + nc2 = nonce; + counterLength = nonceInplaceCounterLength; + } + var block = new Uint8Array(64); + for (var i2 = 0; i2 < src2.length; i2 += 64) { + core(block, nc2, key2); + for (var j2 = i2; j2 < i2 + 64 && j2 < src2.length; j2++) { + dst[j2] = src2[j2] ^ block[j2 - i2]; + } + incrementCounter(nc2, 0, counterLength); + } + wipe_1$3.wipe(block); + if (nonceInplaceCounterLength === 0) { + wipe_1$3.wipe(nc2); + } + return dst; +} +chacha.streamXOR = streamXOR; +function stream(key2, nonce, dst, nonceInplaceCounterLength) { + if (nonceInplaceCounterLength === void 0) { + nonceInplaceCounterLength = 0; + } + wipe_1$3.wipe(dst); + return streamXOR(key2, nonce, dst, dst, nonceInplaceCounterLength); +} +chacha.stream = stream; +function incrementCounter(counter, pos, len) { + var carry = 1; + while (len--) { + carry = carry + (counter[pos] & 255) | 0; + counter[pos] = carry & 255; + carry >>>= 8; + pos++; + } + if (carry > 0) { + throw new Error("ChaCha: counter overflow"); + } +} +var poly1305 = {}; +var constantTime = {}; +Object.defineProperty(constantTime, "__esModule", { value: true }); +function select(subject, resultIfOne, resultIfZero) { + return ~(subject - 1) & resultIfOne | subject - 1 & resultIfZero; +} +constantTime.select = select; +function lessOrEqual(a3, b2) { + return (a3 | 0) - (b2 | 0) - 1 >>> 31 & 1; +} +constantTime.lessOrEqual = lessOrEqual; +function compare$1(a3, b2) { + if (a3.length !== b2.length) { + return 0; + } + var result = 0; + for (var i2 = 0; i2 < a3.length; i2++) { + result |= a3[i2] ^ b2[i2]; + } + return 1 & result - 1 >>> 8; +} +constantTime.compare = compare$1; +function equal(a3, b2) { + if (a3.length === 0 || b2.length === 0) { + return false; + } + return compare$1(a3, b2) !== 0; +} +constantTime.equal = equal; +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + var constant_time_12 = constantTime; + var wipe_12 = wipe$1; + exports.DIGEST_LENGTH = 16; + var Poly1305 = ( + /** @class */ + function() { + function Poly13052(key2) { + this.digestLength = exports.DIGEST_LENGTH; + this._buffer = new Uint8Array(16); + this._r = new Uint16Array(10); + this._h = new Uint16Array(10); + this._pad = new Uint16Array(8); + this._leftover = 0; + this._fin = 0; + this._finished = false; + var t02 = key2[0] | key2[1] << 8; + this._r[0] = t02 & 8191; + var t1 = key2[2] | key2[3] << 8; + this._r[1] = (t02 >>> 13 | t1 << 3) & 8191; + var t2 = key2[4] | key2[5] << 8; + this._r[2] = (t1 >>> 10 | t2 << 6) & 7939; + var t3 = key2[6] | key2[7] << 8; + this._r[3] = (t2 >>> 7 | t3 << 9) & 8191; + var t4 = key2[8] | key2[9] << 8; + this._r[4] = (t3 >>> 4 | t4 << 12) & 255; + this._r[5] = t4 >>> 1 & 8190; + var t5 = key2[10] | key2[11] << 8; + this._r[6] = (t4 >>> 14 | t5 << 2) & 8191; + var t6 = key2[12] | key2[13] << 8; + this._r[7] = (t5 >>> 11 | t6 << 5) & 8065; + var t7 = key2[14] | key2[15] << 8; + this._r[8] = (t6 >>> 8 | t7 << 8) & 8191; + this._r[9] = t7 >>> 5 & 127; + this._pad[0] = key2[16] | key2[17] << 8; + this._pad[1] = key2[18] | key2[19] << 8; + this._pad[2] = key2[20] | key2[21] << 8; + this._pad[3] = key2[22] | key2[23] << 8; + this._pad[4] = key2[24] | key2[25] << 8; + this._pad[5] = key2[26] | key2[27] << 8; + this._pad[6] = key2[28] | key2[29] << 8; + this._pad[7] = key2[30] | key2[31] << 8; + } + Poly13052.prototype._blocks = function(m3, mpos, bytes2) { + var hibit = this._fin ? 0 : 1 << 11; + var h0 = this._h[0], h1 = this._h[1], h22 = this._h[2], h32 = this._h[3], h4 = this._h[4], h5 = this._h[5], h6 = this._h[6], h7 = this._h[7], h8 = this._h[8], h9 = this._h[9]; + var r02 = this._r[0], r1 = this._r[1], r2 = this._r[2], r3 = this._r[3], r4 = this._r[4], r5 = this._r[5], r6 = this._r[6], r7 = this._r[7], r8 = this._r[8], r9 = this._r[9]; + while (bytes2 >= 16) { + var t02 = m3[mpos + 0] | m3[mpos + 1] << 8; + h0 += t02 & 8191; + var t1 = m3[mpos + 2] | m3[mpos + 3] << 8; + h1 += (t02 >>> 13 | t1 << 3) & 8191; + var t2 = m3[mpos + 4] | m3[mpos + 5] << 8; + h22 += (t1 >>> 10 | t2 << 6) & 8191; + var t3 = m3[mpos + 6] | m3[mpos + 7] << 8; + h32 += (t2 >>> 7 | t3 << 9) & 8191; + var t4 = m3[mpos + 8] | m3[mpos + 9] << 8; + h4 += (t3 >>> 4 | t4 << 12) & 8191; + h5 += t4 >>> 1 & 8191; + var t5 = m3[mpos + 10] | m3[mpos + 11] << 8; + h6 += (t4 >>> 14 | t5 << 2) & 8191; + var t6 = m3[mpos + 12] | m3[mpos + 13] << 8; + h7 += (t5 >>> 11 | t6 << 5) & 8191; + var t7 = m3[mpos + 14] | m3[mpos + 15] << 8; + h8 += (t6 >>> 8 | t7 << 8) & 8191; + h9 += t7 >>> 5 | hibit; + var c2 = 0; + var d02 = c2; + d02 += h0 * r02; + d02 += h1 * (5 * r9); + d02 += h22 * (5 * r8); + d02 += h32 * (5 * r7); + d02 += h4 * (5 * r6); + c2 = d02 >>> 13; + d02 &= 8191; + d02 += h5 * (5 * r5); + d02 += h6 * (5 * r4); + d02 += h7 * (5 * r3); + d02 += h8 * (5 * r2); + d02 += h9 * (5 * r1); + c2 += d02 >>> 13; + d02 &= 8191; + var d1 = c2; + d1 += h0 * r1; + d1 += h1 * r02; + d1 += h22 * (5 * r9); + d1 += h32 * (5 * r8); + d1 += h4 * (5 * r7); + c2 = d1 >>> 13; + d1 &= 8191; + d1 += h5 * (5 * r6); + d1 += h6 * (5 * r5); + d1 += h7 * (5 * r4); + d1 += h8 * (5 * r3); + d1 += h9 * (5 * r2); + c2 += d1 >>> 13; + d1 &= 8191; + var d22 = c2; + d22 += h0 * r2; + d22 += h1 * r1; + d22 += h22 * r02; + d22 += h32 * (5 * r9); + d22 += h4 * (5 * r8); + c2 = d22 >>> 13; + d22 &= 8191; + d22 += h5 * (5 * r7); + d22 += h6 * (5 * r6); + d22 += h7 * (5 * r5); + d22 += h8 * (5 * r4); + d22 += h9 * (5 * r3); + c2 += d22 >>> 13; + d22 &= 8191; + var d32 = c2; + d32 += h0 * r3; + d32 += h1 * r2; + d32 += h22 * r1; + d32 += h32 * r02; + d32 += h4 * (5 * r9); + c2 = d32 >>> 13; + d32 &= 8191; + d32 += h5 * (5 * r8); + d32 += h6 * (5 * r7); + d32 += h7 * (5 * r6); + d32 += h8 * (5 * r5); + d32 += h9 * (5 * r4); + c2 += d32 >>> 13; + d32 &= 8191; + var d4 = c2; + d4 += h0 * r4; + d4 += h1 * r3; + d4 += h22 * r2; + d4 += h32 * r1; + d4 += h4 * r02; + c2 = d4 >>> 13; + d4 &= 8191; + d4 += h5 * (5 * r9); + d4 += h6 * (5 * r8); + d4 += h7 * (5 * r7); + d4 += h8 * (5 * r6); + d4 += h9 * (5 * r5); + c2 += d4 >>> 13; + d4 &= 8191; + var d5 = c2; + d5 += h0 * r5; + d5 += h1 * r4; + d5 += h22 * r3; + d5 += h32 * r2; + d5 += h4 * r1; + c2 = d5 >>> 13; + d5 &= 8191; + d5 += h5 * r02; + d5 += h6 * (5 * r9); + d5 += h7 * (5 * r8); + d5 += h8 * (5 * r7); + d5 += h9 * (5 * r6); + c2 += d5 >>> 13; + d5 &= 8191; + var d6 = c2; + d6 += h0 * r6; + d6 += h1 * r5; + d6 += h22 * r4; + d6 += h32 * r3; + d6 += h4 * r2; + c2 = d6 >>> 13; + d6 &= 8191; + d6 += h5 * r1; + d6 += h6 * r02; + d6 += h7 * (5 * r9); + d6 += h8 * (5 * r8); + d6 += h9 * (5 * r7); + c2 += d6 >>> 13; + d6 &= 8191; + var d7 = c2; + d7 += h0 * r7; + d7 += h1 * r6; + d7 += h22 * r5; + d7 += h32 * r4; + d7 += h4 * r3; + c2 = d7 >>> 13; + d7 &= 8191; + d7 += h5 * r2; + d7 += h6 * r1; + d7 += h7 * r02; + d7 += h8 * (5 * r9); + d7 += h9 * (5 * r8); + c2 += d7 >>> 13; + d7 &= 8191; + var d8 = c2; + d8 += h0 * r8; + d8 += h1 * r7; + d8 += h22 * r6; + d8 += h32 * r5; + d8 += h4 * r4; + c2 = d8 >>> 13; + d8 &= 8191; + d8 += h5 * r3; + d8 += h6 * r2; + d8 += h7 * r1; + d8 += h8 * r02; + d8 += h9 * (5 * r9); + c2 += d8 >>> 13; + d8 &= 8191; + var d9 = c2; + d9 += h0 * r9; + d9 += h1 * r8; + d9 += h22 * r7; + d9 += h32 * r6; + d9 += h4 * r5; + c2 = d9 >>> 13; + d9 &= 8191; + d9 += h5 * r4; + d9 += h6 * r3; + d9 += h7 * r2; + d9 += h8 * r1; + d9 += h9 * r02; + c2 += d9 >>> 13; + d9 &= 8191; + c2 = (c2 << 2) + c2 | 0; + c2 = c2 + d02 | 0; + d02 = c2 & 8191; + c2 = c2 >>> 13; + d1 += c2; + h0 = d02; + h1 = d1; + h22 = d22; + h32 = d32; + h4 = d4; + h5 = d5; + h6 = d6; + h7 = d7; + h8 = d8; + h9 = d9; + mpos += 16; + bytes2 -= 16; } - if (carry !== 0) { - out = carry.toString(16) + out; + this._h[0] = h0; + this._h[1] = h1; + this._h[2] = h22; + this._h[3] = h32; + this._h[4] = h4; + this._h[5] = h5; + this._h[6] = h6; + this._h[7] = h7; + this._h[8] = h8; + this._h[9] = h9; + }; + Poly13052.prototype.finish = function(mac, macpos) { + if (macpos === void 0) { + macpos = 0; } - while (out.length % padding2 !== 0) { - out = "0" + out; + var g3 = new Uint16Array(10); + var c2; + var mask2; + var f4; + var i2; + if (this._leftover) { + i2 = this._leftover; + this._buffer[i2++] = 1; + for (; i2 < 16; i2++) { + this._buffer[i2] = 0; + } + this._fin = 1; + this._blocks(this._buffer, 0, 16); } - if (this.negative !== 0) { - out = "-" + out; + c2 = this._h[1] >>> 13; + this._h[1] &= 8191; + for (i2 = 2; i2 < 10; i2++) { + this._h[i2] += c2; + c2 = this._h[i2] >>> 13; + this._h[i2] &= 8191; } - return out; - } - if (base3 === (base3 | 0) && base3 >= 2 && base3 <= 36) { - var groupSize = groupSizes[base3]; - var groupBase = groupBases[base3]; - out = ""; - var c2 = this.clone(); - c2.negative = 0; - while (!c2.isZero()) { - var r2 = c2.modrn(groupBase).toString(base3); - c2 = c2.idivn(groupBase); - if (!c2.isZero()) { - out = zeros[groupSize - r2.length] + r2 + out; - } else { - out = r2 + out; - } + this._h[0] += c2 * 5; + c2 = this._h[0] >>> 13; + this._h[0] &= 8191; + this._h[1] += c2; + c2 = this._h[1] >>> 13; + this._h[1] &= 8191; + this._h[2] += c2; + g3[0] = this._h[0] + 5; + c2 = g3[0] >>> 13; + g3[0] &= 8191; + for (i2 = 1; i2 < 10; i2++) { + g3[i2] = this._h[i2] + c2; + c2 = g3[i2] >>> 13; + g3[i2] &= 8191; } - if (this.isZero()) { - out = "0" + out; + g3[9] -= 1 << 13; + mask2 = (c2 ^ 1) - 1; + for (i2 = 0; i2 < 10; i2++) { + g3[i2] &= mask2; } - while (out.length % padding2 !== 0) { - out = "0" + out; + mask2 = ~mask2; + for (i2 = 0; i2 < 10; i2++) { + this._h[i2] = this._h[i2] & mask2 | g3[i2]; } - if (this.negative !== 0) { - out = "-" + out; + this._h[0] = (this._h[0] | this._h[1] << 13) & 65535; + this._h[1] = (this._h[1] >>> 3 | this._h[2] << 10) & 65535; + this._h[2] = (this._h[2] >>> 6 | this._h[3] << 7) & 65535; + this._h[3] = (this._h[3] >>> 9 | this._h[4] << 4) & 65535; + this._h[4] = (this._h[4] >>> 12 | this._h[5] << 1 | this._h[6] << 14) & 65535; + this._h[5] = (this._h[6] >>> 2 | this._h[7] << 11) & 65535; + this._h[6] = (this._h[7] >>> 5 | this._h[8] << 8) & 65535; + this._h[7] = (this._h[8] >>> 8 | this._h[9] << 5) & 65535; + f4 = this._h[0] + this._pad[0]; + this._h[0] = f4 & 65535; + for (i2 = 1; i2 < 8; i2++) { + f4 = (this._h[i2] + this._pad[i2] | 0) + (f4 >>> 16) | 0; + this._h[i2] = f4 & 65535; } - return out; - } - assert2(false, "Base should be between 2 and 36"); - }; - BN2.prototype.toNumber = function toNumber2() { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 67108864; - } else if (this.length === 3 && this.words[2] === 1) { - ret += 4503599627370496 + this.words[1] * 67108864; - } else if (this.length > 2) { - assert2(false, "Number can only safely store up to 53 bits"); - } - return this.negative !== 0 ? -ret : ret; - }; - BN2.prototype.toJSON = function toJSON3() { - return this.toString(16, 2); - }; - if (Buffer2) { - BN2.prototype.toBuffer = function toBuffer2(endian, length) { - return this.toArrayLike(Buffer2, endian, length); - }; - } - BN2.prototype.toArray = function toArray2(endian, length) { - return this.toArrayLike(Array, endian, length); - }; - var allocate = function allocate2(ArrayType, size2) { - if (ArrayType.allocUnsafe) { - return ArrayType.allocUnsafe(size2); - } - return new ArrayType(size2); - }; - BN2.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { - this._strip(); - var byteLength2 = this.byteLength(); - var reqLength = length || Math.max(1, byteLength2); - assert2(byteLength2 <= reqLength, "byte array longer than desired length"); - assert2(reqLength > 0, "Requested array length <= 0"); - var res = allocate(ArrayType, reqLength); - var postfix = endian === "le" ? "LE" : "BE"; - this["_toArrayLike" + postfix](res, byteLength2); - return res; - }; - BN2.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength2) { - var position = 0; - var carry = 0; - for (var i3 = 0, shift = 0; i3 < this.length; i3++) { - var word = this.words[i3] << shift | carry; - res[position++] = word & 255; - if (position < res.length) { - res[position++] = word >> 8 & 255; + mac[macpos + 0] = this._h[0] >>> 0; + mac[macpos + 1] = this._h[0] >>> 8; + mac[macpos + 2] = this._h[1] >>> 0; + mac[macpos + 3] = this._h[1] >>> 8; + mac[macpos + 4] = this._h[2] >>> 0; + mac[macpos + 5] = this._h[2] >>> 8; + mac[macpos + 6] = this._h[3] >>> 0; + mac[macpos + 7] = this._h[3] >>> 8; + mac[macpos + 8] = this._h[4] >>> 0; + mac[macpos + 9] = this._h[4] >>> 8; + mac[macpos + 10] = this._h[5] >>> 0; + mac[macpos + 11] = this._h[5] >>> 8; + mac[macpos + 12] = this._h[6] >>> 0; + mac[macpos + 13] = this._h[6] >>> 8; + mac[macpos + 14] = this._h[7] >>> 0; + mac[macpos + 15] = this._h[7] >>> 8; + this._finished = true; + return this; + }; + Poly13052.prototype.update = function(m3) { + var mpos = 0; + var bytes2 = m3.length; + var want; + if (this._leftover) { + want = 16 - this._leftover; + if (want > bytes2) { + want = bytes2; + } + for (var i2 = 0; i2 < want; i2++) { + this._buffer[this._leftover + i2] = m3[mpos + i2]; + } + bytes2 -= want; + mpos += want; + this._leftover += want; + if (this._leftover < 16) { + return this; + } + this._blocks(this._buffer, 0, 16); + this._leftover = 0; } - if (position < res.length) { - res[position++] = word >> 16 & 255; + if (bytes2 >= 16) { + want = bytes2 - bytes2 % 16; + this._blocks(m3, mpos, want); + mpos += want; + bytes2 -= want; } - if (shift === 6) { - if (position < res.length) { - res[position++] = word >> 24 & 255; + if (bytes2) { + for (var i2 = 0; i2 < bytes2; i2++) { + this._buffer[this._leftover + i2] = m3[mpos + i2]; } - carry = 0; - shift = 0; - } else { - carry = word >>> 24; - shift += 2; + this._leftover += bytes2; } - } - if (position < res.length) { - res[position++] = carry; - while (position < res.length) { - res[position++] = 0; + return this; + }; + Poly13052.prototype.digest = function() { + if (this._finished) { + throw new Error("Poly1305 was finished"); } - } - }; - BN2.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength2) { - var position = res.length - 1; - var carry = 0; - for (var i3 = 0, shift = 0; i3 < this.length; i3++) { - var word = this.words[i3] << shift | carry; - res[position--] = word & 255; - if (position >= 0) { - res[position--] = word >> 8 & 255; + var mac = new Uint8Array(16); + this.finish(mac); + return mac; + }; + Poly13052.prototype.clean = function() { + wipe_12.wipe(this._buffer); + wipe_12.wipe(this._r); + wipe_12.wipe(this._h); + wipe_12.wipe(this._pad); + this._leftover = 0; + this._fin = 0; + this._finished = true; + return this; + }; + return Poly13052; + }() + ); + exports.Poly1305 = Poly1305; + function oneTimeAuth(key2, data) { + var h4 = new Poly1305(key2); + h4.update(data); + var digest9 = h4.digest(); + h4.clean(); + return digest9; + } + exports.oneTimeAuth = oneTimeAuth; + function equal2(a3, b2) { + if (a3.length !== exports.DIGEST_LENGTH || b2.length !== exports.DIGEST_LENGTH) { + return false; + } + return constant_time_12.equal(a3, b2); + } + exports.equal = equal2; +})(poly1305); +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + var chacha_1 = chacha; + var poly1305_1 = poly1305; + var wipe_12 = wipe$1; + var binary_12 = binary; + var constant_time_12 = constantTime; + exports.KEY_LENGTH = 32; + exports.NONCE_LENGTH = 12; + exports.TAG_LENGTH = 16; + var ZEROS = new Uint8Array(16); + var ChaCha20Poly1305 = ( + /** @class */ + function() { + function ChaCha20Poly13052(key2) { + this.nonceLength = exports.NONCE_LENGTH; + this.tagLength = exports.TAG_LENGTH; + if (key2.length !== exports.KEY_LENGTH) { + throw new Error("ChaCha20Poly1305 needs 32-byte key"); } - if (position >= 0) { - res[position--] = word >> 16 & 255; + this._key = new Uint8Array(key2); + } + ChaCha20Poly13052.prototype.seal = function(nonce, plaintext, associatedData, dst) { + if (nonce.length > 16) { + throw new Error("ChaCha20Poly1305: incorrect nonce length"); } - if (shift === 6) { - if (position >= 0) { - res[position--] = word >> 24 & 255; + var counter = new Uint8Array(16); + counter.set(nonce, counter.length - nonce.length); + var authKey = new Uint8Array(32); + chacha_1.stream(this._key, counter, authKey, 4); + var resultLength = plaintext.length + this.tagLength; + var result; + if (dst) { + if (dst.length !== resultLength) { + throw new Error("ChaCha20Poly1305: incorrect destination length"); } - carry = 0; - shift = 0; + result = dst; } else { - carry = word >>> 24; - shift += 2; + result = new Uint8Array(resultLength); } - } - if (position >= 0) { - res[position--] = carry; - while (position >= 0) { - res[position--] = 0; + chacha_1.streamXOR(this._key, counter, plaintext, result, 4); + this._authenticate(result.subarray(result.length - this.tagLength, result.length), authKey, result.subarray(0, result.length - this.tagLength), associatedData); + wipe_12.wipe(counter); + return result; + }; + ChaCha20Poly13052.prototype.open = function(nonce, sealed, associatedData, dst) { + if (nonce.length > 16) { + throw new Error("ChaCha20Poly1305: incorrect nonce length"); } - } - }; - if (Math.clz32) { - BN2.prototype._countBits = function _countBits(w2) { - return 32 - Math.clz32(w2); + if (sealed.length < this.tagLength) { + return null; + } + var counter = new Uint8Array(16); + counter.set(nonce, counter.length - nonce.length); + var authKey = new Uint8Array(32); + chacha_1.stream(this._key, counter, authKey, 4); + var calculatedTag = new Uint8Array(this.tagLength); + this._authenticate(calculatedTag, authKey, sealed.subarray(0, sealed.length - this.tagLength), associatedData); + if (!constant_time_12.equal(calculatedTag, sealed.subarray(sealed.length - this.tagLength, sealed.length))) { + return null; + } + var resultLength = sealed.length - this.tagLength; + var result; + if (dst) { + if (dst.length !== resultLength) { + throw new Error("ChaCha20Poly1305: incorrect destination length"); + } + result = dst; + } else { + result = new Uint8Array(resultLength); + } + chacha_1.streamXOR(this._key, counter, sealed.subarray(0, sealed.length - this.tagLength), result, 4); + wipe_12.wipe(counter); + return result; }; - } else { - BN2.prototype._countBits = function _countBits(w2) { - var t2 = w2; - var r2 = 0; - if (t2 >= 4096) { - r2 += 13; - t2 >>>= 13; + ChaCha20Poly13052.prototype.clean = function() { + wipe_12.wipe(this._key); + return this; + }; + ChaCha20Poly13052.prototype._authenticate = function(tagOut, authKey, ciphertext, associatedData) { + var h4 = new poly1305_1.Poly1305(authKey); + if (associatedData) { + h4.update(associatedData); + if (associatedData.length % 16 > 0) { + h4.update(ZEROS.subarray(associatedData.length % 16)); + } } - if (t2 >= 64) { - r2 += 7; - t2 >>>= 7; + h4.update(ciphertext); + if (ciphertext.length % 16 > 0) { + h4.update(ZEROS.subarray(ciphertext.length % 16)); } - if (t2 >= 8) { - r2 += 4; - t2 >>>= 4; + var length = new Uint8Array(8); + if (associatedData) { + binary_12.writeUint64LE(associatedData.length, length); } - if (t2 >= 2) { - r2 += 2; - t2 >>>= 2; + h4.update(length); + binary_12.writeUint64LE(ciphertext.length, length); + h4.update(length); + var tag = h4.digest(); + for (var i2 = 0; i2 < tag.length; i2++) { + tagOut[i2] = tag[i2]; } - return r2 + t2; + h4.clean(); + wipe_12.wipe(tag); + wipe_12.wipe(length); }; - } - BN2.prototype._zeroBits = function _zeroBits(w2) { - if (w2 === 0) - return 26; - var t2 = w2; - var r2 = 0; - if ((t2 & 8191) === 0) { - r2 += 13; - t2 >>>= 13; + return ChaCha20Poly13052; + }() + ); + exports.ChaCha20Poly1305 = ChaCha20Poly1305; +})(chacha20poly1305); +var hkdf = {}; +var hmac$3 = {}; +var hash$4 = {}; +Object.defineProperty(hash$4, "__esModule", { value: true }); +function isSerializableHash(h4) { + return typeof h4.saveState !== "undefined" && typeof h4.restoreState !== "undefined" && typeof h4.cleanSavedState !== "undefined"; +} +hash$4.isSerializableHash = isSerializableHash; +Object.defineProperty(hmac$3, "__esModule", { value: true }); +var hash_1 = hash$4; +var constant_time_1 = constantTime; +var wipe_1$2 = wipe$1; +var HMAC$2 = ( + /** @class */ + function() { + function HMAC3(hash3, key2) { + this._finished = false; + this._inner = new hash3(); + this._outer = new hash3(); + this.blockSize = this._outer.blockSize; + this.digestLength = this._outer.digestLength; + var pad3 = new Uint8Array(this.blockSize); + if (key2.length > this.blockSize) { + this._inner.update(key2).finish(pad3).clean(); + } else { + pad3.set(key2); } - if ((t2 & 127) === 0) { - r2 += 7; - t2 >>>= 7; + for (var i2 = 0; i2 < pad3.length; i2++) { + pad3[i2] ^= 54; } - if ((t2 & 15) === 0) { - r2 += 4; - t2 >>>= 4; + this._inner.update(pad3); + for (var i2 = 0; i2 < pad3.length; i2++) { + pad3[i2] ^= 54 ^ 92; } - if ((t2 & 3) === 0) { - r2 += 2; - t2 >>>= 2; + this._outer.update(pad3); + if (hash_1.isSerializableHash(this._inner) && hash_1.isSerializableHash(this._outer)) { + this._innerKeyedState = this._inner.saveState(); + this._outerKeyedState = this._outer.saveState(); } - if ((t2 & 1) === 0) { - r2++; + wipe_1$2.wipe(pad3); + } + HMAC3.prototype.reset = function() { + if (!hash_1.isSerializableHash(this._inner) || !hash_1.isSerializableHash(this._outer)) { + throw new Error("hmac: can't reset() because hash doesn't implement restoreState()"); } - return r2; - }; - BN2.prototype.bitLength = function bitLength() { - var w2 = this.words[this.length - 1]; - var hi2 = this._countBits(w2); - return (this.length - 1) * 26 + hi2; + this._inner.restoreState(this._innerKeyedState); + this._outer.restoreState(this._outerKeyedState); + this._finished = false; + return this; }; - function toBitArray(num) { - var w2 = new Array(num.bitLength()); - for (var bit = 0; bit < w2.length; bit++) { - var off = bit / 26 | 0; - var wbit = bit % 26; - w2[bit] = num.words[off] >>> wbit & 1; + HMAC3.prototype.clean = function() { + if (hash_1.isSerializableHash(this._inner)) { + this._inner.cleanSavedState(this._innerKeyedState); } - return w2; - } - BN2.prototype.zeroBits = function zeroBits() { - if (this.isZero()) - return 0; - var r2 = 0; - for (var i3 = 0; i3 < this.length; i3++) { - var b2 = this._zeroBits(this.words[i3]); - r2 += b2; - if (b2 !== 26) - break; + if (hash_1.isSerializableHash(this._outer)) { + this._outer.cleanSavedState(this._outerKeyedState); } - return r2; - }; - BN2.prototype.byteLength = function byteLength2() { - return Math.ceil(this.bitLength() / 8); + this._inner.clean(); + this._outer.clean(); }; - BN2.prototype.toTwos = function toTwos2(width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); + HMAC3.prototype.update = function(data) { + this._inner.update(data); + return this; }; - BN2.prototype.fromTwos = function fromTwos2(width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); + HMAC3.prototype.finish = function(out) { + if (this._finished) { + this._outer.finish(out); + return this; } - return this.clone(); + this._inner.finish(out); + this._outer.update(out.subarray(0, this.digestLength)).finish(out); + this._finished = true; + return this; }; - BN2.prototype.isNeg = function isNeg() { - return this.negative !== 0; + HMAC3.prototype.digest = function() { + var out = new Uint8Array(this.digestLength); + this.finish(out); + return out; }; - BN2.prototype.neg = function neg4() { - return this.clone().ineg(); + HMAC3.prototype.saveState = function() { + if (!hash_1.isSerializableHash(this._inner)) { + throw new Error("hmac: can't saveState() because hash doesn't implement it"); + } + return this._inner.saveState(); }; - BN2.prototype.ineg = function ineg() { - if (!this.isZero()) { - this.negative ^= 1; + HMAC3.prototype.restoreState = function(savedState) { + if (!hash_1.isSerializableHash(this._inner) || !hash_1.isSerializableHash(this._outer)) { + throw new Error("hmac: can't restoreState() because hash doesn't implement it"); } + this._inner.restoreState(savedState); + this._outer.restoreState(this._outerKeyedState); + this._finished = false; return this; }; - BN2.prototype.iuor = function iuor(num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - for (var i3 = 0; i3 < num.length; i3++) { - this.words[i3] = this.words[i3] | num.words[i3]; + HMAC3.prototype.cleanSavedState = function(savedState) { + if (!hash_1.isSerializableHash(this._inner)) { + throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it"); } - return this._strip(); - }; - BN2.prototype.ior = function ior(num) { - assert2((this.negative | num.negative) === 0); - return this.iuor(num); - }; - BN2.prototype.or = function or2(num) { - if (this.length > num.length) - return this.clone().ior(num); - return num.clone().ior(this); - }; - BN2.prototype.uor = function uor(num) { - if (this.length > num.length) - return this.clone().iuor(num); - return num.clone().iuor(this); + this._inner.cleanSavedState(savedState); }; - BN2.prototype.iuand = function iuand(num) { - var b2; - if (this.length > num.length) { - b2 = num; - } else { - b2 = this; + return HMAC3; + }() +); +hmac$3.HMAC = HMAC$2; +function hmac$2(hash3, key2, data) { + var h4 = new HMAC$2(hash3, key2); + h4.update(data); + var digest9 = h4.digest(); + h4.clean(); + return digest9; +} +hmac$3.hmac = hmac$2; +hmac$3.equal = constant_time_1.equal; +Object.defineProperty(hkdf, "__esModule", { value: true }); +var hmac_1 = hmac$3; +var wipe_1$1 = wipe$1; +var HKDF = ( + /** @class */ + function() { + function HKDF2(hash3, key2, salt, info) { + if (salt === void 0) { + salt = new Uint8Array(0); } - for (var i3 = 0; i3 < b2.length; i3++) { - this.words[i3] = this.words[i3] & num.words[i3]; + this._counter = new Uint8Array(1); + this._hash = hash3; + this._info = info; + var okm = hmac_1.hmac(this._hash, salt, key2); + this._hmac = new hmac_1.HMAC(hash3, okm); + this._buffer = new Uint8Array(this._hmac.digestLength); + this._bufpos = this._buffer.length; + } + HKDF2.prototype._fillBuffer = function() { + this._counter[0]++; + var ctr = this._counter[0]; + if (ctr === 0) { + throw new Error("hkdf: cannot expand more"); } - this.length = b2.length; - return this._strip(); - }; - BN2.prototype.iand = function iand(num) { - assert2((this.negative | num.negative) === 0); - return this.iuand(num); - }; - BN2.prototype.and = function and(num) { - if (this.length > num.length) - return this.clone().iand(num); - return num.clone().iand(this); - }; - BN2.prototype.uand = function uand(num) { - if (this.length > num.length) - return this.clone().iuand(num); - return num.clone().iuand(this); - }; - BN2.prototype.iuxor = function iuxor(num) { - var a3; - var b2; - if (this.length > num.length) { - a3 = this; - b2 = num; - } else { - a3 = num; - b2 = this; + this._hmac.reset(); + if (ctr > 1) { + this._hmac.update(this._buffer); } - for (var i3 = 0; i3 < b2.length; i3++) { - this.words[i3] = a3.words[i3] ^ b2.words[i3]; + if (this._info) { + this._hmac.update(this._info); } - if (this !== a3) { - for (; i3 < a3.length; i3++) { - this.words[i3] = a3.words[i3]; + this._hmac.update(this._counter); + this._hmac.finish(this._buffer); + this._bufpos = 0; + }; + HKDF2.prototype.expand = function(length) { + var out = new Uint8Array(length); + for (var i2 = 0; i2 < out.length; i2++) { + if (this._bufpos === this._buffer.length) { + this._fillBuffer(); } + out[i2] = this._buffer[this._bufpos++]; } - this.length = a3.length; - return this._strip(); - }; - BN2.prototype.ixor = function ixor(num) { - assert2((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - BN2.prototype.xor = function xor(num) { - if (this.length > num.length) - return this.clone().ixor(num); - return num.clone().ixor(this); - }; - BN2.prototype.uxor = function uxor(num) { - if (this.length > num.length) - return this.clone().iuxor(num); - return num.clone().iuxor(this); + return out; }; - BN2.prototype.inotn = function inotn(width) { - assert2(typeof width === "number" && width >= 0); - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - this._expand(bytesNeeded); - if (bitsLeft > 0) { - bytesNeeded--; - } - for (var i3 = 0; i3 < bytesNeeded; i3++) { - this.words[i3] = ~this.words[i3] & 67108863; - } - if (bitsLeft > 0) { - this.words[i3] = ~this.words[i3] & 67108863 >> 26 - bitsLeft; - } - return this._strip(); + HKDF2.prototype.clean = function() { + this._hmac.clean(); + wipe_1$1.wipe(this._buffer); + wipe_1$1.wipe(this._counter); + this._bufpos = 0; }; - BN2.prototype.notn = function notn(width) { - return this.clone().inotn(width); - }; - BN2.prototype.setn = function setn(bit, val) { - assert2(typeof bit === "number" && bit >= 0); - var off = bit / 26 | 0; - var wbit = bit % 26; - this._expand(off + 1); - if (val) { - this.words[off] = this.words[off] | 1 << wbit; - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - return this._strip(); - }; - BN2.prototype.iadd = function iadd(num) { - var r2; - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r2 = this.isub(num); - this.negative ^= 1; - return this._normSign(); - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r2 = this.isub(num); - num.negative = 1; - return r2._normSign(); - } - var a3, b2; - if (this.length > num.length) { - a3 = this; - b2 = num; - } else { - a3 = num; - b2 = this; - } - var carry = 0; - for (var i3 = 0; i3 < b2.length; i3++) { - r2 = (a3.words[i3] | 0) + (b2.words[i3] | 0) + carry; - this.words[i3] = r2 & 67108863; - carry = r2 >>> 26; - } - for (; carry !== 0 && i3 < a3.length; i3++) { - r2 = (a3.words[i3] | 0) + carry; - this.words[i3] = r2 & 67108863; - carry = r2 >>> 26; + return HKDF2; + }() +); +var HKDF_1 = hkdf.HKDF = HKDF; +var random = {}; +var system = {}; +var browser$4 = {}; +Object.defineProperty(browser$4, "__esModule", { value: true }); +browser$4.BrowserRandomSource = void 0; +const QUOTA = 65536; +class BrowserRandomSource { + constructor() { + this.isAvailable = false; + this.isInstantiated = false; + const browserCrypto = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; + if (browserCrypto && browserCrypto.getRandomValues !== void 0) { + this._crypto = browserCrypto; + this.isAvailable = true; + this.isInstantiated = true; + } + } + randomBytes(length) { + if (!this.isAvailable || !this._crypto) { + throw new Error("Browser random byte generator is not available."); + } + const out = new Uint8Array(length); + for (let i2 = 0; i2 < out.length; i2 += QUOTA) { + this._crypto.getRandomValues(out.subarray(i2, i2 + Math.min(out.length - i2, QUOTA))); + } + return out; + } +} +browser$4.BrowserRandomSource = BrowserRandomSource; +function commonjsRequire(path) { + throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); +} +var node = {}; +const __viteBrowserExternal = {}; +const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + default: __viteBrowserExternal +}, Symbol.toStringTag, { value: "Module" })); +const require$$3 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1); +Object.defineProperty(node, "__esModule", { value: true }); +node.NodeRandomSource = void 0; +const wipe_1 = wipe$1; +class NodeRandomSource { + constructor() { + this.isAvailable = false; + this.isInstantiated = false; + if (typeof commonjsRequire !== "undefined") { + const nodeCrypto = require$$3; + if (nodeCrypto && nodeCrypto.randomBytes) { + this._crypto = nodeCrypto; + this.isAvailable = true; + this.isInstantiated = true; } - this.length = a3.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - } else if (a3 !== this) { - for (; i3 < a3.length; i3++) { - this.words[i3] = a3.words[i3]; + } + } + randomBytes(length) { + if (!this.isAvailable || !this._crypto) { + throw new Error("Node.js random byte generator is not available."); + } + let buffer2 = this._crypto.randomBytes(length); + if (buffer2.length !== length) { + throw new Error("NodeRandomSource: got fewer bytes than requested"); + } + const out = new Uint8Array(length); + for (let i2 = 0; i2 < out.length; i2++) { + out[i2] = buffer2[i2]; + } + (0, wipe_1.wipe)(buffer2); + return out; + } +} +node.NodeRandomSource = NodeRandomSource; +Object.defineProperty(system, "__esModule", { value: true }); +system.SystemRandomSource = void 0; +const browser_1 = browser$4; +const node_1 = node; +class SystemRandomSource { + constructor() { + this.isAvailable = false; + this.name = ""; + this._source = new browser_1.BrowserRandomSource(); + if (this._source.isAvailable) { + this.isAvailable = true; + this.name = "Browser"; + return; + } + this._source = new node_1.NodeRandomSource(); + if (this._source.isAvailable) { + this.isAvailable = true; + this.name = "Node"; + return; + } + } + randomBytes(length) { + if (!this.isAvailable) { + throw new Error("System random byte generator is not available."); + } + return this._source.randomBytes(length); + } +} +system.SystemRandomSource = SystemRandomSource; +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.randomStringForEntropy = exports.randomString = exports.randomUint32 = exports.randomBytes = exports.defaultRandomSource = void 0; + const system_1 = system; + const binary_12 = binary; + const wipe_12 = wipe$1; + exports.defaultRandomSource = new system_1.SystemRandomSource(); + function randomBytes2(length, prng = exports.defaultRandomSource) { + return prng.randomBytes(length); + } + exports.randomBytes = randomBytes2; + function randomUint32(prng = exports.defaultRandomSource) { + const buf = randomBytes2(4, prng); + const result = (0, binary_12.readUint32LE)(buf); + (0, wipe_12.wipe)(buf); + return result; + } + exports.randomUint32 = randomUint32; + const ALPHANUMERIC = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + function randomString(length, charset = ALPHANUMERIC, prng = exports.defaultRandomSource) { + if (charset.length < 2) { + throw new Error("randomString charset is too short"); + } + if (charset.length > 256) { + throw new Error("randomString charset is too long"); + } + let out = ""; + const charsLen = charset.length; + const maxByte = 256 - 256 % charsLen; + while (length > 0) { + const buf = randomBytes2(Math.ceil(length * 256 / maxByte), prng); + for (let i2 = 0; i2 < buf.length && length > 0; i2++) { + const randomByte = buf[i2]; + if (randomByte < maxByte) { + out += charset.charAt(randomByte % charsLen); + length--; } } - return this; - }; - BN2.prototype.add = function add6(num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - if (this.length > num.length) - return this.clone().iadd(num); - return num.clone().iadd(this); - }; - BN2.prototype.isub = function isub(num) { - if (num.negative !== 0) { - num.negative = 0; - var r2 = this.iadd(num); - num.negative = 1; - return r2._normSign(); - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); + (0, wipe_12.wipe)(buf); + } + return out; + } + exports.randomString = randomString; + function randomStringForEntropy(bits, charset = ALPHANUMERIC, prng = exports.defaultRandomSource) { + const length = Math.ceil(bits / (Math.log(charset.length) / Math.LN2)); + return randomString(length, charset, prng); + } + exports.randomStringForEntropy = randomStringForEntropy; +})(random); +var sha256$3 = {}; +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + var binary_12 = binary; + var wipe_12 = wipe$1; + exports.DIGEST_LENGTH = 32; + exports.BLOCK_SIZE = 64; + var SHA2564 = ( + /** @class */ + function() { + function SHA2565() { + this.digestLength = exports.DIGEST_LENGTH; + this.blockSize = exports.BLOCK_SIZE; + this._state = new Int32Array(8); + this._temp = new Int32Array(64); + this._buffer = new Uint8Array(128); + this._bufferLength = 0; + this._bytesHashed = 0; + this._finished = false; + this.reset(); } - var cmp = this.cmp(num); - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; + SHA2565.prototype._initState = function() { + this._state[0] = 1779033703; + this._state[1] = 3144134277; + this._state[2] = 1013904242; + this._state[3] = 2773480762; + this._state[4] = 1359893119; + this._state[5] = 2600822924; + this._state[6] = 528734635; + this._state[7] = 1541459225; + }; + SHA2565.prototype.reset = function() { + this._initState(); + this._bufferLength = 0; + this._bytesHashed = 0; + this._finished = false; return this; - } - var a3, b2; - if (cmp > 0) { - a3 = this; - b2 = num; - } else { - a3 = num; - b2 = this; - } - var carry = 0; - for (var i3 = 0; i3 < b2.length; i3++) { - r2 = (a3.words[i3] | 0) - (b2.words[i3] | 0) + carry; - carry = r2 >> 26; - this.words[i3] = r2 & 67108863; - } - for (; carry !== 0 && i3 < a3.length; i3++) { - r2 = (a3.words[i3] | 0) + carry; - carry = r2 >> 26; - this.words[i3] = r2 & 67108863; - } - if (carry === 0 && i3 < a3.length && a3 !== this) { - for (; i3 < a3.length; i3++) { - this.words[i3] = a3.words[i3]; + }; + SHA2565.prototype.clean = function() { + wipe_12.wipe(this._buffer); + wipe_12.wipe(this._temp); + this.reset(); + }; + SHA2565.prototype.update = function(data, dataLength2) { + if (dataLength2 === void 0) { + dataLength2 = data.length; + } + if (this._finished) { + throw new Error("SHA256: can't update because hash was finished."); + } + var dataPos = 0; + this._bytesHashed += dataLength2; + if (this._bufferLength > 0) { + while (this._bufferLength < this.blockSize && dataLength2 > 0) { + this._buffer[this._bufferLength++] = data[dataPos++]; + dataLength2--; + } + if (this._bufferLength === this.blockSize) { + hashBlocks(this._temp, this._state, this._buffer, 0, this.blockSize); + this._bufferLength = 0; + } + } + if (dataLength2 >= this.blockSize) { + dataPos = hashBlocks(this._temp, this._state, data, dataPos, dataLength2); + dataLength2 %= this.blockSize; + } + while (dataLength2 > 0) { + this._buffer[this._bufferLength++] = data[dataPos++]; + dataLength2--; + } + return this; + }; + SHA2565.prototype.finish = function(out) { + if (!this._finished) { + var bytesHashed = this._bytesHashed; + var left = this._bufferLength; + var bitLenHi = bytesHashed / 536870912 | 0; + var bitLenLo = bytesHashed << 3; + var padLength = bytesHashed % 64 < 56 ? 64 : 128; + this._buffer[left] = 128; + for (var i2 = left + 1; i2 < padLength - 8; i2++) { + this._buffer[i2] = 0; + } + binary_12.writeUint32BE(bitLenHi, this._buffer, padLength - 8); + binary_12.writeUint32BE(bitLenLo, this._buffer, padLength - 4); + hashBlocks(this._temp, this._state, this._buffer, 0, padLength); + this._finished = true; + } + for (var i2 = 0; i2 < this.digestLength / 4; i2++) { + binary_12.writeUint32BE(this._state[i2], out, i2 * 4); + } + return this; + }; + SHA2565.prototype.digest = function() { + var out = new Uint8Array(this.digestLength); + this.finish(out); + return out; + }; + SHA2565.prototype.saveState = function() { + if (this._finished) { + throw new Error("SHA256: cannot save finished state"); + } + return { + state: new Int32Array(this._state), + buffer: this._bufferLength > 0 ? new Uint8Array(this._buffer) : void 0, + bufferLength: this._bufferLength, + bytesHashed: this._bytesHashed + }; + }; + SHA2565.prototype.restoreState = function(savedState) { + this._state.set(savedState.state); + this._bufferLength = savedState.bufferLength; + if (savedState.buffer) { + this._buffer.set(savedState.buffer); + } + this._bytesHashed = savedState.bytesHashed; + this._finished = false; + return this; + }; + SHA2565.prototype.cleanSavedState = function(savedState) { + wipe_12.wipe(savedState.state); + if (savedState.buffer) { + wipe_12.wipe(savedState.buffer); } + savedState.bufferLength = 0; + savedState.bytesHashed = 0; + }; + return SHA2565; + }() + ); + exports.SHA256 = SHA2564; + var K3 = new Int32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]); + function hashBlocks(w2, v6, p3, pos, len) { + while (len >= 64) { + var a3 = v6[0]; + var b2 = v6[1]; + var c2 = v6[2]; + var d4 = v6[3]; + var e18 = v6[4]; + var f4 = v6[5]; + var g3 = v6[6]; + var h4 = v6[7]; + for (var i2 = 0; i2 < 16; i2++) { + var j2 = pos + i2 * 4; + w2[i2] = binary_12.readUint32BE(p3, j2); } - this.length = Math.max(this.length, i3); - if (a3 !== this) { - this.negative = 1; + for (var i2 = 16; i2 < 64; i2++) { + var u2 = w2[i2 - 2]; + var t1 = (u2 >>> 17 | u2 << 32 - 17) ^ (u2 >>> 19 | u2 << 32 - 19) ^ u2 >>> 10; + u2 = w2[i2 - 15]; + var t2 = (u2 >>> 7 | u2 << 32 - 7) ^ (u2 >>> 18 | u2 << 32 - 18) ^ u2 >>> 3; + w2[i2] = (t1 + w2[i2 - 7] | 0) + (t2 + w2[i2 - 16] | 0); } - return this._strip(); - }; - BN2.prototype.sub = function sub(num) { - return this.clone().isub(num); - }; - function smallMulTo(self2, num, out) { - out.negative = num.negative ^ self2.negative; - var len = self2.length + num.length | 0; - out.length = len; - len = len - 1 | 0; - var a3 = self2.words[0] | 0; - var b2 = num.words[0] | 0; - var r2 = a3 * b2; - var lo2 = r2 & 67108863; - var carry = r2 / 67108864 | 0; - out.words[0] = lo2; - for (var k2 = 1; k2 < len; k2++) { - var ncarry = carry >>> 26; - var rword = carry & 67108863; - var maxJ = Math.min(k2, num.length - 1); - for (var j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { - var i3 = k2 - j2 | 0; - a3 = self2.words[i3] | 0; - b2 = num.words[j2] | 0; - r2 = a3 * b2 + rword; - ncarry += r2 / 67108864 | 0; - rword = r2 & 67108863; - } - out.words[k2] = rword | 0; - carry = ncarry | 0; + for (var i2 = 0; i2 < 64; i2++) { + var t1 = (((e18 >>> 6 | e18 << 32 - 6) ^ (e18 >>> 11 | e18 << 32 - 11) ^ (e18 >>> 25 | e18 << 32 - 25)) + (e18 & f4 ^ ~e18 & g3) | 0) + (h4 + (K3[i2] + w2[i2] | 0) | 0) | 0; + var t2 = ((a3 >>> 2 | a3 << 32 - 2) ^ (a3 >>> 13 | a3 << 32 - 13) ^ (a3 >>> 22 | a3 << 32 - 22)) + (a3 & b2 ^ a3 & c2 ^ b2 & c2) | 0; + h4 = g3; + g3 = f4; + f4 = e18; + e18 = d4 + t1 | 0; + d4 = c2; + c2 = b2; + b2 = a3; + a3 = t1 + t2 | 0; } - if (carry !== 0) { - out.words[k2] = carry | 0; - } else { - out.length--; - } - return out._strip(); - } - var comb10MulTo = function comb10MulTo2(self2, num, out) { - var a3 = self2.words; - var b2 = num.words; - var o2 = out.words; - var c2 = 0; - var lo2; - var mid; - var hi2; - var a02 = a3[0] | 0; - var al0 = a02 & 8191; - var ah0 = a02 >>> 13; - var a1 = a3[1] | 0; - var al1 = a1 & 8191; - var ah1 = a1 >>> 13; - var a22 = a3[2] | 0; - var al2 = a22 & 8191; - var ah2 = a22 >>> 13; - var a32 = a3[3] | 0; - var al3 = a32 & 8191; - var ah3 = a32 >>> 13; - var a4 = a3[4] | 0; - var al4 = a4 & 8191; - var ah4 = a4 >>> 13; - var a5 = a3[5] | 0; - var al5 = a5 & 8191; - var ah5 = a5 >>> 13; - var a6 = a3[6] | 0; - var al6 = a6 & 8191; - var ah6 = a6 >>> 13; - var a7 = a3[7] | 0; - var al7 = a7 & 8191; - var ah7 = a7 >>> 13; - var a8 = a3[8] | 0; - var al8 = a8 & 8191; - var ah8 = a8 >>> 13; - var a9 = a3[9] | 0; - var al9 = a9 & 8191; - var ah9 = a9 >>> 13; - var b02 = b2[0] | 0; - var bl0 = b02 & 8191; - var bh0 = b02 >>> 13; - var b1 = b2[1] | 0; - var bl1 = b1 & 8191; - var bh1 = b1 >>> 13; - var b22 = b2[2] | 0; - var bl2 = b22 & 8191; - var bh2 = b22 >>> 13; - var b3 = b2[3] | 0; - var bl3 = b3 & 8191; - var bh3 = b3 >>> 13; - var b4 = b2[4] | 0; - var bl4 = b4 & 8191; - var bh4 = b4 >>> 13; - var b5 = b2[5] | 0; - var bl5 = b5 & 8191; - var bh5 = b5 >>> 13; - var b6 = b2[6] | 0; - var bl6 = b6 & 8191; - var bh6 = b6 >>> 13; - var b7 = b2[7] | 0; - var bl7 = b7 & 8191; - var bh7 = b7 >>> 13; - var b8 = b2[8] | 0; - var bl8 = b8 & 8191; - var bh8 = b8 >>> 13; - var b9 = b2[9] | 0; - var bl9 = b9 & 8191; - var bh9 = b9 >>> 13; - out.negative = self2.negative ^ num.negative; - out.length = 19; - lo2 = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = mid + Math.imul(ah0, bl0) | 0; - hi2 = Math.imul(ah0, bh0); - var w02 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w02 >>> 26) | 0; - w02 &= 67108863; - lo2 = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = mid + Math.imul(ah1, bl0) | 0; - hi2 = Math.imul(ah1, bh0); - lo2 = lo2 + Math.imul(al0, bl1) | 0; - mid = mid + Math.imul(al0, bh1) | 0; - mid = mid + Math.imul(ah0, bl1) | 0; - hi2 = hi2 + Math.imul(ah0, bh1) | 0; - var w1 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w1 >>> 26) | 0; - w1 &= 67108863; - lo2 = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = mid + Math.imul(ah2, bl0) | 0; - hi2 = Math.imul(ah2, bh0); - lo2 = lo2 + Math.imul(al1, bl1) | 0; - mid = mid + Math.imul(al1, bh1) | 0; - mid = mid + Math.imul(ah1, bl1) | 0; - hi2 = hi2 + Math.imul(ah1, bh1) | 0; - lo2 = lo2 + Math.imul(al0, bl2) | 0; - mid = mid + Math.imul(al0, bh2) | 0; - mid = mid + Math.imul(ah0, bl2) | 0; - hi2 = hi2 + Math.imul(ah0, bh2) | 0; - var w2 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w2 >>> 26) | 0; - w2 &= 67108863; - lo2 = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = mid + Math.imul(ah3, bl0) | 0; - hi2 = Math.imul(ah3, bh0); - lo2 = lo2 + Math.imul(al2, bl1) | 0; - mid = mid + Math.imul(al2, bh1) | 0; - mid = mid + Math.imul(ah2, bl1) | 0; - hi2 = hi2 + Math.imul(ah2, bh1) | 0; - lo2 = lo2 + Math.imul(al1, bl2) | 0; - mid = mid + Math.imul(al1, bh2) | 0; - mid = mid + Math.imul(ah1, bl2) | 0; - hi2 = hi2 + Math.imul(ah1, bh2) | 0; - lo2 = lo2 + Math.imul(al0, bl3) | 0; - mid = mid + Math.imul(al0, bh3) | 0; - mid = mid + Math.imul(ah0, bl3) | 0; - hi2 = hi2 + Math.imul(ah0, bh3) | 0; - var w3 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w3 >>> 26) | 0; - w3 &= 67108863; - lo2 = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = mid + Math.imul(ah4, bl0) | 0; - hi2 = Math.imul(ah4, bh0); - lo2 = lo2 + Math.imul(al3, bl1) | 0; - mid = mid + Math.imul(al3, bh1) | 0; - mid = mid + Math.imul(ah3, bl1) | 0; - hi2 = hi2 + Math.imul(ah3, bh1) | 0; - lo2 = lo2 + Math.imul(al2, bl2) | 0; - mid = mid + Math.imul(al2, bh2) | 0; - mid = mid + Math.imul(ah2, bl2) | 0; - hi2 = hi2 + Math.imul(ah2, bh2) | 0; - lo2 = lo2 + Math.imul(al1, bl3) | 0; - mid = mid + Math.imul(al1, bh3) | 0; - mid = mid + Math.imul(ah1, bl3) | 0; - hi2 = hi2 + Math.imul(ah1, bh3) | 0; - lo2 = lo2 + Math.imul(al0, bl4) | 0; - mid = mid + Math.imul(al0, bh4) | 0; - mid = mid + Math.imul(ah0, bl4) | 0; - hi2 = hi2 + Math.imul(ah0, bh4) | 0; - var w4 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w4 >>> 26) | 0; - w4 &= 67108863; - lo2 = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = mid + Math.imul(ah5, bl0) | 0; - hi2 = Math.imul(ah5, bh0); - lo2 = lo2 + Math.imul(al4, bl1) | 0; - mid = mid + Math.imul(al4, bh1) | 0; - mid = mid + Math.imul(ah4, bl1) | 0; - hi2 = hi2 + Math.imul(ah4, bh1) | 0; - lo2 = lo2 + Math.imul(al3, bl2) | 0; - mid = mid + Math.imul(al3, bh2) | 0; - mid = mid + Math.imul(ah3, bl2) | 0; - hi2 = hi2 + Math.imul(ah3, bh2) | 0; - lo2 = lo2 + Math.imul(al2, bl3) | 0; - mid = mid + Math.imul(al2, bh3) | 0; - mid = mid + Math.imul(ah2, bl3) | 0; - hi2 = hi2 + Math.imul(ah2, bh3) | 0; - lo2 = lo2 + Math.imul(al1, bl4) | 0; - mid = mid + Math.imul(al1, bh4) | 0; - mid = mid + Math.imul(ah1, bl4) | 0; - hi2 = hi2 + Math.imul(ah1, bh4) | 0; - lo2 = lo2 + Math.imul(al0, bl5) | 0; - mid = mid + Math.imul(al0, bh5) | 0; - mid = mid + Math.imul(ah0, bl5) | 0; - hi2 = hi2 + Math.imul(ah0, bh5) | 0; - var w5 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w5 >>> 26) | 0; - w5 &= 67108863; - lo2 = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = mid + Math.imul(ah6, bl0) | 0; - hi2 = Math.imul(ah6, bh0); - lo2 = lo2 + Math.imul(al5, bl1) | 0; - mid = mid + Math.imul(al5, bh1) | 0; - mid = mid + Math.imul(ah5, bl1) | 0; - hi2 = hi2 + Math.imul(ah5, bh1) | 0; - lo2 = lo2 + Math.imul(al4, bl2) | 0; - mid = mid + Math.imul(al4, bh2) | 0; - mid = mid + Math.imul(ah4, bl2) | 0; - hi2 = hi2 + Math.imul(ah4, bh2) | 0; - lo2 = lo2 + Math.imul(al3, bl3) | 0; - mid = mid + Math.imul(al3, bh3) | 0; - mid = mid + Math.imul(ah3, bl3) | 0; - hi2 = hi2 + Math.imul(ah3, bh3) | 0; - lo2 = lo2 + Math.imul(al2, bl4) | 0; - mid = mid + Math.imul(al2, bh4) | 0; - mid = mid + Math.imul(ah2, bl4) | 0; - hi2 = hi2 + Math.imul(ah2, bh4) | 0; - lo2 = lo2 + Math.imul(al1, bl5) | 0; - mid = mid + Math.imul(al1, bh5) | 0; - mid = mid + Math.imul(ah1, bl5) | 0; - hi2 = hi2 + Math.imul(ah1, bh5) | 0; - lo2 = lo2 + Math.imul(al0, bl6) | 0; - mid = mid + Math.imul(al0, bh6) | 0; - mid = mid + Math.imul(ah0, bl6) | 0; - hi2 = hi2 + Math.imul(ah0, bh6) | 0; - var w6 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w6 >>> 26) | 0; - w6 &= 67108863; - lo2 = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = mid + Math.imul(ah7, bl0) | 0; - hi2 = Math.imul(ah7, bh0); - lo2 = lo2 + Math.imul(al6, bl1) | 0; - mid = mid + Math.imul(al6, bh1) | 0; - mid = mid + Math.imul(ah6, bl1) | 0; - hi2 = hi2 + Math.imul(ah6, bh1) | 0; - lo2 = lo2 + Math.imul(al5, bl2) | 0; - mid = mid + Math.imul(al5, bh2) | 0; - mid = mid + Math.imul(ah5, bl2) | 0; - hi2 = hi2 + Math.imul(ah5, bh2) | 0; - lo2 = lo2 + Math.imul(al4, bl3) | 0; - mid = mid + Math.imul(al4, bh3) | 0; - mid = mid + Math.imul(ah4, bl3) | 0; - hi2 = hi2 + Math.imul(ah4, bh3) | 0; - lo2 = lo2 + Math.imul(al3, bl4) | 0; - mid = mid + Math.imul(al3, bh4) | 0; - mid = mid + Math.imul(ah3, bl4) | 0; - hi2 = hi2 + Math.imul(ah3, bh4) | 0; - lo2 = lo2 + Math.imul(al2, bl5) | 0; - mid = mid + Math.imul(al2, bh5) | 0; - mid = mid + Math.imul(ah2, bl5) | 0; - hi2 = hi2 + Math.imul(ah2, bh5) | 0; - lo2 = lo2 + Math.imul(al1, bl6) | 0; - mid = mid + Math.imul(al1, bh6) | 0; - mid = mid + Math.imul(ah1, bl6) | 0; - hi2 = hi2 + Math.imul(ah1, bh6) | 0; - lo2 = lo2 + Math.imul(al0, bl7) | 0; - mid = mid + Math.imul(al0, bh7) | 0; - mid = mid + Math.imul(ah0, bl7) | 0; - hi2 = hi2 + Math.imul(ah0, bh7) | 0; - var w7 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w7 >>> 26) | 0; - w7 &= 67108863; - lo2 = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = mid + Math.imul(ah8, bl0) | 0; - hi2 = Math.imul(ah8, bh0); - lo2 = lo2 + Math.imul(al7, bl1) | 0; - mid = mid + Math.imul(al7, bh1) | 0; - mid = mid + Math.imul(ah7, bl1) | 0; - hi2 = hi2 + Math.imul(ah7, bh1) | 0; - lo2 = lo2 + Math.imul(al6, bl2) | 0; - mid = mid + Math.imul(al6, bh2) | 0; - mid = mid + Math.imul(ah6, bl2) | 0; - hi2 = hi2 + Math.imul(ah6, bh2) | 0; - lo2 = lo2 + Math.imul(al5, bl3) | 0; - mid = mid + Math.imul(al5, bh3) | 0; - mid = mid + Math.imul(ah5, bl3) | 0; - hi2 = hi2 + Math.imul(ah5, bh3) | 0; - lo2 = lo2 + Math.imul(al4, bl4) | 0; - mid = mid + Math.imul(al4, bh4) | 0; - mid = mid + Math.imul(ah4, bl4) | 0; - hi2 = hi2 + Math.imul(ah4, bh4) | 0; - lo2 = lo2 + Math.imul(al3, bl5) | 0; - mid = mid + Math.imul(al3, bh5) | 0; - mid = mid + Math.imul(ah3, bl5) | 0; - hi2 = hi2 + Math.imul(ah3, bh5) | 0; - lo2 = lo2 + Math.imul(al2, bl6) | 0; - mid = mid + Math.imul(al2, bh6) | 0; - mid = mid + Math.imul(ah2, bl6) | 0; - hi2 = hi2 + Math.imul(ah2, bh6) | 0; - lo2 = lo2 + Math.imul(al1, bl7) | 0; - mid = mid + Math.imul(al1, bh7) | 0; - mid = mid + Math.imul(ah1, bl7) | 0; - hi2 = hi2 + Math.imul(ah1, bh7) | 0; - lo2 = lo2 + Math.imul(al0, bl8) | 0; - mid = mid + Math.imul(al0, bh8) | 0; - mid = mid + Math.imul(ah0, bl8) | 0; - hi2 = hi2 + Math.imul(ah0, bh8) | 0; - var w8 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w8 >>> 26) | 0; - w8 &= 67108863; - lo2 = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = mid + Math.imul(ah9, bl0) | 0; - hi2 = Math.imul(ah9, bh0); - lo2 = lo2 + Math.imul(al8, bl1) | 0; - mid = mid + Math.imul(al8, bh1) | 0; - mid = mid + Math.imul(ah8, bl1) | 0; - hi2 = hi2 + Math.imul(ah8, bh1) | 0; - lo2 = lo2 + Math.imul(al7, bl2) | 0; - mid = mid + Math.imul(al7, bh2) | 0; - mid = mid + Math.imul(ah7, bl2) | 0; - hi2 = hi2 + Math.imul(ah7, bh2) | 0; - lo2 = lo2 + Math.imul(al6, bl3) | 0; - mid = mid + Math.imul(al6, bh3) | 0; - mid = mid + Math.imul(ah6, bl3) | 0; - hi2 = hi2 + Math.imul(ah6, bh3) | 0; - lo2 = lo2 + Math.imul(al5, bl4) | 0; - mid = mid + Math.imul(al5, bh4) | 0; - mid = mid + Math.imul(ah5, bl4) | 0; - hi2 = hi2 + Math.imul(ah5, bh4) | 0; - lo2 = lo2 + Math.imul(al4, bl5) | 0; - mid = mid + Math.imul(al4, bh5) | 0; - mid = mid + Math.imul(ah4, bl5) | 0; - hi2 = hi2 + Math.imul(ah4, bh5) | 0; - lo2 = lo2 + Math.imul(al3, bl6) | 0; - mid = mid + Math.imul(al3, bh6) | 0; - mid = mid + Math.imul(ah3, bl6) | 0; - hi2 = hi2 + Math.imul(ah3, bh6) | 0; - lo2 = lo2 + Math.imul(al2, bl7) | 0; - mid = mid + Math.imul(al2, bh7) | 0; - mid = mid + Math.imul(ah2, bl7) | 0; - hi2 = hi2 + Math.imul(ah2, bh7) | 0; - lo2 = lo2 + Math.imul(al1, bl8) | 0; - mid = mid + Math.imul(al1, bh8) | 0; - mid = mid + Math.imul(ah1, bl8) | 0; - hi2 = hi2 + Math.imul(ah1, bh8) | 0; - lo2 = lo2 + Math.imul(al0, bl9) | 0; - mid = mid + Math.imul(al0, bh9) | 0; - mid = mid + Math.imul(ah0, bl9) | 0; - hi2 = hi2 + Math.imul(ah0, bh9) | 0; - var w9 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w9 >>> 26) | 0; - w9 &= 67108863; - lo2 = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = mid + Math.imul(ah9, bl1) | 0; - hi2 = Math.imul(ah9, bh1); - lo2 = lo2 + Math.imul(al8, bl2) | 0; - mid = mid + Math.imul(al8, bh2) | 0; - mid = mid + Math.imul(ah8, bl2) | 0; - hi2 = hi2 + Math.imul(ah8, bh2) | 0; - lo2 = lo2 + Math.imul(al7, bl3) | 0; - mid = mid + Math.imul(al7, bh3) | 0; - mid = mid + Math.imul(ah7, bl3) | 0; - hi2 = hi2 + Math.imul(ah7, bh3) | 0; - lo2 = lo2 + Math.imul(al6, bl4) | 0; - mid = mid + Math.imul(al6, bh4) | 0; - mid = mid + Math.imul(ah6, bl4) | 0; - hi2 = hi2 + Math.imul(ah6, bh4) | 0; - lo2 = lo2 + Math.imul(al5, bl5) | 0; - mid = mid + Math.imul(al5, bh5) | 0; - mid = mid + Math.imul(ah5, bl5) | 0; - hi2 = hi2 + Math.imul(ah5, bh5) | 0; - lo2 = lo2 + Math.imul(al4, bl6) | 0; - mid = mid + Math.imul(al4, bh6) | 0; - mid = mid + Math.imul(ah4, bl6) | 0; - hi2 = hi2 + Math.imul(ah4, bh6) | 0; - lo2 = lo2 + Math.imul(al3, bl7) | 0; - mid = mid + Math.imul(al3, bh7) | 0; - mid = mid + Math.imul(ah3, bl7) | 0; - hi2 = hi2 + Math.imul(ah3, bh7) | 0; - lo2 = lo2 + Math.imul(al2, bl8) | 0; - mid = mid + Math.imul(al2, bh8) | 0; - mid = mid + Math.imul(ah2, bl8) | 0; - hi2 = hi2 + Math.imul(ah2, bh8) | 0; - lo2 = lo2 + Math.imul(al1, bl9) | 0; - mid = mid + Math.imul(al1, bh9) | 0; - mid = mid + Math.imul(ah1, bl9) | 0; - hi2 = hi2 + Math.imul(ah1, bh9) | 0; - var w10 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w10 >>> 26) | 0; - w10 &= 67108863; - lo2 = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = mid + Math.imul(ah9, bl2) | 0; - hi2 = Math.imul(ah9, bh2); - lo2 = lo2 + Math.imul(al8, bl3) | 0; - mid = mid + Math.imul(al8, bh3) | 0; - mid = mid + Math.imul(ah8, bl3) | 0; - hi2 = hi2 + Math.imul(ah8, bh3) | 0; - lo2 = lo2 + Math.imul(al7, bl4) | 0; - mid = mid + Math.imul(al7, bh4) | 0; - mid = mid + Math.imul(ah7, bl4) | 0; - hi2 = hi2 + Math.imul(ah7, bh4) | 0; - lo2 = lo2 + Math.imul(al6, bl5) | 0; - mid = mid + Math.imul(al6, bh5) | 0; - mid = mid + Math.imul(ah6, bl5) | 0; - hi2 = hi2 + Math.imul(ah6, bh5) | 0; - lo2 = lo2 + Math.imul(al5, bl6) | 0; - mid = mid + Math.imul(al5, bh6) | 0; - mid = mid + Math.imul(ah5, bl6) | 0; - hi2 = hi2 + Math.imul(ah5, bh6) | 0; - lo2 = lo2 + Math.imul(al4, bl7) | 0; - mid = mid + Math.imul(al4, bh7) | 0; - mid = mid + Math.imul(ah4, bl7) | 0; - hi2 = hi2 + Math.imul(ah4, bh7) | 0; - lo2 = lo2 + Math.imul(al3, bl8) | 0; - mid = mid + Math.imul(al3, bh8) | 0; - mid = mid + Math.imul(ah3, bl8) | 0; - hi2 = hi2 + Math.imul(ah3, bh8) | 0; - lo2 = lo2 + Math.imul(al2, bl9) | 0; - mid = mid + Math.imul(al2, bh9) | 0; - mid = mid + Math.imul(ah2, bl9) | 0; - hi2 = hi2 + Math.imul(ah2, bh9) | 0; - var w11 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w11 >>> 26) | 0; - w11 &= 67108863; - lo2 = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = mid + Math.imul(ah9, bl3) | 0; - hi2 = Math.imul(ah9, bh3); - lo2 = lo2 + Math.imul(al8, bl4) | 0; - mid = mid + Math.imul(al8, bh4) | 0; - mid = mid + Math.imul(ah8, bl4) | 0; - hi2 = hi2 + Math.imul(ah8, bh4) | 0; - lo2 = lo2 + Math.imul(al7, bl5) | 0; - mid = mid + Math.imul(al7, bh5) | 0; - mid = mid + Math.imul(ah7, bl5) | 0; - hi2 = hi2 + Math.imul(ah7, bh5) | 0; - lo2 = lo2 + Math.imul(al6, bl6) | 0; - mid = mid + Math.imul(al6, bh6) | 0; - mid = mid + Math.imul(ah6, bl6) | 0; - hi2 = hi2 + Math.imul(ah6, bh6) | 0; - lo2 = lo2 + Math.imul(al5, bl7) | 0; - mid = mid + Math.imul(al5, bh7) | 0; - mid = mid + Math.imul(ah5, bl7) | 0; - hi2 = hi2 + Math.imul(ah5, bh7) | 0; - lo2 = lo2 + Math.imul(al4, bl8) | 0; - mid = mid + Math.imul(al4, bh8) | 0; - mid = mid + Math.imul(ah4, bl8) | 0; - hi2 = hi2 + Math.imul(ah4, bh8) | 0; - lo2 = lo2 + Math.imul(al3, bl9) | 0; - mid = mid + Math.imul(al3, bh9) | 0; - mid = mid + Math.imul(ah3, bl9) | 0; - hi2 = hi2 + Math.imul(ah3, bh9) | 0; - var w12 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w12 >>> 26) | 0; - w12 &= 67108863; - lo2 = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = mid + Math.imul(ah9, bl4) | 0; - hi2 = Math.imul(ah9, bh4); - lo2 = lo2 + Math.imul(al8, bl5) | 0; - mid = mid + Math.imul(al8, bh5) | 0; - mid = mid + Math.imul(ah8, bl5) | 0; - hi2 = hi2 + Math.imul(ah8, bh5) | 0; - lo2 = lo2 + Math.imul(al7, bl6) | 0; - mid = mid + Math.imul(al7, bh6) | 0; - mid = mid + Math.imul(ah7, bl6) | 0; - hi2 = hi2 + Math.imul(ah7, bh6) | 0; - lo2 = lo2 + Math.imul(al6, bl7) | 0; - mid = mid + Math.imul(al6, bh7) | 0; - mid = mid + Math.imul(ah6, bl7) | 0; - hi2 = hi2 + Math.imul(ah6, bh7) | 0; - lo2 = lo2 + Math.imul(al5, bl8) | 0; - mid = mid + Math.imul(al5, bh8) | 0; - mid = mid + Math.imul(ah5, bl8) | 0; - hi2 = hi2 + Math.imul(ah5, bh8) | 0; - lo2 = lo2 + Math.imul(al4, bl9) | 0; - mid = mid + Math.imul(al4, bh9) | 0; - mid = mid + Math.imul(ah4, bl9) | 0; - hi2 = hi2 + Math.imul(ah4, bh9) | 0; - var w13 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w13 >>> 26) | 0; - w13 &= 67108863; - lo2 = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = mid + Math.imul(ah9, bl5) | 0; - hi2 = Math.imul(ah9, bh5); - lo2 = lo2 + Math.imul(al8, bl6) | 0; - mid = mid + Math.imul(al8, bh6) | 0; - mid = mid + Math.imul(ah8, bl6) | 0; - hi2 = hi2 + Math.imul(ah8, bh6) | 0; - lo2 = lo2 + Math.imul(al7, bl7) | 0; - mid = mid + Math.imul(al7, bh7) | 0; - mid = mid + Math.imul(ah7, bl7) | 0; - hi2 = hi2 + Math.imul(ah7, bh7) | 0; - lo2 = lo2 + Math.imul(al6, bl8) | 0; - mid = mid + Math.imul(al6, bh8) | 0; - mid = mid + Math.imul(ah6, bl8) | 0; - hi2 = hi2 + Math.imul(ah6, bh8) | 0; - lo2 = lo2 + Math.imul(al5, bl9) | 0; - mid = mid + Math.imul(al5, bh9) | 0; - mid = mid + Math.imul(ah5, bl9) | 0; - hi2 = hi2 + Math.imul(ah5, bh9) | 0; - var w14 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w14 >>> 26) | 0; - w14 &= 67108863; - lo2 = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = mid + Math.imul(ah9, bl6) | 0; - hi2 = Math.imul(ah9, bh6); - lo2 = lo2 + Math.imul(al8, bl7) | 0; - mid = mid + Math.imul(al8, bh7) | 0; - mid = mid + Math.imul(ah8, bl7) | 0; - hi2 = hi2 + Math.imul(ah8, bh7) | 0; - lo2 = lo2 + Math.imul(al7, bl8) | 0; - mid = mid + Math.imul(al7, bh8) | 0; - mid = mid + Math.imul(ah7, bl8) | 0; - hi2 = hi2 + Math.imul(ah7, bh8) | 0; - lo2 = lo2 + Math.imul(al6, bl9) | 0; - mid = mid + Math.imul(al6, bh9) | 0; - mid = mid + Math.imul(ah6, bl9) | 0; - hi2 = hi2 + Math.imul(ah6, bh9) | 0; - var w15 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w15 >>> 26) | 0; - w15 &= 67108863; - lo2 = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = mid + Math.imul(ah9, bl7) | 0; - hi2 = Math.imul(ah9, bh7); - lo2 = lo2 + Math.imul(al8, bl8) | 0; - mid = mid + Math.imul(al8, bh8) | 0; - mid = mid + Math.imul(ah8, bl8) | 0; - hi2 = hi2 + Math.imul(ah8, bh8) | 0; - lo2 = lo2 + Math.imul(al7, bl9) | 0; - mid = mid + Math.imul(al7, bh9) | 0; - mid = mid + Math.imul(ah7, bl9) | 0; - hi2 = hi2 + Math.imul(ah7, bh9) | 0; - var w16 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w16 >>> 26) | 0; - w16 &= 67108863; - lo2 = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = mid + Math.imul(ah9, bl8) | 0; - hi2 = Math.imul(ah9, bh8); - lo2 = lo2 + Math.imul(al8, bl9) | 0; - mid = mid + Math.imul(al8, bh9) | 0; - mid = mid + Math.imul(ah8, bl9) | 0; - hi2 = hi2 + Math.imul(ah8, bh9) | 0; - var w17 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w17 >>> 26) | 0; - w17 &= 67108863; - lo2 = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = mid + Math.imul(ah9, bl9) | 0; - hi2 = Math.imul(ah9, bh9); - var w18 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; - c2 = (hi2 + (mid >>> 13) | 0) + (w18 >>> 26) | 0; - w18 &= 67108863; - o2[0] = w02; - o2[1] = w1; - o2[2] = w2; - o2[3] = w3; - o2[4] = w4; - o2[5] = w5; - o2[6] = w6; - o2[7] = w7; - o2[8] = w8; - o2[9] = w9; - o2[10] = w10; - o2[11] = w11; - o2[12] = w12; - o2[13] = w13; - o2[14] = w14; - o2[15] = w15; - o2[16] = w16; - o2[17] = w17; - o2[18] = w18; - if (c2 !== 0) { - o2[19] = c2; - out.length++; - } - return out; - }; - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - function bigMulTo(self2, num, out) { - out.negative = num.negative ^ self2.negative; - out.length = self2.length + num.length; - var carry = 0; - var hncarry = 0; - for (var k2 = 0; k2 < out.length - 1; k2++) { - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 67108863; - var maxJ = Math.min(k2, num.length - 1); - for (var j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { - var i3 = k2 - j2; - var a3 = self2.words[i3] | 0; - var b2 = num.words[j2] | 0; - var r2 = a3 * b2; - var lo2 = r2 & 67108863; - ncarry = ncarry + (r2 / 67108864 | 0) | 0; - lo2 = lo2 + rword | 0; - rword = lo2 & 67108863; - ncarry = ncarry + (lo2 >>> 26) | 0; - hncarry += ncarry >>> 26; - ncarry &= 67108863; - } - out.words[k2] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k2] = carry; - } else { - out.length--; - } - return out._strip(); - } - function jumboMulTo(self2, num, out) { - return bigMulTo(self2, num, out); - } - BN2.prototype.mulTo = function mulTo(num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - return res; - }; - BN2.prototype.mul = function mul6(num) { - var out = new BN2(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - BN2.prototype.mulf = function mulf(num) { - var out = new BN2(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - BN2.prototype.imul = function imul(num) { - return this.clone().mulTo(num, this); - }; - BN2.prototype.imuln = function imuln(num) { - var isNegNum = num < 0; - if (isNegNum) - num = -num; - assert2(typeof num === "number"); - assert2(num < 67108864); - var carry = 0; - for (var i3 = 0; i3 < this.length; i3++) { - var w2 = (this.words[i3] | 0) * num; - var lo2 = (w2 & 67108863) + (carry & 67108863); - carry >>= 26; - carry += w2 / 67108864 | 0; - carry += lo2 >>> 26; - this.words[i3] = lo2 & 67108863; - } - if (carry !== 0) { - this.words[i3] = carry; - this.length++; - } - return isNegNum ? this.ineg() : this; - }; - BN2.prototype.muln = function muln(num) { - return this.clone().imuln(num); - }; - BN2.prototype.sqr = function sqr() { - return this.mul(this); - }; - BN2.prototype.isqr = function isqr() { - return this.imul(this.clone()); - }; - BN2.prototype.pow = function pow3(num) { - var w2 = toBitArray(num); - if (w2.length === 0) - return new BN2(1); - var res = this; - for (var i3 = 0; i3 < w2.length; i3++, res = res.sqr()) { - if (w2[i3] !== 0) - break; - } - if (++i3 < w2.length) { - for (var q2 = res.sqr(); i3 < w2.length; i3++, q2 = q2.sqr()) { - if (w2[i3] === 0) - continue; - res = res.mul(q2); - } - } - return res; - }; - BN2.prototype.iushln = function iushln(bits) { - assert2(typeof bits === "number" && bits >= 0); - var r2 = bits % 26; - var s2 = (bits - r2) / 26; - var carryMask = 67108863 >>> 26 - r2 << 26 - r2; - var i3; - if (r2 !== 0) { - var carry = 0; - for (i3 = 0; i3 < this.length; i3++) { - var newCarry = this.words[i3] & carryMask; - var c2 = (this.words[i3] | 0) - newCarry << r2; - this.words[i3] = c2 | carry; - carry = newCarry >>> 26 - r2; - } - if (carry) { - this.words[i3] = carry; - this.length++; - } - } - if (s2 !== 0) { - for (i3 = this.length - 1; i3 >= 0; i3--) { - this.words[i3 + s2] = this.words[i3]; - } - for (i3 = 0; i3 < s2; i3++) { - this.words[i3] = 0; - } - this.length += s2; - } - return this._strip(); - }; - BN2.prototype.ishln = function ishln(bits) { - assert2(this.negative === 0); - return this.iushln(bits); - }; - BN2.prototype.iushrn = function iushrn(bits, hint, extended) { - assert2(typeof bits === "number" && bits >= 0); - var h4; - if (hint) { - h4 = (hint - hint % 26) / 26; - } else { - h4 = 0; - } - var r2 = bits % 26; - var s2 = Math.min((bits - r2) / 26, this.length); - var mask2 = 67108863 ^ 67108863 >>> r2 << r2; - var maskedWords = extended; - h4 -= s2; - h4 = Math.max(0, h4); - if (maskedWords) { - for (var i3 = 0; i3 < s2; i3++) { - maskedWords.words[i3] = this.words[i3]; - } - maskedWords.length = s2; - } - if (s2 === 0) - ; - else if (this.length > s2) { - this.length -= s2; - for (i3 = 0; i3 < this.length; i3++) { - this.words[i3] = this.words[i3 + s2]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - var carry = 0; - for (i3 = this.length - 1; i3 >= 0 && (carry !== 0 || i3 >= h4); i3--) { - var word = this.words[i3] | 0; - this.words[i3] = carry << 26 - r2 | word >>> r2; - carry = word & mask2; - } - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - return this._strip(); - }; - BN2.prototype.ishrn = function ishrn(bits, hint, extended) { - assert2(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - BN2.prototype.shln = function shln(bits) { - return this.clone().ishln(bits); - }; - BN2.prototype.ushln = function ushln(bits) { - return this.clone().iushln(bits); - }; - BN2.prototype.shrn = function shrn(bits) { - return this.clone().ishrn(bits); - }; - BN2.prototype.ushrn = function ushrn(bits) { - return this.clone().iushrn(bits); - }; - BN2.prototype.testn = function testn(bit) { - assert2(typeof bit === "number" && bit >= 0); - var r2 = bit % 26; - var s2 = (bit - r2) / 26; - var q2 = 1 << r2; - if (this.length <= s2) - return false; - var w2 = this.words[s2]; - return !!(w2 & q2); - }; - BN2.prototype.imaskn = function imaskn(bits) { - assert2(typeof bits === "number" && bits >= 0); - var r2 = bits % 26; - var s2 = (bits - r2) / 26; - assert2(this.negative === 0, "imaskn works only with positive numbers"); - if (this.length <= s2) { - return this; - } - if (r2 !== 0) { - s2++; - } - this.length = Math.min(s2, this.length); - if (r2 !== 0) { - var mask2 = 67108863 ^ 67108863 >>> r2 << r2; - this.words[this.length - 1] &= mask2; - } - return this._strip(); - }; - BN2.prototype.maskn = function maskn(bits) { - return this.clone().imaskn(bits); - }; - BN2.prototype.iaddn = function iaddn(num) { - assert2(typeof num === "number"); - assert2(num < 67108864); - if (num < 0) - return this.isubn(-num); - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) <= num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - return this._iaddn(num); - }; - BN2.prototype._iaddn = function _iaddn(num) { - this.words[0] += num; - for (var i3 = 0; i3 < this.length && this.words[i3] >= 67108864; i3++) { - this.words[i3] -= 67108864; - if (i3 === this.length - 1) { - this.words[i3 + 1] = 1; - } else { - this.words[i3 + 1]++; - } - } - this.length = Math.max(this.length, i3 + 1); - return this; - }; - BN2.prototype.isubn = function isubn(num) { - assert2(typeof num === "number"); - assert2(num < 67108864); - if (num < 0) - return this.iaddn(-num); - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - this.words[0] -= num; - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - for (var i3 = 0; i3 < this.length && this.words[i3] < 0; i3++) { - this.words[i3] += 67108864; - this.words[i3 + 1] -= 1; - } - } - return this._strip(); - }; - BN2.prototype.addn = function addn(num) { - return this.clone().iaddn(num); - }; - BN2.prototype.subn = function subn(num) { - return this.clone().isubn(num); - }; - BN2.prototype.iabs = function iabs() { - this.negative = 0; - return this; - }; - BN2.prototype.abs = function abs() { - return this.clone().iabs(); - }; - BN2.prototype._ishlnsubmul = function _ishlnsubmul(num, mul6, shift) { - var len = num.length + shift; - var i3; - this._expand(len); - var w2; - var carry = 0; - for (i3 = 0; i3 < num.length; i3++) { - w2 = (this.words[i3 + shift] | 0) + carry; - var right = (num.words[i3] | 0) * mul6; - w2 -= right & 67108863; - carry = (w2 >> 26) - (right / 67108864 | 0); - this.words[i3 + shift] = w2 & 67108863; - } - for (; i3 < this.length - shift; i3++) { - w2 = (this.words[i3 + shift] | 0) + carry; - carry = w2 >> 26; - this.words[i3 + shift] = w2 & 67108863; - } - if (carry === 0) - return this._strip(); - assert2(carry === -1); - carry = 0; - for (i3 = 0; i3 < this.length; i3++) { - w2 = -(this.words[i3] | 0) + carry; - carry = w2 >> 26; - this.words[i3] = w2 & 67108863; - } - this.negative = 1; - return this._strip(); - }; - BN2.prototype._wordDiv = function _wordDiv(num, mode2) { - var shift = this.length - num.length; - var a3 = this.clone(); - var b2 = num; - var bhi = b2.words[b2.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b2 = b2.ushln(shift); - a3.iushln(shift); - bhi = b2.words[b2.length - 1] | 0; - } - var m3 = a3.length - b2.length; - var q2; - if (mode2 !== "mod") { - q2 = new BN2(null); - q2.length = m3 + 1; - q2.words = new Array(q2.length); - for (var i3 = 0; i3 < q2.length; i3++) { - q2.words[i3] = 0; - } - } - var diff = a3.clone()._ishlnsubmul(b2, 1, m3); - if (diff.negative === 0) { - a3 = diff; - if (q2) { - q2.words[m3] = 1; - } - } - for (var j2 = m3 - 1; j2 >= 0; j2--) { - var qj2 = (a3.words[b2.length + j2] | 0) * 67108864 + (a3.words[b2.length + j2 - 1] | 0); - qj2 = Math.min(qj2 / bhi | 0, 67108863); - a3._ishlnsubmul(b2, qj2, j2); - while (a3.negative !== 0) { - qj2--; - a3.negative = 0; - a3._ishlnsubmul(b2, 1, j2); - if (!a3.isZero()) { - a3.negative ^= 1; - } - } - if (q2) { - q2.words[j2] = qj2; - } - } - if (q2) { - q2._strip(); - } - a3._strip(); - if (mode2 !== "div" && shift !== 0) { - a3.iushrn(shift); - } - return { - div: q2 || null, - mod: a3 - }; - }; - BN2.prototype.divmod = function divmod(num, mode2, positive) { - assert2(!num.isZero()); - if (this.isZero()) { - return { - div: new BN2(0), - mod: new BN2(0) - }; - } - var div, mod2, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode2); - if (mode2 !== "mod") { - div = res.div.neg(); - } - if (mode2 !== "div") { - mod2 = res.mod.neg(); - if (positive && mod2.negative !== 0) { - mod2.iadd(num); - } - } - return { - div, - mod: mod2 - }; - } - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode2); - if (mode2 !== "mod") { - div = res.div.neg(); - } - return { - div, - mod: res.mod - }; - } - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode2); - if (mode2 !== "div") { - mod2 = res.mod.neg(); - if (positive && mod2.negative !== 0) { - mod2.isub(num); - } - } - return { - div: res.div, - mod: mod2 - }; - } - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN2(0), - mod: this - }; - } - if (num.length === 1) { - if (mode2 === "div") { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - if (mode2 === "mod") { - return { - div: null, - mod: new BN2(this.modrn(num.words[0])) - }; - } - return { - div: this.divn(num.words[0]), - mod: new BN2(this.modrn(num.words[0])) - }; - } - return this._wordDiv(num, mode2); - }; - BN2.prototype.div = function div(num) { - return this.divmod(num, "div", false).div; - }; - BN2.prototype.mod = function mod2(num) { - return this.divmod(num, "mod", false).mod; - }; - BN2.prototype.umod = function umod(num) { - return this.divmod(num, "mod", true).mod; - }; - BN2.prototype.divRound = function divRound(num) { - var dm = this.divmod(num); - if (dm.mod.isZero()) - return dm.div; - var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; - var half = num.ushrn(1); - var r2 = num.andln(1); - var cmp = mod2.cmp(half); - if (cmp < 0 || r2 === 1 && cmp === 0) - return dm.div; - return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); - }; - BN2.prototype.modrn = function modrn(num) { - var isNegNum = num < 0; - if (isNegNum) - num = -num; - assert2(num <= 67108863); - var p3 = (1 << 26) % num; - var acc = 0; - for (var i3 = this.length - 1; i3 >= 0; i3--) { - acc = (p3 * acc + (this.words[i3] | 0)) % num; - } - return isNegNum ? -acc : acc; - }; - BN2.prototype.modn = function modn(num) { - return this.modrn(num); - }; - BN2.prototype.idivn = function idivn(num) { - var isNegNum = num < 0; - if (isNegNum) - num = -num; - assert2(num <= 67108863); - var carry = 0; - for (var i3 = this.length - 1; i3 >= 0; i3--) { - var w2 = (this.words[i3] | 0) + carry * 67108864; - this.words[i3] = w2 / num | 0; - carry = w2 % num; - } - this._strip(); - return isNegNum ? this.ineg() : this; - }; - BN2.prototype.divn = function divn(num) { - return this.clone().idivn(num); - }; - BN2.prototype.egcd = function egcd(p3) { - assert2(p3.negative === 0); - assert2(!p3.isZero()); - var x3 = this; - var y3 = p3.clone(); - if (x3.negative !== 0) { - x3 = x3.umod(p3); - } else { - x3 = x3.clone(); - } - var A2 = new BN2(1); - var B2 = new BN2(0); - var C3 = new BN2(0); - var D2 = new BN2(1); - var g3 = 0; - while (x3.isEven() && y3.isEven()) { - x3.iushrn(1); - y3.iushrn(1); - ++g3; - } - var yp = y3.clone(); - var xp = x3.clone(); - while (!x3.isZero()) { - for (var i3 = 0, im = 1; (x3.words[0] & im) === 0 && i3 < 26; ++i3, im <<= 1) - ; - if (i3 > 0) { - x3.iushrn(i3); - while (i3-- > 0) { - if (A2.isOdd() || B2.isOdd()) { - A2.iadd(yp); - B2.isub(xp); - } - A2.iushrn(1); - B2.iushrn(1); - } - } - for (var j2 = 0, jm = 1; (y3.words[0] & jm) === 0 && j2 < 26; ++j2, jm <<= 1) - ; - if (j2 > 0) { - y3.iushrn(j2); - while (j2-- > 0) { - if (C3.isOdd() || D2.isOdd()) { - C3.iadd(yp); - D2.isub(xp); - } - C3.iushrn(1); - D2.iushrn(1); - } - } - if (x3.cmp(y3) >= 0) { - x3.isub(y3); - A2.isub(C3); - B2.isub(D2); - } else { - y3.isub(x3); - C3.isub(A2); - D2.isub(B2); - } - } - return { - a: C3, - b: D2, - gcd: y3.iushln(g3) - }; - }; - BN2.prototype._invmp = function _invmp(p3) { - assert2(p3.negative === 0); - assert2(!p3.isZero()); - var a3 = this; - var b2 = p3.clone(); - if (a3.negative !== 0) { - a3 = a3.umod(p3); - } else { - a3 = a3.clone(); - } - var x1 = new BN2(1); - var x22 = new BN2(0); - var delta = b2.clone(); - while (a3.cmpn(1) > 0 && b2.cmpn(1) > 0) { - for (var i3 = 0, im = 1; (a3.words[0] & im) === 0 && i3 < 26; ++i3, im <<= 1) - ; - if (i3 > 0) { - a3.iushrn(i3); - while (i3-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - x1.iushrn(1); - } - } - for (var j2 = 0, jm = 1; (b2.words[0] & jm) === 0 && j2 < 26; ++j2, jm <<= 1) - ; - if (j2 > 0) { - b2.iushrn(j2); - while (j2-- > 0) { - if (x22.isOdd()) { - x22.iadd(delta); - } - x22.iushrn(1); - } - } - if (a3.cmp(b2) >= 0) { - a3.isub(b2); - x1.isub(x22); - } else { - b2.isub(a3); - x22.isub(x1); - } - } - var res; - if (a3.cmpn(1) === 0) { - res = x1; - } else { - res = x22; - } - if (res.cmpn(0) < 0) { - res.iadd(p3); - } - return res; - }; - BN2.prototype.gcd = function gcd(num) { - if (this.isZero()) - return num.abs(); - if (num.isZero()) - return this.abs(); - var a3 = this.clone(); - var b2 = num.clone(); - a3.negative = 0; - b2.negative = 0; - for (var shift = 0; a3.isEven() && b2.isEven(); shift++) { - a3.iushrn(1); - b2.iushrn(1); - } - do { - while (a3.isEven()) { - a3.iushrn(1); - } - while (b2.isEven()) { - b2.iushrn(1); - } - var r2 = a3.cmp(b2); - if (r2 < 0) { - var t2 = a3; - a3 = b2; - b2 = t2; - } else if (r2 === 0 || b2.cmpn(1) === 0) { - break; - } - a3.isub(b2); - } while (true); - return b2.iushln(shift); - }; - BN2.prototype.invm = function invm(num) { - return this.egcd(num).a.umod(num); - }; - BN2.prototype.isEven = function isEven() { - return (this.words[0] & 1) === 0; - }; - BN2.prototype.isOdd = function isOdd2() { - return (this.words[0] & 1) === 1; - }; - BN2.prototype.andln = function andln(num) { - return this.words[0] & num; - }; - BN2.prototype.bincn = function bincn(bit) { - assert2(typeof bit === "number"); - var r2 = bit % 26; - var s2 = (bit - r2) / 26; - var q2 = 1 << r2; - if (this.length <= s2) { - this._expand(s2 + 1); - this.words[s2] |= q2; - return this; - } - var carry = q2; - for (var i3 = s2; carry !== 0 && i3 < this.length; i3++) { - var w2 = this.words[i3] | 0; - w2 += carry; - carry = w2 >>> 26; - w2 &= 67108863; - this.words[i3] = w2; - } - if (carry !== 0) { - this.words[i3] = carry; - this.length++; - } - return this; - }; - BN2.prototype.isZero = function isZero() { - return this.length === 1 && this.words[0] === 0; - }; - BN2.prototype.cmpn = function cmpn(num) { - var negative = num < 0; - if (this.negative !== 0 && !negative) - return -1; - if (this.negative === 0 && negative) - return 1; - this._strip(); - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - assert2(num <= 67108863, "Number is too big"); - var w2 = this.words[0] | 0; - res = w2 === num ? 0 : w2 < num ? -1 : 1; - } - if (this.negative !== 0) - return -res | 0; - return res; - }; - BN2.prototype.cmp = function cmp(num) { - if (this.negative !== 0 && num.negative === 0) - return -1; - if (this.negative === 0 && num.negative !== 0) - return 1; - var res = this.ucmp(num); - if (this.negative !== 0) - return -res | 0; - return res; - }; - BN2.prototype.ucmp = function ucmp(num) { - if (this.length > num.length) - return 1; - if (this.length < num.length) - return -1; - var res = 0; - for (var i3 = this.length - 1; i3 >= 0; i3--) { - var a3 = this.words[i3] | 0; - var b2 = num.words[i3] | 0; - if (a3 === b2) - continue; - if (a3 < b2) { - res = -1; - } else if (a3 > b2) { - res = 1; - } - break; - } - return res; - }; - BN2.prototype.gtn = function gtn(num) { - return this.cmpn(num) === 1; - }; - BN2.prototype.gt = function gt2(num) { - return this.cmp(num) === 1; - }; - BN2.prototype.gten = function gten(num) { - return this.cmpn(num) >= 0; - }; - BN2.prototype.gte = function gte(num) { - return this.cmp(num) >= 0; - }; - BN2.prototype.ltn = function ltn(num) { - return this.cmpn(num) === -1; - }; - BN2.prototype.lt = function lt2(num) { - return this.cmp(num) === -1; - }; - BN2.prototype.lten = function lten(num) { - return this.cmpn(num) <= 0; - }; - BN2.prototype.lte = function lte(num) { - return this.cmp(num) <= 0; - }; - BN2.prototype.eqn = function eqn(num) { - return this.cmpn(num) === 0; - }; - BN2.prototype.eq = function eq7(num) { - return this.cmp(num) === 0; - }; - BN2.red = function red(num) { - return new Red(num); - }; - BN2.prototype.toRed = function toRed(ctx) { - assert2(!this.red, "Already a number in reduction context"); - assert2(this.negative === 0, "red works only with positives"); - return ctx.convertTo(this)._forceRed(ctx); - }; - BN2.prototype.fromRed = function fromRed() { - assert2(this.red, "fromRed works only with numbers in reduction context"); - return this.red.convertFrom(this); - }; - BN2.prototype._forceRed = function _forceRed(ctx) { - this.red = ctx; - return this; - }; - BN2.prototype.forceRed = function forceRed(ctx) { - assert2(!this.red, "Already a number in reduction context"); - return this._forceRed(ctx); - }; - BN2.prototype.redAdd = function redAdd(num) { - assert2(this.red, "redAdd works only with red numbers"); - return this.red.add(this, num); - }; - BN2.prototype.redIAdd = function redIAdd(num) { - assert2(this.red, "redIAdd works only with red numbers"); - return this.red.iadd(this, num); - }; - BN2.prototype.redSub = function redSub(num) { - assert2(this.red, "redSub works only with red numbers"); - return this.red.sub(this, num); - }; - BN2.prototype.redISub = function redISub(num) { - assert2(this.red, "redISub works only with red numbers"); - return this.red.isub(this, num); - }; - BN2.prototype.redShl = function redShl(num) { - assert2(this.red, "redShl works only with red numbers"); - return this.red.shl(this, num); - }; - BN2.prototype.redMul = function redMul(num) { - assert2(this.red, "redMul works only with red numbers"); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - BN2.prototype.redIMul = function redIMul(num) { - assert2(this.red, "redMul works only with red numbers"); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - BN2.prototype.redSqr = function redSqr() { - assert2(this.red, "redSqr works only with red numbers"); - this.red._verify1(this); - return this.red.sqr(this); - }; - BN2.prototype.redISqr = function redISqr() { - assert2(this.red, "redISqr works only with red numbers"); - this.red._verify1(this); - return this.red.isqr(this); - }; - BN2.prototype.redSqrt = function redSqrt() { - assert2(this.red, "redSqrt works only with red numbers"); - this.red._verify1(this); - return this.red.sqrt(this); - }; - BN2.prototype.redInvm = function redInvm() { - assert2(this.red, "redInvm works only with red numbers"); - this.red._verify1(this); - return this.red.invm(this); - }; - BN2.prototype.redNeg = function redNeg() { - assert2(this.red, "redNeg works only with red numbers"); - this.red._verify1(this); - return this.red.neg(this); - }; - BN2.prototype.redPow = function redPow(num) { - assert2(this.red && !num.red, "redPow(normalNum)"); - this.red._verify1(this); - return this.red.pow(this, num); - }; - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - function MPrime(name2, p3) { - this.name = name2; - this.p = new BN2(p3, 16); - this.n = this.p.bitLength(); - this.k = new BN2(1).iushln(this.n).isub(this.p); - this.tmp = this._tmp(); - } - MPrime.prototype._tmp = function _tmp() { - var tmp = new BN2(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - MPrime.prototype.ireduce = function ireduce(num) { - var r2 = num; - var rlen; - do { - this.split(r2, this.tmp); - r2 = this.imulK(r2); - r2 = r2.iadd(this.tmp); - rlen = r2.bitLength(); - } while (rlen > this.n); - var cmp = rlen < this.n ? -1 : r2.ucmp(this.p); - if (cmp === 0) { - r2.words[0] = 0; - r2.length = 1; - } else if (cmp > 0) { - r2.isub(this.p); - } else { - if (r2.strip !== void 0) { - r2.strip(); - } else { - r2._strip(); - } - } - return r2; - }; - MPrime.prototype.split = function split2(input, out) { - input.iushrn(this.n, 0, out); - }; - MPrime.prototype.imulK = function imulK(num) { - return num.imul(this.k); - }; - function K256() { - MPrime.call( - this, - "k256", - "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f" - ); - } - inherits2(K256, MPrime); - K256.prototype.split = function split2(input, output2) { - var mask2 = 4194303; - var outLen = Math.min(input.length, 9); - for (var i3 = 0; i3 < outLen; i3++) { - output2.words[i3] = input.words[i3]; - } - output2.length = outLen; - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - var prev = input.words[9]; - output2.words[output2.length++] = prev & mask2; - for (i3 = 10; i3 < input.length; i3++) { - var next = input.words[i3] | 0; - input.words[i3 - 10] = (next & mask2) << 4 | prev >>> 22; - prev = next; - } - prev >>>= 22; - input.words[i3 - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - K256.prototype.imulK = function imulK(num) { - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - var lo2 = 0; - for (var i3 = 0; i3 < num.length; i3++) { - var w2 = num.words[i3] | 0; - lo2 += w2 * 977; - num.words[i3] = lo2 & 67108863; - lo2 = w2 * 64 + (lo2 / 67108864 | 0); - } - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - function P224() { - MPrime.call( - this, - "p224", - "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001" - ); - } - inherits2(P224, MPrime); - function P192() { - MPrime.call( - this, - "p192", - "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff" - ); - } - inherits2(P192, MPrime); - function P25519() { - MPrime.call( - this, - "25519", - "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed" - ); - } - inherits2(P25519, MPrime); - P25519.prototype.imulK = function imulK(num) { - var carry = 0; - for (var i3 = 0; i3 < num.length; i3++) { - var hi2 = (num.words[i3] | 0) * 19 + carry; - var lo2 = hi2 & 67108863; - hi2 >>>= 26; - num.words[i3] = lo2; - carry = hi2; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - BN2._prime = function prime(name2) { - if (primes[name2]) - return primes[name2]; - var prime2; - if (name2 === "k256") { - prime2 = new K256(); - } else if (name2 === "p224") { - prime2 = new P224(); - } else if (name2 === "p192") { - prime2 = new P192(); - } else if (name2 === "p25519") { - prime2 = new P25519(); - } else { - throw new Error("Unknown prime " + name2); - } - primes[name2] = prime2; - return prime2; - }; - function Red(m3) { - if (typeof m3 === "string") { - var prime = BN2._prime(m3); - this.m = prime.p; - this.prime = prime; - } else { - assert2(m3.gtn(1), "modulus must be greater than 1"); - this.m = m3; - this.prime = null; - } - } - Red.prototype._verify1 = function _verify1(a3) { - assert2(a3.negative === 0, "red works only with positives"); - assert2(a3.red, "red works only with red numbers"); - }; - Red.prototype._verify2 = function _verify2(a3, b2) { - assert2((a3.negative | b2.negative) === 0, "red works only with positives"); - assert2( - a3.red && a3.red === b2.red, - "red works only with red numbers" - ); - }; - Red.prototype.imod = function imod(a3) { - if (this.prime) - return this.prime.ireduce(a3)._forceRed(this); - move(a3, a3.umod(this.m)._forceRed(this)); - return a3; - }; - Red.prototype.neg = function neg4(a3) { - if (a3.isZero()) { - return a3.clone(); - } - return this.m.sub(a3)._forceRed(this); - }; - Red.prototype.add = function add6(a3, b2) { - this._verify2(a3, b2); - var res = a3.add(b2); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - Red.prototype.iadd = function iadd(a3, b2) { - this._verify2(a3, b2); - var res = a3.iadd(b2); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - Red.prototype.sub = function sub(a3, b2) { - this._verify2(a3, b2); - var res = a3.sub(b2); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - Red.prototype.isub = function isub(a3, b2) { - this._verify2(a3, b2); - var res = a3.isub(b2); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - Red.prototype.shl = function shl(a3, num) { - this._verify1(a3); - return this.imod(a3.ushln(num)); - }; - Red.prototype.imul = function imul(a3, b2) { - this._verify2(a3, b2); - return this.imod(a3.imul(b2)); - }; - Red.prototype.mul = function mul6(a3, b2) { - this._verify2(a3, b2); - return this.imod(a3.mul(b2)); - }; - Red.prototype.isqr = function isqr(a3) { - return this.imul(a3, a3.clone()); - }; - Red.prototype.sqr = function sqr(a3) { - return this.mul(a3, a3); - }; - Red.prototype.sqrt = function sqrt(a3) { - if (a3.isZero()) - return a3.clone(); - var mod3 = this.m.andln(3); - assert2(mod3 % 2 === 1); - if (mod3 === 3) { - var pow3 = this.m.add(new BN2(1)).iushrn(2); - return this.pow(a3, pow3); - } - var q2 = this.m.subn(1); - var s2 = 0; - while (!q2.isZero() && q2.andln(1) === 0) { - s2++; - q2.iushrn(1); - } - assert2(!q2.isZero()); - var one = new BN2(1).toRed(this); - var nOne = one.redNeg(); - var lpow = this.m.subn(1).iushrn(1); - var z3 = this.m.bitLength(); - z3 = new BN2(2 * z3 * z3).toRed(this); - while (this.pow(z3, lpow).cmp(nOne) !== 0) { - z3.redIAdd(nOne); - } - var c2 = this.pow(z3, q2); - var r2 = this.pow(a3, q2.addn(1).iushrn(1)); - var t2 = this.pow(a3, q2); - var m3 = s2; - while (t2.cmp(one) !== 0) { - var tmp = t2; - for (var i3 = 0; tmp.cmp(one) !== 0; i3++) { - tmp = tmp.redSqr(); - } - assert2(i3 < m3); - var b2 = this.pow(c2, new BN2(1).iushln(m3 - i3 - 1)); - r2 = r2.redMul(b2); - c2 = b2.redSqr(); - t2 = t2.redMul(c2); - m3 = i3; - } - return r2; - }; - Red.prototype.invm = function invm(a3) { - var inv = a3._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - Red.prototype.pow = function pow3(a3, num) { - if (num.isZero()) - return new BN2(1).toRed(this); - if (num.cmpn(1) === 0) - return a3.clone(); - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN2(1).toRed(this); - wnd[1] = a3; - for (var i3 = 2; i3 < wnd.length; i3++) { - wnd[i3] = this.mul(wnd[i3 - 1], a3); - } - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - for (i3 = num.length - 1; i3 >= 0; i3--) { - var word = num.words[i3]; - for (var j2 = start - 1; j2 >= 0; j2--) { - var bit = word >> j2 & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i3 !== 0 || j2 !== 0)) - continue; - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - return res; - }; - Red.prototype.convertTo = function convertTo(num) { - var r2 = num.umod(this.m); - return r2 === num ? r2.clone() : r2; - }; - Red.prototype.convertFrom = function convertFrom(num) { - var res = num.clone(); - res.red = null; - return res; - }; - BN2.mont = function mont2(num) { - return new Mont(num); - }; - function Mont(m3) { - Red.call(this, m3); - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - this.shift % 26; - } - this.r = new BN2(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); - } - inherits2(Mont, Red); - Mont.prototype.convertTo = function convertTo(num) { - return this.imod(num.ushln(this.shift)); - }; - Mont.prototype.convertFrom = function convertFrom(num) { - var r2 = this.imod(num.mul(this.rinv)); - r2.red = null; - return r2; - }; - Mont.prototype.imul = function imul(a3, b2) { - if (a3.isZero() || b2.isZero()) { - a3.words[0] = 0; - a3.length = 1; - return a3; - } - var t2 = a3.imul(b2); - var c2 = t2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u2 = t2.isub(c2).iushrn(this.shift); - var res = u2; - if (u2.cmp(this.m) >= 0) { - res = u2.isub(this.m); - } else if (u2.cmpn(0) < 0) { - res = u2.iadd(this.m); - } - return res._forceRed(this); - }; - Mont.prototype.mul = function mul6(a3, b2) { - if (a3.isZero() || b2.isZero()) - return new BN2(0)._forceRed(this); - var t2 = a3.mul(b2); - var c2 = t2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u2 = t2.isub(c2).iushrn(this.shift); - var res = u2; - if (u2.cmp(this.m) >= 0) { - res = u2.isub(this.m); - } else if (u2.cmpn(0) < 0) { - res = u2.iadd(this.m); - } - return res._forceRed(this); - }; - Mont.prototype.invm = function invm(a3) { - var res = this.imod(a3._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; - })(module, commonjsGlobal); -})(bn$2); -var bnExports$1 = bn$2.exports; -const _BN = /* @__PURE__ */ getDefaultExportFromCjs$1(bnExports$1); -var safeBuffer = { exports: {} }; -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -(function(module, exports) { - var buffer$12 = buffer; - var Buffer2 = buffer$12.Buffer; - function copyProps(src2, dst) { - for (var key2 in src2) { - dst[key2] = src2[key2]; - } - } - if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { - module.exports = buffer$12; - } else { - copyProps(buffer$12, exports); - exports.Buffer = SafeBuffer; - } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer2(arg, encodingOrOffset, length); - } - SafeBuffer.prototype = Object.create(Buffer2.prototype); - copyProps(Buffer2, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - throw new TypeError("Argument must not be a number"); - } - return Buffer2(arg, encodingOrOffset, length); - }; - SafeBuffer.alloc = function(size2, fill, encoding2) { - if (typeof size2 !== "number") { - throw new TypeError("Argument must be a number"); - } - var buf = Buffer2(size2); - if (fill !== void 0) { - if (typeof encoding2 === "string") { - buf.fill(fill, encoding2); - } else { - buf.fill(fill); - } - } else { - buf.fill(0); - } - return buf; - }; - SafeBuffer.allocUnsafe = function(size2) { - if (typeof size2 !== "number") { - throw new TypeError("Argument must be a number"); - } - return Buffer2(size2); - }; - SafeBuffer.allocUnsafeSlow = function(size2) { - if (typeof size2 !== "number") { - throw new TypeError("Argument must be a number"); - } - return buffer$12.SlowBuffer(size2); - }; -})(safeBuffer, safeBuffer.exports); -var safeBufferExports = safeBuffer.exports; -var _Buffer = safeBufferExports.Buffer; -function base$4(ALPHABET2) { - if (ALPHABET2.length >= 255) { - throw new TypeError("Alphabet too long"); - } - var BASE_MAP = new Uint8Array(256); - for (var j2 = 0; j2 < BASE_MAP.length; j2++) { - BASE_MAP[j2] = 255; - } - for (var i3 = 0; i3 < ALPHABET2.length; i3++) { - var x3 = ALPHABET2.charAt(i3); - var xc2 = x3.charCodeAt(0); - if (BASE_MAP[xc2] !== 255) { - throw new TypeError(x3 + " is ambiguous"); - } - BASE_MAP[xc2] = i3; - } - var BASE2 = ALPHABET2.length; - var LEADER = ALPHABET2.charAt(0); - var FACTOR = Math.log(BASE2) / Math.log(256); - var iFACTOR = Math.log(256) / Math.log(BASE2); - function encode5(source) { - if (Array.isArray(source) || source instanceof Uint8Array) { - source = _Buffer.from(source); - } - if (!_Buffer.isBuffer(source)) { - throw new TypeError("Expected Buffer"); - } - if (source.length === 0) { - return ""; - } - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - var size2 = (pend - pbegin) * iFACTOR + 1 >>> 0; - var b58 = new Uint8Array(size2); - while (pbegin !== pend) { - var carry = source[pbegin]; - var i4 = 0; - for (var it1 = size2 - 1; (carry !== 0 || i4 < length) && it1 !== -1; it1--, i4++) { - carry += 256 * b58[it1] >>> 0; - b58[it1] = carry % BASE2 >>> 0; - carry = carry / BASE2 >>> 0; - } - if (carry !== 0) { - throw new Error("Non-zero carry"); - } - length = i4; - pbegin++; - } - var it2 = size2 - length; - while (it2 !== size2 && b58[it2] === 0) { - it2++; - } - var str = LEADER.repeat(zeroes); - for (; it2 < size2; ++it2) { - str += ALPHABET2.charAt(b58[it2]); - } - return str; - } - function decodeUnsafe(source) { - if (typeof source !== "string") { - throw new TypeError("Expected String"); - } - if (source.length === 0) { - return _Buffer.alloc(0); - } - var psz = 0; - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - var size2 = (source.length - psz) * FACTOR + 1 >>> 0; - var b256 = new Uint8Array(size2); - while (psz < source.length) { - var carry = BASE_MAP[source.charCodeAt(psz)]; - if (carry === 255) { - return; - } - var i4 = 0; - for (var it3 = size2 - 1; (carry !== 0 || i4 < length) && it3 !== -1; it3--, i4++) { - carry += BASE2 * b256[it3] >>> 0; - b256[it3] = carry % 256 >>> 0; - carry = carry / 256 >>> 0; - } - if (carry !== 0) { - throw new Error("Non-zero carry"); - } - length = i4; - psz++; - } - var it4 = size2 - length; - while (it4 !== size2 && b256[it4] === 0) { - it4++; - } - var vch = _Buffer.allocUnsafe(zeroes + (size2 - it4)); - vch.fill(0, 0, zeroes); - var j3 = zeroes; - while (it4 !== size2) { - vch[j3++] = b256[it4++]; - } - return vch; - } - function decode3(string2) { - var buffer2 = decodeUnsafe(string2); - if (buffer2) { - return buffer2; - } - throw new Error("Non-base" + BASE2 + " character"); - } - return { - encode: encode5, - decodeUnsafe, - decode: decode3 - }; -} -var src$2 = base$4; -var basex$1 = src$2; -var ALPHABET$3 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -var bs58$2 = basex$1(ALPHABET$3); -const bs58$3 = /* @__PURE__ */ getDefaultExportFromCjs$1(bs58$2); -const SHA256_K$1 = /* @__PURE__ */ new Uint32Array([ - 1116352408, - 1899447441, - 3049323471, - 3921009573, - 961987163, - 1508970993, - 2453635748, - 2870763221, - 3624381080, - 310598401, - 607225278, - 1426881987, - 1925078388, - 2162078206, - 2614888103, - 3248222580, - 3835390401, - 4022224774, - 264347078, - 604807628, - 770255983, - 1249150122, - 1555081692, - 1996064986, - 2554220882, - 2821834349, - 2952996808, - 3210313671, - 3336571891, - 3584528711, - 113926993, - 338241895, - 666307205, - 773529912, - 1294757372, - 1396182291, - 1695183700, - 1986661051, - 2177026350, - 2456956037, - 2730485921, - 2820302411, - 3259730800, - 3345764771, - 3516065817, - 3600352804, - 4094571909, - 275423344, - 430227734, - 506948616, - 659060556, - 883997877, - 958139571, - 1322822218, - 1537002063, - 1747873779, - 1955562222, - 2024104815, - 2227730452, - 2361852424, - 2428436474, - 2756734187, - 3204031479, - 3329325298 -]); -const SHA256_IV = /* @__PURE__ */ new Uint32Array([ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 -]); -const SHA256_W$1 = /* @__PURE__ */ new Uint32Array(64); -let SHA256$2 = class SHA256 extends HashMD { - constructor() { - super(64, 32, 8, false); - this.A = SHA256_IV[0] | 0; - this.B = SHA256_IV[1] | 0; - this.C = SHA256_IV[2] | 0; - this.D = SHA256_IV[3] | 0; - this.E = SHA256_IV[4] | 0; - this.F = SHA256_IV[5] | 0; - this.G = SHA256_IV[6] | 0; - this.H = SHA256_IV[7] | 0; - } - get() { - const { A: A2, B: B2, C: C3, D: D2, E: E2, F: F2, G: G2, H: H2 } = this; - return [A2, B2, C3, D2, E2, F2, G2, H2]; - } - // prettier-ignore - set(A2, B2, C3, D2, E2, F2, G2, H2) { - this.A = A2 | 0; - this.B = B2 | 0; - this.C = C3 | 0; - this.D = D2 | 0; - this.E = E2 | 0; - this.F = F2 | 0; - this.G = G2 | 0; - this.H = H2 | 0; - } - process(view, offset2) { - for (let i3 = 0; i3 < 16; i3++, offset2 += 4) - SHA256_W$1[i3] = view.getUint32(offset2, false); - for (let i3 = 16; i3 < 64; i3++) { - const W15 = SHA256_W$1[i3 - 15]; - const W2 = SHA256_W$1[i3 - 2]; - const s02 = rotr$1(W15, 7) ^ rotr$1(W15, 18) ^ W15 >>> 3; - const s1 = rotr$1(W2, 17) ^ rotr$1(W2, 19) ^ W2 >>> 10; - SHA256_W$1[i3] = s1 + SHA256_W$1[i3 - 7] + s02 + SHA256_W$1[i3 - 16] | 0; - } - let { A: A2, B: B2, C: C3, D: D2, E: E2, F: F2, G: G2, H: H2 } = this; - for (let i3 = 0; i3 < 64; i3++) { - const sigma1 = rotr$1(E2, 6) ^ rotr$1(E2, 11) ^ rotr$1(E2, 25); - const T12 = H2 + sigma1 + Chi$1(E2, F2, G2) + SHA256_K$1[i3] + SHA256_W$1[i3] | 0; - const sigma0 = rotr$1(A2, 2) ^ rotr$1(A2, 13) ^ rotr$1(A2, 22); - const T22 = sigma0 + Maj$1(A2, B2, C3) | 0; - H2 = G2; - G2 = F2; - F2 = E2; - E2 = D2 + T12 | 0; - D2 = C3; - C3 = B2; - B2 = A2; - A2 = T12 + T22 | 0; - } - A2 = A2 + this.A | 0; - B2 = B2 + this.B | 0; - C3 = C3 + this.C | 0; - D2 = D2 + this.D | 0; - E2 = E2 + this.E | 0; - F2 = F2 + this.F | 0; - G2 = G2 + this.G | 0; - H2 = H2 + this.H | 0; - this.set(A2, B2, C3, D2, E2, F2, G2, H2); - } - roundClean() { - SHA256_W$1.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } -}; -const sha256$3 = /* @__PURE__ */ wrapConstructor$1(() => new SHA256$2()); -var lib = {}; -function inRange(a3, min, max) { - return min <= a3 && a3 <= max; -} -function ToDictionary(o2) { - if (o2 === void 0) - return {}; - if (o2 === Object(o2)) - return o2; - throw TypeError("Could not convert argument to dictionary"); -} -function stringToCodePoints(string2) { - var s2 = String(string2); - var n4 = s2.length; - var i3 = 0; - var u2 = []; - while (i3 < n4) { - var c2 = s2.charCodeAt(i3); - if (c2 < 55296 || c2 > 57343) { - u2.push(c2); - } else if (56320 <= c2 && c2 <= 57343) { - u2.push(65533); - } else if (55296 <= c2 && c2 <= 56319) { - if (i3 === n4 - 1) { - u2.push(65533); - } else { - var d4 = string2.charCodeAt(i3 + 1); - if (56320 <= d4 && d4 <= 57343) { - var a3 = c2 & 1023; - var b2 = d4 & 1023; - u2.push(65536 + (a3 << 10) + b2); - i3 += 1; - } else { - u2.push(65533); - } - } - } - i3 += 1; - } - return u2; -} -function codePointsToString(code_points) { - var s2 = ""; - for (var i3 = 0; i3 < code_points.length; ++i3) { - var cp = code_points[i3]; - if (cp <= 65535) { - s2 += String.fromCharCode(cp); - } else { - cp -= 65536; - s2 += String.fromCharCode( - (cp >> 10) + 55296, - (cp & 1023) + 56320 - ); - } - } - return s2; -} -var end_of_stream = -1; -function Stream(tokens) { - this.tokens = [].slice.call(tokens); -} -Stream.prototype = { - /** - * @return {boolean} True if end-of-stream has been hit. - */ - endOfStream: function() { - return !this.tokens.length; - }, - /** - * When a token is read from a stream, the first token in the - * stream must be returned and subsequently removed, and - * end-of-stream must be returned otherwise. - * - * @return {number} Get the next token from the stream, or - * end_of_stream. - */ - read: function() { - if (!this.tokens.length) - return end_of_stream; - return this.tokens.shift(); - }, - /** - * When one or more tokens are prepended to a stream, those tokens - * must be inserted, in given order, before the first token in the - * stream. - * - * @param {(number|!Array.)} token The token(s) to prepend to the stream. - */ - prepend: function(token2) { - if (Array.isArray(token2)) { - var tokens = ( - /**@type {!Array.}*/ - token2 - ); - while (tokens.length) - this.tokens.unshift(tokens.pop()); - } else { - this.tokens.unshift(token2); - } - }, - /** - * When one or more tokens are pushed to a stream, those tokens - * must be inserted, in given order, after the last token in the - * stream. - * - * @param {(number|!Array.)} token The tokens(s) to prepend to the stream. - */ - push: function(token2) { - if (Array.isArray(token2)) { - var tokens = ( - /**@type {!Array.}*/ - token2 - ); - while (tokens.length) - this.tokens.push(tokens.shift()); - } else { - this.tokens.push(token2); - } - } -}; -var finished = -1; -function decoderError(fatal, opt_code_point) { - if (fatal) - throw TypeError("Decoder error"); - return opt_code_point || 65533; -} -var DEFAULT_ENCODING = "utf-8"; -function TextDecoder$1(encoding2, options) { - if (!(this instanceof TextDecoder$1)) { - return new TextDecoder$1(encoding2, options); - } - encoding2 = encoding2 !== void 0 ? String(encoding2).toLowerCase() : DEFAULT_ENCODING; - if (encoding2 !== DEFAULT_ENCODING) { - throw new Error("Encoding not supported. Only utf-8 is supported"); - } - options = ToDictionary(options); - this._streaming = false; - this._BOMseen = false; - this._decoder = null; - this._fatal = Boolean(options["fatal"]); - this._ignoreBOM = Boolean(options["ignoreBOM"]); - Object.defineProperty(this, "encoding", { value: "utf-8" }); - Object.defineProperty(this, "fatal", { value: this._fatal }); - Object.defineProperty(this, "ignoreBOM", { value: this._ignoreBOM }); -} -TextDecoder$1.prototype = { - /** - * @param {ArrayBufferView=} input The buffer of bytes to decode. - * @param {Object=} options - * @return {string} The decoded string. - */ - decode: function decode(input, options) { - var bytes2; - if (typeof input === "object" && input instanceof ArrayBuffer) { - bytes2 = new Uint8Array(input); - } else if (typeof input === "object" && "buffer" in input && input.buffer instanceof ArrayBuffer) { - bytes2 = new Uint8Array( - input.buffer, - input.byteOffset, - input.byteLength - ); - } else { - bytes2 = new Uint8Array(0); - } - options = ToDictionary(options); - if (!this._streaming) { - this._decoder = new UTF8Decoder({ fatal: this._fatal }); - this._BOMseen = false; - } - this._streaming = Boolean(options["stream"]); - var input_stream = new Stream(bytes2); - var code_points = []; - var result; - while (!input_stream.endOfStream()) { - result = this._decoder.handler(input_stream, input_stream.read()); - if (result === finished) - break; - if (result === null) - continue; - if (Array.isArray(result)) - code_points.push.apply( - code_points, - /**@type {!Array.}*/ - result - ); - else - code_points.push(result); - } - if (!this._streaming) { - do { - result = this._decoder.handler(input_stream, input_stream.read()); - if (result === finished) - break; - if (result === null) - continue; - if (Array.isArray(result)) - code_points.push.apply( - code_points, - /**@type {!Array.}*/ - result - ); - else - code_points.push(result); - } while (!input_stream.endOfStream()); - this._decoder = null; - } - if (code_points.length) { - if (["utf-8"].indexOf(this.encoding) !== -1 && !this._ignoreBOM && !this._BOMseen) { - if (code_points[0] === 65279) { - this._BOMseen = true; - code_points.shift(); - } else { - this._BOMseen = true; - } - } - } - return codePointsToString(code_points); - } -}; -function TextEncoder$1(encoding2, options) { - if (!(this instanceof TextEncoder$1)) - return new TextEncoder$1(encoding2, options); - encoding2 = encoding2 !== void 0 ? String(encoding2).toLowerCase() : DEFAULT_ENCODING; - if (encoding2 !== DEFAULT_ENCODING) { - throw new Error("Encoding not supported. Only utf-8 is supported"); - } - options = ToDictionary(options); - this._streaming = false; - this._encoder = null; - this._options = { fatal: Boolean(options["fatal"]) }; - Object.defineProperty(this, "encoding", { value: "utf-8" }); -} -TextEncoder$1.prototype = { - /** - * @param {string=} opt_string The string to encode. - * @param {Object=} options - * @return {Uint8Array} Encoded bytes, as a Uint8Array. - */ - encode: function encode(opt_string, options) { - opt_string = opt_string ? String(opt_string) : ""; - options = ToDictionary(options); - if (!this._streaming) - this._encoder = new UTF8Encoder(this._options); - this._streaming = Boolean(options["stream"]); - var bytes2 = []; - var input_stream = new Stream(stringToCodePoints(opt_string)); - var result; - while (!input_stream.endOfStream()) { - result = this._encoder.handler(input_stream, input_stream.read()); - if (result === finished) - break; - if (Array.isArray(result)) - bytes2.push.apply( - bytes2, - /**@type {!Array.}*/ - result - ); - else - bytes2.push(result); - } - if (!this._streaming) { - while (true) { - result = this._encoder.handler(input_stream, input_stream.read()); - if (result === finished) - break; - if (Array.isArray(result)) - bytes2.push.apply( - bytes2, - /**@type {!Array.}*/ - result - ); - else - bytes2.push(result); - } - this._encoder = null; - } - return new Uint8Array(bytes2); - } -}; -function UTF8Decoder(options) { - var fatal = options.fatal; - var utf8_code_point = 0, utf8_bytes_seen = 0, utf8_bytes_needed = 0, utf8_lower_boundary = 128, utf8_upper_boundary = 191; - this.handler = function(stream2, bite) { - if (bite === end_of_stream && utf8_bytes_needed !== 0) { - utf8_bytes_needed = 0; - return decoderError(fatal); - } - if (bite === end_of_stream) - return finished; - if (utf8_bytes_needed === 0) { - if (inRange(bite, 0, 127)) { - return bite; - } - if (inRange(bite, 194, 223)) { - utf8_bytes_needed = 1; - utf8_code_point = bite - 192; - } else if (inRange(bite, 224, 239)) { - if (bite === 224) - utf8_lower_boundary = 160; - if (bite === 237) - utf8_upper_boundary = 159; - utf8_bytes_needed = 2; - utf8_code_point = bite - 224; - } else if (inRange(bite, 240, 244)) { - if (bite === 240) - utf8_lower_boundary = 144; - if (bite === 244) - utf8_upper_boundary = 143; - utf8_bytes_needed = 3; - utf8_code_point = bite - 240; - } else { - return decoderError(fatal); - } - utf8_code_point = utf8_code_point << 6 * utf8_bytes_needed; - return null; - } - if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) { - utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; - utf8_lower_boundary = 128; - utf8_upper_boundary = 191; - stream2.prepend(bite); - return decoderError(fatal); - } - utf8_lower_boundary = 128; - utf8_upper_boundary = 191; - utf8_bytes_seen += 1; - utf8_code_point += bite - 128 << 6 * (utf8_bytes_needed - utf8_bytes_seen); - if (utf8_bytes_seen !== utf8_bytes_needed) - return null; - var code_point = utf8_code_point; - utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; - return code_point; - }; -} -function UTF8Encoder(options) { - options.fatal; - this.handler = function(stream2, code_point) { - if (code_point === end_of_stream) - return finished; - if (inRange(code_point, 0, 127)) - return code_point; - var count, offset2; - if (inRange(code_point, 128, 2047)) { - count = 1; - offset2 = 192; - } else if (inRange(code_point, 2048, 65535)) { - count = 2; - offset2 = 224; - } else if (inRange(code_point, 65536, 1114111)) { - count = 3; - offset2 = 240; - } - var bytes2 = [(code_point >> 6 * count) + offset2]; - while (count > 0) { - var temp = code_point >> 6 * (count - 1); - bytes2.push(128 | temp & 63); - count -= 1; - } - return bytes2; - }; -} -const encoding$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - TextDecoder: TextDecoder$1, - TextEncoder: TextEncoder$1 -}, Symbol.toStringTag, { value: "Module" })); -const require$$2 = /* @__PURE__ */ getAugmentedNamespace(encoding$1); -var __createBinding$1 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - Object.defineProperty(o2, k22, { enumerable: true, get: function() { - return m3[k2]; - } }); -} : function(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; -}); -var __setModuleDefault = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o2, v6) { - Object.defineProperty(o2, "default", { enumerable: true, value: v6 }); -} : function(o2, v6) { - o2["default"] = v6; -}); -var __decorate$1 = commonjsGlobal && commonjsGlobal.__decorate || function(decorators, target, key2, desc) { - var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d4; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r2 = Reflect.decorate(decorators, target, key2, desc); - else - for (var i3 = decorators.length - 1; i3 >= 0; i3--) - if (d4 = decorators[i3]) - r2 = (c2 < 3 ? d4(r2) : c2 > 3 ? d4(target, key2, r2) : d4(target, key2)) || r2; - return c2 > 3 && r2 && Object.defineProperty(target, key2, r2), r2; -}; -var __importStar$1 = commonjsGlobal && commonjsGlobal.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result = {}; - if (mod2 != null) { - for (var k2 in mod2) - if (k2 !== "default" && Object.hasOwnProperty.call(mod2, k2)) - __createBinding$1(result, mod2, k2); - } - __setModuleDefault(result, mod2); - return result; -}; -var __importDefault$1 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod2) { - return mod2 && mod2.__esModule ? mod2 : { "default": mod2 }; -}; -Object.defineProperty(lib, "__esModule", { value: true }); -var deserializeUnchecked_1 = lib.deserializeUnchecked = deserialize_1 = lib.deserialize = serialize_1 = lib.serialize = lib.BinaryReader = lib.BinaryWriter = lib.BorshError = lib.baseDecode = lib.baseEncode = void 0; -const bn_js_1 = __importDefault$1(bnExports$1); -const bs58_1 = __importDefault$1(bs58$2); -const encoding = __importStar$1(require$$2); -const ResolvedTextDecoder = typeof TextDecoder !== "function" ? encoding.TextDecoder : TextDecoder; -const textDecoder = new ResolvedTextDecoder("utf-8", { fatal: true }); -function baseEncode(value) { - if (typeof value === "string") { - value = Buffer.from(value, "utf8"); - } - return bs58_1.default.encode(Buffer.from(value)); -} -lib.baseEncode = baseEncode; -function baseDecode(value) { - return Buffer.from(bs58_1.default.decode(value)); -} -lib.baseDecode = baseDecode; -const INITIAL_LENGTH = 1024; -class BorshError extends Error { - constructor(message2) { - super(message2); - this.fieldPath = []; - this.originalMessage = message2; - } - addToFieldPath(fieldName) { - this.fieldPath.splice(0, 0, fieldName); - this.message = this.originalMessage + ": " + this.fieldPath.join("."); - } -} -lib.BorshError = BorshError; -class BinaryWriter { - constructor() { - this.buf = Buffer.alloc(INITIAL_LENGTH); - this.length = 0; - } - maybeResize() { - if (this.buf.length < 16 + this.length) { - this.buf = Buffer.concat([this.buf, Buffer.alloc(INITIAL_LENGTH)]); - } - } - writeU8(value) { - this.maybeResize(); - this.buf.writeUInt8(value, this.length); - this.length += 1; - } - writeU16(value) { - this.maybeResize(); - this.buf.writeUInt16LE(value, this.length); - this.length += 2; - } - writeU32(value) { - this.maybeResize(); - this.buf.writeUInt32LE(value, this.length); - this.length += 4; - } - writeU64(value) { - this.maybeResize(); - this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 8))); - } - writeU128(value) { - this.maybeResize(); - this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 16))); - } - writeU256(value) { - this.maybeResize(); - this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 32))); - } - writeU512(value) { - this.maybeResize(); - this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 64))); - } - writeBuffer(buffer2) { - this.buf = Buffer.concat([ - Buffer.from(this.buf.subarray(0, this.length)), - buffer2, - Buffer.alloc(INITIAL_LENGTH) - ]); - this.length += buffer2.length; - } - writeString(str) { - this.maybeResize(); - const b2 = Buffer.from(str, "utf8"); - this.writeU32(b2.length); - this.writeBuffer(b2); - } - writeFixedArray(array2) { - this.writeBuffer(Buffer.from(array2)); - } - writeArray(array2, fn2) { - this.maybeResize(); - this.writeU32(array2.length); - for (const elem of array2) { - this.maybeResize(); - fn2(elem); - } - } - toArray() { - return this.buf.subarray(0, this.length); - } -} -lib.BinaryWriter = BinaryWriter; -function handlingRangeError(target, propertyKey, propertyDescriptor) { - const originalMethod = propertyDescriptor.value; - propertyDescriptor.value = function(...args) { - try { - return originalMethod.apply(this, args); - } catch (e18) { - if (e18 instanceof RangeError) { - const code2 = e18.code; - if (["ERR_BUFFER_OUT_OF_BOUNDS", "ERR_OUT_OF_RANGE"].indexOf(code2) >= 0) { - throw new BorshError("Reached the end of buffer when deserializing"); - } - } - throw e18; - } - }; -} -class BinaryReader { - constructor(buf) { - this.buf = buf; - this.offset = 0; - } - readU8() { - const value = this.buf.readUInt8(this.offset); - this.offset += 1; - return value; - } - readU16() { - const value = this.buf.readUInt16LE(this.offset); - this.offset += 2; - return value; - } - readU32() { - const value = this.buf.readUInt32LE(this.offset); - this.offset += 4; - return value; - } - readU64() { - const buf = this.readBuffer(8); - return new bn_js_1.default(buf, "le"); - } - readU128() { - const buf = this.readBuffer(16); - return new bn_js_1.default(buf, "le"); - } - readU256() { - const buf = this.readBuffer(32); - return new bn_js_1.default(buf, "le"); - } - readU512() { - const buf = this.readBuffer(64); - return new bn_js_1.default(buf, "le"); - } - readBuffer(len) { - if (this.offset + len > this.buf.length) { - throw new BorshError(`Expected buffer length ${len} isn't within bounds`); - } - const result = this.buf.slice(this.offset, this.offset + len); - this.offset += len; - return result; - } - readString() { - const len = this.readU32(); - const buf = this.readBuffer(len); - try { - return textDecoder.decode(buf); - } catch (e18) { - throw new BorshError(`Error decoding UTF-8 string: ${e18}`); - } - } - readFixedArray(len) { - return new Uint8Array(this.readBuffer(len)); - } - readArray(fn2) { - const len = this.readU32(); - const result = Array(); - for (let i3 = 0; i3 < len; ++i3) { - result.push(fn2()); - } - return result; - } -} -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readU8", null); -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readU16", null); -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readU32", null); -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readU64", null); -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readU128", null); -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readU256", null); -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readU512", null); -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readString", null); -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readFixedArray", null); -__decorate$1([ - handlingRangeError -], BinaryReader.prototype, "readArray", null); -lib.BinaryReader = BinaryReader; -function capitalizeFirstLetter(string2) { - return string2.charAt(0).toUpperCase() + string2.slice(1); -} -function serializeField(schema, fieldName, value, fieldType, writer) { - try { - if (typeof fieldType === "string") { - writer[`write${capitalizeFirstLetter(fieldType)}`](value); - } else if (fieldType instanceof Array) { - if (typeof fieldType[0] === "number") { - if (value.length !== fieldType[0]) { - throw new BorshError(`Expecting byte array of length ${fieldType[0]}, but got ${value.length} bytes`); - } - writer.writeFixedArray(value); - } else if (fieldType.length === 2 && typeof fieldType[1] === "number") { - if (value.length !== fieldType[1]) { - throw new BorshError(`Expecting byte array of length ${fieldType[1]}, but got ${value.length} bytes`); - } - for (let i3 = 0; i3 < fieldType[1]; i3++) { - serializeField(schema, null, value[i3], fieldType[0], writer); - } - } else { - writer.writeArray(value, (item) => { - serializeField(schema, fieldName, item, fieldType[0], writer); - }); - } - } else if (fieldType.kind !== void 0) { - switch (fieldType.kind) { - case "option": { - if (value === null || value === void 0) { - writer.writeU8(0); - } else { - writer.writeU8(1); - serializeField(schema, fieldName, value, fieldType.type, writer); - } - break; - } - case "map": { - writer.writeU32(value.size); - value.forEach((val, key2) => { - serializeField(schema, fieldName, key2, fieldType.key, writer); - serializeField(schema, fieldName, val, fieldType.value, writer); - }); - break; - } - default: - throw new BorshError(`FieldType ${fieldType} unrecognized`); - } - } else { - serializeStruct(schema, value, writer); - } - } catch (error) { - if (error instanceof BorshError) { - error.addToFieldPath(fieldName); - } - throw error; - } -} -function serializeStruct(schema, obj, writer) { - if (typeof obj.borshSerialize === "function") { - obj.borshSerialize(writer); - return; - } - const structSchema = schema.get(obj.constructor); - if (!structSchema) { - throw new BorshError(`Class ${obj.constructor.name} is missing in schema`); - } - if (structSchema.kind === "struct") { - structSchema.fields.map(([fieldName, fieldType]) => { - serializeField(schema, fieldName, obj[fieldName], fieldType, writer); - }); - } else if (structSchema.kind === "enum") { - const name2 = obj[structSchema.field]; - for (let idx = 0; idx < structSchema.values.length; ++idx) { - const [fieldName, fieldType] = structSchema.values[idx]; - if (fieldName === name2) { - writer.writeU8(idx); - serializeField(schema, fieldName, obj[fieldName], fieldType, writer); - break; - } - } - } else { - throw new BorshError(`Unexpected schema kind: ${structSchema.kind} for ${obj.constructor.name}`); - } -} -function serialize(schema, obj, Writer2 = BinaryWriter) { - const writer = new Writer2(); - serializeStruct(schema, obj, writer); - return writer.toArray(); -} -var serialize_1 = lib.serialize = serialize; -function deserializeField(schema, fieldName, fieldType, reader) { - try { - if (typeof fieldType === "string") { - return reader[`read${capitalizeFirstLetter(fieldType)}`](); - } - if (fieldType instanceof Array) { - if (typeof fieldType[0] === "number") { - return reader.readFixedArray(fieldType[0]); - } else if (typeof fieldType[1] === "number") { - const arr = []; - for (let i3 = 0; i3 < fieldType[1]; i3++) { - arr.push(deserializeField(schema, null, fieldType[0], reader)); - } - return arr; - } else { - return reader.readArray(() => deserializeField(schema, fieldName, fieldType[0], reader)); - } - } - if (fieldType.kind === "option") { - const option = reader.readU8(); - if (option) { - return deserializeField(schema, fieldName, fieldType.type, reader); - } - return void 0; - } - if (fieldType.kind === "map") { - let map = /* @__PURE__ */ new Map(); - const length = reader.readU32(); - for (let i3 = 0; i3 < length; i3++) { - const key2 = deserializeField(schema, fieldName, fieldType.key, reader); - const val = deserializeField(schema, fieldName, fieldType.value, reader); - map.set(key2, val); - } - return map; - } - return deserializeStruct(schema, fieldType, reader); - } catch (error) { - if (error instanceof BorshError) { - error.addToFieldPath(fieldName); - } - throw error; - } -} -function deserializeStruct(schema, classType, reader) { - if (typeof classType.borshDeserialize === "function") { - return classType.borshDeserialize(reader); - } - const structSchema = schema.get(classType); - if (!structSchema) { - throw new BorshError(`Class ${classType.name} is missing in schema`); - } - if (structSchema.kind === "struct") { - const result = {}; - for (const [fieldName, fieldType] of schema.get(classType).fields) { - result[fieldName] = deserializeField(schema, fieldName, fieldType, reader); - } - return new classType(result); - } - if (structSchema.kind === "enum") { - const idx = reader.readU8(); - if (idx >= structSchema.values.length) { - throw new BorshError(`Enum index: ${idx} is out of range`); - } - const [fieldName, fieldType] = structSchema.values[idx]; - const fieldValue = deserializeField(schema, fieldName, fieldType, reader); - return new classType({ [fieldName]: fieldValue }); - } - throw new BorshError(`Unexpected schema kind: ${structSchema.kind} for ${classType.constructor.name}`); -} -function deserialize(schema, classType, buffer2, Reader2 = BinaryReader) { - const reader = new Reader2(buffer2); - const result = deserializeStruct(schema, classType, reader); - if (reader.offset < buffer2.length) { - throw new BorshError(`Unexpected ${buffer2.length - reader.offset} bytes after deserialized data`); - } - return result; -} -var deserialize_1 = lib.deserialize = deserialize; -function deserializeUnchecked(schema, classType, buffer2, Reader2 = BinaryReader) { - const reader = new Reader2(buffer2); - return deserializeStruct(schema, classType, reader); -} -deserializeUnchecked_1 = lib.deserializeUnchecked = deserializeUnchecked; -var Layout$1 = {}; -Object.defineProperty(Layout$1, "__esModule", { value: true }); -Layout$1.s16 = Layout$1.s8 = Layout$1.nu64be = Layout$1.u48be = Layout$1.u40be = Layout$1.u32be = Layout$1.u24be = Layout$1.u16be = nu64 = Layout$1.nu64 = Layout$1.u48 = Layout$1.u40 = u32$1 = Layout$1.u32 = Layout$1.u24 = u16 = Layout$1.u16 = u8 = Layout$1.u8 = offset = Layout$1.offset = Layout$1.greedy = Layout$1.Constant = Layout$1.UTF8 = Layout$1.CString = Layout$1.Blob = Layout$1.Boolean = Layout$1.BitField = Layout$1.BitStructure = Layout$1.VariantLayout = Layout$1.Union = Layout$1.UnionLayoutDiscriminator = Layout$1.UnionDiscriminator = Layout$1.Structure = Layout$1.Sequence = Layout$1.DoubleBE = Layout$1.Double = Layout$1.FloatBE = Layout$1.Float = Layout$1.NearInt64BE = Layout$1.NearInt64 = Layout$1.NearUInt64BE = Layout$1.NearUInt64 = Layout$1.IntBE = Layout$1.Int = Layout$1.UIntBE = Layout$1.UInt = Layout$1.OffsetLayout = Layout$1.GreedyCount = Layout$1.ExternalLayout = Layout$1.bindConstructorLayout = Layout$1.nameWithProperty = Layout$1.Layout = Layout$1.uint8ArrayToBuffer = Layout$1.checkUint8Array = void 0; -Layout$1.constant = Layout$1.utf8 = Layout$1.cstr = blob = Layout$1.blob = Layout$1.unionLayoutDiscriminator = Layout$1.union = seq = Layout$1.seq = Layout$1.bits = struct = Layout$1.struct = Layout$1.f64be = Layout$1.f64 = Layout$1.f32be = Layout$1.f32 = Layout$1.ns64be = Layout$1.s48be = Layout$1.s40be = Layout$1.s32be = Layout$1.s24be = Layout$1.s16be = ns64 = Layout$1.ns64 = Layout$1.s48 = Layout$1.s40 = Layout$1.s32 = Layout$1.s24 = void 0; -const buffer_1 = buffer; -function checkUint8Array(b2) { - if (!(b2 instanceof Uint8Array)) { - throw new TypeError("b must be a Uint8Array"); - } -} -Layout$1.checkUint8Array = checkUint8Array; -function uint8ArrayToBuffer(b2) { - checkUint8Array(b2); - return buffer_1.Buffer.from(b2.buffer, b2.byteOffset, b2.length); -} -Layout$1.uint8ArrayToBuffer = uint8ArrayToBuffer; -class Layout { - constructor(span, property) { - if (!Number.isInteger(span)) { - throw new TypeError("span must be an integer"); - } - this.span = span; - this.property = property; - } - /** Function to create an Object into which decoded properties will - * be written. - * - * Used only for layouts that {@link Layout#decode|decode} to Object - * instances, which means: - * * {@link Structure} - * * {@link Union} - * * {@link VariantLayout} - * * {@link BitStructure} - * - * If left undefined the JavaScript representation of these layouts - * will be Object instances. - * - * See {@link bindConstructorLayout}. - */ - makeDestinationObject() { - return {}; - } - /** - * Calculate the span of a specific instance of a layout. - * - * @param {Uint8Array} b - the buffer that contains an encoded instance. - * - * @param {Number} [offset] - the offset at which the encoded instance - * starts. If absent a zero offset is inferred. - * - * @return {Number} - the number of bytes covered by the layout - * instance. If this method is not overridden in a subclass the - * definition-time constant {@link Layout#span|span} will be - * returned. - * - * @throws {RangeError} - if the length of the value cannot be - * determined. - */ - getSpan(b2, offset2) { - if (0 > this.span) { - throw new RangeError("indeterminate span"); - } - return this.span; - } - /** - * Replicate the layout using a new property. - * - * This function must be used to get a structurally-equivalent layout - * with a different name since all {@link Layout} instances are - * immutable. - * - * **NOTE** This is a shallow copy. All fields except {@link - * Layout#property|property} are strictly equal to the origin layout. - * - * @param {String} property - the value for {@link - * Layout#property|property} in the replica. - * - * @returns {Layout} - the copy with {@link Layout#property|property} - * set to `property`. - */ - replicate(property) { - const rv2 = Object.create(this.constructor.prototype); - Object.assign(rv2, this); - rv2.property = property; - return rv2; - } - /** - * Create an object from layout properties and an array of values. - * - * **NOTE** This function returns `undefined` if invoked on a layout - * that does not return its value as an Object. Objects are - * returned for things that are a {@link Structure}, which includes - * {@link VariantLayout|variant layouts} if they are structures, and - * excludes {@link Union}s. If you want this feature for a union - * you must use {@link Union.getVariant|getVariant} to select the - * desired layout. - * - * @param {Array} values - an array of values that correspond to the - * default order for properties. As with {@link Layout#decode|decode} - * layout elements that have no property name are skipped when - * iterating over the array values. Only the top-level properties are - * assigned; arguments are not assigned to properties of contained - * layouts. Any unused values are ignored. - * - * @return {(Object|undefined)} - */ - fromArray(values) { - return void 0; - } -} -Layout$1.Layout = Layout; -function nameWithProperty(name2, lo2) { - if (lo2.property) { - return name2 + "[" + lo2.property + "]"; - } - return name2; -} -Layout$1.nameWithProperty = nameWithProperty; -function bindConstructorLayout(Class, layout) { - if ("function" !== typeof Class) { - throw new TypeError("Class must be constructor"); - } - if (Object.prototype.hasOwnProperty.call(Class, "layout_")) { - throw new Error("Class is already bound to a layout"); - } - if (!(layout && layout instanceof Layout)) { - throw new TypeError("layout must be a Layout"); - } - if (Object.prototype.hasOwnProperty.call(layout, "boundConstructor_")) { - throw new Error("layout is already bound to a constructor"); - } - Class.layout_ = layout; - layout.boundConstructor_ = Class; - layout.makeDestinationObject = () => new Class(); - Object.defineProperty(Class.prototype, "encode", { - value(b2, offset2) { - return layout.encode(this, b2, offset2); - }, - writable: true - }); - Object.defineProperty(Class, "decode", { - value(b2, offset2) { - return layout.decode(b2, offset2); - }, - writable: true - }); -} -Layout$1.bindConstructorLayout = bindConstructorLayout; -class ExternalLayout extends Layout { - /** - * Return `true` iff the external layout decodes to an unsigned - * integer layout. - * - * In that case it can be used as the source of {@link - * Sequence#count|Sequence counts}, {@link Blob#length|Blob lengths}, - * or as {@link UnionLayoutDiscriminator#layout|external union - * discriminators}. - * - * @abstract - */ - isCount() { - throw new Error("ExternalLayout is abstract"); - } -} -Layout$1.ExternalLayout = ExternalLayout; -class GreedyCount extends ExternalLayout { - constructor(elementSpan = 1, property) { - if (!Number.isInteger(elementSpan) || 0 >= elementSpan) { - throw new TypeError("elementSpan must be a (positive) integer"); - } - super(-1, property); - this.elementSpan = elementSpan; - } - /** @override */ - isCount() { - return true; - } - /** @override */ - decode(b2, offset2 = 0) { - checkUint8Array(b2); - const rem = b2.length - offset2; - return Math.floor(rem / this.elementSpan); - } - /** @override */ - encode(src2, b2, offset2) { - return 0; - } -} -Layout$1.GreedyCount = GreedyCount; -class OffsetLayout extends ExternalLayout { - constructor(layout, offset2 = 0, property) { - if (!(layout instanceof Layout)) { - throw new TypeError("layout must be a Layout"); - } - if (!Number.isInteger(offset2)) { - throw new TypeError("offset must be integer or undefined"); - } - super(layout.span, property || layout.property); - this.layout = layout; - this.offset = offset2; - } - /** @override */ - isCount() { - return this.layout instanceof UInt || this.layout instanceof UIntBE; - } - /** @override */ - decode(b2, offset2 = 0) { - return this.layout.decode(b2, offset2 + this.offset); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - return this.layout.encode(src2, b2, offset2 + this.offset); - } -} -Layout$1.OffsetLayout = OffsetLayout; -class UInt extends Layout { - constructor(span, property) { - super(span, property); - if (6 < this.span) { - throw new RangeError("span must not exceed 6 bytes"); - } - } - /** @override */ - decode(b2, offset2 = 0) { - return uint8ArrayToBuffer(b2).readUIntLE(offset2, this.span); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - uint8ArrayToBuffer(b2).writeUIntLE(src2, offset2, this.span); - return this.span; - } -} -Layout$1.UInt = UInt; -class UIntBE extends Layout { - constructor(span, property) { - super(span, property); - if (6 < this.span) { - throw new RangeError("span must not exceed 6 bytes"); - } - } - /** @override */ - decode(b2, offset2 = 0) { - return uint8ArrayToBuffer(b2).readUIntBE(offset2, this.span); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - uint8ArrayToBuffer(b2).writeUIntBE(src2, offset2, this.span); - return this.span; - } -} -Layout$1.UIntBE = UIntBE; -class Int extends Layout { - constructor(span, property) { - super(span, property); - if (6 < this.span) { - throw new RangeError("span must not exceed 6 bytes"); - } - } - /** @override */ - decode(b2, offset2 = 0) { - return uint8ArrayToBuffer(b2).readIntLE(offset2, this.span); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - uint8ArrayToBuffer(b2).writeIntLE(src2, offset2, this.span); - return this.span; - } -} -Layout$1.Int = Int; -class IntBE extends Layout { - constructor(span, property) { - super(span, property); - if (6 < this.span) { - throw new RangeError("span must not exceed 6 bytes"); - } - } - /** @override */ - decode(b2, offset2 = 0) { - return uint8ArrayToBuffer(b2).readIntBE(offset2, this.span); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - uint8ArrayToBuffer(b2).writeIntBE(src2, offset2, this.span); - return this.span; - } -} -Layout$1.IntBE = IntBE; -const V2E32 = Math.pow(2, 32); -function divmodInt64(src2) { - const hi32 = Math.floor(src2 / V2E32); - const lo32 = src2 - hi32 * V2E32; - return { hi32, lo32 }; -} -function roundedInt64(hi32, lo32) { - return hi32 * V2E32 + lo32; -} -class NearUInt64 extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b2, offset2 = 0) { - const buffer2 = uint8ArrayToBuffer(b2); - const lo32 = buffer2.readUInt32LE(offset2); - const hi32 = buffer2.readUInt32LE(offset2 + 4); - return roundedInt64(hi32, lo32); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - const split2 = divmodInt64(src2); - const buffer2 = uint8ArrayToBuffer(b2); - buffer2.writeUInt32LE(split2.lo32, offset2); - buffer2.writeUInt32LE(split2.hi32, offset2 + 4); - return 8; - } -} -Layout$1.NearUInt64 = NearUInt64; -class NearUInt64BE extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b2, offset2 = 0) { - const buffer2 = uint8ArrayToBuffer(b2); - const hi32 = buffer2.readUInt32BE(offset2); - const lo32 = buffer2.readUInt32BE(offset2 + 4); - return roundedInt64(hi32, lo32); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - const split2 = divmodInt64(src2); - const buffer2 = uint8ArrayToBuffer(b2); - buffer2.writeUInt32BE(split2.hi32, offset2); - buffer2.writeUInt32BE(split2.lo32, offset2 + 4); - return 8; - } -} -Layout$1.NearUInt64BE = NearUInt64BE; -class NearInt64 extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b2, offset2 = 0) { - const buffer2 = uint8ArrayToBuffer(b2); - const lo32 = buffer2.readUInt32LE(offset2); - const hi32 = buffer2.readInt32LE(offset2 + 4); - return roundedInt64(hi32, lo32); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - const split2 = divmodInt64(src2); - const buffer2 = uint8ArrayToBuffer(b2); - buffer2.writeUInt32LE(split2.lo32, offset2); - buffer2.writeInt32LE(split2.hi32, offset2 + 4); - return 8; - } -} -Layout$1.NearInt64 = NearInt64; -class NearInt64BE extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b2, offset2 = 0) { - const buffer2 = uint8ArrayToBuffer(b2); - const hi32 = buffer2.readInt32BE(offset2); - const lo32 = buffer2.readUInt32BE(offset2 + 4); - return roundedInt64(hi32, lo32); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - const split2 = divmodInt64(src2); - const buffer2 = uint8ArrayToBuffer(b2); - buffer2.writeInt32BE(split2.hi32, offset2); - buffer2.writeUInt32BE(split2.lo32, offset2 + 4); - return 8; - } -} -Layout$1.NearInt64BE = NearInt64BE; -class Float extends Layout { - constructor(property) { - super(4, property); - } - /** @override */ - decode(b2, offset2 = 0) { - return uint8ArrayToBuffer(b2).readFloatLE(offset2); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - uint8ArrayToBuffer(b2).writeFloatLE(src2, offset2); - return 4; - } -} -Layout$1.Float = Float; -class FloatBE extends Layout { - constructor(property) { - super(4, property); - } - /** @override */ - decode(b2, offset2 = 0) { - return uint8ArrayToBuffer(b2).readFloatBE(offset2); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - uint8ArrayToBuffer(b2).writeFloatBE(src2, offset2); - return 4; - } -} -Layout$1.FloatBE = FloatBE; -class Double extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b2, offset2 = 0) { - return uint8ArrayToBuffer(b2).readDoubleLE(offset2); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - uint8ArrayToBuffer(b2).writeDoubleLE(src2, offset2); - return 8; - } -} -Layout$1.Double = Double; -class DoubleBE extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b2, offset2 = 0) { - return uint8ArrayToBuffer(b2).readDoubleBE(offset2); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - uint8ArrayToBuffer(b2).writeDoubleBE(src2, offset2); - return 8; - } -} -Layout$1.DoubleBE = DoubleBE; -class Sequence extends Layout { - constructor(elementLayout, count, property) { - if (!(elementLayout instanceof Layout)) { - throw new TypeError("elementLayout must be a Layout"); - } - if (!(count instanceof ExternalLayout && count.isCount() || Number.isInteger(count) && 0 <= count)) { - throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout"); - } - let span = -1; - if (!(count instanceof ExternalLayout) && 0 < elementLayout.span) { - span = count * elementLayout.span; - } - super(span, property); - this.elementLayout = elementLayout; - this.count = count; - } - /** @override */ - getSpan(b2, offset2 = 0) { - if (0 <= this.span) { - return this.span; - } - let span = 0; - let count = this.count; - if (count instanceof ExternalLayout) { - count = count.decode(b2, offset2); - } - if (0 < this.elementLayout.span) { - span = count * this.elementLayout.span; - } else { - let idx = 0; - while (idx < count) { - span += this.elementLayout.getSpan(b2, offset2 + span); - ++idx; - } - } - return span; - } - /** @override */ - decode(b2, offset2 = 0) { - const rv2 = []; - let i3 = 0; - let count = this.count; - if (count instanceof ExternalLayout) { - count = count.decode(b2, offset2); - } - while (i3 < count) { - rv2.push(this.elementLayout.decode(b2, offset2)); - offset2 += this.elementLayout.getSpan(b2, offset2); - i3 += 1; - } - return rv2; - } - /** Implement {@link Layout#encode|encode} for {@link Sequence}. - * - * **NOTE** If `src` is shorter than {@link Sequence#count|count} then - * the unused space in the buffer is left unchanged. If `src` is - * longer than {@link Sequence#count|count} the unneeded elements are - * ignored. - * - * **NOTE** If {@link Layout#count|count} is an instance of {@link - * ExternalLayout} then the length of `src` will be encoded as the - * count after `src` is encoded. */ - encode(src2, b2, offset2 = 0) { - const elo = this.elementLayout; - const span = src2.reduce((span2, v6) => { - return span2 + elo.encode(v6, b2, offset2 + span2); - }, 0); - if (this.count instanceof ExternalLayout) { - this.count.encode(src2.length, b2, offset2); - } - return span; - } -} -Layout$1.Sequence = Sequence; -class Structure extends Layout { - constructor(fields, property, decodePrefixes) { - if (!(Array.isArray(fields) && fields.reduce((acc, v6) => acc && v6 instanceof Layout, true))) { - throw new TypeError("fields must be array of Layout instances"); - } - if ("boolean" === typeof property && void 0 === decodePrefixes) { - decodePrefixes = property; - property = void 0; - } - for (const fd2 of fields) { - if (0 > fd2.span && void 0 === fd2.property) { - throw new Error("fields cannot contain unnamed variable-length layout"); - } - } - let span = -1; - try { - span = fields.reduce((span2, fd2) => span2 + fd2.getSpan(), 0); - } catch (e18) { - } - super(span, property); - this.fields = fields; - this.decodePrefixes = !!decodePrefixes; - } - /** @override */ - getSpan(b2, offset2 = 0) { - if (0 <= this.span) { - return this.span; - } - let span = 0; - try { - span = this.fields.reduce((span2, fd2) => { - const fsp = fd2.getSpan(b2, offset2); - offset2 += fsp; - return span2 + fsp; - }, 0); - } catch (e18) { - throw new RangeError("indeterminate span"); - } - return span; - } - /** @override */ - decode(b2, offset2 = 0) { - checkUint8Array(b2); - const dest = this.makeDestinationObject(); - for (const fd2 of this.fields) { - if (void 0 !== fd2.property) { - dest[fd2.property] = fd2.decode(b2, offset2); - } - offset2 += fd2.getSpan(b2, offset2); - if (this.decodePrefixes && b2.length === offset2) { - break; - } - } - return dest; - } - /** Implement {@link Layout#encode|encode} for {@link Structure}. - * - * If `src` is missing a property for a member with a defined {@link - * Layout#property|property} the corresponding region of the buffer is - * left unmodified. */ - encode(src2, b2, offset2 = 0) { - const firstOffset = offset2; - let lastOffset = 0; - let lastWrote = 0; - for (const fd2 of this.fields) { - let span = fd2.span; - lastWrote = 0 < span ? span : 0; - if (void 0 !== fd2.property) { - const fv2 = src2[fd2.property]; - if (void 0 !== fv2) { - lastWrote = fd2.encode(fv2, b2, offset2); - if (0 > span) { - span = fd2.getSpan(b2, offset2); - } - } - } - lastOffset = offset2; - offset2 += span; - } - return lastOffset + lastWrote - firstOffset; - } - /** @override */ - fromArray(values) { - const dest = this.makeDestinationObject(); - for (const fd2 of this.fields) { - if (void 0 !== fd2.property && 0 < values.length) { - dest[fd2.property] = values.shift(); - } - } - return dest; - } - /** - * Get access to the layout of a given property. - * - * @param {String} property - the structure member of interest. - * - * @return {Layout} - the layout associated with `property`, or - * undefined if there is no such property. - */ - layoutFor(property) { - if ("string" !== typeof property) { - throw new TypeError("property must be string"); - } - for (const fd2 of this.fields) { - if (fd2.property === property) { - return fd2; - } - } - return void 0; - } - /** - * Get the offset of a structure member. - * - * @param {String} property - the structure member of interest. - * - * @return {Number} - the offset in bytes to the start of `property` - * within the structure, or undefined if `property` is not a field - * within the structure. If the property is a member but follows a - * variable-length structure member a negative number will be - * returned. - */ - offsetOf(property) { - if ("string" !== typeof property) { - throw new TypeError("property must be string"); - } - let offset2 = 0; - for (const fd2 of this.fields) { - if (fd2.property === property) { - return offset2; - } - if (0 > fd2.span) { - offset2 = -1; - } else if (0 <= offset2) { - offset2 += fd2.span; - } - } - return void 0; - } -} -Layout$1.Structure = Structure; -class UnionDiscriminator { - constructor(property) { - this.property = property; - } - /** Analog to {@link Layout#decode|Layout decode} for union discriminators. - * - * The implementation of this method need not reference the buffer if - * variant information is available through other means. */ - decode(b2, offset2) { - throw new Error("UnionDiscriminator is abstract"); - } - /** Analog to {@link Layout#decode|Layout encode} for union discriminators. - * - * The implementation of this method need not store the value if - * variant information is maintained through other means. */ - encode(src2, b2, offset2) { - throw new Error("UnionDiscriminator is abstract"); - } -} -Layout$1.UnionDiscriminator = UnionDiscriminator; -class UnionLayoutDiscriminator extends UnionDiscriminator { - constructor(layout, property) { - if (!(layout instanceof ExternalLayout && layout.isCount())) { - throw new TypeError("layout must be an unsigned integer ExternalLayout"); - } - super(property || layout.property || "variant"); - this.layout = layout; - } - /** Delegate decoding to {@link UnionLayoutDiscriminator#layout|layout}. */ - decode(b2, offset2) { - return this.layout.decode(b2, offset2); - } - /** Delegate encoding to {@link UnionLayoutDiscriminator#layout|layout}. */ - encode(src2, b2, offset2) { - return this.layout.encode(src2, b2, offset2); - } -} -Layout$1.UnionLayoutDiscriminator = UnionLayoutDiscriminator; -class Union extends Layout { - constructor(discr, defaultLayout, property) { - let discriminator; - if (discr instanceof UInt || discr instanceof UIntBE) { - discriminator = new UnionLayoutDiscriminator(new OffsetLayout(discr)); - } else if (discr instanceof ExternalLayout && discr.isCount()) { - discriminator = new UnionLayoutDiscriminator(discr); - } else if (!(discr instanceof UnionDiscriminator)) { - throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout"); - } else { - discriminator = discr; - } - if (void 0 === defaultLayout) { - defaultLayout = null; - } - if (!(null === defaultLayout || defaultLayout instanceof Layout)) { - throw new TypeError("defaultLayout must be null or a Layout"); - } - if (null !== defaultLayout) { - if (0 > defaultLayout.span) { - throw new Error("defaultLayout must have constant span"); - } - if (void 0 === defaultLayout.property) { - defaultLayout = defaultLayout.replicate("content"); - } - } - let span = -1; - if (defaultLayout) { - span = defaultLayout.span; - if (0 <= span && (discr instanceof UInt || discr instanceof UIntBE)) { - span += discriminator.layout.span; - } - } - super(span, property); - this.discriminator = discriminator; - this.usesPrefixDiscriminator = discr instanceof UInt || discr instanceof UIntBE; - this.defaultLayout = defaultLayout; - this.registry = {}; - let boundGetSourceVariant = this.defaultGetSourceVariant.bind(this); - this.getSourceVariant = function(src2) { - return boundGetSourceVariant(src2); - }; - this.configGetSourceVariant = function(gsv) { - boundGetSourceVariant = gsv.bind(this); - }; - } - /** @override */ - getSpan(b2, offset2 = 0) { - if (0 <= this.span) { - return this.span; - } - const vlo = this.getVariant(b2, offset2); - if (!vlo) { - throw new Error("unable to determine span for unrecognized variant"); - } - return vlo.getSpan(b2, offset2); - } - /** - * Method to infer a registered Union variant compatible with `src`. - * - * The first satisfied rule in the following sequence defines the - * return value: - * * If `src` has properties matching the Union discriminator and - * the default layout, `undefined` is returned regardless of the - * value of the discriminator property (this ensures the default - * layout will be used); - * * If `src` has a property matching the Union discriminator, the - * value of the discriminator identifies a registered variant, and - * either (a) the variant has no layout, or (b) `src` has the - * variant's property, then the variant is returned (because the - * source satisfies the constraints of the variant it identifies); - * * If `src` does not have a property matching the Union - * discriminator, but does have a property matching a registered - * variant, then the variant is returned (because the source - * matches a variant without an explicit conflict); - * * An error is thrown (because we either can't identify a variant, - * or we were explicitly told the variant but can't satisfy it). - * - * @param {Object} src - an object presumed to be compatible with - * the content of the Union. - * - * @return {(undefined|VariantLayout)} - as described above. - * - * @throws {Error} - if `src` cannot be associated with a default or - * registered variant. - */ - defaultGetSourceVariant(src2) { - if (Object.prototype.hasOwnProperty.call(src2, this.discriminator.property)) { - if (this.defaultLayout && this.defaultLayout.property && Object.prototype.hasOwnProperty.call(src2, this.defaultLayout.property)) { - return void 0; - } - const vlo = this.registry[src2[this.discriminator.property]]; - if (vlo && (!vlo.layout || vlo.property && Object.prototype.hasOwnProperty.call(src2, vlo.property))) { - return vlo; - } - } else { - for (const tag in this.registry) { - const vlo = this.registry[tag]; - if (vlo.property && Object.prototype.hasOwnProperty.call(src2, vlo.property)) { - return vlo; - } - } - } - throw new Error("unable to infer src variant"); - } - /** Implement {@link Layout#decode|decode} for {@link Union}. - * - * If the variant is {@link Union#addVariant|registered} the return - * value is an instance of that variant, with no explicit - * discriminator. Otherwise the {@link Union#defaultLayout|default - * layout} is used to decode the content. */ - decode(b2, offset2 = 0) { - let dest; - const dlo = this.discriminator; - const discr = dlo.decode(b2, offset2); - const clo = this.registry[discr]; - if (void 0 === clo) { - const defaultLayout = this.defaultLayout; - let contentOffset = 0; - if (this.usesPrefixDiscriminator) { - contentOffset = dlo.layout.span; - } - dest = this.makeDestinationObject(); - dest[dlo.property] = discr; - dest[defaultLayout.property] = defaultLayout.decode(b2, offset2 + contentOffset); - } else { - dest = clo.decode(b2, offset2); - } - return dest; - } - /** Implement {@link Layout#encode|encode} for {@link Union}. - * - * This API assumes the `src` object is consistent with the union's - * {@link Union#defaultLayout|default layout}. To encode variants - * use the appropriate variant-specific {@link VariantLayout#encode} - * method. */ - encode(src2, b2, offset2 = 0) { - const vlo = this.getSourceVariant(src2); - if (void 0 === vlo) { - const dlo = this.discriminator; - const clo = this.defaultLayout; - let contentOffset = 0; - if (this.usesPrefixDiscriminator) { - contentOffset = dlo.layout.span; - } - dlo.encode(src2[dlo.property], b2, offset2); - return contentOffset + clo.encode(src2[clo.property], b2, offset2 + contentOffset); - } - return vlo.encode(src2, b2, offset2); - } - /** Register a new variant structure within a union. The newly - * created variant is returned. - * - * @param {Number} variant - initializer for {@link - * VariantLayout#variant|variant}. - * - * @param {Layout} layout - initializer for {@link - * VariantLayout#layout|layout}. - * - * @param {String} property - initializer for {@link - * Layout#property|property}. - * - * @return {VariantLayout} */ - addVariant(variant, layout, property) { - const rv2 = new VariantLayout(this, variant, layout, property); - this.registry[variant] = rv2; - return rv2; - } - /** - * Get the layout associated with a registered variant. - * - * If `vb` does not produce a registered variant the function returns - * `undefined`. - * - * @param {(Number|Uint8Array)} vb - either the variant number, or a - * buffer from which the discriminator is to be read. - * - * @param {Number} offset - offset into `vb` for the start of the - * union. Used only when `vb` is an instance of {Uint8Array}. - * - * @return {({VariantLayout}|undefined)} - */ - getVariant(vb2, offset2 = 0) { - let variant; - if (vb2 instanceof Uint8Array) { - variant = this.discriminator.decode(vb2, offset2); - } else { - variant = vb2; - } - return this.registry[variant]; - } -} -Layout$1.Union = Union; -class VariantLayout extends Layout { - constructor(union2, variant, layout, property) { - if (!(union2 instanceof Union)) { - throw new TypeError("union must be a Union"); - } - if (!Number.isInteger(variant) || 0 > variant) { - throw new TypeError("variant must be a (non-negative) integer"); - } - if ("string" === typeof layout && void 0 === property) { - property = layout; - layout = null; - } - if (layout) { - if (!(layout instanceof Layout)) { - throw new TypeError("layout must be a Layout"); - } - if (null !== union2.defaultLayout && 0 <= layout.span && layout.span > union2.defaultLayout.span) { - throw new Error("variant span exceeds span of containing union"); - } - if ("string" !== typeof property) { - throw new TypeError("variant must have a String property"); - } - } - let span = union2.span; - if (0 > union2.span) { - span = layout ? layout.span : 0; - if (0 <= span && union2.usesPrefixDiscriminator) { - span += union2.discriminator.layout.span; - } - } - super(span, property); - this.union = union2; - this.variant = variant; - this.layout = layout || null; - } - /** @override */ - getSpan(b2, offset2 = 0) { - if (0 <= this.span) { - return this.span; - } - let contentOffset = 0; - if (this.union.usesPrefixDiscriminator) { - contentOffset = this.union.discriminator.layout.span; - } - let span = 0; - if (this.layout) { - span = this.layout.getSpan(b2, offset2 + contentOffset); - } - return contentOffset + span; - } - /** @override */ - decode(b2, offset2 = 0) { - const dest = this.makeDestinationObject(); - if (this !== this.union.getVariant(b2, offset2)) { - throw new Error("variant mismatch"); - } - let contentOffset = 0; - if (this.union.usesPrefixDiscriminator) { - contentOffset = this.union.discriminator.layout.span; - } - if (this.layout) { - dest[this.property] = this.layout.decode(b2, offset2 + contentOffset); - } else if (this.property) { - dest[this.property] = true; - } else if (this.union.usesPrefixDiscriminator) { - dest[this.union.discriminator.property] = this.variant; - } - return dest; - } - /** @override */ - encode(src2, b2, offset2 = 0) { - let contentOffset = 0; - if (this.union.usesPrefixDiscriminator) { - contentOffset = this.union.discriminator.layout.span; - } - if (this.layout && !Object.prototype.hasOwnProperty.call(src2, this.property)) { - throw new TypeError("variant lacks property " + this.property); - } - this.union.discriminator.encode(this.variant, b2, offset2); - let span = contentOffset; - if (this.layout) { - this.layout.encode(src2[this.property], b2, offset2 + contentOffset); - span += this.layout.getSpan(b2, offset2 + contentOffset); - if (0 <= this.union.span && span > this.union.span) { - throw new Error("encoded variant overruns containing union"); - } - } - return span; - } - /** Delegate {@link Layout#fromArray|fromArray} to {@link - * VariantLayout#layout|layout}. */ - fromArray(values) { - if (this.layout) { - return this.layout.fromArray(values); - } - return void 0; - } -} -Layout$1.VariantLayout = VariantLayout; -function fixBitwiseResult(v6) { - if (0 > v6) { - v6 += 4294967296; - } - return v6; -} -class BitStructure extends Layout { - constructor(word, msb, property) { - if (!(word instanceof UInt || word instanceof UIntBE)) { - throw new TypeError("word must be a UInt or UIntBE layout"); - } - if ("string" === typeof msb && void 0 === property) { - property = msb; - msb = false; - } - if (4 < word.span) { - throw new RangeError("word cannot exceed 32 bits"); - } - super(word.span, property); - this.word = word; - this.msb = !!msb; - this.fields = []; - let value = 0; - this._packedSetValue = function(v6) { - value = fixBitwiseResult(v6); - return this; - }; - this._packedGetValue = function() { - return value; - }; - } - /** @override */ - decode(b2, offset2 = 0) { - const dest = this.makeDestinationObject(); - const value = this.word.decode(b2, offset2); - this._packedSetValue(value); - for (const fd2 of this.fields) { - if (void 0 !== fd2.property) { - dest[fd2.property] = fd2.decode(b2); - } - } - return dest; - } - /** Implement {@link Layout#encode|encode} for {@link BitStructure}. - * - * If `src` is missing a property for a member with a defined {@link - * Layout#property|property} the corresponding region of the packed - * value is left unmodified. Unused bits are also left unmodified. */ - encode(src2, b2, offset2 = 0) { - const value = this.word.decode(b2, offset2); - this._packedSetValue(value); - for (const fd2 of this.fields) { - if (void 0 !== fd2.property) { - const fv2 = src2[fd2.property]; - if (void 0 !== fv2) { - fd2.encode(fv2); - } - } - } - return this.word.encode(this._packedGetValue(), b2, offset2); - } - /** Register a new bitfield with a containing bit structure. The - * resulting bitfield is returned. - * - * @param {Number} bits - initializer for {@link BitField#bits|bits}. - * - * @param {string} property - initializer for {@link - * Layout#property|property}. - * - * @return {BitField} */ - addField(bits, property) { - const bf2 = new BitField(this, bits, property); - this.fields.push(bf2); - return bf2; - } - /** As with {@link BitStructure#addField|addField} for single-bit - * fields with `boolean` value representation. - * - * @param {string} property - initializer for {@link - * Layout#property|property}. - * - * @return {Boolean} */ - // `Boolean` conflicts with the native primitive type - // eslint-disable-next-line @typescript-eslint/ban-types - addBoolean(property) { - const bf2 = new Boolean$1(this, property); - this.fields.push(bf2); - return bf2; - } - /** - * Get access to the bit field for a given property. - * - * @param {String} property - the bit field of interest. - * - * @return {BitField} - the field associated with `property`, or - * undefined if there is no such property. - */ - fieldFor(property) { - if ("string" !== typeof property) { - throw new TypeError("property must be string"); - } - for (const fd2 of this.fields) { - if (fd2.property === property) { - return fd2; - } - } - return void 0; - } -} -Layout$1.BitStructure = BitStructure; -class BitField { - constructor(container, bits, property) { - if (!(container instanceof BitStructure)) { - throw new TypeError("container must be a BitStructure"); - } - if (!Number.isInteger(bits) || 0 >= bits) { - throw new TypeError("bits must be positive integer"); - } - const totalBits = 8 * container.span; - const usedBits = container.fields.reduce((sum, fd2) => sum + fd2.bits, 0); - if (bits + usedBits > totalBits) { - throw new Error("bits too long for span remainder (" + (totalBits - usedBits) + " of " + totalBits + " remain)"); - } - this.container = container; - this.bits = bits; - this.valueMask = (1 << bits) - 1; - if (32 === bits) { - this.valueMask = 4294967295; - } - this.start = usedBits; - if (this.container.msb) { - this.start = totalBits - usedBits - bits; - } - this.wordMask = fixBitwiseResult(this.valueMask << this.start); - this.property = property; - } - /** Store a value into the corresponding subsequence of the containing - * bit field. */ - decode(b2, offset2) { - const word = this.container._packedGetValue(); - const wordValue = fixBitwiseResult(word & this.wordMask); - const value = wordValue >>> this.start; - return value; - } - /** Store a value into the corresponding subsequence of the containing - * bit field. - * - * **NOTE** This is not a specialization of {@link - * Layout#encode|Layout.encode} and there is no return value. */ - encode(value) { - if ("number" !== typeof value || !Number.isInteger(value) || value !== fixBitwiseResult(value & this.valueMask)) { - throw new TypeError(nameWithProperty("BitField.encode", this) + " value must be integer not exceeding " + this.valueMask); - } - const word = this.container._packedGetValue(); - const wordValue = fixBitwiseResult(value << this.start); - this.container._packedSetValue(fixBitwiseResult(word & ~this.wordMask) | wordValue); - } -} -Layout$1.BitField = BitField; -let Boolean$1 = class Boolean2 extends BitField { - constructor(container, property) { - super(container, 1, property); - } - /** Override {@link BitField#decode|decode} for {@link Boolean|Boolean}. - * - * @returns {boolean} */ - decode(b2, offset2) { - return !!super.decode(b2, offset2); - } - /** @override */ - encode(value) { - if ("boolean" === typeof value) { - value = +value; - } - super.encode(value); - } -}; -Layout$1.Boolean = Boolean$1; -let Blob$2 = class Blob2 extends Layout { - constructor(length, property) { - if (!(length instanceof ExternalLayout && length.isCount() || Number.isInteger(length) && 0 <= length)) { - throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout"); - } - let span = -1; - if (!(length instanceof ExternalLayout)) { - span = length; - } - super(span, property); - this.length = length; - } - /** @override */ - getSpan(b2, offset2) { - let span = this.span; - if (0 > span) { - span = this.length.decode(b2, offset2); - } - return span; - } - /** @override */ - decode(b2, offset2 = 0) { - let span = this.span; - if (0 > span) { - span = this.length.decode(b2, offset2); - } - return uint8ArrayToBuffer(b2).slice(offset2, offset2 + span); - } - /** Implement {@link Layout#encode|encode} for {@link Blob}. - * - * **NOTE** If {@link Layout#count|count} is an instance of {@link - * ExternalLayout} then the length of `src` will be encoded as the - * count after `src` is encoded. */ - encode(src2, b2, offset2) { - let span = this.length; - if (this.length instanceof ExternalLayout) { - span = src2.length; - } - if (!(src2 instanceof Uint8Array && span === src2.length)) { - throw new TypeError(nameWithProperty("Blob.encode", this) + " requires (length " + span + ") Uint8Array as src"); - } - if (offset2 + span > b2.length) { - throw new RangeError("encoding overruns Uint8Array"); - } - const srcBuffer = uint8ArrayToBuffer(src2); - uint8ArrayToBuffer(b2).write(srcBuffer.toString("hex"), offset2, span, "hex"); - if (this.length instanceof ExternalLayout) { - this.length.encode(span, b2, offset2); - } - return span; - } -}; -Layout$1.Blob = Blob$2; -class CString extends Layout { - constructor(property) { - super(-1, property); - } - /** @override */ - getSpan(b2, offset2 = 0) { - checkUint8Array(b2); - let idx = offset2; - while (idx < b2.length && 0 !== b2[idx]) { - idx += 1; - } - return 1 + idx - offset2; - } - /** @override */ - decode(b2, offset2 = 0) { - const span = this.getSpan(b2, offset2); - return uint8ArrayToBuffer(b2).slice(offset2, offset2 + span - 1).toString("utf-8"); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - if ("string" !== typeof src2) { - src2 = String(src2); - } - const srcb = buffer_1.Buffer.from(src2, "utf8"); - const span = srcb.length; - if (offset2 + span > b2.length) { - throw new RangeError("encoding overruns Buffer"); - } - const buffer2 = uint8ArrayToBuffer(b2); - srcb.copy(buffer2, offset2); - buffer2[offset2 + span] = 0; - return span + 1; - } -} -Layout$1.CString = CString; -class UTF8 extends Layout { - constructor(maxSpan, property) { - if ("string" === typeof maxSpan && void 0 === property) { - property = maxSpan; - maxSpan = void 0; - } - if (void 0 === maxSpan) { - maxSpan = -1; - } else if (!Number.isInteger(maxSpan)) { - throw new TypeError("maxSpan must be an integer"); - } - super(-1, property); - this.maxSpan = maxSpan; - } - /** @override */ - getSpan(b2, offset2 = 0) { - checkUint8Array(b2); - return b2.length - offset2; - } - /** @override */ - decode(b2, offset2 = 0) { - const span = this.getSpan(b2, offset2); - if (0 <= this.maxSpan && this.maxSpan < span) { - throw new RangeError("text length exceeds maxSpan"); - } - return uint8ArrayToBuffer(b2).slice(offset2, offset2 + span).toString("utf-8"); - } - /** @override */ - encode(src2, b2, offset2 = 0) { - if ("string" !== typeof src2) { - src2 = String(src2); - } - const srcb = buffer_1.Buffer.from(src2, "utf8"); - const span = srcb.length; - if (0 <= this.maxSpan && this.maxSpan < span) { - throw new RangeError("text length exceeds maxSpan"); - } - if (offset2 + span > b2.length) { - throw new RangeError("encoding overruns Buffer"); - } - srcb.copy(uint8ArrayToBuffer(b2), offset2); - return span; - } -} -Layout$1.UTF8 = UTF8; -class Constant extends Layout { - constructor(value, property) { - super(0, property); - this.value = value; - } - /** @override */ - decode(b2, offset2) { - return this.value; - } - /** @override */ - encode(src2, b2, offset2) { - return 0; - } -} -Layout$1.Constant = Constant; -Layout$1.greedy = (elementSpan, property) => new GreedyCount(elementSpan, property); -var offset = Layout$1.offset = (layout, offset2, property) => new OffsetLayout(layout, offset2, property); -var u8 = Layout$1.u8 = (property) => new UInt(1, property); -var u16 = Layout$1.u16 = (property) => new UInt(2, property); -Layout$1.u24 = (property) => new UInt(3, property); -var u32$1 = Layout$1.u32 = (property) => new UInt(4, property); -Layout$1.u40 = (property) => new UInt(5, property); -Layout$1.u48 = (property) => new UInt(6, property); -var nu64 = Layout$1.nu64 = (property) => new NearUInt64(property); -Layout$1.u16be = (property) => new UIntBE(2, property); -Layout$1.u24be = (property) => new UIntBE(3, property); -Layout$1.u32be = (property) => new UIntBE(4, property); -Layout$1.u40be = (property) => new UIntBE(5, property); -Layout$1.u48be = (property) => new UIntBE(6, property); -Layout$1.nu64be = (property) => new NearUInt64BE(property); -Layout$1.s8 = (property) => new Int(1, property); -Layout$1.s16 = (property) => new Int(2, property); -Layout$1.s24 = (property) => new Int(3, property); -Layout$1.s32 = (property) => new Int(4, property); -Layout$1.s40 = (property) => new Int(5, property); -Layout$1.s48 = (property) => new Int(6, property); -var ns64 = Layout$1.ns64 = (property) => new NearInt64(property); -Layout$1.s16be = (property) => new IntBE(2, property); -Layout$1.s24be = (property) => new IntBE(3, property); -Layout$1.s32be = (property) => new IntBE(4, property); -Layout$1.s40be = (property) => new IntBE(5, property); -Layout$1.s48be = (property) => new IntBE(6, property); -Layout$1.ns64be = (property) => new NearInt64BE(property); -Layout$1.f32 = (property) => new Float(property); -Layout$1.f32be = (property) => new FloatBE(property); -Layout$1.f64 = (property) => new Double(property); -Layout$1.f64be = (property) => new DoubleBE(property); -var struct = Layout$1.struct = (fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes); -Layout$1.bits = (word, msb, property) => new BitStructure(word, msb, property); -var seq = Layout$1.seq = (elementLayout, count, property) => new Sequence(elementLayout, count, property); -Layout$1.union = (discr, defaultLayout, property) => new Union(discr, defaultLayout, property); -Layout$1.unionLayoutDiscriminator = (layout, property) => new UnionLayoutDiscriminator(layout, property); -var blob = Layout$1.blob = (length, property) => new Blob$2(length, property); -Layout$1.cstr = (property) => new CString(property); -Layout$1.utf8 = (maxSpan, property) => new UTF8(maxSpan, property); -Layout$1.constant = (value, property) => new Constant(value, property); -var browser$4 = {}; -Object.defineProperty(browser$4, "__esModule", { value: true }); -function toBigIntLE(buf) { - { - const reversed = Buffer.from(buf); - reversed.reverse(); - const hex = reversed.toString("hex"); - if (hex.length === 0) { - return BigInt(0); - } - return BigInt(`0x${hex}`); - } -} -var toBigIntLE_1 = browser$4.toBigIntLE = toBigIntLE; -function toBigIntBE(buf) { - { - const hex = buf.toString("hex"); - if (hex.length === 0) { - return BigInt(0); - } - return BigInt(`0x${hex}`); - } -} -browser$4.toBigIntBE = toBigIntBE; -function toBufferLE(num, width) { - { - const hex = num.toString(16); - const buffer2 = Buffer.from(hex.padStart(width * 2, "0").slice(0, width * 2), "hex"); - buffer2.reverse(); - return buffer2; - } -} -var toBufferLE_1 = browser$4.toBufferLE = toBufferLE; -function toBufferBE(num, width) { - { - const hex = num.toString(16); - return Buffer.from(hex.padStart(width * 2, "0").slice(0, width * 2), "hex"); - } -} -browser$4.toBufferBE = toBufferBE; -class StructError extends TypeError { - constructor(failure, failures) { - let cached; - const { message: message2, explanation, ...rest } = failure; - const { path } = failure; - const msg = path.length === 0 ? message2 : `At path: ${path.join(".")} -- ${message2}`; - super(explanation ?? msg); - if (explanation != null) - this.cause = msg; - Object.assign(this, rest); - this.name = this.constructor.name; - this.failures = () => { - return cached ?? (cached = [failure, ...failures()]); - }; - } -} -function isIterable(x3) { - return isObject$3(x3) && typeof x3[Symbol.iterator] === "function"; -} -function isObject$3(x3) { - return typeof x3 === "object" && x3 != null; -} -function isNonArrayObject(x3) { - return isObject$3(x3) && !Array.isArray(x3); -} -function print(value) { - if (typeof value === "symbol") { - return value.toString(); - } - return typeof value === "string" ? JSON.stringify(value) : `${value}`; -} -function shiftIterator(input) { - const { done, value } = input.next(); - return done ? void 0 : value; -} -function toFailure(result, context, struct2, value) { - if (result === true) { - return; - } else if (result === false) { - result = {}; - } else if (typeof result === "string") { - result = { message: result }; - } - const { path, branch } = context; - const { type: type2 } = struct2; - const { refinement, message: message2 = `Expected a value of type \`${type2}\`${refinement ? ` with refinement \`${refinement}\`` : ""}, but received: \`${print(value)}\`` } = result; - return { - value, - type: type2, - refinement, - key: path[path.length - 1], - path, - branch, - ...result, - message: message2 - }; -} -function* toFailures(result, context, struct2, value) { - if (!isIterable(result)) { - result = [result]; - } - for (const r2 of result) { - const failure = toFailure(r2, context, struct2, value); - if (failure) { - yield failure; - } - } -} -function* run(value, struct2, options = {}) { - const { path = [], branch = [value], coerce: coerce2 = false, mask: mask2 = false } = options; - const ctx = { path, branch, mask: mask2 }; - if (coerce2) { - value = struct2.coercer(value, ctx); - } - let status = "valid"; - for (const failure of struct2.validator(value, ctx)) { - failure.explanation = options.message; - status = "not_valid"; - yield [failure, void 0]; - } - for (let [k2, v6, s2] of struct2.entries(value, ctx)) { - const ts2 = run(v6, s2, { - path: k2 === void 0 ? path : [...path, k2], - branch: k2 === void 0 ? branch : [...branch, v6], - coerce: coerce2, - mask: mask2, - message: options.message - }); - for (const t2 of ts2) { - if (t2[0]) { - status = t2[0].refinement != null ? "not_refined" : "not_valid"; - yield [t2[0], void 0]; - } else if (coerce2) { - v6 = t2[1]; - if (k2 === void 0) { - value = v6; - } else if (value instanceof Map) { - value.set(k2, v6); - } else if (value instanceof Set) { - value.add(v6); - } else if (isObject$3(value)) { - if (v6 !== void 0 || k2 in value) - value[k2] = v6; - } - } - } - } - if (status !== "not_valid") { - for (const failure of struct2.refiner(value, ctx)) { - failure.explanation = options.message; - status = "not_refined"; - yield [failure, void 0]; - } - } - if (status === "valid") { - yield [void 0, value]; - } -} -let Struct$1 = class Struct { - constructor(props) { - const { type: type2, schema, validator: validator2, refiner, coercer = (value) => value, entries = function* () { - } } = props; - this.type = type2; - this.schema = schema; - this.entries = entries; - this.coercer = coercer; - if (validator2) { - this.validator = (value, context) => { - const result = validator2(value, context); - return toFailures(result, context, this, value); - }; - } else { - this.validator = () => []; - } - if (refiner) { - this.refiner = (value, context) => { - const result = refiner(value, context); - return toFailures(result, context, this, value); - }; - } else { - this.refiner = () => []; - } - } - /** - * Assert that a value passes the struct's validation, throwing if it doesn't. - */ - assert(value, message2) { - return assert$c(value, this, message2); - } - /** - * Create a value with the struct's coercion logic, then validate it. - */ - create(value, message2) { - return create(value, this, message2); - } - /** - * Check if a value passes the struct's validation. - */ - is(value) { - return is(value, this); - } - /** - * Mask a value, coercing and validating it, but returning only the subset of - * properties defined by the struct's schema. Masking applies recursively to - * props of `object` structs only. - */ - mask(value, message2) { - return mask$1(value, this, message2); - } - /** - * Validate a value with the struct's validation logic, returning a tuple - * representing the result. - * - * You may optionally pass `true` for the `coerce` argument to coerce - * the value before attempting to validate it. If you do, the result will - * contain the coerced result when successful. Also, `mask` will turn on - * masking of the unknown `object` props recursively if passed. - */ - validate(value, options = {}) { - return validate$1(value, this, options); - } -}; -function assert$c(value, struct2, message2) { - const result = validate$1(value, struct2, { message: message2 }); - if (result[0]) { - throw result[0]; - } -} -function create(value, struct2, message2) { - const result = validate$1(value, struct2, { coerce: true, message: message2 }); - if (result[0]) { - throw result[0]; - } else { - return result[1]; - } -} -function mask$1(value, struct2, message2) { - const result = validate$1(value, struct2, { coerce: true, mask: true, message: message2 }); - if (result[0]) { - throw result[0]; - } else { - return result[1]; - } -} -function is(value, struct2) { - const result = validate$1(value, struct2); - return !result[0]; -} -function validate$1(value, struct2, options = {}) { - const tuples = run(value, struct2, options); - const tuple2 = shiftIterator(tuples); - if (tuple2[0]) { - const error = new StructError(tuple2[0], function* () { - for (const t2 of tuples) { - if (t2[0]) { - yield t2[0]; - } - } - }); - return [error, void 0]; - } else { - const v6 = tuple2[1]; - return [void 0, v6]; - } -} -function define(name2, validator2) { - return new Struct$1({ type: name2, schema: null, validator: validator2 }); -} -function any() { - return define("any", () => true); -} -function array(Element) { - return new Struct$1({ - type: "array", - schema: Element, - *entries(value) { - if (Element && Array.isArray(value)) { - for (const [i3, v6] of value.entries()) { - yield [i3, v6, Element]; - } - } - }, - coercer(value) { - return Array.isArray(value) ? value.slice() : value; - }, - validator(value) { - return Array.isArray(value) || `Expected an array value, but received: ${print(value)}`; - } - }); -} -function boolean() { - return define("boolean", (value) => { - return typeof value === "boolean"; - }); -} -function instance(Class) { - return define("instance", (value) => { - return value instanceof Class || `Expected a \`${Class.name}\` instance, but received: ${print(value)}`; - }); -} -function literal(constant) { - const description2 = print(constant); - const t2 = typeof constant; - return new Struct$1({ - type: "literal", - schema: t2 === "string" || t2 === "number" || t2 === "boolean" ? constant : null, - validator(value) { - return value === constant || `Expected the literal \`${description2}\`, but received: ${print(value)}`; - } - }); -} -function never() { - return define("never", () => false); -} -function nullable(struct2) { - return new Struct$1({ - ...struct2, - validator: (value, ctx) => value === null || struct2.validator(value, ctx), - refiner: (value, ctx) => value === null || struct2.refiner(value, ctx) - }); -} -function number$1() { - return define("number", (value) => { - return typeof value === "number" && !isNaN(value) || `Expected a number, but received: ${print(value)}`; - }); -} -function optional(struct2) { - return new Struct$1({ - ...struct2, - validator: (value, ctx) => value === void 0 || struct2.validator(value, ctx), - refiner: (value, ctx) => value === void 0 || struct2.refiner(value, ctx) - }); -} -function record(Key2, Value) { - return new Struct$1({ - type: "record", - schema: null, - *entries(value) { - if (isObject$3(value)) { - for (const k2 in value) { - const v6 = value[k2]; - yield [k2, k2, Key2]; - yield [k2, v6, Value]; - } - } - }, - validator(value) { - return isNonArrayObject(value) || `Expected an object, but received: ${print(value)}`; - }, - coercer(value) { - return isNonArrayObject(value) ? { ...value } : value; - } - }); -} -function string$1() { - return define("string", (value) => { - return typeof value === "string" || `Expected a string, but received: ${print(value)}`; - }); -} -function tuple(Structs) { - const Never = never(); - return new Struct$1({ - type: "tuple", - schema: null, - *entries(value) { - if (Array.isArray(value)) { - const length = Math.max(Structs.length, value.length); - for (let i3 = 0; i3 < length; i3++) { - yield [i3, value[i3], Structs[i3] || Never]; - } - } - }, - validator(value) { - return Array.isArray(value) || `Expected an array, but received: ${print(value)}`; - }, - coercer(value) { - return Array.isArray(value) ? value.slice() : value; - } - }); -} -function type(schema) { - const keys2 = Object.keys(schema); - return new Struct$1({ - type: "type", - schema, - *entries(value) { - if (isObject$3(value)) { - for (const k2 of keys2) { - yield [k2, value[k2], schema[k2]]; - } - } - }, - validator(value) { - return isNonArrayObject(value) || `Expected an object, but received: ${print(value)}`; - }, - coercer(value) { - return isNonArrayObject(value) ? { ...value } : value; - } - }); -} -function union(Structs) { - const description2 = Structs.map((s2) => s2.type).join(" | "); - return new Struct$1({ - type: "union", - schema: null, - coercer(value, ctx) { - for (const S4 of Structs) { - const [error, coerced] = S4.validate(value, { - coerce: true, - mask: ctx.mask - }); - if (!error) { - return coerced; - } - } - return value; - }, - validator(value, ctx) { - const failures = []; - for (const S4 of Structs) { - const [...tuples] = run(value, S4, ctx); - const [first] = tuples; - if (!first[0]) { - return []; - } else { - for (const [failure] of tuples) { - if (failure) { - failures.push(failure); - } - } - } - } - return [ - `Expected the value to satisfy a union of \`${description2}\`, but received: ${print(value)}`, - ...failures - ]; - } - }); -} -function unknown() { - return define("unknown", () => true); -} -function coerce$1(struct2, condition, coercer) { - return new Struct$1({ - ...struct2, - coercer: (value, ctx) => { - return is(value, condition) ? struct2.coercer(coercer(value, ctx), ctx) : struct2.coercer(value, ctx); - } - }); -} -var getRandomValues; -var rnds8 = new Uint8Array(16); -function rng() { - if (!getRandomValues) { - getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto); - if (!getRandomValues) { - throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); - } - } - return getRandomValues(rnds8); -} -const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; -function validate(uuid2) { - return typeof uuid2 === "string" && REGEX.test(uuid2); -} -var byteToHex = []; -for (var i$3 = 0; i$3 < 256; ++i$3) { - byteToHex.push((i$3 + 256).toString(16).substr(1)); -} -function stringify$2(arr) { - var offset2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; - var uuid2 = (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase(); - if (!validate(uuid2)) { - throw TypeError("Stringified UUID is invalid"); - } - return uuid2; -} -var _nodeId; -var _clockseq; -var _lastMSecs = 0; -var _lastNSecs = 0; -function v1(options, buf, offset2) { - var i3 = buf && offset2 || 0; - var b2 = buf || new Array(16); - options = options || {}; - var node2 = options.node || _nodeId; - var clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq; - if (node2 == null || clockseq == null) { - var seedBytes = options.random || (options.rng || rng)(); - if (node2 == null) { - node2 = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - if (clockseq == null) { - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383; - } - } - var msecs = options.msecs !== void 0 ? options.msecs : Date.now(); - var nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1; - var dt2 = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; - if (dt2 < 0 && options.clockseq === void 0) { - clockseq = clockseq + 1 & 16383; - } - if ((dt2 < 0 || msecs > _lastMSecs) && options.nsecs === void 0) { - nsecs = 0; - } - if (nsecs >= 1e4) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - msecs += 122192928e5; - var tl2 = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; - b2[i3++] = tl2 >>> 24 & 255; - b2[i3++] = tl2 >>> 16 & 255; - b2[i3++] = tl2 >>> 8 & 255; - b2[i3++] = tl2 & 255; - var tmh = msecs / 4294967296 * 1e4 & 268435455; - b2[i3++] = tmh >>> 8 & 255; - b2[i3++] = tmh & 255; - b2[i3++] = tmh >>> 24 & 15 | 16; - b2[i3++] = tmh >>> 16 & 255; - b2[i3++] = clockseq >>> 8 | 128; - b2[i3++] = clockseq & 255; - for (var n4 = 0; n4 < 6; ++n4) { - b2[i3 + n4] = node2[n4]; - } - return buf || stringify$2(b2); -} -function parse(uuid2) { - if (!validate(uuid2)) { - throw TypeError("Invalid UUID"); - } - var v6; - var arr = new Uint8Array(16); - arr[0] = (v6 = parseInt(uuid2.slice(0, 8), 16)) >>> 24; - arr[1] = v6 >>> 16 & 255; - arr[2] = v6 >>> 8 & 255; - arr[3] = v6 & 255; - arr[4] = (v6 = parseInt(uuid2.slice(9, 13), 16)) >>> 8; - arr[5] = v6 & 255; - arr[6] = (v6 = parseInt(uuid2.slice(14, 18), 16)) >>> 8; - arr[7] = v6 & 255; - arr[8] = (v6 = parseInt(uuid2.slice(19, 23), 16)) >>> 8; - arr[9] = v6 & 255; - arr[10] = (v6 = parseInt(uuid2.slice(24, 36), 16)) / 1099511627776 & 255; - arr[11] = v6 / 4294967296 & 255; - arr[12] = v6 >>> 24 & 255; - arr[13] = v6 >>> 16 & 255; - arr[14] = v6 >>> 8 & 255; - arr[15] = v6 & 255; - return arr; -} -function stringToBytes$1(str) { - str = unescape(encodeURIComponent(str)); - var bytes2 = []; - for (var i3 = 0; i3 < str.length; ++i3) { - bytes2.push(str.charCodeAt(i3)); - } - return bytes2; -} -var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; -var URL$1 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; -function v35(name2, version2, hashfunc) { - function generateUUID(value, namespace, buf, offset2) { - if (typeof value === "string") { - value = stringToBytes$1(value); - } - if (typeof namespace === "string") { - namespace = parse(namespace); - } - if (namespace.length !== 16) { - throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); - } - var bytes2 = new Uint8Array(16 + value.length); - bytes2.set(namespace); - bytes2.set(value, namespace.length); - bytes2 = hashfunc(bytes2); - bytes2[6] = bytes2[6] & 15 | version2; - bytes2[8] = bytes2[8] & 63 | 128; - if (buf) { - offset2 = offset2 || 0; - for (var i3 = 0; i3 < 16; ++i3) { - buf[offset2 + i3] = bytes2[i3]; - } - return buf; - } - return stringify$2(bytes2); - } - try { - generateUUID.name = name2; - } catch (err) { - } - generateUUID.DNS = DNS; - generateUUID.URL = URL$1; - return generateUUID; -} -function md5(bytes2) { - if (typeof bytes2 === "string") { - var msg = unescape(encodeURIComponent(bytes2)); - bytes2 = new Uint8Array(msg.length); - for (var i3 = 0; i3 < msg.length; ++i3) { - bytes2[i3] = msg.charCodeAt(i3); - } - } - return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes2), bytes2.length * 8)); -} -function md5ToHexEncodedArray(input) { - var output2 = []; - var length32 = input.length * 32; - var hexTab = "0123456789abcdef"; - for (var i3 = 0; i3 < length32; i3 += 8) { - var x3 = input[i3 >> 5] >>> i3 % 32 & 255; - var hex = parseInt(hexTab.charAt(x3 >>> 4 & 15) + hexTab.charAt(x3 & 15), 16); - output2.push(hex); - } - return output2; -} -function getOutputLength(inputLength8) { - return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; -} -function wordsToMd5(x3, len) { - x3[len >> 5] |= 128 << len % 32; - x3[getOutputLength(len) - 1] = len; - var a3 = 1732584193; - var b2 = -271733879; - var c2 = -1732584194; - var d4 = 271733878; - for (var i3 = 0; i3 < x3.length; i3 += 16) { - var olda = a3; - var oldb = b2; - var oldc = c2; - var oldd = d4; - a3 = md5ff(a3, b2, c2, d4, x3[i3], 7, -680876936); - d4 = md5ff(d4, a3, b2, c2, x3[i3 + 1], 12, -389564586); - c2 = md5ff(c2, d4, a3, b2, x3[i3 + 2], 17, 606105819); - b2 = md5ff(b2, c2, d4, a3, x3[i3 + 3], 22, -1044525330); - a3 = md5ff(a3, b2, c2, d4, x3[i3 + 4], 7, -176418897); - d4 = md5ff(d4, a3, b2, c2, x3[i3 + 5], 12, 1200080426); - c2 = md5ff(c2, d4, a3, b2, x3[i3 + 6], 17, -1473231341); - b2 = md5ff(b2, c2, d4, a3, x3[i3 + 7], 22, -45705983); - a3 = md5ff(a3, b2, c2, d4, x3[i3 + 8], 7, 1770035416); - d4 = md5ff(d4, a3, b2, c2, x3[i3 + 9], 12, -1958414417); - c2 = md5ff(c2, d4, a3, b2, x3[i3 + 10], 17, -42063); - b2 = md5ff(b2, c2, d4, a3, x3[i3 + 11], 22, -1990404162); - a3 = md5ff(a3, b2, c2, d4, x3[i3 + 12], 7, 1804603682); - d4 = md5ff(d4, a3, b2, c2, x3[i3 + 13], 12, -40341101); - c2 = md5ff(c2, d4, a3, b2, x3[i3 + 14], 17, -1502002290); - b2 = md5ff(b2, c2, d4, a3, x3[i3 + 15], 22, 1236535329); - a3 = md5gg(a3, b2, c2, d4, x3[i3 + 1], 5, -165796510); - d4 = md5gg(d4, a3, b2, c2, x3[i3 + 6], 9, -1069501632); - c2 = md5gg(c2, d4, a3, b2, x3[i3 + 11], 14, 643717713); - b2 = md5gg(b2, c2, d4, a3, x3[i3], 20, -373897302); - a3 = md5gg(a3, b2, c2, d4, x3[i3 + 5], 5, -701558691); - d4 = md5gg(d4, a3, b2, c2, x3[i3 + 10], 9, 38016083); - c2 = md5gg(c2, d4, a3, b2, x3[i3 + 15], 14, -660478335); - b2 = md5gg(b2, c2, d4, a3, x3[i3 + 4], 20, -405537848); - a3 = md5gg(a3, b2, c2, d4, x3[i3 + 9], 5, 568446438); - d4 = md5gg(d4, a3, b2, c2, x3[i3 + 14], 9, -1019803690); - c2 = md5gg(c2, d4, a3, b2, x3[i3 + 3], 14, -187363961); - b2 = md5gg(b2, c2, d4, a3, x3[i3 + 8], 20, 1163531501); - a3 = md5gg(a3, b2, c2, d4, x3[i3 + 13], 5, -1444681467); - d4 = md5gg(d4, a3, b2, c2, x3[i3 + 2], 9, -51403784); - c2 = md5gg(c2, d4, a3, b2, x3[i3 + 7], 14, 1735328473); - b2 = md5gg(b2, c2, d4, a3, x3[i3 + 12], 20, -1926607734); - a3 = md5hh(a3, b2, c2, d4, x3[i3 + 5], 4, -378558); - d4 = md5hh(d4, a3, b2, c2, x3[i3 + 8], 11, -2022574463); - c2 = md5hh(c2, d4, a3, b2, x3[i3 + 11], 16, 1839030562); - b2 = md5hh(b2, c2, d4, a3, x3[i3 + 14], 23, -35309556); - a3 = md5hh(a3, b2, c2, d4, x3[i3 + 1], 4, -1530992060); - d4 = md5hh(d4, a3, b2, c2, x3[i3 + 4], 11, 1272893353); - c2 = md5hh(c2, d4, a3, b2, x3[i3 + 7], 16, -155497632); - b2 = md5hh(b2, c2, d4, a3, x3[i3 + 10], 23, -1094730640); - a3 = md5hh(a3, b2, c2, d4, x3[i3 + 13], 4, 681279174); - d4 = md5hh(d4, a3, b2, c2, x3[i3], 11, -358537222); - c2 = md5hh(c2, d4, a3, b2, x3[i3 + 3], 16, -722521979); - b2 = md5hh(b2, c2, d4, a3, x3[i3 + 6], 23, 76029189); - a3 = md5hh(a3, b2, c2, d4, x3[i3 + 9], 4, -640364487); - d4 = md5hh(d4, a3, b2, c2, x3[i3 + 12], 11, -421815835); - c2 = md5hh(c2, d4, a3, b2, x3[i3 + 15], 16, 530742520); - b2 = md5hh(b2, c2, d4, a3, x3[i3 + 2], 23, -995338651); - a3 = md5ii(a3, b2, c2, d4, x3[i3], 6, -198630844); - d4 = md5ii(d4, a3, b2, c2, x3[i3 + 7], 10, 1126891415); - c2 = md5ii(c2, d4, a3, b2, x3[i3 + 14], 15, -1416354905); - b2 = md5ii(b2, c2, d4, a3, x3[i3 + 5], 21, -57434055); - a3 = md5ii(a3, b2, c2, d4, x3[i3 + 12], 6, 1700485571); - d4 = md5ii(d4, a3, b2, c2, x3[i3 + 3], 10, -1894986606); - c2 = md5ii(c2, d4, a3, b2, x3[i3 + 10], 15, -1051523); - b2 = md5ii(b2, c2, d4, a3, x3[i3 + 1], 21, -2054922799); - a3 = md5ii(a3, b2, c2, d4, x3[i3 + 8], 6, 1873313359); - d4 = md5ii(d4, a3, b2, c2, x3[i3 + 15], 10, -30611744); - c2 = md5ii(c2, d4, a3, b2, x3[i3 + 6], 15, -1560198380); - b2 = md5ii(b2, c2, d4, a3, x3[i3 + 13], 21, 1309151649); - a3 = md5ii(a3, b2, c2, d4, x3[i3 + 4], 6, -145523070); - d4 = md5ii(d4, a3, b2, c2, x3[i3 + 11], 10, -1120210379); - c2 = md5ii(c2, d4, a3, b2, x3[i3 + 2], 15, 718787259); - b2 = md5ii(b2, c2, d4, a3, x3[i3 + 9], 21, -343485551); - a3 = safeAdd(a3, olda); - b2 = safeAdd(b2, oldb); - c2 = safeAdd(c2, oldc); - d4 = safeAdd(d4, oldd); - } - return [a3, b2, c2, d4]; -} -function bytesToWords(input) { - if (input.length === 0) { - return []; - } - var length8 = input.length * 8; - var output2 = new Uint32Array(getOutputLength(length8)); - for (var i3 = 0; i3 < length8; i3 += 8) { - output2[i3 >> 5] |= (input[i3 / 8] & 255) << i3 % 32; - } - return output2; -} -function safeAdd(x3, y3) { - var lsw = (x3 & 65535) + (y3 & 65535); - var msw = (x3 >> 16) + (y3 >> 16) + (lsw >> 16); - return msw << 16 | lsw & 65535; -} -function bitRotateLeft(num, cnt) { - return num << cnt | num >>> 32 - cnt; -} -function md5cmn(q2, a3, b2, x3, s2, t2) { - return safeAdd(bitRotateLeft(safeAdd(safeAdd(a3, q2), safeAdd(x3, t2)), s2), b2); -} -function md5ff(a3, b2, c2, d4, x3, s2, t2) { - return md5cmn(b2 & c2 | ~b2 & d4, a3, b2, x3, s2, t2); -} -function md5gg(a3, b2, c2, d4, x3, s2, t2) { - return md5cmn(b2 & d4 | c2 & ~d4, a3, b2, x3, s2, t2); -} -function md5hh(a3, b2, c2, d4, x3, s2, t2) { - return md5cmn(b2 ^ c2 ^ d4, a3, b2, x3, s2, t2); -} -function md5ii(a3, b2, c2, d4, x3, s2, t2) { - return md5cmn(c2 ^ (b2 | ~d4), a3, b2, x3, s2, t2); -} -var v3 = v35("v3", 48, md5); -const v3$1 = v3; -function v4(options, buf, offset2) { - options = options || {}; - var rnds = options.random || (options.rng || rng)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset2 = offset2 || 0; - for (var i3 = 0; i3 < 16; ++i3) { - buf[offset2 + i3] = rnds[i3]; - } - return buf; - } - return stringify$2(rnds); -} -function f$4(s2, x3, y3, z3) { - switch (s2) { - case 0: - return x3 & y3 ^ ~x3 & z3; - case 1: - return x3 ^ y3 ^ z3; - case 2: - return x3 & y3 ^ x3 & z3 ^ y3 & z3; - case 3: - return x3 ^ y3 ^ z3; - } -} -function ROTL(x3, n4) { - return x3 << n4 | x3 >>> 32 - n4; -} -function sha1(bytes2) { - var K3 = [1518500249, 1859775393, 2400959708, 3395469782]; - var H2 = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; - if (typeof bytes2 === "string") { - var msg = unescape(encodeURIComponent(bytes2)); - bytes2 = []; - for (var i3 = 0; i3 < msg.length; ++i3) { - bytes2.push(msg.charCodeAt(i3)); - } - } else if (!Array.isArray(bytes2)) { - bytes2 = Array.prototype.slice.call(bytes2); - } - bytes2.push(128); - var l2 = bytes2.length / 4 + 2; - var N2 = Math.ceil(l2 / 16); - var M3 = new Array(N2); - for (var _i3 = 0; _i3 < N2; ++_i3) { - var arr = new Uint32Array(16); - for (var j2 = 0; j2 < 16; ++j2) { - arr[j2] = bytes2[_i3 * 64 + j2 * 4] << 24 | bytes2[_i3 * 64 + j2 * 4 + 1] << 16 | bytes2[_i3 * 64 + j2 * 4 + 2] << 8 | bytes2[_i3 * 64 + j2 * 4 + 3]; - } - M3[_i3] = arr; - } - M3[N2 - 1][14] = (bytes2.length - 1) * 8 / Math.pow(2, 32); - M3[N2 - 1][14] = Math.floor(M3[N2 - 1][14]); - M3[N2 - 1][15] = (bytes2.length - 1) * 8 & 4294967295; - for (var _i22 = 0; _i22 < N2; ++_i22) { - var W2 = new Uint32Array(80); - for (var t2 = 0; t2 < 16; ++t2) { - W2[t2] = M3[_i22][t2]; - } - for (var _t2 = 16; _t2 < 80; ++_t2) { - W2[_t2] = ROTL(W2[_t2 - 3] ^ W2[_t2 - 8] ^ W2[_t2 - 14] ^ W2[_t2 - 16], 1); - } - var a3 = H2[0]; - var b2 = H2[1]; - var c2 = H2[2]; - var d4 = H2[3]; - var e18 = H2[4]; - for (var _t22 = 0; _t22 < 80; ++_t22) { - var s2 = Math.floor(_t22 / 20); - var T9 = ROTL(a3, 5) + f$4(s2, b2, c2, d4) + e18 + K3[s2] + W2[_t22] >>> 0; - e18 = d4; - d4 = c2; - c2 = ROTL(b2, 30) >>> 0; - b2 = a3; - a3 = T9; - } - H2[0] = H2[0] + a3 >>> 0; - H2[1] = H2[1] + b2 >>> 0; - H2[2] = H2[2] + c2 >>> 0; - H2[3] = H2[3] + d4 >>> 0; - H2[4] = H2[4] + e18 >>> 0; - } - return [H2[0] >> 24 & 255, H2[0] >> 16 & 255, H2[0] >> 8 & 255, H2[0] & 255, H2[1] >> 24 & 255, H2[1] >> 16 & 255, H2[1] >> 8 & 255, H2[1] & 255, H2[2] >> 24 & 255, H2[2] >> 16 & 255, H2[2] >> 8 & 255, H2[2] & 255, H2[3] >> 24 & 255, H2[3] >> 16 & 255, H2[3] >> 8 & 255, H2[3] & 255, H2[4] >> 24 & 255, H2[4] >> 16 & 255, H2[4] >> 8 & 255, H2[4] & 255]; -} -var v5 = v35("v5", 80, sha1); -const v5$1 = v5; -const nil = "00000000-0000-0000-0000-000000000000"; -function version$4(uuid2) { - if (!validate(uuid2)) { - throw TypeError("Invalid UUID"); - } - return parseInt(uuid2.substr(14, 1), 16); -} -const esmBrowser = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - NIL: nil, - parse, - stringify: stringify$2, - v1, - v3: v3$1, - v4, - v5: v5$1, - validate, - version: version$4 -}, Symbol.toStringTag, { value: "Module" })); -const require$$0$2 = /* @__PURE__ */ getAugmentedNamespace(esmBrowser); -const uuid$1 = require$$0$2.v4; -const generateRequest$1 = function(method, params, id2, options) { - if (typeof method !== "string") { - throw new TypeError(method + " must be a string"); - } - options = options || {}; - const version2 = typeof options.version === "number" ? options.version : 2; - if (version2 !== 1 && version2 !== 2) { - throw new TypeError(version2 + " must be 1 or 2"); - } - const request = { - method - }; - if (version2 === 2) { - request.jsonrpc = "2.0"; - } - if (params) { - if (typeof params !== "object" && !Array.isArray(params)) { - throw new TypeError(params + " must be an object, array or omitted"); - } - request.params = params; - } - if (typeof id2 === "undefined") { - const generator = typeof options.generator === "function" ? options.generator : function() { - return uuid$1(); - }; - request.id = generator(request, options); - } else if (version2 === 2 && id2 === null) { - if (options.notificationIdNull) { - request.id = null; - } - } else { - request.id = id2; - } - return request; -}; -var generateRequest_1 = generateRequest$1; -const uuid = require$$0$2.v4; -const generateRequest = generateRequest_1; -const ClientBrowser = function(callServer, options) { - if (!(this instanceof ClientBrowser)) { - return new ClientBrowser(callServer, options); - } - if (!options) { - options = {}; - } - this.options = { - reviver: typeof options.reviver !== "undefined" ? options.reviver : null, - replacer: typeof options.replacer !== "undefined" ? options.replacer : null, - generator: typeof options.generator !== "undefined" ? options.generator : function() { - return uuid(); - }, - version: typeof options.version !== "undefined" ? options.version : 2, - notificationIdNull: typeof options.notificationIdNull === "boolean" ? options.notificationIdNull : false - }; - this.callServer = callServer; -}; -var browser$3 = ClientBrowser; -ClientBrowser.prototype.request = function(method, params, id2, callback) { - const self2 = this; - let request = null; - const isBatch = Array.isArray(method) && typeof params === "function"; - if (this.options.version === 1 && isBatch) { - throw new TypeError("JSON-RPC 1.0 does not support batching"); - } - const isRaw = !isBatch && method && typeof method === "object" && typeof params === "function"; - if (isBatch || isRaw) { - callback = params; - request = method; - } else { - if (typeof id2 === "function") { - callback = id2; - id2 = void 0; - } - const hasCallback = typeof callback === "function"; - try { - request = generateRequest(method, params, id2, { - generator: this.options.generator, - version: this.options.version, - notificationIdNull: this.options.notificationIdNull - }); - } catch (err) { - if (hasCallback) { - return callback(err); - } - throw err; - } - if (!hasCallback) { - return request; - } - } - let message2; - try { - message2 = JSON.stringify(request, this.options.replacer); - } catch (err) { - return callback(err); - } - this.callServer(message2, function(err, response) { - self2._parseResponse(err, response, callback); - }); - return request; -}; -ClientBrowser.prototype._parseResponse = function(err, responseText, callback) { - if (err) { - callback(err); - return; - } - if (!responseText) { - return callback(); - } - let response; - try { - response = JSON.parse(responseText, this.options.reviver); - } catch (err2) { - return callback(err2); - } - if (callback.length === 3) { - if (Array.isArray(response)) { - const isError2 = function(res) { - return typeof res.error !== "undefined"; - }; - const isNotError = function(res) { - return !isError2(res); - }; - return callback(null, response.filter(isError2), response.filter(isNotError)); - } else { - return callback(null, response.error, response.result); - } - } - callback(null, response); -}; -const RpcClient = /* @__PURE__ */ getDefaultExportFromCjs$1(browser$3); -var WebSocketBrowserImpl = class extends O$5 { - /** Instantiate a WebSocket class - * @constructor - * @param {String} address - url to a websocket server - * @param {(Object)} options - websocket options - * @param {(String|Array)} protocols - a list of protocols - * @return {WebSocketBrowserImpl} - returns a WebSocket instance - */ - constructor(address2, options, protocols) { - super(); - __publicField(this, "socket"); - this.socket = new window.WebSocket(address2, protocols); - this.socket.onopen = () => this.emit("open"); - this.socket.onmessage = (event) => this.emit("message", event.data); - this.socket.onerror = (error) => this.emit("error", error); - this.socket.onclose = (event) => { - this.emit("close", event.code, event.reason); - }; - } - /** - * Sends data through a websocket connection - * @method - * @param {(String|Object)} data - data to be sent via websocket - * @param {Object} optionsOrCallback - ws options - * @param {Function} callback - a callback called once the data is sent - * @return {Undefined} - */ - send(data, optionsOrCallback, callback) { - const cb2 = callback || optionsOrCallback; - try { - this.socket.send(data); - cb2(); - } catch (error) { - cb2(error); - } - } - /** - * Closes an underlying socket - * @method - * @param {Number} code - status code explaining why the connection is being closed - * @param {String} reason - a description why the connection is closing - * @return {Undefined} - * @throws {Error} - */ - close(code2, reason) { - this.socket.close(code2, reason); - } - addEventListener(type2, listener, options) { - this.socket.addEventListener(type2, listener, options); - } -}; -function WebSocket$1(address2, options) { - return new WebSocketBrowserImpl(address2, options); -} -var DefaultDataPack = class { - encode(value) { - return JSON.stringify(value); - } - decode(value) { - return JSON.parse(value); - } -}; -var CommonClient = class extends O$5 { - /** - * Instantiate a Client class. - * @constructor - * @param {webSocketFactory} webSocketFactory - factory method for WebSocket - * @param {String} address - url to a websocket server - * @param {Object} options - ws options object with reconnect parameters - * @param {Function} generate_request_id - custom generation request Id - * @param {DataPack} dataPack - data pack contains encoder and decoder - * @return {CommonClient} - */ - constructor(webSocketFactory, address2 = "ws://localhost:8080", { - autoconnect = true, - reconnect: reconnect2 = true, - reconnect_interval = 1e3, - max_reconnects = 5, - ...rest_options - } = {}, generate_request_id, dataPack) { - super(); - __publicField(this, "address"); - __publicField(this, "rpc_id"); - __publicField(this, "queue"); - __publicField(this, "options"); - __publicField(this, "autoconnect"); - __publicField(this, "ready"); - __publicField(this, "reconnect"); - __publicField(this, "reconnect_timer_id"); - __publicField(this, "reconnect_interval"); - __publicField(this, "max_reconnects"); - __publicField(this, "rest_options"); - __publicField(this, "current_reconnects"); - __publicField(this, "generate_request_id"); - __publicField(this, "socket"); - __publicField(this, "webSocketFactory"); - __publicField(this, "dataPack"); - this.webSocketFactory = webSocketFactory; - this.queue = {}; - this.rpc_id = 0; - this.address = address2; - this.autoconnect = autoconnect; - this.ready = false; - this.reconnect = reconnect2; - this.reconnect_timer_id = void 0; - this.reconnect_interval = reconnect_interval; - this.max_reconnects = max_reconnects; - this.rest_options = rest_options; - this.current_reconnects = 0; - this.generate_request_id = generate_request_id || (() => ++this.rpc_id); - if (!dataPack) - this.dataPack = new DefaultDataPack(); - else - this.dataPack = dataPack; - if (this.autoconnect) - this._connect(this.address, { - autoconnect: this.autoconnect, - reconnect: this.reconnect, - reconnect_interval: this.reconnect_interval, - max_reconnects: this.max_reconnects, - ...this.rest_options - }); - } - /** - * Connects to a defined server if not connected already. - * @method - * @return {Undefined} - */ - connect() { - if (this.socket) - return; - this._connect(this.address, { - autoconnect: this.autoconnect, - reconnect: this.reconnect, - reconnect_interval: this.reconnect_interval, - max_reconnects: this.max_reconnects, - ...this.rest_options - }); - } - /** - * Calls a registered RPC method on server. - * @method - * @param {String} method - RPC method name - * @param {Object|Array} params - optional method parameters - * @param {Number} timeout - RPC reply timeout value - * @param {Object} ws_opts - options passed to ws - * @return {Promise} - */ - call(method, params, timeout, ws_opts) { - if (!ws_opts && "object" === typeof timeout) { - ws_opts = timeout; - timeout = null; - } - return new Promise((resolve, reject) => { - if (!this.ready) - return reject(new Error("socket not ready")); - const rpc_id = this.generate_request_id(method, params); - const message2 = { - jsonrpc: "2.0", - method, - params: params || void 0, - id: rpc_id - }; - this.socket.send(this.dataPack.encode(message2), ws_opts, (error) => { - if (error) - return reject(error); - this.queue[rpc_id] = { promise: [resolve, reject] }; - if (timeout) { - this.queue[rpc_id].timeout = setTimeout(() => { - delete this.queue[rpc_id]; - reject(new Error("reply timeout")); - }, timeout); - } - }); - }); - } - /** - * Logins with the other side of the connection. - * @method - * @param {Object} params - Login credentials object - * @return {Promise} - */ - async login(params) { - const resp = await this.call("rpc.login", params); - if (!resp) - throw new Error("authentication failed"); - return resp; - } - /** - * Fetches a list of client's methods registered on server. - * @method - * @return {Array} - */ - async listMethods() { - return await this.call("__listMethods"); - } - /** - * Sends a JSON-RPC 2.0 notification to server. - * @method - * @param {String} method - RPC method name - * @param {Object} params - optional method parameters - * @return {Promise} - */ - notify(method, params) { - return new Promise((resolve, reject) => { - if (!this.ready) - return reject(new Error("socket not ready")); - const message2 = { - jsonrpc: "2.0", - method, - params - }; - this.socket.send(this.dataPack.encode(message2), (error) => { - if (error) - return reject(error); - resolve(); - }); - }); - } - /** - * Subscribes for a defined event. - * @method - * @param {String|Array} event - event name - * @return {Undefined} - * @throws {Error} - */ - async subscribe(event) { - if (typeof event === "string") - event = [event]; - const result = await this.call("rpc.on", event); - if (typeof event === "string" && result[event] !== "ok") - throw new Error( - "Failed subscribing to an event '" + event + "' with: " + result[event] - ); - return result; - } - /** - * Unsubscribes from a defined event. - * @method - * @param {String|Array} event - event name - * @return {Undefined} - * @throws {Error} - */ - async unsubscribe(event) { - if (typeof event === "string") - event = [event]; - const result = await this.call("rpc.off", event); - if (typeof event === "string" && result[event] !== "ok") - throw new Error("Failed unsubscribing from an event with: " + result); - return result; - } - /** - * Closes a WebSocket connection gracefully. - * @method - * @param {Number} code - socket close code - * @param {String} data - optional data to be sent before closing - * @return {Undefined} - */ - close(code2, data) { - this.socket.close(code2 || 1e3, data); - } - /** - * Enable / disable automatic reconnection. - * @method - * @param {Boolean} reconnect - enable / disable reconnection - * @return {Undefined} - */ - setAutoReconnect(reconnect2) { - this.reconnect = reconnect2; - } - /** - * Set the interval between reconnection attempts. - * @method - * @param {Number} interval - reconnection interval in milliseconds - * @return {Undefined} - */ - setReconnectInterval(interval) { - this.reconnect_interval = interval; - } - /** - * Set the maximum number of reconnection attempts. - * @method - * @param {Number} max_reconnects - maximum reconnection attempts - * @return {Undefined} - */ - setMaxReconnects(max_reconnects) { - this.max_reconnects = max_reconnects; - } - /** - * Connection/Message handler. - * @method - * @private - * @param {String} address - WebSocket API address - * @param {Object} options - ws options object - * @return {Undefined} - */ - _connect(address2, options) { - clearTimeout(this.reconnect_timer_id); - this.socket = this.webSocketFactory(address2, options); - this.socket.addEventListener("open", () => { - this.ready = true; - this.emit("open"); - this.current_reconnects = 0; - }); - this.socket.addEventListener("message", ({ data: message2 }) => { - if (message2 instanceof ArrayBuffer) - message2 = buffer.Buffer.from(message2).toString(); - try { - message2 = this.dataPack.decode(message2); - } catch (error) { - return; - } - if (message2.notification && this.listeners(message2.notification).length) { - if (!Object.keys(message2.params).length) - return this.emit(message2.notification); - const args = [message2.notification]; - if (message2.params.constructor === Object) - args.push(message2.params); - else - for (let i3 = 0; i3 < message2.params.length; i3++) - args.push(message2.params[i3]); - return Promise.resolve().then(() => { - this.emit.apply(this, args); - }); - } - if (!this.queue[message2.id]) { - if (message2.method) { - return Promise.resolve().then(() => { - this.emit(message2.method, message2 == null ? void 0 : message2.params); - }); - } - return; - } - if ("error" in message2 === "result" in message2) - this.queue[message2.id].promise[1]( - new Error( - 'Server response malformed. Response must include either "result" or "error", but not both.' - ) - ); - if (this.queue[message2.id].timeout) - clearTimeout(this.queue[message2.id].timeout); - if (message2.error) - this.queue[message2.id].promise[1](message2.error); - else - this.queue[message2.id].promise[0](message2.result); - delete this.queue[message2.id]; - }); - this.socket.addEventListener("error", (error) => this.emit("error", error)); - this.socket.addEventListener("close", ({ code: code2, reason }) => { - if (this.ready) - setTimeout(() => this.emit("close", code2, reason), 0); - this.ready = false; - this.socket = void 0; - if (code2 === 1e3) - return; - this.current_reconnects++; - if (this.reconnect && (this.max_reconnects > this.current_reconnects || this.max_reconnects === 0)) - this.reconnect_timer_id = setTimeout( - () => this._connect(address2, options), - this.reconnect_interval - ); - }); - } -}; -let HMAC$2 = class HMAC extends Hash$1 { - constructor(hash3, _key) { - super(); - this.finished = false; - this.destroyed = false; - hash$4(hash3); - const key2 = toBytes$1(_key); - this.iHash = hash3.create(); - if (typeof this.iHash.update !== "function") - throw new Error("Expected instance of class which extends utils.Hash"); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad3 = new Uint8Array(blockLen); - pad3.set(key2.length > blockLen ? hash3.create().update(key2).digest() : key2); - for (let i3 = 0; i3 < pad3.length; i3++) - pad3[i3] ^= 54; - this.iHash.update(pad3); - this.oHash = hash3.create(); - for (let i3 = 0; i3 < pad3.length; i3++) - pad3[i3] ^= 54 ^ 92; - this.oHash.update(pad3); - pad3.fill(0); - } - update(buf) { - exists$1(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - exists$1(this); - bytes$2(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to2) { - to2 || (to2 = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished: finished2, destroyed, blockLen, outputLen } = this; - to2 = to2; - to2.finished = finished2; - to2.destroyed = destroyed; - to2.blockLen = blockLen; - to2.outputLen = outputLen; - to2.oHash = oHash._cloneInto(to2.oHash); - to2.iHash = iHash._cloneInto(to2.iHash); - return to2; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -}; -const hmac$3 = (hash3, key2, message2) => new HMAC$2(hash3, key2).update(message2).digest(); -hmac$3.create = (hash3, key2) => new HMAC$2(hash3, key2); -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -function validatePointOpts$1(curve2) { - const opts = validateBasic$1(curve2); - validateObject$1(opts, { - a: "field", - b: "field" - }, { - allowedPrivateKeyLengths: "array", - wrapPrivateKey: "boolean", - isTorsionFree: "function", - clearCofactor: "function", - allowInfinityPoint: "boolean", - fromBytes: "function", - toBytes: "function" - }); - const { endo, Fp: Fp2, a: a3 } = opts; - if (endo) { - if (!Fp2.eql(a3, Fp2.ZERO)) { - throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0"); - } - if (typeof endo !== "object" || typeof endo.beta !== "bigint" || typeof endo.splitScalar !== "function") { - throw new Error("Expected endomorphism with beta: bigint and splitScalar: function"); - } - } - return Object.freeze({ ...opts }); -} -const { bytesToNumberBE: b2n$1, hexToBytes: h2b$1 } = ut$3; -const DER$1 = { - // asn.1 DER encoding utils - Err: class DERErr extends Error { - constructor(m3 = "") { - super(m3); - } - }, - _parseInt(data) { - const { Err: E2 } = DER$1; - if (data.length < 2 || data[0] !== 2) - throw new E2("Invalid signature integer tag"); - const len = data[1]; - const res = data.subarray(2, len + 2); - if (!len || res.length !== len) - throw new E2("Invalid signature integer: wrong length"); - if (res[0] & 128) - throw new E2("Invalid signature integer: negative"); - if (res[0] === 0 && !(res[1] & 128)) - throw new E2("Invalid signature integer: unnecessary leading zero"); - return { d: b2n$1(res), l: data.subarray(len + 2) }; - }, - toSig(hex) { - const { Err: E2 } = DER$1; - const data = typeof hex === "string" ? h2b$1(hex) : hex; - abytes(data); - let l2 = data.length; - if (l2 < 2 || data[0] != 48) - throw new E2("Invalid signature tag"); - if (data[1] !== l2 - 2) - throw new E2("Invalid signature: incorrect length"); - const { d: r2, l: sBytes } = DER$1._parseInt(data.subarray(2)); - const { d: s2, l: rBytesLeft } = DER$1._parseInt(sBytes); - if (rBytesLeft.length) - throw new E2("Invalid signature: left bytes after parsing"); - return { r: r2, s: s2 }; - }, - hexFromSig(sig) { - const slice = (s3) => Number.parseInt(s3[0], 16) & 8 ? "00" + s3 : s3; - const h4 = (num) => { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; - }; - const s2 = slice(h4(sig.s)); - const r2 = slice(h4(sig.r)); - const shl = s2.length / 2; - const rhl = r2.length / 2; - const sl2 = h4(shl); - const rl2 = h4(rhl); - return `30${h4(rhl + shl + 4)}02${rl2}${r2}02${sl2}${s2}`; - } -}; -const _0n$5 = BigInt(0), _1n$7 = BigInt(1); -BigInt(2); -const _3n$2 = BigInt(3); -BigInt(4); -function weierstrassPoints$1(opts) { - const CURVE = validatePointOpts$1(opts); - const { Fp: Fp2 } = CURVE; - const toBytes3 = CURVE.toBytes || ((_c2, point5, _isCompressed) => { - const a3 = point5.toAffine(); - return concatBytes$2(Uint8Array.from([4]), Fp2.toBytes(a3.x), Fp2.toBytes(a3.y)); - }); - const fromBytes = CURVE.fromBytes || ((bytes2) => { - const tail = bytes2.subarray(1); - const x3 = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); - const y3 = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); - return { x: x3, y: y3 }; - }); - function weierstrassEquation(x3) { - const { a: a3, b: b2 } = CURVE; - const x22 = Fp2.sqr(x3); - const x32 = Fp2.mul(x22, x3); - return Fp2.add(Fp2.add(x32, Fp2.mul(x3, a3)), b2); - } - if (!Fp2.eql(Fp2.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) - throw new Error("bad generator point: equation left != right"); - function isWithinCurveOrder(num) { - return typeof num === "bigint" && _0n$5 < num && num < CURVE.n; - } - function assertGE(num) { - if (!isWithinCurveOrder(num)) - throw new Error("Expected valid bigint: 0 < bigint < curve.n"); - } - function normPrivateKeyToScalar(key2) { - const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n: n4 } = CURVE; - if (lengths && typeof key2 !== "bigint") { - if (isBytes(key2)) - key2 = bytesToHex$1(key2); - if (typeof key2 !== "string" || !lengths.includes(key2.length)) - throw new Error("Invalid key"); - key2 = key2.padStart(nByteLength * 2, "0"); - } - let num; - try { - num = typeof key2 === "bigint" ? key2 : bytesToNumberBE$1(ensureBytes$1("private key", key2, nByteLength)); - } catch (error) { - throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key2}`); - } - if (wrapPrivateKey) - num = mod$1(num, n4); - assertGE(num); - return num; - } - const pointPrecomputes = /* @__PURE__ */ new Map(); - function assertPrjPoint(other) { - if (!(other instanceof Point2)) - throw new Error("ProjectivePoint expected"); - } - class Point2 { - constructor(px, py, pz) { - this.px = px; - this.py = py; - this.pz = pz; - if (px == null || !Fp2.isValid(px)) - throw new Error("x required"); - if (py == null || !Fp2.isValid(py)) - throw new Error("y required"); - if (pz == null || !Fp2.isValid(pz)) - throw new Error("z required"); - } - // Does not validate if the point is on-curve. - // Use fromHex instead, or call assertValidity() later. - static fromAffine(p3) { - const { x: x3, y: y3 } = p3 || {}; - if (!p3 || !Fp2.isValid(x3) || !Fp2.isValid(y3)) - throw new Error("invalid affine point"); - if (p3 instanceof Point2) - throw new Error("projective point not allowed"); - const is0 = (i3) => Fp2.eql(i3, Fp2.ZERO); - if (is0(x3) && is0(y3)) - return Point2.ZERO; - return new Point2(x3, y3, Fp2.ONE); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ - static normalizeZ(points) { - const toInv = Fp2.invertBatch(points.map((p3) => p3.pz)); - return points.map((p3, i3) => p3.toAffine(toInv[i3])).map(Point2.fromAffine); - } - /** - * Converts hash string or Uint8Array to Point. - * @param hex short/long ECDSA hex - */ - static fromHex(hex) { - const P2 = Point2.fromAffine(fromBytes(ensureBytes$1("pointHex", hex))); - P2.assertValidity(); - return P2; - } - // Multiplies generator point by privateKey. - static fromPrivateKey(privateKey) { - return Point2.BASE.multiply(normPrivateKeyToScalar(privateKey)); - } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // A point on curve is valid if it conforms to equation. - assertValidity() { - if (this.is0()) { - if (CURVE.allowInfinityPoint && !Fp2.is0(this.py)) - return; - throw new Error("bad point: ZERO"); - } - const { x: x3, y: y3 } = this.toAffine(); - if (!Fp2.isValid(x3) || !Fp2.isValid(y3)) - throw new Error("bad point: x or y not FE"); - const left = Fp2.sqr(y3); - const right = weierstrassEquation(x3); - if (!Fp2.eql(left, right)) - throw new Error("bad point: equation left != right"); - if (!this.isTorsionFree()) - throw new Error("bad point: not in prime-order subgroup"); - } - hasEvenY() { - const { y: y3 } = this.toAffine(); - if (Fp2.isOdd) - return !Fp2.isOdd(y3); - throw new Error("Field doesn't support isOdd"); - } - /** - * Compare one point to another. - */ - equals(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - const U12 = Fp2.eql(Fp2.mul(X1, Z2), Fp2.mul(X2, Z1)); - const U22 = Fp2.eql(Fp2.mul(Y1, Z2), Fp2.mul(Y2, Z1)); - return U12 && U22; - } - /** - * Flips point to one corresponding to (x, -y) in Affine coordinates. - */ - negate() { - return new Point2(this.px, Fp2.neg(this.py), this.pz); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a: a3, b: b2 } = CURVE; - const b3 = Fp2.mul(b2, _3n$2); - const { px: X1, py: Y1, pz: Z1 } = this; - let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; - let t02 = Fp2.mul(X1, X1); - let t1 = Fp2.mul(Y1, Y1); - let t2 = Fp2.mul(Z1, Z1); - let t3 = Fp2.mul(X1, Y1); - t3 = Fp2.add(t3, t3); - Z3 = Fp2.mul(X1, Z1); - Z3 = Fp2.add(Z3, Z3); - X3 = Fp2.mul(a3, Z3); - Y3 = Fp2.mul(b3, t2); - Y3 = Fp2.add(X3, Y3); - X3 = Fp2.sub(t1, Y3); - Y3 = Fp2.add(t1, Y3); - Y3 = Fp2.mul(X3, Y3); - X3 = Fp2.mul(t3, X3); - Z3 = Fp2.mul(b3, Z3); - t2 = Fp2.mul(a3, t2); - t3 = Fp2.sub(t02, t2); - t3 = Fp2.mul(a3, t3); - t3 = Fp2.add(t3, Z3); - Z3 = Fp2.add(t02, t02); - t02 = Fp2.add(Z3, t02); - t02 = Fp2.add(t02, t2); - t02 = Fp2.mul(t02, t3); - Y3 = Fp2.add(Y3, t02); - t2 = Fp2.mul(Y1, Z1); - t2 = Fp2.add(t2, t2); - t02 = Fp2.mul(t2, t3); - X3 = Fp2.sub(X3, t02); - Z3 = Fp2.mul(t2, t1); - Z3 = Fp2.add(Z3, Z3); - Z3 = Fp2.add(Z3, Z3); - return new Point2(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; - const a3 = CURVE.a; - const b3 = Fp2.mul(CURVE.b, _3n$2); - let t02 = Fp2.mul(X1, X2); - let t1 = Fp2.mul(Y1, Y2); - let t2 = Fp2.mul(Z1, Z2); - let t3 = Fp2.add(X1, Y1); - let t4 = Fp2.add(X2, Y2); - t3 = Fp2.mul(t3, t4); - t4 = Fp2.add(t02, t1); - t3 = Fp2.sub(t3, t4); - t4 = Fp2.add(X1, Z1); - let t5 = Fp2.add(X2, Z2); - t4 = Fp2.mul(t4, t5); - t5 = Fp2.add(t02, t2); - t4 = Fp2.sub(t4, t5); - t5 = Fp2.add(Y1, Z1); - X3 = Fp2.add(Y2, Z2); - t5 = Fp2.mul(t5, X3); - X3 = Fp2.add(t1, t2); - t5 = Fp2.sub(t5, X3); - Z3 = Fp2.mul(a3, t4); - X3 = Fp2.mul(b3, t2); - Z3 = Fp2.add(X3, Z3); - X3 = Fp2.sub(t1, Z3); - Z3 = Fp2.add(t1, Z3); - Y3 = Fp2.mul(X3, Z3); - t1 = Fp2.add(t02, t02); - t1 = Fp2.add(t1, t02); - t2 = Fp2.mul(a3, t2); - t4 = Fp2.mul(b3, t4); - t1 = Fp2.add(t1, t2); - t2 = Fp2.sub(t02, t2); - t2 = Fp2.mul(a3, t2); - t4 = Fp2.add(t4, t2); - t02 = Fp2.mul(t1, t4); - Y3 = Fp2.add(Y3, t02); - t02 = Fp2.mul(t5, t4); - X3 = Fp2.mul(t3, X3); - X3 = Fp2.sub(X3, t02); - t02 = Fp2.mul(t3, t1); - Z3 = Fp2.mul(t5, Z3); - Z3 = Fp2.add(Z3, t02); - return new Point2(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point2.ZERO); - } - wNAF(n4) { - return wnaf.wNAFCached(this, pointPrecomputes, n4, (comp) => { - const toInv = Fp2.invertBatch(comp.map((p3) => p3.pz)); - return comp.map((p3, i3) => p3.toAffine(toInv[i3])).map(Point2.fromAffine); - }); - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed private key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(n4) { - const I2 = Point2.ZERO; - if (n4 === _0n$5) - return I2; - assertGE(n4); - if (n4 === _1n$7) - return this; - const { endo } = CURVE; - if (!endo) - return wnaf.unsafeLadder(this, n4); - let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n4); - let k1p = I2; - let k2p = I2; - let d4 = this; - while (k1 > _0n$5 || k2 > _0n$5) { - if (k1 & _1n$7) - k1p = k1p.add(d4); - if (k2 & _1n$7) - k2p = k2p.add(d4); - d4 = d4.double(); - k1 >>= _1n$7; - k2 >>= _1n$7; - } - if (k1neg) - k1p = k1p.negate(); - if (k2neg) - k2p = k2p.negate(); - k2p = new Point2(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - return k1p.add(k2p); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - assertGE(scalar); - let n4 = scalar; - let point5, fake; - const { endo } = CURVE; - if (endo) { - const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n4); - let { p: k1p, f: f1p } = this.wNAF(k1); - let { p: k2p, f: f2p } = this.wNAF(k2); - k1p = wnaf.constTimeNegate(k1neg, k1p); - k2p = wnaf.constTimeNegate(k2neg, k2p); - k2p = new Point2(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - point5 = k1p.add(k2p); - fake = f1p.add(f2p); - } else { - const { p: p3, f: f3 } = this.wNAF(n4); - point5 = p3; - fake = f3; - } - return Point2.normalizeZ([point5, fake])[0]; - } - /** - * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. - * Not using Strauss-Shamir trick: precomputation tables are faster. - * The trick could be useful if both P and Q are not G (not in our case). - * @returns non-zero affine point - */ - multiplyAndAddUnsafe(Q2, a3, b2) { - const G2 = Point2.BASE; - const mul6 = (P2, a4) => a4 === _0n$5 || a4 === _1n$7 || !P2.equals(G2) ? P2.multiplyUnsafe(a4) : P2.multiply(a4); - const sum = mul6(this, a3).add(mul6(Q2, b2)); - return sum.is0() ? void 0 : sum; - } - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (x, y, z) ∋ (x=x/z, y=y/z) - toAffine(iz) { - const { px: x3, py: y3, pz: z3 } = this; - const is0 = this.is0(); - if (iz == null) - iz = is0 ? Fp2.ONE : Fp2.inv(z3); - const ax = Fp2.mul(x3, iz); - const ay = Fp2.mul(y3, iz); - const zz = Fp2.mul(z3, iz); - if (is0) - return { x: Fp2.ZERO, y: Fp2.ZERO }; - if (!Fp2.eql(zz, Fp2.ONE)) - throw new Error("invZ was invalid"); - return { x: ax, y: ay }; - } - isTorsionFree() { - const { h: cofactor, isTorsionFree } = CURVE; - if (cofactor === _1n$7) - return true; - if (isTorsionFree) - return isTorsionFree(Point2, this); - throw new Error("isTorsionFree() has not been declared for the elliptic curve"); - } - clearCofactor() { - const { h: cofactor, clearCofactor } = CURVE; - if (cofactor === _1n$7) - return this; - if (clearCofactor) - return clearCofactor(Point2, this); - return this.multiplyUnsafe(CURVE.h); - } - toRawBytes(isCompressed = true) { - this.assertValidity(); - return toBytes3(Point2, this, isCompressed); - } - toHex(isCompressed = true) { - return bytesToHex$1(this.toRawBytes(isCompressed)); - } - } - Point2.BASE = new Point2(CURVE.Gx, CURVE.Gy, Fp2.ONE); - Point2.ZERO = new Point2(Fp2.ZERO, Fp2.ONE, Fp2.ZERO); - const _bits = CURVE.nBitLength; - const wnaf = wNAF$1(Point2, CURVE.endo ? Math.ceil(_bits / 2) : _bits); - return { - CURVE, - ProjectivePoint: Point2, - normPrivateKeyToScalar, - weierstrassEquation, - isWithinCurveOrder - }; -} -function validateOpts$1(curve2) { - const opts = validateBasic$1(curve2); - validateObject$1(opts, { - hash: "hash", - hmac: "function", - randomBytes: "function" - }, { - bits2int: "function", - bits2int_modN: "function", - lowS: "boolean" - }); - return Object.freeze({ lowS: true, ...opts }); -} -function weierstrass$1(curveDef) { - const CURVE = validateOpts$1(curveDef); - const { Fp: Fp2, n: CURVE_ORDER } = CURVE; - const compressedLen = Fp2.BYTES + 1; - const uncompressedLen = 2 * Fp2.BYTES + 1; - function isValidFieldElement(num) { - return _0n$5 < num && num < Fp2.ORDER; - } - function modN(a3) { - return mod$1(a3, CURVE_ORDER); - } - function invN(a3) { - return invert$1(a3, CURVE_ORDER); - } - const { ProjectivePoint: Point2, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder } = weierstrassPoints$1({ - ...CURVE, - toBytes(_c2, point5, isCompressed) { - const a3 = point5.toAffine(); - const x3 = Fp2.toBytes(a3.x); - const cat = concatBytes$2; - if (isCompressed) { - return cat(Uint8Array.from([point5.hasEvenY() ? 2 : 3]), x3); - } else { - return cat(Uint8Array.from([4]), x3, Fp2.toBytes(a3.y)); - } - }, - fromBytes(bytes2) { - const len = bytes2.length; - const head = bytes2[0]; - const tail = bytes2.subarray(1); - if (len === compressedLen && (head === 2 || head === 3)) { - const x3 = bytesToNumberBE$1(tail); - if (!isValidFieldElement(x3)) - throw new Error("Point is not on curve"); - const y22 = weierstrassEquation(x3); - let y3; - try { - y3 = Fp2.sqrt(y22); - } catch (sqrtError) { - const suffix = sqrtError instanceof Error ? ": " + sqrtError.message : ""; - throw new Error("Point is not on curve" + suffix); - } - const isYOdd = (y3 & _1n$7) === _1n$7; - const isHeadOdd = (head & 1) === 1; - if (isHeadOdd !== isYOdd) - y3 = Fp2.neg(y3); - return { x: x3, y: y3 }; - } else if (len === uncompressedLen && head === 4) { - const x3 = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); - const y3 = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); - return { x: x3, y: y3 }; - } else { - throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); - } - } - }); - const numToNByteStr = (num) => bytesToHex$1(numberToBytesBE$1(num, CURVE.nByteLength)); - function isBiggerThanHalfOrder(number2) { - const HALF = CURVE_ORDER >> _1n$7; - return number2 > HALF; - } - function normalizeS(s2) { - return isBiggerThanHalfOrder(s2) ? modN(-s2) : s2; - } - const slcNum = (b2, from2, to2) => bytesToNumberBE$1(b2.slice(from2, to2)); - class Signature2 { - constructor(r2, s2, recovery) { - this.r = r2; - this.s = s2; - this.recovery = recovery; - this.assertValidity(); - } - // pair (bytes of r, bytes of s) - static fromCompact(hex) { - const l2 = CURVE.nByteLength; - hex = ensureBytes$1("compactSignature", hex, l2 * 2); - return new Signature2(slcNum(hex, 0, l2), slcNum(hex, l2, 2 * l2)); - } - // DER encoded ECDSA signature - // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script - static fromDER(hex) { - const { r: r2, s: s2 } = DER$1.toSig(ensureBytes$1("DER", hex)); - return new Signature2(r2, s2); - } - assertValidity() { - if (!isWithinCurveOrder(this.r)) - throw new Error("r must be 0 < r < CURVE.n"); - if (!isWithinCurveOrder(this.s)) - throw new Error("s must be 0 < s < CURVE.n"); - } - addRecoveryBit(recovery) { - return new Signature2(this.r, this.s, recovery); - } - recoverPublicKey(msgHash) { - const { r: r2, s: s2, recovery: rec } = this; - const h4 = bits2int_modN(ensureBytes$1("msgHash", msgHash)); - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error("recovery id invalid"); - const radj = rec === 2 || rec === 3 ? r2 + CURVE.n : r2; - if (radj >= Fp2.ORDER) - throw new Error("recovery id 2 or 3 invalid"); - const prefix = (rec & 1) === 0 ? "02" : "03"; - const R3 = Point2.fromHex(prefix + numToNByteStr(radj)); - const ir2 = invN(radj); - const u1 = modN(-h4 * ir2); - const u2 = modN(s2 * ir2); - const Q2 = Point2.BASE.multiplyAndAddUnsafe(R3, u1, u2); - if (!Q2) - throw new Error("point at infinify"); - Q2.assertValidity(); - return Q2; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - normalizeS() { - return this.hasHighS() ? new Signature2(this.r, modN(-this.s), this.recovery) : this; - } - // DER-encoded - toDERRawBytes() { - return hexToBytes$1(this.toDERHex()); - } - toDERHex() { - return DER$1.hexFromSig({ r: this.r, s: this.s }); - } - // padded bytes of r, then padded bytes of s - toCompactRawBytes() { - return hexToBytes$1(this.toCompactHex()); - } - toCompactHex() { - return numToNByteStr(this.r) + numToNByteStr(this.s); - } - } - const utils2 = { - isValidPrivateKey(privateKey) { - try { - normPrivateKeyToScalar(privateKey); - return true; - } catch (error) { - return false; - } - }, - normPrivateKeyToScalar, - /** - * Produces cryptographically secure private key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - randomPrivateKey: () => { - const length = getMinHashLength$1(CURVE.n); - return mapHashToField$1(CURVE.randomBytes(length), CURVE.n); - }, - /** - * Creates precompute table for an arbitrary EC point. Makes point "cached". - * Allows to massively speed-up `point.multiply(scalar)`. - * @returns cached point - * @example - * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); - * fast.multiply(privKey); // much faster ECDH now - */ - precompute(windowSize = 8, point5 = Point2.BASE) { - point5._setWindowSize(windowSize); - point5.multiply(BigInt(3)); - return point5; - } - }; - function getPublicKey(privateKey, isCompressed = true) { - return Point2.fromPrivateKey(privateKey).toRawBytes(isCompressed); - } - function isProbPub(item) { - const arr = isBytes(item); - const str = typeof item === "string"; - const len = (arr || str) && item.length; - if (arr) - return len === compressedLen || len === uncompressedLen; - if (str) - return len === 2 * compressedLen || len === 2 * uncompressedLen; - if (item instanceof Point2) - return true; - return false; - } - function getSharedSecret(privateA, publicB, isCompressed = true) { - if (isProbPub(privateA)) - throw new Error("first arg must be private key"); - if (!isProbPub(publicB)) - throw new Error("second arg must be public key"); - const b2 = Point2.fromHex(publicB); - return b2.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); - } - const bits2int = CURVE.bits2int || function(bytes2) { - const num = bytesToNumberBE$1(bytes2); - const delta = bytes2.length * 8 - CURVE.nBitLength; - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = CURVE.bits2int_modN || function(bytes2) { - return modN(bits2int(bytes2)); - }; - const ORDER_MASK = bitMask$1(CURVE.nBitLength); - function int2octets(num) { - if (typeof num !== "bigint") - throw new Error("bigint expected"); - if (!(_0n$5 <= num && num < ORDER_MASK)) - throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); - return numberToBytesBE$1(num, CURVE.nByteLength); - } - function prepSig(msgHash, privateKey, opts = defaultSigOpts) { - if (["recovered", "canonical"].some((k2) => k2 in opts)) - throw new Error("sign() legacy options not supported"); - const { hash: hash3, randomBytes: randomBytes2 } = CURVE; - let { lowS, prehash, extraEntropy: ent } = opts; - if (lowS == null) - lowS = true; - msgHash = ensureBytes$1("msgHash", msgHash); - if (prehash) - msgHash = ensureBytes$1("prehashed msgHash", hash3(msgHash)); - const h1int = bits2int_modN(msgHash); - const d4 = normPrivateKeyToScalar(privateKey); - const seedArgs = [int2octets(d4), int2octets(h1int)]; - if (ent != null && ent !== false) { - const e18 = ent === true ? randomBytes2(Fp2.BYTES) : ent; - seedArgs.push(ensureBytes$1("extraEntropy", e18)); - } - const seed = concatBytes$2(...seedArgs); - const m3 = h1int; - function k2sig(kBytes) { - const k2 = bits2int(kBytes); - if (!isWithinCurveOrder(k2)) - return; - const ik2 = invN(k2); - const q2 = Point2.BASE.multiply(k2).toAffine(); - const r2 = modN(q2.x); - if (r2 === _0n$5) - return; - const s2 = modN(ik2 * modN(m3 + r2 * d4)); - if (s2 === _0n$5) - return; - let recovery = (q2.x === r2 ? 0 : 2) | Number(q2.y & _1n$7); - let normS = s2; - if (lowS && isBiggerThanHalfOrder(s2)) { - normS = normalizeS(s2); - recovery ^= 1; - } - return new Signature2(r2, normS, recovery); - } - return { seed, k2sig }; - } - const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; - const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; - function sign6(msgHash, privKey, opts = defaultSigOpts) { - const { seed, k2sig } = prepSig(msgHash, privKey, opts); - const C3 = CURVE; - const drbg = createHmacDrbg$1(C3.hash.outputLen, C3.nByteLength, C3.hmac); - return drbg(seed, k2sig); - } - Point2.BASE._setWindowSize(8); - function verify6(signature2, msgHash, publicKey2, opts = defaultVerOpts) { - var _a3; - const sg2 = signature2; - msgHash = ensureBytes$1("msgHash", msgHash); - publicKey2 = ensureBytes$1("publicKey", publicKey2); - if ("strict" in opts) - throw new Error("options.strict was renamed to lowS"); - const { lowS, prehash } = opts; - let _sig2 = void 0; - let P2; - try { - if (typeof sg2 === "string" || isBytes(sg2)) { - try { - _sig2 = Signature2.fromDER(sg2); - } catch (derError) { - if (!(derError instanceof DER$1.Err)) - throw derError; - _sig2 = Signature2.fromCompact(sg2); - } - } else if (typeof sg2 === "object" && typeof sg2.r === "bigint" && typeof sg2.s === "bigint") { - const { r: r3, s: s3 } = sg2; - _sig2 = new Signature2(r3, s3); - } else { - throw new Error("PARSE"); - } - P2 = Point2.fromHex(publicKey2); - } catch (error) { - if (error.message === "PARSE") - throw new Error(`signature must be Signature instance, Uint8Array or hex string`); - return false; - } - if (lowS && _sig2.hasHighS()) - return false; - if (prehash) - msgHash = CURVE.hash(msgHash); - const { r: r2, s: s2 } = _sig2; - const h4 = bits2int_modN(msgHash); - const is2 = invN(s2); - const u1 = modN(h4 * is2); - const u2 = modN(r2 * is2); - const R3 = (_a3 = Point2.BASE.multiplyAndAddUnsafe(P2, u1, u2)) == null ? void 0 : _a3.toAffine(); - if (!R3) - return false; - const v6 = modN(R3.x); - return v6 === r2; - } - return { - CURVE, - getPublicKey, - getSharedSecret, - sign: sign6, - verify: verify6, - ProjectivePoint: Point2, - Signature: Signature2, - utils: utils2 - }; -} -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -function getHash$1(hash3) { - return { - hash: hash3, - hmac: (key2, ...msgs) => hmac$3(hash3, key2, concatBytes$3(...msgs)), - randomBytes: randomBytes$3 - }; -} -function createCurve$1(curveDef, defHash) { - const create3 = (hash3) => weierstrass$1({ ...curveDef, ...getHash$1(hash3) }); - return Object.freeze({ ...create3(defHash), create: create3 }); -} -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const secp256k1P$1 = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"); -const secp256k1N$1 = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const _1n$6 = BigInt(1); -const _2n$4 = BigInt(2); -const divNearest$1 = (a3, b2) => (a3 + b2 / _2n$4) / b2; -function sqrtMod$1(y3) { - const P2 = secp256k1P$1; - const _3n2 = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = y3 * y3 * y3 % P2; - const b3 = b2 * b2 * y3 % P2; - const b6 = pow2$1(b3, _3n2, P2) * b3 % P2; - const b9 = pow2$1(b6, _3n2, P2) * b3 % P2; - const b11 = pow2$1(b9, _2n$4, P2) * b2 % P2; - const b22 = pow2$1(b11, _11n, P2) * b11 % P2; - const b44 = pow2$1(b22, _22n, P2) * b22 % P2; - const b88 = pow2$1(b44, _44n, P2) * b44 % P2; - const b176 = pow2$1(b88, _88n, P2) * b88 % P2; - const b220 = pow2$1(b176, _44n, P2) * b44 % P2; - const b223 = pow2$1(b220, _3n2, P2) * b3 % P2; - const t1 = pow2$1(b223, _23n, P2) * b22 % P2; - const t2 = pow2$1(t1, _6n, P2) * b2 % P2; - const root = pow2$1(t2, _2n$4, P2); - if (!Fp$1.eql(Fp$1.sqr(root), y3)) - throw new Error("Cannot find square root"); - return root; -} -const Fp$1 = Field$1(secp256k1P$1, void 0, void 0, { sqrt: sqrtMod$1 }); -const secp256k1$2 = createCurve$1({ - a: BigInt(0), - // equation params: a, b - b: BigInt(7), - // Seem to be rigid: bitcointalk.org/index.php?topic=289795.msg3183975#msg3183975 - Fp: Fp$1, - // Field's prime: 2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n - n: secp256k1N$1, - // Curve order, total count of valid points in the field - // Base point (x, y) aka generator point - Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"), - Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"), - h: BigInt(1), - // Cofactor - lowS: true, - // Allow only low-S signatures by default in sign() and verify() - /** - * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 - */ - endo: { - beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"), - splitScalar: (k2) => { - const n4 = secp256k1N$1; - const a1 = BigInt("0x3086d221a7d46bcde86c90e49284eb15"); - const b1 = -_1n$6 * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"); - const a22 = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"); - const b2 = a1; - const POW_2_128 = BigInt("0x100000000000000000000000000000000"); - const c1 = divNearest$1(b2 * k2, n4); - const c2 = divNearest$1(-b1 * k2, n4); - let k1 = mod$1(k2 - c1 * a1 - c2 * a22, n4); - let k22 = mod$1(-c1 * b1 - c2 * b2, n4); - const k1neg = k1 > POW_2_128; - const k2neg = k22 > POW_2_128; - if (k1neg) - k1 = n4 - k1; - if (k2neg) - k22 = n4 - k22; - if (k1 > POW_2_128 || k22 > POW_2_128) { - throw new Error("splitScalar: Endomorphism failed, k=" + k2); - } - return { k1neg, k1, k2neg, k2: k22 }; - } - } -}, sha256$3); -BigInt(0); -secp256k1$2.ProjectivePoint; -ed25519$1.utils.randomPrivateKey; -function isOnCurve(publicKey2) { - try { - ed25519$1.ExtendedPoint.fromHex(publicKey2); - return true; - } catch { - return false; - } -} -const sign = (message2, secretKey) => ed25519$1.sign(message2, secretKey.slice(0, 32)); -const verify = ed25519$1.verify; -const toBuffer = (arr) => { - if (buffer.Buffer.isBuffer(arr)) { - return arr; - } else if (arr instanceof Uint8Array) { - return buffer.Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength); - } else { - return buffer.Buffer.from(arr); - } -}; -class Struct2 { - constructor(properties) { - Object.assign(this, properties); - } - encode() { - return buffer.Buffer.from(serialize_1(SOLANA_SCHEMA, this)); - } - static decode(data) { - return deserialize_1(SOLANA_SCHEMA, this, data); - } - static decodeUnchecked(data) { - return deserializeUnchecked_1(SOLANA_SCHEMA, this, data); - } -} -const SOLANA_SCHEMA = /* @__PURE__ */ new Map(); -var _PublicKey; -const MAX_SEED_LENGTH = 32; -const PUBLIC_KEY_LENGTH = 32; -function isPublicKeyData(value) { - return value._bn !== void 0; -} -let uniquePublicKeyCounter = 1; -class PublicKey extends Struct2 { - /** - * Create a new PublicKey object - * @param value ed25519 public key as buffer or base-58 encoded string - */ - constructor(value) { - super({}); - this._bn = void 0; - if (isPublicKeyData(value)) { - this._bn = value._bn; - } else { - if (typeof value === "string") { - const decoded = bs58$3.decode(value); - if (decoded.length != PUBLIC_KEY_LENGTH) { - throw new Error(`Invalid public key input`); - } - this._bn = new _BN(decoded); - } else { - this._bn = new _BN(value); - } - if (this._bn.byteLength() > PUBLIC_KEY_LENGTH) { - throw new Error(`Invalid public key input`); - } - } - } - /** - * Returns a unique PublicKey for tests and benchmarks using a counter - */ - static unique() { - const key2 = new PublicKey(uniquePublicKeyCounter); - uniquePublicKeyCounter += 1; - return new PublicKey(key2.toBuffer()); - } - /** - * Default public key value. The base58-encoded string representation is all ones (as seen below) - * The underlying BN number is 32 bytes that are all zeros - */ - /** - * Checks if two publicKeys are equal - */ - equals(publicKey2) { - return this._bn.eq(publicKey2._bn); - } - /** - * Return the base-58 representation of the public key - */ - toBase58() { - return bs58$3.encode(this.toBytes()); - } - toJSON() { - return this.toBase58(); - } - /** - * Return the byte array representation of the public key in big endian - */ - toBytes() { - const buf = this.toBuffer(); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); - } - /** - * Return the Buffer representation of the public key in big endian - */ - toBuffer() { - const b2 = this._bn.toArrayLike(buffer.Buffer); - if (b2.length === PUBLIC_KEY_LENGTH) { - return b2; - } - const zeroPad2 = buffer.Buffer.alloc(32); - b2.copy(zeroPad2, 32 - b2.length); - return zeroPad2; - } - get [Symbol.toStringTag]() { - return `PublicKey(${this.toString()})`; - } - /** - * Return the base-58 representation of the public key - */ - toString() { - return this.toBase58(); - } - /** - * Derive a public key from another key, a seed, and a program ID. - * The program ID will also serve as the owner of the public key, giving - * it permission to write data to the account. - */ - /* eslint-disable require-await */ - static async createWithSeed(fromPublicKey, seed, programId) { - const buffer$12 = buffer.Buffer.concat([fromPublicKey.toBuffer(), buffer.Buffer.from(seed), programId.toBuffer()]); - const publicKeyBytes = sha256$3(buffer$12); - return new PublicKey(publicKeyBytes); - } - /** - * Derive a program address from seeds and a program ID. - */ - /* eslint-disable require-await */ - static createProgramAddressSync(seeds, programId) { - let buffer$12 = buffer.Buffer.alloc(0); - seeds.forEach(function(seed) { - if (seed.length > MAX_SEED_LENGTH) { - throw new TypeError(`Max seed length exceeded`); - } - buffer$12 = buffer.Buffer.concat([buffer$12, toBuffer(seed)]); - }); - buffer$12 = buffer.Buffer.concat([buffer$12, programId.toBuffer(), buffer.Buffer.from("ProgramDerivedAddress")]); - const publicKeyBytes = sha256$3(buffer$12); - if (isOnCurve(publicKeyBytes)) { - throw new Error(`Invalid seeds, address must fall off the curve`); - } - return new PublicKey(publicKeyBytes); - } - /** - * Async version of createProgramAddressSync - * For backwards compatibility - * - * @deprecated Use {@link createProgramAddressSync} instead - */ - /* eslint-disable require-await */ - static async createProgramAddress(seeds, programId) { - return this.createProgramAddressSync(seeds, programId); - } - /** - * Find a valid program address - * - * Valid program addresses must fall off the ed25519 curve. This function - * iterates a nonce until it finds one that when combined with the seeds - * results in a valid program address. - */ - static findProgramAddressSync(seeds, programId) { - let nonce = 255; - let address2; - while (nonce != 0) { - try { - const seedsWithNonce = seeds.concat(buffer.Buffer.from([nonce])); - address2 = this.createProgramAddressSync(seedsWithNonce, programId); - } catch (err) { - if (err instanceof TypeError) { - throw err; - } - nonce--; - continue; - } - return [address2, nonce]; - } - throw new Error(`Unable to find a viable program address nonce`); - } - /** - * Async version of findProgramAddressSync - * For backwards compatibility - * - * @deprecated Use {@link findProgramAddressSync} instead - */ - static async findProgramAddress(seeds, programId) { - return this.findProgramAddressSync(seeds, programId); - } - /** - * Check that a pubkey is on the ed25519 curve. - */ - static isOnCurve(pubkeyData) { - const pubkey = new PublicKey(pubkeyData); - return isOnCurve(pubkey.toBytes()); - } -} -_PublicKey = PublicKey; -PublicKey.default = new _PublicKey("11111111111111111111111111111111"); -SOLANA_SCHEMA.set(PublicKey, { - kind: "struct", - fields: [["_bn", "u256"]] -}); -new PublicKey("BPFLoader1111111111111111111111111111111111"); -const PACKET_DATA_SIZE = 1280 - 40 - 8; -const VERSION_PREFIX_MASK = 127; -const SIGNATURE_LENGTH_IN_BYTES$1 = 64; -class TransactionExpiredBlockheightExceededError extends Error { - constructor(signature2) { - super(`Signature ${signature2} has expired: block height exceeded.`); - this.signature = void 0; - this.signature = signature2; - } -} -Object.defineProperty(TransactionExpiredBlockheightExceededError.prototype, "name", { - value: "TransactionExpiredBlockheightExceededError" -}); -class TransactionExpiredTimeoutError extends Error { - constructor(signature2, timeoutSeconds) { - super(`Transaction was not confirmed in ${timeoutSeconds.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${signature2} using the Solana Explorer or CLI tools.`); - this.signature = void 0; - this.signature = signature2; - } -} -Object.defineProperty(TransactionExpiredTimeoutError.prototype, "name", { - value: "TransactionExpiredTimeoutError" -}); -class TransactionExpiredNonceInvalidError extends Error { - constructor(signature2) { - super(`Signature ${signature2} has expired: the nonce is no longer valid.`); - this.signature = void 0; - this.signature = signature2; - } -} -Object.defineProperty(TransactionExpiredNonceInvalidError.prototype, "name", { - value: "TransactionExpiredNonceInvalidError" -}); -class MessageAccountKeys { - constructor(staticAccountKeys, accountKeysFromLookups) { - this.staticAccountKeys = void 0; - this.accountKeysFromLookups = void 0; - this.staticAccountKeys = staticAccountKeys; - this.accountKeysFromLookups = accountKeysFromLookups; - } - keySegments() { - const keySegments = [this.staticAccountKeys]; - if (this.accountKeysFromLookups) { - keySegments.push(this.accountKeysFromLookups.writable); - keySegments.push(this.accountKeysFromLookups.readonly); - } - return keySegments; - } - get(index2) { - for (const keySegment of this.keySegments()) { - if (index2 < keySegment.length) { - return keySegment[index2]; - } else { - index2 -= keySegment.length; - } - } - return; - } - get length() { - return this.keySegments().flat().length; - } - compileInstructions(instructions) { - const U8_MAX = 255; - if (this.length > U8_MAX + 1) { - throw new Error("Account index overflow encountered during compilation"); - } - const keyIndexMap = /* @__PURE__ */ new Map(); - this.keySegments().flat().forEach((key2, index2) => { - keyIndexMap.set(key2.toBase58(), index2); - }); - const findKeyIndex = (key2) => { - const keyIndex = keyIndexMap.get(key2.toBase58()); - if (keyIndex === void 0) - throw new Error("Encountered an unknown instruction account key during compilation"); - return keyIndex; - }; - return instructions.map((instruction) => { - return { - programIdIndex: findKeyIndex(instruction.programId), - accountKeyIndexes: instruction.keys.map((meta) => findKeyIndex(meta.pubkey)), - data: instruction.data - }; - }); - } -} -const publicKey = (property = "publicKey") => { - return blob(32, property); -}; -const signature$2 = (property = "signature") => { - return blob(64, property); -}; -const rustString = (property = "string") => { - const rsl = struct([u32$1("length"), u32$1("lengthPadding"), blob(offset(u32$1(), -8), "chars")], property); - const _decode2 = rsl.decode.bind(rsl); - const _encode4 = rsl.encode.bind(rsl); - const rslShim = rsl; - rslShim.decode = (b2, offset2) => { - const data = _decode2(b2, offset2); - return data["chars"].toString(); - }; - rslShim.encode = (str, b2, offset2) => { - const data = { - chars: buffer.Buffer.from(str, "utf8") - }; - return _encode4(data, b2, offset2); - }; - rslShim.alloc = (str) => { - return u32$1().span + u32$1().span + buffer.Buffer.from(str, "utf8").length; - }; - return rslShim; -}; -const authorized = (property = "authorized") => { - return struct([publicKey("staker"), publicKey("withdrawer")], property); -}; -const lockup = (property = "lockup") => { - return struct([ns64("unixTimestamp"), ns64("epoch"), publicKey("custodian")], property); -}; -const voteInit = (property = "voteInit") => { - return struct([publicKey("nodePubkey"), publicKey("authorizedVoter"), publicKey("authorizedWithdrawer"), u8("commission")], property); -}; -const voteAuthorizeWithSeedArgs = (property = "voteAuthorizeWithSeedArgs") => { - return struct([u32$1("voteAuthorizationType"), publicKey("currentAuthorityDerivedKeyOwnerPubkey"), rustString("currentAuthorityDerivedKeySeed"), publicKey("newAuthorized")], property); -}; -function decodeLength(bytes2) { - let len = 0; - let size2 = 0; - for (; ; ) { - let elem = bytes2.shift(); - len |= (elem & 127) << size2 * 7; - size2 += 1; - if ((elem & 128) === 0) { - break; - } - } - return len; -} -function encodeLength(bytes2, len) { - let rem_len = len; - for (; ; ) { - let elem = rem_len & 127; - rem_len >>= 7; - if (rem_len == 0) { - bytes2.push(elem); - break; - } else { - elem |= 128; - bytes2.push(elem); - } - } -} -function assert$b(condition, message2) { - if (!condition) { - throw new Error(message2 || "Assertion failed"); - } -} -class CompiledKeys { - constructor(payer, keyMetaMap) { - this.payer = void 0; - this.keyMetaMap = void 0; - this.payer = payer; - this.keyMetaMap = keyMetaMap; - } - static compile(instructions, payer) { - const keyMetaMap = /* @__PURE__ */ new Map(); - const getOrInsertDefault = (pubkey) => { - const address2 = pubkey.toBase58(); - let keyMeta = keyMetaMap.get(address2); - if (keyMeta === void 0) { - keyMeta = { - isSigner: false, - isWritable: false, - isInvoked: false - }; - keyMetaMap.set(address2, keyMeta); - } - return keyMeta; - }; - const payerKeyMeta = getOrInsertDefault(payer); - payerKeyMeta.isSigner = true; - payerKeyMeta.isWritable = true; - for (const ix of instructions) { - getOrInsertDefault(ix.programId).isInvoked = true; - for (const accountMeta of ix.keys) { - const keyMeta = getOrInsertDefault(accountMeta.pubkey); - keyMeta.isSigner || (keyMeta.isSigner = accountMeta.isSigner); - keyMeta.isWritable || (keyMeta.isWritable = accountMeta.isWritable); - } - } - return new CompiledKeys(payer, keyMetaMap); - } - getMessageComponents() { - const mapEntries = [...this.keyMetaMap.entries()]; - assert$b(mapEntries.length <= 256, "Max static account keys length exceeded"); - const writableSigners = mapEntries.filter(([, meta]) => meta.isSigner && meta.isWritable); - const readonlySigners = mapEntries.filter(([, meta]) => meta.isSigner && !meta.isWritable); - const writableNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && meta.isWritable); - const readonlyNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && !meta.isWritable); - const header = { - numRequiredSignatures: writableSigners.length + readonlySigners.length, - numReadonlySignedAccounts: readonlySigners.length, - numReadonlyUnsignedAccounts: readonlyNonSigners.length - }; - { - assert$b(writableSigners.length > 0, "Expected at least one writable signer key"); - const [payerAddress] = writableSigners[0]; - assert$b(payerAddress === this.payer.toBase58(), "Expected first writable signer key to be the fee payer"); - } - const staticAccountKeys = [...writableSigners.map(([address2]) => new PublicKey(address2)), ...readonlySigners.map(([address2]) => new PublicKey(address2)), ...writableNonSigners.map(([address2]) => new PublicKey(address2)), ...readonlyNonSigners.map(([address2]) => new PublicKey(address2))]; - return [header, staticAccountKeys]; - } - extractTableLookup(lookupTable) { - const [writableIndexes, drainedWritableKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, (keyMeta) => !keyMeta.isSigner && !keyMeta.isInvoked && keyMeta.isWritable); - const [readonlyIndexes, drainedReadonlyKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, (keyMeta) => !keyMeta.isSigner && !keyMeta.isInvoked && !keyMeta.isWritable); - if (writableIndexes.length === 0 && readonlyIndexes.length === 0) { - return; - } - return [{ - accountKey: lookupTable.key, - writableIndexes, - readonlyIndexes - }, { - writable: drainedWritableKeys, - readonly: drainedReadonlyKeys - }]; - } - /** @internal */ - drainKeysFoundInLookupTable(lookupTableEntries, keyMetaFilter) { - const lookupTableIndexes = new Array(); - const drainedKeys = new Array(); - for (const [address2, keyMeta] of this.keyMetaMap.entries()) { - if (keyMetaFilter(keyMeta)) { - const key2 = new PublicKey(address2); - const lookupTableIndex = lookupTableEntries.findIndex((entry) => entry.equals(key2)); - if (lookupTableIndex >= 0) { - assert$b(lookupTableIndex < 256, "Max lookup table index exceeded"); - lookupTableIndexes.push(lookupTableIndex); - drainedKeys.push(key2); - this.keyMetaMap.delete(address2); - } - } - } - return [lookupTableIndexes, drainedKeys]; - } -} -const END_OF_BUFFER_ERROR_MESSAGE = "Reached end of buffer unexpectedly"; -function guardedShift(byteArray) { - if (byteArray.length === 0) { - throw new Error(END_OF_BUFFER_ERROR_MESSAGE); - } - return byteArray.shift(); -} -function guardedSplice(byteArray, ...args) { - const [start] = args; - if (args.length === 2 ? start + (args[1] ?? 0) > byteArray.length : start >= byteArray.length) { - throw new Error(END_OF_BUFFER_ERROR_MESSAGE); - } - return byteArray.splice(...args); -} -class Message { - constructor(args) { - this.header = void 0; - this.accountKeys = void 0; - this.recentBlockhash = void 0; - this.instructions = void 0; - this.indexToProgramIds = /* @__PURE__ */ new Map(); - this.header = args.header; - this.accountKeys = args.accountKeys.map((account) => new PublicKey(account)); - this.recentBlockhash = args.recentBlockhash; - this.instructions = args.instructions; - this.instructions.forEach((ix) => this.indexToProgramIds.set(ix.programIdIndex, this.accountKeys[ix.programIdIndex])); - } - get version() { - return "legacy"; - } - get staticAccountKeys() { - return this.accountKeys; - } - get compiledInstructions() { - return this.instructions.map((ix) => ({ - programIdIndex: ix.programIdIndex, - accountKeyIndexes: ix.accounts, - data: bs58$3.decode(ix.data) - })); - } - get addressTableLookups() { - return []; - } - getAccountKeys() { - return new MessageAccountKeys(this.staticAccountKeys); - } - static compile(args) { - const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey); - const [header, staticAccountKeys] = compiledKeys.getMessageComponents(); - const accountKeys = new MessageAccountKeys(staticAccountKeys); - const instructions = accountKeys.compileInstructions(args.instructions).map((ix) => ({ - programIdIndex: ix.programIdIndex, - accounts: ix.accountKeyIndexes, - data: bs58$3.encode(ix.data) - })); - return new Message({ - header, - accountKeys: staticAccountKeys, - recentBlockhash: args.recentBlockhash, - instructions - }); - } - isAccountSigner(index2) { - return index2 < this.header.numRequiredSignatures; - } - isAccountWritable(index2) { - const numSignedAccounts = this.header.numRequiredSignatures; - if (index2 >= this.header.numRequiredSignatures) { - const unsignedAccountIndex = index2 - numSignedAccounts; - const numUnsignedAccounts = this.accountKeys.length - numSignedAccounts; - const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts; - return unsignedAccountIndex < numWritableUnsignedAccounts; - } else { - const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts; - return index2 < numWritableSignedAccounts; - } - } - isProgramId(index2) { - return this.indexToProgramIds.has(index2); - } - programIds() { - return [...this.indexToProgramIds.values()]; - } - nonProgramIds() { - return this.accountKeys.filter((_3, index2) => !this.isProgramId(index2)); - } - serialize() { - const numKeys = this.accountKeys.length; - let keyCount = []; - encodeLength(keyCount, numKeys); - const instructions = this.instructions.map((instruction) => { - const { - accounts: accounts2, - programIdIndex - } = instruction; - const data = Array.from(bs58$3.decode(instruction.data)); - let keyIndicesCount = []; - encodeLength(keyIndicesCount, accounts2.length); - let dataCount = []; - encodeLength(dataCount, data.length); - return { - programIdIndex, - keyIndicesCount: buffer.Buffer.from(keyIndicesCount), - keyIndices: accounts2, - dataLength: buffer.Buffer.from(dataCount), - data - }; - }); - let instructionCount = []; - encodeLength(instructionCount, instructions.length); - let instructionBuffer = buffer.Buffer.alloc(PACKET_DATA_SIZE); - buffer.Buffer.from(instructionCount).copy(instructionBuffer); - let instructionBufferLength = instructionCount.length; - instructions.forEach((instruction) => { - const instructionLayout = struct([u8("programIdIndex"), blob(instruction.keyIndicesCount.length, "keyIndicesCount"), seq(u8("keyIndex"), instruction.keyIndices.length, "keyIndices"), blob(instruction.dataLength.length, "dataLength"), seq(u8("userdatum"), instruction.data.length, "data")]); - const length2 = instructionLayout.encode(instruction, instructionBuffer, instructionBufferLength); - instructionBufferLength += length2; - }); - instructionBuffer = instructionBuffer.slice(0, instructionBufferLength); - const signDataLayout = struct([blob(1, "numRequiredSignatures"), blob(1, "numReadonlySignedAccounts"), blob(1, "numReadonlyUnsignedAccounts"), blob(keyCount.length, "keyCount"), seq(publicKey("key"), numKeys, "keys"), publicKey("recentBlockhash")]); - const transaction2 = { - numRequiredSignatures: buffer.Buffer.from([this.header.numRequiredSignatures]), - numReadonlySignedAccounts: buffer.Buffer.from([this.header.numReadonlySignedAccounts]), - numReadonlyUnsignedAccounts: buffer.Buffer.from([this.header.numReadonlyUnsignedAccounts]), - keyCount: buffer.Buffer.from(keyCount), - keys: this.accountKeys.map((key2) => toBuffer(key2.toBytes())), - recentBlockhash: bs58$3.decode(this.recentBlockhash) - }; - let signData = buffer.Buffer.alloc(2048); - const length = signDataLayout.encode(transaction2, signData); - instructionBuffer.copy(signData, length); - return signData.slice(0, length + instructionBuffer.length); - } - /** - * Decode a compiled message into a Message object. - */ - static from(buffer$12) { - let byteArray = [...buffer$12]; - const numRequiredSignatures = guardedShift(byteArray); - if (numRequiredSignatures !== (numRequiredSignatures & VERSION_PREFIX_MASK)) { - throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()"); - } - const numReadonlySignedAccounts = guardedShift(byteArray); - const numReadonlyUnsignedAccounts = guardedShift(byteArray); - const accountCount = decodeLength(byteArray); - let accountKeys = []; - for (let i3 = 0; i3 < accountCount; i3++) { - const account = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH); - accountKeys.push(new PublicKey(buffer.Buffer.from(account))); - } - const recentBlockhash = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH); - const instructionCount = decodeLength(byteArray); - let instructions = []; - for (let i3 = 0; i3 < instructionCount; i3++) { - const programIdIndex = guardedShift(byteArray); - const accountCount2 = decodeLength(byteArray); - const accounts2 = guardedSplice(byteArray, 0, accountCount2); - const dataLength2 = decodeLength(byteArray); - const dataSlice2 = guardedSplice(byteArray, 0, dataLength2); - const data = bs58$3.encode(buffer.Buffer.from(dataSlice2)); - instructions.push({ - programIdIndex, - accounts: accounts2, - data - }); - } - const messageArgs = { - header: { - numRequiredSignatures, - numReadonlySignedAccounts, - numReadonlyUnsignedAccounts - }, - recentBlockhash: bs58$3.encode(buffer.Buffer.from(recentBlockhash)), - accountKeys, - instructions - }; - return new Message(messageArgs); - } -} -class MessageV0 { - constructor(args) { - this.header = void 0; - this.staticAccountKeys = void 0; - this.recentBlockhash = void 0; - this.compiledInstructions = void 0; - this.addressTableLookups = void 0; - this.header = args.header; - this.staticAccountKeys = args.staticAccountKeys; - this.recentBlockhash = args.recentBlockhash; - this.compiledInstructions = args.compiledInstructions; - this.addressTableLookups = args.addressTableLookups; - } - get version() { - return 0; - } - get numAccountKeysFromLookups() { - let count = 0; - for (const lookup2 of this.addressTableLookups) { - count += lookup2.readonlyIndexes.length + lookup2.writableIndexes.length; - } - return count; - } - getAccountKeys(args) { - let accountKeysFromLookups; - if (args && "accountKeysFromLookups" in args && args.accountKeysFromLookups) { - if (this.numAccountKeysFromLookups != args.accountKeysFromLookups.writable.length + args.accountKeysFromLookups.readonly.length) { - throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups"); - } - accountKeysFromLookups = args.accountKeysFromLookups; - } else if (args && "addressLookupTableAccounts" in args && args.addressLookupTableAccounts) { - accountKeysFromLookups = this.resolveAddressTableLookups(args.addressLookupTableAccounts); - } else if (this.addressTableLookups.length > 0) { - throw new Error("Failed to get account keys because address table lookups were not resolved"); - } - return new MessageAccountKeys(this.staticAccountKeys, accountKeysFromLookups); - } - isAccountSigner(index2) { - return index2 < this.header.numRequiredSignatures; - } - isAccountWritable(index2) { - const numSignedAccounts = this.header.numRequiredSignatures; - const numStaticAccountKeys = this.staticAccountKeys.length; - if (index2 >= numStaticAccountKeys) { - const lookupAccountKeysIndex = index2 - numStaticAccountKeys; - const numWritableLookupAccountKeys = this.addressTableLookups.reduce((count, lookup2) => count + lookup2.writableIndexes.length, 0); - return lookupAccountKeysIndex < numWritableLookupAccountKeys; - } else if (index2 >= this.header.numRequiredSignatures) { - const unsignedAccountIndex = index2 - numSignedAccounts; - const numUnsignedAccounts = numStaticAccountKeys - numSignedAccounts; - const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts; - return unsignedAccountIndex < numWritableUnsignedAccounts; - } else { - const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts; - return index2 < numWritableSignedAccounts; - } - } - resolveAddressTableLookups(addressLookupTableAccounts) { - const accountKeysFromLookups = { - writable: [], - readonly: [] - }; - for (const tableLookup of this.addressTableLookups) { - const tableAccount = addressLookupTableAccounts.find((account) => account.key.equals(tableLookup.accountKey)); - if (!tableAccount) { - throw new Error(`Failed to find address lookup table account for table key ${tableLookup.accountKey.toBase58()}`); - } - for (const index2 of tableLookup.writableIndexes) { - if (index2 < tableAccount.state.addresses.length) { - accountKeysFromLookups.writable.push(tableAccount.state.addresses[index2]); - } else { - throw new Error(`Failed to find address for index ${index2} in address lookup table ${tableLookup.accountKey.toBase58()}`); - } - } - for (const index2 of tableLookup.readonlyIndexes) { - if (index2 < tableAccount.state.addresses.length) { - accountKeysFromLookups.readonly.push(tableAccount.state.addresses[index2]); - } else { - throw new Error(`Failed to find address for index ${index2} in address lookup table ${tableLookup.accountKey.toBase58()}`); - } - } - } - return accountKeysFromLookups; - } - static compile(args) { - const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey); - const addressTableLookups = new Array(); - const accountKeysFromLookups = { - writable: new Array(), - readonly: new Array() - }; - const lookupTableAccounts = args.addressLookupTableAccounts || []; - for (const lookupTable of lookupTableAccounts) { - const extractResult = compiledKeys.extractTableLookup(lookupTable); - if (extractResult !== void 0) { - const [addressTableLookup, { - writable, - readonly - }] = extractResult; - addressTableLookups.push(addressTableLookup); - accountKeysFromLookups.writable.push(...writable); - accountKeysFromLookups.readonly.push(...readonly); - } - } - const [header, staticAccountKeys] = compiledKeys.getMessageComponents(); - const accountKeys = new MessageAccountKeys(staticAccountKeys, accountKeysFromLookups); - const compiledInstructions = accountKeys.compileInstructions(args.instructions); - return new MessageV0({ - header, - staticAccountKeys, - recentBlockhash: args.recentBlockhash, - compiledInstructions, - addressTableLookups - }); - } - serialize() { - const encodedStaticAccountKeysLength = Array(); - encodeLength(encodedStaticAccountKeysLength, this.staticAccountKeys.length); - const serializedInstructions = this.serializeInstructions(); - const encodedInstructionsLength = Array(); - encodeLength(encodedInstructionsLength, this.compiledInstructions.length); - const serializedAddressTableLookups = this.serializeAddressTableLookups(); - const encodedAddressTableLookupsLength = Array(); - encodeLength(encodedAddressTableLookupsLength, this.addressTableLookups.length); - const messageLayout = struct([u8("prefix"), struct([u8("numRequiredSignatures"), u8("numReadonlySignedAccounts"), u8("numReadonlyUnsignedAccounts")], "header"), blob(encodedStaticAccountKeysLength.length, "staticAccountKeysLength"), seq(publicKey(), this.staticAccountKeys.length, "staticAccountKeys"), publicKey("recentBlockhash"), blob(encodedInstructionsLength.length, "instructionsLength"), blob(serializedInstructions.length, "serializedInstructions"), blob(encodedAddressTableLookupsLength.length, "addressTableLookupsLength"), blob(serializedAddressTableLookups.length, "serializedAddressTableLookups")]); - const serializedMessage = new Uint8Array(PACKET_DATA_SIZE); - const MESSAGE_VERSION_0_PREFIX = 1 << 7; - const serializedMessageLength = messageLayout.encode({ - prefix: MESSAGE_VERSION_0_PREFIX, - header: this.header, - staticAccountKeysLength: new Uint8Array(encodedStaticAccountKeysLength), - staticAccountKeys: this.staticAccountKeys.map((key2) => key2.toBytes()), - recentBlockhash: bs58$3.decode(this.recentBlockhash), - instructionsLength: new Uint8Array(encodedInstructionsLength), - serializedInstructions, - addressTableLookupsLength: new Uint8Array(encodedAddressTableLookupsLength), - serializedAddressTableLookups - }, serializedMessage); - return serializedMessage.slice(0, serializedMessageLength); - } - serializeInstructions() { - let serializedLength = 0; - const serializedInstructions = new Uint8Array(PACKET_DATA_SIZE); - for (const instruction of this.compiledInstructions) { - const encodedAccountKeyIndexesLength = Array(); - encodeLength(encodedAccountKeyIndexesLength, instruction.accountKeyIndexes.length); - const encodedDataLength = Array(); - encodeLength(encodedDataLength, instruction.data.length); - const instructionLayout = struct([u8("programIdIndex"), blob(encodedAccountKeyIndexesLength.length, "encodedAccountKeyIndexesLength"), seq(u8(), instruction.accountKeyIndexes.length, "accountKeyIndexes"), blob(encodedDataLength.length, "encodedDataLength"), blob(instruction.data.length, "data")]); - serializedLength += instructionLayout.encode({ - programIdIndex: instruction.programIdIndex, - encodedAccountKeyIndexesLength: new Uint8Array(encodedAccountKeyIndexesLength), - accountKeyIndexes: instruction.accountKeyIndexes, - encodedDataLength: new Uint8Array(encodedDataLength), - data: instruction.data - }, serializedInstructions, serializedLength); - } - return serializedInstructions.slice(0, serializedLength); - } - serializeAddressTableLookups() { - let serializedLength = 0; - const serializedAddressTableLookups = new Uint8Array(PACKET_DATA_SIZE); - for (const lookup2 of this.addressTableLookups) { - const encodedWritableIndexesLength = Array(); - encodeLength(encodedWritableIndexesLength, lookup2.writableIndexes.length); - const encodedReadonlyIndexesLength = Array(); - encodeLength(encodedReadonlyIndexesLength, lookup2.readonlyIndexes.length); - const addressTableLookupLayout = struct([publicKey("accountKey"), blob(encodedWritableIndexesLength.length, "encodedWritableIndexesLength"), seq(u8(), lookup2.writableIndexes.length, "writableIndexes"), blob(encodedReadonlyIndexesLength.length, "encodedReadonlyIndexesLength"), seq(u8(), lookup2.readonlyIndexes.length, "readonlyIndexes")]); - serializedLength += addressTableLookupLayout.encode({ - accountKey: lookup2.accountKey.toBytes(), - encodedWritableIndexesLength: new Uint8Array(encodedWritableIndexesLength), - writableIndexes: lookup2.writableIndexes, - encodedReadonlyIndexesLength: new Uint8Array(encodedReadonlyIndexesLength), - readonlyIndexes: lookup2.readonlyIndexes - }, serializedAddressTableLookups, serializedLength); - } - return serializedAddressTableLookups.slice(0, serializedLength); - } - static deserialize(serializedMessage) { - let byteArray = [...serializedMessage]; - const prefix = guardedShift(byteArray); - const maskedPrefix = prefix & VERSION_PREFIX_MASK; - assert$b(prefix !== maskedPrefix, `Expected versioned message but received legacy message`); - const version2 = maskedPrefix; - assert$b(version2 === 0, `Expected versioned message with version 0 but found version ${version2}`); - const header = { - numRequiredSignatures: guardedShift(byteArray), - numReadonlySignedAccounts: guardedShift(byteArray), - numReadonlyUnsignedAccounts: guardedShift(byteArray) - }; - const staticAccountKeys = []; - const staticAccountKeysLength = decodeLength(byteArray); - for (let i3 = 0; i3 < staticAccountKeysLength; i3++) { - staticAccountKeys.push(new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH))); - } - const recentBlockhash = bs58$3.encode(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH)); - const instructionCount = decodeLength(byteArray); - const compiledInstructions = []; - for (let i3 = 0; i3 < instructionCount; i3++) { - const programIdIndex = guardedShift(byteArray); - const accountKeyIndexesLength = decodeLength(byteArray); - const accountKeyIndexes = guardedSplice(byteArray, 0, accountKeyIndexesLength); - const dataLength2 = decodeLength(byteArray); - const data = new Uint8Array(guardedSplice(byteArray, 0, dataLength2)); - compiledInstructions.push({ - programIdIndex, - accountKeyIndexes, - data - }); - } - const addressTableLookupsCount = decodeLength(byteArray); - const addressTableLookups = []; - for (let i3 = 0; i3 < addressTableLookupsCount; i3++) { - const accountKey = new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH)); - const writableIndexesLength = decodeLength(byteArray); - const writableIndexes = guardedSplice(byteArray, 0, writableIndexesLength); - const readonlyIndexesLength = decodeLength(byteArray); - const readonlyIndexes = guardedSplice(byteArray, 0, readonlyIndexesLength); - addressTableLookups.push({ - accountKey, - writableIndexes, - readonlyIndexes - }); - } - return new MessageV0({ - header, - staticAccountKeys, - recentBlockhash, - compiledInstructions, - addressTableLookups - }); - } -} -const VersionedMessage = { - deserializeMessageVersion(serializedMessage) { - const prefix = serializedMessage[0]; - const maskedPrefix = prefix & VERSION_PREFIX_MASK; - if (maskedPrefix === prefix) { - return "legacy"; - } - return maskedPrefix; - }, - deserialize: (serializedMessage) => { - const version2 = VersionedMessage.deserializeMessageVersion(serializedMessage); - if (version2 === "legacy") { - return Message.from(serializedMessage); - } - if (version2 === 0) { - return MessageV0.deserialize(serializedMessage); - } else { - throw new Error(`Transaction message version ${version2} deserialization is not supported`); - } - } -}; -let TransactionStatus = /* @__PURE__ */ function(TransactionStatus2) { - TransactionStatus2[TransactionStatus2["BLOCKHEIGHT_EXCEEDED"] = 0] = "BLOCKHEIGHT_EXCEEDED"; - TransactionStatus2[TransactionStatus2["PROCESSED"] = 1] = "PROCESSED"; - TransactionStatus2[TransactionStatus2["TIMED_OUT"] = 2] = "TIMED_OUT"; - TransactionStatus2[TransactionStatus2["NONCE_INVALID"] = 3] = "NONCE_INVALID"; - return TransactionStatus2; -}({}); -const DEFAULT_SIGNATURE = buffer.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES$1).fill(0); -class TransactionInstruction { - constructor(opts) { - this.keys = void 0; - this.programId = void 0; - this.data = buffer.Buffer.alloc(0); - this.programId = opts.programId; - this.keys = opts.keys; - if (opts.data) { - this.data = opts.data; - } - } - /** - * @internal - */ - toJSON() { - return { - keys: this.keys.map(({ - pubkey, - isSigner, - isWritable - }) => ({ - pubkey: pubkey.toJSON(), - isSigner, - isWritable - })), - programId: this.programId.toJSON(), - data: [...this.data] - }; - } -} -let Transaction$2 = class Transaction { - /** - * The first (payer) Transaction signature - * - * @returns {Buffer | null} Buffer of payer's signature - */ - get signature() { - if (this.signatures.length > 0) { - return this.signatures[0].signature; - } - return null; - } - /** - * The transaction fee payer - */ - // Construct a transaction with a blockhash and lastValidBlockHeight - // Construct a transaction using a durable nonce - /** - * @deprecated `TransactionCtorFields` has been deprecated and will be removed in a future version. - * Please supply a `TransactionBlockhashCtor` instead. - */ - /** - * Construct an empty Transaction - */ - constructor(opts) { - this.signatures = []; - this.feePayer = void 0; - this.instructions = []; - this.recentBlockhash = void 0; - this.lastValidBlockHeight = void 0; - this.nonceInfo = void 0; - this.minNonceContextSlot = void 0; - this._message = void 0; - this._json = void 0; - if (!opts) { - return; - } - if (opts.feePayer) { - this.feePayer = opts.feePayer; - } - if (opts.signatures) { - this.signatures = opts.signatures; - } - if (Object.prototype.hasOwnProperty.call(opts, "nonceInfo")) { - const { - minContextSlot, - nonceInfo - } = opts; - this.minNonceContextSlot = minContextSlot; - this.nonceInfo = nonceInfo; - } else if (Object.prototype.hasOwnProperty.call(opts, "lastValidBlockHeight")) { - const { - blockhash, - lastValidBlockHeight - } = opts; - this.recentBlockhash = blockhash; - this.lastValidBlockHeight = lastValidBlockHeight; - } else { - const { - recentBlockhash, - nonceInfo - } = opts; - if (nonceInfo) { - this.nonceInfo = nonceInfo; - } - this.recentBlockhash = recentBlockhash; - } - } - /** - * @internal - */ - toJSON() { - return { - recentBlockhash: this.recentBlockhash || null, - feePayer: this.feePayer ? this.feePayer.toJSON() : null, - nonceInfo: this.nonceInfo ? { - nonce: this.nonceInfo.nonce, - nonceInstruction: this.nonceInfo.nonceInstruction.toJSON() - } : null, - instructions: this.instructions.map((instruction) => instruction.toJSON()), - signers: this.signatures.map(({ - publicKey: publicKey2 - }) => { - return publicKey2.toJSON(); - }) - }; - } - /** - * Add one or more instructions to this Transaction - * - * @param {Array< Transaction | TransactionInstruction | TransactionInstructionCtorFields >} items - Instructions to add to the Transaction - */ - add(...items) { - if (items.length === 0) { - throw new Error("No instructions"); - } - items.forEach((item) => { - if ("instructions" in item) { - this.instructions = this.instructions.concat(item.instructions); - } else if ("data" in item && "programId" in item && "keys" in item) { - this.instructions.push(item); - } else { - this.instructions.push(new TransactionInstruction(item)); - } - }); - return this; - } - /** - * Compile transaction data - */ - compileMessage() { - if (this._message && JSON.stringify(this.toJSON()) === JSON.stringify(this._json)) { - return this._message; - } - let recentBlockhash; - let instructions; - if (this.nonceInfo) { - recentBlockhash = this.nonceInfo.nonce; - if (this.instructions[0] != this.nonceInfo.nonceInstruction) { - instructions = [this.nonceInfo.nonceInstruction, ...this.instructions]; - } else { - instructions = this.instructions; - } - } else { - recentBlockhash = this.recentBlockhash; - instructions = this.instructions; - } - if (!recentBlockhash) { - throw new Error("Transaction recentBlockhash required"); - } - if (instructions.length < 1) { - console.warn("No instructions provided"); - } - let feePayer; - if (this.feePayer) { - feePayer = this.feePayer; - } else if (this.signatures.length > 0 && this.signatures[0].publicKey) { - feePayer = this.signatures[0].publicKey; - } else { - throw new Error("Transaction fee payer required"); - } - for (let i3 = 0; i3 < instructions.length; i3++) { - if (instructions[i3].programId === void 0) { - throw new Error(`Transaction instruction index ${i3} has undefined program id`); - } - } - const programIds = []; - const accountMetas = []; - instructions.forEach((instruction) => { - instruction.keys.forEach((accountMeta) => { - accountMetas.push({ - ...accountMeta - }); - }); - const programId = instruction.programId.toString(); - if (!programIds.includes(programId)) { - programIds.push(programId); - } - }); - programIds.forEach((programId) => { - accountMetas.push({ - pubkey: new PublicKey(programId), - isSigner: false, - isWritable: false - }); - }); - const uniqueMetas = []; - accountMetas.forEach((accountMeta) => { - const pubkeyString = accountMeta.pubkey.toString(); - const uniqueIndex = uniqueMetas.findIndex((x3) => { - return x3.pubkey.toString() === pubkeyString; - }); - if (uniqueIndex > -1) { - uniqueMetas[uniqueIndex].isWritable = uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable; - uniqueMetas[uniqueIndex].isSigner = uniqueMetas[uniqueIndex].isSigner || accountMeta.isSigner; - } else { - uniqueMetas.push(accountMeta); - } - }); - uniqueMetas.sort(function(x3, y3) { - if (x3.isSigner !== y3.isSigner) { - return x3.isSigner ? -1 : 1; - } - if (x3.isWritable !== y3.isWritable) { - return x3.isWritable ? -1 : 1; - } - const options = { - localeMatcher: "best fit", - usage: "sort", - sensitivity: "variant", - ignorePunctuation: false, - numeric: false, - caseFirst: "lower" - }; - return x3.pubkey.toBase58().localeCompare(y3.pubkey.toBase58(), "en", options); - }); - const feePayerIndex = uniqueMetas.findIndex((x3) => { - return x3.pubkey.equals(feePayer); - }); - if (feePayerIndex > -1) { - const [payerMeta] = uniqueMetas.splice(feePayerIndex, 1); - payerMeta.isSigner = true; - payerMeta.isWritable = true; - uniqueMetas.unshift(payerMeta); - } else { - uniqueMetas.unshift({ - pubkey: feePayer, - isSigner: true, - isWritable: true - }); - } - for (const signature2 of this.signatures) { - const uniqueIndex = uniqueMetas.findIndex((x3) => { - return x3.pubkey.equals(signature2.publicKey); - }); - if (uniqueIndex > -1) { - if (!uniqueMetas[uniqueIndex].isSigner) { - uniqueMetas[uniqueIndex].isSigner = true; - console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."); - } - } else { - throw new Error(`unknown signer: ${signature2.publicKey.toString()}`); - } - } - let numRequiredSignatures = 0; - let numReadonlySignedAccounts = 0; - let numReadonlyUnsignedAccounts = 0; - const signedKeys = []; - const unsignedKeys = []; - uniqueMetas.forEach(({ - pubkey, - isSigner, - isWritable - }) => { - if (isSigner) { - signedKeys.push(pubkey.toString()); - numRequiredSignatures += 1; - if (!isWritable) { - numReadonlySignedAccounts += 1; - } - } else { - unsignedKeys.push(pubkey.toString()); - if (!isWritable) { - numReadonlyUnsignedAccounts += 1; - } - } - }); - const accountKeys = signedKeys.concat(unsignedKeys); - const compiledInstructions = instructions.map((instruction) => { - const { - data, - programId - } = instruction; - return { - programIdIndex: accountKeys.indexOf(programId.toString()), - accounts: instruction.keys.map((meta) => accountKeys.indexOf(meta.pubkey.toString())), - data: bs58$3.encode(data) - }; - }); - compiledInstructions.forEach((instruction) => { - assert$b(instruction.programIdIndex >= 0); - instruction.accounts.forEach((keyIndex) => assert$b(keyIndex >= 0)); - }); - return new Message({ - header: { - numRequiredSignatures, - numReadonlySignedAccounts, - numReadonlyUnsignedAccounts - }, - accountKeys, - recentBlockhash, - instructions: compiledInstructions - }); - } - /** - * @internal - */ - _compile() { - const message2 = this.compileMessage(); - const signedKeys = message2.accountKeys.slice(0, message2.header.numRequiredSignatures); - if (this.signatures.length === signedKeys.length) { - const valid = this.signatures.every((pair, index2) => { - return signedKeys[index2].equals(pair.publicKey); - }); - if (valid) - return message2; - } - this.signatures = signedKeys.map((publicKey2) => ({ - signature: null, - publicKey: publicKey2 - })); - return message2; - } - /** - * Get a buffer of the Transaction data that need to be covered by signatures - */ - serializeMessage() { - return this._compile().serialize(); - } - /** - * Get the estimated fee associated with a transaction - * - * @param {Connection} connection Connection to RPC Endpoint. - * - * @returns {Promise} The estimated fee for the transaction - */ - async getEstimatedFee(connection) { - return (await connection.getFeeForMessage(this.compileMessage())).value; - } - /** - * Specify the public keys which will be used to sign the Transaction. - * The first signer will be used as the transaction fee payer account. - * - * Signatures can be added with either `partialSign` or `addSignature` - * - * @deprecated Deprecated since v0.84.0. Only the fee payer needs to be - * specified and it can be set in the Transaction constructor or with the - * `feePayer` property. - */ - setSigners(...signers) { - if (signers.length === 0) { - throw new Error("No signers"); - } - const seen2 = /* @__PURE__ */ new Set(); - this.signatures = signers.filter((publicKey2) => { - const key2 = publicKey2.toString(); - if (seen2.has(key2)) { - return false; - } else { - seen2.add(key2); - return true; - } - }).map((publicKey2) => ({ - signature: null, - publicKey: publicKey2 - })); - } - /** - * Sign the Transaction with the specified signers. Multiple signatures may - * be applied to a Transaction. The first signature is considered "primary" - * and is used identify and confirm transactions. - * - * If the Transaction `feePayer` is not set, the first signer will be used - * as the transaction fee payer account. - * - * Transaction fields should not be modified after the first call to `sign`, - * as doing so may invalidate the signature and cause the Transaction to be - * rejected. - * - * The Transaction must be assigned a valid `recentBlockhash` before invoking this method - * - * @param {Array} signers Array of signers that will sign the transaction - */ - sign(...signers) { - if (signers.length === 0) { - throw new Error("No signers"); - } - const seen2 = /* @__PURE__ */ new Set(); - const uniqueSigners = []; - for (const signer of signers) { - const key2 = signer.publicKey.toString(); - if (seen2.has(key2)) { - continue; - } else { - seen2.add(key2); - uniqueSigners.push(signer); - } - } - this.signatures = uniqueSigners.map((signer) => ({ - signature: null, - publicKey: signer.publicKey - })); - const message2 = this._compile(); - this._partialSign(message2, ...uniqueSigners); - } - /** - * Partially sign a transaction with the specified accounts. All accounts must - * correspond to either the fee payer or a signer account in the transaction - * instructions. - * - * All the caveats from the `sign` method apply to `partialSign` - * - * @param {Array} signers Array of signers that will sign the transaction - */ - partialSign(...signers) { - if (signers.length === 0) { - throw new Error("No signers"); - } - const seen2 = /* @__PURE__ */ new Set(); - const uniqueSigners = []; - for (const signer of signers) { - const key2 = signer.publicKey.toString(); - if (seen2.has(key2)) { - continue; - } else { - seen2.add(key2); - uniqueSigners.push(signer); - } - } - const message2 = this._compile(); - this._partialSign(message2, ...uniqueSigners); - } - /** - * @internal - */ - _partialSign(message2, ...signers) { - const signData = message2.serialize(); - signers.forEach((signer) => { - const signature2 = sign(signData, signer.secretKey); - this._addSignature(signer.publicKey, toBuffer(signature2)); - }); - } - /** - * Add an externally created signature to a transaction. The public key - * must correspond to either the fee payer or a signer account in the transaction - * instructions. - * - * @param {PublicKey} pubkey Public key that will be added to the transaction. - * @param {Buffer} signature An externally created signature to add to the transaction. - */ - addSignature(pubkey, signature2) { - this._compile(); - this._addSignature(pubkey, signature2); - } - /** - * @internal - */ - _addSignature(pubkey, signature2) { - assert$b(signature2.length === 64); - const index2 = this.signatures.findIndex((sigpair) => pubkey.equals(sigpair.publicKey)); - if (index2 < 0) { - throw new Error(`unknown signer: ${pubkey.toString()}`); - } - this.signatures[index2].signature = buffer.Buffer.from(signature2); - } - /** - * Verify signatures of a Transaction - * Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one. - * If no boolean is provided, we expect a fully signed Transaction by default. - * - * @param {boolean} [requireAllSignatures=true] Require a fully signed Transaction - */ - verifySignatures(requireAllSignatures = true) { - const signatureErrors = this._getMessageSignednessErrors(this.serializeMessage(), requireAllSignatures); - return !signatureErrors; - } - /** - * @internal - */ - _getMessageSignednessErrors(message2, requireAllSignatures) { - const errors = {}; - for (const { - signature: signature2, - publicKey: publicKey2 - } of this.signatures) { - if (signature2 === null) { - if (requireAllSignatures) { - (errors.missing || (errors.missing = [])).push(publicKey2); - } - } else { - if (!verify(signature2, message2, publicKey2.toBytes())) { - (errors.invalid || (errors.invalid = [])).push(publicKey2); - } - } - } - return errors.invalid || errors.missing ? errors : void 0; - } - /** - * Serialize the Transaction in the wire format. - * - * @param {Buffer} [config] Config of transaction. - * - * @returns {Buffer} Signature of transaction in wire format. - */ - serialize(config2) { - const { - requireAllSignatures, - verifySignatures - } = Object.assign({ - requireAllSignatures: true, - verifySignatures: true - }, config2); - const signData = this.serializeMessage(); - if (verifySignatures) { - const sigErrors = this._getMessageSignednessErrors(signData, requireAllSignatures); - if (sigErrors) { - let errorMessage = "Signature verification failed."; - if (sigErrors.invalid) { - errorMessage += ` -Invalid signature for public key${sigErrors.invalid.length === 1 ? "" : "(s)"} [\`${sigErrors.invalid.map((p3) => p3.toBase58()).join("`, `")}\`].`; - } - if (sigErrors.missing) { - errorMessage += ` -Missing signature for public key${sigErrors.missing.length === 1 ? "" : "(s)"} [\`${sigErrors.missing.map((p3) => p3.toBase58()).join("`, `")}\`].`; - } - throw new Error(errorMessage); - } - } - return this._serialize(signData); - } - /** - * @internal - */ - _serialize(signData) { - const { - signatures - } = this; - const signatureCount = []; - encodeLength(signatureCount, signatures.length); - const transactionLength = signatureCount.length + signatures.length * 64 + signData.length; - const wireTransaction = buffer.Buffer.alloc(transactionLength); - assert$b(signatures.length < 256); - buffer.Buffer.from(signatureCount).copy(wireTransaction, 0); - signatures.forEach(({ - signature: signature2 - }, index2) => { - if (signature2 !== null) { - assert$b(signature2.length === 64, `signature has invalid length`); - buffer.Buffer.from(signature2).copy(wireTransaction, signatureCount.length + index2 * 64); - } - }); - signData.copy(wireTransaction, signatureCount.length + signatures.length * 64); - assert$b(wireTransaction.length <= PACKET_DATA_SIZE, `Transaction too large: ${wireTransaction.length} > ${PACKET_DATA_SIZE}`); - return wireTransaction; - } - /** - * Deprecated method - * @internal - */ - get keys() { - assert$b(this.instructions.length === 1); - return this.instructions[0].keys.map((keyObj) => keyObj.pubkey); - } - /** - * Deprecated method - * @internal - */ - get programId() { - assert$b(this.instructions.length === 1); - return this.instructions[0].programId; - } - /** - * Deprecated method - * @internal - */ - get data() { - assert$b(this.instructions.length === 1); - return this.instructions[0].data; - } - /** - * Parse a wire transaction into a Transaction object. - * - * @param {Buffer | Uint8Array | Array} buffer Signature of wire Transaction - * - * @returns {Transaction} Transaction associated with the signature - */ - static from(buffer$12) { - let byteArray = [...buffer$12]; - const signatureCount = decodeLength(byteArray); - let signatures = []; - for (let i3 = 0; i3 < signatureCount; i3++) { - const signature2 = guardedSplice(byteArray, 0, SIGNATURE_LENGTH_IN_BYTES$1); - signatures.push(bs58$3.encode(buffer.Buffer.from(signature2))); - } - return Transaction.populate(Message.from(byteArray), signatures); - } - /** - * Populate Transaction object from message and signatures - * - * @param {Message} message Message of transaction - * @param {Array} signatures List of signatures to assign to the transaction - * - * @returns {Transaction} The populated Transaction - */ - static populate(message2, signatures = []) { - const transaction2 = new Transaction(); - transaction2.recentBlockhash = message2.recentBlockhash; - if (message2.header.numRequiredSignatures > 0) { - transaction2.feePayer = message2.accountKeys[0]; - } - signatures.forEach((signature2, index2) => { - const sigPubkeyPair = { - signature: signature2 == bs58$3.encode(DEFAULT_SIGNATURE) ? null : bs58$3.decode(signature2), - publicKey: message2.accountKeys[index2] - }; - transaction2.signatures.push(sigPubkeyPair); - }); - message2.instructions.forEach((instruction) => { - const keys2 = instruction.accounts.map((account) => { - const pubkey = message2.accountKeys[account]; - return { - pubkey, - isSigner: transaction2.signatures.some((keyObj) => keyObj.publicKey.toString() === pubkey.toString()) || message2.isAccountSigner(account), - isWritable: message2.isAccountWritable(account) - }; - }); - transaction2.instructions.push(new TransactionInstruction({ - keys: keys2, - programId: message2.accountKeys[instruction.programIdIndex], - data: bs58$3.decode(instruction.data) - })); - }); - transaction2._message = message2; - transaction2._json = transaction2.toJSON(); - return transaction2; - } -}; -class VersionedTransaction { - get version() { - return this.message.version; - } - constructor(message2, signatures) { - this.signatures = void 0; - this.message = void 0; - if (signatures !== void 0) { - assert$b(signatures.length === message2.header.numRequiredSignatures, "Expected signatures length to be equal to the number of required signatures"); - this.signatures = signatures; - } else { - const defaultSignatures = []; - for (let i3 = 0; i3 < message2.header.numRequiredSignatures; i3++) { - defaultSignatures.push(new Uint8Array(SIGNATURE_LENGTH_IN_BYTES$1)); - } - this.signatures = defaultSignatures; - } - this.message = message2; - } - serialize() { - const serializedMessage = this.message.serialize(); - const encodedSignaturesLength = Array(); - encodeLength(encodedSignaturesLength, this.signatures.length); - const transactionLayout = struct([blob(encodedSignaturesLength.length, "encodedSignaturesLength"), seq(signature$2(), this.signatures.length, "signatures"), blob(serializedMessage.length, "serializedMessage")]); - const serializedTransaction = new Uint8Array(2048); - const serializedTransactionLength = transactionLayout.encode({ - encodedSignaturesLength: new Uint8Array(encodedSignaturesLength), - signatures: this.signatures, - serializedMessage - }, serializedTransaction); - return serializedTransaction.slice(0, serializedTransactionLength); - } - static deserialize(serializedTransaction) { - let byteArray = [...serializedTransaction]; - const signatures = []; - const signaturesLength = decodeLength(byteArray); - for (let i3 = 0; i3 < signaturesLength; i3++) { - signatures.push(new Uint8Array(guardedSplice(byteArray, 0, SIGNATURE_LENGTH_IN_BYTES$1))); - } - const message2 = VersionedMessage.deserialize(new Uint8Array(byteArray)); - return new VersionedTransaction(message2, signatures); - } - sign(signers) { - const messageData = this.message.serialize(); - const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures); - for (const signer of signers) { - const signerIndex = signerPubkeys.findIndex((pubkey) => pubkey.equals(signer.publicKey)); - assert$b(signerIndex >= 0, `Cannot sign with non signer key ${signer.publicKey.toBase58()}`); - this.signatures[signerIndex] = sign(messageData, signer.secretKey); - } - } - addSignature(publicKey2, signature2) { - assert$b(signature2.byteLength === 64, "Signature must be 64 bytes long"); - const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures); - const signerIndex = signerPubkeys.findIndex((pubkey) => pubkey.equals(publicKey2)); - assert$b(signerIndex >= 0, `Can not add signature; \`${publicKey2.toBase58()}\` is not required to sign this transaction`); - this.signatures[signerIndex] = signature2; - } -} -const NUM_TICKS_PER_SECOND = 160; -const DEFAULT_TICKS_PER_SLOT = 64; -const NUM_SLOTS_PER_SECOND = NUM_TICKS_PER_SECOND / DEFAULT_TICKS_PER_SLOT; -const MS_PER_SLOT = 1e3 / NUM_SLOTS_PER_SECOND; -new PublicKey("SysvarC1ock11111111111111111111111111111111"); -new PublicKey("SysvarEpochSchedu1e111111111111111111111111"); -new PublicKey("Sysvar1nstructions1111111111111111111111111"); -new PublicKey("SysvarRecentB1ockHashes11111111111111111111"); -new PublicKey("SysvarRent111111111111111111111111111111111"); -new PublicKey("SysvarRewards111111111111111111111111111111"); -new PublicKey("SysvarS1otHashes111111111111111111111111111"); -new PublicKey("SysvarS1otHistory11111111111111111111111111"); -new PublicKey("SysvarStakeHistory1111111111111111111111111"); -class SendTransactionError extends Error { - constructor({ - action, - signature: signature2, - transactionMessage, - logs - }) { - const maybeLogsOutput = logs ? `Logs: -${JSON.stringify(logs.slice(-10), null, 2)}. ` : ""; - const guideText = "\nCatch the `SendTransactionError` and call `getLogs()` on it for full details."; - let message2; - switch (action) { - case "send": - message2 = `Transaction ${signature2} resulted in an error. -${transactionMessage}. ` + maybeLogsOutput + guideText; - break; - case "simulate": - message2 = `Simulation failed. -Message: ${transactionMessage}. -` + maybeLogsOutput + guideText; - break; - default: { - message2 = `Unknown action '${((a3) => a3)(action)}'`; - } - } - super(message2); - this.signature = void 0; - this.transactionMessage = void 0; - this.transactionLogs = void 0; - this.signature = signature2; - this.transactionMessage = transactionMessage; - this.transactionLogs = logs ? logs : void 0; - } - get transactionError() { - return { - message: this.transactionMessage, - logs: Array.isArray(this.transactionLogs) ? this.transactionLogs : void 0 - }; - } - /* @deprecated Use `await getLogs()` instead */ - get logs() { - const cachedLogs = this.transactionLogs; - if (cachedLogs != null && typeof cachedLogs === "object" && "then" in cachedLogs) { - return void 0; - } - return cachedLogs; - } - async getLogs(connection) { - if (!Array.isArray(this.transactionLogs)) { - this.transactionLogs = new Promise((resolve, reject) => { - connection.getTransaction(this.signature).then((tx) => { - if (tx && tx.meta && tx.meta.logMessages) { - const logs = tx.meta.logMessages; - this.transactionLogs = logs; - resolve(logs); - } else { - reject(new Error("Log messages not found")); - } - }).catch(reject); - }); - } - return await this.transactionLogs; - } -} -class SolanaJSONRPCError extends Error { - constructor({ - code: code2, - message: message2, - data - }, customMessage) { - super(customMessage != null ? `${customMessage}: ${message2}` : message2); - this.code = void 0; - this.data = void 0; - this.code = code2; - this.data = data; - this.name = "SolanaJSONRPCError"; - } -} -function sleep$1(ms2) { - return new Promise((resolve) => setTimeout(resolve, ms2)); -} -const FeeCalculatorLayout = nu64("lamportsPerSignature"); -const NonceAccountLayout = struct([u32$1("version"), u32$1("state"), publicKey("authorizedPubkey"), publicKey("nonce"), struct([FeeCalculatorLayout], "feeCalculator")]); -NonceAccountLayout.span; -class NonceAccount { - /** - * @internal - */ - constructor(args) { - this.authorizedPubkey = void 0; - this.nonce = void 0; - this.feeCalculator = void 0; - this.authorizedPubkey = args.authorizedPubkey; - this.nonce = args.nonce; - this.feeCalculator = args.feeCalculator; - } - /** - * Deserialize NonceAccount from the account data. - * - * @param buffer account data - * @return NonceAccount - */ - static fromAccountData(buffer2) { - const nonceAccount = NonceAccountLayout.decode(toBuffer(buffer2), 0); - return new NonceAccount({ - authorizedPubkey: new PublicKey(nonceAccount.authorizedPubkey), - nonce: new PublicKey(nonceAccount.nonce).toString(), - feeCalculator: nonceAccount.feeCalculator - }); - } -} -const encodeDecode = (layout) => { - const decode3 = layout.decode.bind(layout); - const encode5 = layout.encode.bind(layout); - return { - decode: decode3, - encode: encode5 - }; -}; -const bigInt = (length) => (property) => { - const layout = blob(length, property); - const { - encode: encode5, - decode: decode3 - } = encodeDecode(layout); - const bigIntLayout = layout; - bigIntLayout.decode = (buffer$12, offset2) => { - const src2 = decode3(buffer$12, offset2); - return toBigIntLE_1(buffer.Buffer.from(src2)); - }; - bigIntLayout.encode = (bigInt2, buffer2, offset2) => { - const src2 = toBufferLE_1(bigInt2, length); - return encode5(src2, buffer2, offset2); - }; - return bigIntLayout; -}; -const u64$2 = bigInt(8); -Object.freeze({ - Create: { - index: 0, - layout: struct([u32$1("instruction"), ns64("lamports"), ns64("space"), publicKey("programId")]) - }, - Assign: { - index: 1, - layout: struct([u32$1("instruction"), publicKey("programId")]) - }, - Transfer: { - index: 2, - layout: struct([u32$1("instruction"), u64$2("lamports")]) - }, - CreateWithSeed: { - index: 3, - layout: struct([u32$1("instruction"), publicKey("base"), rustString("seed"), ns64("lamports"), ns64("space"), publicKey("programId")]) - }, - AdvanceNonceAccount: { - index: 4, - layout: struct([u32$1("instruction")]) - }, - WithdrawNonceAccount: { - index: 5, - layout: struct([u32$1("instruction"), ns64("lamports")]) - }, - InitializeNonceAccount: { - index: 6, - layout: struct([u32$1("instruction"), publicKey("authorized")]) - }, - AuthorizeNonceAccount: { - index: 7, - layout: struct([u32$1("instruction"), publicKey("authorized")]) - }, - Allocate: { - index: 8, - layout: struct([u32$1("instruction"), ns64("space")]) - }, - AllocateWithSeed: { - index: 9, - layout: struct([u32$1("instruction"), publicKey("base"), rustString("seed"), ns64("space"), publicKey("programId")]) - }, - AssignWithSeed: { - index: 10, - layout: struct([u32$1("instruction"), publicKey("base"), rustString("seed"), publicKey("programId")]) - }, - TransferWithSeed: { - index: 11, - layout: struct([u32$1("instruction"), u64$2("lamports"), rustString("seed"), publicKey("programId")]) - }, - UpgradeNonceAccount: { - index: 12, - layout: struct([u32$1("instruction")]) - } -}); -new PublicKey("11111111111111111111111111111111"); -new PublicKey("BPFLoader2111111111111111111111111111111111"); -function getDefaultExportFromCjs(x3) { - return x3 && x3.__esModule && Object.prototype.hasOwnProperty.call(x3, "default") ? x3["default"] : x3; -} -var fastStableStringify$1; -var hasRequiredFastStableStringify; -function requireFastStableStringify() { - if (hasRequiredFastStableStringify) - return fastStableStringify$1; - hasRequiredFastStableStringify = 1; - var objToString = Object.prototype.toString; - var objKeys = Object.keys || function(obj) { - var keys2 = []; - for (var name2 in obj) { - keys2.push(name2); - } - return keys2; - }; - function stringify2(val, isArrayProp) { - var i3, max, str, keys2, key2, propVal, toStr2; - if (val === true) { - return "true"; - } - if (val === false) { - return "false"; - } - switch (typeof val) { - case "object": - if (val === null) { - return null; - } else if (val.toJSON && typeof val.toJSON === "function") { - return stringify2(val.toJSON(), isArrayProp); - } else { - toStr2 = objToString.call(val); - if (toStr2 === "[object Array]") { - str = "["; - max = val.length - 1; - for (i3 = 0; i3 < max; i3++) { - str += stringify2(val[i3], true) + ","; - } - if (max > -1) { - str += stringify2(val[i3], true); - } - return str + "]"; - } else if (toStr2 === "[object Object]") { - keys2 = objKeys(val).sort(); - max = keys2.length; - str = ""; - i3 = 0; - while (i3 < max) { - key2 = keys2[i3]; - propVal = stringify2(val[key2], false); - if (propVal !== void 0) { - if (str) { - str += ","; - } - str += JSON.stringify(key2) + ":" + propVal; - } - i3++; - } - return "{" + str + "}"; - } else { - return JSON.stringify(val); - } - } - case "function": - case "undefined": - return isArrayProp ? null : void 0; - case "string": - return JSON.stringify(val); - default: - return isFinite(val) ? val : null; - } - } - fastStableStringify$1 = function(val) { - var returnVal = stringify2(val, false); - if (returnVal !== void 0) { - return "" + returnVal; - } - }; - return fastStableStringify$1; -} -var fastStableStringifyExports = /* @__PURE__ */ requireFastStableStringify(); -var fastStableStringify = /* @__PURE__ */ getDefaultExportFromCjs(fastStableStringifyExports); -const MINIMUM_SLOT_PER_EPOCH = 32; -function trailingZeros(n4) { - let trailingZeros2 = 0; - while (n4 > 1) { - n4 /= 2; - trailingZeros2++; - } - return trailingZeros2; -} -function nextPowerOfTwo(n4) { - if (n4 === 0) - return 1; - n4--; - n4 |= n4 >> 1; - n4 |= n4 >> 2; - n4 |= n4 >> 4; - n4 |= n4 >> 8; - n4 |= n4 >> 16; - n4 |= n4 >> 32; - return n4 + 1; -} -class EpochSchedule { - constructor(slotsPerEpoch, leaderScheduleSlotOffset, warmup, firstNormalEpoch, firstNormalSlot) { - this.slotsPerEpoch = void 0; - this.leaderScheduleSlotOffset = void 0; - this.warmup = void 0; - this.firstNormalEpoch = void 0; - this.firstNormalSlot = void 0; - this.slotsPerEpoch = slotsPerEpoch; - this.leaderScheduleSlotOffset = leaderScheduleSlotOffset; - this.warmup = warmup; - this.firstNormalEpoch = firstNormalEpoch; - this.firstNormalSlot = firstNormalSlot; - } - getEpoch(slot) { - return this.getEpochAndSlotIndex(slot)[0]; - } - getEpochAndSlotIndex(slot) { - if (slot < this.firstNormalSlot) { - const epoch = trailingZeros(nextPowerOfTwo(slot + MINIMUM_SLOT_PER_EPOCH + 1)) - trailingZeros(MINIMUM_SLOT_PER_EPOCH) - 1; - const epochLen = this.getSlotsInEpoch(epoch); - const slotIndex = slot - (epochLen - MINIMUM_SLOT_PER_EPOCH); - return [epoch, slotIndex]; - } else { - const normalSlotIndex = slot - this.firstNormalSlot; - const normalEpochIndex = Math.floor(normalSlotIndex / this.slotsPerEpoch); - const epoch = this.firstNormalEpoch + normalEpochIndex; - const slotIndex = normalSlotIndex % this.slotsPerEpoch; - return [epoch, slotIndex]; - } - } - getFirstSlotInEpoch(epoch) { - if (epoch <= this.firstNormalEpoch) { - return (Math.pow(2, epoch) - 1) * MINIMUM_SLOT_PER_EPOCH; - } else { - return (epoch - this.firstNormalEpoch) * this.slotsPerEpoch + this.firstNormalSlot; - } - } - getLastSlotInEpoch(epoch) { - return this.getFirstSlotInEpoch(epoch) + this.getSlotsInEpoch(epoch) - 1; - } - getSlotsInEpoch(epoch) { - if (epoch < this.firstNormalEpoch) { - return Math.pow(2, epoch + trailingZeros(MINIMUM_SLOT_PER_EPOCH)); - } else { - return this.slotsPerEpoch; - } - } -} -var fetchImpl = globalThis.fetch; -class RpcWebSocketClient extends CommonClient { - constructor(address2, options, generate_request_id) { - const webSocketFactory = (url) => { - const rpc = WebSocket$1(url, { - autoconnect: true, - max_reconnects: 5, - reconnect: true, - reconnect_interval: 1e3, - ...options - }); - if ("socket" in rpc) { - this.underlyingSocket = rpc.socket; - } else { - this.underlyingSocket = rpc; - } - return rpc; - }; - super(webSocketFactory, address2, options, generate_request_id); - this.underlyingSocket = void 0; - } - call(...args) { - var _a3; - const readyState = (_a3 = this.underlyingSocket) == null ? void 0 : _a3.readyState; - if (readyState === 1) { - return super.call(...args); - } - return Promise.reject(new Error("Tried to call a JSON-RPC method `" + args[0] + "` but the socket was not `CONNECTING` or `OPEN` (`readyState` was " + readyState + ")")); - } - notify(...args) { - var _a3; - const readyState = (_a3 = this.underlyingSocket) == null ? void 0 : _a3.readyState; - if (readyState === 1) { - return super.notify(...args); - } - return Promise.reject(new Error("Tried to send a JSON-RPC notification `" + args[0] + "` but the socket was not `CONNECTING` or `OPEN` (`readyState` was " + readyState + ")")); - } -} -function decodeData(type2, data) { - let decoded; - try { - decoded = type2.layout.decode(data); - } catch (err) { - throw new Error("invalid instruction; " + err); - } - if (decoded.typeIndex !== type2.index) { - throw new Error(`invalid account data; account type mismatch ${decoded.typeIndex} != ${type2.index}`); - } - return decoded; -} -const LOOKUP_TABLE_META_SIZE = 56; -class AddressLookupTableAccount { - constructor(args) { - this.key = void 0; - this.state = void 0; - this.key = args.key; - this.state = args.state; - } - isActive() { - const U64_MAX = BigInt("0xffffffffffffffff"); - return this.state.deactivationSlot === U64_MAX; - } - static deserialize(accountData) { - const meta = decodeData(LookupTableMetaLayout, accountData); - const serializedAddressesLen = accountData.length - LOOKUP_TABLE_META_SIZE; - assert$b(serializedAddressesLen >= 0, "lookup table is invalid"); - assert$b(serializedAddressesLen % 32 === 0, "lookup table is invalid"); - const numSerializedAddresses = serializedAddressesLen / 32; - const { - addresses - } = struct([seq(publicKey(), numSerializedAddresses, "addresses")]).decode(accountData.slice(LOOKUP_TABLE_META_SIZE)); - return { - deactivationSlot: meta.deactivationSlot, - lastExtendedSlot: meta.lastExtendedSlot, - lastExtendedSlotStartIndex: meta.lastExtendedStartIndex, - authority: meta.authority.length !== 0 ? new PublicKey(meta.authority[0]) : void 0, - addresses: addresses.map((address2) => new PublicKey(address2)) - }; - } -} -const LookupTableMetaLayout = { - index: 1, - layout: struct([ - u32$1("typeIndex"), - u64$2("deactivationSlot"), - nu64("lastExtendedSlot"), - u8("lastExtendedStartIndex"), - u8(), - // option - seq(publicKey(), offset(u8(), -1), "authority") - ]) -}; -const URL_RE = /^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i; -function makeWebsocketUrl(endpoint) { - const matches2 = endpoint.match(URL_RE); - if (matches2 == null) { - throw TypeError(`Failed to validate endpoint URL \`${endpoint}\``); - } - const [ - _3, - // eslint-disable-line @typescript-eslint/no-unused-vars - hostish, - portWithColon, - rest - ] = matches2; - const protocol = endpoint.startsWith("https:") ? "wss:" : "ws:"; - const startPort = portWithColon == null ? null : parseInt(portWithColon.slice(1), 10); - const websocketPort = ( - // Only shift the port by +1 as a convention for ws(s) only if given endpoint - // is explicitly specifying the endpoint port (HTTP-based RPC), assuming - // we're directly trying to connect to agave-validator's ws listening port. - // When the endpoint omits the port, we're connecting to the protocol - // default ports: http(80) or https(443) and it's assumed we're behind a reverse - // proxy which manages WebSocket upgrade and backend port redirection. - startPort == null ? "" : `:${startPort + 1}` - ); - return `${protocol}//${hostish}${websocketPort}${rest}`; -} -const PublicKeyFromString = coerce$1(instance(PublicKey), string$1(), (value) => new PublicKey(value)); -const RawAccountDataResult = tuple([string$1(), literal("base64")]); -const BufferFromRawAccountData = coerce$1(instance(buffer.Buffer), RawAccountDataResult, (value) => buffer.Buffer.from(value[0], "base64")); -const BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1e3; -function assertEndpointUrl(putativeUrl) { - if (/^https?:/.test(putativeUrl) === false) { - throw new TypeError("Endpoint URL must start with `http:` or `https:`."); - } - return putativeUrl; -} -function extractCommitmentFromConfig(commitmentOrConfig) { - let commitment; - let config2; - if (typeof commitmentOrConfig === "string") { - commitment = commitmentOrConfig; - } else if (commitmentOrConfig) { - const { - commitment: specifiedCommitment, - ...specifiedConfig - } = commitmentOrConfig; - commitment = specifiedCommitment; - config2 = specifiedConfig; - } - return { - commitment, - config: config2 - }; -} -function applyDefaultMemcmpEncodingToFilters(filters) { - return filters.map((filter2) => "memcmp" in filter2 ? { - ...filter2, - memcmp: { - ...filter2.memcmp, - encoding: filter2.memcmp.encoding ?? "base58" - } - } : filter2); -} -function createRpcResult(result) { - return union([type({ - jsonrpc: literal("2.0"), - id: string$1(), - result - }), type({ - jsonrpc: literal("2.0"), - id: string$1(), - error: type({ - code: unknown(), - message: string$1(), - data: optional(any()) - }) - })]); -} -const UnknownRpcResult = createRpcResult(unknown()); -function jsonRpcResult(schema) { - return coerce$1(createRpcResult(schema), UnknownRpcResult, (value) => { - if ("error" in value) { - return value; - } else { - return { - ...value, - result: create(value.result, schema) - }; - } - }); -} -function jsonRpcResultAndContext(value) { - return jsonRpcResult(type({ - context: type({ - slot: number$1() - }), - value - })); -} -function notificationResultAndContext(value) { - return type({ - context: type({ - slot: number$1() - }), - value - }); -} -function versionedMessageFromResponse(version2, response) { - if (version2 === 0) { - return new MessageV0({ - header: response.header, - staticAccountKeys: response.accountKeys.map((accountKey) => new PublicKey(accountKey)), - recentBlockhash: response.recentBlockhash, - compiledInstructions: response.instructions.map((ix) => ({ - programIdIndex: ix.programIdIndex, - accountKeyIndexes: ix.accounts, - data: bs58$3.decode(ix.data) - })), - addressTableLookups: response.addressTableLookups - }); - } else { - return new Message(response); - } -} -const GetInflationGovernorResult = type({ - foundation: number$1(), - foundationTerm: number$1(), - initial: number$1(), - taper: number$1(), - terminal: number$1() -}); -const GetInflationRewardResult = jsonRpcResult(array(nullable(type({ - epoch: number$1(), - effectiveSlot: number$1(), - amount: number$1(), - postBalance: number$1(), - commission: optional(nullable(number$1())) -})))); -const GetRecentPrioritizationFeesResult = array(type({ - slot: number$1(), - prioritizationFee: number$1() -})); -const GetInflationRateResult = type({ - total: number$1(), - validator: number$1(), - foundation: number$1(), - epoch: number$1() -}); -const GetEpochInfoResult = type({ - epoch: number$1(), - slotIndex: number$1(), - slotsInEpoch: number$1(), - absoluteSlot: number$1(), - blockHeight: optional(number$1()), - transactionCount: optional(number$1()) -}); -const GetEpochScheduleResult = type({ - slotsPerEpoch: number$1(), - leaderScheduleSlotOffset: number$1(), - warmup: boolean(), - firstNormalEpoch: number$1(), - firstNormalSlot: number$1() -}); -const GetLeaderScheduleResult = record(string$1(), array(number$1())); -const TransactionErrorResult = nullable(union([type({}), string$1()])); -const SignatureStatusResult = type({ - err: TransactionErrorResult -}); -const SignatureReceivedResult = literal("receivedSignature"); -const VersionResult = type({ - "solana-core": string$1(), - "feature-set": optional(number$1()) -}); -const ParsedInstructionStruct = type({ - program: string$1(), - programId: PublicKeyFromString, - parsed: unknown() -}); -const PartiallyDecodedInstructionStruct = type({ - programId: PublicKeyFromString, - accounts: array(PublicKeyFromString), - data: string$1() -}); -const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({ - err: nullable(union([type({}), string$1()])), - logs: nullable(array(string$1())), - accounts: optional(nullable(array(nullable(type({ - executable: boolean(), - owner: string$1(), - lamports: number$1(), - data: array(string$1()), - rentEpoch: optional(number$1()) - }))))), - unitsConsumed: optional(number$1()), - returnData: optional(nullable(type({ - programId: string$1(), - data: tuple([string$1(), literal("base64")]) - }))), - innerInstructions: optional(nullable(array(type({ - index: number$1(), - instructions: array(union([ParsedInstructionStruct, PartiallyDecodedInstructionStruct])) - })))) -})); -const BlockProductionResponseStruct = jsonRpcResultAndContext(type({ - byIdentity: record(string$1(), array(number$1())), - range: type({ - firstSlot: number$1(), - lastSlot: number$1() - }) -})); -function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent) { - const fetch2 = customFetch ? customFetch : fetchImpl; - let agent; - { - if (httpAgent != null) { - console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."); - } - } - let fetchWithMiddleware; - if (fetchMiddleware) { - fetchWithMiddleware = async (info, init3) => { - const modifiedFetchArgs = await new Promise((resolve, reject) => { - try { - fetchMiddleware(info, init3, (modifiedInfo, modifiedInit) => resolve([modifiedInfo, modifiedInit])); - } catch (error) { - reject(error); - } - }); - return await fetch2(...modifiedFetchArgs); - }; - } - const clientBrowser = new RpcClient(async (request, callback) => { - const options = { - method: "POST", - body: request, - agent, - headers: Object.assign({ - "Content-Type": "application/json" - }, httpHeaders || {}, COMMON_HTTP_HEADERS) - }; - try { - let too_many_requests_retries = 5; - let res; - let waitTime = 500; - for (; ; ) { - if (fetchWithMiddleware) { - res = await fetchWithMiddleware(url, options); - } else { - res = await fetch2(url, options); - } - if (res.status !== 429) { - break; - } - if (disableRetryOnRateLimit === true) { - break; - } - too_many_requests_retries -= 1; - if (too_many_requests_retries === 0) { - break; - } - console.error(`Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`); - await sleep$1(waitTime); - waitTime *= 2; - } - const text = await res.text(); - if (res.ok) { - callback(null, text); - } else { - callback(new Error(`${res.status} ${res.statusText}: ${text}`)); - } - } catch (err) { - if (err instanceof Error) - callback(err); - } - }, {}); - return clientBrowser; -} -function createRpcRequest(client2) { - return (method, args) => { - return new Promise((resolve, reject) => { - client2.request(method, args, (err, response) => { - if (err) { - reject(err); - return; - } - resolve(response); - }); - }); - }; -} -function createRpcBatchRequest(client2) { - return (requests) => { - return new Promise((resolve, reject) => { - if (requests.length === 0) - resolve([]); - const batch = requests.map((params) => { - return client2.request(params.methodName, params.args); - }); - client2.request(batch, (err, response) => { - if (err) { - reject(err); - return; - } - resolve(response); - }); - }); - }; -} -const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult); -const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult); -const GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult); -const GetEpochInfoRpcResult = jsonRpcResult(GetEpochInfoResult); -const GetEpochScheduleRpcResult = jsonRpcResult(GetEpochScheduleResult); -const GetLeaderScheduleRpcResult = jsonRpcResult(GetLeaderScheduleResult); -const SlotRpcResult = jsonRpcResult(number$1()); -const GetSupplyRpcResult = jsonRpcResultAndContext(type({ - total: number$1(), - circulating: number$1(), - nonCirculating: number$1(), - nonCirculatingAccounts: array(PublicKeyFromString) -})); -const TokenAmountResult = type({ - amount: string$1(), - uiAmount: nullable(number$1()), - decimals: number$1(), - uiAmountString: optional(string$1()) -}); -const GetTokenLargestAccountsResult = jsonRpcResultAndContext(array(type({ - address: PublicKeyFromString, - amount: string$1(), - uiAmount: nullable(number$1()), - decimals: number$1(), - uiAmountString: optional(string$1()) -}))); -const GetTokenAccountsByOwner = jsonRpcResultAndContext(array(type({ - pubkey: PublicKeyFromString, - account: type({ - executable: boolean(), - owner: PublicKeyFromString, - lamports: number$1(), - data: BufferFromRawAccountData, - rentEpoch: number$1() - }) -}))); -const ParsedAccountDataResult = type({ - program: string$1(), - parsed: unknown(), - space: number$1() -}); -const GetParsedTokenAccountsByOwner = jsonRpcResultAndContext(array(type({ - pubkey: PublicKeyFromString, - account: type({ - executable: boolean(), - owner: PublicKeyFromString, - lamports: number$1(), - data: ParsedAccountDataResult, - rentEpoch: number$1() - }) -}))); -const GetLargestAccountsRpcResult = jsonRpcResultAndContext(array(type({ - lamports: number$1(), - address: PublicKeyFromString -}))); -const AccountInfoResult = type({ - executable: boolean(), - owner: PublicKeyFromString, - lamports: number$1(), - data: BufferFromRawAccountData, - rentEpoch: number$1() -}); -const KeyedAccountInfoResult = type({ - pubkey: PublicKeyFromString, - account: AccountInfoResult -}); -const ParsedOrRawAccountData = coerce$1(union([instance(buffer.Buffer), ParsedAccountDataResult]), union([RawAccountDataResult, ParsedAccountDataResult]), (value) => { - if (Array.isArray(value)) { - return create(value, BufferFromRawAccountData); - } else { - return value; - } -}); -const ParsedAccountInfoResult = type({ - executable: boolean(), - owner: PublicKeyFromString, - lamports: number$1(), - data: ParsedOrRawAccountData, - rentEpoch: number$1() -}); -const KeyedParsedAccountInfoResult = type({ - pubkey: PublicKeyFromString, - account: ParsedAccountInfoResult -}); -const StakeActivationResult = type({ - state: union([literal("active"), literal("inactive"), literal("activating"), literal("deactivating")]), - active: number$1(), - inactive: number$1() -}); -const GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(array(type({ - signature: string$1(), - slot: number$1(), - err: TransactionErrorResult, - memo: nullable(string$1()), - blockTime: optional(nullable(number$1())) -}))); -const GetSignaturesForAddressRpcResult = jsonRpcResult(array(type({ - signature: string$1(), - slot: number$1(), - err: TransactionErrorResult, - memo: nullable(string$1()), - blockTime: optional(nullable(number$1())) -}))); -const AccountNotificationResult = type({ - subscription: number$1(), - result: notificationResultAndContext(AccountInfoResult) -}); -const ProgramAccountInfoResult = type({ - pubkey: PublicKeyFromString, - account: AccountInfoResult -}); -const ProgramAccountNotificationResult = type({ - subscription: number$1(), - result: notificationResultAndContext(ProgramAccountInfoResult) -}); -const SlotInfoResult = type({ - parent: number$1(), - slot: number$1(), - root: number$1() -}); -const SlotNotificationResult = type({ - subscription: number$1(), - result: SlotInfoResult -}); -const SlotUpdateResult = union([type({ - type: union([literal("firstShredReceived"), literal("completed"), literal("optimisticConfirmation"), literal("root")]), - slot: number$1(), - timestamp: number$1() -}), type({ - type: literal("createdBank"), - parent: number$1(), - slot: number$1(), - timestamp: number$1() -}), type({ - type: literal("frozen"), - slot: number$1(), - timestamp: number$1(), - stats: type({ - numTransactionEntries: number$1(), - numSuccessfulTransactions: number$1(), - numFailedTransactions: number$1(), - maxTransactionsPerEntry: number$1() - }) -}), type({ - type: literal("dead"), - slot: number$1(), - timestamp: number$1(), - err: string$1() -})]); -const SlotUpdateNotificationResult = type({ - subscription: number$1(), - result: SlotUpdateResult -}); -const SignatureNotificationResult = type({ - subscription: number$1(), - result: notificationResultAndContext(union([SignatureStatusResult, SignatureReceivedResult])) -}); -const RootNotificationResult = type({ - subscription: number$1(), - result: number$1() -}); -const ContactInfoResult = type({ - pubkey: string$1(), - gossip: nullable(string$1()), - tpu: nullable(string$1()), - rpc: nullable(string$1()), - version: nullable(string$1()) -}); -const VoteAccountInfoResult = type({ - votePubkey: string$1(), - nodePubkey: string$1(), - activatedStake: number$1(), - epochVoteAccount: boolean(), - epochCredits: array(tuple([number$1(), number$1(), number$1()])), - commission: number$1(), - lastVote: number$1(), - rootSlot: nullable(number$1()) -}); -const GetVoteAccounts = jsonRpcResult(type({ - current: array(VoteAccountInfoResult), - delinquent: array(VoteAccountInfoResult) -})); -const ConfirmationStatus = union([literal("processed"), literal("confirmed"), literal("finalized")]); -const SignatureStatusResponse = type({ - slot: number$1(), - confirmations: nullable(number$1()), - err: TransactionErrorResult, - confirmationStatus: optional(ConfirmationStatus) -}); -const GetSignatureStatusesRpcResult = jsonRpcResultAndContext(array(nullable(SignatureStatusResponse))); -const GetMinimumBalanceForRentExemptionRpcResult = jsonRpcResult(number$1()); -const AddressTableLookupStruct = type({ - accountKey: PublicKeyFromString, - writableIndexes: array(number$1()), - readonlyIndexes: array(number$1()) -}); -const ConfirmedTransactionResult = type({ - signatures: array(string$1()), - message: type({ - accountKeys: array(string$1()), - header: type({ - numRequiredSignatures: number$1(), - numReadonlySignedAccounts: number$1(), - numReadonlyUnsignedAccounts: number$1() - }), - instructions: array(type({ - accounts: array(number$1()), - data: string$1(), - programIdIndex: number$1() - })), - recentBlockhash: string$1(), - addressTableLookups: optional(array(AddressTableLookupStruct)) - }) -}); -const AnnotatedAccountKey = type({ - pubkey: PublicKeyFromString, - signer: boolean(), - writable: boolean(), - source: optional(union([literal("transaction"), literal("lookupTable")])) -}); -const ConfirmedTransactionAccountsModeResult = type({ - accountKeys: array(AnnotatedAccountKey), - signatures: array(string$1()) -}); -const ParsedInstructionResult = type({ - parsed: unknown(), - program: string$1(), - programId: PublicKeyFromString -}); -const RawInstructionResult = type({ - accounts: array(PublicKeyFromString), - data: string$1(), - programId: PublicKeyFromString -}); -const InstructionResult = union([RawInstructionResult, ParsedInstructionResult]); -const UnknownInstructionResult = union([type({ - parsed: unknown(), - program: string$1(), - programId: string$1() -}), type({ - accounts: array(string$1()), - data: string$1(), - programId: string$1() -})]); -const ParsedOrRawInstruction = coerce$1(InstructionResult, UnknownInstructionResult, (value) => { - if ("accounts" in value) { - return create(value, RawInstructionResult); - } else { - return create(value, ParsedInstructionResult); - } -}); -const ParsedConfirmedTransactionResult = type({ - signatures: array(string$1()), - message: type({ - accountKeys: array(AnnotatedAccountKey), - instructions: array(ParsedOrRawInstruction), - recentBlockhash: string$1(), - addressTableLookups: optional(nullable(array(AddressTableLookupStruct))) - }) -}); -const TokenBalanceResult = type({ - accountIndex: number$1(), - mint: string$1(), - owner: optional(string$1()), - uiTokenAmount: TokenAmountResult -}); -const LoadedAddressesResult = type({ - writable: array(PublicKeyFromString), - readonly: array(PublicKeyFromString) -}); -const ConfirmedTransactionMetaResult = type({ - err: TransactionErrorResult, - fee: number$1(), - innerInstructions: optional(nullable(array(type({ - index: number$1(), - instructions: array(type({ - accounts: array(number$1()), - data: string$1(), - programIdIndex: number$1() - })) - })))), - preBalances: array(number$1()), - postBalances: array(number$1()), - logMessages: optional(nullable(array(string$1()))), - preTokenBalances: optional(nullable(array(TokenBalanceResult))), - postTokenBalances: optional(nullable(array(TokenBalanceResult))), - loadedAddresses: optional(LoadedAddressesResult), - computeUnitsConsumed: optional(number$1()) -}); -const ParsedConfirmedTransactionMetaResult = type({ - err: TransactionErrorResult, - fee: number$1(), - innerInstructions: optional(nullable(array(type({ - index: number$1(), - instructions: array(ParsedOrRawInstruction) - })))), - preBalances: array(number$1()), - postBalances: array(number$1()), - logMessages: optional(nullable(array(string$1()))), - preTokenBalances: optional(nullable(array(TokenBalanceResult))), - postTokenBalances: optional(nullable(array(TokenBalanceResult))), - loadedAddresses: optional(LoadedAddressesResult), - computeUnitsConsumed: optional(number$1()) -}); -const TransactionVersionStruct = union([literal(0), literal("legacy")]); -const RewardsResult = type({ - pubkey: string$1(), - lamports: number$1(), - postBalance: nullable(number$1()), - rewardType: nullable(string$1()), - commission: optional(nullable(number$1())) -}); -const GetBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string$1(), - previousBlockhash: string$1(), - parentSlot: number$1(), - transactions: array(type({ - transaction: ConfirmedTransactionResult, - meta: nullable(ConfirmedTransactionMetaResult), - version: optional(TransactionVersionStruct) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number$1()), - blockHeight: nullable(number$1()) -}))); -const GetNoneModeBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string$1(), - previousBlockhash: string$1(), - parentSlot: number$1(), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number$1()), - blockHeight: nullable(number$1()) -}))); -const GetAccountsModeBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string$1(), - previousBlockhash: string$1(), - parentSlot: number$1(), - transactions: array(type({ - transaction: ConfirmedTransactionAccountsModeResult, - meta: nullable(ConfirmedTransactionMetaResult), - version: optional(TransactionVersionStruct) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number$1()), - blockHeight: nullable(number$1()) -}))); -const GetParsedBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string$1(), - previousBlockhash: string$1(), - parentSlot: number$1(), - transactions: array(type({ - transaction: ParsedConfirmedTransactionResult, - meta: nullable(ParsedConfirmedTransactionMetaResult), - version: optional(TransactionVersionStruct) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number$1()), - blockHeight: nullable(number$1()) -}))); -const GetParsedAccountsModeBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string$1(), - previousBlockhash: string$1(), - parentSlot: number$1(), - transactions: array(type({ - transaction: ConfirmedTransactionAccountsModeResult, - meta: nullable(ParsedConfirmedTransactionMetaResult), - version: optional(TransactionVersionStruct) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number$1()), - blockHeight: nullable(number$1()) -}))); -const GetParsedNoneModeBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string$1(), - previousBlockhash: string$1(), - parentSlot: number$1(), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number$1()), - blockHeight: nullable(number$1()) -}))); -const GetConfirmedBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string$1(), - previousBlockhash: string$1(), - parentSlot: number$1(), - transactions: array(type({ - transaction: ConfirmedTransactionResult, - meta: nullable(ConfirmedTransactionMetaResult) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number$1()) -}))); -const GetBlockSignaturesRpcResult = jsonRpcResult(nullable(type({ - blockhash: string$1(), - previousBlockhash: string$1(), - parentSlot: number$1(), - signatures: array(string$1()), - blockTime: nullable(number$1()) -}))); -const GetTransactionRpcResult = jsonRpcResult(nullable(type({ - slot: number$1(), - meta: nullable(ConfirmedTransactionMetaResult), - blockTime: optional(nullable(number$1())), - transaction: ConfirmedTransactionResult, - version: optional(TransactionVersionStruct) -}))); -const GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({ - slot: number$1(), - transaction: ParsedConfirmedTransactionResult, - meta: nullable(ParsedConfirmedTransactionMetaResult), - blockTime: optional(nullable(number$1())), - version: optional(TransactionVersionStruct) -}))); -const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({ - blockhash: string$1(), - feeCalculator: type({ - lamportsPerSignature: number$1() - }) -})); -const GetLatestBlockhashRpcResult = jsonRpcResultAndContext(type({ - blockhash: string$1(), - lastValidBlockHeight: number$1() -})); -const IsBlockhashValidRpcResult = jsonRpcResultAndContext(boolean()); -const PerfSampleResult = type({ - slot: number$1(), - numTransactions: number$1(), - numSlots: number$1(), - samplePeriodSecs: number$1() -}); -const GetRecentPerformanceSamplesRpcResult = jsonRpcResult(array(PerfSampleResult)); -const GetFeeCalculatorRpcResult = jsonRpcResultAndContext(nullable(type({ - feeCalculator: type({ - lamportsPerSignature: number$1() - }) -}))); -const RequestAirdropRpcResult = jsonRpcResult(string$1()); -const SendTransactionRpcResult = jsonRpcResult(string$1()); -const LogsResult = type({ - err: TransactionErrorResult, - logs: array(string$1()), - signature: string$1() -}); -const LogsNotificationResult = type({ - result: notificationResultAndContext(LogsResult), - subscription: number$1() -}); -const COMMON_HTTP_HEADERS = { - "solana-client": `js/${"1.0.0-maintenance"}` -}; -class Connection { - /** - * Establish a JSON RPC connection - * - * @param endpoint URL to the fullnode JSON RPC endpoint - * @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object - */ - constructor(endpoint, _commitmentOrConfig) { - this._commitment = void 0; - this._confirmTransactionInitialTimeout = void 0; - this._rpcEndpoint = void 0; - this._rpcWsEndpoint = void 0; - this._rpcClient = void 0; - this._rpcRequest = void 0; - this._rpcBatchRequest = void 0; - this._rpcWebSocket = void 0; - this._rpcWebSocketConnected = false; - this._rpcWebSocketHeartbeat = null; - this._rpcWebSocketIdleTimeout = null; - this._rpcWebSocketGeneration = 0; - this._disableBlockhashCaching = false; - this._pollingBlockhash = false; - this._blockhashInfo = { - latestBlockhash: null, - lastFetch: 0, - transactionSignatures: [], - simulatedSignatures: [] - }; - this._nextClientSubscriptionId = 0; - this._subscriptionDisposeFunctionsByClientSubscriptionId = {}; - this._subscriptionHashByClientSubscriptionId = {}; - this._subscriptionStateChangeCallbacksByHash = {}; - this._subscriptionCallbacksByServerSubscriptionId = {}; - this._subscriptionsByHash = {}; - this._subscriptionsAutoDisposedByRpc = /* @__PURE__ */ new Set(); - this.getBlockHeight = (() => { - const requestPromises = {}; - return async (commitmentOrConfig) => { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config2); - const requestHash = fastStableStringify(args); - requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => { - try { - const unsafeRes = await this._rpcRequest("getBlockHeight", args); - const res = create(unsafeRes, jsonRpcResult(number$1())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get block height information"); - } - return res.result; - } finally { - delete requestPromises[requestHash]; - } - })(); - return await requestPromises[requestHash]; - }; - })(); - let wsEndpoint; - let httpHeaders; - let fetch2; - let fetchMiddleware; - let disableRetryOnRateLimit; - let httpAgent; - if (_commitmentOrConfig && typeof _commitmentOrConfig === "string") { - this._commitment = _commitmentOrConfig; - } else if (_commitmentOrConfig) { - this._commitment = _commitmentOrConfig.commitment; - this._confirmTransactionInitialTimeout = _commitmentOrConfig.confirmTransactionInitialTimeout; - wsEndpoint = _commitmentOrConfig.wsEndpoint; - httpHeaders = _commitmentOrConfig.httpHeaders; - fetch2 = _commitmentOrConfig.fetch; - fetchMiddleware = _commitmentOrConfig.fetchMiddleware; - disableRetryOnRateLimit = _commitmentOrConfig.disableRetryOnRateLimit; - httpAgent = _commitmentOrConfig.httpAgent; - } - this._rpcEndpoint = assertEndpointUrl(endpoint); - this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint); - this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch2, fetchMiddleware, disableRetryOnRateLimit, httpAgent); - this._rpcRequest = createRpcRequest(this._rpcClient); - this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient); - this._rpcWebSocket = new RpcWebSocketClient(this._rpcWsEndpoint, { - autoconnect: false, - max_reconnects: Infinity - }); - this._rpcWebSocket.on("open", this._wsOnOpen.bind(this)); - this._rpcWebSocket.on("error", this._wsOnError.bind(this)); - this._rpcWebSocket.on("close", this._wsOnClose.bind(this)); - this._rpcWebSocket.on("accountNotification", this._wsOnAccountNotification.bind(this)); - this._rpcWebSocket.on("programNotification", this._wsOnProgramAccountNotification.bind(this)); - this._rpcWebSocket.on("slotNotification", this._wsOnSlotNotification.bind(this)); - this._rpcWebSocket.on("slotsUpdatesNotification", this._wsOnSlotUpdatesNotification.bind(this)); - this._rpcWebSocket.on("signatureNotification", this._wsOnSignatureNotification.bind(this)); - this._rpcWebSocket.on("rootNotification", this._wsOnRootNotification.bind(this)); - this._rpcWebSocket.on("logsNotification", this._wsOnLogsNotification.bind(this)); - } - /** - * The default commitment used for requests - */ - get commitment() { - return this._commitment; - } - /** - * The RPC endpoint - */ - get rpcEndpoint() { - return this._rpcEndpoint; - } - /** - * Fetch the balance for the specified public key, return with context - */ - async getBalanceAndContext(publicKey2, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([publicKey2.toBase58()], commitment, void 0, config2); - const unsafeRes = await this._rpcRequest("getBalance", args); - const res = create(unsafeRes, jsonRpcResultAndContext(number$1())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get balance for ${publicKey2.toBase58()}`); - } - return res.result; - } - /** - * Fetch the balance for the specified public key - */ - async getBalance(publicKey2, commitmentOrConfig) { - return await this.getBalanceAndContext(publicKey2, commitmentOrConfig).then((x3) => x3.value).catch((e18) => { - throw new Error("failed to get balance of account " + publicKey2.toBase58() + ": " + e18); - }); - } - /** - * Fetch the estimated production time of a block - */ - async getBlockTime(slot) { - const unsafeRes = await this._rpcRequest("getBlockTime", [slot]); - const res = create(unsafeRes, jsonRpcResult(nullable(number$1()))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get block time for slot ${slot}`); - } - return res.result; - } - /** - * Fetch the lowest slot that the node has information about in its ledger. - * This value may increase over time if the node is configured to purge older ledger data - */ - async getMinimumLedgerSlot() { - const unsafeRes = await this._rpcRequest("minimumLedgerSlot", []); - const res = create(unsafeRes, jsonRpcResult(number$1())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get minimum ledger slot"); - } - return res.result; - } - /** - * Fetch the slot of the lowest confirmed block that has not been purged from the ledger - */ - async getFirstAvailableBlock() { - const unsafeRes = await this._rpcRequest("getFirstAvailableBlock", []); - const res = create(unsafeRes, SlotRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get first available block"); - } - return res.result; - } - /** - * Fetch information about the current supply - */ - async getSupply(config2) { - let configArg = {}; - if (typeof config2 === "string") { - configArg = { - commitment: config2 - }; - } else if (config2) { - configArg = { - ...config2, - commitment: config2 && config2.commitment || this.commitment - }; - } else { - configArg = { - commitment: this.commitment - }; - } - const unsafeRes = await this._rpcRequest("getSupply", [configArg]); - const res = create(unsafeRes, GetSupplyRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get supply"); - } - return res.result; - } - /** - * Fetch the current supply of a token mint - */ - async getTokenSupply(tokenMintAddress, commitment) { - const args = this._buildArgs([tokenMintAddress.toBase58()], commitment); - const unsafeRes = await this._rpcRequest("getTokenSupply", args); - const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get token supply"); - } - return res.result; - } - /** - * Fetch the current balance of a token account - */ - async getTokenAccountBalance(tokenAddress, commitment) { - const args = this._buildArgs([tokenAddress.toBase58()], commitment); - const unsafeRes = await this._rpcRequest("getTokenAccountBalance", args); - const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get token account balance"); - } - return res.result; - } - /** - * Fetch all the token accounts owned by the specified account - * - * @return {Promise} - */ - async getTokenAccountsByOwner(ownerAddress, filter2, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - let _args = [ownerAddress.toBase58()]; - if ("mint" in filter2) { - _args.push({ - mint: filter2.mint.toBase58() - }); - } else { - _args.push({ - programId: filter2.programId.toBase58() - }); - } - const args = this._buildArgs(_args, commitment, "base64", config2); - const unsafeRes = await this._rpcRequest("getTokenAccountsByOwner", args); - const res = create(unsafeRes, GetTokenAccountsByOwner); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`); - } - return res.result; - } - /** - * Fetch parsed token accounts owned by the specified account - * - * @return {Promise}>>>} - */ - async getParsedTokenAccountsByOwner(ownerAddress, filter2, commitment) { - let _args = [ownerAddress.toBase58()]; - if ("mint" in filter2) { - _args.push({ - mint: filter2.mint.toBase58() - }); - } else { - _args.push({ - programId: filter2.programId.toBase58() - }); - } - const args = this._buildArgs(_args, commitment, "jsonParsed"); - const unsafeRes = await this._rpcRequest("getTokenAccountsByOwner", args); - const res = create(unsafeRes, GetParsedTokenAccountsByOwner); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`); - } - return res.result; - } - /** - * Fetch the 20 largest accounts with their current balances - */ - async getLargestAccounts(config2) { - const arg = { - ...config2, - commitment: config2 && config2.commitment || this.commitment - }; - const args = arg.filter || arg.commitment ? [arg] : []; - const unsafeRes = await this._rpcRequest("getLargestAccounts", args); - const res = create(unsafeRes, GetLargestAccountsRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get largest accounts"); - } - return res.result; - } - /** - * Fetch the 20 largest token accounts with their current balances - * for a given mint. - */ - async getTokenLargestAccounts(mintAddress, commitment) { - const args = this._buildArgs([mintAddress.toBase58()], commitment); - const unsafeRes = await this._rpcRequest("getTokenLargestAccounts", args); - const res = create(unsafeRes, GetTokenLargestAccountsResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get token largest accounts"); - } - return res.result; - } - /** - * Fetch all the account info for the specified public key, return with context - */ - async getAccountInfoAndContext(publicKey2, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([publicKey2.toBase58()], commitment, "base64", config2); - const unsafeRes = await this._rpcRequest("getAccountInfo", args); - const res = create(unsafeRes, jsonRpcResultAndContext(nullable(AccountInfoResult))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey2.toBase58()}`); - } - return res.result; - } - /** - * Fetch parsed account info for the specified public key - */ - async getParsedAccountInfo(publicKey2, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([publicKey2.toBase58()], commitment, "jsonParsed", config2); - const unsafeRes = await this._rpcRequest("getAccountInfo", args); - const res = create(unsafeRes, jsonRpcResultAndContext(nullable(ParsedAccountInfoResult))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey2.toBase58()}`); - } - return res.result; - } - /** - * Fetch all the account info for the specified public key - */ - async getAccountInfo(publicKey2, commitmentOrConfig) { - try { - const res = await this.getAccountInfoAndContext(publicKey2, commitmentOrConfig); - return res.value; - } catch (e18) { - throw new Error("failed to get info about account " + publicKey2.toBase58() + ": " + e18); - } - } - /** - * Fetch all the account info for multiple accounts specified by an array of public keys, return with context - */ - async getMultipleParsedAccounts(publicKeys, rawConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(rawConfig); - const keys2 = publicKeys.map((key2) => key2.toBase58()); - const args = this._buildArgs([keys2], commitment, "jsonParsed", config2); - const unsafeRes = await this._rpcRequest("getMultipleAccounts", args); - const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(ParsedAccountInfoResult)))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys2}`); - } - return res.result; - } - /** - * Fetch all the account info for multiple accounts specified by an array of public keys, return with context - */ - async getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const keys2 = publicKeys.map((key2) => key2.toBase58()); - const args = this._buildArgs([keys2], commitment, "base64", config2); - const unsafeRes = await this._rpcRequest("getMultipleAccounts", args); - const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(AccountInfoResult)))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys2}`); - } - return res.result; - } - /** - * Fetch all the account info for multiple accounts specified by an array of public keys - */ - async getMultipleAccountsInfo(publicKeys, commitmentOrConfig) { - const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig); - return res.value; - } - /** - * Returns epoch activation information for a stake account that has been delegated - * - * @deprecated Deprecated since RPC v1.18; will be removed in a future version. - */ - async getStakeActivation(publicKey2, commitmentOrConfig, epoch) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([publicKey2.toBase58()], commitment, void 0, { - ...config2, - epoch: epoch != null ? epoch : config2 == null ? void 0 : config2.epoch - }); - const unsafeRes = await this._rpcRequest("getStakeActivation", args); - const res = create(unsafeRes, jsonRpcResult(StakeActivationResult)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get Stake Activation ${publicKey2.toBase58()}`); - } - return res.result; - } - /** - * Fetch all the accounts owned by the specified program id - * - * @return {Promise}>>} - */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - async getProgramAccounts(programId, configOrCommitment) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(configOrCommitment); - const { - encoding: encoding2, - ...configWithoutEncoding - } = config2 || {}; - const args = this._buildArgs([programId.toBase58()], commitment, encoding2 || "base64", { - ...configWithoutEncoding, - ...configWithoutEncoding.filters ? { - filters: applyDefaultMemcmpEncodingToFilters(configWithoutEncoding.filters) - } : null - }); - const unsafeRes = await this._rpcRequest("getProgramAccounts", args); - const baseSchema = array(KeyedAccountInfoResult); - const res = configWithoutEncoding.withContext === true ? create(unsafeRes, jsonRpcResultAndContext(baseSchema)) : create(unsafeRes, jsonRpcResult(baseSchema)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`); - } - return res.result; - } - /** - * Fetch and parse all the accounts owned by the specified program id - * - * @return {Promise}>>} - */ - async getParsedProgramAccounts(programId, configOrCommitment) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(configOrCommitment); - const args = this._buildArgs([programId.toBase58()], commitment, "jsonParsed", config2); - const unsafeRes = await this._rpcRequest("getProgramAccounts", args); - const res = create(unsafeRes, jsonRpcResult(array(KeyedParsedAccountInfoResult))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`); - } - return res.result; - } - /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - async confirmTransaction(strategy, commitment) { - var _a3; - let rawSignature; - if (typeof strategy == "string") { - rawSignature = strategy; - } else { - const config2 = strategy; - if ((_a3 = config2.abortSignal) == null ? void 0 : _a3.aborted) { - return Promise.reject(config2.abortSignal.reason); - } - rawSignature = config2.signature; - } - let decodedSignature; - try { - decodedSignature = bs58$3.decode(rawSignature); - } catch (err) { - throw new Error("signature must be base58 encoded: " + rawSignature); - } - assert$b(decodedSignature.length === 64, "signature has invalid length"); - if (typeof strategy === "string") { - return await this.confirmTransactionUsingLegacyTimeoutStrategy({ - commitment: commitment || this.commitment, - signature: rawSignature - }); - } else if ("lastValidBlockHeight" in strategy) { - return await this.confirmTransactionUsingBlockHeightExceedanceStrategy({ - commitment: commitment || this.commitment, - strategy - }); - } else { - return await this.confirmTransactionUsingDurableNonceStrategy({ - commitment: commitment || this.commitment, - strategy - }); - } - } - getCancellationPromise(signal) { - return new Promise((_3, reject) => { - if (signal == null) { - return; - } - if (signal.aborted) { - reject(signal.reason); - } else { - signal.addEventListener("abort", () => { - reject(signal.reason); - }); - } - }); - } - getTransactionConfirmationPromise({ - commitment, - signature: signature2 - }) { - let signatureSubscriptionId; - let disposeSignatureSubscriptionStateChangeObserver; - let done = false; - const confirmationPromise = new Promise((resolve, reject) => { - try { - signatureSubscriptionId = this.onSignature(signature2, (result, context) => { - signatureSubscriptionId = void 0; - const response = { - context, - value: result - }; - resolve({ - __type: TransactionStatus.PROCESSED, - response - }); - }, commitment); - const subscriptionSetupPromise = new Promise((resolveSubscriptionSetup) => { - if (signatureSubscriptionId == null) { - resolveSubscriptionSetup(); - } else { - disposeSignatureSubscriptionStateChangeObserver = this._onSubscriptionStateChange(signatureSubscriptionId, (nextState) => { - if (nextState === "subscribed") { - resolveSubscriptionSetup(); - } - }); - } - }); - (async () => { - await subscriptionSetupPromise; - if (done) - return; - const response = await this.getSignatureStatus(signature2); - if (done) - return; - if (response == null) { - return; - } - const { - context, - value - } = response; - if (value == null) { - return; - } - if (value == null ? void 0 : value.err) { - reject(value.err); - } else { - switch (commitment) { - case "confirmed": - case "single": - case "singleGossip": { - if (value.confirmationStatus === "processed") { - return; - } - break; - } - case "finalized": - case "max": - case "root": { - if (value.confirmationStatus === "processed" || value.confirmationStatus === "confirmed") { - return; - } - break; - } - case "processed": - case "recent": - } - done = true; - resolve({ - __type: TransactionStatus.PROCESSED, - response: { - context, - value - } - }); - } - })(); - } catch (err) { - reject(err); - } - }); - const abortConfirmation = () => { - if (disposeSignatureSubscriptionStateChangeObserver) { - disposeSignatureSubscriptionStateChangeObserver(); - disposeSignatureSubscriptionStateChangeObserver = void 0; - } - if (signatureSubscriptionId != null) { - this.removeSignatureListener(signatureSubscriptionId); - signatureSubscriptionId = void 0; - } - }; - return { - abortConfirmation, - confirmationPromise - }; - } - async confirmTransactionUsingBlockHeightExceedanceStrategy({ - commitment, - strategy: { - abortSignal, - lastValidBlockHeight, - signature: signature2 - } - }) { - let done = false; - const expiryPromise = new Promise((resolve) => { - const checkBlockHeight = async () => { - try { - const blockHeight = await this.getBlockHeight(commitment); - return blockHeight; - } catch (_e3) { - return -1; - } - }; - (async () => { - let currentBlockHeight = await checkBlockHeight(); - if (done) - return; - while (currentBlockHeight <= lastValidBlockHeight) { - await sleep$1(1e3); - if (done) - return; - currentBlockHeight = await checkBlockHeight(); - if (done) - return; - } - resolve({ - __type: TransactionStatus.BLOCKHEIGHT_EXCEEDED - }); - })(); - }); - const { - abortConfirmation, - confirmationPromise - } = this.getTransactionConfirmationPromise({ - commitment, - signature: signature2 - }); - const cancellationPromise = this.getCancellationPromise(abortSignal); - let result; - try { - const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]); - if (outcome.__type === TransactionStatus.PROCESSED) { - result = outcome.response; - } else { - throw new TransactionExpiredBlockheightExceededError(signature2); - } - } finally { - done = true; - abortConfirmation(); - } - return result; - } - async confirmTransactionUsingDurableNonceStrategy({ - commitment, - strategy: { - abortSignal, - minContextSlot, - nonceAccountPubkey, - nonceValue, - signature: signature2 - } - }) { - let done = false; - const expiryPromise = new Promise((resolve) => { - let currentNonceValue = nonceValue; - let lastCheckedSlot = null; - const getCurrentNonceValue = async () => { - try { - const { - context, - value: nonceAccount - } = await this.getNonceAndContext(nonceAccountPubkey, { - commitment, - minContextSlot - }); - lastCheckedSlot = context.slot; - return nonceAccount == null ? void 0 : nonceAccount.nonce; - } catch (e18) { - return currentNonceValue; - } - }; - (async () => { - currentNonceValue = await getCurrentNonceValue(); - if (done) - return; - while (true) { - if (nonceValue !== currentNonceValue) { - resolve({ - __type: TransactionStatus.NONCE_INVALID, - slotInWhichNonceDidAdvance: lastCheckedSlot - }); - return; - } - await sleep$1(2e3); - if (done) - return; - currentNonceValue = await getCurrentNonceValue(); - if (done) - return; - } - })(); - }); - const { - abortConfirmation, - confirmationPromise - } = this.getTransactionConfirmationPromise({ - commitment, - signature: signature2 - }); - const cancellationPromise = this.getCancellationPromise(abortSignal); - let result; - try { - const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]); - if (outcome.__type === TransactionStatus.PROCESSED) { - result = outcome.response; - } else { - let signatureStatus; - while (true) { - const status = await this.getSignatureStatus(signature2); - if (status == null) { - break; - } - if (status.context.slot < (outcome.slotInWhichNonceDidAdvance ?? minContextSlot)) { - await sleep$1(400); - continue; - } - signatureStatus = status; - break; - } - if (signatureStatus == null ? void 0 : signatureStatus.value) { - const commitmentForStatus = commitment || "finalized"; - const { - confirmationStatus - } = signatureStatus.value; - switch (commitmentForStatus) { - case "processed": - case "recent": - if (confirmationStatus !== "processed" && confirmationStatus !== "confirmed" && confirmationStatus !== "finalized") { - throw new TransactionExpiredNonceInvalidError(signature2); - } - break; - case "confirmed": - case "single": - case "singleGossip": - if (confirmationStatus !== "confirmed" && confirmationStatus !== "finalized") { - throw new TransactionExpiredNonceInvalidError(signature2); - } - break; - case "finalized": - case "max": - case "root": - if (confirmationStatus !== "finalized") { - throw new TransactionExpiredNonceInvalidError(signature2); - } - break; - default: - /* @__PURE__ */ ((_3) => { - })(commitmentForStatus); - } - result = { - context: signatureStatus.context, - value: { - err: signatureStatus.value.err - } - }; - } else { - throw new TransactionExpiredNonceInvalidError(signature2); - } - } - } finally { - done = true; - abortConfirmation(); - } - return result; - } - async confirmTransactionUsingLegacyTimeoutStrategy({ - commitment, - signature: signature2 - }) { - let timeoutId; - const expiryPromise = new Promise((resolve) => { - let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1e3; - switch (commitment) { - case "processed": - case "recent": - case "single": - case "confirmed": - case "singleGossip": { - timeoutMs = this._confirmTransactionInitialTimeout || 30 * 1e3; - break; - } - } - timeoutId = setTimeout(() => resolve({ - __type: TransactionStatus.TIMED_OUT, - timeoutMs - }), timeoutMs); - }); - const { - abortConfirmation, - confirmationPromise - } = this.getTransactionConfirmationPromise({ - commitment, - signature: signature2 - }); - let result; - try { - const outcome = await Promise.race([confirmationPromise, expiryPromise]); - if (outcome.__type === TransactionStatus.PROCESSED) { - result = outcome.response; - } else { - throw new TransactionExpiredTimeoutError(signature2, outcome.timeoutMs / 1e3); - } - } finally { - clearTimeout(timeoutId); - abortConfirmation(); - } - return result; - } - /** - * Return the list of nodes that are currently participating in the cluster - */ - async getClusterNodes() { - const unsafeRes = await this._rpcRequest("getClusterNodes", []); - const res = create(unsafeRes, jsonRpcResult(array(ContactInfoResult))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get cluster nodes"); - } - return res.result; - } - /** - * Return the list of nodes that are currently participating in the cluster - */ - async getVoteAccounts(commitment) { - const args = this._buildArgs([], commitment); - const unsafeRes = await this._rpcRequest("getVoteAccounts", args); - const res = create(unsafeRes, GetVoteAccounts); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get vote accounts"); - } - return res.result; - } - /** - * Fetch the current slot that the node is processing - */ - async getSlot(commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config2); - const unsafeRes = await this._rpcRequest("getSlot", args); - const res = create(unsafeRes, jsonRpcResult(number$1())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get slot"); - } - return res.result; - } - /** - * Fetch the current slot leader of the cluster - */ - async getSlotLeader(commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config2); - const unsafeRes = await this._rpcRequest("getSlotLeader", args); - const res = create(unsafeRes, jsonRpcResult(string$1())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get slot leader"); - } - return res.result; - } - /** - * Fetch `limit` number of slot leaders starting from `startSlot` - * - * @param startSlot fetch slot leaders starting from this slot - * @param limit number of slot leaders to return - */ - async getSlotLeaders(startSlot, limit) { - const args = [startSlot, limit]; - const unsafeRes = await this._rpcRequest("getSlotLeaders", args); - const res = create(unsafeRes, jsonRpcResult(array(PublicKeyFromString))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get slot leaders"); - } - return res.result; - } - /** - * Fetch the current status of a signature - */ - async getSignatureStatus(signature2, config2) { - const { - context, - value: values - } = await this.getSignatureStatuses([signature2], config2); - assert$b(values.length === 1); - const value = values[0]; - return { - context, - value - }; - } - /** - * Fetch the current statuses of a batch of signatures - */ - async getSignatureStatuses(signatures, config2) { - const params = [signatures]; - if (config2) { - params.push(config2); - } - const unsafeRes = await this._rpcRequest("getSignatureStatuses", params); - const res = create(unsafeRes, GetSignatureStatusesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get signature status"); - } - return res.result; - } - /** - * Fetch the current transaction count of the cluster - */ - async getTransactionCount(commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config2); - const unsafeRes = await this._rpcRequest("getTransactionCount", args); - const res = create(unsafeRes, jsonRpcResult(number$1())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get transaction count"); - } - return res.result; - } - /** - * Fetch the current total currency supply of the cluster in lamports - * - * @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead. - */ - async getTotalSupply(commitment) { - const result = await this.getSupply({ - commitment, - excludeNonCirculatingAccountsList: true - }); - return result.value.total; - } - /** - * Fetch the cluster InflationGovernor parameters - */ - async getInflationGovernor(commitment) { - const args = this._buildArgs([], commitment); - const unsafeRes = await this._rpcRequest("getInflationGovernor", args); - const res = create(unsafeRes, GetInflationGovernorRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get inflation"); - } - return res.result; - } - /** - * Fetch the inflation reward for a list of addresses for an epoch - */ - async getInflationReward(addresses, epoch, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([addresses.map((pubkey) => pubkey.toBase58())], commitment, void 0, { - ...config2, - epoch: epoch != null ? epoch : config2 == null ? void 0 : config2.epoch - }); - const unsafeRes = await this._rpcRequest("getInflationReward", args); - const res = create(unsafeRes, GetInflationRewardResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get inflation reward"); - } - return res.result; - } - /** - * Fetch the specific inflation values for the current epoch - */ - async getInflationRate() { - const unsafeRes = await this._rpcRequest("getInflationRate", []); - const res = create(unsafeRes, GetInflationRateRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get inflation rate"); - } - return res.result; - } - /** - * Fetch the Epoch Info parameters - */ - async getEpochInfo(commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config2); - const unsafeRes = await this._rpcRequest("getEpochInfo", args); - const res = create(unsafeRes, GetEpochInfoRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get epoch info"); - } - return res.result; - } - /** - * Fetch the Epoch Schedule parameters - */ - async getEpochSchedule() { - const unsafeRes = await this._rpcRequest("getEpochSchedule", []); - const res = create(unsafeRes, GetEpochScheduleRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get epoch schedule"); - } - const epochSchedule = res.result; - return new EpochSchedule(epochSchedule.slotsPerEpoch, epochSchedule.leaderScheduleSlotOffset, epochSchedule.warmup, epochSchedule.firstNormalEpoch, epochSchedule.firstNormalSlot); - } - /** - * Fetch the leader schedule for the current epoch - * @return {Promise>} - */ - async getLeaderSchedule() { - const unsafeRes = await this._rpcRequest("getLeaderSchedule", []); - const res = create(unsafeRes, GetLeaderScheduleRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get leader schedule"); - } - return res.result; - } - /** - * Fetch the minimum balance needed to exempt an account of `dataLength` - * size from rent - */ - async getMinimumBalanceForRentExemption(dataLength2, commitment) { - const args = this._buildArgs([dataLength2], commitment); - const unsafeRes = await this._rpcRequest("getMinimumBalanceForRentExemption", args); - const res = create(unsafeRes, GetMinimumBalanceForRentExemptionRpcResult); - if ("error" in res) { - console.warn("Unable to fetch minimum balance for rent exemption"); - return 0; - } - return res.result; - } - /** - * Fetch a recent blockhash from the cluster, return with context - * @return {Promise>} - * - * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead. - */ - async getRecentBlockhashAndContext(commitment) { - const args = this._buildArgs([], commitment); - const unsafeRes = await this._rpcRequest("getRecentBlockhash", args); - const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get recent blockhash"); - } - return res.result; - } - /** - * Fetch recent performance samples - * @return {Promise>} - */ - async getRecentPerformanceSamples(limit) { - const unsafeRes = await this._rpcRequest("getRecentPerformanceSamples", limit ? [limit] : []); - const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get recent performance samples"); - } - return res.result; - } - /** - * Fetch the fee calculator for a recent blockhash from the cluster, return with context - * - * @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead. - */ - async getFeeCalculatorForBlockhash(blockhash, commitment) { - const args = this._buildArgs([blockhash], commitment); - const unsafeRes = await this._rpcRequest("getFeeCalculatorForBlockhash", args); - const res = create(unsafeRes, GetFeeCalculatorRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get fee calculator"); - } - const { - context, - value - } = res.result; - return { - context, - value: value !== null ? value.feeCalculator : null - }; - } - /** - * Fetch the fee for a message from the cluster, return with context - */ - async getFeeForMessage(message2, commitment) { - const wireMessage = toBuffer(message2.serialize()).toString("base64"); - const args = this._buildArgs([wireMessage], commitment); - const unsafeRes = await this._rpcRequest("getFeeForMessage", args); - const res = create(unsafeRes, jsonRpcResultAndContext(nullable(number$1()))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get fee for message"); - } - if (res.result === null) { - throw new Error("invalid blockhash"); - } - return res.result; - } - /** - * Fetch a list of prioritization fees from recent blocks. - */ - async getRecentPrioritizationFees(config2) { - var _a3; - const accounts2 = (_a3 = config2 == null ? void 0 : config2.lockedWritableAccounts) == null ? void 0 : _a3.map((key2) => key2.toBase58()); - const args = (accounts2 == null ? void 0 : accounts2.length) ? [accounts2] : []; - const unsafeRes = await this._rpcRequest("getRecentPrioritizationFees", args); - const res = create(unsafeRes, GetRecentPrioritizationFeesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get recent prioritization fees"); - } - return res.result; - } - /** - * Fetch a recent blockhash from the cluster - * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>} - * - * @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead. - */ - async getRecentBlockhash(commitment) { - try { - const res = await this.getRecentBlockhashAndContext(commitment); - return res.value; - } catch (e18) { - throw new Error("failed to get recent blockhash: " + e18); - } - } - /** - * Fetch the latest blockhash from the cluster - * @return {Promise} - */ - async getLatestBlockhash(commitmentOrConfig) { - try { - const res = await this.getLatestBlockhashAndContext(commitmentOrConfig); - return res.value; - } catch (e18) { - throw new Error("failed to get recent blockhash: " + e18); - } - } - /** - * Fetch the latest blockhash from the cluster - * @return {Promise} - */ - async getLatestBlockhashAndContext(commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config2); - const unsafeRes = await this._rpcRequest("getLatestBlockhash", args); - const res = create(unsafeRes, GetLatestBlockhashRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get latest blockhash"); - } - return res.result; - } - /** - * Returns whether a blockhash is still valid or not - */ - async isBlockhashValid(blockhash, rawConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(rawConfig); - const args = this._buildArgs([blockhash], commitment, void 0, config2); - const unsafeRes = await this._rpcRequest("isBlockhashValid", args); - const res = create(unsafeRes, IsBlockhashValidRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to determine if the blockhash `" + blockhash + "`is valid"); - } - return res.result; - } - /** - * Fetch the node version - */ - async getVersion() { - const unsafeRes = await this._rpcRequest("getVersion", []); - const res = create(unsafeRes, jsonRpcResult(VersionResult)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get version"); - } - return res.result; - } - /** - * Fetch the genesis hash - */ - async getGenesisHash() { - const unsafeRes = await this._rpcRequest("getGenesisHash", []); - const res = create(unsafeRes, jsonRpcResult(string$1())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get genesis hash"); - } - return res.result; - } - /** - * Fetch a processed block from the cluster. - * - * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by - * setting the `maxSupportedTransactionVersion` property. - */ - /** - * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by - * setting the `maxSupportedTransactionVersion` property. - */ - // eslint-disable-next-line no-dupe-class-members - /** - * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by - * setting the `maxSupportedTransactionVersion` property. - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Fetch a processed block from the cluster. - */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - /** - * Fetch a processed block from the cluster. - */ - // eslint-disable-next-line no-dupe-class-members - async getBlock(slot, rawConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(rawConfig); - const args = this._buildArgsAtLeastConfirmed([slot], commitment, void 0, config2); - const unsafeRes = await this._rpcRequest("getBlock", args); - try { - switch (config2 == null ? void 0 : config2.transactionDetails) { - case "accounts": { - const res = create(unsafeRes, GetAccountsModeBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - case "none": { - const res = create(unsafeRes, GetNoneModeBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - default: { - const res = create(unsafeRes, GetBlockRpcResult); - if ("error" in res) { - throw res.error; - } - const { - result - } = res; - return result ? { - ...result, - transactions: result.transactions.map(({ - transaction: transaction2, - meta, - version: version2 - }) => ({ - meta, - transaction: { - ...transaction2, - message: versionedMessageFromResponse(version2, transaction2.message) - }, - version: version2 - })) - } : null; - } - } - } catch (e18) { - throw new SolanaJSONRPCError(e18, "failed to get confirmed block"); - } - } - /** - * Fetch parsed transaction details for a confirmed or finalized block - */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - async getParsedBlock(slot, rawConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(rawConfig); - const args = this._buildArgsAtLeastConfirmed([slot], commitment, "jsonParsed", config2); - const unsafeRes = await this._rpcRequest("getBlock", args); - try { - switch (config2 == null ? void 0 : config2.transactionDetails) { - case "accounts": { - const res = create(unsafeRes, GetParsedAccountsModeBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - case "none": { - const res = create(unsafeRes, GetParsedNoneModeBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - default: { - const res = create(unsafeRes, GetParsedBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - } - } catch (e18) { - throw new SolanaJSONRPCError(e18, "failed to get block"); - } - } - /* - * Returns recent block production information from the current or previous epoch - */ - async getBlockProduction(configOrCommitment) { - let extra; - let commitment; - if (typeof configOrCommitment === "string") { - commitment = configOrCommitment; - } else if (configOrCommitment) { - const { - commitment: c2, - ...rest - } = configOrCommitment; - commitment = c2; - extra = rest; - } - const args = this._buildArgs([], commitment, "base64", extra); - const unsafeRes = await this._rpcRequest("getBlockProduction", args); - const res = create(unsafeRes, BlockProductionResponseStruct); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get block production information"); - } - return res.result; - } - /** - * Fetch a confirmed or finalized transaction from the cluster. - * - * @deprecated Instead, call `getTransaction` using a - * `GetVersionedTransactionConfig` by setting the - * `maxSupportedTransactionVersion` property. - */ - /** - * Fetch a confirmed or finalized transaction from the cluster. - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Fetch a confirmed or finalized transaction from the cluster. - */ - // eslint-disable-next-line no-dupe-class-members - async getTransaction(signature2, rawConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(rawConfig); - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, void 0, config2); - const unsafeRes = await this._rpcRequest("getTransaction", args); - const res = create(unsafeRes, GetTransactionRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get transaction"); - } - const result = res.result; - if (!result) - return result; - return { - ...result, - transaction: { - ...result.transaction, - message: versionedMessageFromResponse(result.version, result.transaction.message) - } - }; - } - /** - * Fetch parsed transaction details for a confirmed or finalized transaction - */ - async getParsedTransaction(signature2, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed", config2); - const unsafeRes = await this._rpcRequest("getTransaction", args); - const res = create(unsafeRes, GetParsedTransactionRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get transaction"); - } - return res.result; - } - /** - * Fetch parsed transaction details for a batch of confirmed transactions - */ - async getParsedTransactions(signatures, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const batch = signatures.map((signature2) => { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed", config2); - return { - methodName: "getTransaction", - args - }; - }); - const unsafeRes = await this._rpcBatchRequest(batch); - const res = unsafeRes.map((unsafeRes2) => { - const res2 = create(unsafeRes2, GetParsedTransactionRpcResult); - if ("error" in res2) { - throw new SolanaJSONRPCError(res2.error, "failed to get transactions"); - } - return res2.result; - }); - return res; - } - /** - * Fetch transaction details for a batch of confirmed transactions. - * Similar to {@link getParsedTransactions} but returns a {@link TransactionResponse}. - * - * @deprecated Instead, call `getTransactions` using a - * `GetVersionedTransactionConfig` by setting the - * `maxSupportedTransactionVersion` property. - */ - /** - * Fetch transaction details for a batch of confirmed transactions. - * Similar to {@link getParsedTransactions} but returns a {@link - * VersionedTransactionResponse}. - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Fetch transaction details for a batch of confirmed transactions. - * Similar to {@link getParsedTransactions} but returns a {@link - * VersionedTransactionResponse}. - */ - // eslint-disable-next-line no-dupe-class-members - async getTransactions(signatures, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const batch = signatures.map((signature2) => { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, void 0, config2); - return { - methodName: "getTransaction", - args - }; - }); - const unsafeRes = await this._rpcBatchRequest(batch); - const res = unsafeRes.map((unsafeRes2) => { - const res2 = create(unsafeRes2, GetTransactionRpcResult); - if ("error" in res2) { - throw new SolanaJSONRPCError(res2.error, "failed to get transactions"); - } - const result = res2.result; - if (!result) - return result; - return { - ...result, - transaction: { - ...result.transaction, - message: versionedMessageFromResponse(result.version, result.transaction.message) - } - }; - }); - return res; - } - /** - * Fetch a list of Transactions and transaction statuses from the cluster - * for a confirmed block. - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead. - */ - async getConfirmedBlock(slot, commitment) { - const args = this._buildArgsAtLeastConfirmed([slot], commitment); - const unsafeRes = await this._rpcRequest("getConfirmedBlock", args); - const res = create(unsafeRes, GetConfirmedBlockRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get confirmed block"); - } - const result = res.result; - if (!result) { - throw new Error("Confirmed block " + slot + " not found"); - } - const block = { - ...result, - transactions: result.transactions.map(({ - transaction: transaction2, - meta - }) => { - const message2 = new Message(transaction2.message); - return { - meta, - transaction: { - ...transaction2, - message: message2 - } - }; - }) - }; - return { - ...block, - transactions: block.transactions.map(({ - transaction: transaction2, - meta - }) => { - return { - meta, - transaction: Transaction$2.populate(transaction2.message, transaction2.signatures) - }; - }) - }; - } - /** - * Fetch confirmed blocks between two slots - */ - async getBlocks(startSlot, endSlot, commitment) { - const args = this._buildArgsAtLeastConfirmed(endSlot !== void 0 ? [startSlot, endSlot] : [startSlot], commitment); - const unsafeRes = await this._rpcRequest("getBlocks", args); - const res = create(unsafeRes, jsonRpcResult(array(number$1()))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get blocks"); - } - return res.result; - } - /** - * Fetch a list of Signatures from the cluster for a block, excluding rewards - */ - async getBlockSignatures(slot, commitment) { - const args = this._buildArgsAtLeastConfirmed([slot], commitment, void 0, { - transactionDetails: "signatures", - rewards: false - }); - const unsafeRes = await this._rpcRequest("getBlock", args); - const res = create(unsafeRes, GetBlockSignaturesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get block"); - } - const result = res.result; - if (!result) { - throw new Error("Block " + slot + " not found"); - } - return result; - } - /** - * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead. - */ - async getConfirmedBlockSignatures(slot, commitment) { - const args = this._buildArgsAtLeastConfirmed([slot], commitment, void 0, { - transactionDetails: "signatures", - rewards: false - }); - const unsafeRes = await this._rpcRequest("getConfirmedBlock", args); - const res = create(unsafeRes, GetBlockSignaturesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get confirmed block"); - } - const result = res.result; - if (!result) { - throw new Error("Confirmed block " + slot + " not found"); - } - return result; - } - /** - * Fetch a transaction details for a confirmed transaction - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead. - */ - async getConfirmedTransaction(signature2, commitment) { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment); - const unsafeRes = await this._rpcRequest("getConfirmedTransaction", args); - const res = create(unsafeRes, GetTransactionRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get transaction"); - } - const result = res.result; - if (!result) - return result; - const message2 = new Message(result.transaction.message); - const signatures = result.transaction.signatures; - return { - ...result, - transaction: Transaction$2.populate(message2, signatures) - }; - } - /** - * Fetch parsed transaction details for a confirmed transaction - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead. - */ - async getParsedConfirmedTransaction(signature2, commitment) { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed"); - const unsafeRes = await this._rpcRequest("getConfirmedTransaction", args); - const res = create(unsafeRes, GetParsedTransactionRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get confirmed transaction"); - } - return res.result; - } - /** - * Fetch parsed transaction details for a batch of confirmed transactions - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead. - */ - async getParsedConfirmedTransactions(signatures, commitment) { - const batch = signatures.map((signature2) => { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed"); - return { - methodName: "getConfirmedTransaction", - args - }; - }); - const unsafeRes = await this._rpcBatchRequest(batch); - const res = unsafeRes.map((unsafeRes2) => { - const res2 = create(unsafeRes2, GetParsedTransactionRpcResult); - if ("error" in res2) { - throw new SolanaJSONRPCError(res2.error, "failed to get confirmed transactions"); - } - return res2.result; - }); - return res; - } - /** - * Fetch a list of all the confirmed signatures for transactions involving an address - * within a specified slot range. Max range allowed is 10,000 slots. - * - * @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead. - * - * @param address queried address - * @param startSlot start slot, inclusive - * @param endSlot end slot, inclusive - */ - async getConfirmedSignaturesForAddress(address2, startSlot, endSlot) { - let options = {}; - let firstAvailableBlock = await this.getFirstAvailableBlock(); - while (!("until" in options)) { - startSlot--; - if (startSlot <= 0 || startSlot < firstAvailableBlock) { - break; - } - try { - const block = await this.getConfirmedBlockSignatures(startSlot, "finalized"); - if (block.signatures.length > 0) { - options.until = block.signatures[block.signatures.length - 1].toString(); - } - } catch (err) { - if (err instanceof Error && err.message.includes("skipped")) { - continue; - } else { - throw err; - } - } - } - let highestConfirmedRoot = await this.getSlot("finalized"); - while (!("before" in options)) { - endSlot++; - if (endSlot > highestConfirmedRoot) { - break; - } - try { - const block = await this.getConfirmedBlockSignatures(endSlot); - if (block.signatures.length > 0) { - options.before = block.signatures[block.signatures.length - 1].toString(); - } - } catch (err) { - if (err instanceof Error && err.message.includes("skipped")) { - continue; - } else { - throw err; - } - } - } - const confirmedSignatureInfo = await this.getConfirmedSignaturesForAddress2(address2, options); - return confirmedSignatureInfo.map((info) => info.signature); - } - /** - * Returns confirmed signatures for transactions involving an - * address backwards in time from the provided signature or most recent confirmed block - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead. - */ - async getConfirmedSignaturesForAddress2(address2, options, commitment) { - const args = this._buildArgsAtLeastConfirmed([address2.toBase58()], commitment, void 0, options); - const unsafeRes = await this._rpcRequest("getConfirmedSignaturesForAddress2", args); - const res = create(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get confirmed signatures for address"); - } - return res.result; - } - /** - * Returns confirmed signatures for transactions involving an - * address backwards in time from the provided signature or most recent confirmed block - * - * - * @param address queried address - * @param options - */ - async getSignaturesForAddress(address2, options, commitment) { - const args = this._buildArgsAtLeastConfirmed([address2.toBase58()], commitment, void 0, options); - const unsafeRes = await this._rpcRequest("getSignaturesForAddress", args); - const res = create(unsafeRes, GetSignaturesForAddressRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get signatures for address"); - } - return res.result; - } - async getAddressLookupTable(accountKey, config2) { - const { - context, - value: accountInfo - } = await this.getAccountInfoAndContext(accountKey, config2); - let value = null; - if (accountInfo !== null) { - value = new AddressLookupTableAccount({ - key: accountKey, - state: AddressLookupTableAccount.deserialize(accountInfo.data) - }); - } - return { - context, - value - }; - } - /** - * Fetch the contents of a Nonce account from the cluster, return with context - */ - async getNonceAndContext(nonceAccount, commitmentOrConfig) { - const { - context, - value: accountInfo - } = await this.getAccountInfoAndContext(nonceAccount, commitmentOrConfig); - let value = null; - if (accountInfo !== null) { - value = NonceAccount.fromAccountData(accountInfo.data); - } - return { - context, - value - }; - } - /** - * Fetch the contents of a Nonce account from the cluster - */ - async getNonce(nonceAccount, commitmentOrConfig) { - return await this.getNonceAndContext(nonceAccount, commitmentOrConfig).then((x3) => x3.value).catch((e18) => { - throw new Error("failed to get nonce for account " + nonceAccount.toBase58() + ": " + e18); - }); - } - /** - * Request an allocation of lamports to the specified address - * - * ```typescript - * import { Connection, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js"; - * - * (async () => { - * const connection = new Connection("https://api.testnet.solana.com", "confirmed"); - * const myAddress = new PublicKey("2nr1bHFT86W9tGnyvmYW4vcHKsQB3sVQfnddasz4kExM"); - * const signature = await connection.requestAirdrop(myAddress, LAMPORTS_PER_SOL); - * await connection.confirmTransaction(signature); - * })(); - * ``` - */ - async requestAirdrop(to2, lamports) { - const unsafeRes = await this._rpcRequest("requestAirdrop", [to2.toBase58(), lamports]); - const res = create(unsafeRes, RequestAirdropRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `airdrop to ${to2.toBase58()} failed`); - } - return res.result; - } - /** - * @internal - */ - async _blockhashWithExpiryBlockHeight(disableCache) { - if (!disableCache) { - while (this._pollingBlockhash) { - await sleep$1(100); - } - const timeSinceFetch = Date.now() - this._blockhashInfo.lastFetch; - const expired = timeSinceFetch >= BLOCKHASH_CACHE_TIMEOUT_MS; - if (this._blockhashInfo.latestBlockhash !== null && !expired) { - return this._blockhashInfo.latestBlockhash; - } - } - return await this._pollNewBlockhash(); - } - /** - * @internal - */ - async _pollNewBlockhash() { - this._pollingBlockhash = true; - try { - const startTime = Date.now(); - const cachedLatestBlockhash = this._blockhashInfo.latestBlockhash; - const cachedBlockhash = cachedLatestBlockhash ? cachedLatestBlockhash.blockhash : null; - for (let i3 = 0; i3 < 50; i3++) { - const latestBlockhash = await this.getLatestBlockhash("finalized"); - if (cachedBlockhash !== latestBlockhash.blockhash) { - this._blockhashInfo = { - latestBlockhash, - lastFetch: Date.now(), - transactionSignatures: [], - simulatedSignatures: [] - }; - return latestBlockhash; - } - await sleep$1(MS_PER_SLOT / 2); - } - throw new Error(`Unable to obtain a new blockhash after ${Date.now() - startTime}ms`); - } finally { - this._pollingBlockhash = false; - } - } - /** - * get the stake minimum delegation - */ - async getStakeMinimumDelegation(config2) { - const { - commitment, - config: configArg - } = extractCommitmentFromConfig(config2); - const args = this._buildArgs([], commitment, "base64", configArg); - const unsafeRes = await this._rpcRequest("getStakeMinimumDelegation", args); - const res = create(unsafeRes, jsonRpcResultAndContext(number$1())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get stake minimum delegation`); - } - return res.result; - } - /** - * Simulate a transaction - * - * @deprecated Instead, call {@link simulateTransaction} with {@link - * VersionedTransaction} and {@link SimulateTransactionConfig} parameters - */ - /** - * Simulate a transaction - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Simulate a transaction - */ - // eslint-disable-next-line no-dupe-class-members - async simulateTransaction(transactionOrMessage, configOrSigners, includeAccounts) { - if ("message" in transactionOrMessage) { - const versionedTx = transactionOrMessage; - const wireTransaction2 = versionedTx.serialize(); - const encodedTransaction2 = buffer.Buffer.from(wireTransaction2).toString("base64"); - if (Array.isArray(configOrSigners) || includeAccounts !== void 0) { - throw new Error("Invalid arguments"); - } - const config3 = configOrSigners || {}; - config3.encoding = "base64"; - if (!("commitment" in config3)) { - config3.commitment = this.commitment; - } - if (configOrSigners && typeof configOrSigners === "object" && "innerInstructions" in configOrSigners) { - config3.innerInstructions = configOrSigners.innerInstructions; - } - const args2 = [encodedTransaction2, config3]; - const unsafeRes2 = await this._rpcRequest("simulateTransaction", args2); - const res2 = create(unsafeRes2, SimulatedTransactionResponseStruct); - if ("error" in res2) { - throw new Error("failed to simulate transaction: " + res2.error.message); - } - return res2.result; - } - let transaction2; - if (transactionOrMessage instanceof Transaction$2) { - let originalTx = transactionOrMessage; - transaction2 = new Transaction$2(); - transaction2.feePayer = originalTx.feePayer; - transaction2.instructions = transactionOrMessage.instructions; - transaction2.nonceInfo = originalTx.nonceInfo; - transaction2.signatures = originalTx.signatures; - } else { - transaction2 = Transaction$2.populate(transactionOrMessage); - transaction2._message = transaction2._json = void 0; - } - if (configOrSigners !== void 0 && !Array.isArray(configOrSigners)) { - throw new Error("Invalid arguments"); - } - const signers = configOrSigners; - if (transaction2.nonceInfo && signers) { - transaction2.sign(...signers); - } else { - let disableCache = this._disableBlockhashCaching; - for (; ; ) { - const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache); - transaction2.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight; - transaction2.recentBlockhash = latestBlockhash.blockhash; - if (!signers) - break; - transaction2.sign(...signers); - if (!transaction2.signature) { - throw new Error("!signature"); - } - const signature2 = transaction2.signature.toString("base64"); - if (!this._blockhashInfo.simulatedSignatures.includes(signature2) && !this._blockhashInfo.transactionSignatures.includes(signature2)) { - this._blockhashInfo.simulatedSignatures.push(signature2); - break; - } else { - disableCache = true; - } - } - } - const message2 = transaction2._compile(); - const signData = message2.serialize(); - const wireTransaction = transaction2._serialize(signData); - const encodedTransaction = wireTransaction.toString("base64"); - const config2 = { - encoding: "base64", - commitment: this.commitment - }; - if (includeAccounts) { - const addresses = (Array.isArray(includeAccounts) ? includeAccounts : message2.nonProgramIds()).map((key2) => key2.toBase58()); - config2["accounts"] = { - encoding: "base64", - addresses - }; - } - if (signers) { - config2.sigVerify = true; - } - if (configOrSigners && typeof configOrSigners === "object" && "innerInstructions" in configOrSigners) { - config2.innerInstructions = configOrSigners.innerInstructions; - } - const args = [encodedTransaction, config2]; - const unsafeRes = await this._rpcRequest("simulateTransaction", args); - const res = create(unsafeRes, SimulatedTransactionResponseStruct); - if ("error" in res) { - let logs; - if ("data" in res.error) { - logs = res.error.data.logs; - if (logs && Array.isArray(logs)) { - const traceIndent = "\n "; - const logTrace = traceIndent + logs.join(traceIndent); - console.error(res.error.message, logTrace); - } - } - throw new SendTransactionError({ - action: "simulate", - signature: "", - transactionMessage: res.error.message, - logs - }); - } - return res.result; - } - /** - * Sign and send a transaction - * - * @deprecated Instead, call {@link sendTransaction} with a {@link - * VersionedTransaction} - */ - /** - * Send a signed transaction - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Sign and send a transaction - */ - // eslint-disable-next-line no-dupe-class-members - async sendTransaction(transaction2, signersOrOptions, options) { - if ("version" in transaction2) { - if (signersOrOptions && Array.isArray(signersOrOptions)) { - throw new Error("Invalid arguments"); - } - const wireTransaction2 = transaction2.serialize(); - return await this.sendRawTransaction(wireTransaction2, signersOrOptions); - } - if (signersOrOptions === void 0 || !Array.isArray(signersOrOptions)) { - throw new Error("Invalid arguments"); - } - const signers = signersOrOptions; - if (transaction2.nonceInfo) { - transaction2.sign(...signers); - } else { - let disableCache = this._disableBlockhashCaching; - for (; ; ) { - const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache); - transaction2.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight; - transaction2.recentBlockhash = latestBlockhash.blockhash; - transaction2.sign(...signers); - if (!transaction2.signature) { - throw new Error("!signature"); - } - const signature2 = transaction2.signature.toString("base64"); - if (!this._blockhashInfo.transactionSignatures.includes(signature2)) { - this._blockhashInfo.transactionSignatures.push(signature2); - break; - } else { - disableCache = true; - } - } - } - const wireTransaction = transaction2.serialize(); - return await this.sendRawTransaction(wireTransaction, options); - } - /** - * Send a transaction that has already been signed and serialized into the - * wire format - */ - async sendRawTransaction(rawTransaction, options) { - const encodedTransaction = toBuffer(rawTransaction).toString("base64"); - const result = await this.sendEncodedTransaction(encodedTransaction, options); - return result; - } - /** - * Send a transaction that has already been signed, serialized into the - * wire format, and encoded as a base64 string - */ - async sendEncodedTransaction(encodedTransaction, options) { - const config2 = { - encoding: "base64" - }; - const skipPreflight = options && options.skipPreflight; - const preflightCommitment = skipPreflight === true ? "processed" : options && options.preflightCommitment || this.commitment; - if (options && options.maxRetries != null) { - config2.maxRetries = options.maxRetries; - } - if (options && options.minContextSlot != null) { - config2.minContextSlot = options.minContextSlot; - } - if (skipPreflight) { - config2.skipPreflight = skipPreflight; - } - if (preflightCommitment) { - config2.preflightCommitment = preflightCommitment; - } - const args = [encodedTransaction, config2]; - const unsafeRes = await this._rpcRequest("sendTransaction", args); - const res = create(unsafeRes, SendTransactionRpcResult); - if ("error" in res) { - let logs = void 0; - if ("data" in res.error) { - logs = res.error.data.logs; - } - throw new SendTransactionError({ - action: skipPreflight ? "send" : "simulate", - signature: "", - transactionMessage: res.error.message, - logs - }); - } - return res.result; - } - /** - * @internal - */ - _wsOnOpen() { - this._rpcWebSocketConnected = true; - this._rpcWebSocketHeartbeat = setInterval(() => { - (async () => { - try { - await this._rpcWebSocket.notify("ping"); - } catch { - } - })(); - }, 5e3); - this._updateSubscriptions(); - } - /** - * @internal - */ - _wsOnError(err) { - this._rpcWebSocketConnected = false; - console.error("ws error:", err.message); - } - /** - * @internal - */ - _wsOnClose(code2) { - this._rpcWebSocketConnected = false; - this._rpcWebSocketGeneration = (this._rpcWebSocketGeneration + 1) % Number.MAX_SAFE_INTEGER; - if (this._rpcWebSocketIdleTimeout) { - clearTimeout(this._rpcWebSocketIdleTimeout); - this._rpcWebSocketIdleTimeout = null; - } - if (this._rpcWebSocketHeartbeat) { - clearInterval(this._rpcWebSocketHeartbeat); - this._rpcWebSocketHeartbeat = null; - } - if (code2 === 1e3) { - this._updateSubscriptions(); - return; - } - this._subscriptionCallbacksByServerSubscriptionId = {}; - Object.entries(this._subscriptionsByHash).forEach(([hash3, subscription]) => { - this._setSubscription(hash3, { - ...subscription, - state: "pending" - }); - }); - } - /** - * @internal - */ - _setSubscription(hash3, nextSubscription) { - var _a3; - const prevState = (_a3 = this._subscriptionsByHash[hash3]) == null ? void 0 : _a3.state; - this._subscriptionsByHash[hash3] = nextSubscription; - if (prevState !== nextSubscription.state) { - const stateChangeCallbacks = this._subscriptionStateChangeCallbacksByHash[hash3]; - if (stateChangeCallbacks) { - stateChangeCallbacks.forEach((cb2) => { - try { - cb2(nextSubscription.state); - } catch { - } - }); - } - } - } - /** - * @internal - */ - _onSubscriptionStateChange(clientSubscriptionId, callback) { - var _a3; - const hash3 = this._subscriptionHashByClientSubscriptionId[clientSubscriptionId]; - if (hash3 == null) { - return () => { - }; - } - const stateChangeCallbacks = (_a3 = this._subscriptionStateChangeCallbacksByHash)[hash3] || (_a3[hash3] = /* @__PURE__ */ new Set()); - stateChangeCallbacks.add(callback); - return () => { - stateChangeCallbacks.delete(callback); - if (stateChangeCallbacks.size === 0) { - delete this._subscriptionStateChangeCallbacksByHash[hash3]; - } - }; - } - /** - * @internal - */ - async _updateSubscriptions() { - if (Object.keys(this._subscriptionsByHash).length === 0) { - if (this._rpcWebSocketConnected) { - this._rpcWebSocketConnected = false; - this._rpcWebSocketIdleTimeout = setTimeout(() => { - this._rpcWebSocketIdleTimeout = null; - try { - this._rpcWebSocket.close(); - } catch (err) { - if (err instanceof Error) { - console.log(`Error when closing socket connection: ${err.message}`); - } - } - }, 500); - } - return; - } - if (this._rpcWebSocketIdleTimeout !== null) { - clearTimeout(this._rpcWebSocketIdleTimeout); - this._rpcWebSocketIdleTimeout = null; - this._rpcWebSocketConnected = true; - } - if (!this._rpcWebSocketConnected) { - this._rpcWebSocket.connect(); - return; - } - const activeWebSocketGeneration = this._rpcWebSocketGeneration; - const isCurrentConnectionStillActive = () => { - return activeWebSocketGeneration === this._rpcWebSocketGeneration; - }; - await Promise.all( - // Don't be tempted to change this to `Object.entries`. We call - // `_updateSubscriptions` recursively when processing the state, - // so it's important that we look up the *current* version of - // each subscription, every time we process a hash. - Object.keys(this._subscriptionsByHash).map(async (hash3) => { - const subscription = this._subscriptionsByHash[hash3]; - if (subscription === void 0) { - return; - } - switch (subscription.state) { - case "pending": - case "unsubscribed": - if (subscription.callbacks.size === 0) { - delete this._subscriptionsByHash[hash3]; - if (subscription.state === "unsubscribed") { - delete this._subscriptionCallbacksByServerSubscriptionId[subscription.serverSubscriptionId]; - } - await this._updateSubscriptions(); - return; - } - await (async () => { - const { - args, - method - } = subscription; - try { - this._setSubscription(hash3, { - ...subscription, - state: "subscribing" - }); - const serverSubscriptionId = await this._rpcWebSocket.call(method, args); - this._setSubscription(hash3, { - ...subscription, - serverSubscriptionId, - state: "subscribed" - }); - this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId] = subscription.callbacks; - await this._updateSubscriptions(); - } catch (e18) { - console.error(`Received ${e18 instanceof Error ? "" : "JSON-RPC "}error calling \`${method}\``, { - args, - error: e18 - }); - if (!isCurrentConnectionStillActive()) { - return; - } - this._setSubscription(hash3, { - ...subscription, - state: "pending" - }); - await this._updateSubscriptions(); - } - })(); - break; - case "subscribed": - if (subscription.callbacks.size === 0) { - await (async () => { - const { - serverSubscriptionId, - unsubscribeMethod - } = subscription; - if (this._subscriptionsAutoDisposedByRpc.has(serverSubscriptionId)) { - this._subscriptionsAutoDisposedByRpc.delete(serverSubscriptionId); - } else { - this._setSubscription(hash3, { - ...subscription, - state: "unsubscribing" - }); - this._setSubscription(hash3, { - ...subscription, - state: "unsubscribing" - }); - try { - await this._rpcWebSocket.call(unsubscribeMethod, [serverSubscriptionId]); - } catch (e18) { - if (e18 instanceof Error) { - console.error(`${unsubscribeMethod} error:`, e18.message); - } - if (!isCurrentConnectionStillActive()) { - return; - } - this._setSubscription(hash3, { - ...subscription, - state: "subscribed" - }); - await this._updateSubscriptions(); - return; - } - } - this._setSubscription(hash3, { - ...subscription, - state: "unsubscribed" - }); - await this._updateSubscriptions(); - })(); - } - break; - } - }) - ); - } - /** - * @internal - */ - _handleServerNotification(serverSubscriptionId, callbackArgs) { - const callbacks = this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId]; - if (callbacks === void 0) { - return; - } - callbacks.forEach((cb2) => { - try { - cb2( - ...callbackArgs - ); - } catch (e18) { - console.error(e18); - } - }); - } - /** - * @internal - */ - _wsOnAccountNotification(notification) { - const { - result, - subscription - } = create(notification, AccountNotificationResult); - this._handleServerNotification(subscription, [result.value, result.context]); - } - /** - * @internal - */ - _makeSubscription(subscriptionConfig, args) { - const clientSubscriptionId = this._nextClientSubscriptionId++; - const hash3 = fastStableStringify([subscriptionConfig.method, args]); - const existingSubscription = this._subscriptionsByHash[hash3]; - if (existingSubscription === void 0) { - this._subscriptionsByHash[hash3] = { - ...subscriptionConfig, - args, - callbacks: /* @__PURE__ */ new Set([subscriptionConfig.callback]), - state: "pending" - }; - } else { - existingSubscription.callbacks.add(subscriptionConfig.callback); - } - this._subscriptionHashByClientSubscriptionId[clientSubscriptionId] = hash3; - this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId] = async () => { - delete this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId]; - delete this._subscriptionHashByClientSubscriptionId[clientSubscriptionId]; - const subscription = this._subscriptionsByHash[hash3]; - assert$b(subscription !== void 0, `Could not find a \`Subscription\` when tearing down client subscription #${clientSubscriptionId}`); - subscription.callbacks.delete(subscriptionConfig.callback); - await this._updateSubscriptions(); - }; - this._updateSubscriptions(); - return clientSubscriptionId; - } - /** - * Register a callback to be invoked whenever the specified account changes - * - * @param publicKey Public key of the account to monitor - * @param callback Function to invoke whenever the account is changed - * @param config - * @return subscription id - */ - /** @deprecated Instead, pass in an {@link AccountSubscriptionConfig} */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - onAccountChange(publicKey2, callback, commitmentOrConfig) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs( - [publicKey2.toBase58()], - commitment || this._commitment || "finalized", - // Apply connection/server default. - "base64", - config2 - ); - return this._makeSubscription({ - callback, - method: "accountSubscribe", - unsubscribeMethod: "accountUnsubscribe" - }, args); - } - /** - * Deregister an account notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeAccountChangeListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "account change"); - } - /** - * @internal - */ - _wsOnProgramAccountNotification(notification) { - const { - result, - subscription - } = create(notification, ProgramAccountNotificationResult); - this._handleServerNotification(subscription, [{ - accountId: result.value.pubkey, - accountInfo: result.value.account - }, result.context]); - } - /** - * Register a callback to be invoked whenever accounts owned by the - * specified program change - * - * @param programId Public key of the program to monitor - * @param callback Function to invoke whenever the account is changed - * @param config - * @return subscription id - */ - /** @deprecated Instead, pass in a {@link ProgramAccountSubscriptionConfig} */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - onProgramAccountChange(programId, callback, commitmentOrConfig, maybeFilters) { - const { - commitment, - config: config2 - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs( - [programId.toBase58()], - commitment || this._commitment || "finalized", - // Apply connection/server default. - "base64", - config2 ? config2 : maybeFilters ? { - filters: applyDefaultMemcmpEncodingToFilters(maybeFilters) - } : void 0 - /* extra */ - ); - return this._makeSubscription({ - callback, - method: "programSubscribe", - unsubscribeMethod: "programUnsubscribe" - }, args); - } - /** - * Deregister an account notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeProgramAccountChangeListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "program account change"); - } - /** - * Registers a callback to be invoked whenever logs are emitted. - */ - onLogs(filter2, callback, commitment) { - const args = this._buildArgs( - [typeof filter2 === "object" ? { - mentions: [filter2.toString()] - } : filter2], - commitment || this._commitment || "finalized" - // Apply connection/server default. - ); - return this._makeSubscription({ - callback, - method: "logsSubscribe", - unsubscribeMethod: "logsUnsubscribe" - }, args); - } - /** - * Deregister a logs callback. - * - * @param clientSubscriptionId client subscription id to deregister. - */ - async removeOnLogsListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "logs"); - } - /** - * @internal - */ - _wsOnLogsNotification(notification) { - const { - result, - subscription - } = create(notification, LogsNotificationResult); - this._handleServerNotification(subscription, [result.value, result.context]); - } - /** - * @internal - */ - _wsOnSlotNotification(notification) { - const { - result, - subscription - } = create(notification, SlotNotificationResult); - this._handleServerNotification(subscription, [result]); - } - /** - * Register a callback to be invoked upon slot changes - * - * @param callback Function to invoke whenever the slot changes - * @return subscription id - */ - onSlotChange(callback) { - return this._makeSubscription( - { - callback, - method: "slotSubscribe", - unsubscribeMethod: "slotUnsubscribe" - }, - [] - /* args */ - ); - } - /** - * Deregister a slot notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeSlotChangeListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "slot change"); - } - /** - * @internal - */ - _wsOnSlotUpdatesNotification(notification) { - const { - result, - subscription - } = create(notification, SlotUpdateNotificationResult); - this._handleServerNotification(subscription, [result]); - } - /** - * Register a callback to be invoked upon slot updates. {@link SlotUpdate}'s - * may be useful to track live progress of a cluster. - * - * @param callback Function to invoke whenever the slot updates - * @return subscription id - */ - onSlotUpdate(callback) { - return this._makeSubscription( - { - callback, - method: "slotsUpdatesSubscribe", - unsubscribeMethod: "slotsUpdatesUnsubscribe" - }, - [] - /* args */ - ); - } - /** - * Deregister a slot update notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeSlotUpdateListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "slot update"); - } - /** - * @internal - */ - async _unsubscribeClientSubscription(clientSubscriptionId, subscriptionName) { - const dispose2 = this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId]; - if (dispose2) { - await dispose2(); - } else { - console.warn(`Ignored unsubscribe request because an active subscription with id \`${clientSubscriptionId}\` for '${subscriptionName}' events could not be found.`); - } - } - _buildArgs(args, override, encoding2, extra) { - const commitment = override || this._commitment; - if (commitment || encoding2 || extra) { - let options = {}; - if (encoding2) { - options.encoding = encoding2; - } - if (commitment) { - options.commitment = commitment; - } - if (extra) { - options = Object.assign(options, extra); - } - args.push(options); - } - return args; - } - /** - * @internal - */ - _buildArgsAtLeastConfirmed(args, override, encoding2, extra) { - const commitment = override || this._commitment; - if (commitment && !["confirmed", "finalized"].includes(commitment)) { - throw new Error("Using Connection with default commitment: `" + this._commitment + "`, but method requires at least `confirmed`"); - } - return this._buildArgs(args, override, encoding2, extra); - } - /** - * @internal - */ - _wsOnSignatureNotification(notification) { - const { - result, - subscription - } = create(notification, SignatureNotificationResult); - if (result.value !== "receivedSignature") { - this._subscriptionsAutoDisposedByRpc.add(subscription); - } - this._handleServerNotification(subscription, result.value === "receivedSignature" ? [{ - type: "received" - }, result.context] : [{ - type: "status", - result: result.value - }, result.context]); - } - /** - * Register a callback to be invoked upon signature updates - * - * @param signature Transaction signature string in base 58 - * @param callback Function to invoke on signature notifications - * @param commitment Specify the commitment level signature must reach before notification - * @return subscription id - */ - onSignature(signature2, callback, commitment) { - const args = this._buildArgs( - [signature2], - commitment || this._commitment || "finalized" - // Apply connection/server default. - ); - const clientSubscriptionId = this._makeSubscription({ - callback: (notification, context) => { - if (notification.type === "status") { - callback(notification.result, context); - try { - this.removeSignatureListener(clientSubscriptionId); - } catch (_err) { - } - } - }, - method: "signatureSubscribe", - unsubscribeMethod: "signatureUnsubscribe" - }, args); - return clientSubscriptionId; - } - /** - * Register a callback to be invoked when a transaction is - * received and/or processed. - * - * @param signature Transaction signature string in base 58 - * @param callback Function to invoke on signature notifications - * @param options Enable received notifications and set the commitment - * level that signature must reach before notification - * @return subscription id - */ - onSignatureWithOptions(signature2, callback, options) { - const { - commitment, - ...extra - } = { - ...options, - commitment: options && options.commitment || this._commitment || "finalized" - // Apply connection/server default. - }; - const args = this._buildArgs([signature2], commitment, void 0, extra); - const clientSubscriptionId = this._makeSubscription({ - callback: (notification, context) => { - callback(notification, context); - try { - this.removeSignatureListener(clientSubscriptionId); - } catch (_err) { - } - }, - method: "signatureSubscribe", - unsubscribeMethod: "signatureUnsubscribe" - }, args); - return clientSubscriptionId; - } - /** - * Deregister a signature notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeSignatureListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "signature result"); - } - /** - * @internal - */ - _wsOnRootNotification(notification) { - const { - result, - subscription - } = create(notification, RootNotificationResult); - this._handleServerNotification(subscription, [result]); - } - /** - * Register a callback to be invoked upon root changes - * - * @param callback Function to invoke whenever the root changes - * @return subscription id - */ - onRootChange(callback) { - return this._makeSubscription( - { - callback, - method: "rootSubscribe", - unsubscribeMethod: "rootUnsubscribe" - }, - [] - /* args */ - ); - } - /** - * Deregister a root notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeRootChangeListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "root change"); - } -} -Object.freeze({ - CreateLookupTable: { - index: 0, - layout: struct([u32$1("instruction"), u64$2("recentSlot"), u8("bumpSeed")]) - }, - FreezeLookupTable: { - index: 1, - layout: struct([u32$1("instruction")]) - }, - ExtendLookupTable: { - index: 2, - layout: struct([u32$1("instruction"), u64$2(), seq(publicKey(), offset(u32$1(), -8), "addresses")]) - }, - DeactivateLookupTable: { - index: 3, - layout: struct([u32$1("instruction")]) - }, - CloseLookupTable: { - index: 4, - layout: struct([u32$1("instruction")]) - } -}); -new PublicKey("AddressLookupTab1e1111111111111111111111111"); -Object.freeze({ - RequestUnits: { - index: 0, - layout: struct([u8("instruction"), u32$1("units"), u32$1("additionalFee")]) - }, - RequestHeapFrame: { - index: 1, - layout: struct([u8("instruction"), u32$1("bytes")]) - }, - SetComputeUnitLimit: { - index: 2, - layout: struct([u8("instruction"), u32$1("units")]) - }, - SetComputeUnitPrice: { - index: 3, - layout: struct([u8("instruction"), u64$2("microLamports")]) - } -}); -new PublicKey("ComputeBudget111111111111111111111111111111"); -struct([u8("numSignatures"), u8("padding"), u16("signatureOffset"), u16("signatureInstructionIndex"), u16("publicKeyOffset"), u16("publicKeyInstructionIndex"), u16("messageDataOffset"), u16("messageDataSize"), u16("messageInstructionIndex")]); -new PublicKey("Ed25519SigVerify111111111111111111111111111"); -secp256k1$2.utils.isValidPrivateKey; -secp256k1$2.getPublicKey; -struct([u8("numSignatures"), u16("signatureOffset"), u8("signatureInstructionIndex"), u16("ethAddressOffset"), u8("ethAddressInstructionIndex"), u16("messageDataOffset"), u16("messageDataSize"), u8("messageInstructionIndex"), blob(20, "ethAddress"), blob(64, "signature"), u8("recoveryId")]); -new PublicKey("KeccakSecp256k11111111111111111111111111111"); -var _Lockup; -new PublicKey("StakeConfig11111111111111111111111111111111"); -class Lockup { - /** - * Create a new Lockup object - */ - constructor(unixTimestamp, epoch, custodian) { - this.unixTimestamp = void 0; - this.epoch = void 0; - this.custodian = void 0; - this.unixTimestamp = unixTimestamp; - this.epoch = epoch; - this.custodian = custodian; - } - /** - * Default, inactive Lockup value - */ -} -_Lockup = Lockup; -Lockup.default = new _Lockup(0, 0, PublicKey.default); -Object.freeze({ - Initialize: { - index: 0, - layout: struct([u32$1("instruction"), authorized(), lockup()]) - }, - Authorize: { - index: 1, - layout: struct([u32$1("instruction"), publicKey("newAuthorized"), u32$1("stakeAuthorizationType")]) - }, - Delegate: { - index: 2, - layout: struct([u32$1("instruction")]) - }, - Split: { - index: 3, - layout: struct([u32$1("instruction"), ns64("lamports")]) - }, - Withdraw: { - index: 4, - layout: struct([u32$1("instruction"), ns64("lamports")]) - }, - Deactivate: { - index: 5, - layout: struct([u32$1("instruction")]) - }, - Merge: { - index: 7, - layout: struct([u32$1("instruction")]) - }, - AuthorizeWithSeed: { - index: 8, - layout: struct([u32$1("instruction"), publicKey("newAuthorized"), u32$1("stakeAuthorizationType"), rustString("authoritySeed"), publicKey("authorityOwner")]) - } -}); -new PublicKey("Stake11111111111111111111111111111111111111"); -Object.freeze({ - InitializeAccount: { - index: 0, - layout: struct([u32$1("instruction"), voteInit()]) - }, - Authorize: { - index: 1, - layout: struct([u32$1("instruction"), publicKey("newAuthorized"), u32$1("voteAuthorizationType")]) - }, - Withdraw: { - index: 3, - layout: struct([u32$1("instruction"), ns64("lamports")]) - }, - UpdateValidatorIdentity: { - index: 4, - layout: struct([u32$1("instruction")]) - }, - AuthorizeWithSeed: { - index: 10, - layout: struct([u32$1("instruction"), voteAuthorizeWithSeedArgs()]) - } -}); -new PublicKey("Vote111111111111111111111111111111111111111"); -new PublicKey("Va1idator1nfo111111111111111111111111111111"); -type({ - name: string$1(), - website: optional(string$1()), - details: optional(string$1()), - iconUrl: optional(string$1()), - keybaseUsername: optional(string$1()) -}); -new PublicKey("Vote111111111111111111111111111111111111111"); -struct([ - publicKey("nodePubkey"), - publicKey("authorizedWithdrawer"), - u8("commission"), - nu64(), - // votes.length - seq(struct([nu64("slot"), u32$1("confirmationCount")]), offset(u32$1(), -8), "votes"), - u8("rootSlotValid"), - nu64("rootSlot"), - nu64(), - // authorizedVoters.length - seq(struct([nu64("epoch"), publicKey("authorizedVoter")]), offset(u32$1(), -8), "authorizedVoters"), - struct([seq(struct([publicKey("authorizedPubkey"), nu64("epochOfLastAuthorizedSwitch"), nu64("targetEpoch")]), 32, "buf"), nu64("idx"), u8("isEmpty")], "priorVoters"), - nu64(), - // epochCredits.length - seq(struct([nu64("epoch"), nu64("credits"), nu64("prevCredits")]), offset(u32$1(), -8), "epochCredits"), - struct([nu64("slot"), nu64("timestamp")], "lastTimestamp") -]); -const ConnectionContext = reactExports.createContext({}); -function useConnection() { - return reactExports.useContext(ConnectionContext); -} -const ConnectionProvider = ({ children, endpoint, config: config2 = { commitment: "confirmed" } }) => { - const connection = reactExports.useMemo(() => new Connection(endpoint, config2), [endpoint, config2]); - return W$2.createElement(ConnectionContext.Provider, { value: { connection } }, children); -}; -var eventemitter3$1 = { exports: {} }; -(function(module) { - var has = Object.prototype.hasOwnProperty, prefix = "~"; - function Events() { - } - if (Object.create) { - Events.prototype = /* @__PURE__ */ Object.create(null); - if (!new Events().__proto__) - prefix = false; - } - function EE2(fn2, context, once3) { - this.fn = fn2; - this.context = context; - this.once = once3 || false; - } - function addListener2(emitter, event, fn2, context, once3) { - if (typeof fn2 !== "function") { - throw new TypeError("The listener must be a function"); - } - var listener = new EE2(fn2, context || emitter, once3), evt = prefix ? prefix + event : event; - if (!emitter._events[evt]) - emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) - emitter._events[evt].push(listener); - else - emitter._events[evt] = [emitter._events[evt], listener]; - return emitter; - } - function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) - emitter._events = new Events(); - else - delete emitter._events[evt]; - } - function EventEmitter2() { - this._events = new Events(); - this._eventsCount = 0; - } - EventEmitter2.prototype.eventNames = function eventNames2() { - var names = [], events2, name2; - if (this._eventsCount === 0) - return names; - for (name2 in events2 = this._events) { - if (has.call(events2, name2)) - names.push(prefix ? name2.slice(1) : name2); - } - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events2)); - } - return names; - }; - EventEmitter2.prototype.listeners = function listeners3(event) { - var evt = prefix ? prefix + event : event, handlers = this._events[evt]; - if (!handlers) - return []; - if (handlers.fn) - return [handlers.fn]; - for (var i3 = 0, l2 = handlers.length, ee2 = new Array(l2); i3 < l2; i3++) { - ee2[i3] = handlers[i3].fn; - } - return ee2; - }; - EventEmitter2.prototype.listenerCount = function listenerCount2(event) { - var evt = prefix ? prefix + event : event, listeners3 = this._events[evt]; - if (!listeners3) - return 0; - if (listeners3.fn) - return 1; - return listeners3.length; - }; - EventEmitter2.prototype.emit = function emit2(event, a1, a22, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - if (!this._events[evt]) - return false; - var listeners3 = this._events[evt], len = arguments.length, args, i3; - if (listeners3.fn) { - if (listeners3.once) - this.removeListener(event, listeners3.fn, void 0, true); - switch (len) { - case 1: - return listeners3.fn.call(listeners3.context), true; - case 2: - return listeners3.fn.call(listeners3.context, a1), true; - case 3: - return listeners3.fn.call(listeners3.context, a1, a22), true; - case 4: - return listeners3.fn.call(listeners3.context, a1, a22, a3), true; - case 5: - return listeners3.fn.call(listeners3.context, a1, a22, a3, a4), true; - case 6: - return listeners3.fn.call(listeners3.context, a1, a22, a3, a4, a5), true; - } - for (i3 = 1, args = new Array(len - 1); i3 < len; i3++) { - args[i3 - 1] = arguments[i3]; - } - listeners3.fn.apply(listeners3.context, args); - } else { - var length = listeners3.length, j2; - for (i3 = 0; i3 < length; i3++) { - if (listeners3[i3].once) - this.removeListener(event, listeners3[i3].fn, void 0, true); - switch (len) { - case 1: - listeners3[i3].fn.call(listeners3[i3].context); - break; - case 2: - listeners3[i3].fn.call(listeners3[i3].context, a1); - break; - case 3: - listeners3[i3].fn.call(listeners3[i3].context, a1, a22); - break; - case 4: - listeners3[i3].fn.call(listeners3[i3].context, a1, a22, a3); - break; - default: - if (!args) - for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) { - args[j2 - 1] = arguments[j2]; - } - listeners3[i3].fn.apply(listeners3[i3].context, args); - } - } - } - return true; - }; - EventEmitter2.prototype.on = function on2(event, fn2, context) { - return addListener2(this, event, fn2, context, false); - }; - EventEmitter2.prototype.once = function once3(event, fn2, context) { - return addListener2(this, event, fn2, context, true); - }; - EventEmitter2.prototype.removeListener = function removeListener2(event, fn2, context, once3) { - var evt = prefix ? prefix + event : event; - if (!this._events[evt]) - return this; - if (!fn2) { - clearEvent(this, evt); - return this; - } - var listeners3 = this._events[evt]; - if (listeners3.fn) { - if (listeners3.fn === fn2 && (!once3 || listeners3.once) && (!context || listeners3.context === context)) { - clearEvent(this, evt); - } - } else { - for (var i3 = 0, events2 = [], length = listeners3.length; i3 < length; i3++) { - if (listeners3[i3].fn !== fn2 || once3 && !listeners3[i3].once || context && listeners3[i3].context !== context) { - events2.push(listeners3[i3]); - } - } - if (events2.length) - this._events[evt] = events2.length === 1 ? events2[0] : events2; - else - clearEvent(this, evt); - } - return this; - }; - EventEmitter2.prototype.removeAllListeners = function removeAllListeners2(event) { - var evt; - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) - clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - return this; - }; - EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; - EventEmitter2.prototype.addListener = EventEmitter2.prototype.on; - EventEmitter2.prefixed = prefix; - EventEmitter2.EventEmitter = EventEmitter2; - { - module.exports = EventEmitter2; - } -})(eventemitter3$1); -var eventemitter3Exports$1 = eventemitter3$1.exports; -const EventEmitter$3 = /* @__PURE__ */ getDefaultExportFromCjs$1(eventemitter3Exports$1); -let WalletError$2 = class WalletError extends Error { - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types - constructor(message2, error) { - super(message2); - this.error = error; - } -}; -class WalletNotReadyError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletNotReadyError"; - } -} -class WalletConfigError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletConfigError"; - } -} -let WalletConnectionError$1 = class WalletConnectionError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletConnectionError"; - } -}; -let WalletDisconnectedError$1 = class WalletDisconnectedError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletDisconnectedError"; - } -}; -class WalletDisconnectionError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletDisconnectionError"; - } -} -class WalletAccountError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletAccountError"; - } -} -class WalletPublicKeyError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletPublicKeyError"; - } -} -class WalletNotConnectedError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletNotConnectedError"; - } -} -class WalletSendTransactionError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletSendTransactionError"; - } -} -let WalletSignTransactionError$1 = class WalletSignTransactionError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletSignTransactionError"; - } -}; -let WalletSignMessageError$1 = class WalletSignMessageError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletSignMessageError"; - } -}; -class WalletSignInError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletSignInError"; - } -} -var WalletReadyState$2; -(function(WalletReadyState2) { - WalletReadyState2["Installed"] = "Installed"; - WalletReadyState2["NotDetected"] = "NotDetected"; - WalletReadyState2["Loadable"] = "Loadable"; - WalletReadyState2["Unsupported"] = "Unsupported"; -})(WalletReadyState$2 || (WalletReadyState$2 = {})); -class BaseWalletAdapter extends EventEmitter$3 { - get connected() { - return !!this.publicKey; - } - async autoConnect() { - await this.connect(); - } - async prepareTransaction(transaction2, connection, options = {}) { - const publicKey2 = this.publicKey; - if (!publicKey2) - throw new WalletNotConnectedError(); - transaction2.feePayer = transaction2.feePayer || publicKey2; - transaction2.recentBlockhash = transaction2.recentBlockhash || (await connection.getLatestBlockhash({ - commitment: options.preflightCommitment, - minContextSlot: options.minContextSlot - })).blockhash; - return transaction2; - } -} -function isVersionedTransaction$1(transaction2) { - return "version" in transaction2; -} -class BaseSignerWalletAdapter extends BaseWalletAdapter { - async sendTransaction(transaction2, connection, options = {}) { - let emit2 = true; - try { - if (isVersionedTransaction$1(transaction2)) { - if (!this.supportedTransactionVersions) - throw new WalletSendTransactionError(`Sending versioned transactions isn't supported by this wallet`); - if (!this.supportedTransactionVersions.has(transaction2.version)) - throw new WalletSendTransactionError(`Sending transaction version ${transaction2.version} isn't supported by this wallet`); - try { - transaction2 = await this.signTransaction(transaction2); - const rawTransaction = transaction2.serialize(); - return await connection.sendRawTransaction(rawTransaction, options); - } catch (error) { - if (error instanceof WalletSignTransactionError$1) { - emit2 = false; - throw error; - } - throw new WalletSendTransactionError(error == null ? void 0 : error.message, error); - } - } else { - try { - const { signers, ...sendOptions } = options; - transaction2 = await this.prepareTransaction(transaction2, connection, sendOptions); - (signers == null ? void 0 : signers.length) && transaction2.partialSign(...signers); - transaction2 = await this.signTransaction(transaction2); - const rawTransaction = transaction2.serialize(); - return await connection.sendRawTransaction(rawTransaction, sendOptions); - } catch (error) { - if (error instanceof WalletSignTransactionError$1) { - emit2 = false; - throw error; - } - throw new WalletSendTransactionError(error == null ? void 0 : error.message, error); - } - } - } catch (error) { - if (emit2) { - this.emit("error", error); - } - throw error; - } - } - async signAllTransactions(transactions) { - for (const transaction2 of transactions) { - if (isVersionedTransaction$1(transaction2)) { - if (!this.supportedTransactionVersions) - throw new WalletSignTransactionError$1(`Signing versioned transactions isn't supported by this wallet`); - if (!this.supportedTransactionVersions.has(transaction2.version)) - throw new WalletSignTransactionError$1(`Signing transaction version ${transaction2.version} isn't supported by this wallet`); - } - } - const signedTransactions = []; - for (const transaction2 of transactions) { - signedTransactions.push(await this.signTransaction(transaction2)); - } - return signedTransactions; - } -} -class BaseMessageSignerWalletAdapter extends BaseSignerWalletAdapter { -} -class BaseSignInMessageSignerWalletAdapter extends BaseMessageSignerWalletAdapter { -} -const SolanaSignAndSendTransaction = "solana:signAndSendTransaction"; -const SolanaSignIn = "solana:signIn"; -const SolanaSignMessage = "solana:signMessage"; -const SolanaSignTransaction = "solana:signTransaction"; -const StandardConnect = "standard:connect"; -const StandardDisconnect = "standard:disconnect"; -const StandardEvents = "standard:events"; -function isWalletAdapterCompatibleStandardWallet(wallet) { - return StandardConnect in wallet.features && StandardEvents in wallet.features && (SolanaSignAndSendTransaction in wallet.features || SolanaSignTransaction in wallet.features); -} -let WalletNotSelectedError$1 = class WalletNotSelectedError extends WalletError$2 { - constructor() { - super(...arguments); - this.name = "WalletNotSelectedError"; - } -}; -const EMPTY_ARRAY = []; -const DEFAULT_CONTEXT$1 = { - autoConnect: false, - connecting: false, - connected: false, - disconnecting: false, - select() { - logMissingProviderError("call", "select"); - }, - connect() { - return Promise.reject(logMissingProviderError("call", "connect")); - }, - disconnect() { - return Promise.reject(logMissingProviderError("call", "disconnect")); - }, - sendTransaction() { - return Promise.reject(logMissingProviderError("call", "sendTransaction")); - }, - signTransaction() { - return Promise.reject(logMissingProviderError("call", "signTransaction")); - }, - signAllTransactions() { - return Promise.reject(logMissingProviderError("call", "signAllTransactions")); - }, - signMessage() { - return Promise.reject(logMissingProviderError("call", "signMessage")); - }, - signIn() { - return Promise.reject(logMissingProviderError("call", "signIn")); - } -}; -Object.defineProperty(DEFAULT_CONTEXT$1, "wallets", { - get() { - logMissingProviderError("read", "wallets"); - return EMPTY_ARRAY; - } -}); -Object.defineProperty(DEFAULT_CONTEXT$1, "wallet", { - get() { - logMissingProviderError("read", "wallet"); - return null; - } -}); -Object.defineProperty(DEFAULT_CONTEXT$1, "publicKey", { - get() { - logMissingProviderError("read", "publicKey"); - return null; - } -}); -function logMissingProviderError(action, property) { - const error = new Error(`You have tried to ${action} "${property}" on a WalletContext without providing one. Make sure to render a WalletProvider as an ancestor of the component that uses WalletContext.`); - console.error(error); - return error; -} -const WalletContext$1 = reactExports.createContext(DEFAULT_CONTEXT$1); -function useWallet$1() { - return reactExports.useContext(WalletContext$1); -} -function useLocalStorage$1(key2, defaultState) { - const state = reactExports.useState(() => { - try { - const value2 = localStorage.getItem(key2); - if (value2) - return JSON.parse(value2); - } catch (error) { - if (typeof window !== "undefined") { - console.error(error); - } - } - return defaultState; - }); - const value = state[0]; - const isFirstRenderRef = reactExports.useRef(true); - reactExports.useEffect(() => { - if (isFirstRenderRef.current) { - isFirstRenderRef.current = false; - return; - } - try { - if (value === null) { - localStorage.removeItem(key2); - } else { - localStorage.setItem(key2, JSON.stringify(value)); - } - } catch (error) { - if (typeof window !== "undefined") { - console.error(error); - } - } - }, [value, key2]); - return state; -} -function getCommitment(commitment) { - switch (commitment) { - case "processed": - case "confirmed": - case "finalized": - case void 0: - return commitment; - case "recent": - return "processed"; - case "single": - case "singleGossip": - return "confirmed"; - case "max": - case "root": - return "finalized"; - default: - return void 0; - } -} -const SOLANA_MAINNET_CHAIN = "solana:mainnet"; -const SOLANA_DEVNET_CHAIN = "solana:devnet"; -const SOLANA_TESTNET_CHAIN = "solana:testnet"; -const SOLANA_LOCALNET_CHAIN = "solana:localnet"; -const MAINNET_ENDPOINT = "https://api.mainnet-beta.solana.com"; -function getChainForEndpoint(endpoint) { - if (endpoint.includes(MAINNET_ENDPOINT)) - return SOLANA_MAINNET_CHAIN; - if (/\bdevnet\b/i.test(endpoint)) - return SOLANA_DEVNET_CHAIN; - if (/\btestnet\b/i.test(endpoint)) - return SOLANA_TESTNET_CHAIN; - if (/\blocalhost\b/i.test(endpoint) || /\b127\.0\.0\.1\b/.test(endpoint)) - return SOLANA_LOCALNET_CHAIN; - return SOLANA_MAINNET_CHAIN; -} -function createSignInMessageText(input) { - let message2 = `${input.domain} wants you to sign in with your Solana account: -`; - message2 += `${input.address}`; - if (input.statement) { - message2 += ` - -${input.statement}`; - } - const fields = []; - if (input.uri) { - fields.push(`URI: ${input.uri}`); - } - if (input.version) { - fields.push(`Version: ${input.version}`); - } - if (input.chainId) { - fields.push(`Chain ID: ${input.chainId}`); - } - if (input.nonce) { - fields.push(`Nonce: ${input.nonce}`); - } - if (input.issuedAt) { - fields.push(`Issued At: ${input.issuedAt}`); - } - if (input.expirationTime) { - fields.push(`Expiration Time: ${input.expirationTime}`); - } - if (input.notBefore) { - fields.push(`Not Before: ${input.notBefore}`); - } - if (input.requestId) { - fields.push(`Request ID: ${input.requestId}`); - } - if (input.resources) { - fields.push(`Resources:`); - for (const resource of input.resources) { - fields.push(`- ${resource}`); - } - } - if (fields.length) { - message2 += ` - -${fields.join("\n")}`; - } - return message2; -} -const SolanaMobileWalletAdapterErrorCode = { - ERROR_ASSOCIATION_PORT_OUT_OF_RANGE: "ERROR_ASSOCIATION_PORT_OUT_OF_RANGE", - ERROR_FORBIDDEN_WALLET_BASE_URL: "ERROR_FORBIDDEN_WALLET_BASE_URL", - ERROR_SECURE_CONTEXT_REQUIRED: "ERROR_SECURE_CONTEXT_REQUIRED", - ERROR_SESSION_CLOSED: "ERROR_SESSION_CLOSED", - ERROR_SESSION_TIMEOUT: "ERROR_SESSION_TIMEOUT", - ERROR_WALLET_NOT_FOUND: "ERROR_WALLET_NOT_FOUND", - ERROR_INVALID_PROTOCOL_VERSION: "ERROR_INVALID_PROTOCOL_VERSION" -}; -class SolanaMobileWalletAdapterError extends Error { - constructor(...args) { - const [code2, message2, data] = args; - super(message2); - this.code = code2; - this.data = data; - this.name = "SolanaMobileWalletAdapterError"; - } -} -class SolanaMobileWalletAdapterProtocolError extends Error { - constructor(...args) { - const [jsonRpcMessageId, code2, message2, data] = args; - super(message2); - this.code = code2; - this.data = data; - this.jsonRpcMessageId = jsonRpcMessageId; - this.name = "SolanaMobileWalletAdapterProtocolError"; - } -} -function __awaiter$6(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve) { - resolve(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e18) { - reject(e18); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e18) { - reject(e18); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function createHelloReq(ecdhPublicKey, associationKeypairPrivateKey) { - return __awaiter$6(this, void 0, void 0, function* () { - const publicKeyBuffer = yield crypto.subtle.exportKey("raw", ecdhPublicKey); - const signatureBuffer = yield crypto.subtle.sign({ hash: "SHA-256", name: "ECDSA" }, associationKeypairPrivateKey, publicKeyBuffer); - const response = new Uint8Array(publicKeyBuffer.byteLength + signatureBuffer.byteLength); - response.set(new Uint8Array(publicKeyBuffer), 0); - response.set(new Uint8Array(signatureBuffer), publicKeyBuffer.byteLength); - return response; - }); -} -function encode$4(input) { - return window.btoa(input); -} -function createSIWSMessage(payload) { - return createSignInMessageText(payload); -} -function createSIWSMessageBase64(payload) { - return encode$4(createSIWSMessage(payload)); -} -const SolanaSignTransactions = "solana:signTransactions"; -const SolanaCloneAuthorization = "solana:cloneAuthorization"; -function createMobileWalletProxy(protocolVersion, protocolRequestHandler) { - return new Proxy({}, { - get(target, p3) { - if (target[p3] == null) { - target[p3] = function(inputParams) { - return __awaiter$6(this, void 0, void 0, function* () { - const { method, params } = handleMobileWalletRequest(p3, inputParams, protocolVersion); - const result = yield protocolRequestHandler(method, params); - if (method === "authorize" && params.sign_in_payload && !result.sign_in_result) { - result["sign_in_result"] = yield signInFallback(params.sign_in_payload, result, protocolRequestHandler); - } - return handleMobileWalletResponse(p3, result, protocolVersion); - }); - }; - } - return target[p3]; - }, - defineProperty() { - return false; - }, - deleteProperty() { - return false; - } - }); -} -function handleMobileWalletRequest(methodName, methodParams, protocolVersion) { - let params = methodParams; - let method = methodName.toString().replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`).toLowerCase(); - switch (methodName) { - case "authorize": { - let { chain } = params; - if (protocolVersion === "legacy") { - switch (chain) { - case "solana:testnet": { - chain = "testnet"; - break; - } - case "solana:devnet": { - chain = "devnet"; - break; - } - case "solana:mainnet": { - chain = "mainnet-beta"; - break; - } - default: { - chain = params.cluster; - } - } - params.cluster = chain; - } else { - switch (chain) { - case "testnet": - case "devnet": { - chain = `solana:${chain}`; - break; - } - case "mainnet-beta": { - chain = "solana:mainnet"; - break; - } - } - params.chain = chain; - } - } - case "reauthorize": { - const { auth_token, identity: identity2 } = params; - if (auth_token) { - switch (protocolVersion) { - case "legacy": { - method = "reauthorize"; - params = { auth_token, identity: identity2 }; - break; - } - default: { - method = "authorize"; - break; - } - } - } - break; - } - } - return { method, params }; -} -function handleMobileWalletResponse(method, response, protocolVersion) { - switch (method) { - case "getCapabilities": { - const capabilities = response; - switch (protocolVersion) { - case "legacy": { - const features = [SolanaSignTransactions]; - if (capabilities.supports_clone_authorization === true) { - features.push(SolanaCloneAuthorization); - } - return Object.assign(Object.assign({}, capabilities), { features }); - } - case "v1": { - return Object.assign(Object.assign({}, capabilities), { supports_sign_and_send_transactions: true, supports_clone_authorization: capabilities.features.includes(SolanaCloneAuthorization) }); - } - } - } - } - return response; -} -function signInFallback(signInPayload, authorizationResult, protocolRequestHandler) { - var _a3; - return __awaiter$6(this, void 0, void 0, function* () { - const domain = (_a3 = signInPayload.domain) !== null && _a3 !== void 0 ? _a3 : window.location.host; - const address2 = authorizationResult.accounts[0].address; - const siwsMessage = createSIWSMessageBase64(Object.assign(Object.assign({}, signInPayload), { domain, address: address2 })); - const signMessageResult = yield protocolRequestHandler("sign_messages", { - addresses: [address2], - payloads: [siwsMessage] - }); - const signInResult = { - address: address2, - signed_message: siwsMessage, - signature: signMessageResult.signed_payloads[0].slice(siwsMessage.length) - }; - return signInResult; - }); -} -const SEQUENCE_NUMBER_BYTES = 4; -function createSequenceNumberVector(sequenceNumber) { - if (sequenceNumber >= 4294967296) { - throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes."); - } - const byteArray = new ArrayBuffer(SEQUENCE_NUMBER_BYTES); - const view = new DataView(byteArray); - view.setUint32( - 0, - sequenceNumber, - /* littleEndian */ - false - ); - return new Uint8Array(byteArray); -} -const INITIALIZATION_VECTOR_BYTES = 12; -const ENCODED_PUBLIC_KEY_LENGTH_BYTES = 65; -function encryptMessage(plaintext, sequenceNumber, sharedSecret) { - return __awaiter$6(this, void 0, void 0, function* () { - const sequenceNumberVector = createSequenceNumberVector(sequenceNumber); - const initializationVector = new Uint8Array(INITIALIZATION_VECTOR_BYTES); - crypto.getRandomValues(initializationVector); - const ciphertext = yield crypto.subtle.encrypt(getAlgorithmParams(sequenceNumberVector, initializationVector), sharedSecret, new TextEncoder().encode(plaintext)); - const response = new Uint8Array(sequenceNumberVector.byteLength + initializationVector.byteLength + ciphertext.byteLength); - response.set(new Uint8Array(sequenceNumberVector), 0); - response.set(new Uint8Array(initializationVector), sequenceNumberVector.byteLength); - response.set(new Uint8Array(ciphertext), sequenceNumberVector.byteLength + initializationVector.byteLength); - return response; - }); -} -function decryptMessage(message2, sharedSecret) { - return __awaiter$6(this, void 0, void 0, function* () { - const sequenceNumberVector = message2.slice(0, SEQUENCE_NUMBER_BYTES); - const initializationVector = message2.slice(SEQUENCE_NUMBER_BYTES, SEQUENCE_NUMBER_BYTES + INITIALIZATION_VECTOR_BYTES); - const ciphertext = message2.slice(SEQUENCE_NUMBER_BYTES + INITIALIZATION_VECTOR_BYTES); - const plaintextBuffer = yield crypto.subtle.decrypt(getAlgorithmParams(sequenceNumberVector, initializationVector), sharedSecret, ciphertext); - const plaintext = getUtf8Decoder().decode(plaintextBuffer); - return plaintext; - }); -} -function getAlgorithmParams(sequenceNumber, initializationVector) { - return { - additionalData: sequenceNumber, - iv: initializationVector, - name: "AES-GCM", - tagLength: 128 - // 16 byte tag => 128 bits - }; -} -let _utf8Decoder; -function getUtf8Decoder() { - if (_utf8Decoder === void 0) { - _utf8Decoder = new TextDecoder("utf-8"); - } - return _utf8Decoder; -} -function generateAssociationKeypair() { - return __awaiter$6(this, void 0, void 0, function* () { - return yield crypto.subtle.generateKey( - { - name: "ECDSA", - namedCurve: "P-256" - }, - false, - ["sign"] - /* keyUsages */ - ); - }); -} -function generateECDHKeypair() { - return __awaiter$6(this, void 0, void 0, function* () { - return yield crypto.subtle.generateKey( - { - name: "ECDH", - namedCurve: "P-256" - }, - false, - ["deriveKey", "deriveBits"] - /* keyUsages */ - ); - }); -} -function encryptJsonRpcMessage(jsonRpcMessage, sharedSecret) { - return __awaiter$6(this, void 0, void 0, function* () { - const plaintext = JSON.stringify(jsonRpcMessage); - const sequenceNumber = jsonRpcMessage.id; - return encryptMessage(plaintext, sequenceNumber, sharedSecret); - }); -} -function decryptJsonRpcMessage(message2, sharedSecret) { - return __awaiter$6(this, void 0, void 0, function* () { - const plaintext = yield decryptMessage(message2, sharedSecret); - const jsonRpcMessage = JSON.parse(plaintext); - if (Object.hasOwnProperty.call(jsonRpcMessage, "error")) { - throw new SolanaMobileWalletAdapterProtocolError(jsonRpcMessage.id, jsonRpcMessage.error.code, jsonRpcMessage.error.message); - } - return jsonRpcMessage; - }); -} -function parseHelloRsp(payloadBuffer, associationPublicKey, ecdhPrivateKey) { - return __awaiter$6(this, void 0, void 0, function* () { - const [associationPublicKeyBuffer, walletPublicKey] = yield Promise.all([ - crypto.subtle.exportKey("raw", associationPublicKey), - crypto.subtle.importKey( - "raw", - payloadBuffer.slice(0, ENCODED_PUBLIC_KEY_LENGTH_BYTES), - { name: "ECDH", namedCurve: "P-256" }, - false, - [] - /* keyUsages */ - ) - ]); - const sharedSecret = yield crypto.subtle.deriveBits({ name: "ECDH", public: walletPublicKey }, ecdhPrivateKey, 256); - const ecdhSecretKey = yield crypto.subtle.importKey( - "raw", - sharedSecret, - "HKDF", - false, - ["deriveKey"] - /* keyUsages */ - ); - const aesKeyMaterialVal = yield crypto.subtle.deriveKey({ - name: "HKDF", - hash: "SHA-256", - salt: new Uint8Array(associationPublicKeyBuffer), - info: new Uint8Array() - }, ecdhSecretKey, { name: "AES-GCM", length: 128 }, false, ["encrypt", "decrypt"]); - return aesKeyMaterialVal; - }); -} -function parseSessionProps(message2, sharedSecret) { - return __awaiter$6(this, void 0, void 0, function* () { - const plaintext = yield decryptMessage(message2, sharedSecret); - const jsonProperties = JSON.parse(plaintext); - let protocolVersion = "legacy"; - if (Object.hasOwnProperty.call(jsonProperties, "v")) { - switch (jsonProperties.v) { - case 1: - case "1": - case "v1": - protocolVersion = "v1"; - break; - case "legacy": - protocolVersion = "legacy"; - break; - default: - throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_INVALID_PROTOCOL_VERSION, `Unknown/unsupported protocol version: ${jsonProperties.v}`); - } - } - return { - protocol_version: protocolVersion - }; - }); -} -function getRandomAssociationPort() { - return assertAssociationPort(49152 + Math.floor(Math.random() * (65535 - 49152 + 1))); -} -function assertAssociationPort(port) { - if (port < 49152 || port > 65535) { - throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE, `Association port number must be between 49152 and 65535. ${port} given.`, { port }); - } - return port; -} -function arrayBufferToBase64String(buffer2) { - let binary2 = ""; - const bytes2 = new Uint8Array(buffer2); - const len = bytes2.byteLength; - for (let ii2 = 0; ii2 < len; ii2++) { - binary2 += String.fromCharCode(bytes2[ii2]); - } - return window.btoa(binary2); -} -function getStringWithURLUnsafeCharactersReplaced(unsafeBase64EncodedString) { - return unsafeBase64EncodedString.replace(/[/+=]/g, (m3) => ({ - "/": "_", - "+": "-", - "=": "." - })[m3]); -} -const INTENT_NAME = "solana-wallet"; -function getPathParts(pathString) { - return pathString.replace(/(^\/+|\/+$)/g, "").split("/"); -} -function getIntentURL(methodPathname, intentUrlBase) { - let baseUrl = null; - if (intentUrlBase) { - try { - baseUrl = new URL(intentUrlBase); - } catch (_a3) { - } - if ((baseUrl === null || baseUrl === void 0 ? void 0 : baseUrl.protocol) !== "https:") { - throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_FORBIDDEN_WALLET_BASE_URL, "Base URLs supplied by wallets must be valid `https` URLs"); - } - } - baseUrl || (baseUrl = new URL(`${INTENT_NAME}:/`)); - const pathname = methodPathname.startsWith("/") ? ( - // Method is an absolute path. Replace it wholesale. - methodPathname - ) : ( - // Method is a relative path. Merge it with the existing one. - [...getPathParts(baseUrl.pathname), ...getPathParts(methodPathname)].join("/") - ); - return new URL(pathname, baseUrl); -} -function getAssociateAndroidIntentURL(associationPublicKey, putativePort, associationURLBase, protocolVersions = ["v1"]) { - return __awaiter$6(this, void 0, void 0, function* () { - const associationPort = assertAssociationPort(putativePort); - const exportedKey = yield crypto.subtle.exportKey("raw", associationPublicKey); - const encodedKey = arrayBufferToBase64String(exportedKey); - const url = getIntentURL("v1/associate/local", associationURLBase); - url.searchParams.set("association", getStringWithURLUnsafeCharactersReplaced(encodedKey)); - url.searchParams.set("port", `${associationPort}`); - protocolVersions.forEach((version2) => { - url.searchParams.set("v", version2); - }); - return url; - }); -} -const Browser = { - Firefox: 0, - Other: 1 -}; -function assertUnreachable(x3) { - return x3; -} -function getBrowser() { - return navigator.userAgent.indexOf("Firefox/") !== -1 ? Browser.Firefox : Browser.Other; -} -function getDetectionPromise() { - return new Promise((resolve, reject) => { - function cleanup() { - clearTimeout(timeoutId); - window.removeEventListener("blur", handleBlur); - } - function handleBlur() { - cleanup(); - resolve(); - } - window.addEventListener("blur", handleBlur); - const timeoutId = setTimeout(() => { - cleanup(); - reject(); - }, 2e3); - }); -} -let _frame = null; -function launchUrlThroughHiddenFrame(url) { - if (_frame == null) { - _frame = document.createElement("iframe"); - _frame.style.display = "none"; - document.body.appendChild(_frame); - } - _frame.contentWindow.location.href = url.toString(); -} -function startSession(associationPublicKey, associationURLBase) { - return __awaiter$6(this, void 0, void 0, function* () { - const randomAssociationPort = getRandomAssociationPort(); - const associationUrl = yield getAssociateAndroidIntentURL(associationPublicKey, randomAssociationPort, associationURLBase); - if (associationUrl.protocol === "https:") { - window.location.assign(associationUrl); - } else { - try { - const browser2 = getBrowser(); - switch (browser2) { - case Browser.Firefox: - launchUrlThroughHiddenFrame(associationUrl); - break; - case Browser.Other: { - const detectionPromise = getDetectionPromise(); - window.location.assign(associationUrl); - yield detectionPromise; - break; - } - default: - assertUnreachable(browser2); - } - } catch (e18) { - throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND, "Found no installed wallet that supports the mobile wallet protocol."); - } - } - return randomAssociationPort; - }); -} -const WEBSOCKET_CONNECTION_CONFIG = { - /** - * 300 milliseconds is a generally accepted threshold for what someone - * would consider an acceptable response time for a user interface - * after having performed a low-attention tapping task. We set the initial - * interval at which we wait for the wallet to set up the websocket at - * half this, as per the Nyquist frequency, with a progressive backoff - * sequence from there. The total wait time is 30s, which allows for the - * user to be presented with a disambiguation dialog, select a wallet, and - * for the wallet app to subsequently start. - */ - retryDelayScheduleMs: [150, 150, 200, 500, 500, 750, 750, 1e3], - timeoutMs: 3e4 -}; -const WEBSOCKET_PROTOCOL = "com.solana.mobilewalletadapter.v1"; -function assertSecureContext() { - if (typeof window === "undefined" || window.isSecureContext !== true) { - throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SECURE_CONTEXT_REQUIRED, "The mobile wallet adapter protocol must be used in a secure context (`https`)."); - } -} -function assertSecureEndpointSpecificURI(walletUriBase) { - let url; - try { - url = new URL(walletUriBase); - } catch (_a3) { - throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_FORBIDDEN_WALLET_BASE_URL, "Invalid base URL supplied by wallet"); - } - if (url.protocol !== "https:") { - throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_FORBIDDEN_WALLET_BASE_URL, "Base URLs supplied by wallets must be valid `https` URLs"); - } -} -function getSequenceNumberFromByteArray(byteArray) { - const view = new DataView(byteArray); - return view.getUint32( - 0, - /* littleEndian */ - false - ); -} -function transact$1(callback, config2) { - return __awaiter$6(this, void 0, void 0, function* () { - assertSecureContext(); - const associationKeypair = yield generateAssociationKeypair(); - const sessionPort = yield startSession(associationKeypair.publicKey, config2 === null || config2 === void 0 ? void 0 : config2.baseUri); - const websocketURL = `ws://localhost:${sessionPort}/solana-wallet`; - let connectionStartTime; - const getNextRetryDelayMs = (() => { - const schedule = [...WEBSOCKET_CONNECTION_CONFIG.retryDelayScheduleMs]; - return () => schedule.length > 1 ? schedule.shift() : schedule[0]; - })(); - let nextJsonRpcMessageId = 1; - let lastKnownInboundSequenceNumber = 0; - let state = { __type: "disconnected" }; - return new Promise((resolve, reject) => { - let socket; - const jsonRpcResponsePromises = {}; - const handleOpen = () => __awaiter$6(this, void 0, void 0, function* () { - if (state.__type !== "connecting") { - console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${state.__type}\`.`); - return; - } - const { associationKeypair: associationKeypair2 } = state; - socket.removeEventListener("open", handleOpen); - const ecdhKeypair = yield generateECDHKeypair(); - socket.send(yield createHelloReq(ecdhKeypair.publicKey, associationKeypair2.privateKey)); - state = { - __type: "hello_req_sent", - associationPublicKey: associationKeypair2.publicKey, - ecdhPrivateKey: ecdhKeypair.privateKey - }; - }); - const handleClose = (evt) => { - if (evt.wasClean) { - state = { __type: "disconnected" }; - } else { - reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_CLOSED, `The wallet session dropped unexpectedly (${evt.code}: ${evt.reason}).`, { closeEvent: evt })); - } - disposeSocket(); - }; - const handleError = (_evt) => __awaiter$6(this, void 0, void 0, function* () { - disposeSocket(); - if (Date.now() - connectionStartTime >= WEBSOCKET_CONNECTION_CONFIG.timeoutMs) { - reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT, `Failed to connect to the wallet websocket on port ${sessionPort}.`)); - } else { - yield new Promise((resolve2) => { - const retryDelayMs = getNextRetryDelayMs(); - retryWaitTimeoutId = window.setTimeout(resolve2, retryDelayMs); - }); - attemptSocketConnection(); - } - }); - const handleMessage = (evt) => __awaiter$6(this, void 0, void 0, function* () { - const responseBuffer = yield evt.data.arrayBuffer(); - switch (state.__type) { - case "connected": - try { - const sequenceNumberVector = responseBuffer.slice(0, SEQUENCE_NUMBER_BYTES); - const sequenceNumber = getSequenceNumberFromByteArray(sequenceNumberVector); - if (sequenceNumber !== lastKnownInboundSequenceNumber + 1) { - throw new Error("Encrypted message has invalid sequence number"); - } - lastKnownInboundSequenceNumber = sequenceNumber; - const jsonRpcMessage = yield decryptJsonRpcMessage(responseBuffer, state.sharedSecret); - const responsePromise = jsonRpcResponsePromises[jsonRpcMessage.id]; - delete jsonRpcResponsePromises[jsonRpcMessage.id]; - responsePromise.resolve(jsonRpcMessage.result); - } catch (e18) { - if (e18 instanceof SolanaMobileWalletAdapterProtocolError) { - const responsePromise = jsonRpcResponsePromises[e18.jsonRpcMessageId]; - delete jsonRpcResponsePromises[e18.jsonRpcMessageId]; - responsePromise.reject(e18); - } else { - throw e18; - } - } - break; - case "hello_req_sent": { - const sharedSecret = yield parseHelloRsp(responseBuffer, state.associationPublicKey, state.ecdhPrivateKey); - const sessionPropertiesBuffer = responseBuffer.slice(ENCODED_PUBLIC_KEY_LENGTH_BYTES); - const sessionProperties = sessionPropertiesBuffer.byteLength !== 0 ? yield (() => __awaiter$6(this, void 0, void 0, function* () { - const sequenceNumberVector = sessionPropertiesBuffer.slice(0, SEQUENCE_NUMBER_BYTES); - const sequenceNumber = getSequenceNumberFromByteArray(sequenceNumberVector); - if (sequenceNumber !== lastKnownInboundSequenceNumber + 1) { - throw new Error("Encrypted message has invalid sequence number"); - } - lastKnownInboundSequenceNumber = sequenceNumber; - return parseSessionProps(sessionPropertiesBuffer, sharedSecret); - }))() : { protocol_version: "legacy" }; - state = { __type: "connected", sharedSecret, sessionProperties }; - const wallet = createMobileWalletProxy(sessionProperties.protocol_version, (method, params) => __awaiter$6(this, void 0, void 0, function* () { - const id2 = nextJsonRpcMessageId++; - socket.send(yield encryptJsonRpcMessage({ - id: id2, - jsonrpc: "2.0", - method, - params: params !== null && params !== void 0 ? params : {} - }, sharedSecret)); - return new Promise((resolve2, reject2) => { - jsonRpcResponsePromises[id2] = { - resolve(result) { - switch (method) { - case "authorize": - case "reauthorize": { - const { wallet_uri_base } = result; - if (wallet_uri_base != null) { - try { - assertSecureEndpointSpecificURI(wallet_uri_base); - } catch (e18) { - reject2(e18); - return; - } - } - break; - } - } - resolve2(result); - }, - reject: reject2 - }; - }); - })); - try { - resolve(yield callback(wallet)); - } catch (e18) { - reject(e18); - } finally { - disposeSocket(); - socket.close(); - } - break; - } - } - }); - let disposeSocket; - let retryWaitTimeoutId; - const attemptSocketConnection = () => { - if (disposeSocket) { - disposeSocket(); - } - state = { __type: "connecting", associationKeypair }; - if (connectionStartTime === void 0) { - connectionStartTime = Date.now(); - } - socket = new WebSocket(websocketURL, [WEBSOCKET_PROTOCOL]); - socket.addEventListener("open", handleOpen); - socket.addEventListener("close", handleClose); - socket.addEventListener("error", handleError); - socket.addEventListener("message", handleMessage); - disposeSocket = () => { - window.clearTimeout(retryWaitTimeoutId); - socket.removeEventListener("open", handleOpen); - socket.removeEventListener("close", handleClose); - socket.removeEventListener("error", handleError); - socket.removeEventListener("message", handleMessage); - }; - }; - attemptSocketConnection(); - }); - }); -} -function base$3(ALPHABET2) { - if (ALPHABET2.length >= 255) { - throw new TypeError("Alphabet too long"); - } - var BASE_MAP = new Uint8Array(256); - for (var j2 = 0; j2 < BASE_MAP.length; j2++) { - BASE_MAP[j2] = 255; - } - for (var i3 = 0; i3 < ALPHABET2.length; i3++) { - var x3 = ALPHABET2.charAt(i3); - var xc2 = x3.charCodeAt(0); - if (BASE_MAP[xc2] !== 255) { - throw new TypeError(x3 + " is ambiguous"); - } - BASE_MAP[xc2] = i3; - } - var BASE2 = ALPHABET2.length; - var LEADER = ALPHABET2.charAt(0); - var FACTOR = Math.log(BASE2) / Math.log(256); - var iFACTOR = Math.log(256) / Math.log(BASE2); - function encode5(source) { - if (source instanceof Uint8Array) - ; - else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { - throw new TypeError("Expected Uint8Array"); - } - if (source.length === 0) { - return ""; - } - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - var size2 = (pend - pbegin) * iFACTOR + 1 >>> 0; - var b58 = new Uint8Array(size2); - while (pbegin !== pend) { - var carry = source[pbegin]; - var i4 = 0; - for (var it1 = size2 - 1; (carry !== 0 || i4 < length) && it1 !== -1; it1--, i4++) { - carry += 256 * b58[it1] >>> 0; - b58[it1] = carry % BASE2 >>> 0; - carry = carry / BASE2 >>> 0; - } - if (carry !== 0) { - throw new Error("Non-zero carry"); - } - length = i4; - pbegin++; - } - var it2 = size2 - length; - while (it2 !== size2 && b58[it2] === 0) { - it2++; - } - var str = LEADER.repeat(zeroes); - for (; it2 < size2; ++it2) { - str += ALPHABET2.charAt(b58[it2]); - } - return str; - } - function decodeUnsafe(source) { - if (typeof source !== "string") { - throw new TypeError("Expected String"); - } - if (source.length === 0) { - return new Uint8Array(); - } - var psz = 0; - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - var size2 = (source.length - psz) * FACTOR + 1 >>> 0; - var b256 = new Uint8Array(size2); - while (source[psz]) { - var carry = BASE_MAP[source.charCodeAt(psz)]; - if (carry === 255) { - return; - } - var i4 = 0; - for (var it3 = size2 - 1; (carry !== 0 || i4 < length) && it3 !== -1; it3--, i4++) { - carry += BASE2 * b256[it3] >>> 0; - b256[it3] = carry % 256 >>> 0; - carry = carry / 256 >>> 0; - } - if (carry !== 0) { - throw new Error("Non-zero carry"); - } - length = i4; - psz++; - } - var it4 = size2 - length; - while (it4 !== size2 && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size2 - it4)); - var j3 = zeroes; - while (it4 !== size2) { - vch[j3++] = b256[it4++]; - } - return vch; - } - function decode3(string2) { - var buffer2 = decodeUnsafe(string2); - if (buffer2) { - return buffer2; - } - throw new Error("Non-base" + BASE2 + " character"); - } - return { - encode: encode5, - decodeUnsafe, - decode: decode3 - }; -} -var src$1 = base$3; -const basex = src$1; -const ALPHABET$2 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -var bs58 = basex(ALPHABET$2); -const bs58$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(bs58); -function __rest$1(s2, e18) { - var t2 = {}; - for (var p3 in s2) - if (Object.prototype.hasOwnProperty.call(s2, p3) && e18.indexOf(p3) < 0) - t2[p3] = s2[p3]; - if (s2 != null && typeof Object.getOwnPropertySymbols === "function") - for (var i3 = 0, p3 = Object.getOwnPropertySymbols(s2); i3 < p3.length; i3++) { - if (e18.indexOf(p3[i3]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p3[i3])) - t2[p3[i3]] = s2[p3[i3]]; - } - return t2; -} -function __awaiter$5(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve) { - resolve(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e18) { - reject(e18); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e18) { - reject(e18); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function fromUint8Array(byteArray) { - return window.btoa(String.fromCharCode.call(null, ...byteArray)); -} -function toUint8Array$1(base64EncodedByteArray) { - return new Uint8Array(window.atob(base64EncodedByteArray).split("").map((c2) => c2.charCodeAt(0))); -} -function getPayloadFromTransaction(transaction2) { - const serializedTransaction = "version" in transaction2 ? transaction2.serialize() : transaction2.serialize({ - requireAllSignatures: false, - verifySignatures: false - }); - const payload = fromUint8Array(serializedTransaction); - return payload; -} -function getTransactionFromWireMessage(byteArray) { - const numSignatures = byteArray[0]; - const messageOffset = numSignatures * SIGNATURE_LENGTH_IN_BYTES$1 + 1; - const version2 = VersionedMessage.deserializeMessageVersion(byteArray.slice(messageOffset, byteArray.length)); - if (version2 === "legacy") { - return Transaction$2.from(byteArray); - } else { - return VersionedTransaction.deserialize(byteArray); - } -} -function transact(callback, config2) { - return __awaiter$5(this, void 0, void 0, function* () { - const augmentedCallback = (wallet) => { - const augmentedAPI = new Proxy({}, { - get(target, p3) { - if (target[p3] == null) { - switch (p3) { - case "signAndSendTransactions": - target[p3] = function(_a3) { - var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a3, rest = __rest$1(_a3, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]); - return __awaiter$5(this, void 0, void 0, function* () { - const payloads = transactions.map(getPayloadFromTransaction); - const options = { - min_context_slot: minContextSlot, - commitment, - skip_preflight: skipPreflight, - max_retries: maxRetries, - wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction - }; - const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), Object.values(options).some((element) => element != null) ? { options } : null), { payloads })); - const signatures = base64EncodedSignatures.map(toUint8Array$1).map(bs58$1.encode); - return signatures; - }); - }; - break; - case "signMessages": - target[p3] = function(_a3) { - var { payloads } = _a3, rest = __rest$1(_a3, ["payloads"]); - return __awaiter$5(this, void 0, void 0, function* () { - const base64EncodedPayloads = payloads.map(fromUint8Array); - const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads })); - const signedMessages = base64EncodedSignedMessages.map(toUint8Array$1); - return signedMessages; - }); - }; - break; - case "signTransactions": - target[p3] = function(_a3) { - var { transactions } = _a3, rest = __rest$1(_a3, ["transactions"]); - return __awaiter$5(this, void 0, void 0, function* () { - const payloads = transactions.map(getPayloadFromTransaction); - const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads })); - const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array$1); - const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage); - return signedTransactions; - }); - }; - break; - default: { - target[p3] = wallet[p3]; - break; - } - } - } - return target[p3]; - }, - defineProperty() { - return false; - }, - deleteProperty() { - return false; - } - }); - return callback(augmentedAPI); - }; - return yield transact$1(augmentedCallback, config2); - }); -} -function __awaiter$4(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve) { - resolve(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e18) { - reject(e18); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e18) { - reject(e18); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function toUint8Array(base64EncodedByteArray) { - return new Uint8Array(window.atob(base64EncodedByteArray).split("").map((c2) => c2.charCodeAt(0))); -} -function getIsSupported() { - return typeof window !== "undefined" && window.isSecureContext && typeof document !== "undefined" && /android/i.test(navigator.userAgent); -} -const SolanaMobileWalletAdapterWalletName = "Mobile Wallet Adapter"; -const SIGNATURE_LENGTH_IN_BYTES = 64; -function getPublicKeyFromAddress(address2) { - const publicKeyByteArray = toUint8Array(address2); - return new PublicKey(publicKeyByteArray); -} -function isVersionedTransaction(transaction2) { - return "version" in transaction2; -} -class SolanaMobileWalletAdapter extends BaseSignInMessageSignerWalletAdapter { - constructor(config2) { - var _a3; - super(); - this.supportedTransactionVersions = /* @__PURE__ */ new Set( - // FIXME(#244): We can't actually know what versions are supported until we know which wallet we're talking to. - ["legacy", 0] - ); - this.name = SolanaMobileWalletAdapterWalletName; - this.url = "https://solanamobile.com/wallets"; - this.icon = "data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI4IiB3aWR0aD0iMjgiIHZpZXdCb3g9Ii0zIDAgMjggMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0RDQjhGRiI+PHBhdGggZD0iTTE3LjQgMTcuNEgxNXYyLjRoMi40di0yLjRabTEuMi05LjZoLTIuNHYyLjRoMi40VjcuOFoiLz48cGF0aCBkPSJNMjEuNiAzVjBoLTIuNHYzaC0zLjZWMGgtMi40djNoLTIuNHY2LjZINC41YTIuMSAyLjEgMCAxIDEgMC00LjJoMi43VjNINC41QTQuNSA0LjUgMCAwIDAgMCA3LjVWMjRoMjEuNnYtNi42aC0yLjR2NC4ySDIuNFYxMS41Yy41LjMgMS4yLjQgMS44LjVoNy41QTYuNiA2LjYgMCAwIDAgMjQgOVYzaC0yLjRabTAgNS43YTQuMiA0LjIgMCAxIDEtOC40IDBWNS40aDguNHYzLjNaIi8+PC9nPjwvc3ZnPg=="; - this._connecting = false; - this._connectionGeneration = 0; - this._readyState = getIsSupported() ? WalletReadyState$2.Loadable : WalletReadyState$2.Unsupported; - this._authorizationResultCache = config2.authorizationResultCache; - this._addressSelector = config2.addressSelector; - this._appIdentity = config2.appIdentity; - this._chain = (_a3 = config2.chain) !== null && _a3 !== void 0 ? _a3 : config2.cluster; - this._onWalletNotFound = config2.onWalletNotFound; - if (this._readyState !== WalletReadyState$2.Unsupported) { - this._authorizationResultCache.get().then((authorizationResult) => { - if (authorizationResult) { - this.declareWalletAsInstalled(); - } - }); - } - } - get publicKey() { - if (this._publicKey == null && this._selectedAddress != null) { - try { - this._publicKey = getPublicKeyFromAddress(this._selectedAddress); - } catch (e18) { - throw new WalletPublicKeyError(e18 instanceof Error && (e18 === null || e18 === void 0 ? void 0 : e18.message) || "Unknown error", e18); - } - } - return this._publicKey ? this._publicKey : null; - } - get connected() { - return !!this._authorizationResult; - } - get connecting() { - return this._connecting; - } - get readyState() { - return this._readyState; - } - declareWalletAsInstalled() { - if (this._readyState !== WalletReadyState$2.Installed) { - this.emit("readyStateChange", this._readyState = WalletReadyState$2.Installed); - } - } - runWithGuard(callback) { - return __awaiter$4(this, void 0, void 0, function* () { - try { - return yield callback(); - } catch (e18) { - this.emit("error", e18); - throw e18; - } - }); - } - /** @deprecated Use `autoConnect()` instead. */ - autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED() { - return __awaiter$4(this, void 0, void 0, function* () { - return yield this.autoConnect(); - }); - } - autoConnect() { - return __awaiter$4(this, void 0, void 0, function* () { - if (this.connecting || this.connected) { - return; - } - return yield this.runWithGuard(() => __awaiter$4(this, void 0, void 0, function* () { - if (this._readyState !== WalletReadyState$2.Installed && this._readyState !== WalletReadyState$2.Loadable) { - throw new WalletNotReadyError(); - } - this._connecting = true; - try { - const cachedAuthorizationResult = yield this._authorizationResultCache.get(); - if (cachedAuthorizationResult) { - this.handleAuthorizationResult(cachedAuthorizationResult); - } - } catch (e18) { - throw new WalletConnectionError$1(e18 instanceof Error && e18.message || "Unknown error", e18); - } finally { - this._connecting = false; - } - })); - }); - } - connect() { - return __awaiter$4(this, void 0, void 0, function* () { - if (this.connecting || this.connected) { - return; - } - return yield this.runWithGuard(() => __awaiter$4(this, void 0, void 0, function* () { - if (this._readyState !== WalletReadyState$2.Installed && this._readyState !== WalletReadyState$2.Loadable) { - throw new WalletNotReadyError(); - } - this._connecting = true; - try { - yield this.performAuthorization(); - } catch (e18) { - throw new WalletConnectionError$1(e18 instanceof Error && e18.message || "Unknown error", e18); - } finally { - this._connecting = false; - } - })); - }); - } - performAuthorization(signInPayload) { - return __awaiter$4(this, void 0, void 0, function* () { - try { - const cachedAuthorizationResult = yield this._authorizationResultCache.get(); - if (cachedAuthorizationResult) { - this.handleAuthorizationResult(cachedAuthorizationResult); - return cachedAuthorizationResult; - } - return yield this.transact((wallet) => __awaiter$4(this, void 0, void 0, function* () { - const authorizationResult = yield wallet.authorize({ - chain: this._chain, - identity: this._appIdentity, - sign_in_payload: signInPayload - }); - Promise.all([ - this._authorizationResultCache.set(authorizationResult), - this.handleAuthorizationResult(authorizationResult) - ]); - return authorizationResult; - })); - } catch (e18) { - throw new WalletConnectionError$1(e18 instanceof Error && e18.message || "Unknown error", e18); - } - }); - } - handleAuthorizationResult(authorizationResult) { - var _a3; - return __awaiter$4(this, void 0, void 0, function* () { - const didPublicKeysChange = ( - // Case 1: We started from having no authorization. - this._authorizationResult == null || // Case 2: The number of authorized accounts changed. - ((_a3 = this._authorizationResult) === null || _a3 === void 0 ? void 0 : _a3.accounts.length) !== authorizationResult.accounts.length || // Case 3: The new list of addresses isn't exactly the same as the old list, in the same order. - this._authorizationResult.accounts.some((account, ii2) => account.address !== authorizationResult.accounts[ii2].address) - ); - this._authorizationResult = authorizationResult; - this.declareWalletAsInstalled(); - if (didPublicKeysChange) { - const nextSelectedAddress = yield this._addressSelector.select(authorizationResult.accounts.map(({ address: address2 }) => address2)); - if (nextSelectedAddress !== this._selectedAddress) { - this._selectedAddress = nextSelectedAddress; - delete this._publicKey; - this.emit( - "connect", - // Having just set `this._selectedAddress`, `this.publicKey` is definitely non-null - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - this.publicKey - ); - } - } - }); - } - performReauthorization(wallet, authToken) { - return __awaiter$4(this, void 0, void 0, function* () { - try { - const authorizationResult = yield wallet.authorize({ - auth_token: authToken, - identity: this._appIdentity - }); - Promise.all([ - this._authorizationResultCache.set(authorizationResult), - this.handleAuthorizationResult(authorizationResult) - ]); - } catch (e18) { - this.disconnect(); - throw new WalletDisconnectedError$1(e18 instanceof Error && (e18 === null || e18 === void 0 ? void 0 : e18.message) || "Unknown error", e18); - } - }); - } - disconnect() { - return __awaiter$4(this, void 0, void 0, function* () { - this._authorizationResultCache.clear(); - this._connecting = false; - this._connectionGeneration++; - delete this._authorizationResult; - delete this._publicKey; - delete this._selectedAddress; - this.emit("disconnect"); - }); - } - transact(callback) { - var _a3; - return __awaiter$4(this, void 0, void 0, function* () { - const walletUriBase = (_a3 = this._authorizationResult) === null || _a3 === void 0 ? void 0 : _a3.wallet_uri_base; - const config2 = walletUriBase ? { baseUri: walletUriBase } : void 0; - const currentConnectionGeneration = this._connectionGeneration; - try { - return yield transact(callback, config2); - } catch (e18) { - if (this._connectionGeneration !== currentConnectionGeneration) { - yield new Promise(() => { - }); - } - if (e18 instanceof Error && e18.name === "SolanaMobileWalletAdapterError" && e18.code === "ERROR_WALLET_NOT_FOUND") { - yield this._onWalletNotFound(this); - } - throw e18; - } - }); - } - assertIsAuthorized() { - if (!this._authorizationResult || !this._selectedAddress) - throw new WalletNotConnectedError(); - return { - authToken: this._authorizationResult.auth_token, - selectedAddress: this._selectedAddress - }; - } - performSignTransactions(transactions) { - return __awaiter$4(this, void 0, void 0, function* () { - const { authToken } = this.assertIsAuthorized(); - try { - return yield this.transact((wallet) => __awaiter$4(this, void 0, void 0, function* () { - yield this.performReauthorization(wallet, authToken); - const signedTransactions = yield wallet.signTransactions({ - transactions - }); - return signedTransactions; - })); - } catch (error) { - throw new WalletSignTransactionError$1(error === null || error === void 0 ? void 0 : error.message, error); - } - }); - } - sendTransaction(transaction2, connection, options) { - return __awaiter$4(this, void 0, void 0, function* () { - return yield this.runWithGuard(() => __awaiter$4(this, void 0, void 0, function* () { - const { authToken } = this.assertIsAuthorized(); - const minContextSlot = options === null || options === void 0 ? void 0 : options.minContextSlot; - try { - return yield this.transact((wallet) => __awaiter$4(this, void 0, void 0, function* () { - function getTargetCommitment() { - let targetCommitment; - switch (connection.commitment) { - case "confirmed": - case "finalized": - case "processed": - targetCommitment = connection.commitment; - break; - default: - targetCommitment = "finalized"; - } - let targetPreflightCommitment; - switch (options === null || options === void 0 ? void 0 : options.preflightCommitment) { - case "confirmed": - case "finalized": - case "processed": - targetPreflightCommitment = options.preflightCommitment; - break; - case void 0: - targetPreflightCommitment = targetCommitment; - break; - default: - targetPreflightCommitment = "finalized"; - } - const preflightCommitmentScore = targetPreflightCommitment === "finalized" ? 2 : targetPreflightCommitment === "confirmed" ? 1 : 0; - const targetCommitmentScore = targetCommitment === "finalized" ? 2 : targetCommitment === "confirmed" ? 1 : 0; - return preflightCommitmentScore < targetCommitmentScore ? targetPreflightCommitment : targetCommitment; - } - const [capabilities, _12, _22] = yield Promise.all([ - wallet.getCapabilities(), - this.performReauthorization(wallet, authToken), - isVersionedTransaction(transaction2) ? null : ( - /** - * Unlike versioned transactions, legacy `Transaction` objects - * may not have an associated `feePayer` or `recentBlockhash`. - * This code exists to patch them up in case they are missing. - */ - (() => __awaiter$4(this, void 0, void 0, function* () { - var _a3; - transaction2.feePayer || (transaction2.feePayer = (_a3 = this.publicKey) !== null && _a3 !== void 0 ? _a3 : void 0); - if (transaction2.recentBlockhash == null) { - const { blockhash } = yield connection.getLatestBlockhash({ - commitment: getTargetCommitment() - }); - transaction2.recentBlockhash = blockhash; - } - }))() - ) - ]); - if (capabilities.supports_sign_and_send_transactions) { - const signatures = yield wallet.signAndSendTransactions({ - minContextSlot, - transactions: [transaction2] - }); - return signatures[0]; - } else { - const [signedTransaction] = yield wallet.signTransactions({ - transactions: [transaction2] - }); - if (isVersionedTransaction(signedTransaction)) { - return yield connection.sendTransaction(signedTransaction); - } else { - const serializedTransaction = signedTransaction.serialize(); - return yield connection.sendRawTransaction(serializedTransaction, Object.assign(Object.assign({}, options), { preflightCommitment: getTargetCommitment() })); - } - } - })); - } catch (error) { - throw new WalletSendTransactionError(error === null || error === void 0 ? void 0 : error.message, error); - } - })); - }); - } - signTransaction(transaction2) { - return __awaiter$4(this, void 0, void 0, function* () { - return yield this.runWithGuard(() => __awaiter$4(this, void 0, void 0, function* () { - const [signedTransaction] = yield this.performSignTransactions([transaction2]); - return signedTransaction; - })); - }); - } - signAllTransactions(transactions) { - return __awaiter$4(this, void 0, void 0, function* () { - return yield this.runWithGuard(() => __awaiter$4(this, void 0, void 0, function* () { - const signedTransactions = yield this.performSignTransactions(transactions); - return signedTransactions; - })); - }); - } - signMessage(message2) { - return __awaiter$4(this, void 0, void 0, function* () { - return yield this.runWithGuard(() => __awaiter$4(this, void 0, void 0, function* () { - const { authToken, selectedAddress } = this.assertIsAuthorized(); - try { - return yield this.transact((wallet) => __awaiter$4(this, void 0, void 0, function* () { - yield this.performReauthorization(wallet, authToken); - const [signedMessage] = yield wallet.signMessages({ - addresses: [selectedAddress], - payloads: [message2] - }); - const signature2 = signedMessage.slice(-SIGNATURE_LENGTH_IN_BYTES); - return signature2; - })); - } catch (error) { - throw new WalletSignMessageError$1(error === null || error === void 0 ? void 0 : error.message, error); - } - })); - }); - } - signIn(input) { - return __awaiter$4(this, void 0, void 0, function* () { - return yield this.runWithGuard(() => __awaiter$4(this, void 0, void 0, function* () { - var _a3, _b2; - if (this._readyState !== WalletReadyState$2.Installed && this._readyState !== WalletReadyState$2.Loadable) { - throw new WalletNotReadyError(); - } - this._connecting = true; - try { - const authorizationResult = yield this.performAuthorization(Object.assign(Object.assign({}, input), { domain: (_a3 = input === null || input === void 0 ? void 0 : input.domain) !== null && _a3 !== void 0 ? _a3 : window.location.host })); - if (!authorizationResult.sign_in_result) { - throw new Error("Sign in failed, no sign in result returned by wallet"); - } - const signedInAddress = authorizationResult.sign_in_result.address; - const signedInAccount = Object.assign(Object.assign({}, (_b2 = authorizationResult.accounts.find((acc) => acc.address == signedInAddress)) !== null && _b2 !== void 0 ? _b2 : { - address: signedInAddress - }), { publicKey: toUint8Array(signedInAddress) }); - return { - account: signedInAccount, - signedMessage: toUint8Array(authorizationResult.sign_in_result.signed_message), - signature: toUint8Array(authorizationResult.sign_in_result.signature) - }; - } catch (e18) { - throw new WalletConnectionError$1(e18 instanceof Error && e18.message || "Unknown error", e18); - } finally { - this._connecting = false; - } - })); - }); - } -} -function createDefaultAddressSelector() { - return { - select(addresses) { - return __awaiter$4(this, void 0, void 0, function* () { - return addresses[0]; - }); - } - }; -} -const CACHE_KEY = "SolanaMobileWalletAdapterDefaultAuthorizationCache"; -function createDefaultAuthorizationResultCache() { - let storage; - try { - storage = window.localStorage; - } catch (_a3) { - } - return { - clear() { - return __awaiter$4(this, void 0, void 0, function* () { - if (!storage) { - return; - } - try { - storage.removeItem(CACHE_KEY); - } catch (_a3) { - } - }); - }, - get() { - return __awaiter$4(this, void 0, void 0, function* () { - if (!storage) { - return; - } - try { - return JSON.parse(storage.getItem(CACHE_KEY)) || void 0; - } catch (_a3) { - } - }); - }, - set(authorizationResult) { - return __awaiter$4(this, void 0, void 0, function* () { - if (!storage) { - return; - } - try { - storage.setItem(CACHE_KEY, JSON.stringify(authorizationResult)); - } catch (_a3) { - } - }); - } - }; -} -function defaultWalletNotFoundHandler(mobileWalletAdapter) { - return __awaiter$4(this, void 0, void 0, function* () { - if (typeof window !== "undefined") { - window.location.assign(mobileWalletAdapter.url); - } - }); -} -function createDefaultWalletNotFoundHandler() { - return defaultWalletNotFoundHandler; -} -globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f3) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f3.call(receiver, value) : f3 ? f3.value = value : state.set(receiver, value), value; -}; -globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f3) { - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f3 : kind === "a" ? f3.call(receiver) : f3 ? f3.value : state.get(receiver); -}; -function arraysEqual(a3, b2) { - if (a3 === b2) - return true; - const length = a3.length; - if (length !== b2.length) - return false; - for (let i3 = 0; i3 < length; i3++) { - if (a3[i3] !== b2[i3]) - return false; - } - return true; -} -var __classPrivateFieldSet$4 = globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f3) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f3.call(receiver, value) : f3 ? f3.value = value : state.set(receiver, value), value; -}; -var __classPrivateFieldGet$4 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f3) { - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f3 : kind === "a" ? f3.call(receiver) : f3 ? f3.value : state.get(receiver); -}; -var _StandardWalletAdapter_instances, _StandardWalletAdapter_account, _StandardWalletAdapter_publicKey, _StandardWalletAdapter_connecting, _StandardWalletAdapter_disconnecting, _StandardWalletAdapter_off, _StandardWalletAdapter_supportedTransactionVersions, _StandardWalletAdapter_wallet, _StandardWalletAdapter_readyState, _StandardWalletAdapter_connect, _StandardWalletAdapter_connected, _StandardWalletAdapter_disconnected, _StandardWalletAdapter_reset, _StandardWalletAdapter_changed, _StandardWalletAdapter_signTransaction, _StandardWalletAdapter_signAllTransactions, _StandardWalletAdapter_signMessage, _StandardWalletAdapter_signIn; -class StandardWalletAdapter extends BaseWalletAdapter { - constructor({ wallet }) { - super(); - _StandardWalletAdapter_instances.add(this); - _StandardWalletAdapter_account.set(this, void 0); - _StandardWalletAdapter_publicKey.set(this, void 0); - _StandardWalletAdapter_connecting.set(this, void 0); - _StandardWalletAdapter_disconnecting.set(this, void 0); - _StandardWalletAdapter_off.set(this, void 0); - _StandardWalletAdapter_supportedTransactionVersions.set(this, void 0); - _StandardWalletAdapter_wallet.set(this, void 0); - _StandardWalletAdapter_readyState.set(this, typeof window === "undefined" || typeof document === "undefined" ? WalletReadyState$2.Unsupported : WalletReadyState$2.Installed); - _StandardWalletAdapter_changed.set(this, (properties) => { - if ("accounts" in properties) { - const account = __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").accounts[0]; - if (__classPrivateFieldGet$4(this, _StandardWalletAdapter_account, "f") && !__classPrivateFieldGet$4(this, _StandardWalletAdapter_disconnecting, "f") && account !== __classPrivateFieldGet$4(this, _StandardWalletAdapter_account, "f")) { - if (account) { - __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connected).call(this, account); - } else { - this.emit("error", new WalletDisconnectedError$1()); - __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_disconnected).call(this); - } - } - } - if ("features" in properties) { - __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_reset).call(this); - } - }); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_wallet, wallet, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_account, null, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_publicKey, null, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_connecting, false, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_disconnecting, false, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_off, __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[StandardEvents].on("change", __classPrivateFieldGet$4(this, _StandardWalletAdapter_changed, "f")), "f"); - __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_reset).call(this); - } - get name() { - return __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").name; - } - get url() { - return "https://github.com/solana-labs/wallet-standard"; - } - get icon() { - return __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").icon; - } - get readyState() { - return __classPrivateFieldGet$4(this, _StandardWalletAdapter_readyState, "f"); - } - get publicKey() { - return __classPrivateFieldGet$4(this, _StandardWalletAdapter_publicKey, "f"); - } - get connecting() { - return __classPrivateFieldGet$4(this, _StandardWalletAdapter_connecting, "f"); - } - get supportedTransactionVersions() { - return __classPrivateFieldGet$4(this, _StandardWalletAdapter_supportedTransactionVersions, "f"); - } - get wallet() { - return __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f"); - } - get standard() { - return true; - } - destroy() { - __classPrivateFieldSet$4(this, _StandardWalletAdapter_account, null, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_publicKey, null, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_connecting, false, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_disconnecting, false, "f"); - const off = __classPrivateFieldGet$4(this, _StandardWalletAdapter_off, "f"); - if (off) { - __classPrivateFieldSet$4(this, _StandardWalletAdapter_off, null, "f"); - off(); - } - } - async autoConnect() { - return __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connect).call(this, { silent: true }); - } - async connect() { - return __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connect).call(this); - } - async disconnect() { - if (StandardDisconnect in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features) { - try { - __classPrivateFieldSet$4(this, _StandardWalletAdapter_disconnecting, true, "f"); - await __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[StandardDisconnect].disconnect(); - } catch (error) { - this.emit("error", new WalletDisconnectionError(error == null ? void 0 : error.message, error)); - } finally { - __classPrivateFieldSet$4(this, _StandardWalletAdapter_disconnecting, false, "f"); - } - } - __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_disconnected).call(this); - } - async sendTransaction(transaction2, connection, options = {}) { - try { - const account = __classPrivateFieldGet$4(this, _StandardWalletAdapter_account, "f"); - if (!account) - throw new WalletNotConnectedError(); - let feature; - if (SolanaSignAndSendTransaction in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features) { - if (account.features.includes(SolanaSignAndSendTransaction)) { - feature = SolanaSignAndSendTransaction; - } else if (SolanaSignTransaction in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features && account.features.includes(SolanaSignTransaction)) { - feature = SolanaSignTransaction; - } else { - throw new WalletAccountError(); - } - } else if (SolanaSignTransaction in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features) { - if (!account.features.includes(SolanaSignTransaction)) - throw new WalletAccountError(); - feature = SolanaSignTransaction; - } else { - throw new WalletConfigError(); - } - const chain = getChainForEndpoint(connection.rpcEndpoint); - if (!account.chains.includes(chain)) - throw new WalletSendTransactionError(); - try { - const { signers, ...sendOptions } = options; - let serializedTransaction; - if (isVersionedTransaction$1(transaction2)) { - (signers == null ? void 0 : signers.length) && transaction2.sign(signers); - serializedTransaction = transaction2.serialize(); - } else { - transaction2 = await this.prepareTransaction(transaction2, connection, sendOptions); - (signers == null ? void 0 : signers.length) && transaction2.partialSign(...signers); - serializedTransaction = new Uint8Array(transaction2.serialize({ - requireAllSignatures: false, - verifySignatures: false - })); - } - if (feature === SolanaSignAndSendTransaction) { - const [output2] = await __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignAndSendTransaction].signAndSendTransaction({ - account, - chain, - transaction: serializedTransaction, - options: { - preflightCommitment: getCommitment(sendOptions.preflightCommitment || connection.commitment), - skipPreflight: sendOptions.skipPreflight, - maxRetries: sendOptions.maxRetries, - minContextSlot: sendOptions.minContextSlot - } - }); - return bs58$1.encode(output2.signature); - } else { - const [output2] = await __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignTransaction].signTransaction({ - account, - chain, - transaction: serializedTransaction, - options: { - preflightCommitment: getCommitment(sendOptions.preflightCommitment || connection.commitment), - minContextSlot: sendOptions.minContextSlot - } - }); - return await connection.sendRawTransaction(output2.signedTransaction, { - ...sendOptions, - preflightCommitment: getCommitment(sendOptions.preflightCommitment || connection.commitment) - }); - } - } catch (error) { - if (error instanceof WalletError$2) - throw error; - throw new WalletSendTransactionError(error == null ? void 0 : error.message, error); - } - } catch (error) { - this.emit("error", error); - throw error; - } - } -} -_StandardWalletAdapter_account = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_publicKey = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_connecting = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_disconnecting = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_off = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_supportedTransactionVersions = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_wallet = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_readyState = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_changed = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_instances = /* @__PURE__ */ new WeakSet(), _StandardWalletAdapter_connect = async function _StandardWalletAdapter_connect2(input) { - try { - if (this.connected || this.connecting) - return; - if (__classPrivateFieldGet$4(this, _StandardWalletAdapter_readyState, "f") !== WalletReadyState$2.Installed) - throw new WalletNotReadyError(); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_connecting, true, "f"); - if (!__classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").accounts.length) { - try { - await __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[StandardConnect].connect(input); - } catch (error) { - throw new WalletConnectionError$1(error == null ? void 0 : error.message, error); - } - } - const account = __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").accounts[0]; - if (!account) - throw new WalletAccountError(); - __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connected).call(this, account); - } catch (error) { - this.emit("error", error); - throw error; - } finally { - __classPrivateFieldSet$4(this, _StandardWalletAdapter_connecting, false, "f"); - } -}, _StandardWalletAdapter_connected = function _StandardWalletAdapter_connected2(account) { - let publicKey2; - try { - publicKey2 = new PublicKey(account.address); - } catch (error) { - throw new WalletPublicKeyError(error == null ? void 0 : error.message, error); - } - __classPrivateFieldSet$4(this, _StandardWalletAdapter_account, account, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_publicKey, publicKey2, "f"); - __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_reset).call(this); - this.emit("connect", publicKey2); -}, _StandardWalletAdapter_disconnected = function _StandardWalletAdapter_disconnected2() { - __classPrivateFieldSet$4(this, _StandardWalletAdapter_account, null, "f"); - __classPrivateFieldSet$4(this, _StandardWalletAdapter_publicKey, null, "f"); - __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_reset).call(this); - this.emit("disconnect"); -}, _StandardWalletAdapter_reset = function _StandardWalletAdapter_reset2() { - var _a3, _b2; - const supportedTransactionVersions = SolanaSignAndSendTransaction in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features ? __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignAndSendTransaction].supportedTransactionVersions : __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignTransaction].supportedTransactionVersions; - __classPrivateFieldSet$4(this, _StandardWalletAdapter_supportedTransactionVersions, arraysEqual(supportedTransactionVersions, ["legacy"]) ? null : new Set(supportedTransactionVersions), "f"); - if (SolanaSignTransaction in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features && ((_a3 = __classPrivateFieldGet$4(this, _StandardWalletAdapter_account, "f")) == null ? void 0 : _a3.features.includes(SolanaSignTransaction))) { - this.signTransaction = __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_signTransaction); - this.signAllTransactions = __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_signAllTransactions); - } else { - delete this.signTransaction; - delete this.signAllTransactions; - } - if (SolanaSignMessage in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features && ((_b2 = __classPrivateFieldGet$4(this, _StandardWalletAdapter_account, "f")) == null ? void 0 : _b2.features.includes(SolanaSignMessage))) { - this.signMessage = __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_signMessage); - } else { - delete this.signMessage; - } - if (SolanaSignIn in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features) { - this.signIn = __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_signIn); - } else { - delete this.signIn; - } -}, _StandardWalletAdapter_signTransaction = async function _StandardWalletAdapter_signTransaction2(transaction2) { - try { - const account = __classPrivateFieldGet$4(this, _StandardWalletAdapter_account, "f"); - if (!account) - throw new WalletNotConnectedError(); - if (!(SolanaSignTransaction in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features)) - throw new WalletConfigError(); - if (!account.features.includes(SolanaSignTransaction)) - throw new WalletAccountError(); - try { - const signedTransactions = await __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignTransaction].signTransaction({ - account, - transaction: isVersionedTransaction$1(transaction2) ? transaction2.serialize() : new Uint8Array(transaction2.serialize({ - requireAllSignatures: false, - verifySignatures: false - })) - }); - const serializedTransaction = signedTransactions[0].signedTransaction; - return isVersionedTransaction$1(transaction2) ? VersionedTransaction.deserialize(serializedTransaction) : Transaction$2.from(serializedTransaction); - } catch (error) { - if (error instanceof WalletError$2) - throw error; - throw new WalletSignTransactionError$1(error == null ? void 0 : error.message, error); - } - } catch (error) { - this.emit("error", error); - throw error; - } -}, _StandardWalletAdapter_signAllTransactions = async function _StandardWalletAdapter_signAllTransactions2(transactions) { - try { - const account = __classPrivateFieldGet$4(this, _StandardWalletAdapter_account, "f"); - if (!account) - throw new WalletNotConnectedError(); - if (!(SolanaSignTransaction in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features)) - throw new WalletConfigError(); - if (!account.features.includes(SolanaSignTransaction)) - throw new WalletAccountError(); - try { - const signedTransactions = await __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignTransaction].signTransaction(...transactions.map((transaction2) => ({ - account, - transaction: isVersionedTransaction$1(transaction2) ? transaction2.serialize() : new Uint8Array(transaction2.serialize({ - requireAllSignatures: false, - verifySignatures: false - })) - }))); - return transactions.map((transaction2, index2) => { - const signedTransaction = signedTransactions[index2].signedTransaction; - return isVersionedTransaction$1(transaction2) ? VersionedTransaction.deserialize(signedTransaction) : Transaction$2.from(signedTransaction); - }); - } catch (error) { - throw new WalletSignTransactionError$1(error == null ? void 0 : error.message, error); - } - } catch (error) { - this.emit("error", error); - throw error; - } -}, _StandardWalletAdapter_signMessage = async function _StandardWalletAdapter_signMessage2(message2) { - try { - const account = __classPrivateFieldGet$4(this, _StandardWalletAdapter_account, "f"); - if (!account) - throw new WalletNotConnectedError(); - if (!(SolanaSignMessage in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features)) - throw new WalletConfigError(); - if (!account.features.includes(SolanaSignMessage)) - throw new WalletAccountError(); - try { - const signedMessages = await __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignMessage].signMessage({ - account, - message: message2 - }); - return signedMessages[0].signature; - } catch (error) { - throw new WalletSignMessageError$1(error == null ? void 0 : error.message, error); - } - } catch (error) { - this.emit("error", error); - throw error; - } -}, _StandardWalletAdapter_signIn = async function _StandardWalletAdapter_signIn2(input = {}) { - try { - if (!(SolanaSignIn in __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features)) - throw new WalletConfigError(); - let output2; - try { - [output2] = await __classPrivateFieldGet$4(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignIn].signIn(input); - } catch (error) { - throw new WalletSignInError(error == null ? void 0 : error.message, error); - } - if (!output2) - throw new WalletSignInError(); - __classPrivateFieldGet$4(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connected).call(this, output2.account); - return output2; - } catch (error) { - this.emit("error", error); - throw error; - } -}; -const isWalletAdapterCompatibleWallet = isWalletAdapterCompatibleStandardWallet; -var __classPrivateFieldSet$3 = globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f3) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f3.call(receiver, value) : f3 ? f3.value = value : state.set(receiver, value), value; -}; -var __classPrivateFieldGet$3 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f3) { - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f3 : kind === "a" ? f3.call(receiver) : f3 ? f3.value : state.get(receiver); -}; -var _AppReadyEvent_detail; -let wallets = void 0; -const registered = /* @__PURE__ */ new Set(); -const listeners = {}; -function getWallets() { - if (wallets) - return wallets; - wallets = Object.freeze({ register, get: get$1, on: on$2 }); - if (typeof window === "undefined") - return wallets; - const api = Object.freeze({ register }); - try { - window.addEventListener("wallet-standard:register-wallet", ({ detail: callback }) => callback(api)); - } catch (error) { - console.error("wallet-standard:register-wallet event listener could not be added\n", error); - } - try { - window.dispatchEvent(new AppReadyEvent(api)); - } catch (error) { - console.error("wallet-standard:app-ready event could not be dispatched\n", error); - } - return wallets; -} -function register(...wallets2) { - var _a3; - wallets2 = wallets2.filter((wallet) => !registered.has(wallet)); - if (!wallets2.length) - return () => { - }; - wallets2.forEach((wallet) => registered.add(wallet)); - (_a3 = listeners["register"]) == null ? void 0 : _a3.forEach((listener) => guard(() => listener(...wallets2))); - return function unregister() { - var _a4; - wallets2.forEach((wallet) => registered.delete(wallet)); - (_a4 = listeners["unregister"]) == null ? void 0 : _a4.forEach((listener) => guard(() => listener(...wallets2))); - }; -} -function get$1() { - return [...registered]; -} -function on$2(event, listener) { - var _a3; - ((_a3 = listeners[event]) == null ? void 0 : _a3.push(listener)) || (listeners[event] = [listener]); - return function off() { - var _a4; - listeners[event] = (_a4 = listeners[event]) == null ? void 0 : _a4.filter((existingListener) => listener !== existingListener); - }; -} -function guard(callback) { - try { - callback(); - } catch (error) { - console.error(error); - } -} -class AppReadyEvent extends Event { - constructor(api) { - super("wallet-standard:app-ready", { - bubbles: false, - cancelable: false, - composed: false - }); - _AppReadyEvent_detail.set(this, void 0); - __classPrivateFieldSet$3(this, _AppReadyEvent_detail, api, "f"); - } - get detail() { - return __classPrivateFieldGet$3(this, _AppReadyEvent_detail, "f"); - } - get type() { - return "wallet-standard:app-ready"; - } - /** @deprecated */ - preventDefault() { - throw new Error("preventDefault cannot be called"); - } - /** @deprecated */ - stopImmediatePropagation() { - throw new Error("stopImmediatePropagation cannot be called"); - } - /** @deprecated */ - stopPropagation() { - throw new Error("stopPropagation cannot be called"); - } -} -_AppReadyEvent_detail = /* @__PURE__ */ new WeakMap(); -function DEPRECATED_getWallets() { - if (wallets) - return wallets; - wallets = getWallets(); - if (typeof window === "undefined") - return wallets; - const callbacks = window.navigator.wallets || []; - if (!Array.isArray(callbacks)) { - console.error("window.navigator.wallets is not an array"); - return wallets; - } - const { register: register2 } = wallets; - const push = (...callbacks2) => callbacks2.forEach((callback) => guard(() => callback({ register: register2 }))); - try { - Object.defineProperty(window.navigator, "wallets", { - value: Object.freeze({ push }) - }); - } catch (error) { - console.error("window.navigator.wallets could not be set"); - return wallets; - } - push(...callbacks); - return wallets; -} -function useStandardWalletAdapters(adapters2) { - const warnings = useConstant(() => /* @__PURE__ */ new Set()); - const { get: get2, on: on2 } = useConstant(() => DEPRECATED_getWallets()); - const [standardAdapters, setStandardAdapters] = reactExports.useState(() => wrapWalletsWithAdapters(get2())); - reactExports.useEffect(() => { - const listeners3 = [ - on2("register", (...wallets2) => setStandardAdapters((standardAdapters2) => [...standardAdapters2, ...wrapWalletsWithAdapters(wallets2)])), - on2("unregister", (...wallets2) => setStandardAdapters((standardAdapters2) => standardAdapters2.filter((standardAdapter) => wallets2.some((wallet) => wallet === standardAdapter.wallet)))) - ]; - return () => listeners3.forEach((off) => off()); - }, [on2]); - const prevStandardAdapters = usePrevious(standardAdapters); - reactExports.useEffect(() => { - if (!prevStandardAdapters) - return; - const currentAdapters = new Set(standardAdapters); - const removedAdapters = new Set(prevStandardAdapters.filter((previousAdapter) => !currentAdapters.has(previousAdapter))); - removedAdapters.forEach((adapter) => adapter.destroy()); - }, [prevStandardAdapters, standardAdapters]); - reactExports.useEffect(() => () => standardAdapters.forEach((adapter) => adapter.destroy()), []); - return reactExports.useMemo(() => [ - ...standardAdapters, - ...adapters2.filter(({ name: name2 }) => { - if (standardAdapters.some((standardAdapter) => standardAdapter.name === name2)) { - if (!warnings.has(name2)) { - warnings.add(name2); - console.warn(`${name2} was registered as a Standard Wallet. The Wallet Adapter for ${name2} can be removed from your app.`); - } - return false; - } - return true; - }) - ], [standardAdapters, adapters2, warnings]); -} -function useConstant(fn2) { - const ref = reactExports.useRef(); - if (!ref.current) { - ref.current = { value: fn2() }; - } - return ref.current.value; -} -function usePrevious(state) { - const ref = reactExports.useRef(); - reactExports.useEffect(() => { - ref.current = state; - }); - return ref.current; -} -function wrapWalletsWithAdapters(wallets2) { - return wallets2.filter(isWalletAdapterCompatibleWallet).map((wallet) => new StandardWalletAdapter({ wallet })); -} -var Environment; -(function(Environment2) { - Environment2[Environment2["DESKTOP_WEB"] = 0] = "DESKTOP_WEB"; - Environment2[Environment2["MOBILE_WEB"] = 1] = "MOBILE_WEB"; -})(Environment || (Environment = {})); -function isWebView(userAgentString) { - return /(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(userAgentString); -} -function getEnvironment({ adapters: adapters2, userAgentString }) { - if (adapters2.some((adapter) => adapter.name !== SolanaMobileWalletAdapterWalletName && adapter.readyState === WalletReadyState$2.Installed)) { - return Environment.DESKTOP_WEB; - } - if (userAgentString && // Step 1: Check whether we're on a platform that supports MWA at all. - /android/i.test(userAgentString) && // Step 2: Determine that we are *not* running in a WebView. - !isWebView(userAgentString)) { - return Environment.MOBILE_WEB; - } else { - return Environment.DESKTOP_WEB; - } -} -function getInferredClusterFromEndpoint(endpoint) { - if (!endpoint) { - return "mainnet-beta"; - } - if (/devnet/i.test(endpoint)) { - return "devnet"; - } else if (/testnet/i.test(endpoint)) { - return "testnet"; - } else { - return "mainnet-beta"; - } -} -function WalletProviderBase({ children, wallets: adapters2, adapter, isUnloadingRef, onAutoConnectRequest, onConnectError, onError, onSelectWallet }) { - const isConnectingRef = reactExports.useRef(false); - const [connecting, setConnecting] = reactExports.useState(false); - const isDisconnectingRef = reactExports.useRef(false); - const [disconnecting, setDisconnecting] = reactExports.useState(false); - const [publicKey2, setPublicKey] = reactExports.useState(() => (adapter == null ? void 0 : adapter.publicKey) ?? null); - const [connected, setConnected] = reactExports.useState(() => (adapter == null ? void 0 : adapter.connected) ?? false); - const onErrorRef = reactExports.useRef(onError); - reactExports.useEffect(() => { - onErrorRef.current = onError; - return () => { - onErrorRef.current = void 0; - }; - }, [onError]); - const handleErrorRef = reactExports.useRef((error, adapter2) => { - if (!isUnloadingRef.current) { - if (onErrorRef.current) { - onErrorRef.current(error, adapter2); - } else { - console.error(error, adapter2); - if (error instanceof WalletNotReadyError && typeof window !== "undefined" && adapter2) { - window.open(adapter2.url, "_blank"); - } - } - } - return error; - }); - const [wallets2, setWallets] = reactExports.useState(() => adapters2.map((adapter2) => ({ - adapter: adapter2, - readyState: adapter2.readyState - })).filter(({ readyState }) => readyState !== WalletReadyState$2.Unsupported)); - reactExports.useEffect(() => { - setWallets((wallets3) => adapters2.map((adapter2, index2) => { - const wallet2 = wallets3[index2]; - return wallet2 && wallet2.adapter === adapter2 && wallet2.readyState === adapter2.readyState ? wallet2 : { - adapter: adapter2, - readyState: adapter2.readyState - }; - }).filter(({ readyState }) => readyState !== WalletReadyState$2.Unsupported)); - function handleReadyStateChange(readyState) { - setWallets((prevWallets) => { - const index2 = prevWallets.findIndex(({ adapter: adapter3 }) => adapter3 === this); - if (index2 === -1) - return prevWallets; - const { adapter: adapter2 } = prevWallets[index2]; - return [ - ...prevWallets.slice(0, index2), - { adapter: adapter2, readyState }, - ...prevWallets.slice(index2 + 1) - ].filter(({ readyState: readyState2 }) => readyState2 !== WalletReadyState$2.Unsupported); - }); - } - adapters2.forEach((adapter2) => adapter2.on("readyStateChange", handleReadyStateChange, adapter2)); - return () => { - adapters2.forEach((adapter2) => adapter2.off("readyStateChange", handleReadyStateChange, adapter2)); - }; - }, [adapter, adapters2]); - const wallet = reactExports.useMemo(() => wallets2.find((wallet2) => wallet2.adapter === adapter) ?? null, [adapter, wallets2]); - reactExports.useEffect(() => { - if (!adapter) - return; - const handleConnect2 = (publicKey3) => { - setPublicKey(publicKey3); - isConnectingRef.current = false; - setConnecting(false); - setConnected(true); - isDisconnectingRef.current = false; - setDisconnecting(false); - }; - const handleDisconnect2 = () => { - if (isUnloadingRef.current) - return; - setPublicKey(null); - isConnectingRef.current = false; - setConnecting(false); - setConnected(false); - isDisconnectingRef.current = false; - setDisconnecting(false); - }; - const handleError = (error) => { - handleErrorRef.current(error, adapter); - }; - adapter.on("connect", handleConnect2); - adapter.on("disconnect", handleDisconnect2); - adapter.on("error", handleError); - return () => { - adapter.off("connect", handleConnect2); - adapter.off("disconnect", handleDisconnect2); - adapter.off("error", handleError); - handleDisconnect2(); - }; - }, [adapter, isUnloadingRef]); - const didAttemptAutoConnectRef = reactExports.useRef(false); - reactExports.useEffect(() => { - return () => { - didAttemptAutoConnectRef.current = false; - }; - }, [adapter]); - reactExports.useEffect(() => { - if (didAttemptAutoConnectRef.current || isConnectingRef.current || connected || !onAutoConnectRequest || !((wallet == null ? void 0 : wallet.readyState) === WalletReadyState$2.Installed || (wallet == null ? void 0 : wallet.readyState) === WalletReadyState$2.Loadable)) - return; - isConnectingRef.current = true; - setConnecting(true); - didAttemptAutoConnectRef.current = true; - (async function() { - try { - await onAutoConnectRequest(); - } catch { - onConnectError(); - } finally { - setConnecting(false); - isConnectingRef.current = false; - } - })(); - }, [connected, onAutoConnectRequest, onConnectError, wallet]); - const sendTransaction = reactExports.useCallback(async (transaction2, connection, options) => { - if (!adapter) - throw handleErrorRef.current(new WalletNotSelectedError$1()); - if (!connected) - throw handleErrorRef.current(new WalletNotConnectedError(), adapter); - return await adapter.sendTransaction(transaction2, connection, options); - }, [adapter, connected]); - const signTransaction2 = reactExports.useMemo(() => adapter && "signTransaction" in adapter ? async (transaction2) => { - if (!connected) - throw handleErrorRef.current(new WalletNotConnectedError(), adapter); - return await adapter.signTransaction(transaction2); - } : void 0, [adapter, connected]); - const signAllTransactions = reactExports.useMemo(() => adapter && "signAllTransactions" in adapter ? async (transactions) => { - if (!connected) - throw handleErrorRef.current(new WalletNotConnectedError(), adapter); - return await adapter.signAllTransactions(transactions); - } : void 0, [adapter, connected]); - const signMessage2 = reactExports.useMemo(() => adapter && "signMessage" in adapter ? async (message2) => { - if (!connected) - throw handleErrorRef.current(new WalletNotConnectedError(), adapter); - return await adapter.signMessage(message2); - } : void 0, [adapter, connected]); - const signIn = reactExports.useMemo(() => adapter && "signIn" in adapter ? async (input) => { - return await adapter.signIn(input); - } : void 0, [adapter]); - const handleConnect = reactExports.useCallback(async () => { - if (isConnectingRef.current || isDisconnectingRef.current || (wallet == null ? void 0 : wallet.adapter.connected)) - return; - if (!wallet) - throw handleErrorRef.current(new WalletNotSelectedError$1()); - const { adapter: adapter2, readyState } = wallet; - if (!(readyState === WalletReadyState$2.Installed || readyState === WalletReadyState$2.Loadable)) - throw handleErrorRef.current(new WalletNotReadyError(), adapter2); - isConnectingRef.current = true; - setConnecting(true); - try { - await adapter2.connect(); - } catch (e18) { - onConnectError(); - throw e18; - } finally { - setConnecting(false); - isConnectingRef.current = false; - } - }, [onConnectError, wallet]); - const handleDisconnect = reactExports.useCallback(async () => { - if (isDisconnectingRef.current) - return; - if (!adapter) - return; - isDisconnectingRef.current = true; - setDisconnecting(true); - try { - await adapter.disconnect(); - } finally { - setDisconnecting(false); - isDisconnectingRef.current = false; - } - }, [adapter]); - return W$2.createElement(WalletContext$1.Provider, { value: { - autoConnect: !!onAutoConnectRequest, - wallets: wallets2, - wallet, - publicKey: publicKey2, - connected, - connecting, - disconnecting, - select: onSelectWallet, - connect: handleConnect, - disconnect: handleDisconnect, - sendTransaction, - signTransaction: signTransaction2, - signAllTransactions, - signMessage: signMessage2, - signIn - } }, children); -} -let _userAgent; -function getUserAgent$1() { - var _a3; - if (_userAgent === void 0) { - _userAgent = ((_a3 = globalThis.navigator) == null ? void 0 : _a3.userAgent) ?? null; - } - return _userAgent; -} -function getIsMobile(adapters2) { - const userAgentString = getUserAgent$1(); - return getEnvironment({ adapters: adapters2, userAgentString }) === Environment.MOBILE_WEB; -} -function getUriForAppIdentity() { - const location2 = globalThis.location; - if (!location2) - return; - return `${location2.protocol}//${location2.host}`; -} -function WalletProvider$1({ children, wallets: adapters2, autoConnect, localStorageKey = "walletName", onError }) { - const { connection } = useConnection(); - const adaptersWithStandardAdapters = useStandardWalletAdapters(adapters2); - const mobileWalletAdapter = reactExports.useMemo(() => { - if (!getIsMobile(adaptersWithStandardAdapters)) { - return null; - } - const existingMobileWalletAdapter = adaptersWithStandardAdapters.find((adapter2) => adapter2.name === SolanaMobileWalletAdapterWalletName); - if (existingMobileWalletAdapter) { - return existingMobileWalletAdapter; - } - return new SolanaMobileWalletAdapter({ - addressSelector: createDefaultAddressSelector(), - appIdentity: { - uri: getUriForAppIdentity() - }, - authorizationResultCache: createDefaultAuthorizationResultCache(), - cluster: getInferredClusterFromEndpoint(connection == null ? void 0 : connection.rpcEndpoint), - onWalletNotFound: createDefaultWalletNotFoundHandler() - }); - }, [adaptersWithStandardAdapters, connection == null ? void 0 : connection.rpcEndpoint]); - const adaptersWithMobileWalletAdapter = reactExports.useMemo(() => { - if (mobileWalletAdapter == null || adaptersWithStandardAdapters.indexOf(mobileWalletAdapter) !== -1) { - return adaptersWithStandardAdapters; - } - return [mobileWalletAdapter, ...adaptersWithStandardAdapters]; - }, [adaptersWithStandardAdapters, mobileWalletAdapter]); - const [walletName, setWalletName] = useLocalStorage$1(localStorageKey, getIsMobile(adaptersWithStandardAdapters) ? SolanaMobileWalletAdapterWalletName : null); - const adapter = reactExports.useMemo(() => adaptersWithMobileWalletAdapter.find((a3) => a3.name === walletName) ?? null, [adaptersWithMobileWalletAdapter, walletName]); - const changeWallet = reactExports.useCallback((nextWalletName) => { - if (walletName === nextWalletName) - return; - if (adapter && // Selecting a wallet other than the mobile wallet adapter is not - // sufficient reason to call `disconnect` on the mobile wallet adapter. - // Calling `disconnect` on the mobile wallet adapter causes the entire - // authorization store to be wiped. - adapter.name !== SolanaMobileWalletAdapterWalletName) { - adapter.disconnect(); - } - setWalletName(nextWalletName); - }, [adapter, setWalletName, walletName]); - reactExports.useEffect(() => { - if (!adapter) - return; - function handleDisconnect() { - if (isUnloadingRef.current) - return; - if (walletName === SolanaMobileWalletAdapterWalletName && getIsMobile(adaptersWithStandardAdapters)) - return; - setWalletName(null); - } - adapter.on("disconnect", handleDisconnect); - return () => { - adapter.off("disconnect", handleDisconnect); - }; - }, [adapter, adaptersWithStandardAdapters, setWalletName, walletName]); - const hasUserSelectedAWallet = reactExports.useRef(false); - const handleAutoConnectRequest = reactExports.useMemo(() => { - if (!autoConnect || !adapter) - return; - return async () => { - if (autoConnect === true || await autoConnect(adapter)) { - if (hasUserSelectedAWallet.current) { - await adapter.connect(); - } else { - await adapter.autoConnect(); - } - } - }; - }, [autoConnect, adapter]); - const isUnloadingRef = reactExports.useRef(false); - reactExports.useEffect(() => { - if (walletName === SolanaMobileWalletAdapterWalletName && getIsMobile(adaptersWithStandardAdapters)) { - isUnloadingRef.current = false; - return; - } - function handleBeforeUnload() { - isUnloadingRef.current = true; - } - window.addEventListener("beforeunload", handleBeforeUnload); - return () => { - window.removeEventListener("beforeunload", handleBeforeUnload); - }; - }, [adaptersWithStandardAdapters, walletName]); - const handleConnectError = reactExports.useCallback(() => { - if (adapter && adapter.name !== SolanaMobileWalletAdapterWalletName) { - changeWallet(null); - } - }, [adapter, changeWallet]); - const selectWallet = reactExports.useCallback((walletName2) => { - hasUserSelectedAWallet.current = true; - changeWallet(walletName2); - }, [changeWallet]); - return W$2.createElement(WalletProviderBase, { wallets: adaptersWithMobileWalletAdapter, adapter, isUnloadingRef, onAutoConnectRequest: handleAutoConnectRequest, onConnectError: handleConnectError, onError, onSelectWallet: selectWallet }, children); -} -var WalletReadyState$1; -(function(WalletReadyState2) { - WalletReadyState2["Loading"] = "Loading"; - WalletReadyState2["NotFound"] = "NotFound"; - WalletReadyState2["Found"] = "Found"; -})(WalletReadyState$1 || (WalletReadyState$1 = {})); -var AdapterState$1; -(function(AdapterState2) { - AdapterState2["Loading"] = "Loading"; - AdapterState2["NotFound"] = "NotFound"; - AdapterState2["Disconnect"] = "Disconnected"; - AdapterState2["Connected"] = "Connected"; -})(AdapterState$1 || (AdapterState$1 = {})); -let WalletError$1 = class WalletError2 extends Error { - constructor(message2, error) { - super(message2); - this.error = error; - } -}; -class WalletNotSelectedError2 extends WalletError$1 { - constructor() { - super(...arguments); - this.name = "WalletNotSelectedError"; - this.message = "No wallet is selected. Please select a wallet."; - } -} -function isInBrowser$1() { - return typeof window !== "undefined" && typeof document !== "undefined" && typeof navigator !== "undefined"; -} -function useLocalStorage(key2, defaultState) { - const [state, setState] = reactExports.useState(() => { - try { - const value = localStorage.getItem(key2); - if (value) - return JSON.parse(value); - } catch (error) { - if (isInBrowser$1()) { - console.error(error); - } - } - return defaultState; - }); - const isFirstRender = reactExports.useRef(true); - reactExports.useEffect(() => { - if (isFirstRender.current) { - isFirstRender.current = false; - return; - } - try { - if (state === null) { - localStorage.removeItem(key2); - } else { - localStorage.setItem(key2, JSON.stringify(state)); - } - } catch (error) { - if (isInBrowser$1()) { - console.error(error); - } - } - }, [state, key2]); - return [state, setState]; -} -function printError() { - console.error(` -You are using WalletContext without provide the WalletContext.Provider. -Please wrap your sub-components with a WalletProvider and provide required values. -`); -} -const DEFAULT_CONTEXT = { - autoConnect: false, - connecting: false, - connected: false, - disconnecting: false, - /* eslint-disable */ - select(_name) { - printError(); - }, - connect() { - printError(); - return Promise.reject(); - }, - disconnect() { - printError(); - return Promise.reject(); - }, - signTransaction(_transaction) { - printError(); - return Promise.reject(); - }, - signMessage(_message) { - printError(); - return Promise.reject(); - } - /* eslint-enable */ -}; -Object.defineProperty(DEFAULT_CONTEXT, "wallets", { - get() { - printError(); - return []; - } -}); -Object.defineProperty(DEFAULT_CONTEXT, "wallet", { - get() { - printError(); - return null; - } -}); -Object.defineProperty(DEFAULT_CONTEXT, "address", { - get() { - printError(); - return null; - } -}); -const WalletContext = reactExports.createContext(DEFAULT_CONTEXT); -function useWallet() { - return reactExports.useContext(WalletContext); -} -var WalletReadyState; -(function(WalletReadyState2) { - WalletReadyState2["Loading"] = "Loading"; - WalletReadyState2["NotFound"] = "NotFound"; - WalletReadyState2["Found"] = "Found"; -})(WalletReadyState || (WalletReadyState = {})); -var AdapterState; -(function(AdapterState2) { - AdapterState2["Loading"] = "Loading"; - AdapterState2["NotFound"] = "NotFound"; - AdapterState2["Disconnect"] = "Disconnected"; - AdapterState2["Connected"] = "Connected"; -})(AdapterState || (AdapterState = {})); -class Adapter extends EventEmitter$3 { - get connected() { - return this.state === AdapterState.Connected; - } - /** - * Some wallets such as TronLink don't support disconnect() method. - */ - disconnect() { - console.info("The current adapter doesn't support disconnect by DApp."); - return Promise.resolve(); - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - multiSign(...args) { - return Promise.reject("The current wallet doesn't support multiSign."); - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - switchChain(_chainId2) { - return Promise.reject("The current wallet doesn't support switch chain."); - } -} -class WalletError3 extends Error { - constructor(message2, error) { - super(message2); - this.error = error; - } -} -class WalletNotFoundError extends WalletError3 { - constructor() { - super(...arguments); - this.name = "WalletNotFoundError"; - this.message = "The wallet is not found."; - } -} -class WalletDisconnectedError2 extends WalletError3 { - constructor() { - super(...arguments); - this.name = "WalletDisconnectedError"; - this.message = "The wallet is disconnected. Please connect first."; - } -} -class WalletConnectionError2 extends WalletError3 { - constructor() { - super(...arguments); - this.name = "WalletConnectionError"; - } -} -class WalletSignMessageError2 extends WalletError3 { - constructor() { - super(...arguments); - this.name = "WalletSignMessageError"; - } -} -class WalletSignTransactionError2 extends WalletError3 { - constructor() { - super(...arguments); - this.name = "WalletSignTransactionError"; - } -} -class WalletSwitchChainError extends WalletError3 { - constructor() { - super(...arguments); - this.name = "WalletSwitchChainError"; - } -} -class WalletGetNetworkError extends WalletError3 { - constructor() { - super(...arguments); - this.name = "WalletGetNetworkError"; - } -} -const _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; -class Base64 { - encode(input) { - let output2 = ""; - let chr1; - let chr2; - let chr3; - let enc1; - let enc2; - let enc3; - let enc4; - let i3 = 0; - while (i3 < input.length) { - chr1 = input.charCodeAt(i3++); - chr2 = input.charCodeAt(i3++); - chr3 = input.charCodeAt(i3++); - enc1 = chr1 >> 2; - enc2 = (chr1 & 3) << 4 | chr2 >> 4; - enc3 = (chr2 & 15) << 2 | chr3 >> 6; - enc4 = chr3 & 63; - if (isNaN(chr2)) - enc3 = enc4 = 64; - else if (isNaN(chr3)) - enc4 = 64; - output2 = output2 + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4); - } - return output2; - } - encodeIgnoreUtf8(inputBytes) { - let output2 = ""; - let chr1; - let chr2; - let chr3; - let enc1; - let enc2; - let enc3; - let enc4; - let i3 = 0; - while (i3 < inputBytes.length) { - chr1 = inputBytes[i3++]; - chr2 = inputBytes[i3++]; - chr3 = inputBytes[i3++]; - enc1 = chr1 >> 2; - enc2 = (chr1 & 3) << 4 | chr2 >> 4; - enc3 = (chr2 & 15) << 2 | chr3 >> 6; - enc4 = chr3 & 63; - if (isNaN(chr2)) - enc3 = enc4 = 64; - else if (isNaN(chr3)) - enc4 = 64; - output2 = output2 + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4); - } - return output2; - } - decode(input) { - let output2 = ""; - let chr1; - let chr2; - let chr3; - let enc1; - let enc2; - let enc3; - let enc4; - let i3 = 0; - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - while (i3 < input.length) { - enc1 = _keyStr.indexOf(input.charAt(i3++)); - enc2 = _keyStr.indexOf(input.charAt(i3++)); - enc3 = _keyStr.indexOf(input.charAt(i3++)); - enc4 = _keyStr.indexOf(input.charAt(i3++)); - chr1 = enc1 << 2 | enc2 >> 4; - chr2 = (enc2 & 15) << 4 | enc3 >> 2; - chr3 = (enc3 & 3) << 6 | enc4; - output2 = output2 + String.fromCharCode(chr1); - if (enc3 != 64) - output2 = output2 + String.fromCharCode(chr2); - if (enc4 != 64) - output2 = output2 + String.fromCharCode(chr3); - } - return this._utf8_decode(output2); - } - decodeToByteArray(input) { - let output2 = ""; - let chr1; - let chr2; - let chr3; - let enc1; - let enc2; - let enc3; - let enc4; - let i3 = 0; - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - while (i3 < input.length) { - enc1 = _keyStr.indexOf(input.charAt(i3++)); - enc2 = _keyStr.indexOf(input.charAt(i3++)); - enc3 = _keyStr.indexOf(input.charAt(i3++)); - enc4 = _keyStr.indexOf(input.charAt(i3++)); - chr1 = enc1 << 2 | enc2 >> 4; - chr2 = (enc2 & 15) << 4 | enc3 >> 2; - chr3 = (enc3 & 3) << 6 | enc4; - output2 = output2 + String.fromCharCode(chr1); - if (enc3 != 64) - output2 = output2 + String.fromCharCode(chr2); - if (enc4 != 64) - output2 = output2 + String.fromCharCode(chr3); - } - return this._out2ByteArray(output2); - } - _out2ByteArray(utftext) { - const byteArray = new Array(utftext.length); - let i3 = 0; - let c2 = 0; - while (i3 < utftext.length) { - c2 = utftext.charCodeAt(i3); - byteArray[i3] = c2; - i3++; - } - return byteArray; - } - _utf8_encode(string2) { - string2 = string2.replace(/\r\n/g, "\n"); - let utftext = ""; - for (let n4 = 0; n4 < string2.length; n4++) { - const c2 = string2.charCodeAt(n4); - if (c2 < 128) { - utftext += String.fromCharCode(c2); - } else if (c2 > 127 && c2 < 2048) { - utftext += String.fromCharCode(c2 >> 6 | 192); - utftext += String.fromCharCode(c2 & 63 | 128); - } else { - utftext += String.fromCharCode(c2 >> 12 | 224); - utftext += String.fromCharCode(c2 >> 6 & 63 | 128); - utftext += String.fromCharCode(c2 & 63 | 128); - } - } - return utftext; - } - _utf8_decode(utftext) { - let string2 = ""; - let i3 = 0; - let c2 = 0; - let c22 = 0; - let c3 = 0; - while (i3 < utftext.length) { - c2 = utftext.charCodeAt(i3); - if (c2 < 128) { - string2 += String.fromCharCode(c2); - i3++; - } else if (c2 > 191 && c2 < 224) { - c22 = utftext.charCodeAt(i3 + 1); - string2 += String.fromCharCode((c2 & 31) << 6 | c22 & 63); - i3 += 2; - } else { - c22 = utftext.charCodeAt(i3 + 1); - c3 = utftext.charCodeAt(i3 + 2); - string2 += String.fromCharCode((c2 & 15) << 12 | (c22 & 63) << 6 | c3 & 63); - i3 += 3; - } - } - return string2; - } -} -function byte2hexStr(byte2) { - if (byte2 < 0 || byte2 > 255) - throw new Error("Input must be a byte"); - const hexByteMap = "0123456789ABCDEF"; - let str = ""; - str += hexByteMap.charAt(byte2 >> 4); - str += hexByteMap.charAt(byte2 & 15); - return str; -} -function bytesToString(arr) { - let str = ""; - for (let i3 = 0; i3 < arr.length; i3++) { - const one = arr[i3].toString(2); - const v6 = one.match(/^1+?(?=0)/); - if (v6 && one.length === 8) { - const bytesLength = v6[0].length; - let store = arr[i3].toString(2).slice(7 - bytesLength); - for (let st2 = 1; st2 < bytesLength; st2++) - store += arr[st2 + i3].toString(2).slice(2); - str += String.fromCharCode(parseInt(store, 2)); - i3 += bytesLength - 1; - } else { - str += String.fromCharCode(arr[i3]); - } - } - return str; -} -function hextoString(hex) { - const arr = hex.replace(/^0x/, "").split(""); - let out = ""; - for (let i3 = 0; i3 < arr.length / 2; i3++) { - const tmp = `0x${arr[i3 * 2]}${arr[i3 * 2 + 1]}`; - out += String.fromCharCode(parseInt(tmp)); - } - return out; -} -function byteArray2hexStr(byteArray) { - let str = ""; - for (let i3 = 0; i3 < byteArray.length; i3++) - str += byte2hexStr(byteArray[i3]); - return str; -} -function base64DecodeFromString(string64) { - return new Base64().decodeToByteArray(string64); -} -function base64EncodeToString(bytes2) { - const b2 = new Base64(); - const string64 = b2.encodeIgnoreUtf8(bytes2); - return string64; -} -const bytes$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - base64DecodeFromString, - base64EncodeToString, - byte2hexStr, - byteArray2hexStr, - bytesToString, - hextoString -}, Symbol.toStringTag, { value: "Module" })); -function bin2String(array2) { - return bytesToString(array2); -} -function arrayEquals(array1, array2, strict = false) { - if (array1.length != array2.length) - return false; - for (let i3 = 0; i3 < array1.length; i3++) { - if (strict) { - if (array1[i3] != array2[i3]) - return false; - } else if (JSON.stringify(array1[i3]) != JSON.stringify(array2[i3])) - return false; - } - return true; -} -function stringToBytes(str) { - const bytes2 = []; - const len = str.length; - let c2; - for (let i3 = 0; i3 < len; i3++) { - c2 = str.charCodeAt(i3); - if (c2 >= 65536 && c2 <= 1114111) { - bytes2.push(c2 >> 18 & 7 | 240); - bytes2.push(c2 >> 12 & 63 | 128); - bytes2.push(c2 >> 6 & 63 | 128); - bytes2.push(c2 & 63 | 128); - } else if (c2 >= 2048 && c2 <= 65535) { - bytes2.push(c2 >> 12 & 15 | 224); - bytes2.push(c2 >> 6 & 63 | 128); - bytes2.push(c2 & 63 | 128); - } else if (c2 >= 128 && c2 <= 2047) { - bytes2.push(c2 >> 6 & 31 | 192); - bytes2.push(c2 & 63 | 128); - } else - bytes2.push(c2 & 255); - } - return bytes2; -} -function hexChar2byte(c2) { - let d4; - if (c2 >= "A" && c2 <= "F") - d4 = c2.charCodeAt(0) - "A".charCodeAt(0) + 10; - else if (c2 >= "a" && c2 <= "f") - d4 = c2.charCodeAt(0) - "a".charCodeAt(0) + 10; - else if (c2 >= "0" && c2 <= "9") - d4 = c2.charCodeAt(0) - "0".charCodeAt(0); - if (typeof d4 === "number") - return d4; - else - throw new Error("The passed hex char is not a valid hex char"); -} -function isHexChar(c2) { - if (c2 >= "A" && c2 <= "F" || c2 >= "a" && c2 <= "f" || c2 >= "0" && c2 <= "9") { - return 1; - } - return 0; -} -function hexStr2byteArray(str, strict = false) { - let len = str.length; - if (strict) { - if (len % 2) { - str = `0${str}`; - len++; - } - } - const byteArray = []; - let d4 = 0; - let j2 = 0; - let k2 = 0; - for (let i3 = 0; i3 < len; i3++) { - const c2 = str.charAt(i3); - if (isHexChar(c2)) { - d4 <<= 4; - d4 += hexChar2byte(c2); - j2++; - if (0 === j2 % 2) { - byteArray[k2++] = d4; - d4 = 0; - } - } else - throw new Error("The passed hex char is not a valid hex string"); - } - return byteArray; -} -function strToDate(str) { - if (!/^\d{4}-\d{2}-\d{2}( \d{2}-\d{2}-\d{2}|)/.test(str)) - throw new Error("The passed date string is not valid"); - const tempStrs = str.split(" "); - const dateStrs = tempStrs[0].split("-"); - const year = parseInt(dateStrs[0], 10); - const month = parseInt(dateStrs[1], 10) - 1; - const day = parseInt(dateStrs[2], 10); - if (tempStrs.length > 1) { - const timeStrs = tempStrs[1].split("-"); - const hour = parseInt(timeStrs[0], 10); - const minute = parseInt(timeStrs[1], 10); - const second = parseInt(timeStrs[2], 10); - return new Date(year, month, day, hour, minute, second); - } - return new Date(year, month, day); -} -function isNumber$1(c2) { - if (c2 >= "0" && c2 <= "9") - return 1; - return 0; -} -function getStringType(str) { - if (null == str) - return -1; - if (str.length == 0 || str == "") - return -1; - let i3 = 0; - if (str.length == 40) { - for (; i3 < 40; i3++) { - const c2 = str.charAt(i3); - if (!isHexChar(c2)) - break; - } - } - if (i3 == 40) - return 1; - for (i3 = 0; i3 < str.length; i3++) { - const c2 = str.charAt(i3); - if (!isNumber$1(c2)) - break; - } - if (i3 == str.length) - return 2; - for (i3 = 0; i3 < str.length; i3++) { - const c2 = str.charAt(i3); - if (c2 > " ") - return 3; - } - return -1; -} -const code = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - arrayEquals, - base64DecodeFromString, - base64EncodeToString, - bin2String, - byte2hexStr, - byteArray2hexStr, - bytesToString, - getStringType, - hexChar2byte, - hexStr2byteArray, - hextoString, - isHexChar, - isNumber: isNumber$1, - strToDate, - stringToBytes -}, Symbol.toStringTag, { value: "Module" })); -var isNumeric$1 = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE$1 = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9; -function clone(configObject) { - var div, convertBase, parseNumeric, P2 = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = { - prefix: "", - groupSize: 3, - secondaryGroupSize: 0, - groupSeparator: ",", - decimalSeparator: ".", - fractionGroupSize: 0, - fractionGroupSeparator: " ", - // non-breaking space - suffix: "" - }, ALPHABET2 = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true; - function BigNumber2(v6, b2) { - var alphabet2, c2, caseChanged, e18, i3, isNum, len, str, x3 = this; - if (!(x3 instanceof BigNumber2)) - return new BigNumber2(v6, b2); - if (b2 == null) { - if (v6 && v6._isBigNumber === true) { - x3.s = v6.s; - if (!v6.c || v6.e > MAX_EXP) { - x3.c = x3.e = null; - } else if (v6.e < MIN_EXP) { - x3.c = [x3.e = 0]; - } else { - x3.e = v6.e; - x3.c = v6.c.slice(); - } - return; - } - if ((isNum = typeof v6 == "number") && v6 * 0 == 0) { - x3.s = 1 / v6 < 0 ? (v6 = -v6, -1) : 1; - if (v6 === ~~v6) { - for (e18 = 0, i3 = v6; i3 >= 10; i3 /= 10, e18++) - ; - if (e18 > MAX_EXP) { - x3.c = x3.e = null; - } else { - x3.e = e18; - x3.c = [v6]; - } - return; - } - str = String(v6); - } else { - if (!isNumeric$1.test(str = String(v6))) - return parseNumeric(x3, str, isNum); - x3.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; - } - if ((e18 = str.indexOf(".")) > -1) - str = str.replace(".", ""); - if ((i3 = str.search(/e/i)) > 0) { - if (e18 < 0) - e18 = i3; - e18 += +str.slice(i3 + 1); - str = str.substring(0, i3); - } else if (e18 < 0) { - e18 = str.length; - } - } else { - intCheck(b2, 2, ALPHABET2.length, "Base"); - if (b2 == 10 && alphabetHasNormalDecimalDigits) { - x3 = new BigNumber2(v6); - return round(x3, DECIMAL_PLACES + x3.e + 1, ROUNDING_MODE); - } - str = String(v6); - if (isNum = typeof v6 == "number") { - if (v6 * 0 != 0) - return parseNumeric(x3, str, isNum, b2); - x3.s = 1 / v6 < 0 ? (str = str.slice(1), -1) : 1; - if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) { - throw Error(tooManyDigits + v6); - } - } else { - x3.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; - } - alphabet2 = ALPHABET2.slice(0, b2); - e18 = i3 = 0; - for (len = str.length; i3 < len; i3++) { - if (alphabet2.indexOf(c2 = str.charAt(i3)) < 0) { - if (c2 == ".") { - if (i3 > e18) { - e18 = len; - continue; - } - } else if (!caseChanged) { - if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) { - caseChanged = true; - i3 = -1; - e18 = 0; - continue; - } - } - return parseNumeric(x3, String(v6), isNum, b2); - } - } - isNum = false; - str = convertBase(str, b2, 10, x3.s); - if ((e18 = str.indexOf(".")) > -1) - str = str.replace(".", ""); - else - e18 = str.length; - } - for (i3 = 0; str.charCodeAt(i3) === 48; i3++) - ; - for (len = str.length; str.charCodeAt(--len) === 48; ) - ; - if (str = str.slice(i3, ++len)) { - len -= i3; - if (isNum && BigNumber2.DEBUG && len > 15 && (v6 > MAX_SAFE_INTEGER || v6 !== mathfloor(v6))) { - throw Error(tooManyDigits + x3.s * v6); - } - if ((e18 = e18 - i3 - 1) > MAX_EXP) { - x3.c = x3.e = null; - } else if (e18 < MIN_EXP) { - x3.c = [x3.e = 0]; - } else { - x3.e = e18; - x3.c = []; - i3 = (e18 + 1) % LOG_BASE; - if (e18 < 0) - i3 += LOG_BASE; - if (i3 < len) { - if (i3) - x3.c.push(+str.slice(0, i3)); - for (len -= LOG_BASE; i3 < len; ) { - x3.c.push(+str.slice(i3, i3 += LOG_BASE)); - } - i3 = LOG_BASE - (str = str.slice(i3)).length; - } else { - i3 -= len; - } - for (; i3--; str += "0") - ; - x3.c.push(+str); - } - } else { - x3.c = [x3.e = 0]; - } - } - BigNumber2.clone = clone; - BigNumber2.ROUND_UP = 0; - BigNumber2.ROUND_DOWN = 1; - BigNumber2.ROUND_CEIL = 2; - BigNumber2.ROUND_FLOOR = 3; - BigNumber2.ROUND_HALF_UP = 4; - BigNumber2.ROUND_HALF_DOWN = 5; - BigNumber2.ROUND_HALF_EVEN = 6; - BigNumber2.ROUND_HALF_CEIL = 7; - BigNumber2.ROUND_HALF_FLOOR = 8; - BigNumber2.EUCLID = 9; - BigNumber2.config = BigNumber2.set = function(obj) { - var p3, v6; - if (obj != null) { - if (typeof obj == "object") { - if (obj.hasOwnProperty(p3 = "DECIMAL_PLACES")) { - v6 = obj[p3]; - intCheck(v6, 0, MAX, p3); - DECIMAL_PLACES = v6; - } - if (obj.hasOwnProperty(p3 = "ROUNDING_MODE")) { - v6 = obj[p3]; - intCheck(v6, 0, 8, p3); - ROUNDING_MODE = v6; - } - if (obj.hasOwnProperty(p3 = "EXPONENTIAL_AT")) { - v6 = obj[p3]; - if (v6 && v6.pop) { - intCheck(v6[0], -MAX, 0, p3); - intCheck(v6[1], 0, MAX, p3); - TO_EXP_NEG = v6[0]; - TO_EXP_POS = v6[1]; - } else { - intCheck(v6, -MAX, MAX, p3); - TO_EXP_NEG = -(TO_EXP_POS = v6 < 0 ? -v6 : v6); - } - } - if (obj.hasOwnProperty(p3 = "RANGE")) { - v6 = obj[p3]; - if (v6 && v6.pop) { - intCheck(v6[0], -MAX, -1, p3); - intCheck(v6[1], 1, MAX, p3); - MIN_EXP = v6[0]; - MAX_EXP = v6[1]; - } else { - intCheck(v6, -MAX, MAX, p3); - if (v6) { - MIN_EXP = -(MAX_EXP = v6 < 0 ? -v6 : v6); - } else { - throw Error(bignumberError + p3 + " cannot be zero: " + v6); - } - } - } - if (obj.hasOwnProperty(p3 = "CRYPTO")) { - v6 = obj[p3]; - if (v6 === !!v6) { - if (v6) { - if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) { - CRYPTO = v6; - } else { - CRYPTO = !v6; - throw Error(bignumberError + "crypto unavailable"); - } - } else { - CRYPTO = v6; - } - } else { - throw Error(bignumberError + p3 + " not true or false: " + v6); - } - } - if (obj.hasOwnProperty(p3 = "MODULO_MODE")) { - v6 = obj[p3]; - intCheck(v6, 0, 9, p3); - MODULO_MODE = v6; - } - if (obj.hasOwnProperty(p3 = "POW_PRECISION")) { - v6 = obj[p3]; - intCheck(v6, 0, MAX, p3); - POW_PRECISION = v6; - } - if (obj.hasOwnProperty(p3 = "FORMAT")) { - v6 = obj[p3]; - if (typeof v6 == "object") - FORMAT = v6; - else - throw Error(bignumberError + p3 + " not an object: " + v6); - } - if (obj.hasOwnProperty(p3 = "ALPHABET")) { - v6 = obj[p3]; - if (typeof v6 == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v6)) { - alphabetHasNormalDecimalDigits = v6.slice(0, 10) == "0123456789"; - ALPHABET2 = v6; - } else { - throw Error(bignumberError + p3 + " invalid: " + v6); - } - } - } else { - throw Error(bignumberError + "Object expected: " + obj); - } - } - return { - DECIMAL_PLACES, - ROUNDING_MODE, - EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], - RANGE: [MIN_EXP, MAX_EXP], - CRYPTO, - MODULO_MODE, - POW_PRECISION, - FORMAT, - ALPHABET: ALPHABET2 - }; - }; - BigNumber2.isBigNumber = function(v6) { - if (!v6 || v6._isBigNumber !== true) - return false; - if (!BigNumber2.DEBUG) - return true; - var i3, n4, c2 = v6.c, e18 = v6.e, s2 = v6.s; - out: - if ({}.toString.call(c2) == "[object Array]") { - if ((s2 === 1 || s2 === -1) && e18 >= -MAX && e18 <= MAX && e18 === mathfloor(e18)) { - if (c2[0] === 0) { - if (e18 === 0 && c2.length === 1) - return true; - break out; - } - i3 = (e18 + 1) % LOG_BASE; - if (i3 < 1) - i3 += LOG_BASE; - if (String(c2[0]).length == i3) { - for (i3 = 0; i3 < c2.length; i3++) { - n4 = c2[i3]; - if (n4 < 0 || n4 >= BASE$1 || n4 !== mathfloor(n4)) - break out; - } - if (n4 !== 0) - return true; - } - } - } else if (c2 === null && e18 === null && (s2 === null || s2 === 1 || s2 === -1)) { - return true; - } - throw Error(bignumberError + "Invalid BigNumber: " + v6); - }; - BigNumber2.maximum = BigNumber2.max = function() { - return maxOrMin(arguments, -1); - }; - BigNumber2.minimum = BigNumber2.min = function() { - return maxOrMin(arguments, 1); - }; - BigNumber2.random = function() { - var pow2_53 = 9007199254740992; - var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() { - return mathfloor(Math.random() * pow2_53); - } : function() { - return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0); - }; - return function(dp) { - var a3, b2, e18, k2, v6, i3 = 0, c2 = [], rand3 = new BigNumber2(ONE); - if (dp == null) - dp = DECIMAL_PLACES; - else - intCheck(dp, 0, MAX); - k2 = mathceil(dp / LOG_BASE); - if (CRYPTO) { - if (crypto.getRandomValues) { - a3 = crypto.getRandomValues(new Uint32Array(k2 *= 2)); - for (; i3 < k2; ) { - v6 = a3[i3] * 131072 + (a3[i3 + 1] >>> 11); - if (v6 >= 9e15) { - b2 = crypto.getRandomValues(new Uint32Array(2)); - a3[i3] = b2[0]; - a3[i3 + 1] = b2[1]; - } else { - c2.push(v6 % 1e14); - i3 += 2; - } - } - i3 = k2 / 2; - } else if (crypto.randomBytes) { - a3 = crypto.randomBytes(k2 *= 7); - for (; i3 < k2; ) { - v6 = (a3[i3] & 31) * 281474976710656 + a3[i3 + 1] * 1099511627776 + a3[i3 + 2] * 4294967296 + a3[i3 + 3] * 16777216 + (a3[i3 + 4] << 16) + (a3[i3 + 5] << 8) + a3[i3 + 6]; - if (v6 >= 9e15) { - crypto.randomBytes(7).copy(a3, i3); - } else { - c2.push(v6 % 1e14); - i3 += 7; - } - } - i3 = k2 / 7; - } else { - CRYPTO = false; - throw Error(bignumberError + "crypto unavailable"); - } - } - if (!CRYPTO) { - for (; i3 < k2; ) { - v6 = random53bitInt(); - if (v6 < 9e15) - c2[i3++] = v6 % 1e14; - } - } - k2 = c2[--i3]; - dp %= LOG_BASE; - if (k2 && dp) { - v6 = POWS_TEN[LOG_BASE - dp]; - c2[i3] = mathfloor(k2 / v6) * v6; - } - for (; c2[i3] === 0; c2.pop(), i3--) - ; - if (i3 < 0) { - c2 = [e18 = 0]; - } else { - for (e18 = -1; c2[0] === 0; c2.splice(0, 1), e18 -= LOG_BASE) - ; - for (i3 = 1, v6 = c2[0]; v6 >= 10; v6 /= 10, i3++) - ; - if (i3 < LOG_BASE) - e18 -= LOG_BASE - i3; - } - rand3.e = e18; - rand3.c = c2; - return rand3; - }; - }(); - BigNumber2.sum = function() { - var i3 = 1, args = arguments, sum = new BigNumber2(args[0]); - for (; i3 < args.length; ) - sum = sum.plus(args[i3++]); - return sum; - }; - convertBase = function() { - var decimal2 = "0123456789"; - function toBaseOut(str, baseIn, baseOut, alphabet2) { - var j2, arr = [0], arrL, i3 = 0, len = str.length; - for (; i3 < len; ) { - for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) - ; - arr[0] += alphabet2.indexOf(str.charAt(i3++)); - for (j2 = 0; j2 < arr.length; j2++) { - if (arr[j2] > baseOut - 1) { - if (arr[j2 + 1] == null) - arr[j2 + 1] = 0; - arr[j2 + 1] += arr[j2] / baseOut | 0; - arr[j2] %= baseOut; - } - } - } - return arr.reverse(); - } - return function(str, baseIn, baseOut, sign6, callerIsToString) { - var alphabet2, d4, e18, k2, r2, x3, xc2, y3, i3 = str.indexOf("."), dp = DECIMAL_PLACES, rm2 = ROUNDING_MODE; - if (i3 >= 0) { - k2 = POW_PRECISION; - POW_PRECISION = 0; - str = str.replace(".", ""); - y3 = new BigNumber2(baseIn); - x3 = y3.pow(str.length - i3); - POW_PRECISION = k2; - y3.c = toBaseOut( - toFixedPoint(coeffToString(x3.c), x3.e, "0"), - 10, - baseOut, - decimal2 - ); - y3.e = y3.c.length; - } - xc2 = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet2 = ALPHABET2, decimal2) : (alphabet2 = decimal2, ALPHABET2)); - e18 = k2 = xc2.length; - for (; xc2[--k2] == 0; xc2.pop()) - ; - if (!xc2[0]) - return alphabet2.charAt(0); - if (i3 < 0) { - --e18; - } else { - x3.c = xc2; - x3.e = e18; - x3.s = sign6; - x3 = div(x3, y3, dp, rm2, baseOut); - xc2 = x3.c; - r2 = x3.r; - e18 = x3.e; - } - d4 = e18 + dp + 1; - i3 = xc2[d4]; - k2 = baseOut / 2; - r2 = r2 || d4 < 0 || xc2[d4 + 1] != null; - r2 = rm2 < 4 ? (i3 != null || r2) && (rm2 == 0 || rm2 == (x3.s < 0 ? 3 : 2)) : i3 > k2 || i3 == k2 && (rm2 == 4 || r2 || rm2 == 6 && xc2[d4 - 1] & 1 || rm2 == (x3.s < 0 ? 8 : 7)); - if (d4 < 1 || !xc2[0]) { - str = r2 ? toFixedPoint(alphabet2.charAt(1), -dp, alphabet2.charAt(0)) : alphabet2.charAt(0); - } else { - xc2.length = d4; - if (r2) { - for (--baseOut; ++xc2[--d4] > baseOut; ) { - xc2[d4] = 0; - if (!d4) { - ++e18; - xc2 = [1].concat(xc2); - } - } - } - for (k2 = xc2.length; !xc2[--k2]; ) - ; - for (i3 = 0, str = ""; i3 <= k2; str += alphabet2.charAt(xc2[i3++])) - ; - str = toFixedPoint(str, e18, alphabet2.charAt(0)); - } - return str; - }; - }(); - div = function() { - function multiply(x3, k2, base3) { - var m3, temp, xlo, xhi, carry = 0, i3 = x3.length, klo = k2 % SQRT_BASE, khi = k2 / SQRT_BASE | 0; - for (x3 = x3.slice(); i3--; ) { - xlo = x3[i3] % SQRT_BASE; - xhi = x3[i3] / SQRT_BASE | 0; - m3 = khi * xlo + xhi * klo; - temp = klo * xlo + m3 % SQRT_BASE * SQRT_BASE + carry; - carry = (temp / base3 | 0) + (m3 / SQRT_BASE | 0) + khi * xhi; - x3[i3] = temp % base3; - } - if (carry) - x3 = [carry].concat(x3); - return x3; - } - function compare2(a3, b2, aL, bL) { - var i3, cmp; - if (aL != bL) { - cmp = aL > bL ? 1 : -1; - } else { - for (i3 = cmp = 0; i3 < aL; i3++) { - if (a3[i3] != b2[i3]) { - cmp = a3[i3] > b2[i3] ? 1 : -1; - break; - } - } - } - return cmp; - } - function subtract(a3, b2, aL, base3) { - var i3 = 0; - for (; aL--; ) { - a3[aL] -= i3; - i3 = a3[aL] < b2[aL] ? 1 : 0; - a3[aL] = i3 * base3 + a3[aL] - b2[aL]; - } - for (; !a3[0] && a3.length > 1; a3.splice(0, 1)) - ; - } - return function(x3, y3, dp, rm2, base3) { - var cmp, e18, i3, more, n4, prod, prodL, q2, qc2, rem, remL, rem0, xi2, xL, yc0, yL, yz, s2 = x3.s == y3.s ? 1 : -1, xc2 = x3.c, yc2 = y3.c; - if (!xc2 || !xc2[0] || !yc2 || !yc2[0]) { - return new BigNumber2( - // Return NaN if either NaN, or both Infinity or 0. - !x3.s || !y3.s || (xc2 ? yc2 && xc2[0] == yc2[0] : !yc2) ? NaN : ( - // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. - xc2 && xc2[0] == 0 || !yc2 ? s2 * 0 : s2 / 0 - ) - ); - } - q2 = new BigNumber2(s2); - qc2 = q2.c = []; - e18 = x3.e - y3.e; - s2 = dp + e18 + 1; - if (!base3) { - base3 = BASE$1; - e18 = bitFloor(x3.e / LOG_BASE) - bitFloor(y3.e / LOG_BASE); - s2 = s2 / LOG_BASE | 0; - } - for (i3 = 0; yc2[i3] == (xc2[i3] || 0); i3++) - ; - if (yc2[i3] > (xc2[i3] || 0)) - e18--; - if (s2 < 0) { - qc2.push(1); - more = true; - } else { - xL = xc2.length; - yL = yc2.length; - i3 = 0; - s2 += 2; - n4 = mathfloor(base3 / (yc2[0] + 1)); - if (n4 > 1) { - yc2 = multiply(yc2, n4, base3); - xc2 = multiply(xc2, n4, base3); - yL = yc2.length; - xL = xc2.length; - } - xi2 = yL; - rem = xc2.slice(0, yL); - remL = rem.length; - for (; remL < yL; rem[remL++] = 0) - ; - yz = yc2.slice(); - yz = [0].concat(yz); - yc0 = yc2[0]; - if (yc2[1] >= base3 / 2) - yc0++; - do { - n4 = 0; - cmp = compare2(yc2, rem, yL, remL); - if (cmp < 0) { - rem0 = rem[0]; - if (yL != remL) - rem0 = rem0 * base3 + (rem[1] || 0); - n4 = mathfloor(rem0 / yc0); - if (n4 > 1) { - if (n4 >= base3) - n4 = base3 - 1; - prod = multiply(yc2, n4, base3); - prodL = prod.length; - remL = rem.length; - while (compare2(prod, rem, prodL, remL) == 1) { - n4--; - subtract(prod, yL < prodL ? yz : yc2, prodL, base3); - prodL = prod.length; - cmp = 1; - } - } else { - if (n4 == 0) { - cmp = n4 = 1; - } - prod = yc2.slice(); - prodL = prod.length; - } - if (prodL < remL) - prod = [0].concat(prod); - subtract(rem, prod, remL, base3); - remL = rem.length; - if (cmp == -1) { - while (compare2(yc2, rem, yL, remL) < 1) { - n4++; - subtract(rem, yL < remL ? yz : yc2, remL, base3); - remL = rem.length; - } - } - } else if (cmp === 0) { - n4++; - rem = [0]; - } - qc2[i3++] = n4; - if (rem[0]) { - rem[remL++] = xc2[xi2] || 0; - } else { - rem = [xc2[xi2]]; - remL = 1; - } - } while ((xi2++ < xL || rem[0] != null) && s2--); - more = rem[0] != null; - if (!qc2[0]) - qc2.splice(0, 1); - } - if (base3 == BASE$1) { - for (i3 = 1, s2 = qc2[0]; s2 >= 10; s2 /= 10, i3++) - ; - round(q2, dp + (q2.e = i3 + e18 * LOG_BASE - 1) + 1, rm2, more); - } else { - q2.e = e18; - q2.r = +more; - } - return q2; - }; - }(); - function format2(n4, i3, rm2, id2) { - var c02, e18, ne2, len, str; - if (rm2 == null) - rm2 = ROUNDING_MODE; - else - intCheck(rm2, 0, 8); - if (!n4.c) - return n4.toString(); - c02 = n4.c[0]; - ne2 = n4.e; - if (i3 == null) { - str = coeffToString(n4.c); - str = id2 == 1 || id2 == 2 && (ne2 <= TO_EXP_NEG || ne2 >= TO_EXP_POS) ? toExponential(str, ne2) : toFixedPoint(str, ne2, "0"); - } else { - n4 = round(new BigNumber2(n4), i3, rm2); - e18 = n4.e; - str = coeffToString(n4.c); - len = str.length; - if (id2 == 1 || id2 == 2 && (i3 <= e18 || e18 <= TO_EXP_NEG)) { - for (; len < i3; str += "0", len++) - ; - str = toExponential(str, e18); - } else { - i3 -= ne2; - str = toFixedPoint(str, e18, "0"); - if (e18 + 1 > len) { - if (--i3 > 0) - for (str += "."; i3--; str += "0") - ; - } else { - i3 += e18 - len; - if (i3 > 0) { - if (e18 + 1 == len) - str += "."; - for (; i3--; str += "0") - ; - } - } - } - } - return n4.s < 0 && c02 ? "-" + str : str; - } - function maxOrMin(args, n4) { - var k2, y3, i3 = 1, x3 = new BigNumber2(args[0]); - for (; i3 < args.length; i3++) { - y3 = new BigNumber2(args[i3]); - if (!y3.s || (k2 = compare$1(x3, y3)) === n4 || k2 === 0 && x3.s === n4) { - x3 = y3; - } - } - return x3; - } - function normalise(n4, c2, e18) { - var i3 = 1, j2 = c2.length; - for (; !c2[--j2]; c2.pop()) - ; - for (j2 = c2[0]; j2 >= 10; j2 /= 10, i3++) - ; - if ((e18 = i3 + e18 * LOG_BASE - 1) > MAX_EXP) { - n4.c = n4.e = null; - } else if (e18 < MIN_EXP) { - n4.c = [n4.e = 0]; - } else { - n4.e = e18; - n4.c = c2; - } - return n4; - } - parseNumeric = function() { - var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; - return function(x3, str, isNum, b2) { - var base3, s2 = isNum ? str : str.replace(whitespaceOrPlus, ""); - if (isInfinityOrNaN.test(s2)) { - x3.s = isNaN(s2) ? null : s2 < 0 ? -1 : 1; - } else { - if (!isNum) { - s2 = s2.replace(basePrefix, function(m3, p1, p22) { - base3 = (p22 = p22.toLowerCase()) == "x" ? 16 : p22 == "b" ? 2 : 8; - return !b2 || b2 == base3 ? p1 : m3; - }); - if (b2) { - base3 = b2; - s2 = s2.replace(dotAfter, "$1").replace(dotBefore, "0.$1"); - } - if (str != s2) - return new BigNumber2(s2, base3); - } - if (BigNumber2.DEBUG) { - throw Error(bignumberError + "Not a" + (b2 ? " base " + b2 : "") + " number: " + str); - } - x3.s = null; - } - x3.c = x3.e = null; - }; - }(); - function round(x3, sd2, rm2, r2) { - var d4, i3, j2, k2, n4, ni2, rd2, xc2 = x3.c, pows10 = POWS_TEN; - if (xc2) { - out: { - for (d4 = 1, k2 = xc2[0]; k2 >= 10; k2 /= 10, d4++) - ; - i3 = sd2 - d4; - if (i3 < 0) { - i3 += LOG_BASE; - j2 = sd2; - n4 = xc2[ni2 = 0]; - rd2 = mathfloor(n4 / pows10[d4 - j2 - 1] % 10); - } else { - ni2 = mathceil((i3 + 1) / LOG_BASE); - if (ni2 >= xc2.length) { - if (r2) { - for (; xc2.length <= ni2; xc2.push(0)) - ; - n4 = rd2 = 0; - d4 = 1; - i3 %= LOG_BASE; - j2 = i3 - LOG_BASE + 1; - } else { - break out; - } - } else { - n4 = k2 = xc2[ni2]; - for (d4 = 1; k2 >= 10; k2 /= 10, d4++) - ; - i3 %= LOG_BASE; - j2 = i3 - LOG_BASE + d4; - rd2 = j2 < 0 ? 0 : mathfloor(n4 / pows10[d4 - j2 - 1] % 10); - } - } - r2 = r2 || sd2 < 0 || // Are there any non-zero digits after the rounding digit? - // The expression n % pows10[d - j - 1] returns all digits of n to the right - // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. - xc2[ni2 + 1] != null || (j2 < 0 ? n4 : n4 % pows10[d4 - j2 - 1]); - r2 = rm2 < 4 ? (rd2 || r2) && (rm2 == 0 || rm2 == (x3.s < 0 ? 3 : 2)) : rd2 > 5 || rd2 == 5 && (rm2 == 4 || r2 || rm2 == 6 && // Check whether the digit to the left of the rounding digit is odd. - (i3 > 0 ? j2 > 0 ? n4 / pows10[d4 - j2] : 0 : xc2[ni2 - 1]) % 10 & 1 || rm2 == (x3.s < 0 ? 8 : 7)); - if (sd2 < 1 || !xc2[0]) { - xc2.length = 0; - if (r2) { - sd2 -= x3.e + 1; - xc2[0] = pows10[(LOG_BASE - sd2 % LOG_BASE) % LOG_BASE]; - x3.e = -sd2 || 0; - } else { - xc2[0] = x3.e = 0; - } - return x3; - } - if (i3 == 0) { - xc2.length = ni2; - k2 = 1; - ni2--; - } else { - xc2.length = ni2 + 1; - k2 = pows10[LOG_BASE - i3]; - xc2[ni2] = j2 > 0 ? mathfloor(n4 / pows10[d4 - j2] % pows10[j2]) * k2 : 0; - } - if (r2) { - for (; ; ) { - if (ni2 == 0) { - for (i3 = 1, j2 = xc2[0]; j2 >= 10; j2 /= 10, i3++) - ; - j2 = xc2[0] += k2; - for (k2 = 1; j2 >= 10; j2 /= 10, k2++) - ; - if (i3 != k2) { - x3.e++; - if (xc2[0] == BASE$1) - xc2[0] = 1; - } - break; - } else { - xc2[ni2] += k2; - if (xc2[ni2] != BASE$1) - break; - xc2[ni2--] = 0; - k2 = 1; - } - } - } - for (i3 = xc2.length; xc2[--i3] === 0; xc2.pop()) - ; - } - if (x3.e > MAX_EXP) { - x3.c = x3.e = null; - } else if (x3.e < MIN_EXP) { - x3.c = [x3.e = 0]; - } - } - return x3; - } - function valueOf(n4) { - var str, e18 = n4.e; - if (e18 === null) - return n4.toString(); - str = coeffToString(n4.c); - str = e18 <= TO_EXP_NEG || e18 >= TO_EXP_POS ? toExponential(str, e18) : toFixedPoint(str, e18, "0"); - return n4.s < 0 ? "-" + str : str; - } - P2.absoluteValue = P2.abs = function() { - var x3 = new BigNumber2(this); - if (x3.s < 0) - x3.s = 1; - return x3; - }; - P2.comparedTo = function(y3, b2) { - return compare$1(this, new BigNumber2(y3, b2)); - }; - P2.decimalPlaces = P2.dp = function(dp, rm2) { - var c2, n4, v6, x3 = this; - if (dp != null) { - intCheck(dp, 0, MAX); - if (rm2 == null) - rm2 = ROUNDING_MODE; - else - intCheck(rm2, 0, 8); - return round(new BigNumber2(x3), dp + x3.e + 1, rm2); - } - if (!(c2 = x3.c)) - return null; - n4 = ((v6 = c2.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; - if (v6 = c2[v6]) - for (; v6 % 10 == 0; v6 /= 10, n4--) - ; - if (n4 < 0) - n4 = 0; - return n4; - }; - P2.dividedBy = P2.div = function(y3, b2) { - return div(this, new BigNumber2(y3, b2), DECIMAL_PLACES, ROUNDING_MODE); - }; - P2.dividedToIntegerBy = P2.idiv = function(y3, b2) { - return div(this, new BigNumber2(y3, b2), 0, 1); - }; - P2.exponentiatedBy = P2.pow = function(n4, m3) { - var half, isModExp, i3, k2, more, nIsBig, nIsNeg, nIsOdd, y3, x3 = this; - n4 = new BigNumber2(n4); - if (n4.c && !n4.isInteger()) { - throw Error(bignumberError + "Exponent not an integer: " + valueOf(n4)); - } - if (m3 != null) - m3 = new BigNumber2(m3); - nIsBig = n4.e > 14; - if (!x3.c || !x3.c[0] || x3.c[0] == 1 && !x3.e && x3.c.length == 1 || !n4.c || !n4.c[0]) { - y3 = new BigNumber2(Math.pow(+valueOf(x3), nIsBig ? n4.s * (2 - isOdd(n4)) : +valueOf(n4))); - return m3 ? y3.mod(m3) : y3; - } - nIsNeg = n4.s < 0; - if (m3) { - if (m3.c ? !m3.c[0] : !m3.s) - return new BigNumber2(NaN); - isModExp = !nIsNeg && x3.isInteger() && m3.isInteger(); - if (isModExp) - x3 = x3.mod(m3); - } else if (n4.e > 9 && (x3.e > 0 || x3.e < -1 || (x3.e == 0 ? x3.c[0] > 1 || nIsBig && x3.c[1] >= 24e7 : x3.c[0] < 8e13 || nIsBig && x3.c[0] <= 9999975e7))) { - k2 = x3.s < 0 && isOdd(n4) ? -0 : 0; - if (x3.e > -1) - k2 = 1 / k2; - return new BigNumber2(nIsNeg ? 1 / k2 : k2); - } else if (POW_PRECISION) { - k2 = mathceil(POW_PRECISION / LOG_BASE + 2); - } - if (nIsBig) { - half = new BigNumber2(0.5); - if (nIsNeg) - n4.s = 1; - nIsOdd = isOdd(n4); - } else { - i3 = Math.abs(+valueOf(n4)); - nIsOdd = i3 % 2; - } - y3 = new BigNumber2(ONE); - for (; ; ) { - if (nIsOdd) { - y3 = y3.times(x3); - if (!y3.c) - break; - if (k2) { - if (y3.c.length > k2) - y3.c.length = k2; - } else if (isModExp) { - y3 = y3.mod(m3); - } - } - if (i3) { - i3 = mathfloor(i3 / 2); - if (i3 === 0) - break; - nIsOdd = i3 % 2; - } else { - n4 = n4.times(half); - round(n4, n4.e + 1, 1); - if (n4.e > 14) { - nIsOdd = isOdd(n4); - } else { - i3 = +valueOf(n4); - if (i3 === 0) - break; - nIsOdd = i3 % 2; - } - } - x3 = x3.times(x3); - if (k2) { - if (x3.c && x3.c.length > k2) - x3.c.length = k2; - } else if (isModExp) { - x3 = x3.mod(m3); - } - } - if (isModExp) - return y3; - if (nIsNeg) - y3 = ONE.div(y3); - return m3 ? y3.mod(m3) : k2 ? round(y3, POW_PRECISION, ROUNDING_MODE, more) : y3; - }; - P2.integerValue = function(rm2) { - var n4 = new BigNumber2(this); - if (rm2 == null) - rm2 = ROUNDING_MODE; - else - intCheck(rm2, 0, 8); - return round(n4, n4.e + 1, rm2); - }; - P2.isEqualTo = P2.eq = function(y3, b2) { - return compare$1(this, new BigNumber2(y3, b2)) === 0; - }; - P2.isFinite = function() { - return !!this.c; - }; - P2.isGreaterThan = P2.gt = function(y3, b2) { - return compare$1(this, new BigNumber2(y3, b2)) > 0; - }; - P2.isGreaterThanOrEqualTo = P2.gte = function(y3, b2) { - return (b2 = compare$1(this, new BigNumber2(y3, b2))) === 1 || b2 === 0; - }; - P2.isInteger = function() { - return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; - }; - P2.isLessThan = P2.lt = function(y3, b2) { - return compare$1(this, new BigNumber2(y3, b2)) < 0; - }; - P2.isLessThanOrEqualTo = P2.lte = function(y3, b2) { - return (b2 = compare$1(this, new BigNumber2(y3, b2))) === -1 || b2 === 0; - }; - P2.isNaN = function() { - return !this.s; - }; - P2.isNegative = function() { - return this.s < 0; - }; - P2.isPositive = function() { - return this.s > 0; - }; - P2.isZero = function() { - return !!this.c && this.c[0] == 0; - }; - P2.minus = function(y3, b2) { - var i3, j2, t2, xLTy, x3 = this, a3 = x3.s; - y3 = new BigNumber2(y3, b2); - b2 = y3.s; - if (!a3 || !b2) - return new BigNumber2(NaN); - if (a3 != b2) { - y3.s = -b2; - return x3.plus(y3); - } - var xe2 = x3.e / LOG_BASE, ye2 = y3.e / LOG_BASE, xc2 = x3.c, yc2 = y3.c; - if (!xe2 || !ye2) { - if (!xc2 || !yc2) - return xc2 ? (y3.s = -b2, y3) : new BigNumber2(yc2 ? x3 : NaN); - if (!xc2[0] || !yc2[0]) { - return yc2[0] ? (y3.s = -b2, y3) : new BigNumber2(xc2[0] ? x3 : ( - // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity - ROUNDING_MODE == 3 ? -0 : 0 - )); - } - } - xe2 = bitFloor(xe2); - ye2 = bitFloor(ye2); - xc2 = xc2.slice(); - if (a3 = xe2 - ye2) { - if (xLTy = a3 < 0) { - a3 = -a3; - t2 = xc2; - } else { - ye2 = xe2; - t2 = yc2; - } - t2.reverse(); - for (b2 = a3; b2--; t2.push(0)) - ; - t2.reverse(); - } else { - j2 = (xLTy = (a3 = xc2.length) < (b2 = yc2.length)) ? a3 : b2; - for (a3 = b2 = 0; b2 < j2; b2++) { - if (xc2[b2] != yc2[b2]) { - xLTy = xc2[b2] < yc2[b2]; - break; - } - } - } - if (xLTy) { - t2 = xc2; - xc2 = yc2; - yc2 = t2; - y3.s = -y3.s; - } - b2 = (j2 = yc2.length) - (i3 = xc2.length); - if (b2 > 0) - for (; b2--; xc2[i3++] = 0) - ; - b2 = BASE$1 - 1; - for (; j2 > a3; ) { - if (xc2[--j2] < yc2[j2]) { - for (i3 = j2; i3 && !xc2[--i3]; xc2[i3] = b2) - ; - --xc2[i3]; - xc2[j2] += BASE$1; - } - xc2[j2] -= yc2[j2]; - } - for (; xc2[0] == 0; xc2.splice(0, 1), --ye2) - ; - if (!xc2[0]) { - y3.s = ROUNDING_MODE == 3 ? -1 : 1; - y3.c = [y3.e = 0]; - return y3; - } - return normalise(y3, xc2, ye2); - }; - P2.modulo = P2.mod = function(y3, b2) { - var q2, s2, x3 = this; - y3 = new BigNumber2(y3, b2); - if (!x3.c || !y3.s || y3.c && !y3.c[0]) { - return new BigNumber2(NaN); - } else if (!y3.c || x3.c && !x3.c[0]) { - return new BigNumber2(x3); - } - if (MODULO_MODE == 9) { - s2 = y3.s; - y3.s = 1; - q2 = div(x3, y3, 0, 3); - y3.s = s2; - q2.s *= s2; - } else { - q2 = div(x3, y3, 0, MODULO_MODE); - } - y3 = x3.minus(q2.times(y3)); - if (!y3.c[0] && MODULO_MODE == 1) - y3.s = x3.s; - return y3; - }; - P2.multipliedBy = P2.times = function(y3, b2) { - var c2, e18, i3, j2, k2, m3, xcL, xlo, xhi, ycL, ylo, yhi, zc2, base3, sqrtBase, x3 = this, xc2 = x3.c, yc2 = (y3 = new BigNumber2(y3, b2)).c; - if (!xc2 || !yc2 || !xc2[0] || !yc2[0]) { - if (!x3.s || !y3.s || xc2 && !xc2[0] && !yc2 || yc2 && !yc2[0] && !xc2) { - y3.c = y3.e = y3.s = null; - } else { - y3.s *= x3.s; - if (!xc2 || !yc2) { - y3.c = y3.e = null; - } else { - y3.c = [0]; - y3.e = 0; - } - } - return y3; - } - e18 = bitFloor(x3.e / LOG_BASE) + bitFloor(y3.e / LOG_BASE); - y3.s *= x3.s; - xcL = xc2.length; - ycL = yc2.length; - if (xcL < ycL) { - zc2 = xc2; - xc2 = yc2; - yc2 = zc2; - i3 = xcL; - xcL = ycL; - ycL = i3; - } - for (i3 = xcL + ycL, zc2 = []; i3--; zc2.push(0)) - ; - base3 = BASE$1; - sqrtBase = SQRT_BASE; - for (i3 = ycL; --i3 >= 0; ) { - c2 = 0; - ylo = yc2[i3] % sqrtBase; - yhi = yc2[i3] / sqrtBase | 0; - for (k2 = xcL, j2 = i3 + k2; j2 > i3; ) { - xlo = xc2[--k2] % sqrtBase; - xhi = xc2[k2] / sqrtBase | 0; - m3 = yhi * xlo + xhi * ylo; - xlo = ylo * xlo + m3 % sqrtBase * sqrtBase + zc2[j2] + c2; - c2 = (xlo / base3 | 0) + (m3 / sqrtBase | 0) + yhi * xhi; - zc2[j2--] = xlo % base3; - } - zc2[j2] = c2; - } - if (c2) { - ++e18; - } else { - zc2.splice(0, 1); - } - return normalise(y3, zc2, e18); - }; - P2.negated = function() { - var x3 = new BigNumber2(this); - x3.s = -x3.s || null; - return x3; - }; - P2.plus = function(y3, b2) { - var t2, x3 = this, a3 = x3.s; - y3 = new BigNumber2(y3, b2); - b2 = y3.s; - if (!a3 || !b2) - return new BigNumber2(NaN); - if (a3 != b2) { - y3.s = -b2; - return x3.minus(y3); - } - var xe2 = x3.e / LOG_BASE, ye2 = y3.e / LOG_BASE, xc2 = x3.c, yc2 = y3.c; - if (!xe2 || !ye2) { - if (!xc2 || !yc2) - return new BigNumber2(a3 / 0); - if (!xc2[0] || !yc2[0]) - return yc2[0] ? y3 : new BigNumber2(xc2[0] ? x3 : a3 * 0); - } - xe2 = bitFloor(xe2); - ye2 = bitFloor(ye2); - xc2 = xc2.slice(); - if (a3 = xe2 - ye2) { - if (a3 > 0) { - ye2 = xe2; - t2 = yc2; - } else { - a3 = -a3; - t2 = xc2; - } - t2.reverse(); - for (; a3--; t2.push(0)) - ; - t2.reverse(); - } - a3 = xc2.length; - b2 = yc2.length; - if (a3 - b2 < 0) { - t2 = yc2; - yc2 = xc2; - xc2 = t2; - b2 = a3; - } - for (a3 = 0; b2; ) { - a3 = (xc2[--b2] = xc2[b2] + yc2[b2] + a3) / BASE$1 | 0; - xc2[b2] = BASE$1 === xc2[b2] ? 0 : xc2[b2] % BASE$1; - } - if (a3) { - xc2 = [a3].concat(xc2); - ++ye2; - } - return normalise(y3, xc2, ye2); - }; - P2.precision = P2.sd = function(sd2, rm2) { - var c2, n4, v6, x3 = this; - if (sd2 != null && sd2 !== !!sd2) { - intCheck(sd2, 1, MAX); - if (rm2 == null) - rm2 = ROUNDING_MODE; - else - intCheck(rm2, 0, 8); - return round(new BigNumber2(x3), sd2, rm2); - } - if (!(c2 = x3.c)) - return null; - v6 = c2.length - 1; - n4 = v6 * LOG_BASE + 1; - if (v6 = c2[v6]) { - for (; v6 % 10 == 0; v6 /= 10, n4--) - ; - for (v6 = c2[0]; v6 >= 10; v6 /= 10, n4++) - ; - } - if (sd2 && x3.e + 1 > n4) - n4 = x3.e + 1; - return n4; - }; - P2.shiftedBy = function(k2) { - intCheck(k2, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); - return this.times("1e" + k2); - }; - P2.squareRoot = P2.sqrt = function() { - var m3, n4, r2, rep, t2, x3 = this, c2 = x3.c, s2 = x3.s, e18 = x3.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5"); - if (s2 !== 1 || !c2 || !c2[0]) { - return new BigNumber2(!s2 || s2 < 0 && (!c2 || c2[0]) ? NaN : c2 ? x3 : 1 / 0); - } - s2 = Math.sqrt(+valueOf(x3)); - if (s2 == 0 || s2 == 1 / 0) { - n4 = coeffToString(c2); - if ((n4.length + e18) % 2 == 0) - n4 += "0"; - s2 = Math.sqrt(+n4); - e18 = bitFloor((e18 + 1) / 2) - (e18 < 0 || e18 % 2); - if (s2 == 1 / 0) { - n4 = "5e" + e18; - } else { - n4 = s2.toExponential(); - n4 = n4.slice(0, n4.indexOf("e") + 1) + e18; - } - r2 = new BigNumber2(n4); - } else { - r2 = new BigNumber2(s2 + ""); - } - if (r2.c[0]) { - e18 = r2.e; - s2 = e18 + dp; - if (s2 < 3) - s2 = 0; - for (; ; ) { - t2 = r2; - r2 = half.times(t2.plus(div(x3, t2, dp, 1))); - if (coeffToString(t2.c).slice(0, s2) === (n4 = coeffToString(r2.c)).slice(0, s2)) { - if (r2.e < e18) - --s2; - n4 = n4.slice(s2 - 3, s2 + 1); - if (n4 == "9999" || !rep && n4 == "4999") { - if (!rep) { - round(t2, t2.e + DECIMAL_PLACES + 2, 0); - if (t2.times(t2).eq(x3)) { - r2 = t2; - break; - } - } - dp += 4; - s2 += 4; - rep = 1; - } else { - if (!+n4 || !+n4.slice(1) && n4.charAt(0) == "5") { - round(r2, r2.e + DECIMAL_PLACES + 2, 1); - m3 = !r2.times(r2).eq(x3); - } - break; - } - } - } - } - return round(r2, r2.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m3); - }; - P2.toExponential = function(dp, rm2) { - if (dp != null) { - intCheck(dp, 0, MAX); - dp++; - } - return format2(this, dp, rm2, 1); - }; - P2.toFixed = function(dp, rm2) { - if (dp != null) { - intCheck(dp, 0, MAX); - dp = dp + this.e + 1; - } - return format2(this, dp, rm2); - }; - P2.toFormat = function(dp, rm2, format3) { - var str, x3 = this; - if (format3 == null) { - if (dp != null && rm2 && typeof rm2 == "object") { - format3 = rm2; - rm2 = null; - } else if (dp && typeof dp == "object") { - format3 = dp; - dp = rm2 = null; - } else { - format3 = FORMAT; - } - } else if (typeof format3 != "object") { - throw Error(bignumberError + "Argument not an object: " + format3); - } - str = x3.toFixed(dp, rm2); - if (x3.c) { - var i3, arr = str.split("."), g1 = +format3.groupSize, g22 = +format3.secondaryGroupSize, groupSeparator = format3.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x3.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length; - if (g22) { - i3 = g1; - g1 = g22; - g22 = i3; - len -= i3; - } - if (g1 > 0 && len > 0) { - i3 = len % g1 || g1; - intPart = intDigits.substr(0, i3); - for (; i3 < len; i3 += g1) - intPart += groupSeparator + intDigits.substr(i3, g1); - if (g22 > 0) - intPart += groupSeparator + intDigits.slice(i3); - if (isNeg) - intPart = "-" + intPart; - } - str = fractionPart ? intPart + (format3.decimalSeparator || "") + ((g22 = +format3.fractionGroupSize) ? fractionPart.replace( - new RegExp("\\d{" + g22 + "}\\B", "g"), - "$&" + (format3.fractionGroupSeparator || "") - ) : fractionPart) : intPart; - } - return (format3.prefix || "") + str + (format3.suffix || ""); - }; - P2.toFraction = function(md2) { - var d4, d02, d1, d22, e18, exp2, n4, n02, n1, q2, r2, s2, x3 = this, xc2 = x3.c; - if (md2 != null) { - n4 = new BigNumber2(md2); - if (!n4.isInteger() && (n4.c || n4.s !== 1) || n4.lt(ONE)) { - throw Error(bignumberError + "Argument " + (n4.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n4)); - } - } - if (!xc2) - return new BigNumber2(x3); - d4 = new BigNumber2(ONE); - n1 = d02 = new BigNumber2(ONE); - d1 = n02 = new BigNumber2(ONE); - s2 = coeffToString(xc2); - e18 = d4.e = s2.length - x3.e - 1; - d4.c[0] = POWS_TEN[(exp2 = e18 % LOG_BASE) < 0 ? LOG_BASE + exp2 : exp2]; - md2 = !md2 || n4.comparedTo(d4) > 0 ? e18 > 0 ? d4 : n1 : n4; - exp2 = MAX_EXP; - MAX_EXP = 1 / 0; - n4 = new BigNumber2(s2); - n02.c[0] = 0; - for (; ; ) { - q2 = div(n4, d4, 0, 1); - d22 = d02.plus(q2.times(d1)); - if (d22.comparedTo(md2) == 1) - break; - d02 = d1; - d1 = d22; - n1 = n02.plus(q2.times(d22 = n1)); - n02 = d22; - d4 = n4.minus(q2.times(d22 = d4)); - n4 = d22; - } - d22 = div(md2.minus(d02), d1, 0, 1); - n02 = n02.plus(d22.times(n1)); - d02 = d02.plus(d22.times(d1)); - n02.s = n1.s = x3.s; - e18 = e18 * 2; - r2 = div(n1, d1, e18, ROUNDING_MODE).minus(x3).abs().comparedTo( - div(n02, d02, e18, ROUNDING_MODE).minus(x3).abs() - ) < 1 ? [n1, d1] : [n02, d02]; - MAX_EXP = exp2; - return r2; - }; - P2.toNumber = function() { - return +valueOf(this); - }; - P2.toPrecision = function(sd2, rm2) { - if (sd2 != null) - intCheck(sd2, 1, MAX); - return format2(this, sd2, rm2, 2); - }; - P2.toString = function(b2) { - var str, n4 = this, s2 = n4.s, e18 = n4.e; - if (e18 === null) { - if (s2) { - str = "Infinity"; - if (s2 < 0) - str = "-" + str; - } else { - str = "NaN"; - } - } else { - if (b2 == null) { - str = e18 <= TO_EXP_NEG || e18 >= TO_EXP_POS ? toExponential(coeffToString(n4.c), e18) : toFixedPoint(coeffToString(n4.c), e18, "0"); - } else if (b2 === 10 && alphabetHasNormalDecimalDigits) { - n4 = round(new BigNumber2(n4), DECIMAL_PLACES + e18 + 1, ROUNDING_MODE); - str = toFixedPoint(coeffToString(n4.c), n4.e, "0"); - } else { - intCheck(b2, 2, ALPHABET2.length, "Base"); - str = convertBase(toFixedPoint(coeffToString(n4.c), e18, "0"), 10, b2, s2, true); - } - if (s2 < 0 && n4.c[0]) - str = "-" + str; - } - return str; - }; - P2.valueOf = P2.toJSON = function() { - return valueOf(this); - }; - P2._isBigNumber = true; - P2[Symbol.toStringTag] = "BigNumber"; - P2[Symbol.for("nodejs.util.inspect.custom")] = P2.valueOf; - if (configObject != null) - BigNumber2.set(configObject); - return BigNumber2; -} -function bitFloor(n4) { - var i3 = n4 | 0; - return n4 > 0 || n4 === i3 ? i3 : i3 - 1; -} -function coeffToString(a3) { - var s2, z3, i3 = 1, j2 = a3.length, r2 = a3[0] + ""; - for (; i3 < j2; ) { - s2 = a3[i3++] + ""; - z3 = LOG_BASE - s2.length; - for (; z3--; s2 = "0" + s2) - ; - r2 += s2; - } - for (j2 = r2.length; r2.charCodeAt(--j2) === 48; ) - ; - return r2.slice(0, j2 + 1 || 1); -} -function compare$1(x3, y3) { - var a3, b2, xc2 = x3.c, yc2 = y3.c, i3 = x3.s, j2 = y3.s, k2 = x3.e, l2 = y3.e; - if (!i3 || !j2) - return null; - a3 = xc2 && !xc2[0]; - b2 = yc2 && !yc2[0]; - if (a3 || b2) - return a3 ? b2 ? 0 : -j2 : i3; - if (i3 != j2) - return i3; - a3 = i3 < 0; - b2 = k2 == l2; - if (!xc2 || !yc2) - return b2 ? 0 : !xc2 ^ a3 ? 1 : -1; - if (!b2) - return k2 > l2 ^ a3 ? 1 : -1; - j2 = (k2 = xc2.length) < (l2 = yc2.length) ? k2 : l2; - for (i3 = 0; i3 < j2; i3++) - if (xc2[i3] != yc2[i3]) - return xc2[i3] > yc2[i3] ^ a3 ? 1 : -1; - return k2 == l2 ? 0 : k2 > l2 ^ a3 ? 1 : -1; -} -function intCheck(n4, min, max, name2) { - if (n4 < min || n4 > max || n4 !== mathfloor(n4)) { - throw Error(bignumberError + (name2 || "Argument") + (typeof n4 == "number" ? n4 < min || n4 > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n4)); - } -} -function isOdd(n4) { - var k2 = n4.c.length - 1; - return bitFloor(n4.e / LOG_BASE) == k2 && n4.c[k2] % 2 != 0; -} -function toExponential(str, e18) { - return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e18 < 0 ? "e" : "e+") + e18; -} -function toFixedPoint(str, e18, z3) { - var len, zs2; - if (e18 < 0) { - for (zs2 = z3 + "."; ++e18; zs2 += z3) - ; - str = zs2 + str; - } else { - len = str.length; - if (++e18 > len) { - for (zs2 = z3, e18 -= len; --e18; zs2 += z3) - ; - str += zs2; - } else if (e18 < len) { - str = str.slice(0, e18) + "." + str.slice(e18); - } - } - return str; -} -var BigNumber = clone(); -var validator$2 = { exports: {} }; -var toDate = { exports: {} }; -var assertString = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = assertString2; - function _typeof2(o2) { - "@babel/helpers - typeof"; - return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof2(o2); - } - function assertString2(input) { - var isString2 = typeof input === "string" || input instanceof String; - if (!isString2) { - var invalidType = _typeof2(input); - if (input === null) - invalidType = "null"; - else if (invalidType === "object") - invalidType = input.constructor.name; - throw new TypeError("Expected a string but received a ".concat(invalidType)); - } - } - module.exports = exports.default; - module.exports.default = exports.default; -})(assertString, assertString.exports); -var assertStringExports = assertString.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = toDate2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function toDate2(date) { - (0, _assertString2.default)(date); - date = Date.parse(date); - return !isNaN(date) ? new Date(date) : null; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(toDate, toDate.exports); -var toDateExports = toDate.exports; -var toFloat = { exports: {} }; -var isFloat$1 = {}; -var alpha$1 = {}; -Object.defineProperty(alpha$1, "__esModule", { - value: true -}); -alpha$1.farsiLocales = alpha$1.englishLocales = alpha$1.dotDecimal = alpha$1.decimal = alpha$1.commaDecimal = alpha$1.bengaliLocales = alpha$1.arabicLocales = alpha$1.alphanumeric = alpha$1.alpha = void 0; -var alpha = alpha$1.alpha = { - "en-US": /^[A-Z]+$/i, - "az-AZ": /^[A-VXYZÇƏĞİıÖŞÜ]+$/i, - "bg-BG": /^[А-Я]+$/i, - "cs-CZ": /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i, - "da-DK": /^[A-ZÆØÅ]+$/i, - "de-DE": /^[A-ZÄÖÜß]+$/i, - "el-GR": /^[Α-ώ]+$/i, - "es-ES": /^[A-ZÁÉÍÑÓÚÜ]+$/i, - "fa-IR": /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i, - "fi-FI": /^[A-ZÅÄÖ]+$/i, - "fr-FR": /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i, - "it-IT": /^[A-ZÀÉÈÌÎÓÒÙ]+$/i, - "ja-JP": /^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i, - "nb-NO": /^[A-ZÆØÅ]+$/i, - "nl-NL": /^[A-ZÁÉËÏÓÖÜÚ]+$/i, - "nn-NO": /^[A-ZÆØÅ]+$/i, - "hu-HU": /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i, - "pl-PL": /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i, - "pt-PT": /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i, - "ru-RU": /^[А-ЯЁ]+$/i, - "kk-KZ": /^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i, - "sl-SI": /^[A-ZČĆĐŠŽ]+$/i, - "sk-SK": /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i, - "sr-RS@latin": /^[A-ZČĆŽŠĐ]+$/i, - "sr-RS": /^[А-ЯЂЈЉЊЋЏ]+$/i, - "sv-SE": /^[A-ZÅÄÖ]+$/i, - "th-TH": /^[ก-๐\s]+$/i, - "tr-TR": /^[A-ZÇĞİıÖŞÜ]+$/i, - "uk-UA": /^[А-ЩЬЮЯЄIЇҐі]+$/i, - "vi-VN": /^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i, - "ko-KR": /^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/, - "ku-IQ": /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i, - ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/, - he: /^[א-ת]+$/, - fa: /^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i, - bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/, - eo: /^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i, - "hi-IN": /^[\u0900-\u0961]+[\u0972-\u097F]*$/i, - "si-LK": /^[\u0D80-\u0DFF]+$/ -}; -var alphanumeric$1 = alpha$1.alphanumeric = { - "en-US": /^[0-9A-Z]+$/i, - "az-AZ": /^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i, - "bg-BG": /^[0-9А-Я]+$/i, - "cs-CZ": /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i, - "da-DK": /^[0-9A-ZÆØÅ]+$/i, - "de-DE": /^[0-9A-ZÄÖÜß]+$/i, - "el-GR": /^[0-9Α-ω]+$/i, - "es-ES": /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i, - "fi-FI": /^[0-9A-ZÅÄÖ]+$/i, - "fr-FR": /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i, - "it-IT": /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i, - "ja-JP": /^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i, - "hu-HU": /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i, - "nb-NO": /^[0-9A-ZÆØÅ]+$/i, - "nl-NL": /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i, - "nn-NO": /^[0-9A-ZÆØÅ]+$/i, - "pl-PL": /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i, - "pt-PT": /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i, - "ru-RU": /^[0-9А-ЯЁ]+$/i, - "kk-KZ": /^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i, - "sl-SI": /^[0-9A-ZČĆĐŠŽ]+$/i, - "sk-SK": /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i, - "sr-RS@latin": /^[0-9A-ZČĆŽŠĐ]+$/i, - "sr-RS": /^[0-9А-ЯЂЈЉЊЋЏ]+$/i, - "sv-SE": /^[0-9A-ZÅÄÖ]+$/i, - "th-TH": /^[ก-๙\s]+$/i, - "tr-TR": /^[0-9A-ZÇĞİıÖŞÜ]+$/i, - "uk-UA": /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i, - "ko-KR": /^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/, - "ku-IQ": /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i, - "vi-VN": /^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i, - ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/, - he: /^[0-9א-ת]+$/, - fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i, - bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/, - eo: /^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i, - "hi-IN": /^[\u0900-\u0963]+[\u0966-\u097F]*$/i, - "si-LK": /^[0-9\u0D80-\u0DFF]+$/ -}; -var decimal = alpha$1.decimal = { - "en-US": ".", - ar: "٫" -}; -var englishLocales = alpha$1.englishLocales = ["AU", "GB", "HK", "IN", "NZ", "ZA", "ZM"]; -for (var locale, i$2 = 0; i$2 < englishLocales.length; i$2++) { - locale = "en-".concat(englishLocales[i$2]); - alpha[locale] = alpha["en-US"]; - alphanumeric$1[locale] = alphanumeric$1["en-US"]; - decimal[locale] = decimal["en-US"]; -} -var arabicLocales = alpha$1.arabicLocales = ["AE", "BH", "DZ", "EG", "IQ", "JO", "KW", "LB", "LY", "MA", "QM", "QA", "SA", "SD", "SY", "TN", "YE"]; -for (var _locale, _i$2 = 0; _i$2 < arabicLocales.length; _i$2++) { - _locale = "ar-".concat(arabicLocales[_i$2]); - alpha[_locale] = alpha.ar; - alphanumeric$1[_locale] = alphanumeric$1.ar; - decimal[_locale] = decimal.ar; -} -var farsiLocales = alpha$1.farsiLocales = ["IR", "AF"]; -for (var _locale2, _i22 = 0; _i22 < farsiLocales.length; _i22++) { - _locale2 = "fa-".concat(farsiLocales[_i22]); - alphanumeric$1[_locale2] = alphanumeric$1.fa; - decimal[_locale2] = decimal.ar; -} -var bengaliLocales = alpha$1.bengaliLocales = ["BD", "IN"]; -for (var _locale3, _i3 = 0; _i3 < bengaliLocales.length; _i3++) { - _locale3 = "bn-".concat(bengaliLocales[_i3]); - alpha[_locale3] = alpha.bn; - alphanumeric$1[_locale3] = alphanumeric$1.bn; - decimal[_locale3] = decimal["en-US"]; -} -var dotDecimal = alpha$1.dotDecimal = ["ar-EG", "ar-LB", "ar-LY"]; -var commaDecimal = alpha$1.commaDecimal = ["bg-BG", "cs-CZ", "da-DK", "de-DE", "el-GR", "en-ZM", "eo", "es-ES", "fr-CA", "fr-FR", "id-ID", "it-IT", "ku-IQ", "hi-IN", "hu-HU", "nb-NO", "nn-NO", "nl-NL", "pl-PL", "pt-PT", "ru-RU", "kk-KZ", "si-LK", "sl-SI", "sr-RS@latin", "sr-RS", "sv-SE", "tr-TR", "uk-UA", "vi-VN"]; -for (var _i4 = 0; _i4 < dotDecimal.length; _i4++) { - decimal[dotDecimal[_i4]] = decimal["en-US"]; -} -for (var _i5 = 0; _i5 < commaDecimal.length; _i5++) { - decimal[commaDecimal[_i5]] = ","; -} -alpha["fr-CA"] = alpha["fr-FR"]; -alphanumeric$1["fr-CA"] = alphanumeric$1["fr-FR"]; -alpha["pt-BR"] = alpha["pt-PT"]; -alphanumeric$1["pt-BR"] = alphanumeric$1["pt-PT"]; -decimal["pt-BR"] = decimal["pt-PT"]; -alpha["pl-Pl"] = alpha["pl-PL"]; -alphanumeric$1["pl-Pl"] = alphanumeric$1["pl-PL"]; -decimal["pl-Pl"] = decimal["pl-PL"]; -alpha["fa-AF"] = alpha.fa; -Object.defineProperty(isFloat$1, "__esModule", { - value: true -}); -isFloat$1.default = isFloat; -isFloat$1.locales = void 0; -var _assertString$b = _interopRequireDefault$b(assertStringExports); -var _alpha$2 = alpha$1; -function _interopRequireDefault$b(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function isFloat(str, options) { - (0, _assertString$b.default)(str); - options = options || {}; - var float = new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(options.locale ? _alpha$2.decimal[options.locale] : ".", "[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$")); - if (str === "" || str === "." || str === "," || str === "-" || str === "+") { - return false; - } - var value = parseFloat(str.replace(",", ".")); - return float.test(str) && (!options.hasOwnProperty("min") || value >= options.min) && (!options.hasOwnProperty("max") || value <= options.max) && (!options.hasOwnProperty("lt") || value < options.lt) && (!options.hasOwnProperty("gt") || value > options.gt); -} -isFloat$1.locales = Object.keys(_alpha$2.decimal); -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = toFloat2; - var _isFloat = _interopRequireDefault2(isFloat$1); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function toFloat2(str) { - if (!(0, _isFloat.default)(str)) - return NaN; - return parseFloat(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(toFloat, toFloat.exports); -var toFloatExports = toFloat.exports; -var toInt = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = toInt2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function toInt2(str, radix) { - (0, _assertString2.default)(str); - return parseInt(str, radix || 10); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(toInt, toInt.exports); -var toIntExports = toInt.exports; -var toBoolean = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = toBoolean2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function toBoolean2(str, strict) { - (0, _assertString2.default)(str); - if (strict) { - return str === "1" || /^true$/i.test(str); - } - return str !== "0" && !/^false$/i.test(str) && str !== ""; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(toBoolean, toBoolean.exports); -var toBooleanExports = toBoolean.exports; -var equals = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = equals2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function equals2(str, comparison) { - (0, _assertString2.default)(str); - return str === comparison; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(equals, equals.exports); -var equalsExports = equals.exports; -var contains = { exports: {} }; -var toString$4 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = toString3; - function _typeof2(o2) { - "@babel/helpers - typeof"; - return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof2(o2); - } - function toString3(input) { - if (_typeof2(input) === "object" && input !== null) { - if (typeof input.toString === "function") { - input = input.toString(); - } else { - input = "[object Object]"; - } - } else if (input === null || typeof input === "undefined" || isNaN(input) && !input.length) { - input = ""; - } - return String(input); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(toString$4, toString$4.exports); -var toStringExports = toString$4.exports; -var merge$1 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = merge2; - function merge2() { - var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - var defaults2 = arguments.length > 1 ? arguments[1] : void 0; - for (var key2 in defaults2) { - if (typeof obj[key2] === "undefined") { - obj[key2] = defaults2[key2]; - } - } - return obj; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(merge$1, merge$1.exports); -var mergeExports = merge$1.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = contains2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _toString = _interopRequireDefault2(toStringExports); - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var defaulContainsOptions = { - ignoreCase: false, - minOccurrences: 1 - }; - function contains2(str, elem, options) { - (0, _assertString2.default)(str); - options = (0, _merge.default)(options, defaulContainsOptions); - if (options.ignoreCase) { - return str.toLowerCase().split((0, _toString.default)(elem).toLowerCase()).length > options.minOccurrences; - } - return str.split((0, _toString.default)(elem)).length > options.minOccurrences; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(contains, contains.exports); -var containsExports = contains.exports; -var matches = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = matches2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function matches2(str, pattern, modifiers) { - (0, _assertString2.default)(str); - if (Object.prototype.toString.call(pattern) !== "[object RegExp]") { - pattern = new RegExp(pattern, modifiers); - } - return !!str.match(pattern); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(matches, matches.exports); -var matchesExports = matches.exports; -var isEmail = { exports: {} }; -var isByteLength = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isByteLength2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _typeof2(o2) { - "@babel/helpers - typeof"; - return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof2(o2); - } - function isByteLength2(str, options) { - (0, _assertString2.default)(str); - var min; - var max; - if (_typeof2(options) === "object") { - min = options.min || 0; - max = options.max; - } else { - min = arguments[1]; - max = arguments[2]; - } - var len = encodeURI(str).split(/%..|./).length - 1; - return len >= min && (typeof max === "undefined" || len <= max); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isByteLength, isByteLength.exports); -var isByteLengthExports = isByteLength.exports; -var isFQDN = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isFQDN2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var default_fqdn_options = { - require_tld: true, - allow_underscores: false, - allow_trailing_dot: false, - allow_numeric_tld: false, - allow_wildcard: false, - ignore_max_length: false - }; - function isFQDN2(str, options) { - (0, _assertString2.default)(str); - options = (0, _merge.default)(options, default_fqdn_options); - if (options.allow_trailing_dot && str[str.length - 1] === ".") { - str = str.substring(0, str.length - 1); - } - if (options.allow_wildcard === true && str.indexOf("*.") === 0) { - str = str.substring(2); - } - var parts = str.split("."); - var tld = parts[parts.length - 1]; - if (options.require_tld) { - if (parts.length < 2) { - return false; - } - if (!options.allow_numeric_tld && !/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) { - return false; - } - if (/\s/.test(tld)) { - return false; - } - } - if (!options.allow_numeric_tld && /^\d+$/.test(tld)) { - return false; - } - return parts.every(function(part) { - if (part.length > 63 && !options.ignore_max_length) { - return false; - } - if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) { - return false; - } - if (/[\uff01-\uff5e]/.test(part)) { - return false; - } - if (/^-|-$/.test(part)) { - return false; - } - if (!options.allow_underscores && /_/.test(part)) { - return false; - } - return true; - }); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isFQDN, isFQDN.exports); -var isFQDNExports = isFQDN.exports; -var isIP = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isIP2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var IPv4SegmentFormat = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"; - var IPv4AddressFormat = "(".concat(IPv4SegmentFormat, "[.]){3}").concat(IPv4SegmentFormat); - var IPv4AddressRegExp = new RegExp("^".concat(IPv4AddressFormat, "$")); - var IPv6SegmentFormat = "(?:[0-9a-fA-F]{1,4})"; - var IPv6AddressRegExp = new RegExp("^(" + "(?:".concat(IPv6SegmentFormat, ":){7}(?:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){6}(?:").concat(IPv4AddressFormat, "|:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){5}(?::").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,2}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){4}(?:(:").concat(IPv6SegmentFormat, "){0,1}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,3}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){3}(?:(:").concat(IPv6SegmentFormat, "){0,2}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,4}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){2}(?:(:").concat(IPv6SegmentFormat, "){0,3}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,5}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){1}(?:(:").concat(IPv6SegmentFormat, "){0,4}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,6}|:)|") + "(?::((?::".concat(IPv6SegmentFormat, "){0,5}:").concat(IPv4AddressFormat, "|(?::").concat(IPv6SegmentFormat, "){1,7}|:))") + ")(%[0-9a-zA-Z-.:]{1,})?$"); - function isIP2(str) { - var version2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; - (0, _assertString2.default)(str); - version2 = String(version2); - if (!version2) { - return isIP2(str, 4) || isIP2(str, 6); - } - if (version2 === "4") { - return IPv4AddressRegExp.test(str); - } - if (version2 === "6") { - return IPv6AddressRegExp.test(str); - } - return false; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isIP, isIP.exports); -var isIPExports = isIP.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isEmail2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _isByteLength = _interopRequireDefault2(isByteLengthExports); - var _isFQDN = _interopRequireDefault2(isFQDNExports); - var _isIP = _interopRequireDefault2(isIPExports); - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var default_email_options = { - allow_display_name: false, - allow_underscores: false, - require_display_name: false, - allow_utf8_local_part: true, - require_tld: true, - blacklisted_chars: "", - ignore_max_length: false, - host_blacklist: [], - host_whitelist: [] - }; - var splitNameAddress = /^([^\x00-\x1F\x7F-\x9F\cX]+)]/.test(display_name_without_quotes); - if (contains_illegal) { - if (display_name_without_quotes === display_name) { - return false; - } - var all_start_with_back_slash = display_name_without_quotes.split('"').length === display_name_without_quotes.split('\\"').length; - if (!all_start_with_back_slash) { - return false; - } - } - return true; - } - function isEmail2(str, options) { - (0, _assertString2.default)(str); - options = (0, _merge.default)(options, default_email_options); - if (options.require_display_name || options.allow_display_name) { - var display_email = str.match(splitNameAddress); - if (display_email) { - var display_name = display_email[1]; - str = str.replace(display_name, "").replace(/(^<|>$)/g, ""); - if (display_name.endsWith(" ")) { - display_name = display_name.slice(0, -1); - } - if (!validateDisplayName(display_name)) { - return false; - } - } else if (options.require_display_name) { - return false; - } - } - if (!options.ignore_max_length && str.length > defaultMaxEmailLength) { - return false; - } - var parts = str.split("@"); - var domain = parts.pop(); - var lower_domain = domain.toLowerCase(); - if (options.host_blacklist.includes(lower_domain)) { - return false; - } - if (options.host_whitelist.length > 0 && !options.host_whitelist.includes(lower_domain)) { - return false; - } - var user = parts.join("@"); - if (options.domain_specific_validation && (lower_domain === "gmail.com" || lower_domain === "googlemail.com")) { - user = user.toLowerCase(); - var username = user.split("+")[0]; - if (!(0, _isByteLength.default)(username.replace(/\./g, ""), { - min: 6, - max: 30 - })) { - return false; - } - var _user_parts = username.split("."); - for (var i3 = 0; i3 < _user_parts.length; i3++) { - if (!gmailUserPart.test(_user_parts[i3])) { - return false; - } - } - } - if (options.ignore_max_length === false && (!(0, _isByteLength.default)(user, { - max: 64 - }) || !(0, _isByteLength.default)(domain, { - max: 254 - }))) { - return false; - } - if (!(0, _isFQDN.default)(domain, { - require_tld: options.require_tld, - ignore_max_length: options.ignore_max_length, - allow_underscores: options.allow_underscores - })) { - if (!options.allow_ip_domain) { - return false; - } - if (!(0, _isIP.default)(domain)) { - if (!domain.startsWith("[") || !domain.endsWith("]")) { - return false; - } - var noBracketdomain = domain.slice(1, -1); - if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) { - return false; - } - } - } - if (user[0] === '"') { - user = user.slice(1, user.length - 1); - return options.allow_utf8_local_part ? quotedEmailUserUtf8.test(user) : quotedEmailUser.test(user); - } - var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart; - var user_parts = user.split("."); - for (var _i3 = 0; _i3 < user_parts.length; _i3++) { - if (!pattern.test(user_parts[_i3])) { - return false; - } - } - if (options.blacklisted_chars) { - if (user.search(new RegExp("[".concat(options.blacklisted_chars, "]+"), "g")) !== -1) - return false; - } - return true; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isEmail, isEmail.exports); -var isEmailExports = isEmail.exports; -var isURL = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isURL2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _isFQDN = _interopRequireDefault2(isFQDNExports); - var _isIP = _interopRequireDefault2(isIPExports); - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _slicedToArray(arr, i3) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i3) || _unsupportedIterableToArray(arr, i3) || _nonIterableRest(); - } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _unsupportedIterableToArray(o2, minLen) { - if (!o2) - return; - if (typeof o2 === "string") - return _arrayLikeToArray(o2, minLen); - var n4 = Object.prototype.toString.call(o2).slice(8, -1); - if (n4 === "Object" && o2.constructor) - n4 = o2.constructor.name; - if (n4 === "Map" || n4 === "Set") - return Array.from(o2); - if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4)) - return _arrayLikeToArray(o2, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i3 = 0, arr2 = new Array(len); i3 < len; i3++) - arr2[i3] = arr[i3]; - return arr2; - } - function _iterableToArrayLimit(r2, l2) { - var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"]; - if (null != t2) { - var e18, n4, i3, u2, a3 = [], f3 = true, o2 = false; - try { - if (i3 = (t2 = t2.call(r2)).next, 0 === l2) { - if (Object(t2) !== t2) - return; - f3 = false; - } else - for (; !(f3 = (e18 = i3.call(t2)).done) && (a3.push(e18.value), a3.length !== l2); f3 = true) - ; - } catch (r3) { - o2 = true, n4 = r3; - } finally { - try { - if (!f3 && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) - return; - } finally { - if (o2) - throw n4; - } - } - return a3; - } - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) - return arr; - } - var default_url_options = { - protocols: ["http", "https", "ftp"], - require_tld: true, - require_protocol: false, - require_host: true, - require_port: false, - require_valid_protocol: true, - allow_underscores: false, - allow_trailing_dot: false, - allow_protocol_relative_urls: false, - allow_fragments: true, - allow_query_components: true, - validate_length: true - }; - var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/; - function isRegExp2(obj) { - return Object.prototype.toString.call(obj) === "[object RegExp]"; - } - function checkHost(host, matches2) { - for (var i3 = 0; i3 < matches2.length; i3++) { - var match = matches2[i3]; - if (host === match || isRegExp2(match) && match.test(host)) { - return true; - } - } - return false; - } - function isURL2(url, options) { - (0, _assertString2.default)(url); - if (!url || /[\s<>]/.test(url)) { - return false; - } - if (url.indexOf("mailto:") === 0) { - return false; - } - options = (0, _merge.default)(options, default_url_options); - if (options.validate_length && url.length >= 2083) { - return false; - } - if (!options.allow_fragments && url.includes("#")) { - return false; - } - if (!options.allow_query_components && (url.includes("?") || url.includes("&"))) { - return false; - } - var protocol, auth, host, hostname, port, port_str, split2, ipv6; - split2 = url.split("#"); - url = split2.shift(); - split2 = url.split("?"); - url = split2.shift(); - split2 = url.split("://"); - if (split2.length > 1) { - protocol = split2.shift().toLowerCase(); - if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) { - return false; - } - } else if (options.require_protocol) { - return false; - } else if (url.slice(0, 2) === "//") { - if (!options.allow_protocol_relative_urls) { - return false; - } - split2[0] = url.slice(2); - } - url = split2.join("://"); - if (url === "") { - return false; - } - split2 = url.split("/"); - url = split2.shift(); - if (url === "" && !options.require_host) { - return true; - } - split2 = url.split("@"); - if (split2.length > 1) { - if (options.disallow_auth) { - return false; - } - if (split2[0] === "") { - return false; - } - auth = split2.shift(); - if (auth.indexOf(":") >= 0 && auth.split(":").length > 2) { - return false; - } - var _auth$split = auth.split(":"), _auth$split2 = _slicedToArray(_auth$split, 2), user = _auth$split2[0], password = _auth$split2[1]; - if (user === "" && password === "") { - return false; - } - } - hostname = split2.join("@"); - port_str = null; - ipv6 = null; - var ipv6_match = hostname.match(wrapped_ipv6); - if (ipv6_match) { - host = ""; - ipv6 = ipv6_match[1]; - port_str = ipv6_match[2] || null; - } else { - split2 = hostname.split(":"); - host = split2.shift(); - if (split2.length) { - port_str = split2.join(":"); - } - } - if (port_str !== null && port_str.length > 0) { - port = parseInt(port_str, 10); - if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) { - return false; - } - } else if (options.require_port) { - return false; - } - if (options.host_whitelist) { - return checkHost(host, options.host_whitelist); - } - if (host === "" && !options.require_host) { - return true; - } - if (!(0, _isIP.default)(host) && !(0, _isFQDN.default)(host, options) && (!ipv6 || !(0, _isIP.default)(ipv6, 6))) { - return false; - } - host = host || ipv6; - if (options.host_blacklist && checkHost(host, options.host_blacklist)) { - return false; - } - return true; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isURL, isURL.exports); -var isURLExports = isURL.exports; -var isMACAddress = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isMACAddress2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var macAddress48 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/; - var macAddress48NoSeparators = /^([0-9a-fA-F]){12}$/; - var macAddress48WithDots = /^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/; - var macAddress64 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/; - var macAddress64NoSeparators = /^([0-9a-fA-F]){16}$/; - var macAddress64WithDots = /^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/; - function isMACAddress2(str, options) { - (0, _assertString2.default)(str); - if (options !== null && options !== void 0 && options.eui) { - options.eui = String(options.eui); - } - if (options !== null && options !== void 0 && options.no_colons || options !== null && options !== void 0 && options.no_separators) { - if (options.eui === "48") { - return macAddress48NoSeparators.test(str); - } - if (options.eui === "64") { - return macAddress64NoSeparators.test(str); - } - return macAddress48NoSeparators.test(str) || macAddress64NoSeparators.test(str); - } - if ((options === null || options === void 0 ? void 0 : options.eui) === "48") { - return macAddress48.test(str) || macAddress48WithDots.test(str); - } - if ((options === null || options === void 0 ? void 0 : options.eui) === "64") { - return macAddress64.test(str) || macAddress64WithDots.test(str); - } - return isMACAddress2(str, { - eui: "48" - }) || isMACAddress2(str, { - eui: "64" - }); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isMACAddress, isMACAddress.exports); -var isMACAddressExports = isMACAddress.exports; -var isIPRange = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isIPRange2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _isIP = _interopRequireDefault2(isIPExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var subnetMaybe = /^\d{1,3}$/; - var v4Subnet = 32; - var v6Subnet = 128; - function isIPRange2(str) { - var version2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; - (0, _assertString2.default)(str); - var parts = str.split("/"); - if (parts.length !== 2) { - return false; - } - if (!subnetMaybe.test(parts[1])) { - return false; - } - if (parts[1].length > 1 && parts[1].startsWith("0")) { - return false; - } - var isValidIP = (0, _isIP.default)(parts[0], version2); - if (!isValidIP) { - return false; - } - var expectedSubnet = null; - switch (String(version2)) { - case "4": - expectedSubnet = v4Subnet; - break; - case "6": - expectedSubnet = v6Subnet; - break; - default: - expectedSubnet = (0, _isIP.default)(parts[0], "6") ? v6Subnet : v4Subnet; - } - return parts[1] <= expectedSubnet && parts[1] >= 0; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isIPRange, isIPRange.exports); -var isIPRangeExports = isIPRange.exports; -var isDate$1 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isDate2; - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _slicedToArray(arr, i3) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i3) || _unsupportedIterableToArray(arr, i3) || _nonIterableRest(); - } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _iterableToArrayLimit(r2, l2) { - var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"]; - if (null != t2) { - var e18, n4, i3, u2, a3 = [], f3 = true, o2 = false; - try { - if (i3 = (t2 = t2.call(r2)).next, 0 === l2) { - if (Object(t2) !== t2) - return; - f3 = false; - } else - for (; !(f3 = (e18 = i3.call(t2)).done) && (a3.push(e18.value), a3.length !== l2); f3 = true) - ; - } catch (r3) { - o2 = true, n4 = r3; - } finally { - try { - if (!f3 && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) - return; - } finally { - if (o2) - throw n4; - } - } - return a3; - } - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) - return arr; - } - function _createForOfIteratorHelper(o2, allowArrayLike) { - var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"]; - if (!it2) { - if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray(o2)) || allowArrayLike && o2 && typeof o2.length === "number") { - if (it2) - o2 = it2; - var i3 = 0; - var F2 = function F3() { - }; - return { s: F2, n: function n4() { - if (i3 >= o2.length) - return { done: true }; - return { done: false, value: o2[i3++] }; - }, e: function e18(_e3) { - throw _e3; - }, f: F2 }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var normalCompletion = true, didErr = false, err; - return { s: function s2() { - it2 = it2.call(o2); - }, n: function n4() { - var step = it2.next(); - normalCompletion = step.done; - return step; - }, e: function e18(_e22) { - didErr = true; - err = _e22; - }, f: function f3() { - try { - if (!normalCompletion && it2.return != null) - it2.return(); - } finally { - if (didErr) - throw err; - } - } }; - } - function _unsupportedIterableToArray(o2, minLen) { - if (!o2) - return; - if (typeof o2 === "string") - return _arrayLikeToArray(o2, minLen); - var n4 = Object.prototype.toString.call(o2).slice(8, -1); - if (n4 === "Object" && o2.constructor) - n4 = o2.constructor.name; - if (n4 === "Map" || n4 === "Set") - return Array.from(o2); - if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4)) - return _arrayLikeToArray(o2, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i3 = 0, arr2 = new Array(len); i3 < len; i3++) - arr2[i3] = arr[i3]; - return arr2; - } - var default_date_options = { - format: "YYYY/MM/DD", - delimiters: ["/", "-"], - strictMode: false - }; - function isValidFormat(format2) { - return /(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(format2); - } - function zip(date, format2) { - var zippedArr = [], len = Math.min(date.length, format2.length); - for (var i3 = 0; i3 < len; i3++) { - zippedArr.push([date[i3], format2[i3]]); - } - return zippedArr; - } - function isDate2(input, options) { - if (typeof options === "string") { - options = (0, _merge.default)({ - format: options - }, default_date_options); - } else { - options = (0, _merge.default)(options, default_date_options); - } - if (typeof input === "string" && isValidFormat(options.format)) { - var formatDelimiter = options.delimiters.find(function(delimiter) { - return options.format.indexOf(delimiter) !== -1; - }); - var dateDelimiter = options.strictMode ? formatDelimiter : options.delimiters.find(function(delimiter) { - return input.indexOf(delimiter) !== -1; - }); - var dateAndFormat = zip(input.split(dateDelimiter), options.format.toLowerCase().split(formatDelimiter)); - var dateObj = {}; - var _iterator = _createForOfIteratorHelper(dateAndFormat), _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done; ) { - var _step$value = _slicedToArray(_step.value, 2), dateWord = _step$value[0], formatWord = _step$value[1]; - if (dateWord.length !== formatWord.length) { - return false; - } - dateObj[formatWord.charAt(0)] = dateWord; - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - var fullYear = dateObj.y; - if (fullYear.startsWith("-")) { - return false; - } - if (dateObj.y.length === 2) { - var parsedYear = parseInt(dateObj.y, 10); - if (isNaN(parsedYear)) { - return false; - } - var currentYearLastTwoDigits = (/* @__PURE__ */ new Date()).getFullYear() % 100; - if (parsedYear < currentYearLastTwoDigits) { - fullYear = "20".concat(dateObj.y); - } else { - fullYear = "19".concat(dateObj.y); - } - } - var month = dateObj.m; - if (dateObj.m.length === 1) { - month = "0".concat(dateObj.m); - } - var day = dateObj.d; - if (dateObj.d.length === 1) { - day = "0".concat(dateObj.d); - } - return new Date("".concat(fullYear, "-").concat(month, "-").concat(day, "T00:00:00.000Z")).getUTCDate() === +dateObj.d; - } - if (!options.strictMode) { - return Object.prototype.toString.call(input) === "[object Date]" && isFinite(input); - } - return false; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isDate$1, isDate$1.exports); -var isDateExports = isDate$1.exports; -var isTime = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isTime2; - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var default_time_options = { - hourFormat: "hour24", - mode: "default" - }; - var formats = { - hour24: { - default: /^([01]?[0-9]|2[0-3]):([0-5][0-9])$/, - withSeconds: /^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/ - }, - hour12: { - default: /^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/, - withSeconds: /^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/ - } - }; - function isTime2(input, options) { - options = (0, _merge.default)(options, default_time_options); - if (typeof input !== "string") - return false; - return formats[options.hourFormat][options.mode].test(input); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isTime, isTime.exports); -var isTimeExports = isTime.exports; -var isBoolean$2 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isBoolean2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var defaultOptions = { - loose: false - }; - var strictBooleans = ["true", "false", "1", "0"]; - var looseBooleans = [].concat(strictBooleans, ["yes", "no"]); - function isBoolean2(str) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultOptions; - (0, _assertString2.default)(str); - if (options.loose) { - return looseBooleans.includes(str.toLowerCase()); - } - return strictBooleans.includes(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isBoolean$2, isBoolean$2.exports); -var isBooleanExports = isBoolean$2.exports; -var isLocale = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isLocale2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var extlang = "([A-Za-z]{3}(-[A-Za-z]{3}){0,2})"; - var language = "(([a-zA-Z]{2,3}(-".concat(extlang, ")?)|([a-zA-Z]{5,8}))"); - var script = "([A-Za-z]{4})"; - var region = "([A-Za-z]{2}|\\d{3})"; - var variant = "([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))"; - var singleton = "(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])"; - var extension = "(".concat(singleton, "(-[A-Za-z0-9]{2,8})+)"); - var privateuse = "(x(-[A-Za-z0-9]{1,8})+)"; - var irregular = "((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))"; - var regular = "((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))"; - var grandfathered = "(".concat(irregular, "|").concat(regular, ")"); - var delimiter = "(-|_)"; - var langtag = "".concat(language, "(").concat(delimiter).concat(script, ")?(").concat(delimiter).concat(region, ")?(").concat(delimiter).concat(variant, ")*(").concat(delimiter).concat(extension, ")*(").concat(delimiter).concat(privateuse, ")?"); - var languageTagRegex = new RegExp("(^".concat(privateuse, "$)|(^").concat(grandfathered, "$)|(^").concat(langtag, "$)")); - function isLocale2(str) { - (0, _assertString2.default)(str); - return languageTagRegex.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isLocale, isLocale.exports); -var isLocaleExports = isLocale.exports; -var isAbaRouting = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isAbaRouting2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var isRoutingReg = /^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/; - function isAbaRouting2(str) { - (0, _assertString2.default)(str); - if (!isRoutingReg.test(str)) - return false; - var checkSumVal = 0; - for (var i3 = 0; i3 < str.length; i3++) { - if (i3 % 3 === 0) - checkSumVal += str[i3] * 3; - else if (i3 % 3 === 1) - checkSumVal += str[i3] * 7; - else - checkSumVal += str[i3] * 1; - } - return checkSumVal % 10 === 0; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isAbaRouting, isAbaRouting.exports); -var isAbaRoutingExports = isAbaRouting.exports; -var isAlpha$1 = {}; -Object.defineProperty(isAlpha$1, "__esModule", { - value: true -}); -isAlpha$1.default = isAlpha; -isAlpha$1.locales = void 0; -var _assertString$a = _interopRequireDefault$a(assertStringExports); -var _alpha$1 = alpha$1; -function _interopRequireDefault$a(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function isAlpha(_str) { - var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en-US"; - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - (0, _assertString$a.default)(_str); - var str = _str; - var ignore = options.ignore; - if (ignore) { - if (ignore instanceof RegExp) { - str = str.replace(ignore, ""); - } else if (typeof ignore === "string") { - str = str.replace(new RegExp("[".concat(ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, "\\$&"), "]"), "g"), ""); - } else { - throw new Error("ignore should be instance of a String or RegExp"); - } - } - if (locale in _alpha$1.alpha) { - return _alpha$1.alpha[locale].test(str); - } - throw new Error("Invalid locale '".concat(locale, "'")); -} -isAlpha$1.locales = Object.keys(_alpha$1.alpha); -var isAlphanumeric$1 = {}; -Object.defineProperty(isAlphanumeric$1, "__esModule", { - value: true -}); -isAlphanumeric$1.default = isAlphanumeric; -isAlphanumeric$1.locales = void 0; -var _assertString$9 = _interopRequireDefault$9(assertStringExports); -var _alpha = alpha$1; -function _interopRequireDefault$9(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function isAlphanumeric(_str) { - var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en-US"; - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - (0, _assertString$9.default)(_str); - var str = _str; - var ignore = options.ignore; - if (ignore) { - if (ignore instanceof RegExp) { - str = str.replace(ignore, ""); - } else if (typeof ignore === "string") { - str = str.replace(new RegExp("[".concat(ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, "\\$&"), "]"), "g"), ""); - } else { - throw new Error("ignore should be instance of a String or RegExp"); - } - } - if (locale in _alpha.alphanumeric) { - return _alpha.alphanumeric[locale].test(str); - } - throw new Error("Invalid locale '".concat(locale, "'")); -} -isAlphanumeric$1.locales = Object.keys(_alpha.alphanumeric); -var isNumeric = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isNumeric2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _alpha2 = alpha$1; - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var numericNoSymbols = /^[0-9]+$/; - function isNumeric2(str, options) { - (0, _assertString2.default)(str); - if (options && options.no_symbols) { - return numericNoSymbols.test(str); - } - return new RegExp("^[+-]?([0-9]*[".concat((options || {}).locale ? _alpha2.decimal[options.locale] : ".", "])?[0-9]+$")).test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isNumeric, isNumeric.exports); -var isNumericExports = isNumeric.exports; -var isPassportNumber = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isPassportNumber2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var passportRegexByCountryCode = { - AM: /^[A-Z]{2}\d{7}$/, - // ARMENIA - AR: /^[A-Z]{3}\d{6}$/, - // ARGENTINA - AT: /^[A-Z]\d{7}$/, - // AUSTRIA - AU: /^[A-Z]\d{7}$/, - // AUSTRALIA - AZ: /^[A-Z]{1}\d{8}$/, - // AZERBAIJAN - BE: /^[A-Z]{2}\d{6}$/, - // BELGIUM - BG: /^\d{9}$/, - // BULGARIA - BR: /^[A-Z]{2}\d{6}$/, - // BRAZIL - BY: /^[A-Z]{2}\d{7}$/, - // BELARUS - CA: /^[A-Z]{2}\d{6}$/, - // CANADA - CH: /^[A-Z]\d{7}$/, - // SWITZERLAND - CN: /^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/, - // CHINA [G=Ordinary, E=Electronic] followed by 8-digits, or E followed by any UPPERCASE letter (except I and O) followed by 7 digits - CY: /^[A-Z](\d{6}|\d{8})$/, - // CYPRUS - CZ: /^\d{8}$/, - // CZECH REPUBLIC - DE: /^[CFGHJKLMNPRTVWXYZ0-9]{9}$/, - // GERMANY - DK: /^\d{9}$/, - // DENMARK - DZ: /^\d{9}$/, - // ALGERIA - EE: /^([A-Z]\d{7}|[A-Z]{2}\d{7})$/, - // ESTONIA (K followed by 7-digits), e-passports have 2 UPPERCASE followed by 7 digits - ES: /^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/, - // SPAIN - FI: /^[A-Z]{2}\d{7}$/, - // FINLAND - FR: /^\d{2}[A-Z]{2}\d{5}$/, - // FRANCE - GB: /^\d{9}$/, - // UNITED KINGDOM - GR: /^[A-Z]{2}\d{7}$/, - // GREECE - HR: /^\d{9}$/, - // CROATIA - HU: /^[A-Z]{2}(\d{6}|\d{7})$/, - // HUNGARY - IE: /^[A-Z0-9]{2}\d{7}$/, - // IRELAND - IN: /^[A-Z]{1}-?\d{7}$/, - // INDIA - ID: /^[A-C]\d{7}$/, - // INDONESIA - IR: /^[A-Z]\d{8}$/, - // IRAN - IS: /^(A)\d{7}$/, - // ICELAND - IT: /^[A-Z0-9]{2}\d{7}$/, - // ITALY - JM: /^[Aa]\d{7}$/, - // JAMAICA - JP: /^[A-Z]{2}\d{7}$/, - // JAPAN - KR: /^[MS]\d{8}$/, - // SOUTH KOREA, REPUBLIC OF KOREA, [S=PS Passports, M=PM Passports] - KZ: /^[a-zA-Z]\d{7}$/, - // KAZAKHSTAN - LI: /^[a-zA-Z]\d{5}$/, - // LIECHTENSTEIN - LT: /^[A-Z0-9]{8}$/, - // LITHUANIA - LU: /^[A-Z0-9]{8}$/, - // LUXEMBURG - LV: /^[A-Z0-9]{2}\d{7}$/, - // LATVIA - LY: /^[A-Z0-9]{8}$/, - // LIBYA - MT: /^\d{7}$/, - // MALTA - MZ: /^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/, - // MOZAMBIQUE - MY: /^[AHK]\d{8}$/, - // MALAYSIA - MX: /^\d{10,11}$/, - // MEXICO - NL: /^[A-Z]{2}[A-Z0-9]{6}\d$/, - // NETHERLANDS - NZ: /^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/, - // NEW ZEALAND - PH: /^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/, - // PHILIPPINES - PK: /^[A-Z]{2}\d{7}$/, - // PAKISTAN - PL: /^[A-Z]{2}\d{7}$/, - // POLAND - PT: /^[A-Z]\d{6}$/, - // PORTUGAL - RO: /^\d{8,9}$/, - // ROMANIA - RU: /^\d{9}$/, - // RUSSIAN FEDERATION - SE: /^\d{8}$/, - // SWEDEN - SL: /^(P)[A-Z]\d{7}$/, - // SLOVENIA - SK: /^[0-9A-Z]\d{7}$/, - // SLOVAKIA - TH: /^[A-Z]{1,2}\d{6,7}$/, - // THAILAND - TR: /^[A-Z]\d{8}$/, - // TURKEY - UA: /^[A-Z]{2}\d{6}$/, - // UKRAINE - US: /^\d{9}$/, - // UNITED STATES - ZA: /^[TAMD]\d{8}$/ - // SOUTH AFRICA - }; - function isPassportNumber2(str, countryCode) { - (0, _assertString2.default)(str); - var normalizedStr = str.replace(/\s/g, "").toUpperCase(); - return countryCode.toUpperCase() in passportRegexByCountryCode && passportRegexByCountryCode[countryCode].test(normalizedStr); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isPassportNumber, isPassportNumber.exports); -var isPassportNumberExports = isPassportNumber.exports; -var isPort = { exports: {} }; -var isInt = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isInt2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var int2 = /^(?:[-+]?(?:0|[1-9][0-9]*))$/; - var intLeadingZeroes = /^[-+]?[0-9]+$/; - function isInt2(str, options) { - (0, _assertString2.default)(str); - options = options || {}; - var regex2 = options.allow_leading_zeroes === false ? int2 : intLeadingZeroes; - var minCheckPassed = !options.hasOwnProperty("min") || str >= options.min; - var maxCheckPassed = !options.hasOwnProperty("max") || str <= options.max; - var ltCheckPassed = !options.hasOwnProperty("lt") || str < options.lt; - var gtCheckPassed = !options.hasOwnProperty("gt") || str > options.gt; - return regex2.test(str) && minCheckPassed && maxCheckPassed && ltCheckPassed && gtCheckPassed; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isInt, isInt.exports); -var isIntExports = isInt.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isPort2; - var _isInt = _interopRequireDefault2(isIntExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isPort2(str) { - return (0, _isInt.default)(str, { - allow_leading_zeroes: false, - min: 0, - max: 65535 - }); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isPort, isPort.exports); -var isPortExports = isPort.exports; -var isLowercase = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isLowercase2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isLowercase2(str) { - (0, _assertString2.default)(str); - return str === str.toLowerCase(); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isLowercase, isLowercase.exports); -var isLowercaseExports = isLowercase.exports; -var isUppercase = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isUppercase2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isUppercase2(str) { - (0, _assertString2.default)(str); - return str === str.toUpperCase(); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isUppercase, isUppercase.exports); -var isUppercaseExports = isUppercase.exports; -var isIMEI = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isIMEI2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var imeiRegexWithoutHypens = /^[0-9]{15}$/; - var imeiRegexWithHypens = /^\d{2}-\d{6}-\d{6}-\d{1}$/; - function isIMEI2(str, options) { - (0, _assertString2.default)(str); - options = options || {}; - var imeiRegex = imeiRegexWithoutHypens; - if (options.allow_hyphens) { - imeiRegex = imeiRegexWithHypens; - } - if (!imeiRegex.test(str)) { - return false; - } - str = str.replace(/-/g, ""); - var sum = 0, mul6 = 2, l2 = 14; - for (var i3 = 0; i3 < l2; i3++) { - var digit = str.substring(l2 - i3 - 1, l2 - i3); - var tp = parseInt(digit, 10) * mul6; - if (tp >= 10) { - sum += tp % 10 + 1; - } else { - sum += tp; - } - if (mul6 === 1) { - mul6 += 1; - } else { - mul6 -= 1; - } - } - var chk = (10 - sum % 10) % 10; - if (chk !== parseInt(str.substring(14, 15), 10)) { - return false; - } - return true; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isIMEI, isIMEI.exports); -var isIMEIExports = isIMEI.exports; -var isAscii = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isAscii2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var ascii2 = /^[\x00-\x7F]+$/; - function isAscii2(str) { - (0, _assertString2.default)(str); - return ascii2.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isAscii, isAscii.exports); -var isAsciiExports = isAscii.exports; -var isFullWidth$1 = {}; -Object.defineProperty(isFullWidth$1, "__esModule", { - value: true -}); -isFullWidth$1.default = isFullWidth; -isFullWidth$1.fullWidth = void 0; -var _assertString$8 = _interopRequireDefault$8(assertStringExports); -function _interopRequireDefault$8(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -var fullWidth = isFullWidth$1.fullWidth = /[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/; -function isFullWidth(str) { - (0, _assertString$8.default)(str); - return fullWidth.test(str); -} -var isHalfWidth$1 = {}; -Object.defineProperty(isHalfWidth$1, "__esModule", { - value: true -}); -isHalfWidth$1.default = isHalfWidth; -isHalfWidth$1.halfWidth = void 0; -var _assertString$7 = _interopRequireDefault$7(assertStringExports); -function _interopRequireDefault$7(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -var halfWidth = isHalfWidth$1.halfWidth = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/; -function isHalfWidth(str) { - (0, _assertString$7.default)(str); - return halfWidth.test(str); -} -var isVariableWidth = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isVariableWidth2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _isFullWidth = isFullWidth$1; - var _isHalfWidth = isHalfWidth$1; - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isVariableWidth2(str) { - (0, _assertString2.default)(str); - return _isFullWidth.fullWidth.test(str) && _isHalfWidth.halfWidth.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isVariableWidth, isVariableWidth.exports); -var isVariableWidthExports = isVariableWidth.exports; -var isMultibyte = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isMultibyte2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var multibyte = /[^\x00-\x7F]/; - function isMultibyte2(str) { - (0, _assertString2.default)(str); - return multibyte.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isMultibyte, isMultibyte.exports); -var isMultibyteExports = isMultibyte.exports; -var isSemVer = { exports: {} }; -var multilineRegex = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = multilineRegexp; - function multilineRegexp(parts, flags) { - var regexpAsStringLiteral = parts.join(""); - return new RegExp(regexpAsStringLiteral, flags); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(multilineRegex, multilineRegex.exports); -var multilineRegexExports = multilineRegex.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isSemVer2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _multilineRegex = _interopRequireDefault2(multilineRegexExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var semanticVersioningRegex = (0, _multilineRegex.default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)", "(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))", "?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"], "i"); - function isSemVer2(str) { - (0, _assertString2.default)(str); - return semanticVersioningRegex.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isSemVer, isSemVer.exports); -var isSemVerExports = isSemVer.exports; -var isSurrogatePair = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isSurrogatePair2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var surrogatePair = /[\uD800-\uDBFF][\uDC00-\uDFFF]/; - function isSurrogatePair2(str) { - (0, _assertString2.default)(str); - return surrogatePair.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isSurrogatePair, isSurrogatePair.exports); -var isSurrogatePairExports = isSurrogatePair.exports; -var isDecimal = { exports: {} }; -var includes = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = void 0; - var includes2 = function includes3(arr, val) { - return arr.some(function(arrVal) { - return val === arrVal; - }); - }; - exports.default = includes2; - module.exports = exports.default; - module.exports.default = exports.default; -})(includes, includes.exports); -var includesExports = includes.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isDecimal2; - var _merge = _interopRequireDefault2(mergeExports); - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _includes = _interopRequireDefault2(includesExports); - var _alpha2 = alpha$1; - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function decimalRegExp(options) { - var regExp = new RegExp("^[-+]?([0-9]+)?(\\".concat(_alpha2.decimal[options.locale], "[0-9]{").concat(options.decimal_digits, "})").concat(options.force_decimal ? "" : "?", "$")); - return regExp; - } - var default_decimal_options = { - force_decimal: false, - decimal_digits: "1,", - locale: "en-US" - }; - var blacklist2 = ["", "-", "+"]; - function isDecimal2(str, options) { - (0, _assertString2.default)(str); - options = (0, _merge.default)(options, default_decimal_options); - if (options.locale in _alpha2.decimal) { - return !(0, _includes.default)(blacklist2, str.replace(/ /g, "")) && decimalRegExp(options).test(str); - } - throw new Error("Invalid locale '".concat(options.locale, "'")); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isDecimal, isDecimal.exports); -var isDecimalExports = isDecimal.exports; -var isHexadecimal = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isHexadecimal2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var hexadecimal = /^(0x|0h)?[0-9A-F]+$/i; - function isHexadecimal2(str) { - (0, _assertString2.default)(str); - return hexadecimal.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isHexadecimal, isHexadecimal.exports); -var isHexadecimalExports = isHexadecimal.exports; -var isOctal = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isOctal2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var octal = /^(0o)?[0-7]+$/i; - function isOctal2(str) { - (0, _assertString2.default)(str); - return octal.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isOctal, isOctal.exports); -var isOctalExports = isOctal.exports; -var isDivisibleBy = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isDivisibleBy2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _toFloat = _interopRequireDefault2(toFloatExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isDivisibleBy2(str, num) { - (0, _assertString2.default)(str); - return (0, _toFloat.default)(str) % parseInt(num, 10) === 0; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isDivisibleBy, isDivisibleBy.exports); -var isDivisibleByExports = isDivisibleBy.exports; -var isHexColor = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isHexColor2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i; - function isHexColor2(str) { - (0, _assertString2.default)(str); - return hexcolor.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isHexColor, isHexColor.exports); -var isHexColorExports = isHexColor.exports; -var isRgbColor = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isRgbColor2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var rgbColor = /^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/; - var rgbaColor = /^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/; - var rgbColorPercent = /^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/; - var rgbaColorPercent = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/; - function isRgbColor2(str) { - var includePercentValues = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; - (0, _assertString2.default)(str); - if (!includePercentValues) { - return rgbColor.test(str) || rgbaColor.test(str); - } - return rgbColor.test(str) || rgbaColor.test(str) || rgbColorPercent.test(str) || rgbaColorPercent.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isRgbColor, isRgbColor.exports); -var isRgbColorExports = isRgbColor.exports; -var isHSL = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isHSL2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var hslComma = /^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i; - var hslSpace = /^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i; - function isHSL2(str) { - (0, _assertString2.default)(str); - var strippedStr = str.replace(/\s+/g, " ").replace(/\s?(hsla?\(|\)|,)\s?/ig, "$1"); - if (strippedStr.indexOf(",") !== -1) { - return hslComma.test(strippedStr); - } - return hslSpace.test(strippedStr); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isHSL, isHSL.exports); -var isHSLExports = isHSL.exports; -var isISRC = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isISRC2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var isrc = /^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/; - function isISRC2(str) { - (0, _assertString2.default)(str); - return isrc.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isISRC, isISRC.exports); -var isISRCExports = isISRC.exports; -var isIBAN$1 = {}; -Object.defineProperty(isIBAN$1, "__esModule", { - value: true -}); -isIBAN$1.default = isIBAN; -isIBAN$1.locales = void 0; -var _assertString$6 = _interopRequireDefault$6(assertStringExports); -function _interopRequireDefault$6(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -var ibanRegexThroughCountryCode = { - AD: /^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/, - AE: /^(AE[0-9]{2})\d{3}\d{16}$/, - AL: /^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/, - AT: /^(AT[0-9]{2})\d{16}$/, - AZ: /^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/, - BA: /^(BA[0-9]{2})\d{16}$/, - BE: /^(BE[0-9]{2})\d{12}$/, - BG: /^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/, - BH: /^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/, - BR: /^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/, - BY: /^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/, - CH: /^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/, - CR: /^(CR[0-9]{2})\d{18}$/, - CY: /^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/, - CZ: /^(CZ[0-9]{2})\d{20}$/, - DE: /^(DE[0-9]{2})\d{18}$/, - DK: /^(DK[0-9]{2})\d{14}$/, - DO: /^(DO[0-9]{2})[A-Z]{4}\d{20}$/, - DZ: /^(DZ\d{24})$/, - EE: /^(EE[0-9]{2})\d{16}$/, - EG: /^(EG[0-9]{2})\d{25}$/, - ES: /^(ES[0-9]{2})\d{20}$/, - FI: /^(FI[0-9]{2})\d{14}$/, - FO: /^(FO[0-9]{2})\d{14}$/, - FR: /^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/, - GB: /^(GB[0-9]{2})[A-Z]{4}\d{14}$/, - GE: /^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/, - GI: /^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/, - GL: /^(GL[0-9]{2})\d{14}$/, - GR: /^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/, - GT: /^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/, - HR: /^(HR[0-9]{2})\d{17}$/, - HU: /^(HU[0-9]{2})\d{24}$/, - IE: /^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/, - IL: /^(IL[0-9]{2})\d{19}$/, - IQ: /^(IQ[0-9]{2})[A-Z]{4}\d{15}$/, - IR: /^(IR[0-9]{2})0\d{2}0\d{18}$/, - IS: /^(IS[0-9]{2})\d{22}$/, - IT: /^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/, - JO: /^(JO[0-9]{2})[A-Z]{4}\d{22}$/, - KW: /^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/, - KZ: /^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/, - LB: /^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/, - LC: /^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/, - LI: /^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/, - LT: /^(LT[0-9]{2})\d{16}$/, - LU: /^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/, - LV: /^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/, - MA: /^(MA[0-9]{26})$/, - MC: /^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/, - MD: /^(MD[0-9]{2})[A-Z0-9]{20}$/, - ME: /^(ME[0-9]{2})\d{18}$/, - MK: /^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/, - MR: /^(MR[0-9]{2})\d{23}$/, - MT: /^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/, - MU: /^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/, - MZ: /^(MZ[0-9]{2})\d{21}$/, - NL: /^(NL[0-9]{2})[A-Z]{4}\d{10}$/, - NO: /^(NO[0-9]{2})\d{11}$/, - PK: /^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/, - PL: /^(PL[0-9]{2})\d{24}$/, - PS: /^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/, - PT: /^(PT[0-9]{2})\d{21}$/, - QA: /^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/, - RO: /^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/, - RS: /^(RS[0-9]{2})\d{18}$/, - SA: /^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/, - SC: /^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/, - SE: /^(SE[0-9]{2})\d{20}$/, - SI: /^(SI[0-9]{2})\d{15}$/, - SK: /^(SK[0-9]{2})\d{20}$/, - SM: /^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/, - SV: /^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/, - TL: /^(TL[0-9]{2})\d{19}$/, - TN: /^(TN[0-9]{2})\d{20}$/, - TR: /^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/, - UA: /^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/, - VA: /^(VA[0-9]{2})\d{18}$/, - VG: /^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/, - XK: /^(XK[0-9]{2})\d{16}$/ -}; -function hasOnlyValidCountryCodes(countryCodeArray) { - var countryCodeArrayFilteredWithObjectIbanCode = countryCodeArray.filter(function(countryCode) { - return !(countryCode in ibanRegexThroughCountryCode); - }); - if (countryCodeArrayFilteredWithObjectIbanCode.length > 0) { - return false; - } - return true; -} -function hasValidIbanFormat(str, options) { - var strippedStr = str.replace(/[\s\-]+/gi, "").toUpperCase(); - var isoCountryCode = strippedStr.slice(0, 2).toUpperCase(); - var isoCountryCodeInIbanRegexCodeObject = isoCountryCode in ibanRegexThroughCountryCode; - if (options.whitelist) { - if (!hasOnlyValidCountryCodes(options.whitelist)) { - return false; - } - var isoCountryCodeInWhiteList = options.whitelist.includes(isoCountryCode); - if (!isoCountryCodeInWhiteList) { - return false; - } - } - if (options.blacklist) { - var isoCountryCodeInBlackList = options.blacklist.includes(isoCountryCode); - if (isoCountryCodeInBlackList) { - return false; - } - } - return isoCountryCodeInIbanRegexCodeObject && ibanRegexThroughCountryCode[isoCountryCode].test(strippedStr); -} -function hasValidIbanChecksum(str) { - var strippedStr = str.replace(/[^A-Z0-9]+/gi, "").toUpperCase(); - var rearranged = strippedStr.slice(4) + strippedStr.slice(0, 4); - var alphaCapsReplacedWithDigits = rearranged.replace(/[A-Z]/g, function(char) { - return char.charCodeAt(0) - 55; - }); - var remainder = alphaCapsReplacedWithDigits.match(/\d{1,7}/g).reduce(function(acc, value) { - return Number(acc + value) % 97; - }, ""); - return remainder === 1; -} -function isIBAN(str) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - (0, _assertString$6.default)(str); - return hasValidIbanFormat(str, options) && hasValidIbanChecksum(str); -} -isIBAN$1.locales = Object.keys(ibanRegexThroughCountryCode); -var isBIC = { exports: {} }; -var isISO31661Alpha2$1 = {}; -Object.defineProperty(isISO31661Alpha2$1, "__esModule", { - value: true -}); -isISO31661Alpha2$1.CountryCodes = void 0; -isISO31661Alpha2$1.default = isISO31661Alpha2; -var _assertString$5 = _interopRequireDefault$5(assertStringExports); -function _interopRequireDefault$5(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -var validISO31661Alpha2CountriesCodes = /* @__PURE__ */ new Set(["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"]); -function isISO31661Alpha2(str) { - (0, _assertString$5.default)(str); - return validISO31661Alpha2CountriesCodes.has(str.toUpperCase()); -} -isISO31661Alpha2$1.CountryCodes = validISO31661Alpha2CountriesCodes; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isBIC2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _isISO31661Alpha = isISO31661Alpha2$1; - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var isBICReg = /^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/; - function isBIC2(str) { - (0, _assertString2.default)(str); - var countryCode = str.slice(4, 6).toUpperCase(); - if (!_isISO31661Alpha.CountryCodes.has(countryCode) && countryCode !== "XK") { - return false; - } - return isBICReg.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isBIC, isBIC.exports); -var isBICExports = isBIC.exports; -var isMD5 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isMD52; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var md52 = /^[a-f0-9]{32}$/; - function isMD52(str) { - (0, _assertString2.default)(str); - return md52.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isMD5, isMD5.exports); -var isMD5Exports = isMD5.exports; -var isHash = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isHash2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var lengths = { - md5: 32, - md4: 32, - sha1: 40, - sha256: 64, - sha384: 96, - sha512: 128, - ripemd128: 32, - ripemd160: 40, - tiger128: 32, - tiger160: 40, - tiger192: 48, - crc32: 8, - crc32b: 8 - }; - function isHash2(str, algorithm) { - (0, _assertString2.default)(str); - var hash3 = new RegExp("^[a-fA-F0-9]{".concat(lengths[algorithm], "}$")); - return hash3.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isHash, isHash.exports); -var isHashExports = isHash.exports; -var isJWT = { exports: {} }; -var isBase64 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isBase642; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var notBase64 = /[^A-Z0-9+\/=]/i; - var urlSafeBase64 = /^[A-Z0-9_\-]*$/i; - var defaultBase64Options = { - urlSafe: false - }; - function isBase642(str, options) { - (0, _assertString2.default)(str); - options = (0, _merge.default)(options, defaultBase64Options); - var len = str.length; - if (options.urlSafe) { - return urlSafeBase64.test(str); - } - if (len % 4 !== 0 || notBase64.test(str)) { - return false; - } - var firstPaddingChar = str.indexOf("="); - return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === "="; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isBase64, isBase64.exports); -var isBase64Exports = isBase64.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isJWT2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _isBase = _interopRequireDefault2(isBase64Exports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isJWT2(str) { - (0, _assertString2.default)(str); - var dotSplit = str.split("."); - var len = dotSplit.length; - if (len !== 3) { - return false; - } - return dotSplit.reduce(function(acc, currElem) { - return acc && (0, _isBase.default)(currElem, { - urlSafe: true - }); - }, true); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isJWT, isJWT.exports); -var isJWTExports = isJWT.exports; -var isJSON = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isJSON2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _typeof2(o2) { - "@babel/helpers - typeof"; - return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof2(o2); - } - var default_json_options = { - allow_primitives: false - }; - function isJSON2(str, options) { - (0, _assertString2.default)(str); - try { - options = (0, _merge.default)(options, default_json_options); - var primitives = []; - if (options.allow_primitives) { - primitives = [null, false, true]; - } - var obj = JSON.parse(str); - return primitives.includes(obj) || !!obj && _typeof2(obj) === "object"; - } catch (e18) { - } - return false; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isJSON, isJSON.exports); -var isJSONExports = isJSON.exports; -var isEmpty = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isEmpty2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var default_is_empty_options = { - ignore_whitespace: false - }; - function isEmpty2(str, options) { - (0, _assertString2.default)(str); - options = (0, _merge.default)(options, default_is_empty_options); - return (options.ignore_whitespace ? str.trim().length : str.length) === 0; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isEmpty, isEmpty.exports); -var isEmptyExports = isEmpty.exports; -var isLength = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isLength2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _typeof2(o2) { - "@babel/helpers - typeof"; - return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof2(o2); - } - function isLength2(str, options) { - (0, _assertString2.default)(str); - var min; - var max; - if (_typeof2(options) === "object") { - min = options.min || 0; - max = options.max; - } else { - min = arguments[1] || 0; - max = arguments[2]; - } - var presentationSequences = str.match(/(\uFE0F|\uFE0E)/g) || []; - var surrogatePairs = str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g) || []; - var len = str.length - presentationSequences.length - surrogatePairs.length; - return len >= min && (typeof max === "undefined" || len <= max); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isLength, isLength.exports); -var isLengthExports = isLength.exports; -var isUUID = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isUUID2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var uuid2 = { - 1: /^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i, - 2: /^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i, - 3: /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i, - 4: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, - 5: /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, - 7: /^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, - all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i - }; - function isUUID2(str, version2) { - (0, _assertString2.default)(str); - var pattern = uuid2[![void 0, null].includes(version2) ? version2 : "all"]; - return !!pattern && pattern.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isUUID, isUUID.exports); -var isUUIDExports = isUUID.exports; -var isMongoId = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isMongoId2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _isHexadecimal = _interopRequireDefault2(isHexadecimalExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isMongoId2(str) { - (0, _assertString2.default)(str); - return (0, _isHexadecimal.default)(str) && str.length === 24; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isMongoId, isMongoId.exports); -var isMongoIdExports = isMongoId.exports; -var isAfter = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isAfter2; - var _toDate = _interopRequireDefault2(toDateExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isAfter2(date, options) { - var comparisonDate = (options === null || options === void 0 ? void 0 : options.comparisonDate) || options || Date().toString(); - var comparison = (0, _toDate.default)(comparisonDate); - var original = (0, _toDate.default)(date); - return !!(original && comparison && original > comparison); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isAfter, isAfter.exports); -var isAfterExports = isAfter.exports; -var isBefore = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isBefore2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _toDate = _interopRequireDefault2(toDateExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isBefore2(str) { - var date = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : String(/* @__PURE__ */ new Date()); - (0, _assertString2.default)(str); - var comparison = (0, _toDate.default)(date); - var original = (0, _toDate.default)(str); - return !!(original && comparison && original < comparison); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isBefore, isBefore.exports); -var isBeforeExports = isBefore.exports; -var isIn = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isIn2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _toString = _interopRequireDefault2(toStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _typeof2(o2) { - "@babel/helpers - typeof"; - return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof2(o2); - } - function isIn2(str, options) { - (0, _assertString2.default)(str); - var i3; - if (Object.prototype.toString.call(options) === "[object Array]") { - var array2 = []; - for (i3 in options) { - if ({}.hasOwnProperty.call(options, i3)) { - array2[i3] = (0, _toString.default)(options[i3]); - } - } - return array2.indexOf(str) >= 0; - } else if (_typeof2(options) === "object") { - return options.hasOwnProperty(str); - } else if (options && typeof options.indexOf === "function") { - return options.indexOf(str) >= 0; - } - return false; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isIn, isIn.exports); -var isInExports = isIn.exports; -var isLuhnNumber = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isLuhnNumber2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isLuhnNumber2(str) { - (0, _assertString2.default)(str); - var sanitized = str.replace(/[- ]+/g, ""); - var sum = 0; - var digit; - var tmpNum; - var shouldDouble; - for (var i3 = sanitized.length - 1; i3 >= 0; i3--) { - digit = sanitized.substring(i3, i3 + 1); - tmpNum = parseInt(digit, 10); - if (shouldDouble) { - tmpNum *= 2; - if (tmpNum >= 10) { - sum += tmpNum % 10 + 1; - } else { - sum += tmpNum; - } - } else { - sum += tmpNum; - } - shouldDouble = !shouldDouble; - } - return !!(sum % 10 === 0 ? sanitized : false); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isLuhnNumber, isLuhnNumber.exports); -var isLuhnNumberExports = isLuhnNumber.exports; -var isCreditCard = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isCreditCard2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _isLuhnNumber = _interopRequireDefault2(isLuhnNumberExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var cards = { - amex: /^3[47][0-9]{13}$/, - dinersclub: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/, - discover: /^6(?:011|5[0-9][0-9])[0-9]{12,15}$/, - jcb: /^(?:2131|1800|35\d{3})\d{11}$/, - mastercard: /^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/, - // /^[25][1-7][0-9]{14}$/; - unionpay: /^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/, - visa: /^(?:4[0-9]{12})(?:[0-9]{3,6})?$/ - }; - var allCards = function() { - var tmpCardsArray = []; - for (var cardProvider in cards) { - if (cards.hasOwnProperty(cardProvider)) { - tmpCardsArray.push(cards[cardProvider]); - } - } - return tmpCardsArray; - }(); - function isCreditCard2(card) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - (0, _assertString2.default)(card); - var provider = options.provider; - var sanitized = card.replace(/[- ]+/g, ""); - if (provider && provider.toLowerCase() in cards) { - if (!cards[provider.toLowerCase()].test(sanitized)) { - return false; - } - } else if (provider && !(provider.toLowerCase() in cards)) { - throw new Error("".concat(provider, " is not a valid credit card provider.")); - } else if (!allCards.some(function(cardProvider) { - return cardProvider.test(sanitized); - })) { - return false; - } - return (0, _isLuhnNumber.default)(card); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isCreditCard, isCreditCard.exports); -var isCreditCardExports = isCreditCard.exports; -var isIdentityCard = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isIdentityCard2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _isInt = _interopRequireDefault2(isIntExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var validators2 = { - PL: function PL2(str) { - (0, _assertString2.default)(str); - var weightOfDigits = { - 1: 1, - 2: 3, - 3: 7, - 4: 9, - 5: 1, - 6: 3, - 7: 7, - 8: 9, - 9: 1, - 10: 3, - 11: 0 - }; - if (str != null && str.length === 11 && (0, _isInt.default)(str, { - allow_leading_zeroes: true - })) { - var digits = str.split("").slice(0, -1); - var sum = digits.reduce(function(acc, digit, index2) { - return acc + Number(digit) * weightOfDigits[index2 + 1]; - }, 0); - var modulo = sum % 10; - var lastDigit = Number(str.charAt(str.length - 1)); - if (modulo === 0 && lastDigit === 0 || lastDigit === 10 - modulo) { - return true; - } - } - return false; - }, - ES: function ES2(str) { - (0, _assertString2.default)(str); - var DNI = /^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/; - var charsValue = { - X: 0, - Y: 1, - Z: 2 - }; - var controlDigits = ["T", "R", "W", "A", "G", "M", "Y", "F", "P", "D", "X", "B", "N", "J", "Z", "S", "Q", "V", "H", "L", "C", "K", "E"]; - var sanitized = str.trim().toUpperCase(); - if (!DNI.test(sanitized)) { - return false; - } - var number2 = sanitized.slice(0, -1).replace(/[X,Y,Z]/g, function(char) { - return charsValue[char]; - }); - return sanitized.endsWith(controlDigits[number2 % 23]); - }, - FI: function FI2(str) { - (0, _assertString2.default)(str); - if (str.length !== 11) { - return false; - } - if (!str.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/)) { - return false; - } - var checkDigits = "0123456789ABCDEFHJKLMNPRSTUVWXY"; - var idAsNumber = parseInt(str.slice(0, 6), 10) * 1e3 + parseInt(str.slice(7, 10), 10); - var remainder = idAsNumber % 31; - var checkDigit = checkDigits[remainder]; - return checkDigit === str.slice(10, 11); - }, - IN: function IN2(str) { - var DNI = /^[1-9]\d{3}\s?\d{4}\s?\d{4}$/; - var d4 = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]]; - var p3 = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2], [8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0], [4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5], [7, 0, 4, 6, 9, 1, 3, 2, 5, 8]]; - var sanitized = str.trim(); - if (!DNI.test(sanitized)) { - return false; - } - var c2 = 0; - var invertedArray = sanitized.replace(/\s/g, "").split("").map(Number).reverse(); - invertedArray.forEach(function(val, i3) { - c2 = d4[c2][p3[i3 % 8][val]]; - }); - return c2 === 0; - }, - IR: function IR(str) { - if (!str.match(/^\d{10}$/)) - return false; - str = "0000".concat(str).slice(str.length - 6); - if (parseInt(str.slice(3, 9), 10) === 0) - return false; - var lastNumber = parseInt(str.slice(9, 10), 10); - var sum = 0; - for (var i3 = 0; i3 < 9; i3++) { - sum += parseInt(str.slice(i3, i3 + 1), 10) * (10 - i3); - } - sum %= 11; - return sum < 2 && lastNumber === sum || sum >= 2 && lastNumber === 11 - sum; - }, - IT: function IT2(str) { - if (str.length !== 9) - return false; - if (str === "CA00000AA") - return false; - return str.search(/C[A-Z]\d{5}[A-Z]{2}/i) > -1; - }, - NO: function NO2(str) { - var sanitized = str.trim(); - if (isNaN(Number(sanitized))) - return false; - if (sanitized.length !== 11) - return false; - if (sanitized === "00000000000") - return false; - var f3 = sanitized.split("").map(Number); - var k1 = (11 - (3 * f3[0] + 7 * f3[1] + 6 * f3[2] + 1 * f3[3] + 8 * f3[4] + 9 * f3[5] + 4 * f3[6] + 5 * f3[7] + 2 * f3[8]) % 11) % 11; - var k2 = (11 - (5 * f3[0] + 4 * f3[1] + 3 * f3[2] + 2 * f3[3] + 7 * f3[4] + 6 * f3[5] + 5 * f3[6] + 4 * f3[7] + 3 * f3[8] + 2 * k1) % 11) % 11; - if (k1 !== f3[9] || k2 !== f3[10]) - return false; - return true; - }, - TH: function TH(str) { - if (!str.match(/^[1-8]\d{12}$/)) - return false; - var sum = 0; - for (var i3 = 0; i3 < 12; i3++) { - sum += parseInt(str[i3], 10) * (13 - i3); - } - return str[12] === ((11 - sum % 11) % 10).toString(); - }, - LK: function LK(str) { - var old_nic = /^[1-9]\d{8}[vx]$/i; - var new_nic = /^[1-9]\d{11}$/i; - if (str.length === 10 && old_nic.test(str)) - return true; - else if (str.length === 12 && new_nic.test(str)) - return true; - return false; - }, - "he-IL": function heIL(str) { - var DNI = /^\d{9}$/; - var sanitized = str.trim(); - if (!DNI.test(sanitized)) { - return false; - } - var id2 = sanitized; - var sum = 0, incNum; - for (var i3 = 0; i3 < id2.length; i3++) { - incNum = Number(id2[i3]) * (i3 % 2 + 1); - sum += incNum > 9 ? incNum - 9 : incNum; - } - return sum % 10 === 0; - }, - "ar-LY": function arLY(str) { - var NIN = /^(1|2)\d{11}$/; - var sanitized = str.trim(); - if (!NIN.test(sanitized)) { - return false; - } - return true; - }, - "ar-TN": function arTN(str) { - var DNI = /^\d{8}$/; - var sanitized = str.trim(); - if (!DNI.test(sanitized)) { - return false; - } - return true; - }, - "zh-CN": function zhCN(str) { - var provincesAndCities = [ - "11", - // 北京 - "12", - // 天津 - "13", - // 河北 - "14", - // 山西 - "15", - // 内蒙古 - "21", - // 辽宁 - "22", - // 吉林 - "23", - // 黑龙江 - "31", - // 上海 - "32", - // 江苏 - "33", - // 浙江 - "34", - // 安徽 - "35", - // 福建 - "36", - // 江西 - "37", - // 山东 - "41", - // 河南 - "42", - // 湖北 - "43", - // 湖南 - "44", - // 广东 - "45", - // 广西 - "46", - // 海南 - "50", - // 重庆 - "51", - // 四川 - "52", - // 贵州 - "53", - // 云南 - "54", - // 西藏 - "61", - // 陕西 - "62", - // 甘肃 - "63", - // 青海 - "64", - // 宁夏 - "65", - // 新疆 - "71", - // 台湾 - "81", - // 香港 - "82", - // 澳门 - "91" - // 国外 - ]; - var powers = ["7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2"]; - var parityBit = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]; - var checkAddressCode = function checkAddressCode2(addressCode) { - return provincesAndCities.includes(addressCode); - }; - var checkBirthDayCode = function checkBirthDayCode2(birDayCode) { - var yyyy = parseInt(birDayCode.substring(0, 4), 10); - var mm = parseInt(birDayCode.substring(4, 6), 10); - var dd2 = parseInt(birDayCode.substring(6), 10); - var xdata = new Date(yyyy, mm - 1, dd2); - if (xdata > /* @__PURE__ */ new Date()) { - return false; - } else if (xdata.getFullYear() === yyyy && xdata.getMonth() === mm - 1 && xdata.getDate() === dd2) { - return true; - } - return false; - }; - var getParityBit = function getParityBit2(idCardNo) { - var id17 = idCardNo.substring(0, 17); - var power = 0; - for (var i3 = 0; i3 < 17; i3++) { - power += parseInt(id17.charAt(i3), 10) * parseInt(powers[i3], 10); - } - var mod2 = power % 11; - return parityBit[mod2]; - }; - var checkParityBit = function checkParityBit2(idCardNo) { - return getParityBit(idCardNo) === idCardNo.charAt(17).toUpperCase(); - }; - var check15IdCardNo = function check15IdCardNo2(idCardNo) { - var check = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(idCardNo); - if (!check) - return false; - var addressCode = idCardNo.substring(0, 2); - check = checkAddressCode(addressCode); - if (!check) - return false; - var birDayCode = "19".concat(idCardNo.substring(6, 12)); - check = checkBirthDayCode(birDayCode); - if (!check) - return false; - return true; - }; - var check18IdCardNo = function check18IdCardNo2(idCardNo) { - var check = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(idCardNo); - if (!check) - return false; - var addressCode = idCardNo.substring(0, 2); - check = checkAddressCode(addressCode); - if (!check) - return false; - var birDayCode = idCardNo.substring(6, 14); - check = checkBirthDayCode(birDayCode); - if (!check) - return false; - return checkParityBit(idCardNo); - }; - var checkIdCardNo = function checkIdCardNo2(idCardNo) { - var check = /^\d{15}|(\d{17}(\d|x|X))$/.test(idCardNo); - if (!check) - return false; - if (idCardNo.length === 15) { - return check15IdCardNo(idCardNo); - } - return check18IdCardNo(idCardNo); - }; - return checkIdCardNo(str); - }, - "zh-HK": function zhHK(str) { - str = str.trim(); - var regexHKID = /^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/; - var regexIsDigit = /^[0-9]$/; - str = str.toUpperCase(); - if (!regexHKID.test(str)) - return false; - str = str.replace(/\[|\]|\(|\)/g, ""); - if (str.length === 8) - str = "3".concat(str); - var checkSumVal = 0; - for (var i3 = 0; i3 <= 7; i3++) { - var convertedChar = void 0; - if (!regexIsDigit.test(str[i3])) - convertedChar = (str[i3].charCodeAt(0) - 55) % 11; - else - convertedChar = str[i3]; - checkSumVal += convertedChar * (9 - i3); - } - checkSumVal %= 11; - var checkSumConverted; - if (checkSumVal === 0) - checkSumConverted = "0"; - else if (checkSumVal === 1) - checkSumConverted = "A"; - else - checkSumConverted = String(11 - checkSumVal); - if (checkSumConverted === str[str.length - 1]) - return true; - return false; - }, - "zh-TW": function zhTW(str) { - var ALPHABET_CODES = { - A: 10, - B: 11, - C: 12, - D: 13, - E: 14, - F: 15, - G: 16, - H: 17, - I: 34, - J: 18, - K: 19, - L: 20, - M: 21, - N: 22, - O: 35, - P: 23, - Q: 24, - R: 25, - S: 26, - T: 27, - U: 28, - V: 29, - W: 32, - X: 30, - Y: 31, - Z: 33 - }; - var sanitized = str.trim().toUpperCase(); - if (!/^[A-Z][0-9]{9}$/.test(sanitized)) - return false; - return Array.from(sanitized).reduce(function(sum, number2, index2) { - if (index2 === 0) { - var code2 = ALPHABET_CODES[number2]; - return code2 % 10 * 9 + Math.floor(code2 / 10); - } - if (index2 === 9) { - return (10 - sum % 10 - Number(number2)) % 10 === 0; - } - return sum + Number(number2) * (9 - index2); - }, 0); - } - }; - function isIdentityCard2(str, locale) { - (0, _assertString2.default)(str); - if (locale in validators2) { - return validators2[locale](str); - } else if (locale === "any") { - for (var key2 in validators2) { - if (validators2.hasOwnProperty(key2)) { - var validator2 = validators2[key2]; - if (validator2(str)) { - return true; - } - } - } - return false; - } - throw new Error("Invalid locale '".concat(locale, "'")); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isIdentityCard, isIdentityCard.exports); -var isIdentityCardExports = isIdentityCard.exports; -var isEAN = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isEAN2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var LENGTH_EAN_8 = 8; - var LENGTH_EAN_14 = 14; - var validEanRegex = /^(\d{8}|\d{13}|\d{14})$/; - function getPositionWeightThroughLengthAndIndex(length, index2) { - if (length === LENGTH_EAN_8 || length === LENGTH_EAN_14) { - return index2 % 2 === 0 ? 3 : 1; - } - return index2 % 2 === 0 ? 1 : 3; - } - function calculateCheckDigit(ean) { - var checksum2 = ean.slice(0, -1).split("").map(function(char, index2) { - return Number(char) * getPositionWeightThroughLengthAndIndex(ean.length, index2); - }).reduce(function(acc, partialSum) { - return acc + partialSum; - }, 0); - var remainder = 10 - checksum2 % 10; - return remainder < 10 ? remainder : 0; - } - function isEAN2(str) { - (0, _assertString2.default)(str); - var actualCheckDigit = Number(str.slice(-1)); - return validEanRegex.test(str) && actualCheckDigit === calculateCheckDigit(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isEAN, isEAN.exports); -var isEANExports = isEAN.exports; -var isISIN = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isISIN2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var isin = /^[A-Z]{2}[0-9A-Z]{9}[0-9]$/; - function isISIN2(str) { - (0, _assertString2.default)(str); - if (!isin.test(str)) { - return false; - } - var double = true; - var sum = 0; - for (var i3 = str.length - 2; i3 >= 0; i3--) { - if (str[i3] >= "A" && str[i3] <= "Z") { - var value = str[i3].charCodeAt(0) - 55; - var lo2 = value % 10; - var hi2 = Math.trunc(value / 10); - for (var _i3 = 0, _arr = [lo2, hi2]; _i3 < _arr.length; _i3++) { - var digit = _arr[_i3]; - if (double) { - if (digit >= 5) { - sum += 1 + (digit - 5) * 2; - } else { - sum += digit * 2; - } - } else { - sum += digit; - } - double = !double; - } - } else { - var _digit = str[i3].charCodeAt(0) - "0".charCodeAt(0); - if (double) { - if (_digit >= 5) { - sum += 1 + (_digit - 5) * 2; - } else { - sum += _digit * 2; - } - } else { - sum += _digit; - } - double = !double; - } - } - var check = Math.trunc((sum + 9) / 10) * 10 - sum; - return +str[str.length - 1] === check; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isISIN, isISIN.exports); -var isISINExports = isISIN.exports; -var isISBN = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isISBN2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var possibleIsbn10 = /^(?:[0-9]{9}X|[0-9]{10})$/; - var possibleIsbn13 = /^(?:[0-9]{13})$/; - var factor = [1, 3]; - function isISBN2(isbn, options) { - (0, _assertString2.default)(isbn); - var version2 = String((options === null || options === void 0 ? void 0 : options.version) || options); - if (!(options !== null && options !== void 0 && options.version || options)) { - return isISBN2(isbn, { - version: 10 - }) || isISBN2(isbn, { - version: 13 - }); - } - var sanitizedIsbn = isbn.replace(/[\s-]+/g, ""); - var checksum2 = 0; - if (version2 === "10") { - if (!possibleIsbn10.test(sanitizedIsbn)) { - return false; - } - for (var i3 = 0; i3 < version2 - 1; i3++) { - checksum2 += (i3 + 1) * sanitizedIsbn.charAt(i3); - } - if (sanitizedIsbn.charAt(9) === "X") { - checksum2 += 10 * 10; - } else { - checksum2 += 10 * sanitizedIsbn.charAt(9); - } - if (checksum2 % 11 === 0) { - return true; - } - } else if (version2 === "13") { - if (!possibleIsbn13.test(sanitizedIsbn)) { - return false; - } - for (var _i3 = 0; _i3 < 12; _i3++) { - checksum2 += factor[_i3 % 2] * sanitizedIsbn.charAt(_i3); - } - if (sanitizedIsbn.charAt(12) - (10 - checksum2 % 10) % 10 === 0) { - return true; - } - } - return false; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isISBN, isISBN.exports); -var isISBNExports = isISBN.exports; -var isISSN = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isISSN2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var issn = "^\\d{4}-?\\d{3}[\\dX]$"; - function isISSN2(str) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - (0, _assertString2.default)(str); - var testIssn = issn; - testIssn = options.require_hyphen ? testIssn.replace("?", "") : testIssn; - testIssn = options.case_sensitive ? new RegExp(testIssn) : new RegExp(testIssn, "i"); - if (!testIssn.test(str)) { - return false; - } - var digits = str.replace("-", "").toUpperCase(); - var checksum2 = 0; - for (var i3 = 0; i3 < digits.length; i3++) { - var digit = digits[i3]; - checksum2 += (digit === "X" ? 10 : +digit) * (8 - i3); - } - return checksum2 % 11 === 0; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isISSN, isISSN.exports); -var isISSNExports = isISSN.exports; -var isTaxID = { exports: {} }; -var algorithms$1 = {}; -Object.defineProperty(algorithms$1, "__esModule", { - value: true -}); -algorithms$1.iso7064Check = iso7064Check; -algorithms$1.luhnCheck = luhnCheck; -algorithms$1.reverseMultiplyAndSum = reverseMultiplyAndSum; -algorithms$1.verhoeffCheck = verhoeffCheck; -function iso7064Check(str) { - var checkvalue = 10; - for (var i3 = 0; i3 < str.length - 1; i3++) { - checkvalue = (parseInt(str[i3], 10) + checkvalue) % 10 === 0 ? 10 * 2 % 11 : (parseInt(str[i3], 10) + checkvalue) % 10 * 2 % 11; - } - checkvalue = checkvalue === 1 ? 0 : 11 - checkvalue; - return checkvalue === parseInt(str[10], 10); -} -function luhnCheck(str) { - var checksum2 = 0; - var second = false; - for (var i3 = str.length - 1; i3 >= 0; i3--) { - if (second) { - var product = parseInt(str[i3], 10) * 2; - if (product > 9) { - checksum2 += product.toString().split("").map(function(a3) { - return parseInt(a3, 10); - }).reduce(function(a3, b2) { - return a3 + b2; - }, 0); - } else { - checksum2 += product; - } - } else { - checksum2 += parseInt(str[i3], 10); - } - second = !second; - } - return checksum2 % 10 === 0; -} -function reverseMultiplyAndSum(digits, base3) { - var total = 0; - for (var i3 = 0; i3 < digits.length; i3++) { - total += digits[i3] * (base3 - i3); - } - return total; -} -function verhoeffCheck(str) { - var d_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]]; - var p_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2], [8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0], [4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5], [7, 0, 4, 6, 9, 1, 3, 2, 5, 8]]; - var str_copy = str.split("").reverse().join(""); - var checksum2 = 0; - for (var i3 = 0; i3 < str_copy.length; i3++) { - checksum2 = d_table[checksum2][p_table[i3 % 8][parseInt(str_copy[i3], 10)]]; - } - return checksum2 === 0; -} -(function(module, exports) { - function _typeof2(o2) { - "@babel/helpers - typeof"; - return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof2(o2); - } - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isTaxID2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var algorithms2 = _interopRequireWildcard2(algorithms$1); - var _isDate = _interopRequireDefault2(isDateExports); - function _getRequireWildcardCache2(e18) { - if ("function" != typeof WeakMap) - return null; - var r2 = /* @__PURE__ */ new WeakMap(), t2 = /* @__PURE__ */ new WeakMap(); - return (_getRequireWildcardCache2 = function _getRequireWildcardCache3(e19) { - return e19 ? t2 : r2; - })(e18); - } - function _interopRequireWildcard2(e18, r2) { - if (!r2 && e18 && e18.__esModule) - return e18; - if (null === e18 || "object" != _typeof2(e18) && "function" != typeof e18) - return { default: e18 }; - var t2 = _getRequireWildcardCache2(r2); - if (t2 && t2.has(e18)) - return t2.get(e18); - var n4 = { __proto__: null }, a3 = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var u2 in e18) - if ("default" !== u2 && {}.hasOwnProperty.call(e18, u2)) { - var i3 = a3 ? Object.getOwnPropertyDescriptor(e18, u2) : null; - i3 && (i3.get || i3.set) ? Object.defineProperty(n4, u2, i3) : n4[u2] = e18[u2]; - } - return n4.default = e18, t2 && t2.set(e18, n4), n4; - } - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _unsupportedIterableToArray(o2, minLen) { - if (!o2) - return; - if (typeof o2 === "string") - return _arrayLikeToArray(o2, minLen); - var n4 = Object.prototype.toString.call(o2).slice(8, -1); - if (n4 === "Object" && o2.constructor) - n4 = o2.constructor.name; - if (n4 === "Map" || n4 === "Set") - return Array.from(o2); - if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4)) - return _arrayLikeToArray(o2, minLen); - } - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) - return _arrayLikeToArray(arr); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i3 = 0, arr2 = new Array(len); i3 < len; i3++) - arr2[i3] = arr[i3]; - return arr2; - } - function bgBgCheck(tin) { - var century_year = tin.slice(0, 2); - var month = parseInt(tin.slice(2, 4), 10); - if (month > 40) { - month -= 40; - century_year = "20".concat(century_year); - } else if (month > 20) { - month -= 20; - century_year = "18".concat(century_year); - } else { - century_year = "19".concat(century_year); - } - if (month < 10) { - month = "0".concat(month); - } - var date = "".concat(century_year, "/").concat(month, "/").concat(tin.slice(4, 6)); - if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - var digits = tin.split("").map(function(a3) { - return parseInt(a3, 10); - }); - var multip_lookup = [2, 4, 8, 5, 10, 9, 7, 3, 6]; - var checksum2 = 0; - for (var i3 = 0; i3 < multip_lookup.length; i3++) { - checksum2 += digits[i3] * multip_lookup[i3]; - } - checksum2 = checksum2 % 11 === 10 ? 0 : checksum2 % 11; - return checksum2 === digits[9]; - } - function isCanadianSIN(input) { - var digitsArray = input.split(""); - var even = digitsArray.filter(function(_3, idx) { - return idx % 2; - }).map(function(i3) { - return Number(i3) * 2; - }).join("").split(""); - var total = digitsArray.filter(function(_3, idx) { - return !(idx % 2); - }).concat(even).map(function(i3) { - return Number(i3); - }).reduce(function(acc, cur) { - return acc + cur; - }); - return total % 10 === 0; - } - function csCzCheck(tin) { - tin = tin.replace(/\W/, ""); - var full_year = parseInt(tin.slice(0, 2), 10); - if (tin.length === 10) { - if (full_year < 54) { - full_year = "20".concat(full_year); - } else { - full_year = "19".concat(full_year); - } - } else { - if (tin.slice(6) === "000") { - return false; - } - if (full_year < 54) { - full_year = "19".concat(full_year); - } else { - return false; - } - } - if (full_year.length === 3) { - full_year = [full_year.slice(0, 2), "0", full_year.slice(2)].join(""); - } - var month = parseInt(tin.slice(2, 4), 10); - if (month > 50) { - month -= 50; - } - if (month > 20) { - if (parseInt(full_year, 10) < 2004) { - return false; - } - month -= 20; - } - if (month < 10) { - month = "0".concat(month); - } - var date = "".concat(full_year, "/").concat(month, "/").concat(tin.slice(4, 6)); - if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - if (tin.length === 10) { - if (parseInt(tin, 10) % 11 !== 0) { - var checkdigit = parseInt(tin.slice(0, 9), 10) % 11; - if (parseInt(full_year, 10) < 1986 && checkdigit === 10) { - if (parseInt(tin.slice(9), 10) !== 0) { - return false; - } - } else { - return false; - } - } - } - return true; - } - function deAtCheck(tin) { - return algorithms2.luhnCheck(tin); - } - function deDeCheck(tin) { - var digits = tin.split("").map(function(a3) { - return parseInt(a3, 10); - }); - var occurences = []; - for (var i3 = 0; i3 < digits.length - 1; i3++) { - occurences.push(""); - for (var j2 = 0; j2 < digits.length - 1; j2++) { - if (digits[i3] === digits[j2]) { - occurences[i3] += j2; - } - } - } - occurences = occurences.filter(function(a3) { - return a3.length > 1; - }); - if (occurences.length !== 2 && occurences.length !== 3) { - return false; - } - if (occurences[0].length === 3) { - var trip_locations = occurences[0].split("").map(function(a3) { - return parseInt(a3, 10); - }); - var recurrent = 0; - for (var _i3 = 0; _i3 < trip_locations.length - 1; _i3++) { - if (trip_locations[_i3] + 1 === trip_locations[_i3 + 1]) { - recurrent += 1; - } - } - if (recurrent === 2) { - return false; - } - } - return algorithms2.iso7064Check(tin); - } - function dkDkCheck(tin) { - tin = tin.replace(/\W/, ""); - var year = parseInt(tin.slice(4, 6), 10); - var century_digit = tin.slice(6, 7); - switch (century_digit) { - case "0": - case "1": - case "2": - case "3": - year = "19".concat(year); - break; - case "4": - case "9": - if (year < 37) { - year = "20".concat(year); - } else { - year = "19".concat(year); - } - break; - default: - if (year < 37) { - year = "20".concat(year); - } else if (year > 58) { - year = "18".concat(year); - } else { - return false; - } - break; - } - if (year.length === 3) { - year = [year.slice(0, 2), "0", year.slice(2)].join(""); - } - var date = "".concat(year, "/").concat(tin.slice(2, 4), "/").concat(tin.slice(0, 2)); - if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - var digits = tin.split("").map(function(a3) { - return parseInt(a3, 10); - }); - var checksum2 = 0; - var weight = 4; - for (var i3 = 0; i3 < 9; i3++) { - checksum2 += digits[i3] * weight; - weight -= 1; - if (weight === 1) { - weight = 7; - } - } - checksum2 %= 11; - if (checksum2 === 1) { - return false; - } - return checksum2 === 0 ? digits[9] === 0 : digits[9] === 11 - checksum2; - } - function elCyCheck(tin) { - var digits = tin.slice(0, 8).split("").map(function(a3) { - return parseInt(a3, 10); - }); - var checksum2 = 0; - for (var i3 = 1; i3 < digits.length; i3 += 2) { - checksum2 += digits[i3]; - } - for (var _i22 = 0; _i22 < digits.length; _i22 += 2) { - if (digits[_i22] < 2) { - checksum2 += 1 - digits[_i22]; - } else { - checksum2 += 2 * (digits[_i22] - 2) + 5; - if (digits[_i22] > 4) { - checksum2 += 2; - } - } - } - return String.fromCharCode(checksum2 % 26 + 65) === tin.charAt(8); - } - function elGrCheck(tin) { - var digits = tin.split("").map(function(a3) { - return parseInt(a3, 10); - }); - var checksum2 = 0; - for (var i3 = 0; i3 < 8; i3++) { - checksum2 += digits[i3] * Math.pow(2, 8 - i3); - } - return checksum2 % 11 % 10 === digits[8]; - } - function enIeCheck(tin) { - var checksum2 = algorithms2.reverseMultiplyAndSum(tin.split("").slice(0, 7).map(function(a3) { - return parseInt(a3, 10); - }), 8); - if (tin.length === 9 && tin[8] !== "W") { - checksum2 += (tin[8].charCodeAt(0) - 64) * 9; - } - checksum2 %= 23; - if (checksum2 === 0) { - return tin[7].toUpperCase() === "W"; - } - return tin[7].toUpperCase() === String.fromCharCode(64 + checksum2); - } - var enUsCampusPrefix = { - andover: ["10", "12"], - atlanta: ["60", "67"], - austin: ["50", "53"], - brookhaven: ["01", "02", "03", "04", "05", "06", "11", "13", "14", "16", "21", "22", "23", "25", "34", "51", "52", "54", "55", "56", "57", "58", "59", "65"], - cincinnati: ["30", "32", "35", "36", "37", "38", "61"], - fresno: ["15", "24"], - internet: ["20", "26", "27", "45", "46", "47"], - kansas: ["40", "44"], - memphis: ["94", "95"], - ogden: ["80", "90"], - philadelphia: ["33", "39", "41", "42", "43", "46", "48", "62", "63", "64", "66", "68", "71", "72", "73", "74", "75", "76", "77", "81", "82", "83", "84", "85", "86", "87", "88", "91", "92", "93", "98", "99"], - sba: ["31"] - }; - function enUsGetPrefixes() { - var prefixes = []; - for (var location2 in enUsCampusPrefix) { - if (enUsCampusPrefix.hasOwnProperty(location2)) { - prefixes.push.apply(prefixes, _toConsumableArray(enUsCampusPrefix[location2])); - } - } - return prefixes; - } - function enUsCheck(tin) { - return enUsGetPrefixes().indexOf(tin.slice(0, 2)) !== -1; - } - function esArCheck(tin) { - var accum = 0; - var digits = tin.split(""); - var digit = parseInt(digits.pop(), 10); - for (var i3 = 0; i3 < digits.length; i3++) { - accum += digits[9 - i3] * (2 + i3 % 6); - } - var verif = 11 - accum % 11; - if (verif === 11) { - verif = 0; - } else if (verif === 10) { - verif = 9; - } - return digit === verif; - } - function esEsCheck(tin) { - var chars = tin.toUpperCase().split(""); - if (isNaN(parseInt(chars[0], 10)) && chars.length > 1) { - var lead_replace = 0; - switch (chars[0]) { - case "Y": - lead_replace = 1; - break; - case "Z": - lead_replace = 2; - break; - } - chars.splice(0, 1, lead_replace); - } else { - while (chars.length < 9) { - chars.unshift(0); - } - } - var lookup2 = ["T", "R", "W", "A", "G", "M", "Y", "F", "P", "D", "X", "B", "N", "J", "Z", "S", "Q", "V", "H", "L", "C", "K", "E"]; - chars = chars.join(""); - var checksum2 = parseInt(chars.slice(0, 8), 10) % 23; - return chars[8] === lookup2[checksum2]; - } - function etEeCheck(tin) { - var full_year = tin.slice(1, 3); - var century_digit = tin.slice(0, 1); - switch (century_digit) { - case "1": - case "2": - full_year = "18".concat(full_year); - break; - case "3": - case "4": - full_year = "19".concat(full_year); - break; - default: - full_year = "20".concat(full_year); - break; - } - var date = "".concat(full_year, "/").concat(tin.slice(3, 5), "/").concat(tin.slice(5, 7)); - if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - var digits = tin.split("").map(function(a3) { - return parseInt(a3, 10); - }); - var checksum2 = 0; - var weight = 1; - for (var i3 = 0; i3 < 10; i3++) { - checksum2 += digits[i3] * weight; - weight += 1; - if (weight === 10) { - weight = 1; - } - } - if (checksum2 % 11 === 10) { - checksum2 = 0; - weight = 3; - for (var _i3 = 0; _i3 < 10; _i3++) { - checksum2 += digits[_i3] * weight; - weight += 1; - if (weight === 10) { - weight = 1; - } - } - if (checksum2 % 11 === 10) { - return digits[10] === 0; - } - } - return checksum2 % 11 === digits[10]; - } - function fiFiCheck(tin) { - var full_year = tin.slice(4, 6); - var century_symbol = tin.slice(6, 7); - switch (century_symbol) { - case "+": - full_year = "18".concat(full_year); - break; - case "-": - full_year = "19".concat(full_year); - break; - default: - full_year = "20".concat(full_year); - break; - } - var date = "".concat(full_year, "/").concat(tin.slice(2, 4), "/").concat(tin.slice(0, 2)); - if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - var checksum2 = parseInt(tin.slice(0, 6) + tin.slice(7, 10), 10) % 31; - if (checksum2 < 10) { - return checksum2 === parseInt(tin.slice(10), 10); - } - checksum2 -= 10; - var letters_lookup = ["A", "B", "C", "D", "E", "F", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y"]; - return letters_lookup[checksum2] === tin.slice(10); - } - function frBeCheck(tin) { - if (tin.slice(2, 4) !== "00" || tin.slice(4, 6) !== "00") { - var date = "".concat(tin.slice(0, 2), "/").concat(tin.slice(2, 4), "/").concat(tin.slice(4, 6)); - if (!(0, _isDate.default)(date, "YY/MM/DD")) { - return false; - } - } - var checksum2 = 97 - parseInt(tin.slice(0, 9), 10) % 97; - var checkdigits = parseInt(tin.slice(9, 11), 10); - if (checksum2 !== checkdigits) { - checksum2 = 97 - parseInt("2".concat(tin.slice(0, 9)), 10) % 97; - if (checksum2 !== checkdigits) { - return false; - } - } - return true; - } - function frFrCheck(tin) { - tin = tin.replace(/\s/g, ""); - var checksum2 = parseInt(tin.slice(0, 10), 10) % 511; - var checkdigits = parseInt(tin.slice(10, 13), 10); - return checksum2 === checkdigits; - } - function frLuCheck(tin) { - var date = "".concat(tin.slice(0, 4), "/").concat(tin.slice(4, 6), "/").concat(tin.slice(6, 8)); - if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - if (!algorithms2.luhnCheck(tin.slice(0, 12))) { - return false; - } - return algorithms2.verhoeffCheck("".concat(tin.slice(0, 11)).concat(tin[12])); - } - function hrHrCheck(tin) { - return algorithms2.iso7064Check(tin); - } - function huHuCheck(tin) { - var digits = tin.split("").map(function(a3) { - return parseInt(a3, 10); - }); - var checksum2 = 8; - for (var i3 = 1; i3 < 9; i3++) { - checksum2 += digits[i3] * (i3 + 1); - } - return checksum2 % 11 === digits[9]; - } - function itItNameCheck(name2) { - var vowelflag = false; - var xflag = false; - for (var i3 = 0; i3 < 3; i3++) { - if (!vowelflag && /[AEIOU]/.test(name2[i3])) { - vowelflag = true; - } else if (!xflag && vowelflag && name2[i3] === "X") { - xflag = true; - } else if (i3 > 0) { - if (vowelflag && !xflag) { - if (!/[AEIOU]/.test(name2[i3])) { - return false; - } - } - if (xflag) { - if (!/X/.test(name2[i3])) { - return false; - } - } - } - } - return true; - } - function itItCheck(tin) { - var chars = tin.toUpperCase().split(""); - if (!itItNameCheck(chars.slice(0, 3))) { - return false; - } - if (!itItNameCheck(chars.slice(3, 6))) { - return false; - } - var number_locations = [6, 7, 9, 10, 12, 13, 14]; - var number_replace = { - L: "0", - M: "1", - N: "2", - P: "3", - Q: "4", - R: "5", - S: "6", - T: "7", - U: "8", - V: "9" - }; - for (var _i4 = 0, _number_locations = number_locations; _i4 < _number_locations.length; _i4++) { - var i3 = _number_locations[_i4]; - if (chars[i3] in number_replace) { - chars.splice(i3, 1, number_replace[chars[i3]]); - } - } - var month_replace = { - A: "01", - B: "02", - C: "03", - D: "04", - E: "05", - H: "06", - L: "07", - M: "08", - P: "09", - R: "10", - S: "11", - T: "12" - }; - var month = month_replace[chars[8]]; - var day = parseInt(chars[9] + chars[10], 10); - if (day > 40) { - day -= 40; - } - if (day < 10) { - day = "0".concat(day); - } - var date = "".concat(chars[6]).concat(chars[7], "/").concat(month, "/").concat(day); - if (!(0, _isDate.default)(date, "YY/MM/DD")) { - return false; - } - var checksum2 = 0; - for (var _i5 = 1; _i5 < chars.length - 1; _i5 += 2) { - var char_to_int = parseInt(chars[_i5], 10); - if (isNaN(char_to_int)) { - char_to_int = chars[_i5].charCodeAt(0) - 65; - } - checksum2 += char_to_int; - } - var odd_convert = { - // Maps of characters at odd places - A: 1, - B: 0, - C: 5, - D: 7, - E: 9, - F: 13, - G: 15, - H: 17, - I: 19, - J: 21, - K: 2, - L: 4, - M: 18, - N: 20, - O: 11, - P: 3, - Q: 6, - R: 8, - S: 12, - T: 14, - U: 16, - V: 10, - W: 22, - X: 25, - Y: 24, - Z: 23, - 0: 1, - 1: 0 - }; - for (var _i6 = 0; _i6 < chars.length - 1; _i6 += 2) { - var _char_to_int = 0; - if (chars[_i6] in odd_convert) { - _char_to_int = odd_convert[chars[_i6]]; - } else { - var multiplier = parseInt(chars[_i6], 10); - _char_to_int = 2 * multiplier + 1; - if (multiplier > 4) { - _char_to_int += 2; - } - } - checksum2 += _char_to_int; - } - if (String.fromCharCode(65 + checksum2 % 26) !== chars[15]) { - return false; - } - return true; - } - function lvLvCheck(tin) { - tin = tin.replace(/\W/, ""); - var day = tin.slice(0, 2); - if (day !== "32") { - var month = tin.slice(2, 4); - if (month !== "00") { - var full_year = tin.slice(4, 6); - switch (tin[6]) { - case "0": - full_year = "18".concat(full_year); - break; - case "1": - full_year = "19".concat(full_year); - break; - default: - full_year = "20".concat(full_year); - break; - } - var date = "".concat(full_year, "/").concat(tin.slice(2, 4), "/").concat(day); - if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - } - var checksum2 = 1101; - var multip_lookup = [1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; - for (var i3 = 0; i3 < tin.length - 1; i3++) { - checksum2 -= parseInt(tin[i3], 10) * multip_lookup[i3]; - } - return parseInt(tin[10], 10) === checksum2 % 11; - } - return true; - } - function mtMtCheck(tin) { - if (tin.length !== 9) { - var chars = tin.toUpperCase().split(""); - while (chars.length < 8) { - chars.unshift(0); - } - switch (tin[7]) { - case "A": - case "P": - if (parseInt(chars[6], 10) === 0) { - return false; - } - break; - default: { - var first_part = parseInt(chars.join("").slice(0, 5), 10); - if (first_part > 32e3) { - return false; - } - var second_part = parseInt(chars.join("").slice(5, 7), 10); - if (first_part === second_part) { - return false; - } - } - } - } - return true; - } - function nlNlCheck(tin) { - return algorithms2.reverseMultiplyAndSum(tin.split("").slice(0, 8).map(function(a3) { - return parseInt(a3, 10); - }), 9) % 11 === parseInt(tin[8], 10); - } - function plPlCheck(tin) { - if (tin.length === 10) { - var lookup2 = [6, 5, 7, 2, 3, 4, 5, 6, 7]; - var _checksum2 = 0; - for (var i3 = 0; i3 < lookup2.length; i3++) { - _checksum2 += parseInt(tin[i3], 10) * lookup2[i3]; - } - _checksum2 %= 11; - if (_checksum2 === 10) { - return false; - } - return _checksum2 === parseInt(tin[9], 10); - } - var full_year = tin.slice(0, 2); - var month = parseInt(tin.slice(2, 4), 10); - if (month > 80) { - full_year = "18".concat(full_year); - month -= 80; - } else if (month > 60) { - full_year = "22".concat(full_year); - month -= 60; - } else if (month > 40) { - full_year = "21".concat(full_year); - month -= 40; - } else if (month > 20) { - full_year = "20".concat(full_year); - month -= 20; - } else { - full_year = "19".concat(full_year); - } - if (month < 10) { - month = "0".concat(month); - } - var date = "".concat(full_year, "/").concat(month, "/").concat(tin.slice(4, 6)); - if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - var checksum2 = 0; - var multiplier = 1; - for (var _i7 = 0; _i7 < tin.length - 1; _i7++) { - checksum2 += parseInt(tin[_i7], 10) * multiplier % 10; - multiplier += 2; - if (multiplier > 10) { - multiplier = 1; - } else if (multiplier === 5) { - multiplier += 2; - } - } - checksum2 = 10 - checksum2 % 10; - return checksum2 === parseInt(tin[10], 10); - } - function ptBrCheck(tin) { - if (tin.length === 11) { - var _sum; - var remainder; - _sum = 0; - if ( - // Reject known invalid CPFs - tin === "11111111111" || tin === "22222222222" || tin === "33333333333" || tin === "44444444444" || tin === "55555555555" || tin === "66666666666" || tin === "77777777777" || tin === "88888888888" || tin === "99999999999" || tin === "00000000000" - ) - return false; - for (var i3 = 1; i3 <= 9; i3++) - _sum += parseInt(tin.substring(i3 - 1, i3), 10) * (11 - i3); - remainder = _sum * 10 % 11; - if (remainder === 10) - remainder = 0; - if (remainder !== parseInt(tin.substring(9, 10), 10)) - return false; - _sum = 0; - for (var _i8 = 1; _i8 <= 10; _i8++) - _sum += parseInt(tin.substring(_i8 - 1, _i8), 10) * (12 - _i8); - remainder = _sum * 10 % 11; - if (remainder === 10) - remainder = 0; - if (remainder !== parseInt(tin.substring(10, 11), 10)) - return false; - return true; - } - if ( - // Reject know invalid CNPJs - tin === "00000000000000" || tin === "11111111111111" || tin === "22222222222222" || tin === "33333333333333" || tin === "44444444444444" || tin === "55555555555555" || tin === "66666666666666" || tin === "77777777777777" || tin === "88888888888888" || tin === "99999999999999" - ) { - return false; - } - var length = tin.length - 2; - var identifiers = tin.substring(0, length); - var verificators = tin.substring(length); - var sum = 0; - var pos = length - 7; - for (var _i9 = length; _i9 >= 1; _i9--) { - sum += identifiers.charAt(length - _i9) * pos; - pos -= 1; - if (pos < 2) { - pos = 9; - } - } - var result = sum % 11 < 2 ? 0 : 11 - sum % 11; - if (result !== parseInt(verificators.charAt(0), 10)) { - return false; - } - length += 1; - identifiers = tin.substring(0, length); - sum = 0; - pos = length - 7; - for (var _i10 = length; _i10 >= 1; _i10--) { - sum += identifiers.charAt(length - _i10) * pos; - pos -= 1; - if (pos < 2) { - pos = 9; - } - } - result = sum % 11 < 2 ? 0 : 11 - sum % 11; - if (result !== parseInt(verificators.charAt(1), 10)) { - return false; - } - return true; - } - function ptPtCheck(tin) { - var checksum2 = 11 - algorithms2.reverseMultiplyAndSum(tin.split("").slice(0, 8).map(function(a3) { - return parseInt(a3, 10); - }), 9) % 11; - if (checksum2 > 9) { - return parseInt(tin[8], 10) === 0; - } - return checksum2 === parseInt(tin[8], 10); - } - function roRoCheck(tin) { - if (tin.slice(0, 4) !== "9000") { - var full_year = tin.slice(1, 3); - switch (tin[0]) { - case "1": - case "2": - full_year = "19".concat(full_year); - break; - case "3": - case "4": - full_year = "18".concat(full_year); - break; - case "5": - case "6": - full_year = "20".concat(full_year); - break; - } - var date = "".concat(full_year, "/").concat(tin.slice(3, 5), "/").concat(tin.slice(5, 7)); - if (date.length === 8) { - if (!(0, _isDate.default)(date, "YY/MM/DD")) { - return false; - } - } else if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - var digits = tin.split("").map(function(a3) { - return parseInt(a3, 10); - }); - var multipliers = [2, 7, 9, 1, 4, 6, 3, 5, 8, 2, 7, 9]; - var checksum2 = 0; - for (var i3 = 0; i3 < multipliers.length; i3++) { - checksum2 += digits[i3] * multipliers[i3]; - } - if (checksum2 % 11 === 10) { - return digits[12] === 1; - } - return digits[12] === checksum2 % 11; - } - return true; - } - function skSkCheck(tin) { - if (tin.length === 9) { - tin = tin.replace(/\W/, ""); - if (tin.slice(6) === "000") { - return false; - } - var full_year = parseInt(tin.slice(0, 2), 10); - if (full_year > 53) { - return false; - } - if (full_year < 10) { - full_year = "190".concat(full_year); - } else { - full_year = "19".concat(full_year); - } - var month = parseInt(tin.slice(2, 4), 10); - if (month > 50) { - month -= 50; - } - if (month < 10) { - month = "0".concat(month); - } - var date = "".concat(full_year, "/").concat(month, "/").concat(tin.slice(4, 6)); - if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - } - return true; - } - function slSiCheck(tin) { - var checksum2 = 11 - algorithms2.reverseMultiplyAndSum(tin.split("").slice(0, 7).map(function(a3) { - return parseInt(a3, 10); - }), 8) % 11; - if (checksum2 === 10) { - return parseInt(tin[7], 10) === 0; - } - return checksum2 === parseInt(tin[7], 10); - } - function svSeCheck(tin) { - var tin_copy = tin.slice(0); - if (tin.length > 11) { - tin_copy = tin_copy.slice(2); - } - var full_year = ""; - var month = tin_copy.slice(2, 4); - var day = parseInt(tin_copy.slice(4, 6), 10); - if (tin.length > 11) { - full_year = tin.slice(0, 4); - } else { - full_year = tin.slice(0, 2); - if (tin.length === 11 && day < 60) { - var current_year = (/* @__PURE__ */ new Date()).getFullYear().toString(); - var current_century = parseInt(current_year.slice(0, 2), 10); - current_year = parseInt(current_year, 10); - if (tin[6] === "-") { - if (parseInt("".concat(current_century).concat(full_year), 10) > current_year) { - full_year = "".concat(current_century - 1).concat(full_year); - } else { - full_year = "".concat(current_century).concat(full_year); - } - } else { - full_year = "".concat(current_century - 1).concat(full_year); - if (current_year - parseInt(full_year, 10) < 100) { - return false; - } - } - } - } - if (day > 60) { - day -= 60; - } - if (day < 10) { - day = "0".concat(day); - } - var date = "".concat(full_year, "/").concat(month, "/").concat(day); - if (date.length === 8) { - if (!(0, _isDate.default)(date, "YY/MM/DD")) { - return false; - } - } else if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { - return false; - } - return algorithms2.luhnCheck(tin.replace(/\W/, "")); - } - function ukUaCheck(tin) { - var digits = tin.split("").map(function(a3) { - return parseInt(a3, 10); - }); - var multipliers = [-1, 5, 7, 9, 4, 6, 10, 5, 7]; - var checksum2 = 0; - for (var i3 = 0; i3 < multipliers.length; i3++) { - checksum2 += digits[i3] * multipliers[i3]; - } - return checksum2 % 11 === 10 ? digits[9] === 0 : digits[9] === checksum2 % 11; - } - var taxIdFormat = { - "bg-BG": /^\d{10}$/, - "cs-CZ": /^\d{6}\/{0,1}\d{3,4}$/, - "de-AT": /^\d{9}$/, - "de-DE": /^[1-9]\d{10}$/, - "dk-DK": /^\d{6}-{0,1}\d{4}$/, - "el-CY": /^[09]\d{7}[A-Z]$/, - "el-GR": /^([0-4]|[7-9])\d{8}$/, - "en-CA": /^\d{9}$/, - "en-GB": /^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i, - "en-IE": /^\d{7}[A-W][A-IW]{0,1}$/i, - "en-US": /^\d{2}[- ]{0,1}\d{7}$/, - "es-AR": /(20|23|24|27|30|33|34)[0-9]{8}[0-9]/, - "es-ES": /^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i, - "et-EE": /^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/, - "fi-FI": /^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i, - "fr-BE": /^\d{11}$/, - "fr-FR": /^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/, - // Conforms both to official spec and provided example - "fr-LU": /^\d{13}$/, - "hr-HR": /^\d{11}$/, - "hu-HU": /^8\d{9}$/, - "it-IT": /^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i, - "lv-LV": /^\d{6}-{0,1}\d{5}$/, - // Conforms both to DG TAXUD spec and original research - "mt-MT": /^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i, - "nl-NL": /^\d{9}$/, - "pl-PL": /^\d{10,11}$/, - "pt-BR": /(?:^\d{11}$)|(?:^\d{14}$)/, - "pt-PT": /^\d{9}$/, - "ro-RO": /^\d{13}$/, - "sk-SK": /^\d{6}\/{0,1}\d{3,4}$/, - "sl-SI": /^[1-9]\d{7}$/, - "sv-SE": /^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/, - "uk-UA": /^\d{10}$/ - }; - taxIdFormat["lb-LU"] = taxIdFormat["fr-LU"]; - taxIdFormat["lt-LT"] = taxIdFormat["et-EE"]; - taxIdFormat["nl-BE"] = taxIdFormat["fr-BE"]; - taxIdFormat["fr-CA"] = taxIdFormat["en-CA"]; - var taxIdCheck = { - "bg-BG": bgBgCheck, - "cs-CZ": csCzCheck, - "de-AT": deAtCheck, - "de-DE": deDeCheck, - "dk-DK": dkDkCheck, - "el-CY": elCyCheck, - "el-GR": elGrCheck, - "en-CA": isCanadianSIN, - "en-IE": enIeCheck, - "en-US": enUsCheck, - "es-AR": esArCheck, - "es-ES": esEsCheck, - "et-EE": etEeCheck, - "fi-FI": fiFiCheck, - "fr-BE": frBeCheck, - "fr-FR": frFrCheck, - "fr-LU": frLuCheck, - "hr-HR": hrHrCheck, - "hu-HU": huHuCheck, - "it-IT": itItCheck, - "lv-LV": lvLvCheck, - "mt-MT": mtMtCheck, - "nl-NL": nlNlCheck, - "pl-PL": plPlCheck, - "pt-BR": ptBrCheck, - "pt-PT": ptPtCheck, - "ro-RO": roRoCheck, - "sk-SK": skSkCheck, - "sl-SI": slSiCheck, - "sv-SE": svSeCheck, - "uk-UA": ukUaCheck - }; - taxIdCheck["lb-LU"] = taxIdCheck["fr-LU"]; - taxIdCheck["lt-LT"] = taxIdCheck["et-EE"]; - taxIdCheck["nl-BE"] = taxIdCheck["fr-BE"]; - taxIdCheck["fr-CA"] = taxIdCheck["en-CA"]; - var allsymbols = /[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g; - var sanitizeRegexes = { - "de-AT": allsymbols, - "de-DE": /[\/\\]/g, - "fr-BE": allsymbols - }; - sanitizeRegexes["nl-BE"] = sanitizeRegexes["fr-BE"]; - function isTaxID2(str) { - var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en-US"; - (0, _assertString2.default)(str); - var strcopy = str.slice(0); - if (locale in taxIdFormat) { - if (locale in sanitizeRegexes) { - strcopy = strcopy.replace(sanitizeRegexes[locale], ""); - } - if (!taxIdFormat[locale].test(strcopy)) { - return false; - } - if (locale in taxIdCheck) { - return taxIdCheck[locale](strcopy); - } - return true; - } - throw new Error("Invalid locale '".concat(locale, "'")); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isTaxID, isTaxID.exports); -var isTaxIDExports = isTaxID.exports; -var isMobilePhone$1 = {}; -Object.defineProperty(isMobilePhone$1, "__esModule", { - value: true -}); -isMobilePhone$1.default = isMobilePhone; -isMobilePhone$1.locales = void 0; -var _assertString$4 = _interopRequireDefault$4(assertStringExports); -function _interopRequireDefault$4(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -var phones = { - "am-AM": /^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/, - "ar-AE": /^((\+?971)|0)?5[024568]\d{7}$/, - "ar-BH": /^(\+?973)?(3|6)\d{7}$/, - "ar-DZ": /^(\+?213|0)(5|6|7)\d{8}$/, - "ar-LB": /^(\+?961)?((3|81)\d{6}|7\d{7})$/, - "ar-EG": /^((\+?20)|0)?1[0125]\d{8}$/, - "ar-IQ": /^(\+?964|0)?7[0-9]\d{8}$/, - "ar-JO": /^(\+?962|0)?7[789]\d{7}$/, - "ar-KW": /^(\+?965)([569]\d{7}|41\d{6})$/, - "ar-LY": /^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/, - "ar-MA": /^(?:(?:\+|00)212|0)[5-7]\d{8}$/, - "ar-OM": /^((\+|00)968)?(9[1-9])\d{6}$/, - "ar-PS": /^(\+?970|0)5[6|9](\d{7})$/, - "ar-SA": /^(!?(\+?966)|0)?5\d{8}$/, - "ar-SD": /^((\+?249)|0)?(9[012369]|1[012])\d{7}$/, - "ar-SY": /^(!?(\+?963)|0)?9\d{8}$/, - "ar-TN": /^(\+?216)?[2459]\d{7}$/, - "az-AZ": /^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/, - "bs-BA": /^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/, - "be-BY": /^(\+?375)?(24|25|29|33|44)\d{7}$/, - "bg-BG": /^(\+?359|0)?8[789]\d{7}$/, - "bn-BD": /^(\+?880|0)1[13456789][0-9]{8}$/, - "ca-AD": /^(\+376)?[346]\d{5}$/, - "cs-CZ": /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/, - "da-DK": /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/, - "de-DE": /^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/, - "de-AT": /^(\+43|0)\d{1,4}\d{3,12}$/, - "de-CH": /^(\+41|0)([1-9])\d{1,9}$/, - "de-LU": /^(\+352)?((6\d1)\d{6})$/, - "dv-MV": /^(\+?960)?(7[2-9]|9[1-9])\d{5}$/, - "el-GR": /^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/, - "el-CY": /^(\+?357?)?(9(9|6)\d{6})$/, - "en-AI": /^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/, - "en-AU": /^(\+?61|0)4\d{8}$/, - "en-AG": /^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/, - "en-BM": /^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/, - "en-BS": /^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/, - "en-GB": /^(\+?44|0)7\d{9}$/, - "en-GG": /^(\+?44|0)1481\d{6}$/, - "en-GH": /^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/, - "en-GY": /^(\+592|0)6\d{6}$/, - "en-HK": /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/, - "en-MO": /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/, - "en-IE": /^(\+?353|0)8[356789]\d{7}$/, - "en-IN": /^(\+?91|0)?[6789]\d{9}$/, - "en-JM": /^(\+?876)?\d{7}$/, - "en-KE": /^(\+?254|0)(7|1)\d{8}$/, - "fr-CF": /^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/, - "en-SS": /^(\+?211|0)(9[1257])\d{7}$/, - "en-KI": /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/, - "en-KN": /^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/, - "en-LS": /^(\+?266)(22|28|57|58|59|27|52)\d{6}$/, - "en-MT": /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/, - "en-MU": /^(\+?230|0)?\d{8}$/, - "en-MW": /^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/, - "en-NA": /^(\+?264|0)(6|8)\d{7}$/, - "en-NG": /^(\+?234|0)?[789]\d{9}$/, - "en-NZ": /^(\+?64|0)[28]\d{7,9}$/, - "en-PG": /^(\+?675|0)?(7\d|8[18])\d{6}$/, - "en-PK": /^((00|\+)?92|0)3[0-6]\d{8}$/, - "en-PH": /^(09|\+639)\d{9}$/, - "en-RW": /^(\+?250|0)?[7]\d{8}$/, - "en-SG": /^(\+65)?[3689]\d{7}$/, - "en-SL": /^(\+?232|0)\d{8}$/, - "en-TZ": /^(\+?255|0)?[67]\d{8}$/, - "en-UG": /^(\+?256|0)?[7]\d{8}$/, - "en-US": /^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/, - "en-ZA": /^(\+?27|0)\d{9}$/, - "en-ZM": /^(\+?26)?09[567]\d{7}$/, - "en-ZW": /^(\+263)[0-9]{9}$/, - "en-BW": /^(\+?267)?(7[1-8]{1})\d{6}$/, - "es-AR": /^\+?549(11|[2368]\d)\d{8}$/, - "es-BO": /^(\+?591)?(6|7)\d{7}$/, - "es-CO": /^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/, - "es-CL": /^(\+?56|0)[2-9]\d{1}\d{7}$/, - "es-CR": /^(\+506)?[2-8]\d{7}$/, - "es-CU": /^(\+53|0053)?5\d{7}$/, - "es-DO": /^(\+?1)?8[024]9\d{7}$/, - "es-HN": /^(\+?504)?[9|8|3|2]\d{7}$/, - "es-EC": /^(\+?593|0)([2-7]|9[2-9])\d{7}$/, - "es-ES": /^(\+?34)?[6|7]\d{8}$/, - "es-PE": /^(\+?51)?9\d{8}$/, - "es-MX": /^(\+?52)?(1|01)?\d{10,11}$/, - "es-NI": /^(\+?505)\d{7,8}$/, - "es-PA": /^(\+?507)\d{7,8}$/, - "es-PY": /^(\+?595|0)9[9876]\d{7}$/, - "es-SV": /^(\+?503)?[67]\d{7}$/, - "es-UY": /^(\+598|0)9[1-9][\d]{6}$/, - "es-VE": /^(\+?58)?(2|4)\d{9}$/, - "et-EE": /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/, - "fa-IR": /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/, - "fi-FI": /^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/, - "fj-FJ": /^(\+?679)?\s?\d{3}\s?\d{4}$/, - "fo-FO": /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/, - "fr-BF": /^(\+226|0)[67]\d{7}$/, - "fr-BJ": /^(\+229)\d{8}$/, - "fr-CD": /^(\+?243|0)?(8|9)\d{8}$/, - "fr-CM": /^(\+?237)6[0-9]{8}$/, - "fr-FR": /^(\+?33|0)[67]\d{8}$/, - "fr-GF": /^(\+?594|0|00594)[67]\d{8}$/, - "fr-GP": /^(\+?590|0|00590)[67]\d{8}$/, - "fr-MQ": /^(\+?596|0|00596)[67]\d{8}$/, - "fr-PF": /^(\+?689)?8[789]\d{6}$/, - "fr-RE": /^(\+?262|0|00262)[67]\d{8}$/, - "fr-WF": /^(\+681)?\d{6}$/, - "he-IL": /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/, - "hu-HU": /^(\+?36|06)(20|30|31|50|70)\d{7}$/, - "id-ID": /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/, - "ir-IR": /^(\+98|0)?9\d{9}$/, - "it-IT": /^(\+?39)?\s?3\d{2} ?\d{6,7}$/, - "it-SM": /^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/, - "ja-JP": /^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/, - "ka-GE": /^(\+?995)?(79\d{7}|5\d{8})$/, - "kk-KZ": /^(\+?7|8)?7\d{9}$/, - "kl-GL": /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/, - "ko-KR": /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/, - "ky-KG": /^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/, - "lt-LT": /^(\+370|8)\d{8}$/, - "lv-LV": /^(\+?371)2\d{7}$/, - "mg-MG": /^((\+?261|0)(2|3)\d)?\d{7}$/, - "mn-MN": /^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/, - "my-MM": /^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/, - "ms-MY": /^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/, - "mz-MZ": /^(\+?258)?8[234567]\d{7}$/, - "nb-NO": /^(\+?47)?[49]\d{7}$/, - "ne-NP": /^(\+?977)?9[78]\d{8}$/, - "nl-BE": /^(\+?32|0)4\d{8}$/, - "nl-NL": /^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/, - "nl-AW": /^(\+)?297(56|59|64|73|74|99)\d{5}$/, - "nn-NO": /^(\+?47)?[49]\d{7}$/, - "pl-PL": /^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/, - "pt-BR": /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/, - "pt-PT": /^(\+?351)?9[1236]\d{7}$/, - "pt-AO": /^(\+244)\d{9}$/, - "ro-MD": /^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/, - "ro-RO": /^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/, - "ru-RU": /^(\+?7|8)?9\d{9}$/, - "si-LK": /^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/, - "sl-SI": /^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/, - "sk-SK": /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/, - "so-SO": /^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/, - "sq-AL": /^(\+355|0)6[789]\d{6}$/, - "sr-RS": /^(\+3816|06)[- \d]{5,9}$/, - "sv-SE": /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/, - "tg-TJ": /^(\+?992)?[5][5]\d{7}$/, - "th-TH": /^(\+66|66|0)\d{9}$/, - "tr-TR": /^(\+?90|0)?5\d{9}$/, - "tk-TM": /^(\+993|993|8)\d{8}$/, - "uk-UA": /^(\+?38|8)?0\d{9}$/, - "uz-UZ": /^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/, - "vi-VN": /^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/, - "zh-CN": /^((\+|00)86)?(1[3-9]|9[28])\d{9}$/, - "zh-TW": /^(\+?886\-?|0)?9\d{8}$/, - "dz-BT": /^(\+?975|0)?(17|16|77|02)\d{6}$/, - "ar-YE": /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/, - "ar-EH": /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/, - "fa-AF": /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/ -}; -phones["en-CA"] = phones["en-US"]; -phones["fr-CA"] = phones["en-CA"]; -phones["fr-BE"] = phones["nl-BE"]; -phones["zh-HK"] = phones["en-HK"]; -phones["zh-MO"] = phones["en-MO"]; -phones["ga-IE"] = phones["en-IE"]; -phones["fr-CH"] = phones["de-CH"]; -phones["it-CH"] = phones["fr-CH"]; -function isMobilePhone(str, locale, options) { - (0, _assertString$4.default)(str); - if (options && options.strictMode && !str.startsWith("+")) { - return false; - } - if (Array.isArray(locale)) { - return locale.some(function(key3) { - if (phones.hasOwnProperty(key3)) { - var phone2 = phones[key3]; - if (phone2.test(str)) { - return true; - } - } - return false; - }); - } else if (locale in phones) { - return phones[locale].test(str); - } else if (!locale || locale === "any") { - for (var key2 in phones) { - if (phones.hasOwnProperty(key2)) { - var phone = phones[key2]; - if (phone.test(str)) { - return true; - } - } - } - return false; - } - throw new Error("Invalid locale '".concat(locale, "'")); -} -isMobilePhone$1.locales = Object.keys(phones); -var isEthereumAddress = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isEthereumAddress2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var eth = /^(0x)[0-9a-f]{40}$/i; - function isEthereumAddress2(str) { - (0, _assertString2.default)(str); - return eth.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isEthereumAddress, isEthereumAddress.exports); -var isEthereumAddressExports = isEthereumAddress.exports; -var isCurrency = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isCurrency2; - var _merge = _interopRequireDefault2(mergeExports); - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function currencyRegex(options) { - var decimal_digits = "\\d{".concat(options.digits_after_decimal[0], "}"); - options.digits_after_decimal.forEach(function(digit, index2) { - if (index2 !== 0) - decimal_digits = "".concat(decimal_digits, "|\\d{").concat(digit, "}"); - }); - var symbol = "(".concat(options.symbol.replace(/\W/, function(m3) { - return "\\".concat(m3); - }), ")").concat(options.require_symbol ? "" : "?"), negative = "-?", whole_dollar_amount_without_sep = "[1-9]\\d*", whole_dollar_amount_with_sep = "[1-9]\\d{0,2}(\\".concat(options.thousands_separator, "\\d{3})*"), valid_whole_dollar_amounts = ["0", whole_dollar_amount_without_sep, whole_dollar_amount_with_sep], whole_dollar_amount = "(".concat(valid_whole_dollar_amounts.join("|"), ")?"), decimal_amount = "(\\".concat(options.decimal_separator, "(").concat(decimal_digits, "))").concat(options.require_decimal ? "" : "?"); - var pattern = whole_dollar_amount + (options.allow_decimal || options.require_decimal ? decimal_amount : ""); - if (options.allow_negatives && !options.parens_for_negatives) { - if (options.negative_sign_after_digits) { - pattern += negative; - } else if (options.negative_sign_before_digits) { - pattern = negative + pattern; - } - } - if (options.allow_negative_sign_placeholder) { - pattern = "( (?!\\-))?".concat(pattern); - } else if (options.allow_space_after_symbol) { - pattern = " ?".concat(pattern); - } else if (options.allow_space_after_digits) { - pattern += "( (?!$))?"; - } - if (options.symbol_after_digits) { - pattern += symbol; - } else { - pattern = symbol + pattern; - } - if (options.allow_negatives) { - if (options.parens_for_negatives) { - pattern = "(\\(".concat(pattern, "\\)|").concat(pattern, ")"); - } else if (!(options.negative_sign_before_digits || options.negative_sign_after_digits)) { - pattern = negative + pattern; - } - } - return new RegExp("^(?!-? )(?=.*\\d)".concat(pattern, "$")); - } - var default_currency_options = { - symbol: "$", - require_symbol: false, - allow_space_after_symbol: false, - symbol_after_digits: false, - allow_negatives: true, - parens_for_negatives: false, - negative_sign_before_digits: false, - negative_sign_after_digits: false, - allow_negative_sign_placeholder: false, - thousands_separator: ",", - decimal_separator: ".", - allow_decimal: true, - require_decimal: false, - digits_after_decimal: [2], - allow_space_after_digits: false - }; - function isCurrency2(str, options) { - (0, _assertString2.default)(str); - options = (0, _merge.default)(options, default_currency_options); - return currencyRegex(options).test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isCurrency, isCurrency.exports); -var isCurrencyExports = isCurrency.exports; -var isBtcAddress = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isBtcAddress2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var bech32 = /^(bc1)[a-z0-9]{25,39}$/; - var base582 = /^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/; - function isBtcAddress2(str) { - (0, _assertString2.default)(str); - return bech32.test(str) || base582.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isBtcAddress, isBtcAddress.exports); -var isBtcAddressExports = isBtcAddress.exports; -var isISO6346$1 = {}; -Object.defineProperty(isISO6346$1, "__esModule", { - value: true -}); -isISO6346$1.isFreightContainerID = void 0; -isISO6346$1.isISO6346 = isISO6346; -var _assertString$3 = _interopRequireDefault$3(assertStringExports); -function _interopRequireDefault$3(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -var isISO6346Str = /^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/; -var isDigit = /^[0-9]$/; -function isISO6346(str) { - (0, _assertString$3.default)(str); - str = str.toUpperCase(); - if (!isISO6346Str.test(str)) - return false; - if (str.length === 11) { - var sum = 0; - for (var i3 = 0; i3 < str.length - 1; i3++) { - if (!isDigit.test(str[i3])) { - var convertedCode = void 0; - var letterCode = str.charCodeAt(i3) - 55; - if (letterCode < 11) - convertedCode = letterCode; - else if (letterCode >= 11 && letterCode <= 20) - convertedCode = 12 + letterCode % 11; - else if (letterCode >= 21 && letterCode <= 30) - convertedCode = 23 + letterCode % 21; - else - convertedCode = 34 + letterCode % 31; - sum += convertedCode * Math.pow(2, i3); - } else - sum += str[i3] * Math.pow(2, i3); - } - var checkSumDigit = sum % 11; - return Number(str[str.length - 1]) === checkSumDigit; - } - return true; -} -isISO6346$1.isFreightContainerID = isISO6346; -var isISO6391 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isISO63912; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var isISO6391Set = /* @__PURE__ */ new Set(["aa", "ab", "ae", "af", "ak", "am", "an", "ar", "as", "av", "ay", "az", "az", "ba", "be", "bg", "bh", "bi", "bm", "bn", "bo", "br", "bs", "ca", "ce", "ch", "co", "cr", "cs", "cu", "cv", "cy", "da", "de", "dv", "dz", "ee", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fj", "fo", "fr", "fy", "ga", "gd", "gl", "gn", "gu", "gv", "ha", "he", "hi", "ho", "hr", "ht", "hu", "hy", "hz", "ia", "id", "ie", "ig", "ii", "ik", "io", "is", "it", "iu", "ja", "jv", "ka", "kg", "ki", "kj", "kk", "kl", "km", "kn", "ko", "kr", "ks", "ku", "kv", "kw", "ky", "la", "lb", "lg", "li", "ln", "lo", "lt", "lu", "lv", "mg", "mh", "mi", "mk", "ml", "mn", "mr", "ms", "mt", "my", "na", "nb", "nd", "ne", "ng", "nl", "nn", "no", "nr", "nv", "ny", "oc", "oj", "om", "or", "os", "pa", "pi", "pl", "ps", "pt", "qu", "rm", "rn", "ro", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm", "sn", "so", "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", "tg", "th", "ti", "tk", "tl", "tn", "to", "tr", "ts", "tt", "tw", "ty", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "wo", "xh", "yi", "yo", "za", "zh", "zu"]); - function isISO63912(str) { - (0, _assertString2.default)(str); - return isISO6391Set.has(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isISO6391, isISO6391.exports); -var isISO6391Exports = isISO6391.exports; -var isISO8601 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isISO86012; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var iso8601 = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; - var iso8601StrictSeparator = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; - var isValidDate = function isValidDate2(str) { - var ordinalMatch = str.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/); - if (ordinalMatch) { - var oYear = Number(ordinalMatch[1]); - var oDay = Number(ordinalMatch[2]); - if (oYear % 4 === 0 && oYear % 100 !== 0 || oYear % 400 === 0) - return oDay <= 366; - return oDay <= 365; - } - var match = str.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number); - var year = match[1]; - var month = match[2]; - var day = match[3]; - var monthString = month ? "0".concat(month).slice(-2) : month; - var dayString = day ? "0".concat(day).slice(-2) : day; - var d4 = new Date("".concat(year, "-").concat(monthString || "01", "-").concat(dayString || "01")); - if (month && day) { - return d4.getUTCFullYear() === year && d4.getUTCMonth() + 1 === month && d4.getUTCDate() === day; - } - return true; - }; - function isISO86012(str) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - (0, _assertString2.default)(str); - var check = options.strictSeparator ? iso8601StrictSeparator.test(str) : iso8601.test(str); - if (check && options.strict) - return isValidDate(str); - return check; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isISO8601, isISO8601.exports); -var isISO8601Exports = isISO8601.exports; -var isRFC3339 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isRFC33392; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var dateFullYear = /[0-9]{4}/; - var dateMonth = /(0[1-9]|1[0-2])/; - var dateMDay = /([12]\d|0[1-9]|3[01])/; - var timeHour = /([01][0-9]|2[0-3])/; - var timeMinute = /[0-5][0-9]/; - var timeSecond = /([0-5][0-9]|60)/; - var timeSecFrac = /(\.[0-9]+)?/; - var timeNumOffset = new RegExp("[-+]".concat(timeHour.source, ":").concat(timeMinute.source)); - var timeOffset = new RegExp("([zZ]|".concat(timeNumOffset.source, ")")); - var partialTime = new RegExp("".concat(timeHour.source, ":").concat(timeMinute.source, ":").concat(timeSecond.source).concat(timeSecFrac.source)); - var fullDate = new RegExp("".concat(dateFullYear.source, "-").concat(dateMonth.source, "-").concat(dateMDay.source)); - var fullTime = new RegExp("".concat(partialTime.source).concat(timeOffset.source)); - var rfc3339 = new RegExp("^".concat(fullDate.source, "[ tT]").concat(fullTime.source, "$")); - function isRFC33392(str) { - (0, _assertString2.default)(str); - return rfc3339.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isRFC3339, isRFC3339.exports); -var isRFC3339Exports = isRFC3339.exports; -var isISO31661Alpha3 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isISO31661Alpha32; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var validISO31661Alpha3CountriesCodes = /* @__PURE__ */ new Set(["AFG", "ALA", "ALB", "DZA", "ASM", "AND", "AGO", "AIA", "ATA", "ATG", "ARG", "ARM", "ABW", "AUS", "AUT", "AZE", "BHS", "BHR", "BGD", "BRB", "BLR", "BEL", "BLZ", "BEN", "BMU", "BTN", "BOL", "BES", "BIH", "BWA", "BVT", "BRA", "IOT", "BRN", "BGR", "BFA", "BDI", "KHM", "CMR", "CAN", "CPV", "CYM", "CAF", "TCD", "CHL", "CHN", "CXR", "CCK", "COL", "COM", "COG", "COD", "COK", "CRI", "CIV", "HRV", "CUB", "CUW", "CYP", "CZE", "DNK", "DJI", "DMA", "DOM", "ECU", "EGY", "SLV", "GNQ", "ERI", "EST", "ETH", "FLK", "FRO", "FJI", "FIN", "FRA", "GUF", "PYF", "ATF", "GAB", "GMB", "GEO", "DEU", "GHA", "GIB", "GRC", "GRL", "GRD", "GLP", "GUM", "GTM", "GGY", "GIN", "GNB", "GUY", "HTI", "HMD", "VAT", "HND", "HKG", "HUN", "ISL", "IND", "IDN", "IRN", "IRQ", "IRL", "IMN", "ISR", "ITA", "JAM", "JPN", "JEY", "JOR", "KAZ", "KEN", "KIR", "PRK", "KOR", "KWT", "KGZ", "LAO", "LVA", "LBN", "LSO", "LBR", "LBY", "LIE", "LTU", "LUX", "MAC", "MKD", "MDG", "MWI", "MYS", "MDV", "MLI", "MLT", "MHL", "MTQ", "MRT", "MUS", "MYT", "MEX", "FSM", "MDA", "MCO", "MNG", "MNE", "MSR", "MAR", "MOZ", "MMR", "NAM", "NRU", "NPL", "NLD", "NCL", "NZL", "NIC", "NER", "NGA", "NIU", "NFK", "MNP", "NOR", "OMN", "PAK", "PLW", "PSE", "PAN", "PNG", "PRY", "PER", "PHL", "PCN", "POL", "PRT", "PRI", "QAT", "REU", "ROU", "RUS", "RWA", "BLM", "SHN", "KNA", "LCA", "MAF", "SPM", "VCT", "WSM", "SMR", "STP", "SAU", "SEN", "SRB", "SYC", "SLE", "SGP", "SXM", "SVK", "SVN", "SLB", "SOM", "ZAF", "SGS", "SSD", "ESP", "LKA", "SDN", "SUR", "SJM", "SWZ", "SWE", "CHE", "SYR", "TWN", "TJK", "TZA", "THA", "TLS", "TGO", "TKL", "TON", "TTO", "TUN", "TUR", "TKM", "TCA", "TUV", "UGA", "UKR", "ARE", "GBR", "USA", "UMI", "URY", "UZB", "VUT", "VEN", "VNM", "VGB", "VIR", "WLF", "ESH", "YEM", "ZMB", "ZWE"]); - function isISO31661Alpha32(str) { - (0, _assertString2.default)(str); - return validISO31661Alpha3CountriesCodes.has(str.toUpperCase()); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isISO31661Alpha3, isISO31661Alpha3.exports); -var isISO31661Alpha3Exports = isISO31661Alpha3.exports; -var isISO4217$1 = {}; -Object.defineProperty(isISO4217$1, "__esModule", { - value: true -}); -isISO4217$1.CurrencyCodes = void 0; -isISO4217$1.default = isISO4217; -var _assertString$2 = _interopRequireDefault$2(assertStringExports); -function _interopRequireDefault$2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -var validISO4217CurrencyCodes = /* @__PURE__ */ new Set(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLE", "SLL", "SOS", "SRD", "SSP", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", "YER", "ZAR", "ZMW", "ZWL"]); -function isISO4217(str) { - (0, _assertString$2.default)(str); - return validISO4217CurrencyCodes.has(str.toUpperCase()); -} -isISO4217$1.CurrencyCodes = validISO4217CurrencyCodes; -var isBase32 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isBase322; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var base322 = /^[A-Z2-7]+=*$/; - var crockfordBase32 = /^[A-HJKMNP-TV-Z0-9]+$/; - var defaultBase32Options = { - crockford: false - }; - function isBase322(str, options) { - (0, _assertString2.default)(str); - options = (0, _merge.default)(options, defaultBase32Options); - if (options.crockford) { - return crockfordBase32.test(str); - } - var len = str.length; - if (len % 8 === 0 && base322.test(str)) { - return true; - } - return false; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isBase32, isBase32.exports); -var isBase32Exports = isBase32.exports; -var isBase58 = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isBase582; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var base58Reg = /^[A-HJ-NP-Za-km-z1-9]*$/; - function isBase582(str) { - (0, _assertString2.default)(str); - if (base58Reg.test(str)) { - return true; - } - return false; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isBase58, isBase58.exports); -var isBase58Exports = isBase58.exports; -var isDataURI = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isDataURI2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var validMediaType = /^[a-z]+\/[a-z0-9\-\+\._]+$/i; - var validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i; - var validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i; - function isDataURI2(str) { - (0, _assertString2.default)(str); - var data = str.split(","); - if (data.length < 2) { - return false; - } - var attributes = data.shift().trim().split(";"); - var schemeAndMediaType = attributes.shift(); - if (schemeAndMediaType.slice(0, 5) !== "data:") { - return false; - } - var mediaType = schemeAndMediaType.slice(5); - if (mediaType !== "" && !validMediaType.test(mediaType)) { - return false; - } - for (var i3 = 0; i3 < attributes.length; i3++) { - if (!(i3 === attributes.length - 1 && attributes[i3].toLowerCase() === "base64") && !validAttribute.test(attributes[i3])) { - return false; - } - } - for (var _i3 = 0; _i3 < data.length; _i3++) { - if (!validData.test(data[_i3])) { - return false; - } - } - return true; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isDataURI, isDataURI.exports); -var isDataURIExports = isDataURI.exports; -var isMagnetURI = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isMagnetURI2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var magnetURIComponent = /(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i; - function isMagnetURI2(url) { - (0, _assertString2.default)(url); - if (url.indexOf("magnet:?") !== 0) { - return false; - } - return magnetURIComponent.test(url); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isMagnetURI, isMagnetURI.exports); -var isMagnetURIExports = isMagnetURI.exports; -var isMailtoURI = { exports: {} }; -var trim$1 = { exports: {} }; -var rtrim = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = rtrim2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function rtrim2(str, chars) { - (0, _assertString2.default)(str); - if (chars) { - var pattern = new RegExp("[".concat(chars.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "]+$"), "g"); - return str.replace(pattern, ""); - } - var strIndex = str.length - 1; - while (/\s/.test(str.charAt(strIndex))) { - strIndex -= 1; - } - return str.slice(0, strIndex + 1); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(rtrim, rtrim.exports); -var rtrimExports = rtrim.exports; -var ltrim = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = ltrim2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function ltrim2(str, chars) { - (0, _assertString2.default)(str); - var pattern = chars ? new RegExp("^[".concat(chars.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "]+"), "g") : /^\s+/g; - return str.replace(pattern, ""); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(ltrim, ltrim.exports); -var ltrimExports = ltrim.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = trim2; - var _rtrim = _interopRequireDefault2(rtrimExports); - var _ltrim = _interopRequireDefault2(ltrimExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function trim2(str, chars) { - return (0, _rtrim.default)((0, _ltrim.default)(str, chars), chars); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(trim$1, trim$1.exports); -var trimExports = trim$1.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isMailtoURI2; - var _trim = _interopRequireDefault2(trimExports); - var _isEmail = _interopRequireDefault2(isEmailExports); - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _slicedToArray(arr, i3) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i3) || _unsupportedIterableToArray(arr, i3) || _nonIterableRest(); - } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _iterableToArrayLimit(r2, l2) { - var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"]; - if (null != t2) { - var e18, n4, i3, u2, a3 = [], f3 = true, o2 = false; - try { - if (i3 = (t2 = t2.call(r2)).next, 0 === l2) { - if (Object(t2) !== t2) - return; - f3 = false; - } else - for (; !(f3 = (e18 = i3.call(t2)).done) && (a3.push(e18.value), a3.length !== l2); f3 = true) - ; - } catch (r3) { - o2 = true, n4 = r3; - } finally { - try { - if (!f3 && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) - return; - } finally { - if (o2) - throw n4; - } - } - return a3; - } - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) - return arr; - } - function _createForOfIteratorHelper(o2, allowArrayLike) { - var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"]; - if (!it2) { - if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray(o2)) || allowArrayLike && o2 && typeof o2.length === "number") { - if (it2) - o2 = it2; - var i3 = 0; - var F2 = function F3() { - }; - return { s: F2, n: function n4() { - if (i3 >= o2.length) - return { done: true }; - return { done: false, value: o2[i3++] }; - }, e: function e18(_e3) { - throw _e3; - }, f: F2 }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var normalCompletion = true, didErr = false, err; - return { s: function s2() { - it2 = it2.call(o2); - }, n: function n4() { - var step = it2.next(); - normalCompletion = step.done; - return step; - }, e: function e18(_e22) { - didErr = true; - err = _e22; - }, f: function f3() { - try { - if (!normalCompletion && it2.return != null) - it2.return(); - } finally { - if (didErr) - throw err; - } - } }; - } - function _unsupportedIterableToArray(o2, minLen) { - if (!o2) - return; - if (typeof o2 === "string") - return _arrayLikeToArray(o2, minLen); - var n4 = Object.prototype.toString.call(o2).slice(8, -1); - if (n4 === "Object" && o2.constructor) - n4 = o2.constructor.name; - if (n4 === "Map" || n4 === "Set") - return Array.from(o2); - if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4)) - return _arrayLikeToArray(o2, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i3 = 0, arr2 = new Array(len); i3 < len; i3++) - arr2[i3] = arr[i3]; - return arr2; - } - function parseMailtoQueryString(queryString2) { - var allowedParams = /* @__PURE__ */ new Set(["subject", "body", "cc", "bcc"]), query = { - cc: "", - bcc: "" - }; - var isParseFailed = false; - var queryParams = queryString2.split("&"); - if (queryParams.length > 4) { - return false; - } - var _iterator = _createForOfIteratorHelper(queryParams), _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done; ) { - var q2 = _step.value; - var _q$split = q2.split("="), _q$split2 = _slicedToArray(_q$split, 2), key2 = _q$split2[0], value = _q$split2[1]; - if (key2 && !allowedParams.has(key2)) { - isParseFailed = true; - break; - } - if (value && (key2 === "cc" || key2 === "bcc")) { - query[key2] = value; - } - if (key2) { - allowedParams.delete(key2); - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - return isParseFailed ? false : query; - } - function isMailtoURI2(url, options) { - (0, _assertString2.default)(url); - if (url.indexOf("mailto:") !== 0) { - return false; - } - var _url$replace$split = url.replace("mailto:", "").split("?"), _url$replace$split2 = _slicedToArray(_url$replace$split, 2), to2 = _url$replace$split2[0], _url$replace$split2$ = _url$replace$split2[1], queryString2 = _url$replace$split2$ === void 0 ? "" : _url$replace$split2$; - if (!to2 && !queryString2) { - return true; - } - var query = parseMailtoQueryString(queryString2); - if (!query) { - return false; - } - return "".concat(to2, ",").concat(query.cc, ",").concat(query.bcc).split(",").every(function(email) { - email = (0, _trim.default)(email, " "); - if (email) { - return (0, _isEmail.default)(email, options); - } - return true; - }); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isMailtoURI, isMailtoURI.exports); -var isMailtoURIExports = isMailtoURI.exports; -var isMimeType = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isMimeType2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var mimeTypeSimple = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i; - var mimeTypeText = /^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i; - var mimeTypeMultipart = /^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i; - function isMimeType2(str) { - (0, _assertString2.default)(str); - return mimeTypeSimple.test(str) || mimeTypeText.test(str) || mimeTypeMultipart.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isMimeType, isMimeType.exports); -var isMimeTypeExports = isMimeType.exports; -var isLatLong = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isLatLong2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var lat = /^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/; - var long = /^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/; - var latDMS = /^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i; - var longDMS = /^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i; - var defaultLatLongOptions = { - checkDMS: false - }; - function isLatLong2(str, options) { - (0, _assertString2.default)(str); - options = (0, _merge.default)(options, defaultLatLongOptions); - if (!str.includes(",")) - return false; - var pair = str.split(","); - if (pair[0].startsWith("(") && !pair[1].endsWith(")") || pair[1].endsWith(")") && !pair[0].startsWith("(")) - return false; - if (options.checkDMS) { - return latDMS.test(pair[0]) && longDMS.test(pair[1]); - } - return lat.test(pair[0]) && long.test(pair[1]); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isLatLong, isLatLong.exports); -var isLatLongExports = isLatLong.exports; -var isPostalCode$1 = {}; -Object.defineProperty(isPostalCode$1, "__esModule", { - value: true -}); -isPostalCode$1.default = isPostalCode; -isPostalCode$1.locales = void 0; -var _assertString$1 = _interopRequireDefault$1(assertStringExports); -function _interopRequireDefault$1(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -var threeDigit = /^\d{3}$/; -var fourDigit = /^\d{4}$/; -var fiveDigit = /^\d{5}$/; -var sixDigit = /^\d{6}$/; -var patterns = { - AD: /^AD\d{3}$/, - AT: fourDigit, - AU: fourDigit, - AZ: /^AZ\d{4}$/, - BA: /^([7-8]\d{4}$)/, - BE: fourDigit, - BG: fourDigit, - BR: /^\d{5}-\d{3}$/, - BY: /^2[1-4]\d{4}$/, - CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i, - CH: fourDigit, - CN: /^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/, - CZ: /^\d{3}\s?\d{2}$/, - DE: fiveDigit, - DK: fourDigit, - DO: fiveDigit, - DZ: fiveDigit, - EE: fiveDigit, - ES: /^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/, - FI: fiveDigit, - FR: /^\d{2}\s?\d{3}$/, - GB: /^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i, - GR: /^\d{3}\s?\d{2}$/, - HR: /^([1-5]\d{4}$)/, - HT: /^HT\d{4}$/, - HU: fourDigit, - ID: fiveDigit, - IE: /^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i, - IL: /^(\d{5}|\d{7})$/, - IN: /^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/, - IR: /^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/, - IS: threeDigit, - IT: fiveDigit, - JP: /^\d{3}\-\d{4}$/, - KE: fiveDigit, - KR: /^(\d{5}|\d{6})$/, - LI: /^(948[5-9]|949[0-7])$/, - LT: /^LT\-\d{5}$/, - LU: fourDigit, - LV: /^LV\-\d{4}$/, - LK: fiveDigit, - MG: threeDigit, - MX: fiveDigit, - MT: /^[A-Za-z]{3}\s{0,1}\d{4}$/, - MY: fiveDigit, - NL: /^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i, - NO: fourDigit, - NP: /^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i, - NZ: fourDigit, - PL: /^\d{2}\-\d{3}$/, - PR: /^00[679]\d{2}([ -]\d{4})?$/, - PT: /^\d{4}\-\d{3}?$/, - RO: sixDigit, - RU: sixDigit, - SA: fiveDigit, - SE: /^[1-9]\d{2}\s?\d{2}$/, - SG: sixDigit, - SI: fourDigit, - SK: /^\d{3}\s?\d{2}$/, - TH: fiveDigit, - TN: fourDigit, - TW: /^\d{3}(\d{2})?$/, - UA: fiveDigit, - US: /^\d{5}(-\d{4})?$/, - ZA: fourDigit, - ZM: fiveDigit -}; -isPostalCode$1.locales = Object.keys(patterns); -function isPostalCode(str, locale) { - (0, _assertString$1.default)(str); - if (locale in patterns) { - return patterns[locale].test(str); - } else if (locale === "any") { - for (var key2 in patterns) { - if (patterns.hasOwnProperty(key2)) { - var pattern = patterns[key2]; - if (pattern.test(str)) { - return true; - } - } - } - return false; - } - throw new Error("Invalid locale '".concat(locale, "'")); -} -var _escape = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = escape2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function escape2(str) { - (0, _assertString2.default)(str); - return str.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(//g, ">").replace(/\//g, "/").replace(/\\/g, "\").replace(/`/g, "`"); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(_escape, _escape.exports); -var _escapeExports = _escape.exports; -var _unescape = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = unescape2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function unescape2(str) { - (0, _assertString2.default)(str); - return str.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(///g, "/").replace(/\/g, "\\").replace(/`/g, "`").replace(/&/g, "&"); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(_unescape, _unescape.exports); -var _unescapeExports = _unescape.exports; -var stripLow = { exports: {} }; -var blacklist = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = blacklist2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function blacklist2(str, chars) { - (0, _assertString2.default)(str); - return str.replace(new RegExp("[".concat(chars, "]+"), "g"), ""); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(blacklist, blacklist.exports); -var blacklistExports = blacklist.exports; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = stripLow2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - var _blacklist = _interopRequireDefault2(blacklistExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function stripLow2(str, keep_new_lines) { - (0, _assertString2.default)(str); - var chars = keep_new_lines ? "\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F" : "\\x00-\\x1F\\x7F"; - return (0, _blacklist.default)(str, chars); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(stripLow, stripLow.exports); -var stripLowExports = stripLow.exports; -var whitelist = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = whitelist2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function whitelist2(str, chars) { - (0, _assertString2.default)(str); - return str.replace(new RegExp("[^".concat(chars, "]+"), "g"), ""); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(whitelist, whitelist.exports); -var whitelistExports = whitelist.exports; -var isWhitelisted = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isWhitelisted2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function isWhitelisted2(str, chars) { - (0, _assertString2.default)(str); - for (var i3 = str.length - 1; i3 >= 0; i3--) { - if (chars.indexOf(str[i3]) === -1) { - return false; - } - } - return true; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isWhitelisted, isWhitelisted.exports); -var isWhitelistedExports = isWhitelisted.exports; -var normalizeEmail = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = normalizeEmail2; - var _merge = _interopRequireDefault2(mergeExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var default_normalize_email_options = { - // The following options apply to all email addresses - // Lowercases the local part of the email address. - // Please note this may violate RFC 5321 as per http://stackoverflow.com/a/9808332/192024). - // The domain is always lowercased, as per RFC 1035 - all_lowercase: true, - // The following conversions are specific to GMail - // Lowercases the local part of the GMail address (known to be case-insensitive) - gmail_lowercase: true, - // Removes dots from the local part of the email address, as that's ignored by GMail - gmail_remove_dots: true, - // Removes the subaddress (e.g. "+foo") from the email address - gmail_remove_subaddress: true, - // Conversts the googlemail.com domain to gmail.com - gmail_convert_googlemaildotcom: true, - // The following conversions are specific to Outlook.com / Windows Live / Hotmail - // Lowercases the local part of the Outlook.com address (known to be case-insensitive) - outlookdotcom_lowercase: true, - // Removes the subaddress (e.g. "+foo") from the email address - outlookdotcom_remove_subaddress: true, - // The following conversions are specific to Yahoo - // Lowercases the local part of the Yahoo address (known to be case-insensitive) - yahoo_lowercase: true, - // Removes the subaddress (e.g. "-foo") from the email address - yahoo_remove_subaddress: true, - // The following conversions are specific to Yandex - // Lowercases the local part of the Yandex address (known to be case-insensitive) - yandex_lowercase: true, - // The following conversions are specific to iCloud - // Lowercases the local part of the iCloud address (known to be case-insensitive) - icloud_lowercase: true, - // Removes the subaddress (e.g. "+foo") from the email address - icloud_remove_subaddress: true - }; - var icloud_domains = ["icloud.com", "me.com"]; - var outlookdotcom_domains = ["hotmail.at", "hotmail.be", "hotmail.ca", "hotmail.cl", "hotmail.co.il", "hotmail.co.nz", "hotmail.co.th", "hotmail.co.uk", "hotmail.com", "hotmail.com.ar", "hotmail.com.au", "hotmail.com.br", "hotmail.com.gr", "hotmail.com.mx", "hotmail.com.pe", "hotmail.com.tr", "hotmail.com.vn", "hotmail.cz", "hotmail.de", "hotmail.dk", "hotmail.es", "hotmail.fr", "hotmail.hu", "hotmail.id", "hotmail.ie", "hotmail.in", "hotmail.it", "hotmail.jp", "hotmail.kr", "hotmail.lv", "hotmail.my", "hotmail.ph", "hotmail.pt", "hotmail.sa", "hotmail.sg", "hotmail.sk", "live.be", "live.co.uk", "live.com", "live.com.ar", "live.com.mx", "live.de", "live.es", "live.eu", "live.fr", "live.it", "live.nl", "msn.com", "outlook.at", "outlook.be", "outlook.cl", "outlook.co.il", "outlook.co.nz", "outlook.co.th", "outlook.com", "outlook.com.ar", "outlook.com.au", "outlook.com.br", "outlook.com.gr", "outlook.com.pe", "outlook.com.tr", "outlook.com.vn", "outlook.cz", "outlook.de", "outlook.dk", "outlook.es", "outlook.fr", "outlook.hu", "outlook.id", "outlook.ie", "outlook.in", "outlook.it", "outlook.jp", "outlook.kr", "outlook.lv", "outlook.my", "outlook.ph", "outlook.pt", "outlook.sa", "outlook.sg", "outlook.sk", "passport.com"]; - var yahoo_domains = ["rocketmail.com", "yahoo.ca", "yahoo.co.uk", "yahoo.com", "yahoo.de", "yahoo.fr", "yahoo.in", "yahoo.it", "ymail.com"]; - var yandex_domains = ["yandex.ru", "yandex.ua", "yandex.kz", "yandex.com", "yandex.by", "ya.ru"]; - function dotsReplacer(match) { - if (match.length > 1) { - return match; - } - return ""; - } - function normalizeEmail2(email, options) { - options = (0, _merge.default)(options, default_normalize_email_options); - var raw_parts = email.split("@"); - var domain = raw_parts.pop(); - var user = raw_parts.join("@"); - var parts = [user, domain]; - parts[1] = parts[1].toLowerCase(); - if (parts[1] === "gmail.com" || parts[1] === "googlemail.com") { - if (options.gmail_remove_subaddress) { - parts[0] = parts[0].split("+")[0]; - } - if (options.gmail_remove_dots) { - parts[0] = parts[0].replace(/\.+/g, dotsReplacer); - } - if (!parts[0].length) { - return false; - } - if (options.all_lowercase || options.gmail_lowercase) { - parts[0] = parts[0].toLowerCase(); - } - parts[1] = options.gmail_convert_googlemaildotcom ? "gmail.com" : parts[1]; - } else if (icloud_domains.indexOf(parts[1]) >= 0) { - if (options.icloud_remove_subaddress) { - parts[0] = parts[0].split("+")[0]; - } - if (!parts[0].length) { - return false; - } - if (options.all_lowercase || options.icloud_lowercase) { - parts[0] = parts[0].toLowerCase(); - } - } else if (outlookdotcom_domains.indexOf(parts[1]) >= 0) { - if (options.outlookdotcom_remove_subaddress) { - parts[0] = parts[0].split("+")[0]; - } - if (!parts[0].length) { - return false; - } - if (options.all_lowercase || options.outlookdotcom_lowercase) { - parts[0] = parts[0].toLowerCase(); - } - } else if (yahoo_domains.indexOf(parts[1]) >= 0) { - if (options.yahoo_remove_subaddress) { - var components = parts[0].split("-"); - parts[0] = components.length > 1 ? components.slice(0, -1).join("-") : components[0]; - } - if (!parts[0].length) { - return false; - } - if (options.all_lowercase || options.yahoo_lowercase) { - parts[0] = parts[0].toLowerCase(); - } - } else if (yandex_domains.indexOf(parts[1]) >= 0) { - if (options.all_lowercase || options.yandex_lowercase) { - parts[0] = parts[0].toLowerCase(); - } - parts[1] = "yandex.ru"; - } else if (options.all_lowercase) { - parts[0] = parts[0].toLowerCase(); - } - return parts.join("@"); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(normalizeEmail, normalizeEmail.exports); -var normalizeEmailExports = normalizeEmail.exports; -var isSlug = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isSlug2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var charsetRegex = /^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/; - function isSlug2(str) { - (0, _assertString2.default)(str); - return charsetRegex.test(str); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isSlug, isSlug.exports); -var isSlugExports = isSlug.exports; -var isLicensePlate = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isLicensePlate2; - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var validators2 = { - "cs-CZ": function csCZ(str) { - return /^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(str); - }, - "de-DE": function deDE(str) { - return /^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|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P|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(str); - }, - "de-LI": function deLI(str) { - return /^FL[- ]?\d{1,5}[UZ]?$/.test(str); - }, - "en-IN": function enIN(str) { - return /^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(str); - }, - "es-AR": function esAR(str) { - return /^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(str); - }, - "fi-FI": function fiFI(str) { - return /^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(str); - }, - "hu-HU": function huHU(str) { - return /^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(str); - }, - "pt-BR": function ptBR(str) { - return /^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(str); - }, - "pt-PT": function ptPT(str) { - return /^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(str); - }, - "sq-AL": function sqAL(str) { - return /^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(str); - }, - "sv-SE": function svSE(str) { - return /^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(str.trim()); - }, - "en-PK": function enPK(str) { - return /(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(str.trim()); - } - }; - function isLicensePlate2(str, locale) { - (0, _assertString2.default)(str); - if (locale in validators2) { - return validators2[locale](str); - } else if (locale === "any") { - for (var key2 in validators2) { - var validator2 = validators2[key2]; - if (validator2(str)) { - return true; - } - } - return false; - } - throw new Error("Invalid locale '".concat(locale, "'")); - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isLicensePlate, isLicensePlate.exports); -var isLicensePlateExports = isLicensePlate.exports; -var isStrongPassword = { exports: {} }; -(function(module, exports) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = isStrongPassword2; - var _merge = _interopRequireDefault2(mergeExports); - var _assertString2 = _interopRequireDefault2(assertStringExports); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var upperCaseRegex = /^[A-Z]$/; - var lowerCaseRegex = /^[a-z]$/; - var numberRegex = /^[0-9]$/; - var symbolRegex = /^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/; - var defaultOptions = { - minLength: 8, - minLowercase: 1, - minUppercase: 1, - minNumbers: 1, - minSymbols: 1, - returnScore: false, - pointsPerUnique: 1, - pointsPerRepeat: 0.5, - pointsForContainingLower: 10, - pointsForContainingUpper: 10, - pointsForContainingNumber: 10, - pointsForContainingSymbol: 10 - }; - function countChars(str) { - var result = {}; - Array.from(str).forEach(function(char) { - var curVal = result[char]; - if (curVal) { - result[char] += 1; - } else { - result[char] = 1; - } - }); - return result; - } - function analyzePassword(password) { - var charMap = countChars(password); - var analysis = { - length: password.length, - uniqueChars: Object.keys(charMap).length, - uppercaseCount: 0, - lowercaseCount: 0, - numberCount: 0, - symbolCount: 0 - }; - Object.keys(charMap).forEach(function(char) { - if (upperCaseRegex.test(char)) { - analysis.uppercaseCount += charMap[char]; - } else if (lowerCaseRegex.test(char)) { - analysis.lowercaseCount += charMap[char]; - } else if (numberRegex.test(char)) { - analysis.numberCount += charMap[char]; - } else if (symbolRegex.test(char)) { - analysis.symbolCount += charMap[char]; - } - }); - return analysis; - } - function scorePassword(analysis, scoringOptions) { - var points = 0; - points += analysis.uniqueChars * scoringOptions.pointsPerUnique; - points += (analysis.length - analysis.uniqueChars) * scoringOptions.pointsPerRepeat; - if (analysis.lowercaseCount > 0) { - points += scoringOptions.pointsForContainingLower; - } - if (analysis.uppercaseCount > 0) { - points += scoringOptions.pointsForContainingUpper; - } - if (analysis.numberCount > 0) { - points += scoringOptions.pointsForContainingNumber; - } - if (analysis.symbolCount > 0) { - points += scoringOptions.pointsForContainingSymbol; - } - return points; - } - function isStrongPassword2(str) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; - (0, _assertString2.default)(str); - var analysis = analyzePassword(str); - options = (0, _merge.default)(options || {}, defaultOptions); - if (options.returnScore) { - return scorePassword(analysis, options); - } - return analysis.length >= options.minLength && analysis.lowercaseCount >= options.minLowercase && analysis.uppercaseCount >= options.minUppercase && analysis.numberCount >= options.minNumbers && analysis.symbolCount >= options.minSymbols; - } - module.exports = exports.default; - module.exports.default = exports.default; -})(isStrongPassword, isStrongPassword.exports); -var isStrongPasswordExports = isStrongPassword.exports; -var isVAT$1 = {}; -function _typeof(o2) { - "@babel/helpers - typeof"; - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof(o2); -} -Object.defineProperty(isVAT$1, "__esModule", { - value: true -}); -isVAT$1.default = isVAT; -isVAT$1.vatMatchers = void 0; -var _assertString = _interopRequireDefault(assertStringExports); -var algorithms = _interopRequireWildcard(algorithms$1); -function _getRequireWildcardCache(e18) { - if ("function" != typeof WeakMap) - return null; - var r2 = /* @__PURE__ */ new WeakMap(), t2 = /* @__PURE__ */ new WeakMap(); - return (_getRequireWildcardCache = function _getRequireWildcardCache2(e19) { - return e19 ? t2 : r2; - })(e18); -} -function _interopRequireWildcard(e18, r2) { - if (!r2 && e18 && e18.__esModule) - return e18; - if (null === e18 || "object" != _typeof(e18) && "function" != typeof e18) - return { default: e18 }; - var t2 = _getRequireWildcardCache(r2); - if (t2 && t2.has(e18)) - return t2.get(e18); - var n4 = { __proto__: null }, a3 = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var u2 in e18) - if ("default" !== u2 && {}.hasOwnProperty.call(e18, u2)) { - var i3 = a3 ? Object.getOwnPropertyDescriptor(e18, u2) : null; - i3 && (i3.get || i3.set) ? Object.defineProperty(n4, u2, i3) : n4[u2] = e18[u2]; - } - return n4.default = e18, t2 && t2.set(e18, n4), n4; -} -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -var AU = function AU2(str) { - var match = str.match(/^(AU)?(\d{11})$/); - if (!match) { - return false; - } - var weights = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19]; - str = str.replace(/^AU/, ""); - var ABN = (parseInt(str.slice(0, 1), 10) - 1).toString() + str.slice(1); - var total = 0; - for (var i3 = 0; i3 < 11; i3++) { - total += weights[i3] * ABN.charAt(i3); - } - return total !== 0 && total % 89 === 0; -}; -var CH = function CH2(str) { - var hasValidCheckNumber = function hasValidCheckNumber2(digits) { - var lastDigit = digits.pop(); - var weights = [5, 4, 3, 2, 7, 6, 5, 4]; - var calculatedCheckNumber = (11 - digits.reduce(function(acc, el2, idx) { - return acc + el2 * weights[idx]; - }, 0) % 11) % 11; - return lastDigit === calculatedCheckNumber; - }; - return /^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(str) && hasValidCheckNumber(str.match(/\d/g).map(function(el2) { - return +el2; - })); -}; -var PT = function PT2(str) { - var match = str.match(/^(PT)?(\d{9})$/); - if (!match) { - return false; - } - var tin = match[2]; - var checksum2 = 11 - algorithms.reverseMultiplyAndSum(tin.split("").slice(0, 8).map(function(a3) { - return parseInt(a3, 10); - }), 9) % 11; - if (checksum2 > 9) { - return parseInt(tin[8], 10) === 0; - } - return checksum2 === parseInt(tin[8], 10); -}; -var vatMatchers = isVAT$1.vatMatchers = { - /** - * European Union VAT identification numbers - */ - AT: function AT(str) { - return /^(AT)?U\d{8}$/.test(str); - }, - BE: function BE(str) { - return /^(BE)?\d{10}$/.test(str); - }, - BG: function BG(str) { - return /^(BG)?\d{9,10}$/.test(str); - }, - HR: function HR(str) { - return /^(HR)?\d{11}$/.test(str); - }, - CY: function CY(str) { - return /^(CY)?\w{9}$/.test(str); - }, - CZ: function CZ(str) { - return /^(CZ)?\d{8,10}$/.test(str); - }, - DK: function DK(str) { - return /^(DK)?\d{8}$/.test(str); - }, - EE: function EE(str) { - return /^(EE)?\d{9}$/.test(str); - }, - FI: function FI(str) { - return /^(FI)?\d{8}$/.test(str); - }, - FR: function FR(str) { - return /^(FR)?\w{2}\d{9}$/.test(str); - }, - DE: function DE(str) { - return /^(DE)?\d{9}$/.test(str); - }, - EL: function EL(str) { - return /^(EL)?\d{9}$/.test(str); - }, - HU: function HU(str) { - return /^(HU)?\d{8}$/.test(str); - }, - IE: function IE(str) { - return /^(IE)?\d{7}\w{1}(W)?$/.test(str); - }, - IT: function IT(str) { - return /^(IT)?\d{11}$/.test(str); - }, - LV: function LV(str) { - return /^(LV)?\d{11}$/.test(str); - }, - LT: function LT(str) { - return /^(LT)?\d{9,12}$/.test(str); - }, - LU: function LU(str) { - return /^(LU)?\d{8}$/.test(str); - }, - MT: function MT(str) { - return /^(MT)?\d{8}$/.test(str); - }, - NL: function NL(str) { - return /^(NL)?\d{9}B\d{2}$/.test(str); - }, - PL: function PL(str) { - return /^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(str); - }, - PT, - RO: function RO(str) { - return /^(RO)?\d{2,10}$/.test(str); - }, - SK: function SK(str) { - return /^(SK)?\d{10}$/.test(str); - }, - SI: function SI(str) { - return /^(SI)?\d{8}$/.test(str); - }, - ES: function ES(str) { - return /^(ES)?\w\d{7}[A-Z]$/.test(str); - }, - SE: function SE(str) { - return /^(SE)?\d{12}$/.test(str); - }, - /** - * VAT numbers of non-EU countries - */ - AL: function AL(str) { - return /^(AL)?\w{9}[A-Z]$/.test(str); - }, - MK: function MK(str) { - return /^(MK)?\d{13}$/.test(str); - }, - AU, - BY: function BY(str) { - return /^(УНП )?\d{9}$/.test(str); - }, - CA: function CA(str) { - return /^(CA)?\d{9}$/.test(str); - }, - IS: function IS(str) { - return /^(IS)?\d{5,6}$/.test(str); - }, - IN: function IN(str) { - return /^(IN)?\d{15}$/.test(str); - }, - ID: function ID(str) { - return /^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(str); - }, - IL: function IL(str) { - return /^(IL)?\d{9}$/.test(str); - }, - KZ: function KZ(str) { - return /^(KZ)?\d{12}$/.test(str); - }, - NZ: function NZ(str) { - return /^(NZ)?\d{9}$/.test(str); - }, - NG: function NG(str) { - return /^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(str); - }, - NO: function NO(str) { - return /^(NO)?\d{9}MVA$/.test(str); - }, - PH: function PH(str) { - return /^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(str); - }, - RU: function RU(str) { - return /^(RU)?(\d{10}|\d{12})$/.test(str); - }, - SM: function SM(str) { - return /^(SM)?\d{5}$/.test(str); - }, - SA: function SA(str) { - return /^(SA)?\d{15}$/.test(str); - }, - RS: function RS(str) { - return /^(RS)?\d{9}$/.test(str); - }, - CH, - TR: function TR(str) { - return /^(TR)?\d{10}$/.test(str); - }, - UA: function UA(str) { - return /^(UA)?\d{12}$/.test(str); - }, - GB: function GB(str) { - return /^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(str); - }, - UZ: function UZ(str) { - return /^(UZ)?\d{9}$/.test(str); - }, - /** - * VAT numbers of Latin American countries - */ - AR: function AR(str) { - return /^(AR)?\d{11}$/.test(str); - }, - BO: function BO(str) { - return /^(BO)?\d{7}$/.test(str); - }, - BR: function BR(str) { - return /^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(str); - }, - CL: function CL(str) { - return /^(CL)?\d{8}-\d{1}$/.test(str); - }, - CO: function CO(str) { - return /^(CO)?\d{10}$/.test(str); - }, - CR: function CR(str) { - return /^(CR)?\d{9,12}$/.test(str); - }, - EC: function EC(str) { - return /^(EC)?\d{13}$/.test(str); - }, - SV: function SV(str) { - return /^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(str); - }, - GT: function GT(str) { - return /^(GT)?\d{7}-\d{1}$/.test(str); - }, - HN: function HN(str) { - return /^(HN)?$/.test(str); - }, - MX: function MX(str) { - return /^(MX)?\w{3,4}\d{6}\w{3}$/.test(str); - }, - NI: function NI(str) { - return /^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(str); - }, - PA: function PA(str) { - return /^(PA)?$/.test(str); - }, - PY: function PY(str) { - return /^(PY)?\d{6,8}-\d{1}$/.test(str); - }, - PE: function PE(str) { - return /^(PE)?\d{11}$/.test(str); - }, - DO: function DO(str) { - return /^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(str); - }, - UY: function UY(str) { - return /^(UY)?\d{12}$/.test(str); - }, - VE: function VE(str) { - return /^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(str); - } -}; -function isVAT(str, countryCode) { - (0, _assertString.default)(str); - (0, _assertString.default)(countryCode); - if (countryCode in vatMatchers) { - return vatMatchers[countryCode](str); - } - throw new Error("Invalid country code: '".concat(countryCode, "'")); -} -(function(module, exports) { - function _typeof2(o2) { - "@babel/helpers - typeof"; - return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof2(o2); - } - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = void 0; - var _toDate = _interopRequireDefault2(toDateExports); - var _toFloat = _interopRequireDefault2(toFloatExports); - var _toInt = _interopRequireDefault2(toIntExports); - var _toBoolean = _interopRequireDefault2(toBooleanExports); - var _equals = _interopRequireDefault2(equalsExports); - var _contains = _interopRequireDefault2(containsExports); - var _matches = _interopRequireDefault2(matchesExports); - var _isEmail = _interopRequireDefault2(isEmailExports); - var _isURL = _interopRequireDefault2(isURLExports); - var _isMACAddress = _interopRequireDefault2(isMACAddressExports); - var _isIP = _interopRequireDefault2(isIPExports); - var _isIPRange = _interopRequireDefault2(isIPRangeExports); - var _isFQDN = _interopRequireDefault2(isFQDNExports); - var _isDate = _interopRequireDefault2(isDateExports); - var _isTime = _interopRequireDefault2(isTimeExports); - var _isBoolean = _interopRequireDefault2(isBooleanExports); - var _isLocale = _interopRequireDefault2(isLocaleExports); - var _isAbaRouting = _interopRequireDefault2(isAbaRoutingExports); - var _isAlpha = _interopRequireWildcard2(isAlpha$1); - var _isAlphanumeric = _interopRequireWildcard2(isAlphanumeric$1); - var _isNumeric = _interopRequireDefault2(isNumericExports); - var _isPassportNumber = _interopRequireDefault2(isPassportNumberExports); - var _isPort = _interopRequireDefault2(isPortExports); - var _isLowercase = _interopRequireDefault2(isLowercaseExports); - var _isUppercase = _interopRequireDefault2(isUppercaseExports); - var _isIMEI = _interopRequireDefault2(isIMEIExports); - var _isAscii = _interopRequireDefault2(isAsciiExports); - var _isFullWidth = _interopRequireDefault2(isFullWidth$1); - var _isHalfWidth = _interopRequireDefault2(isHalfWidth$1); - var _isVariableWidth = _interopRequireDefault2(isVariableWidthExports); - var _isMultibyte = _interopRequireDefault2(isMultibyteExports); - var _isSemVer = _interopRequireDefault2(isSemVerExports); - var _isSurrogatePair = _interopRequireDefault2(isSurrogatePairExports); - var _isInt = _interopRequireDefault2(isIntExports); - var _isFloat = _interopRequireWildcard2(isFloat$1); - var _isDecimal = _interopRequireDefault2(isDecimalExports); - var _isHexadecimal = _interopRequireDefault2(isHexadecimalExports); - var _isOctal = _interopRequireDefault2(isOctalExports); - var _isDivisibleBy = _interopRequireDefault2(isDivisibleByExports); - var _isHexColor = _interopRequireDefault2(isHexColorExports); - var _isRgbColor = _interopRequireDefault2(isRgbColorExports); - var _isHSL = _interopRequireDefault2(isHSLExports); - var _isISRC = _interopRequireDefault2(isISRCExports); - var _isIBAN = _interopRequireWildcard2(isIBAN$1); - var _isBIC = _interopRequireDefault2(isBICExports); - var _isMD = _interopRequireDefault2(isMD5Exports); - var _isHash = _interopRequireDefault2(isHashExports); - var _isJWT = _interopRequireDefault2(isJWTExports); - var _isJSON = _interopRequireDefault2(isJSONExports); - var _isEmpty = _interopRequireDefault2(isEmptyExports); - var _isLength = _interopRequireDefault2(isLengthExports); - var _isByteLength = _interopRequireDefault2(isByteLengthExports); - var _isUUID = _interopRequireDefault2(isUUIDExports); - var _isMongoId = _interopRequireDefault2(isMongoIdExports); - var _isAfter = _interopRequireDefault2(isAfterExports); - var _isBefore = _interopRequireDefault2(isBeforeExports); - var _isIn = _interopRequireDefault2(isInExports); - var _isLuhnNumber = _interopRequireDefault2(isLuhnNumberExports); - var _isCreditCard = _interopRequireDefault2(isCreditCardExports); - var _isIdentityCard = _interopRequireDefault2(isIdentityCardExports); - var _isEAN = _interopRequireDefault2(isEANExports); - var _isISIN = _interopRequireDefault2(isISINExports); - var _isISBN = _interopRequireDefault2(isISBNExports); - var _isISSN = _interopRequireDefault2(isISSNExports); - var _isTaxID = _interopRequireDefault2(isTaxIDExports); - var _isMobilePhone = _interopRequireWildcard2(isMobilePhone$1); - var _isEthereumAddress = _interopRequireDefault2(isEthereumAddressExports); - var _isCurrency = _interopRequireDefault2(isCurrencyExports); - var _isBtcAddress = _interopRequireDefault2(isBtcAddressExports); - var _isISO = isISO6346$1; - var _isISO2 = _interopRequireDefault2(isISO6391Exports); - var _isISO3 = _interopRequireDefault2(isISO8601Exports); - var _isRFC = _interopRequireDefault2(isRFC3339Exports); - var _isISO31661Alpha = _interopRequireDefault2(isISO31661Alpha2$1); - var _isISO31661Alpha2 = _interopRequireDefault2(isISO31661Alpha3Exports); - var _isISO4 = _interopRequireDefault2(isISO4217$1); - var _isBase = _interopRequireDefault2(isBase32Exports); - var _isBase2 = _interopRequireDefault2(isBase58Exports); - var _isBase3 = _interopRequireDefault2(isBase64Exports); - var _isDataURI = _interopRequireDefault2(isDataURIExports); - var _isMagnetURI = _interopRequireDefault2(isMagnetURIExports); - var _isMailtoURI = _interopRequireDefault2(isMailtoURIExports); - var _isMimeType = _interopRequireDefault2(isMimeTypeExports); - var _isLatLong = _interopRequireDefault2(isLatLongExports); - var _isPostalCode = _interopRequireWildcard2(isPostalCode$1); - var _ltrim = _interopRequireDefault2(ltrimExports); - var _rtrim = _interopRequireDefault2(rtrimExports); - var _trim = _interopRequireDefault2(trimExports); - var _escape2 = _interopRequireDefault2(_escapeExports); - var _unescape2 = _interopRequireDefault2(_unescapeExports); - var _stripLow = _interopRequireDefault2(stripLowExports); - var _whitelist = _interopRequireDefault2(whitelistExports); - var _blacklist = _interopRequireDefault2(blacklistExports); - var _isWhitelisted = _interopRequireDefault2(isWhitelistedExports); - var _normalizeEmail = _interopRequireDefault2(normalizeEmailExports); - var _isSlug = _interopRequireDefault2(isSlugExports); - var _isLicensePlate = _interopRequireDefault2(isLicensePlateExports); - var _isStrongPassword = _interopRequireDefault2(isStrongPasswordExports); - var _isVAT = _interopRequireDefault2(isVAT$1); - function _getRequireWildcardCache2(e18) { - if ("function" != typeof WeakMap) - return null; - var r2 = /* @__PURE__ */ new WeakMap(), t2 = /* @__PURE__ */ new WeakMap(); - return (_getRequireWildcardCache2 = function _getRequireWildcardCache3(e19) { - return e19 ? t2 : r2; - })(e18); - } - function _interopRequireWildcard2(e18, r2) { - if (!r2 && e18 && e18.__esModule) - return e18; - if (null === e18 || "object" != _typeof2(e18) && "function" != typeof e18) - return { default: e18 }; - var t2 = _getRequireWildcardCache2(r2); - if (t2 && t2.has(e18)) - return t2.get(e18); - var n4 = { __proto__: null }, a3 = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var u2 in e18) - if ("default" !== u2 && {}.hasOwnProperty.call(e18, u2)) { - var i3 = a3 ? Object.getOwnPropertyDescriptor(e18, u2) : null; - i3 && (i3.get || i3.set) ? Object.defineProperty(n4, u2, i3) : n4[u2] = e18[u2]; - } - return n4.default = e18, t2 && t2.set(e18, n4), n4; - } - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var version2 = "13.12.0"; - var validator2 = { - version: version2, - toDate: _toDate.default, - toFloat: _toFloat.default, - toInt: _toInt.default, - toBoolean: _toBoolean.default, - equals: _equals.default, - contains: _contains.default, - matches: _matches.default, - isEmail: _isEmail.default, - isURL: _isURL.default, - isMACAddress: _isMACAddress.default, - isIP: _isIP.default, - isIPRange: _isIPRange.default, - isFQDN: _isFQDN.default, - isBoolean: _isBoolean.default, - isIBAN: _isIBAN.default, - isBIC: _isBIC.default, - isAbaRouting: _isAbaRouting.default, - isAlpha: _isAlpha.default, - isAlphaLocales: _isAlpha.locales, - isAlphanumeric: _isAlphanumeric.default, - isAlphanumericLocales: _isAlphanumeric.locales, - isNumeric: _isNumeric.default, - isPassportNumber: _isPassportNumber.default, - isPort: _isPort.default, - isLowercase: _isLowercase.default, - isUppercase: _isUppercase.default, - isAscii: _isAscii.default, - isFullWidth: _isFullWidth.default, - isHalfWidth: _isHalfWidth.default, - isVariableWidth: _isVariableWidth.default, - isMultibyte: _isMultibyte.default, - isSemVer: _isSemVer.default, - isSurrogatePair: _isSurrogatePair.default, - isInt: _isInt.default, - isIMEI: _isIMEI.default, - isFloat: _isFloat.default, - isFloatLocales: _isFloat.locales, - isDecimal: _isDecimal.default, - isHexadecimal: _isHexadecimal.default, - isOctal: _isOctal.default, - isDivisibleBy: _isDivisibleBy.default, - isHexColor: _isHexColor.default, - isRgbColor: _isRgbColor.default, - isHSL: _isHSL.default, - isISRC: _isISRC.default, - isMD5: _isMD.default, - isHash: _isHash.default, - isJWT: _isJWT.default, - isJSON: _isJSON.default, - isEmpty: _isEmpty.default, - isLength: _isLength.default, - isLocale: _isLocale.default, - isByteLength: _isByteLength.default, - isUUID: _isUUID.default, - isMongoId: _isMongoId.default, - isAfter: _isAfter.default, - isBefore: _isBefore.default, - isIn: _isIn.default, - isLuhnNumber: _isLuhnNumber.default, - isCreditCard: _isCreditCard.default, - isIdentityCard: _isIdentityCard.default, - isEAN: _isEAN.default, - isISIN: _isISIN.default, - isISBN: _isISBN.default, - isISSN: _isISSN.default, - isMobilePhone: _isMobilePhone.default, - isMobilePhoneLocales: _isMobilePhone.locales, - isPostalCode: _isPostalCode.default, - isPostalCodeLocales: _isPostalCode.locales, - isEthereumAddress: _isEthereumAddress.default, - isCurrency: _isCurrency.default, - isBtcAddress: _isBtcAddress.default, - isISO6346: _isISO.isISO6346, - isFreightContainerID: _isISO.isFreightContainerID, - isISO6391: _isISO2.default, - isISO8601: _isISO3.default, - isRFC3339: _isRFC.default, - isISO31661Alpha2: _isISO31661Alpha.default, - isISO31661Alpha3: _isISO31661Alpha2.default, - isISO4217: _isISO4.default, - isBase32: _isBase.default, - isBase58: _isBase2.default, - isBase64: _isBase3.default, - isDataURI: _isDataURI.default, - isMagnetURI: _isMagnetURI.default, - isMailtoURI: _isMailtoURI.default, - isMimeType: _isMimeType.default, - isLatLong: _isLatLong.default, - ltrim: _ltrim.default, - rtrim: _rtrim.default, - trim: _trim.default, - escape: _escape2.default, - unescape: _unescape2.default, - stripLow: _stripLow.default, - whitelist: _whitelist.default, - blacklist: _blacklist.default, - isWhitelisted: _isWhitelisted.default, - normalizeEmail: _normalizeEmail.default, - toString, - isSlug: _isSlug.default, - isStrongPassword: _isStrongPassword.default, - isTaxID: _isTaxID.default, - isDate: _isDate.default, - isTime: _isTime.default, - isLicensePlate: _isLicensePlate.default, - isVAT: _isVAT.default, - ibanLocales: _isIBAN.locales - }; - exports.default = validator2; - module.exports = exports.default; - module.exports.default = exports.default; -})(validator$2, validator$2.exports); -var validatorExports = validator$2.exports; -const validator$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(validatorExports); -function isValidURL(url) { - if (typeof url !== "string") - return false; - return validator$1.isURL(url.toString(), { - protocols: ["http", "https"], - require_tld: false - }); -} -function isObject$2(obj) { - return obj === Object(obj) && Object.prototype.toString.call(obj) !== "[object Array]"; -} -function isArray$1(array2) { - return Array.isArray(array2); -} -function isJson(string2) { - try { - return !!JSON.parse(string2); - } catch (ex2) { - return false; - } -} -function isBoolean$1(bool) { - return typeof bool === "boolean"; -} -function isBigNumber(number2) { - return !!number2 && (number2 instanceof BigNumber || number2.constructor && number2.constructor.name === "BigNumber"); -} -function isString$1(string2) { - return typeof string2 === "string" || !!string2 && string2.constructor && string2.constructor.name === "String"; -} -function isFunction$1(obj) { - return typeof obj === "function"; -} -function isHex(string2) { - return typeof string2 === "string" && !isNaN(parseInt(string2, 16)) && /^(0x|)[a-fA-F0-9]+$/.test(string2); -} -function isInteger(number2) { - if (number2 === null) - return false; - return Number.isInteger(Number(number2)); -} -function hasProperty(obj, property) { - return Object.prototype.hasOwnProperty.call(obj, property); -} -function hasProperties(obj, ...properties) { - return properties.length && !properties.map((property) => { - return hasProperty(obj, property); - }).includes(false); -} -function mapEvent(event) { - const data = { - block: event.block_number, - timestamp: event.block_timestamp, - contract: event.contract_address, - name: event.event_name, - transaction: event.transaction_id, - result: event.result, - resourceNode: event.resource_Node || (event._unconfirmed ? "fullNode" : "solidityNode") - }; - if (event._unconfirmed) { - data.unconfirmed = event._unconfirmed; - } - if (event._fingerprint) { - data.fingerprint = event._fingerprint; - } - return data; -} -function parseEvent(event, { inputs: abi2 }) { - if (!event.result) - return event; - if (isObject$2(event.result)) { - for (let i3 = 0; i3 < abi2.length; i3++) { - const obj = abi2[i3]; - if (obj.type == "address" && obj.name in event.result) - event.result[obj.name] = ADDRESS_PREFIX + event.result[obj.name].substr(2).toLowerCase(); - } - } else if (isArray$1(event.result)) { - event.result = event.result.reduce((obj, result, index2) => { - const { name: name2, type: type2 } = abi2[index2]; - if (type2 == "address") - result = ADDRESS_PREFIX + result.substr(2).toLowerCase(); - obj[name2] = result; - return obj; - }, {}); - } - return event; -} -function padLeft(input, padding2, amount) { - let res = input.toString(); - while (res.length < amount) - res = padding2 + res; - return res; -} -function isNotNullOrUndefined(val) { - return val !== null && typeof val !== "undefined"; -} -async function sleep(millis = 1e3) { - return new Promise((resolve) => setTimeout(resolve, millis)); -} -const validations = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - hasProperties, - hasProperty, - isArray: isArray$1, - isBigNumber, - isBoolean: isBoolean$1, - isFunction: isFunction$1, - isHex, - isInteger, - isJson, - isNotNullOrUndefined, - isObject: isObject$2, - isString: isString$1, - isValidURL, - mapEvent, - padLeft, - parseEvent, - sleep -}, Symbol.toStringTag, { value: "Module" })); -const version$3 = "6.13.4"; -function checkType(value, type2, name2) { - const types2 = type2.split("|").map((t2) => t2.trim()); - for (let i3 = 0; i3 < types2.length; i3++) { - switch (type2) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof value === type2) { - return; - } - } - } - const error = new Error(`invalid value for type ${type2}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name2}`; - error.value = value; - throw error; -} -async function resolveProperties(value) { - const keys2 = Object.keys(value); - const results = await Promise.all(keys2.map((k2) => Promise.resolve(value[k2]))); - return results.reduce((accum, v6, index2) => { - accum[keys2[index2]] = v6; - return accum; - }, {}); -} -function defineProperties(target, values, types2) { - for (let key2 in values) { - let value = values[key2]; - const type2 = types2 ? types2[key2] : null; - if (type2) { - checkType(value, type2, key2); - } - Object.defineProperty(target, key2, { enumerable: true, value, writable: false }); - } -} -function stringify$1(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[ " + value.map(stringify$1).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i3 = 0; i3 < value.length; i3++) { - result += HEX[value[i3] >> 4]; - result += HEX[value[i3] & 15]; - } - return result; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return stringify$1(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "number": - return value.toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys2 = Object.keys(value); - keys2.sort(); - return "{ " + keys2.map((k2) => `${stringify$1(k2)}: ${stringify$1(value[k2])}`).join(", ") + " }"; - } - } - return `[ COULD NOT SERIALIZE ]`; -} -function isError(error, code2) { - return error && error.code === code2; -} -function makeError(message2, code2, info) { - let shortMessage = message2; - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify$1(info)}`); - } - for (const key2 in info) { - if (key2 === "shortMessage") { - continue; - } - const value = info[key2]; - details.push(key2 + "=" + stringify$1(value)); - } - } - details.push(`code=${code2}`); - details.push(`version=${version$3}`); - if (details.length) { - message2 += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code2) { - case "INVALID_ARGUMENT": - error = new TypeError(message2); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message2); - break; - default: - error = new Error(message2); - } - defineProperties(error, { code: code2 }); - if (info) { - Object.assign(error, info); - } - if (error.shortMessage == null) { - defineProperties(error, { shortMessage }); - } - return error; -} -function assert$a(check, message2, code2, info) { - if (!check) { - throw makeError(message2, code2, info); - } -} -function assertArgument(check, message2, name2, value) { - assert$a(check, message2, "INVALID_ARGUMENT", { argument: name2, value }); -} -function assertArgumentCount(count, expectedCount, message2) { - if (message2 == null) { - message2 = ""; - } - if (message2) { - message2 = ": " + message2; - } - assert$a(count >= expectedCount, "missing arguemnt" + message2, "MISSING_ARGUMENT", { - count, - expectedCount - }); - assert$a(count <= expectedCount, "too many arguments" + message2, "UNEXPECTED_ARGUMENT", { - count, - expectedCount - }); -} -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - ; - if (form === "NFD") { - const check = String.fromCharCode(233).normalize("NFD"); - const expected = String.fromCharCode(101, 769); - if (check !== expected) { - throw new Error("broken"); - } - } - accum.push(form); - } catch (error) { - } - return accum; -}, []); -function assertNormalize(form) { - assert$a(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", - info: { form } - }); -} -function assertPrivate(givenGuard, guard2, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard2) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert$a(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation - }); - } -} -function _getBytes(value, name2, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof value === "string" && value.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset2 = 2; - for (let i3 = 0; i3 < result.length; i3++) { - result[i3] = parseInt(value.substring(offset2, offset2 + 2), 16); - offset2 += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name2 || "value", value); -} -function getBytes(value, name2) { - return _getBytes(value, name2, false); -} -function getBytesCopy(value, name2) { - return _getBytes(value, name2, true); -} -function isHexString(value, length) { - if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof length === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && value.length % 2 !== 0) { - return false; - } - return true; -} -function isBytesLike(value) { - return isHexString(value, true) || value instanceof Uint8Array; -} -const HexCharacters = "0123456789abcdef"; -function hexlify(data) { - const bytes2 = getBytes(data); - let result = "0x"; - for (let i3 = 0; i3 < bytes2.length; i3++) { - const v6 = bytes2[i3]; - result += HexCharacters[(v6 & 240) >> 4] + HexCharacters[v6 & 15]; - } - return result; -} -function concat$1(datas) { - return "0x" + datas.map((d4) => hexlify(d4).substring(2)).join(""); -} -function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; -} -function dataSlice(data, start, end) { - const bytes2 = getBytes(data); - if (end != null && end > bytes2.length) { - assert$a(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes2, - length: bytes2.length, - offset: end - }); - } - return hexlify(bytes2.slice(start == null ? 0 : start, end == null ? bytes2.length : end)); -} -function zeroPad(data, length, left) { - const bytes2 = getBytes(data); - assert$a(length >= bytes2.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes2), - length, - offset: length + 1 - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes2, length - bytes2.length); - } else { - result.set(bytes2, 0); - } - return hexlify(result); -} -function zeroPadValue(data, length) { - return zeroPad(data, length, true); -} -const BN_0$7 = BigInt(0); -const BN_1$4 = BigInt(1); -const maxValue = 9007199254740991; -function fromTwos(_value2, _width) { - const value = getUint(_value2, "value"); - const width = BigInt(getNumber(_width, "width")); - assert$a(value >> width === BN_0$7, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", - fault: "overflow", - value: _value2 - }); - if (value >> width - BN_1$4) { - const mask2 = (BN_1$4 << width) - BN_1$4; - return -((~value & mask2) + BN_1$4); - } - return value; -} -function toTwos(_value2, _width) { - let value = getBigInt(_value2, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = BN_1$4 << width - BN_1$4; - if (value < BN_0$7) { - value = -value; - assert$a(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value2 - }); - const mask2 = (BN_1$4 << width) - BN_1$4; - return (~value & mask2) + BN_1$4; - } else { - assert$a(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value2 - }); - } - return value; -} -function mask(_value2, _bits) { - const value = getUint(_value2, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & (BN_1$4 << bits) - BN_1$4; -} -function getBigInt(value, name2) { - switch (typeof value) { - case "bigint": - return value; - case "number": - assertArgument(Number.isInteger(value), "underflow", name2 || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name2 || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } catch (e18) { - assertArgument(false, `invalid BigNumberish string: ${e18.message}`, name2 || "value", value); - } - } - assertArgument(false, "invalid BigNumberish value", name2 || "value", value); -} -function getUint(value, name2) { - const result = getBigInt(value, name2); - assert$a(result >= BN_0$7, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", - operation: "getUint", - value - }); - return result; -} -const Nibbles$1 = "0123456789abcdef"; -function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v6 of value) { - result += Nibbles$1[v6 >> 4]; - result += Nibbles$1[v6 & 15]; - } - return BigInt(result); - } - return getBigInt(value); -} -function getNumber(value, name2) { - switch (typeof value) { - case "bigint": - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name2 || "value", value); - return Number(value); - case "number": - assertArgument(Number.isInteger(value), "underflow", name2 || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name2 || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name2); - } catch (e18) { - assertArgument(false, `invalid numeric string: ${e18.message}`, name2 || "value", value); - } - } - assertArgument(false, "invalid numeric value", name2 || "value", value); -} -function toNumber(value) { - return getNumber(toBigInt(value)); -} -function toBeHex(_value2, _width) { - const value = getUint(_value2, "value"); - let result = value.toString(16); - if (_width == null) { - if (result.length % 2) { - result = "0" + result; - } - } else { - const width = getNumber(_width, "width"); - assert$a(width * 2 >= result.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value2 - }); - while (result.length < width * 2) { - result = "0" + result; - } - } - return "0x" + result; -} -function toBeArray(_value2) { - const value = getUint(_value2, "value"); - if (value === BN_0$7) { - return new Uint8Array([]); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - const result = new Uint8Array(hex.length / 2); - for (let i3 = 0; i3 < result.length; i3++) { - const offset2 = i3 * 2; - result[i3] = parseInt(hex.substring(offset2, offset2 + 2), 16); - } - return result; -} -function toQuantity(value) { - let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; -} -const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -let Lookup = null; -function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i3 = 0; i3 < Alphabet.length; i3++) { - Lookup[Alphabet[i3]] = BigInt(i3); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; -} -const BN_0$6 = BigInt(0); -const BN_58 = BigInt(58); -function encodeBase58(_value2) { - const bytes2 = getBytes(_value2); - let value = toBigInt(bytes2); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - for (let i3 = 0; i3 < bytes2.length; i3++) { - if (bytes2[i3]) { - break; - } - result = Alphabet[0] + result; - } - return result; -} -function decodeBase58(value) { - let result = BN_0$6; - for (let i3 = 0; i3 < value.length; i3++) { - result *= BN_58; - result += getAlpha(value[i3]); - } - return result; -} -function errorFunc(reason, offset2, bytes2, output2, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset2}; ${reason}`, "bytes", bytes2); -} -function ignoreFunc(reason, offset2, bytes2, output2, badCodepoint) { - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i3 = 0; - for (let o2 = offset2 + 1; o2 < bytes2.length; o2++) { - if (bytes2[o2] >> 6 !== 2) { - break; - } - i3++; - } - return i3; - } - if (reason === "OVERRUN") { - return bytes2.length - offset2 - 1; - } - return 0; -} -function replaceFunc(reason, offset2, bytes2, output2, badCodepoint) { - if (reason === "OVERLONG") { - assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output2.push(badCodepoint); - return 0; - } - output2.push(65533); - return ignoreFunc(reason, offset2, bytes2); -} -const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc -}); -function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes2 = getBytes(_bytes, "bytes"); - const result = []; - let i3 = 0; - while (i3 < bytes2.length) { - const c2 = bytes2[i3++]; - if (c2 >> 7 === 0) { - result.push(c2); - continue; - } - let extraLength = null; - let overlongMask = null; - if ((c2 & 224) === 192) { - extraLength = 1; - overlongMask = 127; - } else if ((c2 & 240) === 224) { - extraLength = 2; - overlongMask = 2047; - } else if ((c2 & 248) === 240) { - extraLength = 3; - overlongMask = 65535; - } else { - if ((c2 & 192) === 128) { - i3 += onError("UNEXPECTED_CONTINUE", i3 - 1, bytes2, result); - } else { - i3 += onError("BAD_PREFIX", i3 - 1, bytes2, result); - } - continue; - } - if (i3 - 1 + extraLength >= bytes2.length) { - i3 += onError("OVERRUN", i3 - 1, bytes2, result); - continue; - } - let res = c2 & (1 << 8 - extraLength - 1) - 1; - for (let j2 = 0; j2 < extraLength; j2++) { - let nextChar = bytes2[i3]; - if ((nextChar & 192) != 128) { - i3 += onError("MISSING_CONTINUE", i3, bytes2, result); - res = null; - break; - } - res = res << 6 | nextChar & 63; - i3++; - } - if (res === null) { - continue; - } - if (res > 1114111) { - i3 += onError("OUT_OF_RANGE", i3 - 1 - extraLength, bytes2, result, res); - continue; - } - if (res >= 55296 && res <= 57343) { - i3 += onError("UTF16_SURROGATE", i3 - 1 - extraLength, bytes2, result, res); - continue; - } - if (res <= overlongMask) { - i3 += onError("OVERLONG", i3 - 1 - extraLength, bytes2, result, res); - continue; - } - result.push(res); - } - return result; -} -function toUtf8Bytes(str, form) { - assertArgument(typeof str === "string", "invalid string value", "str", str); - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - let result = []; - for (let i3 = 0; i3 < str.length; i3++) { - const c2 = str.charCodeAt(i3); - if (c2 < 128) { - result.push(c2); - } else if (c2 < 2048) { - result.push(c2 >> 6 | 192); - result.push(c2 & 63 | 128); - } else if ((c2 & 64512) == 55296) { - i3++; - const c22 = str.charCodeAt(i3); - assertArgument(i3 < str.length && (c22 & 64512) === 56320, "invalid surrogate pair", "str", str); - const pair = 65536 + ((c2 & 1023) << 10) + (c22 & 1023); - result.push(pair >> 18 | 240); - result.push(pair >> 12 & 63 | 128); - result.push(pair >> 6 & 63 | 128); - result.push(pair & 63 | 128); - } else { - result.push(c2 >> 12 | 224); - result.push(c2 >> 6 & 63 | 128); - result.push(c2 & 63 | 128); - } - } - return new Uint8Array(result); -} -function _toUtf8String(codePoints) { - return codePoints.map((codePoint) => { - if (codePoint <= 65535) { - return String.fromCharCode(codePoint); - } - codePoint -= 65536; - return String.fromCharCode((codePoint >> 10 & 1023) + 55296, (codePoint & 1023) + 56320); - }).join(""); -} -function toUtf8String(bytes2, onError) { - return _toUtf8String(getUtf8CodePoints(bytes2, onError)); -} -function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; -} -function unarrayifyInteger(data, offset2, length) { - let result = 0; - for (let i3 = 0; i3 < length; i3++) { - result = result * 256 + data[offset2 + i3]; - } - return result; -} -function _decodeChildren(data, offset2, childOffset, length) { - const result = []; - while (childOffset < offset2 + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - assert$a(childOffset <= offset2 + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, - length, - offset: offset2 - }); - } - return { consumed: 1 + length, result }; -} -function _decode(data, offset2) { - assert$a(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, - length: 0, - offset: 1 - }); - const checkOffset = (offset3) => { - assert$a(offset3 <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, - length: data.length, - offset: offset3 - }); - }; - if (data[offset2] >= 248) { - const lengthLength = data[offset2] - 247; - checkOffset(offset2 + 1 + lengthLength); - const length = unarrayifyInteger(data, offset2 + 1, lengthLength); - checkOffset(offset2 + 1 + lengthLength + length); - return _decodeChildren(data, offset2, offset2 + 1 + lengthLength, lengthLength + length); - } else if (data[offset2] >= 192) { - const length = data[offset2] - 192; - checkOffset(offset2 + 1 + length); - return _decodeChildren(data, offset2, offset2 + 1, length); - } else if (data[offset2] >= 184) { - const lengthLength = data[offset2] - 183; - checkOffset(offset2 + 1 + lengthLength); - const length = unarrayifyInteger(data, offset2 + 1, lengthLength); - checkOffset(offset2 + 1 + lengthLength + length); - const result = hexlify(data.slice(offset2 + 1 + lengthLength, offset2 + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result }; - } else if (data[offset2] >= 128) { - const length = data[offset2] - 128; - checkOffset(offset2 + 1 + length); - const result = hexlify(data.slice(offset2 + 1, offset2 + 1 + length)); - return { consumed: 1 + length, result }; - } - return { consumed: 1, result: hexlifyByte(data[offset2]) }; -} -function decodeRlp(_data5) { - const data = getBytes(_data5, "data"); - const decoded = _decode(data, 0); - assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data5); - return decoded.result; -} -function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 255); - value >>= 8; - } - return result; -} -function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function(child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(192 + payload.length); - return payload; - } - const length2 = arrayifyInteger(payload.length); - length2.unshift(247 + length2.length); - return length2.concat(payload); - } - const data = Array.prototype.slice.call(getBytes(object, "object")); - if (data.length === 1 && data[0] <= 127) { - return data; - } else if (data.length <= 55) { - data.unshift(128 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(183 + length.length); - return length.concat(data); -} -const nibbles = "0123456789abcdef"; -function encodeRlp(object) { - let result = "0x"; - for (const v6 of _encode(object)) { - result += nibbles[v6 >> 4]; - result += nibbles[v6 & 15]; - } - return result; -} -function uuidV4(randomBytes2) { - const bytes2 = getBytes(randomBytes2, "randomBytes"); - bytes2[6] = bytes2[6] & 15 | 64; - bytes2[8] = bytes2[8] & 63 | 128; - const value = hexlify(bytes2); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34) - ].join("-"); -} -const WordSize = 32; -const Padding = new Uint8Array(WordSize); -const passProperties = ["then"]; -const _guard$5 = {}; -const resultNames = /* @__PURE__ */ new WeakMap(); -function getNames(result) { - return resultNames.get(result); -} -function setNames(result, names) { - resultNames.set(result, names); -} -function throwError(name2, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name2}`); - wrapped.error = error; - throw wrapped; -} -function toObject(names, items, deep) { - if (names.indexOf(null) >= 0) { - return items.map((item, index2) => { - if (item instanceof Result) { - return toObject(getNames(item), item, deep); - } - return item; - }); - } - return names.reduce((accum, name2, index2) => { - let item = items.getValue(name2); - if (!(name2 in accum)) { - if (deep && item instanceof Result) { - item = toObject(getNames(item), item, deep); - } - accum[name2] = item; - } - return accum; - }, {}); -} -const _Result = class _Result extends Array { - /** - * @private - */ - constructor(...args) { - const guard2 = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap2 = true; - if (guard2 !== _guard$5) { - items = args; - names = []; - wrap2 = false; - } - super(items.length); - // No longer used; but cannot be removed as it will remove the - // #private field from the .d.ts which may break backwards - // compatibility - __privateAdd(this, _names, void 0); - items.forEach((item, index2) => { - this[index2] = item; - }); - const nameCounts = names.reduce((accum, name2) => { - if (typeof name2 === "string") { - accum.set(name2, (accum.get(name2) || 0) + 1); - } - return accum; - }, /* @__PURE__ */ new Map()); - setNames(this, Object.freeze(items.map((item, index2) => { - const name2 = names[index2]; - if (name2 != null && nameCounts.get(name2) === 1) { - return name2; - } - return null; - }))); - __privateSet(this, _names, []); - if (__privateGet(this, _names) == null) { - void __privateGet(this, _names); - } - if (!wrap2) { - return; - } - Object.freeze(this); - const proxy = new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof prop === "string") { - if (prop.match(/^[0-9]+$/)) { - const index2 = getNumber(prop, "%index"); - if (index2 < 0 || index2 >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index2]; - if (item instanceof Error) { - throwError(`index ${index2}`, item); - } - return item; - } - if (passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - return function(...args2) { - return value.apply(this === receiver ? target : this, args2); - }; - } else if (!(prop in target)) { - return target.getValue.apply(this === receiver ? target : this, [prop]); - } - } - return Reflect.get(target, prop, receiver); - } - }); - setNames(proxy, getNames(this)); - return proxy; - } - /** - * Returns the Result as a normal Array. If %%deep%%, any children - * which are Result objects are also converted to a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(deep) { - const result = []; - this.forEach((item, index2) => { - if (item instanceof Error) { - throwError(`index ${index2}`, item); - } - if (deep && item instanceof _Result) { - item = item.toArray(deep); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. If - * %%deep%%, any children which are Result objects are also - * converted to an Object. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(deep) { - const names = getNames(this); - return names.reduce((accum, name2, index2) => { - assert$a(name2 != null, `value at index ${index2} unnamed`, "UNSUPPORTED_OPERATION", { - operation: "toObject()" - }); - return toObject(names, this, deep); - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const _names2 = getNames(this); - const result = [], names = []; - for (let i3 = start; i3 < end; i3++) { - result.push(this[i3]); - names.push(_names2[i3]); - } - return new _Result(_guard$5, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const _names2 = getNames(this); - const result = [], names = []; - for (let i3 = 0; i3 < this.length; i3++) { - const item = this[i3]; - if (item instanceof Error) { - throwError(`index ${i3}`, item); - } - if (callback.call(thisArg, item, i3, this)) { - result.push(item); - names.push(_names2[i3]); - } - } - return new _Result(_guard$5, result, names); - } - /** - * @_ignore - */ - map(callback, thisArg) { - const result = []; - for (let i3 = 0; i3 < this.length; i3++) { - const item = this[i3]; - if (item instanceof Error) { - throwError(`index ${i3}`, item); - } - result.push(callback.call(thisArg, item, i3, this)); - } - return result; - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name2) { - const index2 = getNames(this).indexOf(name2); - if (index2 === -1) { - return void 0; - } - const value = this[index2]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name2)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys2) { - return new _Result(_guard$5, items, keys2); - } -}; -_names = new WeakMap(); -let Result = _Result; -function getValue(value) { - let bytes2 = toBeArray(value); - assert$a(bytes2.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes2, length: WordSize, offset: bytes2.length }); - if (bytes2.length !== WordSize) { - bytes2 = getBytesCopy(concat$1([Padding.slice(bytes2.length % WordSize), bytes2])); - } - return bytes2; -} -class Coder { - constructor(name2, type2, localName, dynamic) { - // The coder name: - // - address, uint256, tuple, array, etc. - __publicField(this, "name"); - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - __publicField(this, "type"); - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - __publicField(this, "localName"); - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - __publicField(this, "dynamic"); - defineProperties(this, { name: name2, type: type2, localName, dynamic }, { - name: "string", - type: "string", - localName: "string", - dynamic: "boolean" - }); - } - _throwError(message2, value) { - assertArgument(false, message2, this.localName, value); - } -} -class Writer { - constructor() { - __privateAdd(this, _writeData); - // An array of WordSize lengthed objects to concatenation - __privateAdd(this, _data, void 0); - __privateAdd(this, _dataLength, void 0); - __privateSet(this, _data, []); - __privateSet(this, _dataLength, 0); - } - get data() { - return concat$1(__privateGet(this, _data)); - } - get length() { - return __privateGet(this, _dataLength); - } - appendWriter(writer) { - return __privateMethod(this, _writeData, writeData_fn).call(this, getBytesCopy(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes2 = getBytesCopy(value); - const paddingOffset = bytes2.length % WordSize; - if (paddingOffset) { - bytes2 = getBytesCopy(concat$1([bytes2, Padding.slice(paddingOffset)])); - } - return __privateMethod(this, _writeData, writeData_fn).call(this, bytes2); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return __privateMethod(this, _writeData, writeData_fn).call(this, getValue(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset2 = __privateGet(this, _data).length; - __privateGet(this, _data).push(Padding); - __privateSet(this, _dataLength, __privateGet(this, _dataLength) + WordSize); - return (value) => { - __privateGet(this, _data)[offset2] = getValue(value); - }; - } -} -_data = new WeakMap(); -_dataLength = new WeakMap(); -_writeData = new WeakSet(); -writeData_fn = function(data) { - __privateGet(this, _data).push(data); - __privateSet(this, _dataLength, __privateGet(this, _dataLength) + data.length); - return data.length; -}; -const _Reader = class _Reader { - constructor(data, allowLoose, maxInflation) { - __privateAdd(this, _incrementBytesRead); - __privateAdd(this, _peekBytes); - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - __publicField(this, "allowLoose"); - __privateAdd(this, _data2, void 0); - __privateAdd(this, _offset, void 0); - __privateAdd(this, _bytesRead, void 0); - __privateAdd(this, _parent, void 0); - __privateAdd(this, _maxInflation, void 0); - defineProperties(this, { allowLoose: !!allowLoose }); - __privateSet(this, _data2, getBytesCopy(data)); - __privateSet(this, _bytesRead, 0); - __privateSet(this, _parent, null); - __privateSet(this, _maxInflation, maxInflation != null ? maxInflation : 1024); - __privateSet(this, _offset, 0); - } - get data() { - return hexlify(__privateGet(this, _data2)); - } - get dataLength() { - return __privateGet(this, _data2).length; - } - get consumed() { - return __privateGet(this, _offset); - } - get bytes() { - return new Uint8Array(__privateGet(this, _data2)); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset2) { - const reader = new _Reader(__privateGet(this, _data2).slice(__privateGet(this, _offset) + offset2), this.allowLoose, __privateGet(this, _maxInflation)); - __privateSet(reader, _parent, this); - return reader; - } - // Read bytes - readBytes(length, loose) { - let bytes2 = __privateMethod(this, _peekBytes, peekBytes_fn).call(this, 0, length, !!loose); - __privateMethod(this, _incrementBytesRead, incrementBytesRead_fn).call(this, length); - __privateSet(this, _offset, __privateGet(this, _offset) + bytes2.length); - return bytes2.slice(0, length); - } - // Read a numeric values - readValue() { - return toBigInt(this.readBytes(WordSize)); - } - readIndex() { - return toNumber(this.readBytes(WordSize)); - } -}; -_data2 = new WeakMap(); -_offset = new WeakMap(); -_bytesRead = new WeakMap(); -_parent = new WeakMap(); -_maxInflation = new WeakMap(); -_incrementBytesRead = new WeakSet(); -incrementBytesRead_fn = function(count) { - var _a3; - if (__privateGet(this, _parent)) { - return __privateMethod(_a3 = __privateGet(this, _parent), _incrementBytesRead, incrementBytesRead_fn).call(_a3, count); - } - __privateSet(this, _bytesRead, __privateGet(this, _bytesRead) + count); - assert$a(__privateGet(this, _maxInflation) < 1 || __privateGet(this, _bytesRead) <= __privateGet(this, _maxInflation) * this.dataLength, `compressed ABI data exceeds inflation ratio of ${__privateGet(this, _maxInflation)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", { - buffer: getBytesCopy(__privateGet(this, _data2)), - offset: __privateGet(this, _offset), - length: count, - info: { - bytesRead: __privateGet(this, _bytesRead), - dataLength: this.dataLength - } - }); -}; -_peekBytes = new WeakSet(); -peekBytes_fn = function(offset2, length, loose) { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (__privateGet(this, _offset) + alignedLength > __privateGet(this, _data2).length) { - if (this.allowLoose && loose && __privateGet(this, _offset) + length <= __privateGet(this, _data2).length) { - alignedLength = length; - } else { - assert$a(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(__privateGet(this, _data2)), - length: __privateGet(this, _data2).length, - offset: __privateGet(this, _offset) + alignedLength - }); - } - } - return __privateGet(this, _data2).slice(__privateGet(this, _offset), __privateGet(this, _offset) + alignedLength); -}; -let Reader = _Reader; -function number(n4) { - if (!Number.isSafeInteger(n4) || n4 < 0) - throw new Error(`Wrong positive integer: ${n4}`); -} -function bytes(b2, ...lengths) { - if (!(b2 instanceof Uint8Array)) - throw new Error("Expected Uint8Array"); - if (lengths.length > 0 && !lengths.includes(b2.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b2.length}`); -} -function hash$3(hash3) { - if (typeof hash3 !== "function" || typeof hash3.create !== "function") - throw new Error("Hash should be wrapped by utils.wrapConstructor"); - number(hash3.outputLen); - number(hash3.blockLen); -} -function exists(instance2, checkFinished = true) { - if (instance2.destroyed) - throw new Error("Hash instance has been destroyed"); - if (checkFinished && instance2.finished) - throw new Error("Hash#digest() has already been called"); -} -function output(out, instance2) { - bytes(out); - const min = instance2.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} -const crypto$5 = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const u8a$1 = (a3) => a3 instanceof Uint8Array; -const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -const rotr = (word, shift) => word << 32 - shift | word >>> shift; -const isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; -if (!isLE) - throw new Error("Non little-endian hardware is not supported"); -const nextTick = async () => { -}; -async function asyncLoop(iters, tick, cb2) { - let ts2 = Date.now(); - for (let i3 = 0; i3 < iters; i3++) { - cb2(i3); - const diff = Date.now() - ts2; - if (diff >= 0 && diff < tick) - continue; - await nextTick(); - ts2 += diff; - } -} -function utf8ToBytes$1(str) { - if (typeof str !== "string") - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); -} -function toBytes(data) { - if (typeof data === "string") - data = utf8ToBytes$1(data); - if (!u8a$1(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; -} -function concatBytes$1(...arrays) { - const r2 = new Uint8Array(arrays.reduce((sum, a3) => sum + a3.length, 0)); - let pad3 = 0; - arrays.forEach((a3) => { - if (!u8a$1(a3)) - throw new Error("Uint8Array expected"); - r2.set(a3, pad3); - pad3 += a3.length; - }); - return r2; -} -class Hash3 { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } -} -const toStr = {}.toString; -function checkOpts(defaults2, opts) { - if (opts !== void 0 && toStr.call(opts) !== "[object Object]") - throw new Error("Options should be object or undefined"); - const merged = Object.assign(defaults2, opts); - return merged; -} -function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -function randomBytes$2(bytesLength = 32) { - if (crypto$5 && typeof crypto$5.getRandomValues === "function") { - return crypto$5.getRandomValues(new Uint8Array(bytesLength)); - } - throw new Error("crypto.getRandomValues must be defined"); -} -let HMAC$1 = class HMAC2 extends Hash3 { - constructor(hash3, _key) { - super(); - this.finished = false; - this.destroyed = false; - hash$3(hash3); - const key2 = toBytes(_key); - this.iHash = hash3.create(); - if (typeof this.iHash.update !== "function") - throw new Error("Expected instance of class which extends utils.Hash"); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad3 = new Uint8Array(blockLen); - pad3.set(key2.length > blockLen ? hash3.create().update(key2).digest() : key2); - for (let i3 = 0; i3 < pad3.length; i3++) - pad3[i3] ^= 54; - this.iHash.update(pad3); - this.oHash = hash3.create(); - for (let i3 = 0; i3 < pad3.length; i3++) - pad3[i3] ^= 54 ^ 92; - this.oHash.update(pad3); - pad3.fill(0); - } - update(buf) { - exists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - exists(this); - bytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to2) { - to2 || (to2 = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished: finished2, destroyed, blockLen, outputLen } = this; - to2 = to2; - to2.finished = finished2; - to2.destroyed = destroyed; - to2.blockLen = blockLen; - to2.outputLen = outputLen; - to2.oHash = oHash._cloneInto(to2.oHash); - to2.iHash = iHash._cloneInto(to2.iHash); - return to2; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -}; -const hmac$2 = (hash3, key2, message2) => new HMAC$1(hash3, key2).update(message2).digest(); -hmac$2.create = (hash3, key2) => new HMAC$1(hash3, key2); -function pbkdf2Init(hash3, _password, _salt, _opts) { - hash$3(hash3); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c: c2, dkLen, asyncTick } = opts; - number(c2); - number(dkLen); - number(asyncTick); - if (c2 < 1) - throw new Error("PBKDF2: iterations (c) should be >= 1"); - const password = toBytes(_password); - const salt = toBytes(_salt); - const DK2 = new Uint8Array(dkLen); - const PRF = hmac$2.create(hash3, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c: c2, dkLen, asyncTick, DK: DK2, PRF, PRFSalt }; -} -function pbkdf2Output(PRF, PRFSalt, DK2, prfW, u2) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - u2.fill(0); - return DK2; -} -function pbkdf2$1(hash3, password, salt, opts) { - const { c: c2, dkLen, DK: DK2, PRF, PRFSalt } = pbkdf2Init(hash3, password, salt, opts); - let prfW; - const arr = new Uint8Array(4); - const view = createView(arr); - const u2 = new Uint8Array(PRF.outputLen); - for (let ti2 = 1, pos = 0; pos < dkLen; ti2++, pos += PRF.outputLen) { - const Ti2 = DK2.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti2, false); - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u2); - Ti2.set(u2.subarray(0, Ti2.length)); - for (let ui2 = 1; ui2 < c2; ui2++) { - PRF._cloneInto(prfW).update(u2).digestInto(u2); - for (let i3 = 0; i3 < Ti2.length; i3++) - Ti2[i3] ^= u2[i3]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK2, prfW, u2); -} -function setBigUint64(view, byteOffset, value, isLE2) { - if (typeof view.setBigUint64 === "function") - return view.setBigUint64(byteOffset, value, isLE2); - const _32n2 = BigInt(32); - const _u32_max = BigInt(4294967295); - const wh2 = Number(value >> _32n2 & _u32_max); - const wl = Number(value & _u32_max); - const h4 = isLE2 ? 4 : 0; - const l2 = isLE2 ? 0 : 4; - view.setUint32(byteOffset + h4, wh2, isLE2); - view.setUint32(byteOffset + l2, wl, isLE2); -} -class SHA2 extends Hash3 { - constructor(blockLen, outputLen, padOffset, isLE2) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE2; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer: buffer2, blockLen } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer2.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - exists(this); - output(out, this); - this.finished = true; - const { buffer: buffer2, view, blockLen, isLE: isLE2 } = this; - let { pos } = this; - buffer2[pos++] = 128; - this.buffer.subarray(pos).fill(0); - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - for (let i3 = pos; i3 < blockLen; i3++) - buffer2[i3] = 0; - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - if (len % 4) - throw new Error("_sha2: outputLen should be aligned to 32bit"); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error("_sha2: outputLen bigger than state"); - for (let i3 = 0; i3 < outLen; i3++) - oview.setUint32(4 * i3, state[i3], isLE2); - } - digest() { - const { buffer: buffer2, outputLen } = this; - this.digestInto(buffer2); - const res = buffer2.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to2) { - to2 || (to2 = new this.constructor()); - to2.set(...this.get()); - const { blockLen, buffer: buffer2, length, finished: finished2, destroyed, pos } = this; - to2.length = length; - to2.pos = pos; - to2.finished = finished2; - to2.destroyed = destroyed; - if (length % blockLen) - to2.buffer.set(buffer2); - return to2; - } -} -const Chi = (a3, b2, c2) => a3 & b2 ^ ~a3 & c2; -const Maj = (a3, b2, c2) => a3 & b2 ^ a3 & c2 ^ b2 & c2; -const SHA256_K = /* @__PURE__ */ new Uint32Array([ - 1116352408, - 1899447441, - 3049323471, - 3921009573, - 961987163, - 1508970993, - 2453635748, - 2870763221, - 3624381080, - 310598401, - 607225278, - 1426881987, - 1925078388, - 2162078206, - 2614888103, - 3248222580, - 3835390401, - 4022224774, - 264347078, - 604807628, - 770255983, - 1249150122, - 1555081692, - 1996064986, - 2554220882, - 2821834349, - 2952996808, - 3210313671, - 3336571891, - 3584528711, - 113926993, - 338241895, - 666307205, - 773529912, - 1294757372, - 1396182291, - 1695183700, - 1986661051, - 2177026350, - 2456956037, - 2730485921, - 2820302411, - 3259730800, - 3345764771, - 3516065817, - 3600352804, - 4094571909, - 275423344, - 430227734, - 506948616, - 659060556, - 883997877, - 958139571, - 1322822218, - 1537002063, - 1747873779, - 1955562222, - 2024104815, - 2227730452, - 2361852424, - 2428436474, - 2756734187, - 3204031479, - 3329325298 -]); -const IV = /* @__PURE__ */ new Uint32Array([ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 -]); -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -let SHA256$1 = class SHA2562 extends SHA2 { - constructor() { - super(64, 32, 8, false); - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A: A2, B: B2, C: C3, D: D2, E: E2, F: F2, G: G2, H: H2 } = this; - return [A2, B2, C3, D2, E2, F2, G2, H2]; - } - // prettier-ignore - set(A2, B2, C3, D2, E2, F2, G2, H2) { - this.A = A2 | 0; - this.B = B2 | 0; - this.C = C3 | 0; - this.D = D2 | 0; - this.E = E2 | 0; - this.F = F2 | 0; - this.G = G2 | 0; - this.H = H2 | 0; - } - process(view, offset2) { - for (let i3 = 0; i3 < 16; i3++, offset2 += 4) - SHA256_W[i3] = view.getUint32(offset2, false); - for (let i3 = 16; i3 < 64; i3++) { - const W15 = SHA256_W[i3 - 15]; - const W2 = SHA256_W[i3 - 2]; - const s02 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3; - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10; - SHA256_W[i3] = s1 + SHA256_W[i3 - 7] + s02 + SHA256_W[i3 - 16] | 0; - } - let { A: A2, B: B2, C: C3, D: D2, E: E2, F: F2, G: G2, H: H2 } = this; - for (let i3 = 0; i3 < 64; i3++) { - const sigma1 = rotr(E2, 6) ^ rotr(E2, 11) ^ rotr(E2, 25); - const T12 = H2 + sigma1 + Chi(E2, F2, G2) + SHA256_K[i3] + SHA256_W[i3] | 0; - const sigma0 = rotr(A2, 2) ^ rotr(A2, 13) ^ rotr(A2, 22); - const T22 = sigma0 + Maj(A2, B2, C3) | 0; - H2 = G2; - G2 = F2; - F2 = E2; - E2 = D2 + T12 | 0; - D2 = C3; - C3 = B2; - B2 = A2; - A2 = T12 + T22 | 0; - } - A2 = A2 + this.A | 0; - B2 = B2 + this.B | 0; - C3 = C3 + this.C | 0; - D2 = D2 + this.D | 0; - E2 = E2 + this.E | 0; - F2 = F2 + this.F | 0; - G2 = G2 + this.G | 0; - H2 = H2 + this.H | 0; - this.set(A2, B2, C3, D2, E2, F2, G2, H2); - } - roundClean() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } -}; -const sha256$2 = /* @__PURE__ */ wrapConstructor(() => new SHA256$1()); -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -function fromBig(n4, le2 = false) { - if (le2) - return { h: Number(n4 & U32_MASK64), l: Number(n4 >> _32n & U32_MASK64) }; - return { h: Number(n4 >> _32n & U32_MASK64) | 0, l: Number(n4 & U32_MASK64) | 0 }; -} -function split(lst, le2 = false) { - let Ah2 = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i3 = 0; i3 < lst.length; i3++) { - const { h: h4, l: l2 } = fromBig(lst[i3], le2); - [Ah2[i3], Al[i3]] = [h4, l2]; - } - return [Ah2, Al]; -} -const toBig = (h4, l2) => BigInt(h4 >>> 0) << _32n | BigInt(l2 >>> 0); -const shrSH = (h4, _l2, s2) => h4 >>> s2; -const shrSL = (h4, l2, s2) => h4 << 32 - s2 | l2 >>> s2; -const rotrSH = (h4, l2, s2) => h4 >>> s2 | l2 << 32 - s2; -const rotrSL = (h4, l2, s2) => h4 << 32 - s2 | l2 >>> s2; -const rotrBH = (h4, l2, s2) => h4 << 64 - s2 | l2 >>> s2 - 32; -const rotrBL = (h4, l2, s2) => h4 >>> s2 - 32 | l2 << 64 - s2; -const rotr32H = (_h3, l2) => l2; -const rotr32L = (h4, _l2) => h4; -const rotlSH = (h4, l2, s2) => h4 << s2 | l2 >>> 32 - s2; -const rotlSL = (h4, l2, s2) => l2 << s2 | h4 >>> 32 - s2; -const rotlBH = (h4, l2, s2) => l2 << s2 - 32 | h4 >>> 64 - s2; -const rotlBL = (h4, l2, s2) => h4 << s2 - 32 | l2 >>> 64 - s2; -function add(Ah2, Al, Bh2, Bl) { - const l2 = (Al >>> 0) + (Bl >>> 0); - return { h: Ah2 + Bh2 + (l2 / 2 ** 32 | 0) | 0, l: l2 | 0 }; -} -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low, Ah2, Bh2, Ch2) => Ah2 + Bh2 + Ch2 + (low / 2 ** 32 | 0) | 0; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low, Ah2, Bh2, Ch2, Dh2) => Ah2 + Bh2 + Ch2 + Dh2 + (low / 2 ** 32 | 0) | 0; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low, Ah2, Bh2, Ch2, Dh2, Eh2) => Ah2 + Bh2 + Ch2 + Dh2 + Eh2 + (low / 2 ** 32 | 0) | 0; -const u64 = { - fromBig, - split, - toBig, - shrSH, - shrSL, - rotrSH, - rotrSL, - rotrBH, - rotrBL, - rotr32H, - rotr32L, - rotlSH, - rotlSL, - rotlBH, - rotlBL, - add, - add3L, - add3H, - add4L, - add4H, - add5H, - add5L -}; -const u64$1 = u64; -const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64$1.split([ - "0x428a2f98d728ae22", - "0x7137449123ef65cd", - "0xb5c0fbcfec4d3b2f", - "0xe9b5dba58189dbbc", - "0x3956c25bf348b538", - "0x59f111f1b605d019", - "0x923f82a4af194f9b", - "0xab1c5ed5da6d8118", - "0xd807aa98a3030242", - "0x12835b0145706fbe", - "0x243185be4ee4b28c", - "0x550c7dc3d5ffb4e2", - "0x72be5d74f27b896f", - "0x80deb1fe3b1696b1", - "0x9bdc06a725c71235", - "0xc19bf174cf692694", - "0xe49b69c19ef14ad2", - "0xefbe4786384f25e3", - "0x0fc19dc68b8cd5b5", - "0x240ca1cc77ac9c65", - "0x2de92c6f592b0275", - "0x4a7484aa6ea6e483", - "0x5cb0a9dcbd41fbd4", - "0x76f988da831153b5", - "0x983e5152ee66dfab", - "0xa831c66d2db43210", - "0xb00327c898fb213f", - "0xbf597fc7beef0ee4", - "0xc6e00bf33da88fc2", - "0xd5a79147930aa725", - "0x06ca6351e003826f", - "0x142929670a0e6e70", - "0x27b70a8546d22ffc", - "0x2e1b21385c26c926", - "0x4d2c6dfc5ac42aed", - "0x53380d139d95b3df", - "0x650a73548baf63de", - "0x766a0abb3c77b2a8", - "0x81c2c92e47edaee6", - "0x92722c851482353b", - "0xa2bfe8a14cf10364", - "0xa81a664bbc423001", - "0xc24b8b70d0f89791", - "0xc76c51a30654be30", - "0xd192e819d6ef5218", - "0xd69906245565a910", - "0xf40e35855771202a", - "0x106aa07032bbd1b8", - "0x19a4c116b8d2d0c8", - "0x1e376c085141ab53", - "0x2748774cdf8eeb99", - "0x34b0bcb5e19b48a8", - "0x391c0cb3c5c95a63", - "0x4ed8aa4ae3418acb", - "0x5b9cca4f7763e373", - "0x682e6ff3d6b2b8a3", - "0x748f82ee5defb2fc", - "0x78a5636f43172f60", - "0x84c87814a1f0ab72", - "0x8cc702081a6439ec", - "0x90befffa23631e28", - "0xa4506cebde82bde9", - "0xbef9a3f7b2c67915", - "0xc67178f2e372532b", - "0xca273eceea26619c", - "0xd186b8c721c0c207", - "0xeada7dd6cde0eb1e", - "0xf57d4f7fee6ed178", - "0x06f067aa72176fba", - "0x0a637dc5a2c898a6", - "0x113f9804bef90dae", - "0x1b710b35131c471b", - "0x28db77f523047d84", - "0x32caab7b40c72493", - "0x3c9ebe0a15c9bebc", - "0x431d67c49c100d4c", - "0x4cc5d4becb3e42b6", - "0x597f299cfc657e2a", - "0x5fcb6fab3ad6faec", - "0x6c44198c4a475817" -].map((n4) => BigInt(n4))))(); -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -class SHA5122 extends SHA2 { - constructor() { - super(128, 64, 16, false); - this.Ah = 1779033703 | 0; - this.Al = 4089235720 | 0; - this.Bh = 3144134277 | 0; - this.Bl = 2227873595 | 0; - this.Ch = 1013904242 | 0; - this.Cl = 4271175723 | 0; - this.Dh = 2773480762 | 0; - this.Dl = 1595750129 | 0; - this.Eh = 1359893119 | 0; - this.El = 2917565137 | 0; - this.Fh = 2600822924 | 0; - this.Fl = 725511199 | 0; - this.Gh = 528734635 | 0; - this.Gl = 4215389547 | 0; - this.Hh = 1541459225 | 0; - this.Hl = 327033209 | 0; - } - // prettier-ignore - get() { - const { Ah: Ah2, Al, Bh: Bh2, Bl, Ch: Ch2, Cl, Dh: Dh2, Dl, Eh: Eh2, El, Fh: Fh2, Fl, Gh: Gh2, Gl, Hh: Hh2, Hl } = this; - return [Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl]; - } - // prettier-ignore - set(Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl) { - this.Ah = Ah2 | 0; - this.Al = Al | 0; - this.Bh = Bh2 | 0; - this.Bl = Bl | 0; - this.Ch = Ch2 | 0; - this.Cl = Cl | 0; - this.Dh = Dh2 | 0; - this.Dl = Dl | 0; - this.Eh = Eh2 | 0; - this.El = El | 0; - this.Fh = Fh2 | 0; - this.Fl = Fl | 0; - this.Gh = Gh2 | 0; - this.Gl = Gl | 0; - this.Hh = Hh2 | 0; - this.Hl = Hl | 0; - } - process(view, offset2) { - for (let i3 = 0; i3 < 16; i3++, offset2 += 4) { - SHA512_W_H[i3] = view.getUint32(offset2); - SHA512_W_L[i3] = view.getUint32(offset2 += 4); - } - for (let i3 = 16; i3 < 80; i3++) { - const W15h = SHA512_W_H[i3 - 15] | 0; - const W15l = SHA512_W_L[i3 - 15] | 0; - const s0h = u64$1.rotrSH(W15h, W15l, 1) ^ u64$1.rotrSH(W15h, W15l, 8) ^ u64$1.shrSH(W15h, W15l, 7); - const s0l = u64$1.rotrSL(W15h, W15l, 1) ^ u64$1.rotrSL(W15h, W15l, 8) ^ u64$1.shrSL(W15h, W15l, 7); - const W2h = SHA512_W_H[i3 - 2] | 0; - const W2l = SHA512_W_L[i3 - 2] | 0; - const s1h = u64$1.rotrSH(W2h, W2l, 19) ^ u64$1.rotrBH(W2h, W2l, 61) ^ u64$1.shrSH(W2h, W2l, 6); - const s1l = u64$1.rotrSL(W2h, W2l, 19) ^ u64$1.rotrBL(W2h, W2l, 61) ^ u64$1.shrSL(W2h, W2l, 6); - const SUMl = u64$1.add4L(s0l, s1l, SHA512_W_L[i3 - 7], SHA512_W_L[i3 - 16]); - const SUMh = u64$1.add4H(SUMl, s0h, s1h, SHA512_W_H[i3 - 7], SHA512_W_H[i3 - 16]); - SHA512_W_H[i3] = SUMh | 0; - SHA512_W_L[i3] = SUMl | 0; - } - let { Ah: Ah2, Al, Bh: Bh2, Bl, Ch: Ch2, Cl, Dh: Dh2, Dl, Eh: Eh2, El, Fh: Fh2, Fl, Gh: Gh2, Gl, Hh: Hh2, Hl } = this; - for (let i3 = 0; i3 < 80; i3++) { - const sigma1h = u64$1.rotrSH(Eh2, El, 14) ^ u64$1.rotrSH(Eh2, El, 18) ^ u64$1.rotrBH(Eh2, El, 41); - const sigma1l = u64$1.rotrSL(Eh2, El, 14) ^ u64$1.rotrSL(Eh2, El, 18) ^ u64$1.rotrBL(Eh2, El, 41); - const CHIh = Eh2 & Fh2 ^ ~Eh2 & Gh2; - const CHIl = El & Fl ^ ~El & Gl; - const T1ll = u64$1.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i3], SHA512_W_L[i3]); - const T1h = u64$1.add5H(T1ll, Hh2, sigma1h, CHIh, SHA512_Kh[i3], SHA512_W_H[i3]); - const T1l = T1ll | 0; - const sigma0h = u64$1.rotrSH(Ah2, Al, 28) ^ u64$1.rotrBH(Ah2, Al, 34) ^ u64$1.rotrBH(Ah2, Al, 39); - const sigma0l = u64$1.rotrSL(Ah2, Al, 28) ^ u64$1.rotrBL(Ah2, Al, 34) ^ u64$1.rotrBL(Ah2, Al, 39); - const MAJh = Ah2 & Bh2 ^ Ah2 & Ch2 ^ Bh2 & Ch2; - const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; - Hh2 = Gh2 | 0; - Hl = Gl | 0; - Gh2 = Fh2 | 0; - Gl = Fl | 0; - Fh2 = Eh2 | 0; - Fl = El | 0; - ({ h: Eh2, l: El } = u64$1.add(Dh2 | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh2 = Ch2 | 0; - Dl = Cl | 0; - Ch2 = Bh2 | 0; - Cl = Bl | 0; - Bh2 = Ah2 | 0; - Bl = Al | 0; - const All = u64$1.add3L(T1l, sigma0l, MAJl); - Ah2 = u64$1.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - ({ h: Ah2, l: Al } = u64$1.add(this.Ah | 0, this.Al | 0, Ah2 | 0, Al | 0)); - ({ h: Bh2, l: Bl } = u64$1.add(this.Bh | 0, this.Bl | 0, Bh2 | 0, Bl | 0)); - ({ h: Ch2, l: Cl } = u64$1.add(this.Ch | 0, this.Cl | 0, Ch2 | 0, Cl | 0)); - ({ h: Dh2, l: Dl } = u64$1.add(this.Dh | 0, this.Dl | 0, Dh2 | 0, Dl | 0)); - ({ h: Eh2, l: El } = u64$1.add(this.Eh | 0, this.El | 0, Eh2 | 0, El | 0)); - ({ h: Fh2, l: Fl } = u64$1.add(this.Fh | 0, this.Fl | 0, Fh2 | 0, Fl | 0)); - ({ h: Gh2, l: Gl } = u64$1.add(this.Gh | 0, this.Gl | 0, Gh2 | 0, Gl | 0)); - ({ h: Hh2, l: Hl } = u64$1.add(this.Hh | 0, this.Hl | 0, Hh2 | 0, Hl | 0)); - this.set(Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl); - } - roundClean() { - SHA512_W_H.fill(0); - SHA512_W_L.fill(0); - } - destroy() { - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -const sha512$1 = /* @__PURE__ */ wrapConstructor(() => new SHA5122()); -function getGlobal() { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); -} -const anyGlobal = getGlobal(); -const crypto$4 = anyGlobal.crypto || anyGlobal.msCrypto; -function createHash(algo) { - switch (algo) { - case "sha256": - return sha256$2.create(); - case "sha512": - return sha512$1.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); -} -function createHmac(_algo, key2) { - const algo = { sha256: sha256$2, sha512: sha512$1 }[_algo]; - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac$2.create(algo, key2); -} -function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = { sha256: sha256$2, sha512: sha512$1 }[_algo]; - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2$1(algo, password, salt, { c: iterations, dkLen: keylen }); -} -function randomBytes$1(length) { - assert$a(crypto$4 != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes" - }); - assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto$4.getRandomValues(result); - return result; -} -let locked$4 = false; -const _computeHmac = function(algorithm, key2, data) { - return createHmac(algorithm, key2).update(data).digest(); -}; -let __computeHmac = _computeHmac; -function computeHmac(algorithm, _key, _data5) { - const key2 = getBytes(_key, "key"); - const data = getBytes(_data5, "data"); - return hexlify(__computeHmac(algorithm, key2, data)); -} -computeHmac._ = _computeHmac; -computeHmac.lock = function() { - locked$4 = true; -}; -computeHmac.register = function(func) { - if (locked$4) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; -}; -Object.freeze(computeHmac); -const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; -const _0n$4 = /* @__PURE__ */ BigInt(0); -const _1n$5 = /* @__PURE__ */ BigInt(1); -const _2n$3 = /* @__PURE__ */ BigInt(2); -const _7n = /* @__PURE__ */ BigInt(7); -const _256n = /* @__PURE__ */ BigInt(256); -const _0x71n = /* @__PURE__ */ BigInt(113); -for (let round = 0, R3 = _1n$5, x3 = 1, y3 = 0; round < 24; round++) { - [x3, y3] = [y3, (2 * x3 + 3 * y3) % 5]; - SHA3_PI.push(2 * (5 * y3 + x3)); - SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64); - let t2 = _0n$4; - for (let j2 = 0; j2 < 7; j2++) { - R3 = (R3 << _1n$5 ^ (R3 >> _7n) * _0x71n) % _256n; - if (R3 & _2n$3) - t2 ^= _1n$5 << (_1n$5 << /* @__PURE__ */ BigInt(j2)) - _1n$5; - } - _SHA3_IOTA.push(t2); -} -const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true); -const rotlH = (h4, l2, s2) => s2 > 32 ? rotlBH(h4, l2, s2) : rotlSH(h4, l2, s2); -const rotlL = (h4, l2, s2) => s2 > 32 ? rotlBL(h4, l2, s2) : rotlSL(h4, l2, s2); -function keccakP(s2, rounds = 24) { - const B2 = new Uint32Array(5 * 2); - for (let round = 24 - rounds; round < 24; round++) { - for (let x3 = 0; x3 < 10; x3++) - B2[x3] = s2[x3] ^ s2[x3 + 10] ^ s2[x3 + 20] ^ s2[x3 + 30] ^ s2[x3 + 40]; - for (let x3 = 0; x3 < 10; x3 += 2) { - const idx1 = (x3 + 8) % 10; - const idx0 = (x3 + 2) % 10; - const B02 = B2[idx0]; - const B1 = B2[idx0 + 1]; - const Th2 = rotlH(B02, B1, 1) ^ B2[idx1]; - const Tl = rotlL(B02, B1, 1) ^ B2[idx1 + 1]; - for (let y3 = 0; y3 < 50; y3 += 10) { - s2[x3 + y3] ^= Th2; - s2[x3 + y3 + 1] ^= Tl; - } - } - let curH = s2[2]; - let curL = s2[3]; - for (let t2 = 0; t2 < 24; t2++) { - const shift = SHA3_ROTL[t2]; - const Th2 = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t2]; - curH = s2[PI]; - curL = s2[PI + 1]; - s2[PI] = Th2; - s2[PI + 1] = Tl; - } - for (let y3 = 0; y3 < 50; y3 += 10) { - for (let x3 = 0; x3 < 10; x3++) - B2[x3] = s2[y3 + x3]; - for (let x3 = 0; x3 < 10; x3++) - s2[y3 + x3] ^= ~B2[(x3 + 2) % 10] & B2[(x3 + 4) % 10]; - } - s2[0] ^= SHA3_IOTA_H[round]; - s2[1] ^= SHA3_IOTA_L[round]; - } - B2.fill(0); -} -class Keccak2 extends Hash3 { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - number(outputLen); - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error("Sha3 supports only keccak-f1600 function"); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - keccak() { - keccakP(this.state32, this.rounds); - this.posOut = 0; - this.pos = 0; - } - update(data) { - exists(this); - const { blockLen, state } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i3 = 0; i3 < take; i3++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - state[pos] ^= suffix; - if ((suffix & 128) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 128; - this.keccak(); - } - writeInto(out) { - exists(this, false); - bytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len; ) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - if (!this.enableXOF) - throw new Error("XOF is not possible for this instance"); - return this.writeInto(out); - } - xof(bytes2) { - number(bytes2); - return this.xofInto(new Uint8Array(bytes2)); - } - digestInto(out) { - output(out, this); - if (this.finished) - throw new Error("digest() was already called"); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to2) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to2 || (to2 = new Keccak2(blockLen, suffix, outputLen, enableXOF, rounds)); - to2.state32.set(this.state32); - to2.pos = this.pos; - to2.posOut = this.posOut; - to2.finished = this.finished; - to2.rounds = rounds; - to2.suffix = suffix; - to2.outputLen = outputLen; - to2.enableXOF = enableXOF; - to2.destroyed = this.destroyed; - return to2; - } -} -const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak2(blockLen, suffix, outputLen)); -const keccak_256 = /* @__PURE__ */ gen(1, 136, 256 / 8); -let locked$3 = false; -const _keccak256 = function(data) { - return keccak_256(data); -}; -let __keccak256 = _keccak256; -function keccak256(_data5) { - const data = getBytes(_data5, "data"); - return hexlify(__keccak256(data)); -} -keccak256._ = _keccak256; -keccak256.lock = function() { - locked$3 = true; -}; -keccak256.register = function(func) { - if (locked$3) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; -}; -Object.freeze(keccak256); -const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); -const Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_3, i3) => i3); -const Pi$2 = /* @__PURE__ */ Id.map((i3) => (9 * i3 + 5) % 16); -let idxL = [Id]; -let idxR = [Pi$2]; -for (let i3 = 0; i3 < 4; i3++) - for (let j2 of [idxL, idxR]) - j2.push(j2[i3].map((k2) => Rho[k2])); -const shifts = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5] -].map((i3) => new Uint8Array(i3)); -const shiftsL = /* @__PURE__ */ idxL.map((idx, i3) => idx.map((j2) => shifts[i3][j2])); -const shiftsR = /* @__PURE__ */ idxR.map((idx, i3) => idx.map((j2) => shifts[i3][j2])); -const Kl = /* @__PURE__ */ new Uint32Array([ - 0, - 1518500249, - 1859775393, - 2400959708, - 2840853838 -]); -const Kr$3 = /* @__PURE__ */ new Uint32Array([ - 1352829926, - 1548603684, - 1836072691, - 2053994217, - 0 -]); -const rotl$1 = (word, shift) => word << shift | word >>> 32 - shift; -function f$3(group, x3, y3, z3) { - if (group === 0) - return x3 ^ y3 ^ z3; - else if (group === 1) - return x3 & y3 | ~x3 & z3; - else if (group === 2) - return (x3 | ~y3) ^ z3; - else if (group === 3) - return x3 & z3 | y3 & ~z3; - else - return x3 ^ (y3 | ~z3); -} -const BUF = /* @__PURE__ */ new Uint32Array(16); -class RIPEMD160 extends SHA2 { - constructor() { - super(64, 20, 8, true); - this.h0 = 1732584193 | 0; - this.h1 = 4023233417 | 0; - this.h2 = 2562383102 | 0; - this.h3 = 271733878 | 0; - this.h4 = 3285377520 | 0; - } - get() { - const { h0, h1, h2: h22, h3: h32, h4 } = this; - return [h0, h1, h22, h32, h4]; - } - set(h0, h1, h22, h32, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h22 | 0; - this.h3 = h32 | 0; - this.h4 = h4 | 0; - } - process(view, offset2) { - for (let i3 = 0; i3 < 16; i3++, offset2 += 4) - BUF[i3] = view.getUint32(offset2, true); - let al2 = this.h0 | 0, ar2 = al2, bl2 = this.h1 | 0, br2 = bl2, cl2 = this.h2 | 0, cr2 = cl2, dl2 = this.h3 | 0, dr3 = dl2, el2 = this.h4 | 0, er2 = el2; - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl[group], hbr = Kr$3[group]; - const rl2 = idxL[group], rr2 = idxR[group]; - const sl2 = shiftsL[group], sr2 = shiftsR[group]; - for (let i3 = 0; i3 < 16; i3++) { - const tl2 = rotl$1(al2 + f$3(group, bl2, cl2, dl2) + BUF[rl2[i3]] + hbl, sl2[i3]) + el2 | 0; - al2 = el2, el2 = dl2, dl2 = rotl$1(cl2, 10) | 0, cl2 = bl2, bl2 = tl2; - } - for (let i3 = 0; i3 < 16; i3++) { - const tr2 = rotl$1(ar2 + f$3(rGroup, br2, cr2, dr3) + BUF[rr2[i3]] + hbr, sr2[i3]) + er2 | 0; - ar2 = er2, er2 = dr3, dr3 = rotl$1(cr2, 10) | 0, cr2 = br2, br2 = tr2; - } - } - this.set(this.h1 + cl2 + dr3 | 0, this.h2 + dl2 + er2 | 0, this.h3 + el2 + ar2 | 0, this.h4 + al2 + br2 | 0, this.h0 + bl2 + cr2 | 0); - } - roundClean() { - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0); - } -} -const ripemd160$1 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160()); -let locked$2 = false; -const _ripemd160 = function(data) { - return ripemd160$1(data); -}; -let __ripemd160 = _ripemd160; -function ripemd160(_data5) { - const data = getBytes(_data5, "data"); - return hexlify(__ripemd160(data)); -} -ripemd160._ = _ripemd160; -ripemd160.lock = function() { - locked$2 = true; -}; -ripemd160.register = function(func) { - if (locked$2) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; -}; -Object.freeze(ripemd160); -let locked$1 = false; -const _pbkdf2 = function(password, salt, iterations, keylen, algo) { - return pbkdf2Sync(password, salt, iterations, keylen, algo); -}; -let __pbkdf2 = _pbkdf2; -function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); -} -pbkdf2._ = _pbkdf2; -pbkdf2.lock = function() { - locked$1 = true; -}; -pbkdf2.register = function(func) { - if (locked$1) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; -}; -Object.freeze(pbkdf2); -let locked = false; -const _randomBytes = function(length) { - return new Uint8Array(randomBytes$1(length)); -}; -let __randomBytes = _randomBytes; -function randomBytes(length) { - return __randomBytes(length); -} -randomBytes._ = _randomBytes; -randomBytes.lock = function() { - locked = true; -}; -randomBytes.register = function(func) { - if (locked) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; -}; -Object.freeze(randomBytes); -const rotl = (a3, b2) => a3 << b2 | a3 >>> 32 - b2; -function XorAndSalsa(prev, pi2, input, ii2, out, oi2) { - let y00 = prev[pi2++] ^ input[ii2++], y01 = prev[pi2++] ^ input[ii2++]; - let y02 = prev[pi2++] ^ input[ii2++], y03 = prev[pi2++] ^ input[ii2++]; - let y04 = prev[pi2++] ^ input[ii2++], y05 = prev[pi2++] ^ input[ii2++]; - let y06 = prev[pi2++] ^ input[ii2++], y07 = prev[pi2++] ^ input[ii2++]; - let y08 = prev[pi2++] ^ input[ii2++], y09 = prev[pi2++] ^ input[ii2++]; - let y10 = prev[pi2++] ^ input[ii2++], y11 = prev[pi2++] ^ input[ii2++]; - let y12 = prev[pi2++] ^ input[ii2++], y13 = prev[pi2++] ^ input[ii2++]; - let y14 = prev[pi2++] ^ input[ii2++], y15 = prev[pi2++] ^ input[ii2++]; - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - for (let i3 = 0; i3 < 8; i3 += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - out[oi2++] = y00 + x00 | 0; - out[oi2++] = y01 + x01 | 0; - out[oi2++] = y02 + x02 | 0; - out[oi2++] = y03 + x03 | 0; - out[oi2++] = y04 + x04 | 0; - out[oi2++] = y05 + x05 | 0; - out[oi2++] = y06 + x06 | 0; - out[oi2++] = y07 + x07 | 0; - out[oi2++] = y08 + x08 | 0; - out[oi2++] = y09 + x09 | 0; - out[oi2++] = y10 + x10 | 0; - out[oi2++] = y11 + x11 | 0; - out[oi2++] = y12 + x12 | 0; - out[oi2++] = y13 + x13 | 0; - out[oi2++] = y14 + x14 | 0; - out[oi2++] = y15 + x15 | 0; -} -function BlockMix(input, ii2, out, oi2, r2) { - let head = oi2 + 0; - let tail = oi2 + 16 * r2; - for (let i3 = 0; i3 < 16; i3++) - out[tail + i3] = input[ii2 + (2 * r2 - 1) * 16 + i3]; - for (let i3 = 0; i3 < r2; i3++, head += 16, ii2 += 16) { - XorAndSalsa(out, tail, input, ii2, out, head); - if (i3 > 0) - tail += 16; - XorAndSalsa(out, head, input, ii2 += 16, out, tail); - } -} -function scryptInit(password, salt, _opts) { - const opts = checkOpts({ - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024 - }, _opts); - const { N: N2, r: r2, p: p3, dkLen, asyncTick, maxmem, onProgress } = opts; - number(N2); - number(r2); - number(p3); - number(dkLen); - number(asyncTick); - number(maxmem); - if (onProgress !== void 0 && typeof onProgress !== "function") - throw new Error("progressCb should be function"); - const blockSize = 128 * r2; - const blockSize32 = blockSize / 4; - if (N2 <= 1 || (N2 & N2 - 1) !== 0 || N2 >= 2 ** (blockSize / 8) || N2 > 2 ** 32) { - throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32"); - } - if (p3 < 0 || p3 > (2 ** 32 - 1) * 32 / blockSize) { - throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)"); - } - if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { - throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32"); - } - const memUsed = blockSize * (N2 + p3); - if (memUsed > maxmem) { - throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`); - } - const B2 = pbkdf2$1(sha256$2, password, salt, { c: 1, dkLen: blockSize * p3 }); - const B32 = u32(B2); - const V3 = u32(new Uint8Array(blockSize * N2)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => { - }; - if (onProgress) { - const totalBlockMix = 2 * N2 * p3; - const callbackPer = Math.max(Math.floor(totalBlockMix / 1e4), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N: N2, r: r2, p: p3, dkLen, blockSize32, V: V3, B32, B: B2, tmp, blockMixCb, asyncTick }; -} -function scryptOutput(password, dkLen, B2, V3, tmp) { - const res = pbkdf2$1(sha256$2, password, B2, { c: 1, dkLen }); - B2.fill(0); - V3.fill(0); - tmp.fill(0); - return res; -} -function scrypt$1(password, salt, opts) { - const { N: N2, r: r2, p: p3, dkLen, blockSize32, V: V3, B32, B: B2, tmp, blockMixCb } = scryptInit(password, salt, opts); - for (let pi2 = 0; pi2 < p3; pi2++) { - const Pi2 = blockSize32 * pi2; - for (let i3 = 0; i3 < blockSize32; i3++) - V3[i3] = B32[Pi2 + i3]; - for (let i3 = 0, pos = 0; i3 < N2 - 1; i3++) { - BlockMix(V3, pos, V3, pos += blockSize32, r2); - blockMixCb(); - } - BlockMix(V3, (N2 - 1) * blockSize32, B32, Pi2, r2); - blockMixCb(); - for (let i3 = 0; i3 < N2; i3++) { - const j2 = B32[Pi2 + blockSize32 - 16] % N2; - for (let k2 = 0; k2 < blockSize32; k2++) - tmp[k2] = B32[Pi2 + k2] ^ V3[j2 * blockSize32 + k2]; - BlockMix(tmp, 0, B32, Pi2, r2); - blockMixCb(); - } - } - return scryptOutput(password, dkLen, B2, V3, tmp); -} -async function scryptAsync(password, salt, opts) { - const { N: N2, r: r2, p: p3, dkLen, blockSize32, V: V3, B32, B: B2, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - for (let pi2 = 0; pi2 < p3; pi2++) { - const Pi2 = blockSize32 * pi2; - for (let i3 = 0; i3 < blockSize32; i3++) - V3[i3] = B32[Pi2 + i3]; - let pos = 0; - await asyncLoop(N2 - 1, asyncTick, () => { - BlockMix(V3, pos, V3, pos += blockSize32, r2); - blockMixCb(); - }); - BlockMix(V3, (N2 - 1) * blockSize32, B32, Pi2, r2); - blockMixCb(); - await asyncLoop(N2, asyncTick, () => { - const j2 = B32[Pi2 + blockSize32 - 16] % N2; - for (let k2 = 0; k2 < blockSize32; k2++) - tmp[k2] = B32[Pi2 + k2] ^ V3[j2 * blockSize32 + k2]; - BlockMix(tmp, 0, B32, Pi2, r2); - blockMixCb(); - }); - } - return scryptOutput(password, dkLen, B2, V3, tmp); -} -let lockedSync = false, lockedAsync = false; -const _scryptAsync = async function(passwd, salt, N2, r2, p3, dkLen, onProgress) { - return await scryptAsync(passwd, salt, { N: N2, r: r2, p: p3, dkLen, onProgress }); -}; -const _scryptSync = function(passwd, salt, N2, r2, p3, dkLen) { - return scrypt$1(passwd, salt, { N: N2, r: r2, p: p3, dkLen }); -}; -let __scryptAsync = _scryptAsync; -let __scryptSync = _scryptSync; -async function scrypt(_passwd, _salt, N2, r2, p3, dkLen, progress) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(await __scryptAsync(passwd, salt, N2, r2, p3, dkLen, progress)); -} -scrypt._ = _scryptAsync; -scrypt.lock = function() { - lockedAsync = true; -}; -scrypt.register = function(func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; -}; -Object.freeze(scrypt); -function scryptSync(_passwd, _salt, N2, r2, p3, dkLen) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(__scryptSync(passwd, salt, N2, r2, p3, dkLen)); -} -scryptSync._ = _scryptSync; -scryptSync.lock = function() { - lockedSync = true; -}; -scryptSync.register = function(func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; -}; -Object.freeze(scryptSync); -const _sha256 = function(data) { - return createHash("sha256").update(data).digest(); -}; -let __sha256 = _sha256; -let locked256 = false; -function sha256$1(_data5) { - const data = getBytes(_data5, "data"); - return hexlify(__sha256(data)); -} -sha256$1._ = _sha256; -sha256$1.lock = function() { - locked256 = true; -}; -sha256$1.register = function(func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; -}; -Object.freeze(sha256$1); -Object.freeze(sha256$1); -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _0n$3 = BigInt(0); -const _1n$4 = BigInt(1); -const _2n$2 = BigInt(2); -const u8a = (a3) => a3 instanceof Uint8Array; -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_3, i3) => i3.toString(16).padStart(2, "0")); -function bytesToHex(bytes2) { - if (!u8a(bytes2)) - throw new Error("Uint8Array expected"); - let hex = ""; - for (let i3 = 0; i3 < bytes2.length; i3++) { - hex += hexes[bytes2[i3]]; - } - return hex; -} -function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; -} -function hexToNumber(hex) { - if (typeof hex !== "string") - throw new Error("hex string expected, got " + typeof hex); - return BigInt(hex === "" ? "0" : `0x${hex}`); -} -function hexToBytes(hex) { - if (typeof hex !== "string") - throw new Error("hex string expected, got " + typeof hex); - const len = hex.length; - if (len % 2) - throw new Error("padded hex string expected, got unpadded hex of length " + len); - const array2 = new Uint8Array(len / 2); - for (let i3 = 0; i3 < array2.length; i3++) { - const j2 = i3 * 2; - const hexByte = hex.slice(j2, j2 + 2); - const byte2 = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte2) || byte2 < 0) - throw new Error("Invalid byte sequence"); - array2[i3] = byte2; - } - return array2; -} -function bytesToNumberBE(bytes2) { - return hexToNumber(bytesToHex(bytes2)); -} -function bytesToNumberLE(bytes2) { - if (!u8a(bytes2)) - throw new Error("Uint8Array expected"); - return hexToNumber(bytesToHex(Uint8Array.from(bytes2).reverse())); -} -function numberToBytesBE(n4, len) { - return hexToBytes(n4.toString(16).padStart(len * 2, "0")); -} -function numberToBytesLE(n4, len) { - return numberToBytesBE(n4, len).reverse(); -} -function numberToVarBytesBE(n4) { - return hexToBytes(numberToHexUnpadded(n4)); -} -function ensureBytes(title, hex, expectedLength) { - let res; - if (typeof hex === "string") { - try { - res = hexToBytes(hex); - } catch (e18) { - throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e18}`); - } - } else if (u8a(hex)) { - res = Uint8Array.from(hex); - } else { - throw new Error(`${title} must be hex string or Uint8Array`); - } - const len = res.length; - if (typeof expectedLength === "number" && len !== expectedLength) - throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); - return res; -} -function concatBytes(...arrays) { - const r2 = new Uint8Array(arrays.reduce((sum, a3) => sum + a3.length, 0)); - let pad3 = 0; - arrays.forEach((a3) => { - if (!u8a(a3)) - throw new Error("Uint8Array expected"); - r2.set(a3, pad3); - pad3 += a3.length; - }); - return r2; -} -function equalBytes(b1, b2) { - if (b1.length !== b2.length) - return false; - for (let i3 = 0; i3 < b1.length; i3++) - if (b1[i3] !== b2[i3]) - return false; - return true; -} -function utf8ToBytes(str) { - if (typeof str !== "string") - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); -} -function bitLen(n4) { - let len; - for (len = 0; n4 > _0n$3; n4 >>= _1n$4, len += 1) - ; - return len; -} -function bitGet(n4, pos) { - return n4 >> BigInt(pos) & _1n$4; -} -const bitSet = (n4, pos, value) => { - return n4 | (value ? _1n$4 : _0n$3) << BigInt(pos); -}; -const bitMask = (n4) => (_2n$2 << BigInt(n4 - 1)) - _1n$4; -const u8n = (data) => new Uint8Array(data); -const u8fr = (arr) => Uint8Array.from(arr); -function createHmacDrbg(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== "number" || hashLen < 2) - throw new Error("hashLen must be a number"); - if (typeof qByteLen !== "number" || qByteLen < 2) - throw new Error("qByteLen must be a number"); - if (typeof hmacFn !== "function") - throw new Error("hmacFn must be a function"); - let v6 = u8n(hashLen); - let k2 = u8n(hashLen); - let i3 = 0; - const reset = () => { - v6.fill(1); - k2.fill(0); - i3 = 0; - }; - const h4 = (...b2) => hmacFn(k2, v6, ...b2); - const reseed2 = (seed = u8n()) => { - k2 = h4(u8fr([0]), seed); - v6 = h4(); - if (seed.length === 0) - return; - k2 = h4(u8fr([1]), seed); - v6 = h4(); - }; - const gen2 = () => { - if (i3++ >= 1e3) - throw new Error("drbg: tried 1000 values"); - let len = 0; - const out = []; - while (len < qByteLen) { - v6 = h4(); - const sl2 = v6.slice(); - out.push(sl2); - len += v6.length; - } - return concatBytes(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed2(seed); - let res = void 0; - while (!(res = pred(gen2()))) - reseed2(); - reset(); - return res; - }; - return genUntil; -} -const validatorFns = { - bigint: (val) => typeof val === "bigint", - function: (val) => typeof val === "function", - boolean: (val) => typeof val === "boolean", - string: (val) => typeof val === "string", - stringOrUint8Array: (val) => typeof val === "string" || val instanceof Uint8Array, - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen) -}; -function validateObject(object, validators2, optValidators = {}) { - const checkField = (fieldName, type2, isOptional) => { - const checkVal = validatorFns[type2]; - if (typeof checkVal !== "function") - throw new Error(`Invalid validator "${type2}", expected function`); - const val = object[fieldName]; - if (isOptional && val === void 0) - return; - if (!checkVal(val, object)) { - throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type2}`); - } - }; - for (const [fieldName, type2] of Object.entries(validators2)) - checkField(fieldName, type2, false); - for (const [fieldName, type2] of Object.entries(optValidators)) - checkField(fieldName, type2, true); - return object; -} -const ut$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - bitGet, - bitLen, - bitMask, - bitSet, - bytesToHex, - bytesToNumberBE, - bytesToNumberLE, - concatBytes, - createHmacDrbg, - ensureBytes, - equalBytes, - hexToBytes, - hexToNumber, - numberToBytesBE, - numberToBytesLE, - numberToHexUnpadded, - numberToVarBytesBE, - utf8ToBytes, - validateObject -}, Symbol.toStringTag, { value: "Module" })); -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _0n$2 = BigInt(0), _1n$3 = BigInt(1), _2n$1 = BigInt(2), _3n$1 = BigInt(3); -const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); -BigInt(9); -BigInt(16); -function mod(a3, b2) { - const result = a3 % b2; - return result >= _0n$2 ? result : b2 + result; -} -function pow(num, power, modulo) { - if (modulo <= _0n$2 || power < _0n$2) - throw new Error("Expected power/modulo > 0"); - if (modulo === _1n$3) - return _0n$2; - let res = _1n$3; - while (power > _0n$2) { - if (power & _1n$3) - res = res * num % modulo; - num = num * num % modulo; - power >>= _1n$3; - } - return res; -} -function pow2(x3, power, modulo) { - let res = x3; - while (power-- > _0n$2) { - res *= res; - res %= modulo; - } - return res; -} -function invert(number2, modulo) { - if (number2 === _0n$2 || modulo <= _0n$2) { - throw new Error(`invert: expected positive integers, got n=${number2} mod=${modulo}`); - } - let a3 = mod(number2, modulo); - let b2 = modulo; - let x3 = _0n$2, u2 = _1n$3; - while (a3 !== _0n$2) { - const q2 = b2 / a3; - const r2 = b2 % a3; - const m3 = x3 - u2 * q2; - b2 = a3, a3 = r2, x3 = u2, u2 = m3; - } - const gcd = b2; - if (gcd !== _1n$3) - throw new Error("invert: does not exist"); - return mod(x3, modulo); -} -function tonelliShanks(P2) { - const legendreC = (P2 - _1n$3) / _2n$1; - let Q2, S4, Z2; - for (Q2 = P2 - _1n$3, S4 = 0; Q2 % _2n$1 === _0n$2; Q2 /= _2n$1, S4++) - ; - for (Z2 = _2n$1; Z2 < P2 && pow(Z2, legendreC, P2) !== P2 - _1n$3; Z2++) - ; - if (S4 === 1) { - const p1div4 = (P2 + _1n$3) / _4n; - return function tonelliFast(Fp2, n4) { - const root = Fp2.pow(n4, p1div4); - if (!Fp2.eql(Fp2.sqr(root), n4)) - throw new Error("Cannot find square root"); - return root; - }; - } - const Q1div2 = (Q2 + _1n$3) / _2n$1; - return function tonelliSlow(Fp2, n4) { - if (Fp2.pow(n4, legendreC) === Fp2.neg(Fp2.ONE)) - throw new Error("Cannot find square root"); - let r2 = S4; - let g3 = Fp2.pow(Fp2.mul(Fp2.ONE, Z2), Q2); - let x3 = Fp2.pow(n4, Q1div2); - let b2 = Fp2.pow(n4, Q2); - while (!Fp2.eql(b2, Fp2.ONE)) { - if (Fp2.eql(b2, Fp2.ZERO)) - return Fp2.ZERO; - let m3 = 1; - for (let t2 = Fp2.sqr(b2); m3 < r2; m3++) { - if (Fp2.eql(t2, Fp2.ONE)) - break; - t2 = Fp2.sqr(t2); - } - const ge2 = Fp2.pow(g3, _1n$3 << BigInt(r2 - m3 - 1)); - g3 = Fp2.sqr(ge2); - x3 = Fp2.mul(x3, ge2); - b2 = Fp2.mul(b2, g3); - r2 = m3; - } - return x3; - }; -} -function FpSqrt(P2) { - if (P2 % _4n === _3n$1) { - const p1div4 = (P2 + _1n$3) / _4n; - return function sqrt3mod4(Fp2, n4) { - const root = Fp2.pow(n4, p1div4); - if (!Fp2.eql(Fp2.sqr(root), n4)) - throw new Error("Cannot find square root"); - return root; - }; - } - if (P2 % _8n === _5n) { - const c1 = (P2 - _5n) / _8n; - return function sqrt5mod8(Fp2, n4) { - const n22 = Fp2.mul(n4, _2n$1); - const v6 = Fp2.pow(n22, c1); - const nv2 = Fp2.mul(n4, v6); - const i3 = Fp2.mul(Fp2.mul(nv2, _2n$1), v6); - const root = Fp2.mul(nv2, Fp2.sub(i3, Fp2.ONE)); - if (!Fp2.eql(Fp2.sqr(root), n4)) - throw new Error("Cannot find square root"); - return root; - }; - } - return tonelliShanks(P2); -} -const FIELD_FIELDS = [ - "create", - "isValid", - "is0", - "neg", - "inv", - "sqrt", - "sqr", - "eql", - "add", - "sub", - "mul", - "pow", - "div", - "addN", - "subN", - "mulN", - "sqrN" -]; -function validateField(field) { - const initial = { - ORDER: "bigint", - MASK: "bigint", - BYTES: "isSafeInteger", - BITS: "isSafeInteger" - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = "function"; - return map; - }, initial); - return validateObject(field, opts); -} -function FpPow(f3, num, power) { - if (power < _0n$2) - throw new Error("Expected power > 0"); - if (power === _0n$2) - return f3.ONE; - if (power === _1n$3) - return num; - let p3 = f3.ONE; - let d4 = num; - while (power > _0n$2) { - if (power & _1n$3) - p3 = f3.mul(p3, d4); - d4 = f3.sqr(d4); - power >>= _1n$3; - } - return p3; -} -function FpInvertBatch(f3, nums) { - const tmp = new Array(nums.length); - const lastMultiplied = nums.reduce((acc, num, i3) => { - if (f3.is0(num)) - return acc; - tmp[i3] = acc; - return f3.mul(acc, num); - }, f3.ONE); - const inverted = f3.inv(lastMultiplied); - nums.reduceRight((acc, num, i3) => { - if (f3.is0(num)) - return acc; - tmp[i3] = f3.mul(acc, tmp[i3]); - return f3.mul(acc, num); - }, inverted); - return tmp; -} -function nLength(n4, nBitLength) { - const _nBitLength = nBitLength !== void 0 ? nBitLength : n4.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} -function Field(ORDER, bitLen2, isLE2 = false, redef = {}) { - if (ORDER <= _0n$2) - throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2); - if (BYTES > 2048) - throw new Error("Field lengths over 2048 bytes are not supported"); - const sqrtP = FpSqrt(ORDER); - const f3 = Object.freeze({ - ORDER, - BITS, - BYTES, - MASK: bitMask(BITS), - ZERO: _0n$2, - ONE: _1n$3, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== "bigint") - throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); - return _0n$2 <= num && num < ORDER; - }, - is0: (num) => num === _0n$2, - isOdd: (num) => (num & _1n$3) === _1n$3, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f3, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert(num, ORDER), - sqrt: redef.sqrt || ((n4) => sqrtP(f3, n4)), - invertBatch: (lst) => FpInvertBatch(f3, lst), - // TODO: do we really need constant cmov? - // We don't have const-time bigints anyway, so probably will be not very useful - cmov: (a3, b2, c2) => c2 ? b2 : a3, - toBytes: (num) => isLE2 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES), - fromBytes: (bytes2) => { - if (bytes2.length !== BYTES) - throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes2.length}`); - return isLE2 ? bytesToNumberLE(bytes2) : bytesToNumberBE(bytes2); - } - }); - return Object.freeze(f3); -} -function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== "bigint") - throw new Error("field order must be bigint"); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} -function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} -function mapHashToField(key2, fieldOrder, isLE2 = false) { - const len = key2.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - if (len < 16 || len < minLen || len > 1024) - throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); - const num = isLE2 ? bytesToNumberBE(key2) : bytesToNumberLE(key2); - const reduced = mod(num, fieldOrder - _1n$3) + _1n$3; - return isLE2 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); -} -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _0n$1 = BigInt(0); -const _1n$2 = BigInt(1); -function wNAF(c2, bits) { - const constTimeNegate = (condition, item) => { - const neg4 = item.negate(); - return condition ? neg4 : item; - }; - const opts = (W2) => { - const windows = Math.ceil(bits / W2) + 1; - const windowSize = 2 ** (W2 - 1); - return { windows, windowSize }; - }; - return { - constTimeNegate, - // non-const time multiplication ladder - unsafeLadder(elm, n4) { - let p3 = c2.ZERO; - let d4 = elm; - while (n4 > _0n$1) { - if (n4 & _1n$2) - p3 = p3.add(d4); - d4 = d4.double(); - n4 >>= _1n$2; - } - return p3; - }, - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(elm, W2) { - const { windows, windowSize } = opts(W2); - const points = []; - let p3 = elm; - let base3 = p3; - for (let window2 = 0; window2 < windows; window2++) { - base3 = p3; - points.push(base3); - for (let i3 = 1; i3 < windowSize; i3++) { - base3 = base3.add(p3); - points.push(base3); - } - p3 = base3.double(); - } - return points; - }, - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * @param W window size - * @param precomputes precomputed tables - * @param n scalar (we don't check here, but should be less than curve order) - * @returns real and fake (for const-time) points - */ - wNAF(W2, precomputes, n4) { - const { windows, windowSize } = opts(W2); - let p3 = c2.ZERO; - let f3 = c2.BASE; - const mask2 = BigInt(2 ** W2 - 1); - const maxNumber = 2 ** W2; - const shiftBy = BigInt(W2); - for (let window2 = 0; window2 < windows; window2++) { - const offset2 = window2 * windowSize; - let wbits = Number(n4 & mask2); - n4 >>= shiftBy; - if (wbits > windowSize) { - wbits -= maxNumber; - n4 += _1n$2; - } - const offset1 = offset2; - const offset22 = offset2 + Math.abs(wbits) - 1; - const cond1 = window2 % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - f3 = f3.add(constTimeNegate(cond1, precomputes[offset1])); - } else { - p3 = p3.add(constTimeNegate(cond2, precomputes[offset22])); - } - } - return { p: p3, f: f3 }; - }, - wNAFCached(P2, precomputesMap, n4, transform) { - const W2 = P2._WINDOW_SIZE || 1; - let comp = precomputesMap.get(P2); - if (!comp) { - comp = this.precomputeWindow(P2, W2); - if (W2 !== 1) { - precomputesMap.set(P2, transform(comp)); - } - } - return this.wNAF(W2, comp, n4); - } - }; -} -function validateBasic(curve2) { - validateField(curve2.Fp); - validateObject(curve2, { - n: "bigint", - h: "bigint", - Gx: "field", - Gy: "field" - }, { - nBitLength: "isSafeInteger", - nByteLength: "isSafeInteger" - }); - return Object.freeze({ - ...nLength(curve2.n, curve2.nBitLength), - ...curve2, - ...{ p: curve2.Fp.ORDER } - }); -} -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -function validatePointOpts(curve2) { - const opts = validateBasic(curve2); - validateObject(opts, { - a: "field", - b: "field" - }, { - allowedPrivateKeyLengths: "array", - wrapPrivateKey: "boolean", - isTorsionFree: "function", - clearCofactor: "function", - allowInfinityPoint: "boolean", - fromBytes: "function", - toBytes: "function" - }); - const { endo, Fp: Fp2, a: a3 } = opts; - if (endo) { - if (!Fp2.eql(a3, Fp2.ZERO)) { - throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0"); - } - if (typeof endo !== "object" || typeof endo.beta !== "bigint" || typeof endo.splitScalar !== "function") { - throw new Error("Expected endomorphism with beta: bigint and splitScalar: function"); - } - } - return Object.freeze({ ...opts }); -} -const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut$2; -const DER = { - // asn.1 DER encoding utils - Err: class DERErr2 extends Error { - constructor(m3 = "") { - super(m3); - } - }, - _parseInt(data) { - const { Err: E2 } = DER; - if (data.length < 2 || data[0] !== 2) - throw new E2("Invalid signature integer tag"); - const len = data[1]; - const res = data.subarray(2, len + 2); - if (!len || res.length !== len) - throw new E2("Invalid signature integer: wrong length"); - if (res[0] & 128) - throw new E2("Invalid signature integer: negative"); - if (res[0] === 0 && !(res[1] & 128)) - throw new E2("Invalid signature integer: unnecessary leading zero"); - return { d: b2n(res), l: data.subarray(len + 2) }; - }, - toSig(hex) { - const { Err: E2 } = DER; - const data = typeof hex === "string" ? h2b(hex) : hex; - if (!(data instanceof Uint8Array)) - throw new Error("ui8a expected"); - let l2 = data.length; - if (l2 < 2 || data[0] != 48) - throw new E2("Invalid signature tag"); - if (data[1] !== l2 - 2) - throw new E2("Invalid signature: incorrect length"); - const { d: r2, l: sBytes } = DER._parseInt(data.subarray(2)); - const { d: s2, l: rBytesLeft } = DER._parseInt(sBytes); - if (rBytesLeft.length) - throw new E2("Invalid signature: left bytes after parsing"); - return { r: r2, s: s2 }; - }, - hexFromSig(sig) { - const slice = (s3) => Number.parseInt(s3[0], 16) & 8 ? "00" + s3 : s3; - const h4 = (num) => { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; - }; - const s2 = slice(h4(sig.s)); - const r2 = slice(h4(sig.r)); - const shl = s2.length / 2; - const rhl = r2.length / 2; - const sl2 = h4(shl); - const rl2 = h4(rhl); - return `30${h4(rhl + shl + 4)}02${rl2}${r2}02${sl2}${s2}`; - } -}; -const _0n = BigInt(0), _1n$1 = BigInt(1); -BigInt(2); -const _3n = BigInt(3); -BigInt(4); -function weierstrassPoints(opts) { - const CURVE = validatePointOpts(opts); - const { Fp: Fp2 } = CURVE; - const toBytes3 = CURVE.toBytes || ((_c2, point5, _isCompressed) => { - const a3 = point5.toAffine(); - return concatBytes(Uint8Array.from([4]), Fp2.toBytes(a3.x), Fp2.toBytes(a3.y)); - }); - const fromBytes = CURVE.fromBytes || ((bytes2) => { - const tail = bytes2.subarray(1); - const x3 = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); - const y3 = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); - return { x: x3, y: y3 }; - }); - function weierstrassEquation(x3) { - const { a: a3, b: b2 } = CURVE; - const x22 = Fp2.sqr(x3); - const x32 = Fp2.mul(x22, x3); - return Fp2.add(Fp2.add(x32, Fp2.mul(x3, a3)), b2); - } - if (!Fp2.eql(Fp2.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) - throw new Error("bad generator point: equation left != right"); - function isWithinCurveOrder(num) { - return typeof num === "bigint" && _0n < num && num < CURVE.n; - } - function assertGE(num) { - if (!isWithinCurveOrder(num)) - throw new Error("Expected valid bigint: 0 < bigint < curve.n"); - } - function normPrivateKeyToScalar(key2) { - const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n: n4 } = CURVE; - if (lengths && typeof key2 !== "bigint") { - if (key2 instanceof Uint8Array) - key2 = bytesToHex(key2); - if (typeof key2 !== "string" || !lengths.includes(key2.length)) - throw new Error("Invalid key"); - key2 = key2.padStart(nByteLength * 2, "0"); - } - let num; - try { - num = typeof key2 === "bigint" ? key2 : bytesToNumberBE(ensureBytes("private key", key2, nByteLength)); - } catch (error) { - throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key2}`); - } - if (wrapPrivateKey) - num = mod(num, n4); - assertGE(num); - return num; - } - const pointPrecomputes = /* @__PURE__ */ new Map(); - function assertPrjPoint(other) { - if (!(other instanceof Point2)) - throw new Error("ProjectivePoint expected"); - } - class Point2 { - constructor(px, py, pz) { - this.px = px; - this.py = py; - this.pz = pz; - if (px == null || !Fp2.isValid(px)) - throw new Error("x required"); - if (py == null || !Fp2.isValid(py)) - throw new Error("y required"); - if (pz == null || !Fp2.isValid(pz)) - throw new Error("z required"); - } - // Does not validate if the point is on-curve. - // Use fromHex instead, or call assertValidity() later. - static fromAffine(p3) { - const { x: x3, y: y3 } = p3 || {}; - if (!p3 || !Fp2.isValid(x3) || !Fp2.isValid(y3)) - throw new Error("invalid affine point"); - if (p3 instanceof Point2) - throw new Error("projective point not allowed"); - const is0 = (i3) => Fp2.eql(i3, Fp2.ZERO); - if (is0(x3) && is0(y3)) - return Point2.ZERO; - return new Point2(x3, y3, Fp2.ONE); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ - static normalizeZ(points) { - const toInv = Fp2.invertBatch(points.map((p3) => p3.pz)); - return points.map((p3, i3) => p3.toAffine(toInv[i3])).map(Point2.fromAffine); - } - /** - * Converts hash string or Uint8Array to Point. - * @param hex short/long ECDSA hex - */ - static fromHex(hex) { - const P2 = Point2.fromAffine(fromBytes(ensureBytes("pointHex", hex))); - P2.assertValidity(); - return P2; - } - // Multiplies generator point by privateKey. - static fromPrivateKey(privateKey) { - return Point2.BASE.multiply(normPrivateKeyToScalar(privateKey)); - } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // A point on curve is valid if it conforms to equation. - assertValidity() { - if (this.is0()) { - if (CURVE.allowInfinityPoint && !Fp2.is0(this.py)) - return; - throw new Error("bad point: ZERO"); - } - const { x: x3, y: y3 } = this.toAffine(); - if (!Fp2.isValid(x3) || !Fp2.isValid(y3)) - throw new Error("bad point: x or y not FE"); - const left = Fp2.sqr(y3); - const right = weierstrassEquation(x3); - if (!Fp2.eql(left, right)) - throw new Error("bad point: equation left != right"); - if (!this.isTorsionFree()) - throw new Error("bad point: not in prime-order subgroup"); - } - hasEvenY() { - const { y: y3 } = this.toAffine(); - if (Fp2.isOdd) - return !Fp2.isOdd(y3); - throw new Error("Field doesn't support isOdd"); - } - /** - * Compare one point to another. - */ - equals(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - const U12 = Fp2.eql(Fp2.mul(X1, Z2), Fp2.mul(X2, Z1)); - const U22 = Fp2.eql(Fp2.mul(Y1, Z2), Fp2.mul(Y2, Z1)); - return U12 && U22; - } - /** - * Flips point to one corresponding to (x, -y) in Affine coordinates. - */ - negate() { - return new Point2(this.px, Fp2.neg(this.py), this.pz); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a: a3, b: b2 } = CURVE; - const b3 = Fp2.mul(b2, _3n); - const { px: X1, py: Y1, pz: Z1 } = this; - let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; - let t02 = Fp2.mul(X1, X1); - let t1 = Fp2.mul(Y1, Y1); - let t2 = Fp2.mul(Z1, Z1); - let t3 = Fp2.mul(X1, Y1); - t3 = Fp2.add(t3, t3); - Z3 = Fp2.mul(X1, Z1); - Z3 = Fp2.add(Z3, Z3); - X3 = Fp2.mul(a3, Z3); - Y3 = Fp2.mul(b3, t2); - Y3 = Fp2.add(X3, Y3); - X3 = Fp2.sub(t1, Y3); - Y3 = Fp2.add(t1, Y3); - Y3 = Fp2.mul(X3, Y3); - X3 = Fp2.mul(t3, X3); - Z3 = Fp2.mul(b3, Z3); - t2 = Fp2.mul(a3, t2); - t3 = Fp2.sub(t02, t2); - t3 = Fp2.mul(a3, t3); - t3 = Fp2.add(t3, Z3); - Z3 = Fp2.add(t02, t02); - t02 = Fp2.add(Z3, t02); - t02 = Fp2.add(t02, t2); - t02 = Fp2.mul(t02, t3); - Y3 = Fp2.add(Y3, t02); - t2 = Fp2.mul(Y1, Z1); - t2 = Fp2.add(t2, t2); - t02 = Fp2.mul(t2, t3); - X3 = Fp2.sub(X3, t02); - Z3 = Fp2.mul(t2, t1); - Z3 = Fp2.add(Z3, Z3); - Z3 = Fp2.add(Z3, Z3); - return new Point2(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; - const a3 = CURVE.a; - const b3 = Fp2.mul(CURVE.b, _3n); - let t02 = Fp2.mul(X1, X2); - let t1 = Fp2.mul(Y1, Y2); - let t2 = Fp2.mul(Z1, Z2); - let t3 = Fp2.add(X1, Y1); - let t4 = Fp2.add(X2, Y2); - t3 = Fp2.mul(t3, t4); - t4 = Fp2.add(t02, t1); - t3 = Fp2.sub(t3, t4); - t4 = Fp2.add(X1, Z1); - let t5 = Fp2.add(X2, Z2); - t4 = Fp2.mul(t4, t5); - t5 = Fp2.add(t02, t2); - t4 = Fp2.sub(t4, t5); - t5 = Fp2.add(Y1, Z1); - X3 = Fp2.add(Y2, Z2); - t5 = Fp2.mul(t5, X3); - X3 = Fp2.add(t1, t2); - t5 = Fp2.sub(t5, X3); - Z3 = Fp2.mul(a3, t4); - X3 = Fp2.mul(b3, t2); - Z3 = Fp2.add(X3, Z3); - X3 = Fp2.sub(t1, Z3); - Z3 = Fp2.add(t1, Z3); - Y3 = Fp2.mul(X3, Z3); - t1 = Fp2.add(t02, t02); - t1 = Fp2.add(t1, t02); - t2 = Fp2.mul(a3, t2); - t4 = Fp2.mul(b3, t4); - t1 = Fp2.add(t1, t2); - t2 = Fp2.sub(t02, t2); - t2 = Fp2.mul(a3, t2); - t4 = Fp2.add(t4, t2); - t02 = Fp2.mul(t1, t4); - Y3 = Fp2.add(Y3, t02); - t02 = Fp2.mul(t5, t4); - X3 = Fp2.mul(t3, X3); - X3 = Fp2.sub(X3, t02); - t02 = Fp2.mul(t3, t1); - Z3 = Fp2.mul(t5, Z3); - Z3 = Fp2.add(Z3, t02); - return new Point2(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point2.ZERO); - } - wNAF(n4) { - return wnaf.wNAFCached(this, pointPrecomputes, n4, (comp) => { - const toInv = Fp2.invertBatch(comp.map((p3) => p3.pz)); - return comp.map((p3, i3) => p3.toAffine(toInv[i3])).map(Point2.fromAffine); - }); - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed private key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(n4) { - const I2 = Point2.ZERO; - if (n4 === _0n) - return I2; - assertGE(n4); - if (n4 === _1n$1) - return this; - const { endo } = CURVE; - if (!endo) - return wnaf.unsafeLadder(this, n4); - let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n4); - let k1p = I2; - let k2p = I2; - let d4 = this; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n$1) - k1p = k1p.add(d4); - if (k2 & _1n$1) - k2p = k2p.add(d4); - d4 = d4.double(); - k1 >>= _1n$1; - k2 >>= _1n$1; - } - if (k1neg) - k1p = k1p.negate(); - if (k2neg) - k2p = k2p.negate(); - k2p = new Point2(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - return k1p.add(k2p); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - assertGE(scalar); - let n4 = scalar; - let point5, fake; - const { endo } = CURVE; - if (endo) { - const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n4); - let { p: k1p, f: f1p } = this.wNAF(k1); - let { p: k2p, f: f2p } = this.wNAF(k2); - k1p = wnaf.constTimeNegate(k1neg, k1p); - k2p = wnaf.constTimeNegate(k2neg, k2p); - k2p = new Point2(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - point5 = k1p.add(k2p); - fake = f1p.add(f2p); - } else { - const { p: p3, f: f3 } = this.wNAF(n4); - point5 = p3; - fake = f3; - } - return Point2.normalizeZ([point5, fake])[0]; - } - /** - * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. - * Not using Strauss-Shamir trick: precomputation tables are faster. - * The trick could be useful if both P and Q are not G (not in our case). - * @returns non-zero affine point - */ - multiplyAndAddUnsafe(Q2, a3, b2) { - const G2 = Point2.BASE; - const mul6 = (P2, a4) => a4 === _0n || a4 === _1n$1 || !P2.equals(G2) ? P2.multiplyUnsafe(a4) : P2.multiply(a4); - const sum = mul6(this, a3).add(mul6(Q2, b2)); - return sum.is0() ? void 0 : sum; - } - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (x, y, z) ∋ (x=x/z, y=y/z) - toAffine(iz) { - const { px: x3, py: y3, pz: z3 } = this; - const is0 = this.is0(); - if (iz == null) - iz = is0 ? Fp2.ONE : Fp2.inv(z3); - const ax = Fp2.mul(x3, iz); - const ay = Fp2.mul(y3, iz); - const zz = Fp2.mul(z3, iz); - if (is0) - return { x: Fp2.ZERO, y: Fp2.ZERO }; - if (!Fp2.eql(zz, Fp2.ONE)) - throw new Error("invZ was invalid"); - return { x: ax, y: ay }; - } - isTorsionFree() { - const { h: cofactor, isTorsionFree } = CURVE; - if (cofactor === _1n$1) - return true; - if (isTorsionFree) - return isTorsionFree(Point2, this); - throw new Error("isTorsionFree() has not been declared for the elliptic curve"); - } - clearCofactor() { - const { h: cofactor, clearCofactor } = CURVE; - if (cofactor === _1n$1) - return this; - if (clearCofactor) - return clearCofactor(Point2, this); - return this.multiplyUnsafe(CURVE.h); - } - toRawBytes(isCompressed = true) { - this.assertValidity(); - return toBytes3(Point2, this, isCompressed); - } - toHex(isCompressed = true) { - return bytesToHex(this.toRawBytes(isCompressed)); - } - } - Point2.BASE = new Point2(CURVE.Gx, CURVE.Gy, Fp2.ONE); - Point2.ZERO = new Point2(Fp2.ZERO, Fp2.ONE, Fp2.ZERO); - const _bits = CURVE.nBitLength; - const wnaf = wNAF(Point2, CURVE.endo ? Math.ceil(_bits / 2) : _bits); - return { - CURVE, - ProjectivePoint: Point2, - normPrivateKeyToScalar, - weierstrassEquation, - isWithinCurveOrder - }; -} -function validateOpts(curve2) { - const opts = validateBasic(curve2); - validateObject(opts, { - hash: "hash", - hmac: "function", - randomBytes: "function" - }, { - bits2int: "function", - bits2int_modN: "function", - lowS: "boolean" - }); - return Object.freeze({ lowS: true, ...opts }); -} -function weierstrass(curveDef) { - const CURVE = validateOpts(curveDef); - const { Fp: Fp2, n: CURVE_ORDER } = CURVE; - const compressedLen = Fp2.BYTES + 1; - const uncompressedLen = 2 * Fp2.BYTES + 1; - function isValidFieldElement(num) { - return _0n < num && num < Fp2.ORDER; - } - function modN(a3) { - return mod(a3, CURVE_ORDER); - } - function invN(a3) { - return invert(a3, CURVE_ORDER); - } - const { ProjectivePoint: Point2, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder } = weierstrassPoints({ - ...CURVE, - toBytes(_c2, point5, isCompressed) { - const a3 = point5.toAffine(); - const x3 = Fp2.toBytes(a3.x); - const cat = concatBytes; - if (isCompressed) { - return cat(Uint8Array.from([point5.hasEvenY() ? 2 : 3]), x3); - } else { - return cat(Uint8Array.from([4]), x3, Fp2.toBytes(a3.y)); - } - }, - fromBytes(bytes2) { - const len = bytes2.length; - const head = bytes2[0]; - const tail = bytes2.subarray(1); - if (len === compressedLen && (head === 2 || head === 3)) { - const x3 = bytesToNumberBE(tail); - if (!isValidFieldElement(x3)) - throw new Error("Point is not on curve"); - const y22 = weierstrassEquation(x3); - let y3 = Fp2.sqrt(y22); - const isYOdd = (y3 & _1n$1) === _1n$1; - const isHeadOdd = (head & 1) === 1; - if (isHeadOdd !== isYOdd) - y3 = Fp2.neg(y3); - return { x: x3, y: y3 }; - } else if (len === uncompressedLen && head === 4) { - const x3 = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); - const y3 = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); - return { x: x3, y: y3 }; - } else { - throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); - } - } - }); - const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength)); - function isBiggerThanHalfOrder(number2) { - const HALF = CURVE_ORDER >> _1n$1; - return number2 > HALF; - } - function normalizeS(s2) { - return isBiggerThanHalfOrder(s2) ? modN(-s2) : s2; - } - const slcNum = (b2, from2, to2) => bytesToNumberBE(b2.slice(from2, to2)); - class Signature2 { - constructor(r2, s2, recovery) { - this.r = r2; - this.s = s2; - this.recovery = recovery; - this.assertValidity(); - } - // pair (bytes of r, bytes of s) - static fromCompact(hex) { - const l2 = CURVE.nByteLength; - hex = ensureBytes("compactSignature", hex, l2 * 2); - return new Signature2(slcNum(hex, 0, l2), slcNum(hex, l2, 2 * l2)); - } - // DER encoded ECDSA signature - // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script - static fromDER(hex) { - const { r: r2, s: s2 } = DER.toSig(ensureBytes("DER", hex)); - return new Signature2(r2, s2); - } - assertValidity() { - if (!isWithinCurveOrder(this.r)) - throw new Error("r must be 0 < r < CURVE.n"); - if (!isWithinCurveOrder(this.s)) - throw new Error("s must be 0 < s < CURVE.n"); - } - addRecoveryBit(recovery) { - return new Signature2(this.r, this.s, recovery); - } - recoverPublicKey(msgHash) { - const { r: r2, s: s2, recovery: rec } = this; - const h4 = bits2int_modN(ensureBytes("msgHash", msgHash)); - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error("recovery id invalid"); - const radj = rec === 2 || rec === 3 ? r2 + CURVE.n : r2; - if (radj >= Fp2.ORDER) - throw new Error("recovery id 2 or 3 invalid"); - const prefix = (rec & 1) === 0 ? "02" : "03"; - const R3 = Point2.fromHex(prefix + numToNByteStr(radj)); - const ir2 = invN(radj); - const u1 = modN(-h4 * ir2); - const u2 = modN(s2 * ir2); - const Q2 = Point2.BASE.multiplyAndAddUnsafe(R3, u1, u2); - if (!Q2) - throw new Error("point at infinify"); - Q2.assertValidity(); - return Q2; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - normalizeS() { - return this.hasHighS() ? new Signature2(this.r, modN(-this.s), this.recovery) : this; - } - // DER-encoded - toDERRawBytes() { - return hexToBytes(this.toDERHex()); - } - toDERHex() { - return DER.hexFromSig({ r: this.r, s: this.s }); - } - // padded bytes of r, then padded bytes of s - toCompactRawBytes() { - return hexToBytes(this.toCompactHex()); - } - toCompactHex() { - return numToNByteStr(this.r) + numToNByteStr(this.s); - } - } - const utils2 = { - isValidPrivateKey(privateKey) { - try { - normPrivateKeyToScalar(privateKey); - return true; - } catch (error) { - return false; - } - }, - normPrivateKeyToScalar, - /** - * Produces cryptographically secure private key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - randomPrivateKey: () => { - const length = getMinHashLength(CURVE.n); - return mapHashToField(CURVE.randomBytes(length), CURVE.n); - }, - /** - * Creates precompute table for an arbitrary EC point. Makes point "cached". - * Allows to massively speed-up `point.multiply(scalar)`. - * @returns cached point - * @example - * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); - * fast.multiply(privKey); // much faster ECDH now - */ - precompute(windowSize = 8, point5 = Point2.BASE) { - point5._setWindowSize(windowSize); - point5.multiply(BigInt(3)); - return point5; - } - }; - function getPublicKey(privateKey, isCompressed = true) { - return Point2.fromPrivateKey(privateKey).toRawBytes(isCompressed); - } - function isProbPub(item) { - const arr = item instanceof Uint8Array; - const str = typeof item === "string"; - const len = (arr || str) && item.length; - if (arr) - return len === compressedLen || len === uncompressedLen; - if (str) - return len === 2 * compressedLen || len === 2 * uncompressedLen; - if (item instanceof Point2) - return true; - return false; - } - function getSharedSecret(privateA, publicB, isCompressed = true) { - if (isProbPub(privateA)) - throw new Error("first arg must be private key"); - if (!isProbPub(publicB)) - throw new Error("second arg must be public key"); - const b2 = Point2.fromHex(publicB); - return b2.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); - } - const bits2int = CURVE.bits2int || function(bytes2) { - const num = bytesToNumberBE(bytes2); - const delta = bytes2.length * 8 - CURVE.nBitLength; - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = CURVE.bits2int_modN || function(bytes2) { - return modN(bits2int(bytes2)); - }; - const ORDER_MASK = bitMask(CURVE.nBitLength); - function int2octets(num) { - if (typeof num !== "bigint") - throw new Error("bigint expected"); - if (!(_0n <= num && num < ORDER_MASK)) - throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); - return numberToBytesBE(num, CURVE.nByteLength); - } - function prepSig(msgHash, privateKey, opts = defaultSigOpts) { - if (["recovered", "canonical"].some((k2) => k2 in opts)) - throw new Error("sign() legacy options not supported"); - const { hash: hash3, randomBytes: randomBytes2 } = CURVE; - let { lowS, prehash, extraEntropy: ent } = opts; - if (lowS == null) - lowS = true; - msgHash = ensureBytes("msgHash", msgHash); - if (prehash) - msgHash = ensureBytes("prehashed msgHash", hash3(msgHash)); - const h1int = bits2int_modN(msgHash); - const d4 = normPrivateKeyToScalar(privateKey); - const seedArgs = [int2octets(d4), int2octets(h1int)]; - if (ent != null) { - const e18 = ent === true ? randomBytes2(Fp2.BYTES) : ent; - seedArgs.push(ensureBytes("extraEntropy", e18)); - } - const seed = concatBytes(...seedArgs); - const m3 = h1int; - function k2sig(kBytes) { - const k2 = bits2int(kBytes); - if (!isWithinCurveOrder(k2)) - return; - const ik2 = invN(k2); - const q2 = Point2.BASE.multiply(k2).toAffine(); - const r2 = modN(q2.x); - if (r2 === _0n) - return; - const s2 = modN(ik2 * modN(m3 + r2 * d4)); - if (s2 === _0n) - return; - let recovery = (q2.x === r2 ? 0 : 2) | Number(q2.y & _1n$1); - let normS = s2; - if (lowS && isBiggerThanHalfOrder(s2)) { - normS = normalizeS(s2); - recovery ^= 1; - } - return new Signature2(r2, normS, recovery); - } - return { seed, k2sig }; - } - const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; - const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; - function sign6(msgHash, privKey, opts = defaultSigOpts) { - const { seed, k2sig } = prepSig(msgHash, privKey, opts); - const C3 = CURVE; - const drbg = createHmacDrbg(C3.hash.outputLen, C3.nByteLength, C3.hmac); - return drbg(seed, k2sig); - } - Point2.BASE._setWindowSize(8); - function verify6(signature2, msgHash, publicKey2, opts = defaultVerOpts) { - var _a3; - const sg2 = signature2; - msgHash = ensureBytes("msgHash", msgHash); - publicKey2 = ensureBytes("publicKey", publicKey2); - if ("strict" in opts) - throw new Error("options.strict was renamed to lowS"); - const { lowS, prehash } = opts; - let _sig2 = void 0; - let P2; - try { - if (typeof sg2 === "string" || sg2 instanceof Uint8Array) { - try { - _sig2 = Signature2.fromDER(sg2); - } catch (derError) { - if (!(derError instanceof DER.Err)) - throw derError; - _sig2 = Signature2.fromCompact(sg2); - } - } else if (typeof sg2 === "object" && typeof sg2.r === "bigint" && typeof sg2.s === "bigint") { - const { r: r3, s: s3 } = sg2; - _sig2 = new Signature2(r3, s3); - } else { - throw new Error("PARSE"); - } - P2 = Point2.fromHex(publicKey2); - } catch (error) { - if (error.message === "PARSE") - throw new Error(`signature must be Signature instance, Uint8Array or hex string`); - return false; - } - if (lowS && _sig2.hasHighS()) - return false; - if (prehash) - msgHash = CURVE.hash(msgHash); - const { r: r2, s: s2 } = _sig2; - const h4 = bits2int_modN(msgHash); - const is2 = invN(s2); - const u1 = modN(h4 * is2); - const u2 = modN(r2 * is2); - const R3 = (_a3 = Point2.BASE.multiplyAndAddUnsafe(P2, u1, u2)) == null ? void 0 : _a3.toAffine(); - if (!R3) - return false; - const v6 = modN(R3.x); - return v6 === r2; - } - return { - CURVE, - getPublicKey, - getSharedSecret, - sign: sign6, - verify: verify6, - ProjectivePoint: Point2, - Signature: Signature2, - utils: utils2 - }; -} -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -function getHash(hash3) { - return { - hash: hash3, - hmac: (key2, ...msgs) => hmac$2(hash3, key2, concatBytes$1(...msgs)), - randomBytes: randomBytes$2 - }; -} -function createCurve(curveDef, defHash) { - const create3 = (hash3) => weierstrass({ ...curveDef, ...getHash(hash3) }); - return Object.freeze({ ...create3(defHash), create: create3 }); -} -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"); -const secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const _1n = BigInt(1); -const _2n = BigInt(2); -const divNearest = (a3, b2) => (a3 + b2 / _2n) / b2; -function sqrtMod(y3) { - const P2 = secp256k1P; - const _3n2 = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = y3 * y3 * y3 % P2; - const b3 = b2 * b2 * y3 % P2; - const b6 = pow2(b3, _3n2, P2) * b3 % P2; - const b9 = pow2(b6, _3n2, P2) * b3 % P2; - const b11 = pow2(b9, _2n, P2) * b2 % P2; - const b22 = pow2(b11, _11n, P2) * b11 % P2; - const b44 = pow2(b22, _22n, P2) * b22 % P2; - const b88 = pow2(b44, _44n, P2) * b44 % P2; - const b176 = pow2(b88, _88n, P2) * b88 % P2; - const b220 = pow2(b176, _44n, P2) * b44 % P2; - const b223 = pow2(b220, _3n2, P2) * b3 % P2; - const t1 = pow2(b223, _23n, P2) * b22 % P2; - const t2 = pow2(t1, _6n, P2) * b2 % P2; - const root = pow2(t2, _2n, P2); - if (!Fp.eql(Fp.sqr(root), y3)) - throw new Error("Cannot find square root"); - return root; -} -const Fp = Field(secp256k1P, void 0, void 0, { sqrt: sqrtMod }); -const secp256k1$1 = createCurve({ - a: BigInt(0), - b: BigInt(7), - Fp, - n: secp256k1N, - // Base point (x, y) aka generator point - Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"), - Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"), - h: BigInt(1), - lowS: true, - /** - * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 - */ - endo: { - beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"), - splitScalar: (k2) => { - const n4 = secp256k1N; - const a1 = BigInt("0x3086d221a7d46bcde86c90e49284eb15"); - const b1 = -_1n * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"); - const a22 = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"); - const b2 = a1; - const POW_2_128 = BigInt("0x100000000000000000000000000000000"); - const c1 = divNearest(b2 * k2, n4); - const c2 = divNearest(-b1 * k2, n4); - let k1 = mod(k2 - c1 * a1 - c2 * a22, n4); - let k22 = mod(-c1 * b1 - c2 * b2, n4); - const k1neg = k1 > POW_2_128; - const k2neg = k22 > POW_2_128; - if (k1neg) - k1 = n4 - k1; - if (k2neg) - k22 = n4 - k22; - if (k1 > POW_2_128 || k22 > POW_2_128) { - throw new Error("splitScalar: Endomorphism failed, k=" + k2); - } - return { k1neg, k1, k2neg, k2: k22 }; - } - } -}, sha256$2); -BigInt(0); -secp256k1$1.ProjectivePoint; -const ZeroAddress = "0x0000000000000000000000000000000000000000"; -const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; -const MessagePrefix = "Ethereum Signed Message:\n"; -const BN_0$5 = BigInt(0); -const BN_1$3 = BigInt(1); -const BN_2$1 = BigInt(2); -const BN_27$1 = BigInt(27); -const BN_28$1 = BigInt(28); -const BN_35$1 = BigInt(35); -const _guard$4 = {}; -function toUint256(value) { - return zeroPadValue(toBeArray(value), 32); -} -let Signature$4 = (_j = class { - /** - * @private - */ - constructor(guard2, r2, s2, v6) { - __privateAdd(this, _r2, void 0); - __privateAdd(this, _s2, void 0); - __privateAdd(this, _v2, void 0); - __privateAdd(this, _networkV, void 0); - assertPrivate(guard2, _guard$4, "Signature"); - __privateSet(this, _r2, r2); - __privateSet(this, _s2, s2); - __privateSet(this, _v2, v6); - __privateSet(this, _networkV, null); - } - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { - return __privateGet(this, _r2); - } - set r(value) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - __privateSet(this, _r2, hexlify(value)); - } - /** - * The ``s`` value for a signature. - */ - get s() { - return __privateGet(this, _s2); - } - set s(_value2) { - assertArgument(dataLength(_value2) === 32, "invalid s", "value", _value2); - const value = hexlify(_value2); - assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); - __privateSet(this, _s2, value); - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { - return __privateGet(this, _v2); - } - set v(value) { - const v6 = getNumber(value, "value"); - assertArgument(v6 === 27 || v6 === 28, "invalid v", "v", value); - __privateSet(this, _v2, v6); - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { - return __privateGet(this, _networkV); - } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacyChainId() { - const v6 = this.networkV; - if (v6 == null) { - return null; - } - return _j.getChainId(v6); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return this.v === 27 ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - const yParityAndS = getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 128; - } - return hexlify(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return concat$1([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return concat$1([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); - } - [Symbol.for("nodejs.util.inspect.custom")]() { - return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone2 = new _j(_guard$4, this.r, this.s, this.v); - if (this.networkV) { - __privateSet(clone2, _networkV, this.networkV); - } - return clone2; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: networkV != null ? networkV.toString() : null, - r: this.r, - s: this.s, - v: this.v - }; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getChainId(45) - * //_result: - * - * Signature.getChainId(46) - * //_result: - */ - static getChainId(v6) { - const bv = getBigInt(v6, "v"); - if (bv == BN_27$1 || bv == BN_28$1) { - return BN_0$5; - } - assertArgument(bv >= BN_35$1, "invalid EIP-155 v", "v", v6); - return (bv - BN_35$1) / BN_2$1; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getChainIdV(5, 27) - * //_result: - * - * Signature.getChainIdV(5, 28) - * //_result: - * - */ - static getChainIdV(chainId, v6) { - return getBigInt(chainId) * BN_2$1 + BigInt(35 + v6 - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v6) { - const bv = getBigInt(v6); - if (bv === BN_0$5 || bv === BN_27$1) { - return 27; - } - if (bv === BN_1$3 || bv === BN_28$1) { - return 28; - } - assertArgument(bv >= BN_35$1, "invalid v", "v", v6); - return bv & BN_1$3 ? 27 : 28; - } - /** - * Creates a new [[Signature]]. - * - * If no %%sig%% is provided, a new [[Signature]] is created - * with default values. - * - * If %%sig%% is a string, it is parsed. - */ - static from(sig) { - function assertError(check, message2) { - assertArgument(check, message2, "signature", sig); - } - if (sig == null) { - return new _j(_guard$4, ZeroHash, ZeroHash, 27); - } - if (typeof sig === "string") { - const bytes2 = getBytes(sig, "signature"); - if (bytes2.length === 64) { - const r3 = hexlify(bytes2.slice(0, 32)); - const s3 = bytes2.slice(32, 64); - const v7 = s3[0] & 128 ? 28 : 27; - s3[0] &= 127; - return new _j(_guard$4, r3, hexlify(s3), v7); - } - if (bytes2.length === 65) { - const r3 = hexlify(bytes2.slice(0, 32)); - const s3 = bytes2.slice(32, 64); - assertError((s3[0] & 128) === 0, "non-canonical s"); - const v7 = _j.getNormalizedV(bytes2[64]); - return new _j(_guard$4, r3, hexlify(s3), v7); - } - assertError(false, "invalid raw signature length"); - } - if (sig instanceof _j) { - return sig.clone(); - } - const _r4 = sig.r; - assertError(_r4 != null, "missing r"); - const r2 = toUint256(_r4); - const s2 = function(s3, yParityAndS) { - if (s3 != null) { - return toUint256(s3); - } - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - const bytes2 = getBytes(yParityAndS); - bytes2[0] &= 127; - return hexlify(bytes2); - } - assertError(false, "missing s"); - }(sig.s, sig.yParityAndS); - assertError((getBytes(s2)[0] & 128) == 0, "non-canonical s"); - const { networkV, v: v6 } = function(_v3, yParityAndS, yParity) { - if (_v3 != null) { - const v7 = getBigInt(_v3); - return { - networkV: v7 >= BN_35$1 ? v7 : void 0, - v: _j.getNormalizedV(v7) - }; - } - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - return { v: getBytes(yParityAndS)[0] & 128 ? 28 : 27 }; - } - if (yParity != null) { - switch (getNumber(yParity, "sig.yParity")) { - case 0: - return { v: 27 }; - case 1: - return { v: 28 }; - } - assertError(false, "invalid yParity"); - } - assertError(false, "missing v"); - }(sig.v, sig.yParityAndS, sig.yParity); - const result = new _j(_guard$4, r2, s2, v6); - if (networkV) { - __privateSet(result, _networkV, networkV); - } - assertError(sig.yParity == null || getNumber(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch"); - assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch"); - return result; - } -}, _r2 = new WeakMap(), _s2 = new WeakMap(), _v2 = new WeakMap(), _networkV = new WeakMap(), _j); -const _SigningKey = class _SigningKey { - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - __privateAdd(this, _privateKey, void 0); - assertArgument(dataLength(privateKey) === 32, "invalid private key", "privateKey", "[REDACTED]"); - __privateSet(this, _privateKey, hexlify(privateKey)); - } - /** - * The private key. - */ - get privateKey() { - return __privateGet(this, _privateKey); - } - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey() { - return _SigningKey.computePublicKey(__privateGet(this, _privateKey)); - } - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey() { - return _SigningKey.computePublicKey(__privateGet(this, _privateKey), true); - } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest9) { - assertArgument(dataLength(digest9) === 32, "invalid digest length", "digest", digest9); - const sig = secp256k1$1.sign(getBytesCopy(digest9), getBytesCopy(__privateGet(this, _privateKey)), { - lowS: true - }); - return Signature$4.from({ - r: toBeHex(sig.r, 32), - s: toBeHex(sig.s, 32), - v: sig.recovery ? 28 : 27 - }); - } - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other) { - const pubKey = _SigningKey.computePublicKey(other); - return hexlify(secp256k1$1.getSharedSecret(getBytesCopy(__privateGet(this, _privateKey)), getBytes(pubKey), false)); - } - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key2, compressed) { - let bytes2 = getBytes(key2, "key"); - if (bytes2.length === 32) { - const pubKey = secp256k1$1.getPublicKey(bytes2, !!compressed); - return hexlify(pubKey); - } - if (bytes2.length === 64) { - const pub2 = new Uint8Array(65); - pub2[0] = 4; - pub2.set(bytes2, 1); - bytes2 = pub2; - } - const point5 = secp256k1$1.ProjectivePoint.fromHex(bytes2); - return hexlify(point5.toRawBytes(compressed)); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest9, signature2) { - assertArgument(dataLength(digest9) === 32, "invalid digest length", "digest", digest9); - const sig = Signature$4.from(signature2); - let secpSig = secp256k1$1.Signature.fromCompact(getBytesCopy(concat$1([sig.r, sig.s]))); - secpSig = secpSig.addRecoveryBit(sig.yParity); - const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest9)); - assertArgument(pubKey != null, "invalid signautre for digest", "signature", signature2); - return "0x" + pubKey.toHex(false); - } - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p02, p1, compressed) { - const pub0 = secp256k1$1.ProjectivePoint.fromHex(_SigningKey.computePublicKey(p02).substring(2)); - const pub1 = secp256k1$1.ProjectivePoint.fromHex(_SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed); - } -}; -_privateKey = new WeakMap(); -let SigningKey = _SigningKey; -const BN_0$4 = BigInt(0); -const BN_36 = BigInt(36); -function getChecksumAddress$1(address2) { - address2 = address2.toLowerCase(); - const chars = address2.substring(2).split(""); - const expanded = new Uint8Array(40); - for (let i3 = 0; i3 < 40; i3++) { - expanded[i3] = chars[i3].charCodeAt(0); - } - const hashed = getBytes(keccak256(expanded)); - for (let i3 = 0; i3 < 40; i3 += 2) { - if (hashed[i3 >> 1] >> 4 >= 8) { - chars[i3] = chars[i3].toUpperCase(); - } - if ((hashed[i3 >> 1] & 15) >= 8) { - chars[i3 + 1] = chars[i3 + 1].toUpperCase(); - } - } - return "0x" + chars.join(""); -} -const ibanLookup = {}; -for (let i3 = 0; i3 < 10; i3++) { - ibanLookup[String(i3)] = String(i3); -} -for (let i3 = 0; i3 < 26; i3++) { - ibanLookup[String.fromCharCode(65 + i3)] = String(10 + i3); -} -const safeDigits = 15; -function ibanChecksum(address2) { - address2 = address2.toUpperCase(); - address2 = address2.substring(4) + address2.substring(0, 2) + "00"; - let expanded = address2.split("").map((c2) => { - return ibanLookup[c2]; - }).join(""); - while (expanded.length >= safeDigits) { - let block = expanded.substring(0, safeDigits); - expanded = parseInt(block, 10) % 97 + expanded.substring(block.length); - } - let checksum2 = String(98 - parseInt(expanded, 10) % 97); - while (checksum2.length < 2) { - checksum2 = "0" + checksum2; - } - return checksum2; -} -const Base36 = function() { - const result = {}; - for (let i3 = 0; i3 < 36; i3++) { - const key2 = "0123456789abcdefghijklmnopqrstuvwxyz"[i3]; - result[key2] = BigInt(i3); - } - return result; -}(); -function fromBase36(value) { - value = value.toLowerCase(); - let result = BN_0$4; - for (let i3 = 0; i3 < value.length; i3++) { - result = result * BN_36 + Base36[value[i3]]; - } - return result; -} -function getAddress$1(address2) { - assertArgument(typeof address2 === "string", "invalid address", "address", address2); - if (address2.match(/^(0x)?[0-9a-fA-F]{40}$/)) { - if (!address2.startsWith("0x")) { - address2 = "0x" + address2; - } - const result = getChecksumAddress$1(address2); - assertArgument(!address2.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address2, "bad address checksum", "address", address2); - return result; - } - if (address2.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { - assertArgument(address2.substring(2, 4) === ibanChecksum(address2), "bad icap checksum", "address", address2); - let result = fromBase36(address2.substring(4)).toString(16); - while (result.length < 40) { - result = "0" + result; - } - return getChecksumAddress$1("0x" + result); - } - assertArgument(false, "invalid address", "address", address2); -} -function isAddressable(value) { - return value && typeof value.getAddress === "function"; -} -async function checkAddress(target, promise) { - const result = await promise; - if (result == null || result === "0x0000000000000000000000000000000000000000") { - assert$a(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return getAddress$1(result); -} -function resolveAddress(target, resolver) { - if (typeof target === "string") { - if (target.match(/^0x[0-9a-f]{40}$/i)) { - return getAddress$1(target); - } - assert$a(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - return checkAddress(target, resolver.resolveName(target)); - } else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } else if (target && typeof target.then === "function") { - return checkAddress(target, target); - } - assertArgument(false, "unsupported addressable value", "target", target); -} -const _gaurd = {}; -function n$4(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width }); -} -function b$2(value, size2) { - return new Typed(_gaurd, `bytes${size2 ? size2 : ""}`, value, { size: size2 }); -} -const _typedSymbol = Symbol.for("_ethers_typed"); -const _Typed = class _Typed { - /** - * @_ignore: - */ - constructor(gaurd, type2, value, options) { - /** - * The type, as a Solidity-compatible type. - */ - __publicField(this, "type"); - /** - * The actual value. - */ - __publicField(this, "value"); - __privateAdd(this, _options, void 0); - /** - * @_ignore: - */ - __publicField(this, "_typedSymbol"); - if (options == null) { - options = null; - } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type: type2, value }); - __privateSet(this, _options, options); - this.format(); - } - /** - * Format the type as a Human-Readable type. - */ - format() { - if (this.type === "array") { - throw new Error(""); - } else if (this.type === "dynamicArray") { - throw new Error(""); - } else if (this.type === "tuple") { - return `tuple(${this.value.map((v6) => v6.format()).join(",")})`; - } - return this.type; - } - /** - * The default value returned by this type. - */ - defaultValue() { - return 0; - } - /** - * The minimum value for numeric types. - */ - minValue() { - return 0; - } - /** - * The maximum value for numeric types. - */ - maxValue() { - return 0; - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. - */ - isBigInt() { - return !!this.type.match(/^u?int[0-9]+$/); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedData]]. - */ - isData() { - return this.type.startsWith("bytes"); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedString]]. - */ - isString() { - return this.type === "string"; - } - /** - * Returns the tuple name, if this is a tuple. Throws otherwise. - */ - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return __privateGet(this, _options); - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - /** - * Returns the length of the array type or ``-1`` if it is dynamic. - * - * Throws if the type is not an array. - */ - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (__privateGet(this, _options) === true) { - return -1; - } - if (__privateGet(this, _options) === false) { - return this.value.length; - } - return null; - } - /** - * Returns a new **Typed** of %%type%% with the %%value%%. - */ - static from(type2, value) { - return new _Typed(_gaurd, type2, value); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static uint8(v6) { - return n$4(v6, 8); - } - /** - * Return a new ``uint16`` type for %%v%%. - */ - static uint16(v6) { - return n$4(v6, 16); - } - /** - * Return a new ``uint24`` type for %%v%%. - */ - static uint24(v6) { - return n$4(v6, 24); - } - /** - * Return a new ``uint32`` type for %%v%%. - */ - static uint32(v6) { - return n$4(v6, 32); - } - /** - * Return a new ``uint40`` type for %%v%%. - */ - static uint40(v6) { - return n$4(v6, 40); - } - /** - * Return a new ``uint48`` type for %%v%%. - */ - static uint48(v6) { - return n$4(v6, 48); - } - /** - * Return a new ``uint56`` type for %%v%%. - */ - static uint56(v6) { - return n$4(v6, 56); - } - /** - * Return a new ``uint64`` type for %%v%%. - */ - static uint64(v6) { - return n$4(v6, 64); - } - /** - * Return a new ``uint72`` type for %%v%%. - */ - static uint72(v6) { - return n$4(v6, 72); - } - /** - * Return a new ``uint80`` type for %%v%%. - */ - static uint80(v6) { - return n$4(v6, 80); - } - /** - * Return a new ``uint88`` type for %%v%%. - */ - static uint88(v6) { - return n$4(v6, 88); - } - /** - * Return a new ``uint96`` type for %%v%%. - */ - static uint96(v6) { - return n$4(v6, 96); - } - /** - * Return a new ``uint104`` type for %%v%%. - */ - static uint104(v6) { - return n$4(v6, 104); - } - /** - * Return a new ``uint112`` type for %%v%%. - */ - static uint112(v6) { - return n$4(v6, 112); - } - /** - * Return a new ``uint120`` type for %%v%%. - */ - static uint120(v6) { - return n$4(v6, 120); - } - /** - * Return a new ``uint128`` type for %%v%%. - */ - static uint128(v6) { - return n$4(v6, 128); - } - /** - * Return a new ``uint136`` type for %%v%%. - */ - static uint136(v6) { - return n$4(v6, 136); - } - /** - * Return a new ``uint144`` type for %%v%%. - */ - static uint144(v6) { - return n$4(v6, 144); - } - /** - * Return a new ``uint152`` type for %%v%%. - */ - static uint152(v6) { - return n$4(v6, 152); - } - /** - * Return a new ``uint160`` type for %%v%%. - */ - static uint160(v6) { - return n$4(v6, 160); - } - /** - * Return a new ``uint168`` type for %%v%%. - */ - static uint168(v6) { - return n$4(v6, 168); - } - /** - * Return a new ``uint176`` type for %%v%%. - */ - static uint176(v6) { - return n$4(v6, 176); - } - /** - * Return a new ``uint184`` type for %%v%%. - */ - static uint184(v6) { - return n$4(v6, 184); - } - /** - * Return a new ``uint192`` type for %%v%%. - */ - static uint192(v6) { - return n$4(v6, 192); - } - /** - * Return a new ``uint200`` type for %%v%%. - */ - static uint200(v6) { - return n$4(v6, 200); - } - /** - * Return a new ``uint208`` type for %%v%%. - */ - static uint208(v6) { - return n$4(v6, 208); - } - /** - * Return a new ``uint216`` type for %%v%%. - */ - static uint216(v6) { - return n$4(v6, 216); - } - /** - * Return a new ``uint224`` type for %%v%%. - */ - static uint224(v6) { - return n$4(v6, 224); - } - /** - * Return a new ``uint232`` type for %%v%%. - */ - static uint232(v6) { - return n$4(v6, 232); - } - /** - * Return a new ``uint240`` type for %%v%%. - */ - static uint240(v6) { - return n$4(v6, 240); - } - /** - * Return a new ``uint248`` type for %%v%%. - */ - static uint248(v6) { - return n$4(v6, 248); - } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint256(v6) { - return n$4(v6, 256); - } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint(v6) { - return n$4(v6, 256); - } - /** - * Return a new ``int8`` type for %%v%%. - */ - static int8(v6) { - return n$4(v6, -8); - } - /** - * Return a new ``int16`` type for %%v%%. - */ - static int16(v6) { - return n$4(v6, -16); - } - /** - * Return a new ``int24`` type for %%v%%. - */ - static int24(v6) { - return n$4(v6, -24); - } - /** - * Return a new ``int32`` type for %%v%%. - */ - static int32(v6) { - return n$4(v6, -32); - } - /** - * Return a new ``int40`` type for %%v%%. - */ - static int40(v6) { - return n$4(v6, -40); - } - /** - * Return a new ``int48`` type for %%v%%. - */ - static int48(v6) { - return n$4(v6, -48); - } - /** - * Return a new ``int56`` type for %%v%%. - */ - static int56(v6) { - return n$4(v6, -56); - } - /** - * Return a new ``int64`` type for %%v%%. - */ - static int64(v6) { - return n$4(v6, -64); - } - /** - * Return a new ``int72`` type for %%v%%. - */ - static int72(v6) { - return n$4(v6, -72); - } - /** - * Return a new ``int80`` type for %%v%%. - */ - static int80(v6) { - return n$4(v6, -80); - } - /** - * Return a new ``int88`` type for %%v%%. - */ - static int88(v6) { - return n$4(v6, -88); - } - /** - * Return a new ``int96`` type for %%v%%. - */ - static int96(v6) { - return n$4(v6, -96); - } - /** - * Return a new ``int104`` type for %%v%%. - */ - static int104(v6) { - return n$4(v6, -104); - } - /** - * Return a new ``int112`` type for %%v%%. - */ - static int112(v6) { - return n$4(v6, -112); - } - /** - * Return a new ``int120`` type for %%v%%. - */ - static int120(v6) { - return n$4(v6, -120); - } - /** - * Return a new ``int128`` type for %%v%%. - */ - static int128(v6) { - return n$4(v6, -128); - } - /** - * Return a new ``int136`` type for %%v%%. - */ - static int136(v6) { - return n$4(v6, -136); - } - /** - * Return a new ``int144`` type for %%v%%. - */ - static int144(v6) { - return n$4(v6, -144); - } - /** - * Return a new ``int52`` type for %%v%%. - */ - static int152(v6) { - return n$4(v6, -152); - } - /** - * Return a new ``int160`` type for %%v%%. - */ - static int160(v6) { - return n$4(v6, -160); - } - /** - * Return a new ``int168`` type for %%v%%. - */ - static int168(v6) { - return n$4(v6, -168); - } - /** - * Return a new ``int176`` type for %%v%%. - */ - static int176(v6) { - return n$4(v6, -176); - } - /** - * Return a new ``int184`` type for %%v%%. - */ - static int184(v6) { - return n$4(v6, -184); - } - /** - * Return a new ``int92`` type for %%v%%. - */ - static int192(v6) { - return n$4(v6, -192); - } - /** - * Return a new ``int200`` type for %%v%%. - */ - static int200(v6) { - return n$4(v6, -200); - } - /** - * Return a new ``int208`` type for %%v%%. - */ - static int208(v6) { - return n$4(v6, -208); - } - /** - * Return a new ``int216`` type for %%v%%. - */ - static int216(v6) { - return n$4(v6, -216); - } - /** - * Return a new ``int224`` type for %%v%%. - */ - static int224(v6) { - return n$4(v6, -224); - } - /** - * Return a new ``int232`` type for %%v%%. - */ - static int232(v6) { - return n$4(v6, -232); - } - /** - * Return a new ``int240`` type for %%v%%. - */ - static int240(v6) { - return n$4(v6, -240); - } - /** - * Return a new ``int248`` type for %%v%%. - */ - static int248(v6) { - return n$4(v6, -248); - } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int256(v6) { - return n$4(v6, -256); - } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int(v6) { - return n$4(v6, -256); - } - /** - * Return a new ``bytes1`` type for %%v%%. - */ - static bytes1(v6) { - return b$2(v6, 1); - } - /** - * Return a new ``bytes2`` type for %%v%%. - */ - static bytes2(v6) { - return b$2(v6, 2); - } - /** - * Return a new ``bytes3`` type for %%v%%. - */ - static bytes3(v6) { - return b$2(v6, 3); - } - /** - * Return a new ``bytes4`` type for %%v%%. - */ - static bytes4(v6) { - return b$2(v6, 4); - } - /** - * Return a new ``bytes5`` type for %%v%%. - */ - static bytes5(v6) { - return b$2(v6, 5); - } - /** - * Return a new ``bytes6`` type for %%v%%. - */ - static bytes6(v6) { - return b$2(v6, 6); - } - /** - * Return a new ``bytes7`` type for %%v%%. - */ - static bytes7(v6) { - return b$2(v6, 7); - } - /** - * Return a new ``bytes8`` type for %%v%%. - */ - static bytes8(v6) { - return b$2(v6, 8); - } - /** - * Return a new ``bytes9`` type for %%v%%. - */ - static bytes9(v6) { - return b$2(v6, 9); - } - /** - * Return a new ``bytes10`` type for %%v%%. - */ - static bytes10(v6) { - return b$2(v6, 10); - } - /** - * Return a new ``bytes11`` type for %%v%%. - */ - static bytes11(v6) { - return b$2(v6, 11); - } - /** - * Return a new ``bytes12`` type for %%v%%. - */ - static bytes12(v6) { - return b$2(v6, 12); - } - /** - * Return a new ``bytes13`` type for %%v%%. - */ - static bytes13(v6) { - return b$2(v6, 13); - } - /** - * Return a new ``bytes14`` type for %%v%%. - */ - static bytes14(v6) { - return b$2(v6, 14); - } - /** - * Return a new ``bytes15`` type for %%v%%. - */ - static bytes15(v6) { - return b$2(v6, 15); - } - /** - * Return a new ``bytes16`` type for %%v%%. - */ - static bytes16(v6) { - return b$2(v6, 16); - } - /** - * Return a new ``bytes17`` type for %%v%%. - */ - static bytes17(v6) { - return b$2(v6, 17); - } - /** - * Return a new ``bytes18`` type for %%v%%. - */ - static bytes18(v6) { - return b$2(v6, 18); - } - /** - * Return a new ``bytes19`` type for %%v%%. - */ - static bytes19(v6) { - return b$2(v6, 19); - } - /** - * Return a new ``bytes20`` type for %%v%%. - */ - static bytes20(v6) { - return b$2(v6, 20); - } - /** - * Return a new ``bytes21`` type for %%v%%. - */ - static bytes21(v6) { - return b$2(v6, 21); - } - /** - * Return a new ``bytes22`` type for %%v%%. - */ - static bytes22(v6) { - return b$2(v6, 22); - } - /** - * Return a new ``bytes23`` type for %%v%%. - */ - static bytes23(v6) { - return b$2(v6, 23); - } - /** - * Return a new ``bytes24`` type for %%v%%. - */ - static bytes24(v6) { - return b$2(v6, 24); - } - /** - * Return a new ``bytes25`` type for %%v%%. - */ - static bytes25(v6) { - return b$2(v6, 25); - } - /** - * Return a new ``bytes26`` type for %%v%%. - */ - static bytes26(v6) { - return b$2(v6, 26); - } - /** - * Return a new ``bytes27`` type for %%v%%. - */ - static bytes27(v6) { - return b$2(v6, 27); - } - /** - * Return a new ``bytes28`` type for %%v%%. - */ - static bytes28(v6) { - return b$2(v6, 28); - } - /** - * Return a new ``bytes29`` type for %%v%%. - */ - static bytes29(v6) { - return b$2(v6, 29); - } - /** - * Return a new ``bytes30`` type for %%v%%. - */ - static bytes30(v6) { - return b$2(v6, 30); - } - /** - * Return a new ``bytes31`` type for %%v%%. - */ - static bytes31(v6) { - return b$2(v6, 31); - } - /** - * Return a new ``bytes32`` type for %%v%%. - */ - static bytes32(v6) { - return b$2(v6, 32); - } - /** - * Return a new ``address`` type for %%v%%. - */ - static address(v6) { - return new _Typed(_gaurd, "address", v6); - } - /** - * Return a new ``bool`` type for %%v%%. - */ - static bool(v6) { - return new _Typed(_gaurd, "bool", !!v6); - } - /** - * Return a new ``bytes`` type for %%v%%. - */ - static bytes(v6) { - return new _Typed(_gaurd, "bytes", v6); - } - /** - * Return a new ``string`` type for %%v%%. - */ - static string(v6) { - return new _Typed(_gaurd, "string", v6); - } - /** - * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. - */ - static array(v6, dynamic) { - throw new Error("not implemented yet"); - } - /** - * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. - */ - static tuple(v6, name2) { - throw new Error("not implemented yet"); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static overrides(v6) { - return new _Typed(_gaurd, "overrides", Object.assign({}, v6)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return value && typeof value === "object" && "_typedSymbol" in value && value._typedSymbol === _typedSymbol; - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type2) { - if (_Typed.isTyped(value)) { - if (value.type !== type2) { - throw new Error(`invalid type: expecetd ${type2}, got ${value.type}`); - } - return value.value; - } - return value; - } -}; -_options = new WeakMap(); -let Typed = _Typed; -class AddressCoder extends Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value2) { - let value = Typed.dereference(_value2, "string"); - try { - value = getAddress$1(value); - } catch (error) { - return this._throwError(error.message, _value2); - } - return writer.writeValue(value); - } - decode(reader) { - return getAddress$1(toBeHex(reader.readValue(), 20)); - } -} -class AnonymousCoder extends Coder { - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - __publicField(this, "coder"); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } -} -function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } else if (values && typeof values === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name2 = coder.localName; - assert$a(name2, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - assert$a(!unique[name2], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name2] = true; - return values[name2]; - }); - } else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - let updateFuncs = []; - coders.forEach((coder, index2) => { - let value = arrayValues[index2]; - if (coder.dynamic) { - let dynamicOffset = dynamicWriter.length; - coder.encode(dynamicWriter, value); - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } else { - coder.encode(staticWriter, value); - } - }); - updateFuncs.forEach((func) => { - func(staticWriter.length); - }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; -} -function unpack(reader, coders) { - let values = []; - let keys2 = []; - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset2 = reader.readIndex(); - let offsetReader = baseReader.subReader(offset2); - try { - value = coder.decode(offsetReader); - } catch (error) { - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } else { - try { - value = coder.decode(reader); - } catch (error) { - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == void 0) { - throw new Error("investigate"); - } - values.push(value); - keys2.push(coder.localName || null); - }); - return Result.fromItems(values, keys2); -} -class ArrayCoder extends Coder { - constructor(coder, length, localName) { - const type2 = coder.type + "[" + (length >= 0 ? length : "") + "]"; - const dynamic = length === -1 || coder.dynamic; - super("array", type2, localName, dynamic); - __publicField(this, "coder"); - __publicField(this, "length"); - defineProperties(this, { coder, length }); - } - defaultValue() { - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i3 = 0; i3 < this.length; i3++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value2) { - const value = Typed.dereference(_value2, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); - let coders = []; - for (let i3 = 0; i3 < value.length; i3++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - assert$a(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength }); - } - let coders = []; - for (let i3 = 0; i3 < count; i3++) { - coders.push(new AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } -} -class BooleanCoder extends Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value2) { - const value = Typed.dereference(_value2, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } -} -class DynamicBytesCoder extends Coder { - constructor(type2, localName) { - super(type2, type2, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } -} -class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return hexlify(super.decode(reader)); - } -} -class FixedBytesCoder extends Coder { - constructor(size2, localName) { - let name2 = "bytes" + String(size2); - super(name2, name2, localName, false); - __publicField(this, "size"); - defineProperties(this, { size: size2 }, { size: "number" }); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); - } - encode(writer, _value2) { - let data = getBytesCopy(Typed.dereference(_value2, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value2); - } - return writer.writeBytes(data); - } - decode(reader) { - return hexlify(reader.readBytes(this.size)); - } -} -const Empty = new Uint8Array([]); -class NullCoder extends Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } -} -const BN_0$3 = BigInt(0); -const BN_1$2 = BigInt(1); -const BN_MAX_UINT256$2 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -class NumberCoder extends Coder { - constructor(size2, signed, localName) { - const name2 = (signed ? "int" : "uint") + size2 * 8; - super(name2, name2, localName, false); - __publicField(this, "size"); - __publicField(this, "signed"); - defineProperties(this, { size: size2, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value2) { - let value = getBigInt(Typed.dereference(_value2, this.type)); - let maxUintValue = mask(BN_MAX_UINT256$2, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, this.size * 8 - 1); - if (value > bounds || value < -(bounds + BN_1$2)) { - this._throwError("value out-of-bounds", _value2); - } - value = toTwos(value, 8 * WordSize); - } else if (value < BN_0$3 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value2); - } - return writer.writeValue(value); - } - decode(reader) { - let value = mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = fromTwos(value, this.size * 8); - } - return value; - } -} -class StringCoder extends DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value2) { - return super.encode(writer, toUtf8Bytes(Typed.dereference(_value2, "string"))); - } - decode(reader) { - return toUtf8String(super.decode(reader)); - } -} -class TupleCoder extends Coder { - constructor(coders, localName) { - let dynamic = false; - const types2 = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types2.push(coder.type); - }); - const type2 = "tuple(" + types2.join(",") + ")"; - super("tuple", type2, localName, dynamic); - __publicField(this, "coders"); - defineProperties(this, { coders: Object.freeze(coders.slice()) }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - const uniqueNames = this.coders.reduce((accum, coder) => { - const name2 = coder.localName; - if (name2) { - if (!accum[name2]) { - accum[name2] = 0; - } - accum[name2]++; - } - return accum; - }, {}); - this.coders.forEach((coder, index2) => { - let name2 = coder.localName; - if (!name2 || uniqueNames[name2] !== 1) { - return; - } - if (name2 === "length") { - name2 = "_length"; - } - if (values[name2] != null) { - return; - } - values[name2] = values[index2]; - }); - return Object.freeze(values); - } - encode(writer, _value2) { - const value = Typed.dereference(_value2, "tuple"); - return pack(writer, this.coders, value); - } - decode(reader) { - return unpack(reader, this.coders); - } -} -function id(value) { - return keccak256(toUtf8Bytes(value)); -} -function accessSetify(addr, storageKeys) { - return { - address: getAddress$1(addr), - storageKeys: storageKeys.map((storageKey, index2) => { - assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index2}]`, storageKey); - return storageKey.toLowerCase(); - }) - }; -} -function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set2, index2) => { - if (Array.isArray(set2)) { - assertArgument(set2.length === 2, "invalid slot set", `value[${index2}]`, set2); - return accessSetify(set2[0], set2[1]); - } - assertArgument(set2 != null && typeof set2 === "object", "invalid address-slot set", "value", value); - return accessSetify(set2.address, set2.storageKeys); - }); - } - assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a3, b2) => a3.address.localeCompare(b2.address)); - return result; -} -function computeAddress$1(key2) { - let pubkey; - if (typeof key2 === "string") { - pubkey = SigningKey.computePublicKey(key2, false); - } else { - pubkey = key2.publicKey; - } - return getAddress$1(keccak256("0x" + pubkey.substring(4)).substring(26)); -} -function recoverAddress(digest9, signature2) { - return computeAddress$1(SigningKey.recoverPublicKey(digest9, signature2)); -} -const BN_0$2 = BigInt(0); -const BN_2 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -const BLOB_SIZE = 4096 * 32; -function getVersionedHash(version2, hash3) { - let versioned = version2.toString(16); - while (versioned.length < 2) { - versioned = "0" + versioned; - } - versioned += sha256$1(hash3).substring(4); - return "0x" + versioned; -} -function handleAddress(value) { - if (value === "0x") { - return null; - } - return getAddress$1(value); -} -function handleAccessList(value, param) { - try { - return accessListify(value); - } catch (error) { - assertArgument(false, error.message, param, value); - } -} -function handleNumber(_value2, param) { - if (_value2 === "0x") { - return 0; - } - return getNumber(_value2, param); -} -function handleUint(_value2, param) { - if (_value2 === "0x") { - return BN_0$2; - } - const value = getBigInt(_value2, param); - assertArgument(value <= BN_MAX_UINT, "value exceeds uint size", param, value); - return value; -} -function formatNumber(_value2, name2) { - const value = getBigInt(_value2, "value"); - const result = toBeArray(value); - assertArgument(result.length <= 32, `value too large`, `tx.${name2}`, value); - return result; -} -function formatAccessList(value) { - return accessListify(value).map((set2) => [set2.address, set2.storageKeys]); -} -function formatHashes(value, param) { - assertArgument(Array.isArray(value), `invalid ${param}`, "value", value); - for (let i3 = 0; i3 < value.length; i3++) { - assertArgument(isHexString(value[i3], 32), "invalid ${ param } hash", `value[${i3}]`, value[i3]); - } - return value; -} -function _parseLegacy(data) { - const fields = decodeRlp(data); - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), "invalid field count for legacy transaction", "data", data); - const tx = { - type: 0, - nonce: handleNumber(fields[0], "nonce"), - gasPrice: handleUint(fields[1], "gasPrice"), - gasLimit: handleUint(fields[2], "gasLimit"), - to: handleAddress(fields[3]), - value: handleUint(fields[4], "value"), - data: hexlify(fields[5]), - chainId: BN_0$2 - }; - if (fields.length === 6) { - return tx; - } - const v6 = handleUint(fields[6], "v"); - const r2 = handleUint(fields[7], "r"); - const s2 = handleUint(fields[8], "s"); - if (r2 === BN_0$2 && s2 === BN_0$2) { - tx.chainId = v6; - } else { - let chainId = (v6 - BN_35) / BN_2; - if (chainId < BN_0$2) { - chainId = BN_0$2; - } - tx.chainId = chainId; - assertArgument(chainId !== BN_0$2 || (v6 === BN_27 || v6 === BN_28), "non-canonical legacy v", "v", fields[6]); - tx.signature = Signature$4.from({ - r: zeroPadValue(fields[7], 32), - s: zeroPadValue(fields[8], 32), - v: v6 - }); - } - return tx; -} -function _serializeLegacy(tx, sig) { - const fields = [ - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - tx.to || "0x", - formatNumber(tx.value, "value"), - tx.data - ]; - let chainId = BN_0$2; - if (tx.chainId != BN_0$2) { - chainId = getBigInt(tx.chainId, "tx.chainId"); - assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig); - } else if (tx.signature) { - const legacy = tx.signature.legacyChainId; - if (legacy != null) { - chainId = legacy; - } - } - if (!sig) { - if (chainId !== BN_0$2) { - fields.push(toBeArray(chainId)); - fields.push("0x"); - fields.push("0x"); - } - return encodeRlp(fields); - } - let v6 = BigInt(27 + sig.yParity); - if (chainId !== BN_0$2) { - v6 = Signature$4.getChainIdV(chainId, sig.v); - } else if (BigInt(sig.v) !== v6) { - assertArgument(false, "tx.chainId/sig.v mismatch", "sig", sig); - } - fields.push(toBeArray(v6)); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - return encodeRlp(fields); -} -function _parseEipSignature(tx, fields) { - let yParity; - try { - yParity = handleNumber(fields[0], "yParity"); - if (yParity !== 0 && yParity !== 1) { - throw new Error("bad yParity"); - } - } catch (error) { - assertArgument(false, "invalid yParity", "yParity", fields[0]); - } - const r2 = zeroPadValue(fields[1], 32); - const s2 = zeroPadValue(fields[2], 32); - const signature2 = Signature$4.from({ r: r2, s: s2, yParity }); - tx.signature = signature2; -} -function _parseEip1559(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), "invalid field count for transaction type: 2", "data", hexlify(data)); - const tx = { - type: 2, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList") - }; - if (fields.length === 9) { - return tx; - } - _parseEipSignature(tx, fields.slice(9)); - return tx; -} -function _serializeEip1559(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - tx.to || "0x", - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat$1(["0x02", encodeRlp(fields)]); -} -function _parseEip2930(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), "invalid field count for transaction type: 1", "data", hexlify(data)); - const tx = { - type: 1, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - gasPrice: handleUint(fields[2], "gasPrice"), - gasLimit: handleUint(fields[3], "gasLimit"), - to: handleAddress(fields[4]), - value: handleUint(fields[5], "value"), - data: hexlify(fields[6]), - accessList: handleAccessList(fields[7], "accessList") - }; - if (fields.length === 8) { - return tx; - } - _parseEipSignature(tx, fields.slice(8)); - return tx; -} -function _serializeEip2930(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - tx.to || "0x", - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "recoveryParam")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat$1(["0x01", encodeRlp(fields)]); -} -function _parseEip4844(data) { - let fields = decodeRlp(getBytes(data).slice(1)); - let typeName = "3"; - let blobs = null; - if (fields.length === 4 && Array.isArray(fields[0])) { - typeName = "3 (network format)"; - const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3]; - assertArgument(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs); - assertArgument(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits); - assertArgument(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs); - assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - assertArgument(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - blobs = []; - for (let i3 = 0; i3 < fields[1].length; i3++) { - blobs.push({ - data: fBlobs[i3], - commitment: fCommits[i3], - proof: fProofs[i3] - }); - } - fields = fields[0]; - } - assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, "data", hexlify(data)); - const tx = { - type: 3, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"), - blobVersionedHashes: fields[10] - }; - if (blobs) { - tx.blobs = blobs; - } - assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, "data", data); - assertArgument(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data); - for (let i3 = 0; i3 < tx.blobVersionedHashes.length; i3++) { - assertArgument(isHexString(tx.blobVersionedHashes[i3], 32), `invalid blobVersionedHash at index ${i3}: must be length 32`, "data", data); - } - if (fields.length === 11) { - return tx; - } - _parseEipSignature(tx, fields.slice(11)); - return tx; -} -function _serializeEip4844(tx, sig, blobs) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - tx.to || ZeroAddress, - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []), - formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"), - formatHashes(tx.blobVersionedHashes || [], "blobVersionedHashes") - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - if (blobs) { - return concat$1([ - "0x03", - encodeRlp([ - fields, - blobs.map((b2) => b2.data), - blobs.map((b2) => b2.commitment), - blobs.map((b2) => b2.proof) - ]) - ]); - } - } - return concat$1(["0x03", encodeRlp(fields)]); -} -let Transaction$1 = (_k = class { - /** - * Creates a new Transaction with default values. - */ - constructor() { - __privateAdd(this, _getSerialized); - __privateAdd(this, _type, void 0); - __privateAdd(this, _to, void 0); - __privateAdd(this, _data3, void 0); - __privateAdd(this, _nonce, void 0); - __privateAdd(this, _gasLimit, void 0); - __privateAdd(this, _gasPrice, void 0); - __privateAdd(this, _maxPriorityFeePerGas, void 0); - __privateAdd(this, _maxFeePerGas, void 0); - __privateAdd(this, _value, void 0); - __privateAdd(this, _chainId, void 0); - __privateAdd(this, _sig, void 0); - __privateAdd(this, _accessList, void 0); - __privateAdd(this, _maxFeePerBlobGas, void 0); - __privateAdd(this, _blobVersionedHashes, void 0); - __privateAdd(this, _kzg, void 0); - __privateAdd(this, _blobs, void 0); - __privateSet(this, _type, null); - __privateSet(this, _to, null); - __privateSet(this, _nonce, 0); - __privateSet(this, _gasLimit, BN_0$2); - __privateSet(this, _gasPrice, null); - __privateSet(this, _maxPriorityFeePerGas, null); - __privateSet(this, _maxFeePerGas, null); - __privateSet(this, _data3, "0x"); - __privateSet(this, _value, BN_0$2); - __privateSet(this, _chainId, BN_0$2); - __privateSet(this, _sig, null); - __privateSet(this, _accessList, null); - __privateSet(this, _maxFeePerBlobGas, null); - __privateSet(this, _blobVersionedHashes, null); - __privateSet(this, _blobs, null); - __privateSet(this, _kzg, null); - } - /** - * The transaction type. - * - * If null, the type will be automatically inferred based on - * explicit properties. - */ - get type() { - return __privateGet(this, _type); - } - set type(value) { - switch (value) { - case null: - __privateSet(this, _type, null); - break; - case 0: - case "legacy": - __privateSet(this, _type, 0); - break; - case 1: - case "berlin": - case "eip-2930": - __privateSet(this, _type, 1); - break; - case 2: - case "london": - case "eip-1559": - __privateSet(this, _type, 2); - break; - case 3: - case "cancun": - case "eip-4844": - __privateSet(this, _type, 3); - break; - default: - assertArgument(false, "unsupported transaction type", "type", value); - } - } - /** - * The name of the transaction type. - */ - get typeName() { - switch (this.type) { - case 0: - return "legacy"; - case 1: - return "eip-2930"; - case 2: - return "eip-1559"; - case 3: - return "eip-4844"; - } - return null; - } - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - const value = __privateGet(this, _to); - if (value == null && this.type === 3) { - return ZeroAddress; - } - return value; - } - set to(value) { - __privateSet(this, _to, value == null ? null : getAddress$1(value)); - } - /** - * The transaction nonce. - */ - get nonce() { - return __privateGet(this, _nonce); - } - set nonce(value) { - __privateSet(this, _nonce, getNumber(value, "value")); - } - /** - * The gas limit. - */ - get gasLimit() { - return __privateGet(this, _gasLimit); - } - set gasLimit(value) { - __privateSet(this, _gasLimit, getBigInt(value)); - } - /** - * The gas price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get gasPrice() { - const value = __privateGet(this, _gasPrice); - if (value == null && (this.type === 0 || this.type === 1)) { - return BN_0$2; - } - return value; - } - set gasPrice(value) { - __privateSet(this, _gasPrice, value == null ? null : getBigInt(value, "gasPrice")); - } - /** - * The maximum priority fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxPriorityFeePerGas() { - const value = __privateGet(this, _maxPriorityFeePerGas); - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0$2; - } - return null; - } - return value; - } - set maxPriorityFeePerGas(value) { - __privateSet(this, _maxPriorityFeePerGas, value == null ? null : getBigInt(value, "maxPriorityFeePerGas")); - } - /** - * The maximum total fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxFeePerGas() { - const value = __privateGet(this, _maxFeePerGas); - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0$2; - } - return null; - } - return value; - } - set maxFeePerGas(value) { - __privateSet(this, _maxFeePerGas, value == null ? null : getBigInt(value, "maxFeePerGas")); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { - return __privateGet(this, _data3); - } - set data(value) { - __privateSet(this, _data3, hexlify(value)); - } - /** - * The amount of ether (in wei) to send in this transactions. - */ - get value() { - return __privateGet(this, _value); - } - set value(value) { - __privateSet(this, _value, getBigInt(value, "value")); - } - /** - * The chain ID this transaction is valid on. - */ - get chainId() { - return __privateGet(this, _chainId); - } - set chainId(value) { - __privateSet(this, _chainId, getBigInt(value)); - } - /** - * If signed, the signature for this transaction. - */ - get signature() { - return __privateGet(this, _sig) || null; - } - set signature(value) { - __privateSet(this, _sig, value == null ? null : Signature$4.from(value)); - } - /** - * The access list. - * - * An access list permits discounted (but pre-paid) access to - * bytecode and state variable access within contract execution. - */ - get accessList() { - const value = __privateGet(this, _accessList) || null; - if (value == null) { - if (this.type === 1 || this.type === 2 || this.type === 3) { - return []; - } - return null; - } - return value; - } - set accessList(value) { - __privateSet(this, _accessList, value == null ? null : accessListify(value)); - } - /** - * The max fee per blob gas for Cancun transactions. - */ - get maxFeePerBlobGas() { - const value = __privateGet(this, _maxFeePerBlobGas); - if (value == null && this.type === 3) { - return BN_0$2; - } - return value; - } - set maxFeePerBlobGas(value) { - __privateSet(this, _maxFeePerBlobGas, value == null ? null : getBigInt(value, "maxFeePerBlobGas")); - } - /** - * The BLOb versioned hashes for Cancun transactions. - */ - get blobVersionedHashes() { - let value = __privateGet(this, _blobVersionedHashes); - if (value == null && this.type === 3) { - return []; - } - return value; - } - set blobVersionedHashes(value) { - if (value != null) { - assertArgument(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value); - value = value.slice(); - for (let i3 = 0; i3 < value.length; i3++) { - assertArgument(isHexString(value[i3], 32), "invalid blobVersionedHash", `value[${i3}]`, value[i3]); - } - } - __privateSet(this, _blobVersionedHashes, value); - } - /** - * The BLObs for the Transaction, if any. - * - * If ``blobs`` is non-``null``, then the [[seriailized]] - * will return the network formatted sidecar, otherwise it - * will return the standard [[link-eip-2718]] payload. The - * [[unsignedSerialized]] is unaffected regardless. - * - * When setting ``blobs``, either fully valid [[Blob]] objects - * may be specified (i.e. correctly padded, with correct - * committments and proofs) or a raw [[BytesLike]] may - * be provided. - * - * If raw [[BytesLike]] are provided, the [[kzg]] property **must** - * be already set. The blob will be correctly padded and the - * [[KzgLibrary]] will be used to compute the committment and - * proof for the blob. - * - * A BLOb is a sequence of field elements, each of which must - * be within the BLS field modulo, so some additional processing - * may be required to encode arbitrary data to ensure each 32 byte - * field is within the valid range. - * - * Setting this automatically populates [[blobVersionedHashes]], - * overwriting any existing values. Setting this to ``null`` - * does **not** remove the [[blobVersionedHashes]], leaving them - * present. - */ - get blobs() { - if (__privateGet(this, _blobs) == null) { - return null; - } - return __privateGet(this, _blobs).map((b2) => Object.assign({}, b2)); - } - set blobs(_blobs2) { - if (_blobs2 == null) { - __privateSet(this, _blobs, null); - return; - } - const blobs = []; - const versionedHashes = []; - for (let i3 = 0; i3 < _blobs2.length; i3++) { - const blob2 = _blobs2[i3]; - if (isBytesLike(blob2)) { - assert$a(__privateGet(this, _kzg), "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", { - operation: "set blobs()" - }); - let data = getBytes(blob2); - assertArgument(data.length <= BLOB_SIZE, "blob is too large", `blobs[${i3}]`, blob2); - if (data.length !== BLOB_SIZE) { - const padded = new Uint8Array(BLOB_SIZE); - padded.set(data); - data = padded; - } - const commit = __privateGet(this, _kzg).blobToKzgCommitment(data); - const proof = hexlify(__privateGet(this, _kzg).computeBlobKzgProof(data, commit)); - blobs.push({ - data: hexlify(data), - commitment: hexlify(commit), - proof - }); - versionedHashes.push(getVersionedHash(1, commit)); - } else { - const commit = hexlify(blob2.commitment); - blobs.push({ - data: hexlify(blob2.data), - commitment: commit, - proof: hexlify(blob2.proof) - }); - versionedHashes.push(getVersionedHash(1, commit)); - } - } - __privateSet(this, _blobs, blobs); - __privateSet(this, _blobVersionedHashes, versionedHashes); - } - get kzg() { - return __privateGet(this, _kzg); - } - set kzg(kzg) { - __privateSet(this, _kzg, kzg); - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return keccak256(__privateMethod(this, _getSerialized, getSerialized_fn).call(this, true, false)); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return keccak256(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - return recoverAddress(this.unsignedHash, this.signature); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - return this.signature != null; - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - return __privateMethod(this, _getSerialized, getSerialized_fn).call(this, true, true); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return __privateMethod(this, _getSerialized, getSerialized_fn).call(this, false, false); - } - /** - * Return the most "likely" type; currently the highest - * supported transaction type. - */ - inferType() { - const types2 = this.inferTypes(); - if (types2.indexOf(2) >= 0) { - return 2; - } - return types2.pop(); - } - /** - * Validates the explicit properties and returns a list of compatible - * transaction types. - */ - inferTypes() { - const hasGasPrice = this.gasPrice != null; - const hasFee = this.maxFeePerGas != null || this.maxPriorityFeePerGas != null; - const hasAccessList = this.accessList != null; - const hasBlob = __privateGet(this, _maxFeePerBlobGas) != null || __privateGet(this, _blobVersionedHashes); - if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) { - assert$a(this.maxFeePerGas >= this.maxPriorityFeePerGas, "priorityFee cannot be more than maxFee", "BAD_DATA", { value: this }); - } - assert$a(!hasFee || this.type !== 0 && this.type !== 1, "transaction type cannot have maxFeePerGas or maxPriorityFeePerGas", "BAD_DATA", { value: this }); - assert$a(this.type !== 0 || !hasAccessList, "legacy transaction cannot have accessList", "BAD_DATA", { value: this }); - const types2 = []; - if (this.type != null) { - types2.push(this.type); - } else { - if (hasFee) { - types2.push(2); - } else if (hasGasPrice) { - types2.push(1); - if (!hasAccessList) { - types2.push(0); - } - } else if (hasAccessList) { - types2.push(1); - types2.push(2); - } else if (hasBlob && this.to) { - types2.push(3); - } else { - types2.push(0); - types2.push(1); - types2.push(2); - types2.push(3); - } - } - types2.sort(); - return types2; - } - /** - * Returns true if this transaction is a legacy transaction (i.e. - * ``type === 0``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLegacy() { - return this.type === 0; - } - /** - * Returns true if this transaction is berlin hardform transaction (i.e. - * ``type === 1``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isBerlin() { - return this.type === 1; - } - /** - * Returns true if this transaction is london hardform transaction (i.e. - * ``type === 2``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLondon() { - return this.type === 2; - } - /** - * Returns true if this transaction is an [[link-eip-4844]] BLOB - * transaction. - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isCancun() { - return this.type === 3; - } - /** - * Create a copy of this transaciton. - */ - clone() { - return _k.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s2 = (v6) => { - if (v6 == null) { - return null; - } - return v6.toString(); - }; - return { - type: this.type, - to: this.to, - // from: this.from, - data: this.data, - nonce: this.nonce, - gasLimit: s2(this.gasLimit), - gasPrice: s2(this.gasPrice), - maxPriorityFeePerGas: s2(this.maxPriorityFeePerGas), - maxFeePerGas: s2(this.maxFeePerGas), - value: s2(this.value), - chainId: s2(this.chainId), - sig: this.signature ? this.signature.toJSON() : null, - accessList: this.accessList - }; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new _k(); - } - if (typeof tx === "string") { - const payload = getBytes(tx); - if (payload[0] >= 127) { - return _k.from(_parseLegacy(payload)); - } - switch (payload[0]) { - case 1: - return _k.from(_parseEip2930(payload)); - case 2: - return _k.from(_parseEip1559(payload)); - case 3: - return _k.from(_parseEip4844(payload)); - } - assert$a(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" }); - } - const result = new _k(); - if (tx.type != null) { - result.type = tx.type; - } - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.gasLimit != null) { - result.gasLimit = tx.gasLimit; - } - if (tx.gasPrice != null) { - result.gasPrice = tx.gasPrice; - } - if (tx.maxPriorityFeePerGas != null) { - result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas; - } - if (tx.maxFeePerGas != null) { - result.maxFeePerGas = tx.maxFeePerGas; - } - if (tx.maxFeePerBlobGas != null) { - result.maxFeePerBlobGas = tx.maxFeePerBlobGas; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.chainId != null) { - result.chainId = tx.chainId; - } - if (tx.signature != null) { - result.signature = Signature$4.from(tx.signature); - } - if (tx.accessList != null) { - result.accessList = tx.accessList; - } - if (tx.blobVersionedHashes != null) { - result.blobVersionedHashes = tx.blobVersionedHashes; - } - if (tx.kzg != null) { - result.kzg = tx.kzg; - } - if (tx.blobs != null) { - result.blobs = tx.blobs; - } - if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); - assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } -}, _type = new WeakMap(), _to = new WeakMap(), _data3 = new WeakMap(), _nonce = new WeakMap(), _gasLimit = new WeakMap(), _gasPrice = new WeakMap(), _maxPriorityFeePerGas = new WeakMap(), _maxFeePerGas = new WeakMap(), _value = new WeakMap(), _chainId = new WeakMap(), _sig = new WeakMap(), _accessList = new WeakMap(), _maxFeePerBlobGas = new WeakMap(), _blobVersionedHashes = new WeakMap(), _kzg = new WeakMap(), _blobs = new WeakMap(), _getSerialized = new WeakSet(), getSerialized_fn = function(signed, sidecar) { - assert$a(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - const sig = signed ? this.signature : null; - switch (this.inferType()) { - case 0: - return _serializeLegacy(this, sig); - case 1: - return _serializeEip2930(this, sig); - case 2: - return _serializeEip1559(this, sig); - case 3: - return _serializeEip4844(this, sig, sidecar ? this.blobs : null); - } - assert$a(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); -}, _k); -function hashMessage$1(message2) { - if (typeof message2 === "string") { - message2 = toUtf8Bytes(message2); - } - return keccak256(concat$1([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message2.length)), - message2 - ])); -} -const padding$1 = new Uint8Array(32); -padding$1.fill(0); -const BN__1$1 = BigInt(-1); -const BN_0$1 = BigInt(0); -const BN_1$1 = BigInt(1); -const BN_MAX_UINT256$1 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -function hexPadRight$1(value) { - const bytes2 = getBytes(value); - const padOffset = bytes2.length % 32; - if (padOffset) { - return concat$1([bytes2, padding$1.slice(padOffset)]); - } - return hexlify(bytes2); -} -const hexTrue$1 = toBeHex(BN_1$1, 32); -const hexFalse$1 = toBeHex(BN_0$1, 32); -const domainFieldTypes$1 = { - name: "string", - version: "string", - chainId: "uint256", - verifyingContract: "address", - salt: "bytes32" -}; -const domainFieldNames$1 = [ - "name", - "version", - "chainId", - "verifyingContract", - "salt" -]; -function checkString$1(key2) { - return function(value) { - assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key2)}`, `domain.${key2}`, value); - return value; - }; -} -const domainChecks$1 = { - name: checkString$1("name"), - version: checkString$1("version"), - chainId: function(_value2) { - const value = getBigInt(_value2, "domain.chainId"); - assertArgument(value >= 0, "invalid chain ID", "domain.chainId", _value2); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function(value) { - try { - return getAddress$1(value).toLowerCase(); - } catch (error) { - } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function(value) { - const bytes2 = getBytes(value, "domain.salt"); - assertArgument(bytes2.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes2); - } -}; -function getBaseEncoder$1(type2) { - { - const match = type2.match(/^(u?)int(\d+)$/); - if (match) { - const signed = match[1] === ""; - const width = parseInt(match[2]); - assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), "invalid numeric width", "type", type2); - const boundsUpper = mask(BN_MAX_UINT256$1, signed ? width - 1 : width); - const boundsLower = signed ? (boundsUpper + BN_1$1) * BN__1$1 : BN_0$1; - return function(_value2) { - const value = getBigInt(_value2, "value"); - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type2}`, "value", value); - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - { - const match = type2.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type2); - return function(value) { - const bytes2 = getBytes(value); - assertArgument(bytes2.length === width, `invalid length for ${type2}`, "value", value); - return hexPadRight$1(value); - }; - } - } - switch (type2) { - case "address": - return function(value) { - return zeroPadValue(getAddress$1(value), 32); - }; - case "bool": - return function(value) { - return !value ? hexFalse$1 : hexTrue$1; - }; - case "bytes": - return function(value) { - return keccak256(value); - }; - case "string": - return function(value) { - return id(value); - }; - } - return null; -} -function encodeType$1(name2, fields) { - return `${name2}(${fields.map(({ name: name3, type: type2 }) => type2 + " " + name3).join(",")})`; -} -function splitArray(type2) { - const match = type2.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/); - if (match) { - return { - base: match[1], - index: match[2] + match[4], - array: { - base: match[1], - prefix: match[1] + match[2], - count: match[5] ? parseInt(match[5]) : -1 - } - }; - } - return { base: type2 }; -} -let TypedDataEncoder$1 = (_l = class { - /** - * Create a new **TypedDataEncoder** for %%types%%. - * - * This performs all necessary checking that types are valid and - * do not violate the [[link-eip-712]] structural constraints as - * well as computes the [[primaryType]]. - */ - constructor(_types3) { - __privateAdd(this, _getEncoder); - /** - * The primary type for the structured [[types]]. - * - * This is derived automatically from the [[types]], since no - * recursion is possible, once the DAG for the types is consturcted - * internally, the primary type must be the only remaining type with - * no parent nodes. - */ - __publicField(this, "primaryType"); - __privateAdd(this, _types, void 0); - __privateAdd(this, _fullTypes, void 0); - __privateAdd(this, _encoderCache, void 0); - __privateSet(this, _fullTypes, /* @__PURE__ */ new Map()); - __privateSet(this, _encoderCache, /* @__PURE__ */ new Map()); - const links = /* @__PURE__ */ new Map(); - const parents = /* @__PURE__ */ new Map(); - const subtypes = /* @__PURE__ */ new Map(); - const types2 = {}; - Object.keys(_types3).forEach((type2) => { - types2[type2] = _types3[type2].map(({ name: name2, type: type3 }) => { - let { base: base3, index: index2 } = splitArray(type3); - if (base3 === "int" && !_types3["int"]) { - base3 = "int256"; - } - if (base3 === "uint" && !_types3["uint"]) { - base3 = "uint256"; - } - return { name: name2, type: base3 + (index2 || "") }; - }); - links.set(type2, /* @__PURE__ */ new Set()); - parents.set(type2, []); - subtypes.set(type2, /* @__PURE__ */ new Set()); - }); - __privateSet(this, _types, JSON.stringify(types2)); - for (const name2 in types2) { - const uniqueNames = /* @__PURE__ */ new Set(); - for (const field of types2[name2]) { - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name2)}`, "types", _types3); - uniqueNames.add(field.name); - const baseType = splitArray(field.type).base; - assertArgument(baseType !== name2, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types3); - const encoder2 = getBaseEncoder$1(baseType); - if (encoder2) { - continue; - } - assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", _types3); - parents.get(baseType).push(name2); - links.get(name2).add(baseType); - } - } - const primaryTypes = Array.from(parents.keys()).filter((n4) => parents.get(n4).length === 0); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", _types3); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t2) => JSON.stringify(t2)).join(", ")}`, "types", _types3); - defineProperties(this, { primaryType: primaryTypes[0] }); - function checkCircular(type2, found) { - assertArgument(!found.has(type2), `circular type reference to ${JSON.stringify(type2)}`, "types", _types3); - found.add(type2); - for (const child of links.get(type2)) { - if (!parents.has(child)) { - continue; - } - checkCircular(child, found); - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type2); - } - checkCircular(this.primaryType, /* @__PURE__ */ new Set()); - for (const [name2, set2] of subtypes) { - const st2 = Array.from(set2); - st2.sort(); - __privateGet(this, _fullTypes).set(name2, encodeType$1(name2, types2[name2]) + st2.map((t2) => encodeType$1(t2, types2[t2])).join("")); - } - } - /** - * The types. - */ - get types() { - return JSON.parse(__privateGet(this, _types)); - } - /** - * Returnthe encoder for the specific %%type%%. - */ - getEncoder(type2) { - let encoder2 = __privateGet(this, _encoderCache).get(type2); - if (!encoder2) { - encoder2 = __privateMethod(this, _getEncoder, getEncoder_fn).call(this, type2); - __privateGet(this, _encoderCache).set(type2, encoder2); - } - return encoder2; - } - /** - * Return the full type for %%name%%. - */ - encodeType(name2) { - const result = __privateGet(this, _fullTypes).get(name2); - assertArgument(result, `unknown type: ${JSON.stringify(name2)}`, "name", name2); - return result; - } - /** - * Return the encoded %%value%% for the %%type%%. - */ - encodeData(type2, value) { - return this.getEncoder(type2)(value); - } - /** - * Returns the hash of %%value%% for the type of %%name%%. - */ - hashStruct(name2, value) { - return keccak256(this.encodeData(name2, value)); - } - /** - * Return the fulled encoded %%value%% for the [[types]]. - */ - encode(value) { - return this.encodeData(this.primaryType, value); - } - /** - * Return the hash of the fully encoded %%value%% for the [[types]]. - */ - hash(value) { - return this.hashStruct(this.primaryType, value); - } - /** - * @_ignore: - */ - _visit(type2, value, callback) { - { - const encoder2 = getBaseEncoder$1(type2); - if (encoder2) { - return callback(type2, value); - } - } - const array2 = splitArray(type2).array; - if (array2) { - assertArgument(array2.count === -1 || array2.count === value.length, `array length mismatch; expected length ${array2.count}`, "value", value); - return value.map((v6) => this._visit(array2.prefix, v6, callback)); - } - const fields = this.types[type2]; - if (fields) { - return fields.reduce((accum, { name: name2, type: type3 }) => { - accum[name2] = this._visit(type3, value[name2], callback); - return accum; - }, {}); - } - assertArgument(false, `unknown type: ${type2}`, "type", type2); - } - /** - * Call %%calback%% for each value in %%value%%, passing the type and - * component within %%value%%. - * - * This is useful for replacing addresses or other transformation that - * may be desired on each component, based on its type. - */ - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - /** - * Create a new **TypedDataEncoder** for %%types%%. - */ - static from(types2) { - return new _l(types2); - } - /** - * Return the primary type for %%types%%. - */ - static getPrimaryType(types2) { - return _l.from(types2).primaryType; - } - /** - * Return the hashed struct for %%value%% using %%types%% and %%name%%. - */ - static hashStruct(name2, types2, value) { - return _l.from(types2).hashStruct(name2, value); - } - /** - * Return the domain hash for %%domain%%. - */ - static hashDomain(domain) { - const domainFields = []; - for (const name2 in domain) { - if (domain[name2] == null) { - continue; - } - const type2 = domainFieldTypes$1[name2]; - assertArgument(type2, `invalid typed-data domain key: ${JSON.stringify(name2)}`, "domain", domain); - domainFields.push({ name: name2, type: type2 }); - } - domainFields.sort((a3, b2) => { - return domainFieldNames$1.indexOf(a3.name) - domainFieldNames$1.indexOf(b2.name); - }); - return _l.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - /** - * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static encode(domain, types2, value) { - return concat$1([ - "0x1901", - _l.hashDomain(domain), - _l.from(types2).hash(value) - ]); - } - /** - * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static hash(domain, types2, value) { - return keccak256(_l.encode(domain, types2, value)); - } - // Replaces all address types with ENS names with their looked up address - /** - * Resolves to the value from resolving all addresses in %%value%% for - * %%types%% and the %%domain%%. - */ - static async resolveNames(domain, types2, value, resolveName) { - domain = Object.assign({}, domain); - for (const key2 in domain) { - if (domain[key2] == null) { - delete domain[key2]; - } - } - const ensCache = {}; - if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - const encoder2 = _l.from(types2); - encoder2.visit(value, (type2, value2) => { - if (type2 === "address" && !isHexString(value2, 20)) { - ensCache[value2] = "0x"; - } - return value2; - }); - for (const name2 in ensCache) { - ensCache[name2] = await resolveName(name2); - } - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - value = encoder2.visit(value, (type2, value2) => { - if (type2 === "address" && ensCache[value2]) { - return ensCache[value2]; - } - return value2; - }); - return { domain, value }; - } - /** - * Returns the JSON-encoded payload expected by nodes which implement - * the JSON-RPC [[link-eip-712]] method. - */ - static getPayload(domain, types2, value) { - _l.hashDomain(domain); - const domainValues = {}; - const domainTypes = []; - domainFieldNames$1.forEach((name2) => { - const value2 = domain[name2]; - if (value2 == null) { - return; - } - domainValues[name2] = domainChecks$1[name2](value2); - domainTypes.push({ name: name2, type: domainFieldTypes$1[name2] }); - }); - const encoder2 = _l.from(types2); - types2 = encoder2.types; - const typesWithDomain = Object.assign({}, types2); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types2); - typesWithDomain.EIP712Domain = domainTypes; - encoder2.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder2.primaryType, - message: encoder2.visit(value, (type2, value2) => { - if (type2.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value2)); - } - if (type2.match(/^u?int/)) { - return getBigInt(value2).toString(); - } - switch (type2) { - case "address": - return value2.toLowerCase(); - case "bool": - return !!value2; - case "string": - assertArgument(typeof value2 === "string", "invalid string", "value", value2); - return value2; - } - assertArgument(false, "unsupported type", "type", type2); - }) - }; - } -}, _types = new WeakMap(), _fullTypes = new WeakMap(), _encoderCache = new WeakMap(), _getEncoder = new WeakSet(), getEncoder_fn = function(type2) { - { - const encoder2 = getBaseEncoder$1(type2); - if (encoder2) { - return encoder2; - } - } - const array2 = splitArray(type2).array; - if (array2) { - const subtype = array2.prefix; - const subEncoder = this.getEncoder(subtype); - return (value) => { - assertArgument(array2.count === -1 || array2.count === value.length, `array length mismatch; expected length ${array2.count}`, "value", value); - let result = value.map(subEncoder); - if (__privateGet(this, _fullTypes).has(subtype)) { - result = result.map(keccak256); - } - return keccak256(concat$1(result)); - }; - } - const fields = this.types[type2]; - if (fields) { - const encodedType = id(__privateGet(this, _fullTypes).get(type2)); - return (value) => { - const values = fields.map(({ name: name2, type: type3 }) => { - const result = this.getEncoder(type3)(value[name2]); - if (__privateGet(this, _fullTypes).has(type3)) { - return keccak256(result); - } - return result; - }); - values.unshift(encodedType); - return concat$1(values); - }; - } - assertArgument(false, `unknown type: ${type2}`, "type", type2); -}, _l); -function setify$1(items) { - const result = /* @__PURE__ */ new Set(); - items.forEach((k2) => result.add(k2)); - return Object.freeze(result); -} -const _kwVisibDeploy = "external public payable override"; -setify$1(_kwVisibDeploy.split(" ")); -const _kwVisib$1 = "constant external internal payable private public pure view override"; -setify$1(_kwVisib$1.split(" ")); -const _kwTypes$1 = "constructor error event fallback function receive struct"; -setify$1(_kwTypes$1.split(" ")); -const _kwModifiers$1 = "calldata memory storage payable indexed"; -const KwModifiers$1 = setify$1(_kwModifiers$1.split(" ")); -const _kwOther$1 = "tuple returns"; -const _keywords$1 = [_kwTypes$1, _kwModifiers$1, _kwOther$1, _kwVisib$1].join(" "); -const Keywords$1 = setify$1(_keywords$1.split(" ")); -const SimpleTokens$1 = { - "(": "OPEN_PAREN", - ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", - "]": "CLOSE_BRACKET", - ",": "COMMA", - "@": "AT" -}; -const regexWhitespacePrefix$1 = new RegExp("^(\\s*)"); -const regexNumberPrefix$1 = new RegExp("^([0-9]+)"); -const regexIdPrefix$1 = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); -const regexId$1 = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); -const regexType$1 = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); -let TokenString$1 = (_m = class { - constructor(tokens) { - __privateAdd(this, _subTokenString); - __privateAdd(this, _offset2, void 0); - __privateAdd(this, _tokens, void 0); - __privateSet(this, _offset2, 0); - __privateSet(this, _tokens, tokens.slice()); - } - get offset() { - return __privateGet(this, _offset2); - } - get length() { - return __privateGet(this, _tokens).length - __privateGet(this, _offset2); - } - clone() { - return new _m(__privateGet(this, _tokens)); - } - reset() { - __privateSet(this, _offset2, 0); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type2) { - if (this.peek().type !== type2) { - const top = this.peek(); - throw new Error(`expected ${type2}; got ${top.type} ${JSON.stringify(top.text)}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = __privateMethod(this, _subTokenString, subTokenString_fn).call(this, __privateGet(this, _offset2) + 1, top.match + 1); - __privateSet(this, _offset2, top.match + 1); - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (__privateGet(this, _offset2) < top.match - 1) { - const link = this.peek().linkNext; - result.push(__privateMethod(this, _subTokenString, subTokenString_fn).call(this, __privateGet(this, _offset2) + 1, link)); - __privateSet(this, _offset2, link); - } - __privateSet(this, _offset2, top.match + 1); - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (__privateGet(this, _offset2) >= __privateGet(this, _tokens).length) { - throw new Error("out-of-bounds"); - } - return __privateGet(this, _tokens)[__privateGet(this, _offset2)]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return top != null && allowed.has(top) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type2) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return top.type === type2 ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - __privateWrapper(this, _offset2)._++; - return result; - } - toString() { - const tokens = []; - for (let i3 = __privateGet(this, _offset2); i3 < __privateGet(this, _tokens).length; i3++) { - const token2 = __privateGet(this, _tokens)[i3]; - tokens.push(`${token2.type}:${token2.text}`); - } - return ``; - } -}, _offset2 = new WeakMap(), _tokens = new WeakMap(), _subTokenString = new WeakSet(), subTokenString_fn = function(from2 = 0, to2 = 0) { - return new _m(__privateGet(this, _tokens).slice(from2, to2).map((t2) => { - return Object.freeze(Object.assign({}, t2, { - match: t2.match - from2, - linkBack: t2.linkBack - from2, - linkNext: t2.linkNext - from2 - })); - })); -}, _m); -function lex$1(text) { - const tokens = []; - const throwError2 = (message2) => { - const token2 = offset2 < text.length ? JSON.stringify(text[offset2]) : "$EOI"; - throw new Error(`invalid token ${token2} at ${offset2}: ${message2}`); - }; - let brackets = []; - let commas = []; - let offset2 = 0; - while (offset2 < text.length) { - let cur = text.substring(offset2); - let match = cur.match(regexWhitespacePrefix$1); - if (match) { - offset2 += match[1].length; - cur = text.substring(offset2); - } - const token2 = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset: offset2, value: -1 }; - tokens.push(token2); - let type2 = SimpleTokens$1[cur[0]] || ""; - if (type2) { - token2.type = type2; - token2.text = cur[0]; - offset2++; - if (type2 === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } else if (type2 == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError2("no matching open bracket"); - } - token2.match = brackets.pop(); - tokens[token2.match].match = tokens.length - 1; - token2.depth--; - token2.linkBack = commas.pop(); - tokens[token2.linkBack].linkNext = tokens.length - 1; - } else if (type2 === "COMMA") { - token2.linkBack = commas.pop(); - tokens[token2.linkBack].linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } else if (type2 === "OPEN_BRACKET") { - token2.type = "BRACKET"; - } else if (type2 === "CLOSE_BRACKET") { - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - tokens[tokens.length - 1].value = getNumber(value); - } - if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - tokens[tokens.length - 1].text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix$1); - if (match) { - token2.text = match[1]; - offset2 += token2.text.length; - if (Keywords$1.has(token2.text)) { - token2.type = "KEYWORD"; - continue; - } - if (token2.text.match(regexType$1)) { - token2.type = "TYPE"; - continue; - } - token2.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix$1); - if (match) { - token2.text = match[1]; - token2.type = "NUMBER"; - offset2 += token2.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset2}`); - } - return new TokenString$1(tokens.map((t2) => Object.freeze(t2))); -} -function consumeKeywords$1(tokens, allowed) { - const keywords2 = /* @__PURE__ */ new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || allowed && !allowed.has(keyword)) { - break; - } - tokens.pop(); - if (keywords2.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords2.add(keyword); - } - return Object.freeze(keywords2); -} -const regexArrayType$1 = new RegExp(/^(.*)\[([0-9]*)\]$/); -function verifyBasicType$1(type2) { - const match = type2.match(regexType$1); - assertArgument(match, "invalid type", "type", type2); - if (type2 === "uint") { - return "uint256"; - } - if (type2 === "int") { - return "int256"; - } - if (match[2]) { - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type2); - } else if (match[3]) { - const size2 = parseInt(match[3]); - assertArgument(size2 !== 0 && size2 <= 256 && size2 % 8 === 0, "invalid numeric width", "type", type2); - } - return type2; -} -const _guard$3 = {}; -const internal$1 = Symbol.for("_ethers_internal"); -const ParamTypeInternal$1 = "_ParamTypeInternal"; -let ParamType$1 = (_n = class { - /** - * @private - */ - constructor(guard2, name2, type2, baseType, indexed, components, arrayLength, arrayChildren) { - __privateAdd(this, _walkAsync); - /** - * The local name of the parameter (or ``""`` if unbound) - */ - __publicField(this, "name"); - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - __publicField(this, "type"); - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - __publicField(this, "baseType"); - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - __publicField(this, "indexed"); - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - __publicField(this, "components"); - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - __publicField(this, "arrayLength"); - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - __publicField(this, "arrayChildren"); - assertPrivate(guard2, _guard$3, "ParamType"); - Object.defineProperty(this, internal$1, { value: ParamTypeInternal$1 }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } else if (components != null) { - throw new Error(""); - } - defineProperties(this, { - name: name2, - type: type2, - baseType, - indexed, - components, - arrayLength, - arrayChildren - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format2) { - if (format2 == null) { - format2 = "sighash"; - } - if (format2 === "json") { - const name2 = this.name || ""; - if (this.isArray()) { - const result3 = JSON.parse(this.arrayChildren.format("json")); - result3.name = name2; - result3.type += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; - return JSON.stringify(result3); - } - const result2 = { - type: this.baseType === "tuple" ? "tuple" : this.type, - name: name2 - }; - if (typeof this.indexed === "boolean") { - result2.indexed = this.indexed; - } - if (this.isTuple()) { - result2.components = this.components.map((c2) => JSON.parse(c2.format(format2))); - } - return JSON.stringify(result2); - } - let result = ""; - if (this.isArray()) { - result += this.arrayChildren.format(format2); - result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; - } else { - if (this.isTuple()) { - result += "(" + this.components.map((comp) => comp.format(format2)).join(format2 === "full" ? ", " : ",") + ")"; - } else { - result += this.type; - } - } - if (format2 !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format2 === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return this.baseType === "array"; - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return this.baseType === "tuple"; - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return this.indexed != null; - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process2) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v6) => _this.arrayChildren.walk(v6, process2)); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v6, i3) => _this.components[i3].walk(v6, process2)); - } - return process2(this.type, value); - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS names by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process2) { - const promises = []; - const result = [value]; - __privateMethod(this, _walkAsync, walkAsync_fn).call(this, promises, value, process2, (value2) => { - result[0] = value2; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (_n.isParamType(obj)) { - return obj; - } - if (typeof obj === "string") { - try { - return _n.from(lex$1(obj), allowIndexed); - } catch (error) { - assertArgument(false, "invalid param type", "obj", obj); - } - } else if (obj instanceof TokenString$1) { - let type3 = "", baseType = ""; - let comps = null; - if (consumeKeywords$1(obj, setify$1(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) { - baseType = "tuple"; - comps = obj.popParams().map((t2) => _n.from(t2)); - type3 = `tuple(${comps.map((c2) => c2.format()).join(",")})`; - } else { - type3 = verifyBasicType$1(obj.popType("TYPE")); - baseType = type3; - } - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); - arrayChildren = new _n(_guard$3, "", type3, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type3 += bracket.text; - baseType = "array"; - comps = null; - } - let indexed2 = null; - const keywords2 = consumeKeywords$1(obj, KwModifiers$1); - if (keywords2.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed2 = true; - } - const name3 = obj.peekType("ID") ? obj.pop().text : ""; - if (obj.length) { - throw new Error("leftover tokens"); - } - return new _n(_guard$3, name3, type3, baseType, indexed2, comps, arrayLength, arrayChildren); - } - const name2 = obj.name; - assertArgument(!name2 || typeof name2 === "string" && name2.match(regexId$1), "invalid name", "obj.name", name2); - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type2 = obj.type; - let arrayMatch = type2.match(regexArrayType$1); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = _n.from({ - type: arrayMatch[1], - components: obj.components - }); - return new _n(_guard$3, name2 || "", type2, "array", indexed, null, arrayLength, arrayChildren); - } - if (type2 === "tuple" || type2.startsWith( - "tuple(" - /* fix: ) */ - ) || type2.startsWith( - "(" - /* fix: ) */ - )) { - const comps = obj.components != null ? obj.components.map((c2) => _n.from(c2)) : null; - const tuple2 = new _n(_guard$3, name2 || "", type2, "tuple", indexed, comps, null, null); - return tuple2; - } - type2 = verifyBasicType$1(obj.type); - return new _n(_guard$3, name2 || "", type2, type2, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return value && value[internal$1] === ParamTypeInternal$1; - } -}, _walkAsync = new WeakSet(), walkAsync_fn = function(promises, value, process2, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result2 = value.slice(); - result2.forEach((value2, index2) => { - var _a3; - __privateMethod(_a3 = childType, _walkAsync, walkAsync_fn).call(_a3, promises, value2, process2, (value3) => { - result2[index2] = value3; - }); - }); - setValue(result2); - return; - } - if (this.isTuple()) { - const components = this.components; - let result2; - if (Array.isArray(value)) { - result2 = value.slice(); - } else { - if (value == null || typeof value !== "object") { - throw new Error("invalid tuple value"); - } - result2 = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result2.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result2.forEach((value2, index2) => { - var _a3; - __privateMethod(_a3 = components[index2], _walkAsync, walkAsync_fn).call(_a3, promises, value2, process2, (value3) => { - result2[index2] = value3; - }); - }); - setValue(result2); - return; - } - const result = process2(this.type, value); - if (result.then) { - promises.push(async function() { - setValue(await result); - }()); - } else { - setValue(result); - } -}, _n); -const PanicReasons$1 = /* @__PURE__ */ new Map(); -PanicReasons$1.set(0, "GENERIC_PANIC"); -PanicReasons$1.set(1, "ASSERT_FALSE"); -PanicReasons$1.set(17, "OVERFLOW"); -PanicReasons$1.set(18, "DIVIDE_BY_ZERO"); -PanicReasons$1.set(33, "ENUM_RANGE_ERROR"); -PanicReasons$1.set(34, "BAD_STORAGE_DATA"); -PanicReasons$1.set(49, "STACK_UNDERFLOW"); -PanicReasons$1.set(50, "ARRAY_RANGE_ERROR"); -PanicReasons$1.set(65, "OUT_OF_MEMORY"); -PanicReasons$1.set(81, "UNINITIALIZED_FUNCTION_CALL"); -const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); -const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); -let defaultCoder = null; -let defaultMaxInflation = 1024; -function getBuiltinCallException(action, tx, data, abiCoder2) { - let message2 = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data) { - message2 = "execution reverted"; - const bytes2 = getBytes(data); - data = hexlify(data); - if (bytes2.length === 0) { - message2 += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } else if (bytes2.length % 32 !== 4) { - message2 += " (could not decode reason; invalid data length)"; - } else if (hexlify(bytes2.slice(0, 4)) === "0x08c379a0") { - try { - reason = abiCoder2.decode(["string"], bytes2.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason] - }; - message2 += `: ${JSON.stringify(reason)}`; - } catch (error) { - message2 += " (could not decode reason; invalid string data)"; - } - } else if (hexlify(bytes2.slice(0, 4)) === "0x4e487b71") { - try { - const code2 = Number(abiCoder2.decode(["uint256"], bytes2.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code2] - }; - reason = `Panic due to ${PanicReasons$1.get(code2) || "UNKNOWN"}(${code2})`; - message2 += `: ${reason}`; - } catch (error) { - message2 += " (could not decode panic code)"; - } - } else { - message2 += " (unknown custom error)"; - } - } - const transaction2 = { - to: tx.to ? getAddress$1(tx.to) : null, - data: tx.data || "0x" - }; - if (tx.from) { - transaction2.from = getAddress$1(tx.from); - } - return makeError(message2, "CALL_EXCEPTION", { - action, - data, - reason, - transaction: transaction2, - invocation, - revert - }); -} -const _AbiCoder = class _AbiCoder { - constructor() { - __privateAdd(this, _getCoder); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types2) { - const coders = types2.map((type2) => __privateMethod(this, _getCoder, getCoder_fn).call(this, ParamType$1.from(type2))); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types2, values) { - assertArgumentCount(values.length, types2.length, "types/values length mismatch"); - const coders = types2.map((type2) => __privateMethod(this, _getCoder, getCoder_fn).call(this, ParamType$1.from(type2))); - const coder = new TupleCoder(coders, "_"); - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types2, data, loose) { - const coders = types2.map((type2) => __privateMethod(this, _getCoder, getCoder_fn).call(this, ParamType$1.from(type2))); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose, defaultMaxInflation)); - } - static _setDefaultMaxInflation(value) { - assertArgument(typeof value === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); - defaultMaxInflation = value; - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new _AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an ethers-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, _AbiCoder.defaultAbiCoder()); - } -}; -_getCoder = new WeakSet(); -getCoder_fn = function(param) { - if (param.isArray()) { - return new ArrayCoder(__privateMethod(this, _getCoder, getCoder_fn).call(this, param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new TupleCoder(param.components.map((c2) => __privateMethod(this, _getCoder, getCoder_fn).call(this, c2)), param.name); - } - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } - let match = param.type.match(paramTypeNumber); - if (match) { - let size2 = parseInt(match[2] || "256"); - assertArgument(size2 !== 0 && size2 <= 256 && size2 % 8 === 0, "invalid " + match[1] + " bit length", "param", param); - return new NumberCoder(size2 / 8, match[1] === "int", param.name); - } - match = param.type.match(paramTypeBytes); - if (match) { - let size2 = parseInt(match[1]); - assertArgument(size2 !== 0 && size2 <= 32, "invalid bytes length", "param", param); - return new FixedBytesCoder(size2, param.name); - } - assertArgument(false, "invalid type", "type", param.type); -}; -let AbiCoder = _AbiCoder; -BigInt(0); -function copyRequest(req) { - const result = {}; - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = hexlify(req.data); - } - const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); - for (const key2 of bigIntKeys) { - if (!(key2 in req) || req[key2] == null) { - continue; - } - result[key2] = getBigInt(req[key2], `request.${key2}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key2 of numberKeys) { - if (!(key2 in req) || req[key2] == null) { - continue; - } - result[key2] = getNumber(req[key2], `request.${key2}`); - } - if (req.accessList) { - result.accessList = accessListify(req.accessList); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipRead = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - if ("blobVersionedHashes" in req && req.blobVersionedHashes) { - result.blobVersionedHashes = req.blobVersionedHashes.slice(); - } - if ("kzg" in req) { - result.kzg = req.kzg; - } - if ("blobs" in req && req.blobs) { - result.blobs = req.blobs.map((b2) => { - if (isBytesLike(b2)) { - return hexlify(b2); - } - return Object.assign({}, b2); - }); - } - return result; -} -function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - assert$a(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); -} -async function populate(signer, tx) { - let pop = copyRequest(tx); - if (pop.to != null) { - pop.to = resolveAddress(pop.to, signer); - } - if (pop.from != null) { - const from2 = pop.from; - pop.from = Promise.all([ - signer.getAddress(), - resolveAddress(from2, signer) - ]).then(([address2, from3]) => { - assertArgument(address2.toLowerCase() === from3.toLowerCase(), "transaction from mismatch", "tx.from", from3); - return address2; - }); - } else { - pop.from = signer.getAddress(); - } - return await resolveProperties(pop); -} -class AbstractSigner { - /** - * Creates a new Signer connected to %%provider%%. - */ - constructor(provider) { - /** - * The provider this signer is connected to. - */ - __publicField(this, "provider"); - defineProperties(this, { provider: provider || null }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.gasLimit == null) { - pop.gasLimit = await this.estimateGas(pop); - } - const network = await this.provider.getNetwork(); - if (pop.chainId != null) { - const chainId = getBigInt(pop.chainId); - assertArgument(chainId === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId); - } else { - pop.chainId = network.chainId; - } - const hasEip1559 = pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null; - if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) { - assertArgument(false, "eip-1559 transaction do not support gasPrice", "tx", tx); - } else if ((pop.type === 0 || pop.type === 1) && hasEip1559) { - assertArgument(false, "pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "tx", tx); - } - if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) { - pop.type = 2; - } else if (pop.type === 0 || pop.type === 1) { - const feeData = await provider.getFeeData(); - assert$a(feeData.gasPrice != null, "network does not support gasPrice", "UNSUPPORTED_OPERATION", { - operation: "getGasPrice" - }); - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - } else { - const feeData = await provider.getFeeData(); - if (pop.type == null) { - if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) { - pop.type = 2; - if (pop.gasPrice != null) { - const gasPrice = pop.gasPrice; - delete pop.gasPrice; - pop.maxFeePerGas = gasPrice; - pop.maxPriorityFeePerGas = gasPrice; - } else { - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } else if (feeData.gasPrice != null) { - assert$a(!hasEip1559, "network does not support EIP-1559", "UNSUPPORTED_OPERATION", { - operation: "populateTransaction" - }); - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - pop.type = 0; - } else { - assert$a(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData" - }); - } - } else if (pop.type === 2 || pop.type === 3) { - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - return await resolveProperties(pop); - } - async estimateGas(tx) { - return checkProvider(this, "estimateGas").estimateGas(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name2) { - const provider = checkProvider(this, "resolveName"); - return await provider.resolveName(name2); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction$1.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } -} -const _VoidSigner = class _VoidSigner extends AbstractSigner { - /** - * Creates a new **VoidSigner** with %%address%% attached to - * %%provider%%. - */ - constructor(address2, provider) { - super(provider); - __privateAdd(this, _throwUnsupported); - /** - * The signer address. - */ - __publicField(this, "address"); - defineProperties(this, { address: address2 }); - } - async getAddress() { - return this.address; - } - connect(provider) { - return new _VoidSigner(this.address, provider); - } - async signTransaction(tx) { - __privateMethod(this, _throwUnsupported, throwUnsupported_fn).call(this, "transactions", "signTransaction"); - } - async signMessage(message2) { - __privateMethod(this, _throwUnsupported, throwUnsupported_fn).call(this, "messages", "signMessage"); - } - async signTypedData(domain, types2, value) { - __privateMethod(this, _throwUnsupported, throwUnsupported_fn).call(this, "typed-data", "signTypedData"); - } -}; -_throwUnsupported = new WeakSet(); -throwUnsupported_fn = function(suffix, operation) { - assert$a(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { operation }); -}; -let VoidSigner = _VoidSigner; -const _BaseWallet = class _BaseWallet extends AbstractSigner { - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor(privateKey, provider) { - super(provider); - /** - * The wallet address. - */ - __publicField(this, "address"); - __privateAdd(this, _signingKey, void 0); - assertArgument(privateKey && typeof privateKey.sign === "function", "invalid private key", "privateKey", "[ REDACTED ]"); - __privateSet(this, _signingKey, privateKey); - const address2 = computeAddress$1(this.signingKey.publicKey); - defineProperties(this, { address: address2 }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { - return __privateGet(this, _signingKey); - } - /** - * The private key for this wallet. - */ - get privateKey() { - return this.signingKey.privateKey; - } - async getAddress() { - return this.address; - } - connect(provider) { - return new _BaseWallet(__privateGet(this, _signingKey), provider); - } - async signTransaction(tx) { - tx = copyRequest(tx); - const { to: to2, from: from2 } = await resolveProperties({ - to: tx.to ? resolveAddress(tx.to, this.provider) : void 0, - from: tx.from ? resolveAddress(tx.from, this.provider) : void 0 - }); - if (to2 != null) { - tx.to = to2; - } - if (from2 != null) { - tx.from = from2; - } - if (tx.from != null) { - assertArgument(getAddress$1(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - const btx = Transaction$1.from(tx); - btx.signature = this.signingKey.sign(btx.unsignedHash); - return btx.serialized; - } - async signMessage(message2) { - return this.signMessageSync(message2); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message2) { - return this.signingKey.sign(hashMessage$1(message2)).serialized; - } - async signTypedData(domain, types2, value) { - const populated = await TypedDataEncoder$1.resolveNames(domain, types2, value, async (name2) => { - assert$a(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name: name2 } - }); - const address2 = await this.provider.resolveName(name2); - assert$a(address2 != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name2 - }); - return address2; - }); - return this.signingKey.sign(TypedDataEncoder$1.hash(populated.domain, types2, populated.value)).serialized; - } -}; -_signingKey = new WeakMap(); -let BaseWallet = _BaseWallet; -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; -function unfold(words2, sep) { - let initial = 97; - return words2.reduce((accum, word) => { - if (word === sep) { - initial++; - } else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } else { - initial = 97; - accum.push(word); - } - return accum; - }, []); -} -function decode$3(data, subs) { - for (let i3 = subsChrs.length - 1; i3 >= 0; i3--) { - data = data.split(subsChrs[i3]).join(subs.substring(2 * i3, 2 * i3 + 2)); - } - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all2, item, semi, word) => { - if (semi) { - for (let i3 = parseInt(semi); i3 >= 0; i3--) { - clumps.push(";"); - } - } else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - return unfold(unfold(clumps, ";"), ":"); -} -function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode$3(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); -} -class Wordlist { - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - __publicField(this, "locale"); - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words2) { - return words2.join(" "); - } -} -class WordlistOwl extends Wordlist { - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum2) { - super(locale); - __privateAdd(this, _loadWords); - __privateAdd(this, _data4, void 0); - __privateAdd(this, _checksum, void 0); - __privateAdd(this, _words, void 0); - __privateSet(this, _data4, data); - __privateSet(this, _checksum, checksum2); - __privateSet(this, _words, null); - } - /** - * The OWL-encoded data. - */ - get _data() { - return __privateGet(this, _data4); - } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return decodeOwl(__privateGet(this, _data4)); - } - getWord(index2) { - const words2 = __privateMethod(this, _loadWords, loadWords_fn).call(this); - assertArgument(index2 >= 0 && index2 < words2.length, `invalid word index: ${index2}`, "index", index2); - return words2[index2]; - } - getWordIndex(word) { - return __privateMethod(this, _loadWords, loadWords_fn).call(this).indexOf(word); - } -} -_data4 = new WeakMap(); -_checksum = new WeakMap(); -_words = new WeakMap(); -_loadWords = new WeakSet(); -loadWords_fn = function() { - if (__privateGet(this, _words) == null) { - const words2 = this._decodeWords(); - const checksum2 = id(words2.join("\n") + "\n"); - if (checksum2 !== __privateGet(this, _checksum)) { - throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`); - } - __privateSet(this, _words, words2); - } - return __privateGet(this, _words); -}; -const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d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P PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; -const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; -let wordlist = null; -class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { - super("en", words, checksum); - } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } -} -function getUpperMask(bits) { - return (1 << bits) - 1 << 8 - bits & 255; -} -function getLowerMask(bits) { - return (1 << bits) - 1 & 255; -} -function mnemonicToEntropy(mnemonic, wordlist2) { - assertNormalize("NFKD"); - if (wordlist2 == null) { - wordlist2 = LangEn.wordlist(); - } - const words2 = wordlist2.split(mnemonic); - assertArgument(words2.length % 3 === 0 && words2.length >= 12 && words2.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil(11 * words2.length / 8)); - let offset2 = 0; - for (let i3 = 0; i3 < words2.length; i3++) { - let index2 = wordlist2.getWordIndex(words2[i3].normalize("NFKD")); - assertArgument(index2 >= 0, `invalid mnemonic word at index ${i3}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index2 & 1 << 10 - bit) { - entropy[offset2 >> 3] |= 1 << 7 - offset2 % 8; - } - offset2++; - } - } - const entropyBits = 32 * words2.length / 3; - const checksumBits = words2.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum2 = getBytes(sha256$1(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - assertArgument(checksum2 === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return hexlify(entropy.slice(0, entropyBits / 8)); -} -function entropyToMnemonic(entropy, wordlist2) { - assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist2 == null) { - wordlist2 = LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i3 = 0; i3 < entropy.length; i3++) { - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i3]; - remainingBits -= 8; - } else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i3] >> 8 - remainingBits; - indices.push(entropy[i3] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - const checksumBits = entropy.length / 4; - const checksum2 = parseInt(sha256$1(entropy).substring(2, 4), 16) & getUpperMask(checksumBits); - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= checksum2 >> 8 - checksumBits; - return wordlist2.join(indices.map((index2) => wordlist2.getWord(index2))); -} -const _guard$2 = {}; -class Mnemonic { - /** - * @private - */ - constructor(guard2, entropy, phrase, password, wordlist2) { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - __publicField(this, "phrase"); - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - __publicField(this, "password"); - /** - * The wordlist for this mnemonic. - */ - __publicField(this, "wordlist"); - /** - * The underlying entropy which the mnemonic encodes. - */ - __publicField(this, "entropy"); - if (password == null) { - password = ""; - } - if (wordlist2 == null) { - wordlist2 = LangEn.wordlist(); - } - assertPrivate(guard2, _guard$2, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist: wordlist2, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - const salt = toUtf8Bytes("mnemonic" + this.password, "NFKD"); - return pbkdf2(toUtf8Bytes(this.phrase, "NFKD"), salt, 2048, 64, "sha512"); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase(phrase, password, wordlist2) { - const entropy = mnemonicToEntropy(phrase, wordlist2); - phrase = entropyToMnemonic(getBytes(entropy), wordlist2); - return new Mnemonic(_guard$2, entropy, phrase, password, wordlist2); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist2) { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist2); - return new Mnemonic(_guard$2, hexlify(entropy), phrase, password, wordlist2); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist2) { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist2); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist2) { - return mnemonicToEntropy(phrase, wordlist2); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist2) { - try { - mnemonicToEntropy(phrase, wordlist2); - return true; - } catch (error) { - } - return false; - } -} -/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ -var __classPrivateFieldGet$2 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f3) { - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f3 : kind === "a" ? f3.call(receiver) : f3 ? f3.value : state.get(receiver); -}; -var __classPrivateFieldSet$2 = globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f3) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f3.call(receiver, value) : f3 ? f3.value = value : state.set(receiver, value), value; -}; -var _AES_key, _AES_Kd, _AES_Ke; -const numberOfRounds = { 16: 10, 24: 12, 32: 14 }; -const rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145]; -const S$3 = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22]; -const Si$2 = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125]; -const T1 = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986]; -const T2 = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766]; -const T3 = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126]; -const T4 = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436]; -const T5 = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890]; -const T6 = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935]; -const T7 = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600]; -const T8 = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480]; -const U1 = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795]; -const U2 = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855]; -const U3 = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150]; -const U4 = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925]; -function convertToInt32(bytes2) { - const result = []; - for (let i3 = 0; i3 < bytes2.length; i3 += 4) { - result.push(bytes2[i3] << 24 | bytes2[i3 + 1] << 16 | bytes2[i3 + 2] << 8 | bytes2[i3 + 3]); - } - return result; -} -class AES { - get key() { - return __classPrivateFieldGet$2(this, _AES_key, "f").slice(); - } - constructor(key2) { - _AES_key.set(this, void 0); - _AES_Kd.set(this, void 0); - _AES_Ke.set(this, void 0); - if (!(this instanceof AES)) { - throw Error("AES must be instanitated with `new`"); - } - __classPrivateFieldSet$2(this, _AES_key, new Uint8Array(key2), "f"); - const rounds = numberOfRounds[this.key.length]; - if (rounds == null) { - throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)"); - } - __classPrivateFieldSet$2(this, _AES_Ke, [], "f"); - __classPrivateFieldSet$2(this, _AES_Kd, [], "f"); - for (let i3 = 0; i3 <= rounds; i3++) { - __classPrivateFieldGet$2(this, _AES_Ke, "f").push([0, 0, 0, 0]); - __classPrivateFieldGet$2(this, _AES_Kd, "f").push([0, 0, 0, 0]); - } - const roundKeyCount = (rounds + 1) * 4; - const KC = this.key.length / 4; - const tk2 = convertToInt32(this.key); - let index2; - for (let i3 = 0; i3 < KC; i3++) { - index2 = i3 >> 2; - __classPrivateFieldGet$2(this, _AES_Ke, "f")[index2][i3 % 4] = tk2[i3]; - __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds - index2][i3 % 4] = tk2[i3]; - } - let rconpointer = 0; - let t2 = KC, tt2; - while (t2 < roundKeyCount) { - tt2 = tk2[KC - 1]; - tk2[0] ^= S$3[tt2 >> 16 & 255] << 24 ^ S$3[tt2 >> 8 & 255] << 16 ^ S$3[tt2 & 255] << 8 ^ S$3[tt2 >> 24 & 255] ^ rcon[rconpointer] << 24; - rconpointer += 1; - if (KC != 8) { - for (let i4 = 1; i4 < KC; i4++) { - tk2[i4] ^= tk2[i4 - 1]; - } - } else { - for (let i4 = 1; i4 < KC / 2; i4++) { - tk2[i4] ^= tk2[i4 - 1]; - } - tt2 = tk2[KC / 2 - 1]; - tk2[KC / 2] ^= S$3[tt2 & 255] ^ S$3[tt2 >> 8 & 255] << 8 ^ S$3[tt2 >> 16 & 255] << 16 ^ S$3[tt2 >> 24 & 255] << 24; - for (let i4 = KC / 2 + 1; i4 < KC; i4++) { - tk2[i4] ^= tk2[i4 - 1]; - } - } - let i3 = 0, r2, c2; - while (i3 < KC && t2 < roundKeyCount) { - r2 = t2 >> 2; - c2 = t2 % 4; - __classPrivateFieldGet$2(this, _AES_Ke, "f")[r2][c2] = tk2[i3]; - __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds - r2][c2] = tk2[i3++]; - t2++; - } - } - for (let r2 = 1; r2 < rounds; r2++) { - for (let c2 = 0; c2 < 4; c2++) { - tt2 = __classPrivateFieldGet$2(this, _AES_Kd, "f")[r2][c2]; - __classPrivateFieldGet$2(this, _AES_Kd, "f")[r2][c2] = U1[tt2 >> 24 & 255] ^ U2[tt2 >> 16 & 255] ^ U3[tt2 >> 8 & 255] ^ U4[tt2 & 255]; - } - } - } - encrypt(plaintext) { - if (plaintext.length != 16) { - throw new TypeError("invalid plaintext size (must be 16 bytes)"); - } - const rounds = __classPrivateFieldGet$2(this, _AES_Ke, "f").length - 1; - const a3 = [0, 0, 0, 0]; - let t2 = convertToInt32(plaintext); - for (let i3 = 0; i3 < 4; i3++) { - t2[i3] ^= __classPrivateFieldGet$2(this, _AES_Ke, "f")[0][i3]; - } - for (let r2 = 1; r2 < rounds; r2++) { - for (let i3 = 0; i3 < 4; i3++) { - a3[i3] = T1[t2[i3] >> 24 & 255] ^ T2[t2[(i3 + 1) % 4] >> 16 & 255] ^ T3[t2[(i3 + 2) % 4] >> 8 & 255] ^ T4[t2[(i3 + 3) % 4] & 255] ^ __classPrivateFieldGet$2(this, _AES_Ke, "f")[r2][i3]; - } - t2 = a3.slice(); - } - const result = new Uint8Array(16); - let tt2 = 0; - for (let i3 = 0; i3 < 4; i3++) { - tt2 = __classPrivateFieldGet$2(this, _AES_Ke, "f")[rounds][i3]; - result[4 * i3] = (S$3[t2[i3] >> 24 & 255] ^ tt2 >> 24) & 255; - result[4 * i3 + 1] = (S$3[t2[(i3 + 1) % 4] >> 16 & 255] ^ tt2 >> 16) & 255; - result[4 * i3 + 2] = (S$3[t2[(i3 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255; - result[4 * i3 + 3] = (S$3[t2[(i3 + 3) % 4] & 255] ^ tt2) & 255; - } - return result; - } - decrypt(ciphertext) { - if (ciphertext.length != 16) { - throw new TypeError("invalid ciphertext size (must be 16 bytes)"); - } - const rounds = __classPrivateFieldGet$2(this, _AES_Kd, "f").length - 1; - const a3 = [0, 0, 0, 0]; - let t2 = convertToInt32(ciphertext); - for (let i3 = 0; i3 < 4; i3++) { - t2[i3] ^= __classPrivateFieldGet$2(this, _AES_Kd, "f")[0][i3]; - } - for (let r2 = 1; r2 < rounds; r2++) { - for (let i3 = 0; i3 < 4; i3++) { - a3[i3] = T5[t2[i3] >> 24 & 255] ^ T6[t2[(i3 + 3) % 4] >> 16 & 255] ^ T7[t2[(i3 + 2) % 4] >> 8 & 255] ^ T8[t2[(i3 + 1) % 4] & 255] ^ __classPrivateFieldGet$2(this, _AES_Kd, "f")[r2][i3]; - } - t2 = a3.slice(); - } - const result = new Uint8Array(16); - let tt2 = 0; - for (let i3 = 0; i3 < 4; i3++) { - tt2 = __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds][i3]; - result[4 * i3] = (Si$2[t2[i3] >> 24 & 255] ^ tt2 >> 24) & 255; - result[4 * i3 + 1] = (Si$2[t2[(i3 + 3) % 4] >> 16 & 255] ^ tt2 >> 16) & 255; - result[4 * i3 + 2] = (Si$2[t2[(i3 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255; - result[4 * i3 + 3] = (Si$2[t2[(i3 + 1) % 4] & 255] ^ tt2) & 255; - } - return result; - } -} -_AES_key = /* @__PURE__ */ new WeakMap(), _AES_Kd = /* @__PURE__ */ new WeakMap(), _AES_Ke = /* @__PURE__ */ new WeakMap(); -class ModeOfOperation { - constructor(name2, key2, cls) { - if (cls && !(this instanceof cls)) { - throw new Error(`${name2} must be instantiated with "new"`); - } - Object.defineProperties(this, { - aes: { enumerable: true, value: new AES(key2) }, - name: { enumerable: true, value: name2 } - }); - } -} -var __classPrivateFieldSet$1 = globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f3) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f3.call(receiver, value) : f3 ? f3.value = value : state.set(receiver, value), value; -}; -var __classPrivateFieldGet$1 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f3) { - if (kind === "a" && !f3) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f3 : kind === "a" ? f3.call(receiver) : f3 ? f3.value : state.get(receiver); -}; -var _CTR_remaining, _CTR_remainingIndex, _CTR_counter; -class CTR extends ModeOfOperation { - constructor(key2, initialValue) { - super("CTR", key2, CTR); - _CTR_remaining.set(this, void 0); - _CTR_remainingIndex.set(this, void 0); - _CTR_counter.set(this, void 0); - __classPrivateFieldSet$1(this, _CTR_counter, new Uint8Array(16), "f"); - __classPrivateFieldGet$1(this, _CTR_counter, "f").fill(0); - __classPrivateFieldSet$1(this, _CTR_remaining, __classPrivateFieldGet$1(this, _CTR_counter, "f"), "f"); - __classPrivateFieldSet$1(this, _CTR_remainingIndex, 16, "f"); - if (initialValue == null) { - initialValue = 1; - } - if (typeof initialValue === "number") { - this.setCounterValue(initialValue); - } else { - this.setCounterBytes(initialValue); - } - } - get counter() { - return new Uint8Array(__classPrivateFieldGet$1(this, _CTR_counter, "f")); - } - setCounterValue(value) { - if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) { - throw new TypeError("invalid counter initial integer value"); - } - for (let index2 = 15; index2 >= 0; --index2) { - __classPrivateFieldGet$1(this, _CTR_counter, "f")[index2] = value % 256; - value = Math.floor(value / 256); - } - } - setCounterBytes(value) { - if (value.length !== 16) { - throw new TypeError("invalid counter initial Uint8Array value length"); - } - __classPrivateFieldGet$1(this, _CTR_counter, "f").set(value); - } - increment() { - for (let i3 = 15; i3 >= 0; i3--) { - if (__classPrivateFieldGet$1(this, _CTR_counter, "f")[i3] === 255) { - __classPrivateFieldGet$1(this, _CTR_counter, "f")[i3] = 0; - } else { - __classPrivateFieldGet$1(this, _CTR_counter, "f")[i3]++; - break; - } - } - } - encrypt(plaintext) { - var _a3, _b2; - const crypttext = new Uint8Array(plaintext); - for (let i3 = 0; i3 < crypttext.length; i3++) { - if (__classPrivateFieldGet$1(this, _CTR_remainingIndex, "f") === 16) { - __classPrivateFieldSet$1(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet$1(this, _CTR_counter, "f")), "f"); - __classPrivateFieldSet$1(this, _CTR_remainingIndex, 0, "f"); - this.increment(); - } - crypttext[i3] ^= __classPrivateFieldGet$1(this, _CTR_remaining, "f")[__classPrivateFieldSet$1(this, _CTR_remainingIndex, (_b2 = __classPrivateFieldGet$1(this, _CTR_remainingIndex, "f"), _a3 = _b2++, _b2), "f"), _a3]; - } - return crypttext; - } - decrypt(ciphertext) { - return this.encrypt(ciphertext); - } -} -_CTR_remaining = /* @__PURE__ */ new WeakMap(), _CTR_remainingIndex = /* @__PURE__ */ new WeakMap(), _CTR_counter = /* @__PURE__ */ new WeakMap(); -function zpad$1(value, length) { - value = String(value); - while (value.length < length) { - value = "0" + value; - } - return value; -} -function getPassword(password) { - if (typeof password === "string") { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); -} -const defaultPath$1 = "m/44'/60'/0'/0/0"; -function getEncryptKdfParams(options) { - const salt = options.salt != null ? getBytes(options.salt, "options.salt") : randomBytes(32); - let N2 = 1 << 17, r2 = 8, p3 = 1; - if (options.scrypt) { - if (options.scrypt.N) { - N2 = options.scrypt.N; - } - if (options.scrypt.r) { - r2 = options.scrypt.r; - } - if (options.scrypt.p) { - p3 = options.scrypt.p; - } - } - assertArgument(typeof N2 === "number" && N2 > 0 && Number.isSafeInteger(N2) && (BigInt(N2) & BigInt(N2 - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N2); - assertArgument(typeof r2 === "number" && r2 > 0 && Number.isSafeInteger(r2), "invalid scrypt r parameter", "options.r", r2); - assertArgument(typeof p3 === "number" && p3 > 0 && Number.isSafeInteger(p3), "invalid scrypt p parameter", "options.p", p3); - return { name: "scrypt", dkLen: 32, salt, N: N2, r: r2, p: p3 }; -} -function _encryptKeystore(key2, kdf, account, options) { - const privateKey = getBytes(account.privateKey, "privateKey"); - const iv2 = options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); - assertArgument(iv2.length === 16, "invalid options.iv length", "options.iv", options.iv); - const uuidRandom = options.uuid != null ? getBytes(options.uuid, "options.uuid") : randomBytes(16); - assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - const derivedKey = key2.slice(0, 16); - const macPrefix = key2.slice(16, 32); - const aesCtr = new CTR(derivedKey, iv2); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - const mac = keccak256(concat$1([macPrefix, ciphertext])); - const data = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv2).substring(2) - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r - }, - mac: mac.substring(2) - } - }; - if (account.mnemonic) { - const client2 = options.client != null ? options.client : `ethers/${version$3}`; - const path = account.mnemonic.path || defaultPath$1; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key2.slice(32, 64); - const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - const now = /* @__PURE__ */ new Date(); - const timestamp = now.getUTCFullYear() + "-" + zpad$1(now.getUTCMonth() + 1, 2) + "-" + zpad$1(now.getUTCDate(), 2) + "T" + zpad$1(now.getUTCHours(), 2) + "-" + zpad$1(now.getUTCMinutes(), 2) + "-" + zpad$1(now.getUTCSeconds(), 2) + ".0Z"; - const gethFilename = "UTC--" + timestamp + "--" + data.address; - data["x-ethers"] = { - client: client2, - gethFilename, - path, - locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1" - }; - } - return JSON.stringify(data); -} -function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key2 = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key2), kdf, account, options); -} -async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key2 = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(getBytes(key2), kdf, account, options); -} -const defaultPath = "m/44'/60'/0'/0/0"; -const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); -const HardenedBit = 2147483648; -const N$1 = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const Nibbles = "0123456789abcdef"; -function zpad(value, length) { - let result = ""; - while (value) { - result = Nibbles[value % 16] + result; - value = Math.trunc(value / 16); - } - while (result.length < length * 2) { - result = "0" + result; - } - return "0x" + result; -} -function encodeBase58Check(_value2) { - const value = getBytes(_value2); - const check = dataSlice(sha256$1(sha256$1(value)), 0, 4); - const bytes2 = concat$1([value, check]); - return encodeBase58(bytes2); -} -const _guard$1 = {}; -function ser_I(index2, chainCode, publicKey2, privateKey) { - const data = new Uint8Array(37); - if (index2 & HardenedBit) { - assert$a(privateKey != null, "cannot derive child of neutered node", "UNSUPPORTED_OPERATION", { - operation: "deriveChild" - }); - data.set(getBytes(privateKey), 1); - } else { - data.set(getBytes(publicKey2)); - } - for (let i3 = 24; i3 >= 0; i3 -= 8) { - data[33 + (i3 >> 3)] = index2 >> 24 - i3 & 255; - } - const I2 = getBytes(computeHmac("sha512", chainCode, data)); - return { IL: I2.slice(0, 32), IR: I2.slice(32) }; -} -function derivePath(node2, path) { - const components = path.split("/"); - assertArgument(components.length > 0, "invalid path", "path", path); - if (components[0] === "m") { - assertArgument(node2.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node2.depth}`, "path", path); - components.shift(); - } - let result = node2; - for (let i3 = 0; i3 < components.length; i3++) { - const component = components[i3]; - if (component.match(/^[0-9]+'$/)) { - const index2 = parseInt(component.substring(0, component.length - 1)); - assertArgument(index2 < HardenedBit, "invalid path index", `path[${i3}]`, component); - result = result.deriveChild(HardenedBit + index2); - } else if (component.match(/^[0-9]+$/)) { - const index2 = parseInt(component); - assertArgument(index2 < HardenedBit, "invalid path index", `path[${i3}]`, component); - result = result.deriveChild(index2); - } else { - assertArgument(false, "invalid path component", `path[${i3}]`, component); - } - } - return result; -} -const _HDNodeWallet = class _HDNodeWallet extends BaseWallet { - /** - * @private - */ - constructor(guard2, signingKey, parentFingerprint, chainCode, path, index2, depth, mnemonic, provider) { - super(signingKey, provider); - __privateAdd(this, _account); - /** - * The compressed public key. - */ - __publicField(this, "publicKey"); - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - __publicField(this, "fingerprint"); - /** - * The parent fingerprint. - */ - __publicField(this, "parentFingerprint"); - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - __publicField(this, "mnemonic"); - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - __publicField(this, "chainCode"); - /** - * The derivation path of this wallet. - * - * Since extended keys do not provide full path details, this - * may be ``null``, if instantiated from a source that does not - * encode it. - */ - __publicField(this, "path"); - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - __publicField(this, "index"); - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - __publicField(this, "depth"); - assertPrivate(guard2, _guard$1, "HDNodeWallet"); - defineProperties(this, { publicKey: signingKey.compressedPublicKey }); - const fingerprint = dataSlice(ripemd160(sha256$1(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, - fingerprint, - chainCode, - path, - index: index2, - depth - }); - defineProperties(this, { mnemonic }); - } - connect(provider) { - return new _HDNodeWallet(_guard$1, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await encryptKeystoreJson(__privateMethod(this, _account, account_fn).call(this), password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return encryptKeystoreJsonSync(__privateMethod(this, _account, account_fn).call(this), password); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpriv`` and can be used to - * reconstruct this HD Node to derive its children. - */ - get extendedKey() { - assert$a(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check(concat$1([ - "0x0488ADE4", - zpad(this.depth, 1), - this.parentFingerprint, - zpad(this.index, 4), - this.chainCode, - concat$1(["0x00", this.privateKey]) - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { - return this.path != null; - } - /** - * Returns a neutered HD Node, which removes the private details - * of an HD Node. - * - * A neutered node has no private key, but can be used to derive - * child addresses and other public data about the HD Node. - */ - neuter() { - return new HDNodeVoidWallet(_guard$1, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider); - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index2 = getNumber(_index, "index"); - assertArgument(index2 <= 4294967295, "invalid index", "index", index2); - let path = this.path; - if (path) { - path += "/" + (index2 & ~HardenedBit); - if (index2 & HardenedBit) { - path += "'"; - } - } - const { IR, IL: IL2 } = ser_I(index2, this.chainCode, this.publicKey, this.privateKey); - const ki2 = new SigningKey(toBeHex((toBigInt(IL2) + BigInt(this.privateKey)) % N$1, 32)); - return new _HDNodeWallet(_guard$1, ki2, this.fingerprint, hexlify(IR), path, index2, this.depth + 1, this.mnemonic, this.provider); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - /** - * Creates a new HD Node from %%extendedKey%%. - * - * If the %%extendedKey%% will either have a prefix or ``xpub`` or - * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) - * or full HD Node ([[HDNodeWallet) respectively. - */ - static fromExtendedKey(extendedKey) { - const bytes2 = toBeArray(decodeBase58(extendedKey)); - assertArgument(bytes2.length === 82 || encodeBase58Check(bytes2.slice(0, 78)) === extendedKey, "invalid extended key", "extendedKey", "[ REDACTED ]"); - const depth = bytes2[4]; - const parentFingerprint = hexlify(bytes2.slice(5, 9)); - const index2 = parseInt(hexlify(bytes2.slice(9, 13)).substring(2), 16); - const chainCode = hexlify(bytes2.slice(13, 45)); - const key2 = bytes2.slice(45, 78); - switch (hexlify(bytes2.slice(0, 4))) { - case "0x0488b21e": - case "0x043587cf": { - const publicKey2 = hexlify(key2); - return new HDNodeVoidWallet(_guard$1, computeAddress$1(publicKey2), publicKey2, parentFingerprint, chainCode, null, index2, depth, null); - } - case "0x0488ade4": - case "0x04358394 ": - if (key2[0] !== 0) { - break; - } - return new _HDNodeWallet(_guard$1, new SigningKey(key2.slice(1)), parentFingerprint, chainCode, null, index2, depth, null, null); - } - assertArgument(false, "invalid extended key prefix", "extendedKey", "[ REDACTED ]"); - } - /** - * Creates a new random HDNode. - */ - static createRandom(password, path, wordlist2) { - var _a3; - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist2 == null) { - wordlist2 = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist2); - return __privateMethod(_a3 = _HDNodeWallet, _fromSeed, fromSeed_fn).call(_a3, mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Create an HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, path) { - var _a3; - if (!path) { - path = defaultPath; - } - return __privateMethod(_a3 = _HDNodeWallet, _fromSeed, fromSeed_fn).call(_a3, mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase(phrase, password, path, wordlist2) { - var _a3; - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist2 == null) { - wordlist2 = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist2); - return __privateMethod(_a3 = _HDNodeWallet, _fromSeed, fromSeed_fn).call(_a3, mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed(seed) { - var _a3; - return __privateMethod(_a3 = _HDNodeWallet, _fromSeed, fromSeed_fn).call(_a3, seed, null); - } -}; -_account = new WeakSet(); -account_fn = function() { - const account = { address: this.address, privateKey: this.privateKey }; - const m3 = this.mnemonic; - if (this.path && m3 && m3.wordlist.locale === "en" && m3.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m3.entropy - }; - } - return account; -}; -_fromSeed = new WeakSet(); -fromSeed_fn = function(_seed, mnemonic) { - assertArgument(isBytesLike(_seed), "invalid seed", "seed", "[REDACTED]"); - const seed = getBytes(_seed, "seed"); - assertArgument(seed.length >= 16 && seed.length <= 64, "invalid seed", "seed", "[REDACTED]"); - const I2 = getBytes(computeHmac("sha512", MasterSecret, seed)); - const signingKey = new SigningKey(hexlify(I2.slice(0, 32))); - return new _HDNodeWallet(_guard$1, signingKey, "0x00000000", hexlify(I2.slice(32)), "m", 0, 0, mnemonic, null); -}; -__privateAdd(_HDNodeWallet, _fromSeed); -let HDNodeWallet = _HDNodeWallet; -class HDNodeVoidWallet extends VoidSigner { - /** - * @private - */ - constructor(guard2, address2, publicKey2, parentFingerprint, chainCode, path, index2, depth, provider) { - super(address2, provider); - /** - * The compressed public key. - */ - __publicField(this, "publicKey"); - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - __publicField(this, "fingerprint"); - /** - * The parent node fingerprint. - */ - __publicField(this, "parentFingerprint"); - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - __publicField(this, "chainCode"); - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - __publicField(this, "path"); - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - __publicField(this, "index"); - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - __publicField(this, "depth"); - assertPrivate(guard2, _guard$1, "HDNodeVoidWallet"); - defineProperties(this, { publicKey: publicKey2 }); - const fingerprint = dataSlice(ripemd160(sha256$1(publicKey2)), 0, 4); - defineProperties(this, { - publicKey: publicKey2, - fingerprint, - parentFingerprint, - chainCode, - path, - index: index2, - depth - }); - } - connect(provider) { - return new HDNodeVoidWallet(_guard$1, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpub`` and can be used to - * reconstruct this neutered key to derive its children addresses. - */ - get extendedKey() { - assert$a(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check(concat$1([ - "0x0488B21E", - zpad(this.depth, 1), - this.parentFingerprint, - zpad(this.index, 4), - this.chainCode, - this.publicKey - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { - return this.path != null; - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index2 = getNumber(_index, "index"); - assertArgument(index2 <= 4294967295, "invalid index", "index", index2); - let path = this.path; - if (path) { - path += "/" + (index2 & ~HardenedBit); - if (index2 & HardenedBit) { - path += "'"; - } - } - const { IR, IL: IL2 } = ser_I(index2, this.chainCode, this.publicKey, null); - const Ki2 = SigningKey.addPoints(IL2, this.publicKey, true); - const address2 = computeAddress$1(Ki2); - return new HDNodeVoidWallet(_guard$1, address2, Ki2, this.fingerprint, hexlify(IR), path, index2, this.depth + 1, this.provider); - } - /** - * Return the signer for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } -} -const wordlists = { - en: LangEn.wordlist() -}; -var _a$2; -function setify(items) { - const result = /* @__PURE__ */ new Set(); - items.forEach((k2) => result.add(k2)); - return Object.freeze(result); -} -const _kwVisib = "constant external internal payable private public pure view"; -const KwVisib = setify(_kwVisib.split(" ")); -const _kwTypes = "constructor error event fallback function receive struct"; -const KwTypes = setify(_kwTypes.split(" ")); -const _kwModifiers = "calldata memory storage payable indexed"; -const KwModifiers = setify(_kwModifiers.split(" ")); -const _kwOther = "tuple returns"; -const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); -const Keywords = setify(_keywords.split(" ")); -const SimpleTokens = { - "(": "OPEN_PAREN", - ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", - "]": "CLOSE_BRACKET", - ",": "COMMA", - "@": "AT" -}; -const regexWhitespacePrefix = new RegExp("^(\\s*)"); -const regexNumberPrefix = new RegExp("^([0-9]+)"); -const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); -const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); -const regexType = new RegExp("^(trcToken|address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); -class TokenString { - constructor(tokens) { - __privateAdd(this, _subTokenString2); - __privateAdd(this, _offset3, void 0); - __privateAdd(this, _tokens2, void 0); - __privateSet(this, _offset3, 0); - __privateSet(this, _tokens2, tokens.slice()); - } - get offset() { - return __privateGet(this, _offset3); - } - get length() { - return __privateGet(this, _tokens2).length - __privateGet(this, _offset3); - } - clone() { - return new _a$2(__privateGet(this, _tokens2)); - } - reset() { - __privateSet(this, _offset3, 0); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type2) { - if (this.peek().type !== type2) { - throw new Error(`expected ${type2}; got ${JSON.stringify(this.peek())}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = __privateMethod(this, _subTokenString2, subTokenString_fn2).call(this, __privateGet(this, _offset3) + 1, top.match + 1); - __privateSet(this, _offset3, top.match + 1); - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (__privateGet(this, _offset3) < top.match - 1) { - const link = this.peek().linkNext; - result.push(__privateMethod(this, _subTokenString2, subTokenString_fn2).call(this, __privateGet(this, _offset3) + 1, link)); - __privateSet(this, _offset3, link); - } - __privateSet(this, _offset3, top.match + 1); - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (__privateGet(this, _offset3) >= __privateGet(this, _tokens2).length) { - throw new Error("out-of-bounds"); - } - return __privateGet(this, _tokens2)[__privateGet(this, _offset3)]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return top != null && allowed.has(top) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type2) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return top.type === type2 ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - __privateWrapper(this, _offset3)._++; - return result; - } - toString() { - const tokens = []; - for (let i3 = __privateGet(this, _offset3); i3 < __privateGet(this, _tokens2).length; i3++) { - const token2 = __privateGet(this, _tokens2)[i3]; - tokens.push(`${token2.type}:${token2.text}`); - } - return ``; - } -} -_offset3 = new WeakMap(); -_tokens2 = new WeakMap(); -_subTokenString2 = new WeakSet(); -subTokenString_fn2 = function(from2 = 0, to2 = 0) { - return new _a$2(__privateGet(this, _tokens2).slice(from2, to2).map((t2) => { - return Object.freeze(Object.assign({}, t2, { - match: t2.match - from2, - linkBack: t2.linkBack - from2, - linkNext: t2.linkNext - from2 - })); - })); -}; -_a$2 = TokenString; -function lex(text) { - const tokens = []; - const throwError2 = (message2) => { - const token2 = offset2 < text.length ? JSON.stringify(text[offset2]) : "$EOI"; - throw new Error(`invalid token ${token2} at ${offset2}: ${message2}`); - }; - const brackets = []; - const commas = []; - let offset2 = 0; - while (offset2 < text.length) { - let cur = text.substring(offset2); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset2 += match[1].length; - cur = text.substring(offset2); - } - const token2 = { - depth: brackets.length, - linkBack: -1, - linkNext: -1, - match: -1, - type: "", - text: "", - offset: offset2, - value: -1 - }; - tokens.push(token2); - const type2 = SimpleTokens[cur[0]] || ""; - if (type2) { - token2.type = type2; - token2.text = cur[0]; - offset2++; - if (type2 === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } else if (type2 == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError2("no matching open bracket"); - } - token2.match = brackets.pop(); - tokens[token2.match].match = tokens.length - 1; - token2.depth--; - token2.linkBack = commas.pop(); - tokens[token2.linkBack].linkNext = tokens.length - 1; - } else if (type2 === "COMMA") { - token2.linkBack = commas.pop(); - tokens[token2.linkBack].linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } else if (type2 === "OPEN_BRACKET") { - token2.type = "BRACKET"; - } else if (type2 === "CLOSE_BRACKET") { - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - tokens[tokens.length - 1].value = getNumber(value); - } - if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - tokens[tokens.length - 1].text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token2.text = match[1]; - offset2 += token2.text.length; - if (Keywords.has(token2.text)) { - token2.type = "KEYWORD"; - continue; - } - if (token2.text.match(regexType)) { - token2.type = "TYPE"; - continue; - } - token2.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token2.text = match[1]; - token2.type = "NUMBER"; - offset2 += token2.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset2}`); - } - return new TokenString(tokens.map((t2) => Object.freeze(t2))); -} -function allowSingle(set2, allowed) { - const included = []; - for (const key2 in allowed.keys()) { - if (set2.has(key2)) { - included.push(key2); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } -} -function consumeName(type2, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type2) { - throw new Error(`expected ${type2}, got ${keyword}`); - } - } - return tokens.popType("ID"); -} -function consumeKeywords(tokens, allowed) { - const keywords2 = /* @__PURE__ */ new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || allowed && !allowed.has(keyword)) { - break; - } - tokens.pop(); - if (keywords2.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords2.add(keyword); - } - return Object.freeze(keywords2); -} -function consumeMutability(tokens) { - const modifiers = consumeKeywords(tokens, KwVisib); - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; -} -function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t2) => ParamType.from(t2, allowIndexed)); -} -function consumeGas(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid gas"); - } - return null; -} -function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens: ${tokens.toString()}`); - } -} -const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); -function verifyBasicType(type2) { - const match = type2.match(regexType); - assertArgument(match, "invalid type", "type", type2); - if (type2 === "uint") { - return "uint256"; - } - if (type2 === "int") { - return "int256"; - } - if (match[2]) { - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type2); - } else if (match[3]) { - const size2 = parseInt(match[3]); - assertArgument(size2 !== 0 && size2 <= 256 && size2 % 8 === 0, "invalid numeric width", "type", type2); - } - return type2; -} -const _guard = {}; -const internal = Symbol.for("_ethers_internal"); -const ParamTypeInternal = "_ParamTypeInternal"; -const ErrorFragmentInternal = "_ErrorInternal"; -const EventFragmentInternal = "_EventInternal"; -const ConstructorFragmentInternal = "_ConstructorInternal"; -const FallbackFragmentInternal = "_FallbackInternal"; -const FunctionFragmentInternal = "_FunctionInternal"; -const StructFragmentInternal = "_StructInternal"; -const _ParamType = class _ParamType { - /** - * @private - */ - constructor(guard2, name2, type2, baseType, indexed, components, arrayLength, arrayChildren) { - __privateAdd(this, _walkAsync2); - /** - * The local name of the parameter (or ``""`` if unbound) - */ - __publicField(this, "name"); - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - __publicField(this, "type"); - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - __publicField(this, "baseType"); - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - __publicField(this, "indexed"); - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - __publicField(this, "components"); - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - __publicField(this, "arrayLength"); - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - __publicField(this, "arrayChildren"); - assertPrivate(guard2, _guard, "ParamType"); - Object.defineProperty(this, internal, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } else if (components != null) { - throw new Error(""); - } - defineProperties(this, { - name: name2, - type: type2, - baseType, - indexed, - components, - arrayLength, - arrayChildren - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format2) { - if (format2 == null) { - format2 = "sighash"; - } - if (format2 === "json") { - const result2 = { - type: this.baseType === "tuple" ? "tuple" : this.type, - name: this.name || void 0 - }; - if (typeof this.indexed === "boolean") { - result2.indexed = this.indexed; - } - if (this.isTuple()) { - result2.components = this.components.map((c2) => JSON.parse(c2.format(format2))); - } - return JSON.stringify(result2); - } - let result = ""; - if (this.isArray()) { - result += this.arrayChildren.format(format2); - result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; - } else { - if (this.isTuple()) { - if (format2 !== "sighash") { - result += this.type; - } - result += "(" + this.components.map((comp) => comp.format(format2)).join(format2 === "full" ? ", " : ",") + ")"; - } else { - result += this.type; - } - } - if (format2 !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format2 === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return this.baseType === "array"; - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return this.baseType === "tuple"; - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return this.indexed != null; - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process2) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - return value.map((v6) => { - var _a3; - return (_a3 = this.arrayChildren) == null ? void 0 : _a3.walk(v6, process2); - }); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - return value.map((v6, i3) => { - var _a3; - return (_a3 = this.components) == null ? void 0 : _a3[i3].walk(v6, process2); - }); - } - return process2(this.type, value); - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process2) { - const promises = []; - const result = [value]; - __privateMethod(this, _walkAsync2, walkAsync_fn2).call(this, promises, value, process2, (value2) => { - result[0] = value2; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (_ParamType.isParamType(obj)) { - return obj; - } - if (typeof obj === "string") { - return _ParamType.from(lex(obj), allowIndexed); - } else if (obj instanceof TokenString) { - let type3 = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) { - baseType = "tuple"; - comps = obj.popParams().map((t2) => _ParamType.from(t2)); - type3 = `tuple(${comps.map((c2) => c2.format()).join(",")})`; - } else { - type3 = verifyBasicType(obj.popType("TYPE")); - baseType = type3; - } - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); - arrayChildren = new _ParamType(_guard, "", type3, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type3 += bracket.text; - baseType = "array"; - comps = null; - } - let indexed2 = null; - const keywords2 = consumeKeywords(obj, KwModifiers); - if (keywords2.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed2 = true; - } - const name3 = obj.peekType("ID") ? obj.pop().text : ""; - if (obj.length) { - throw new Error("leftover tokens"); - } - return new _ParamType(_guard, name3, type3, baseType, indexed2, comps, arrayLength, arrayChildren); - } - const name2 = obj.name; - assertArgument(!name2 || typeof name2 === "string" && name2.match(regexId), "invalid name", "obj.name", name2); - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type2 = obj.type; - const arrayMatch = type2.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = _ParamType.from({ - type: arrayMatch[1], - components: obj.components - }); - return new _ParamType(_guard, name2 || "", type2, "array", indexed, null, arrayLength, arrayChildren); - } - if (type2 === "tuple" || type2.startsWith( - "tuple(" - /* fix: ) */ - ) || type2.startsWith( - "(" - /* fix: ) */ - )) { - const comps = obj.components != null ? obj.components.map((c2) => _ParamType.from(c2)) : null; - const tuple2 = new _ParamType(_guard, name2 || "", type2, "tuple", indexed, comps, null, null); - return tuple2; - } - type2 = verifyBasicType(obj.type); - return new _ParamType(_guard, name2 || "", type2, type2, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return value && value[internal] === ParamTypeInternal; - } -}; -_walkAsync2 = new WeakSet(); -walkAsync_fn2 = function(promises, value, process2, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result2 = value.slice(); - result2.forEach((value2, index2) => { - var _a3; - __privateMethod(_a3 = childType, _walkAsync2, walkAsync_fn2).call(_a3, promises, value2, process2, (value3) => { - result2[index2] = value3; - }); - }); - setValue(result2); - return; - } - if (this.isTuple()) { - const components = this.components; - let result2; - if (Array.isArray(value)) { - result2 = value.slice(); - } else { - if (value == null || typeof value !== "object") { - throw new Error("invalid tuple value"); - } - result2 = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result2.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result2.forEach((value2, index2) => { - var _a3; - __privateMethod(_a3 = components[index2], _walkAsync2, walkAsync_fn2).call(_a3, promises, value2, process2, (value3) => { - result2[index2] = value3; - }); - }); - setValue(result2); - return; - } - const result = process2(this.type, value); - if (result.then) { - promises.push(async function() { - setValue(await result); - }()); - } else { - setValue(result); - } -}; -let ParamType = _ParamType; -class Fragment { - /** - * @private - */ - constructor(guard2, type2, inputs) { - /** - * The type of the fragment. - */ - __publicField(this, "type"); - /** - * The inputs for the fragment. - */ - __publicField(this, "inputs"); - assertPrivate(guard2, _guard, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type: type2, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof obj === "string") { - try { - Fragment.from(JSON.parse(obj)); - } catch (e18) { - } - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - const type2 = obj.peekKeyword(KwTypes); - switch (type2) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - } else if (typeof obj === "object") { - switch (obj.type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - assert$a(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from" - }); - } - assertArgument(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } -} -class NamedFragment extends Fragment { - /** - * @private - */ - constructor(guard2, type2, name2, inputs) { - super(guard2, type2, inputs); - /** - * The name of the fragment. - */ - __publicField(this, "name"); - assertArgument(typeof name2 === "string" && name2.match(regexId), "invalid identifier", "name", name2); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name: name2 }); - } -} -function joinParams(format2, params) { - return "(" + params.map((p3) => p3.format(format2)).join(format2 === "full" ? ", " : ",") + ")"; -} -class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard2, name2, inputs) { - super(guard2, "error", name2, inputs); - Object.defineProperty(this, internal, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this fragment as %%format%%. - */ - format(format2) { - if (format2 == null) { - format2 = "sighash"; - } - if (format2 === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format2))) - }); - } - const result = []; - if (format2 !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format2, this.inputs)); - return result.join(" "); - } - /** - * Returns a new **ErrorFragment** for %%obj%%. - */ - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ErrorFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const name2 = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard, name2, inputs); - } - return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **ErrorFragment**. - */ - static isFragment(value) { - return value && value[internal] === ErrorFragmentInternal; - } -} -class EventFragment extends NamedFragment { - /** - * @private - */ - constructor(guard2, name2, inputs, anonymous) { - super(guard2, "event", name2, inputs); - /** - * Whether this event is anonymous. - */ - __publicField(this, "anonymous"); - Object.defineProperty(this, internal, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return id(this.format("sighash")); - } - /** - * Returns a string representation of this event as %%format%%. - */ - format(format2) { - if (format2 == null) { - format2 = "sighash"; - } - if (format2 === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i3) => JSON.parse(i3.format(format2))) - }); - } - const result = []; - if (format2 !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format2, this.inputs)); - if (format2 !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - /** - * Return the topic hash for an event with %%name%% and %%params%%. - */ - static getTopicHash(name2, params) { - params = (params || []).map((p3) => ParamType.from(p3)); - const fragment = new EventFragment(_guard, name2, params, false); - return fragment.topicHash; - } - /** - * Returns a new **EventFragment** for %%obj%%. - */ - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return EventFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const name2 = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard, name2, inputs, anonymous); - } - return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p3) => ParamType.from(p3, true)) : [], !!obj.anonymous); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **EventFragment**. - */ - static isFragment(value) { - return value && value[internal] === EventFragmentInternal; - } -} -class ConstructorFragment extends Fragment { - /** - * @private - */ - constructor(guard2, type2, inputs, payable, gas) { - super(guard2, type2, inputs); - /** - * Whether the constructor can receive an endowment. - */ - __publicField(this, "payable"); - /** - * The recommended gas limit for deployment or ``null``. - */ - __publicField(this, "gas"); - Object.defineProperty(this, internal, { - value: ConstructorFragmentInternal - }); - defineProperties(this, { payable, gas }); - } - /** - * Returns a string representation of this constructor as %%format%%. - */ - format(format2) { - assert$a(format2 != null && format2 !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { - operation: "format(sighash)" - }); - if (format2 === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: this.payable ? "payable" : "undefined", - payable: this.payable, - gas: this.gas != null ? this.gas : void 0, - inputs: this.inputs.map((i3) => JSON.parse(i3.format(format2))) - }); - } - const result = [`constructor${joinParams(format2, this.inputs)}`]; - result.push(this.payable ? "payable" : "nonpayable"); - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - return result.join(" "); - } - /** - * Returns a new **ConstructorFragment** for %%obj%%. - */ - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ConstructorFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable"); - const gas = consumeGas(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard, "constructor", inputs, payable, gas); - } - return new ConstructorFragment(_guard, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.gas != null ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **ConstructorFragment**. - */ - static isFragment(value) { - return value && value[internal] === ConstructorFragmentInternal; - } -} -class FallbackFragment extends Fragment { - constructor(guard2, inputs, payable) { - super(guard2, "fallback", inputs); - /** - * If the function can be sent value during invocation. - */ - __publicField(this, "payable"); - Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - /** - * Returns a string representation of this fallback as %%format%%. - */ - format(format2) { - const type2 = this.inputs.length === 0 ? "receive" : "fallback"; - if (format2 === "json") { - const stateMutability = this.payable ? "payable" : "nonpayable"; - return JSON.stringify({ type: type2, stateMutability }); - } - return `${type2}()${this.payable ? " payable" : ""}`; - } - /** - * Returns a new **FallbackFragment** for %%obj%%. - */ - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FallbackFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type2 = obj.popKeyword(setify(["fallback", "receive"])); - if (type2 === "receive") { - const inputs2 = consumeParams(obj); - assertArgument(inputs2.length === 0, `receive cannot have arguments`, "obj.inputs", inputs2); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard, [], true); - } - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i3) => i3.format("minimal")).join(", ")); - } else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i3) => i3.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = obj.stateMutability === "payable"; - return new FallbackFragment(_guard, inputs, payable); - } - assertArgument(false, "invalid fallback description", "obj", obj); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FallbackFragment**. - */ - static isFragment(value) { - return value && value[internal] === FallbackFragmentInternal; - } -} -class FunctionFragment extends NamedFragment { - /** - * @private - */ - constructor(guard2, name2, stateMutability, inputs, outputs, gas) { - super(guard2, "function", name2, inputs); - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - __publicField(this, "constant"); - /** - * The returned types for the result of calling this function. - */ - __publicField(this, "outputs"); - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - __publicField(this, "stateMutability"); - /** - * If the function can be sent value during invocation. - */ - __publicField(this, "payable"); - /** - * The recommended gas limit to send when calling this function. - */ - __publicField(this, "gas"); - Object.defineProperty(this, internal, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = stateMutability === "view" || stateMutability === "pure"; - const payable = stateMutability === "payable"; - defineProperties(this, { - constant, - gas, - outputs, - payable, - stateMutability - }); - } - /** - * The Function selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this function as %%format%%. - */ - format(format2) { - if (format2 == null) { - format2 = "sighash"; - } - if (format2 === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: this.stateMutability !== "nonpayable" ? this.stateMutability : void 0, - payable: this.payable, - gas: this.gas != null ? this.gas : void 0, - inputs: this.inputs.map((i3) => JSON.parse(i3.format(format2))), - outputs: this.outputs.map((o2) => JSON.parse(o2.format(format2))) - }); - } - const result = []; - if (format2 !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format2, this.inputs)); - if (format2 !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format2, this.outputs)); - } - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - } - return result.join(" "); - } - /** - * Return the selector for a function with %%name%% and %%params%%. - */ - static getSelector(name2, params) { - params = (params || []).map((p3) => ParamType.from(p3)); - const fragment = new FunctionFragment(_guard, name2, "view", params, [], null); - return fragment.selector; - } - /** - * Returns a new **FunctionFragment** for %%obj%%. - */ - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FunctionFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const name2 = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const gas = consumeGas(obj); - consumeEoi(obj); - return new FunctionFragment(_guard, name2, mutability, inputs, outputs, gas); - } - let stateMutability = obj.stateMutability; - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof obj.constant === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } else if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.gas != null ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FunctionFragment**. - */ - static isFragment(value) { - return value && value[internal] === FunctionFragmentInternal; - } -} -class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard2, name2, inputs) { - super(guard2, "struct", name2, inputs); - Object.defineProperty(this, internal, { value: StructFragmentInternal }); - } - /** - * Returns a string representation of this struct as %%format%%. - */ - format() { - throw new Error("@TODO"); - } - /** - * Returns a new **StructFragment** for %%obj%%. - */ - static from(obj) { - if (typeof obj === "string") { - return StructFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const name2 = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard, name2, inputs); - } - return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - // @TODO: fix this return type - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **StructFragment**. - */ - static isFragment(value) { - return value && value[internal] === StructFragmentInternal; - } -} -class LogDescription { - /** - * @_ignore: - */ - constructor(fragment, topic, args) { - /** - * The matching fragment for the ``topic0``. - */ - __publicField(this, "fragment"); - /** - * The name of the Event. - */ - __publicField(this, "name"); - /** - * The full Event signature. - */ - __publicField(this, "signature"); - /** - * The topic hash for the Event. - */ - __publicField(this, "topic"); - /** - * The arguments passed into the Event with ``emit``. - */ - __publicField(this, "args"); - const name2 = fragment.name, signature2 = fragment.format(); - defineProperties(this, { - fragment, - name: name2, - signature: signature2, - topic, - args - }); - } -} -class TransactionDescription { - /** - * @_ignore: - */ - constructor(fragment, selector, args, value) { - /** - * The matching fragment from the transaction ``data``. - */ - __publicField(this, "fragment"); - /** - * The name of the Function from the transaction ``data``. - */ - __publicField(this, "name"); - /** - * The arguments passed to the Function from the transaction ``data``. - */ - __publicField(this, "args"); - /** - * The full Function signature from the transaction ``data``. - */ - __publicField(this, "signature"); - /** - * The selector for the Function from the transaction ``data``. - */ - __publicField(this, "selector"); - /** - * The ``value`` (in wei) from the transaction. - */ - __publicField(this, "value"); - const name2 = fragment.name, signature2 = fragment.format(); - defineProperties(this, { - fragment, - name: name2, - args, - signature: signature2, - selector, - value - }); - } -} -class ErrorDescription { - /** - * @_ignore: - */ - constructor(fragment, selector, args) { - /** - * The matching fragment. - */ - __publicField(this, "fragment"); - /** - * The name of the Error. - */ - __publicField(this, "name"); - /** - * The arguments passed to the Error with ``revert``. - */ - __publicField(this, "args"); - /** - * The full Error signature. - */ - __publicField(this, "signature"); - /** - * The selector for the Error. - */ - __publicField(this, "selector"); - const name2 = fragment.name, signature2 = fragment.format(); - defineProperties(this, { - fragment, - name: name2, - args, - signature: signature2, - selector - }); - } -} -class Indexed { - /** - * @_ignore: - */ - constructor(hash3) { - /** - * The ``keccak256`` of the value logged. - */ - __publicField(this, "hash"); - /** - * @_ignore: - */ - __publicField(this, "_isIndexed"); - defineProperties(this, { hash: hash3, _isIndexed: true }); - } - /** - * Returns ``true`` if %%value%% is an **Indexed**. - * - * This provides a Type Guard for property access. - */ - static isIndexed(value) { - return !!(value && value._isIndexed); - } -} -const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function" -}; -const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message2) => { - return `reverted with reason string ${JSON.stringify(message2)}`; - } - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code2) => { - let reason = "unknown panic code"; - if (code2 >= 0 && code2 <= 255 && PanicReasons[code2.toString()]) { - reason = PanicReasons[code2.toString()]; - } - return `reverted with panic code 0x${code2.toString(16)} (${reason})`; - } - } -}; -const _Interface = class _Interface { - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments) { - // Find a function definition by any means necessary (unless it is ambiguous) - __privateAdd(this, _getFunction); - // Find an event definition by any means necessary (unless it is ambiguous) - __privateAdd(this, _getEvent); - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - __publicField(this, "fragments"); - /** - * The Contract constructor. - */ - __publicField(this, "deploy"); - /** - * The Fallback method, if any. - */ - __publicField(this, "fallback"); - /** - * If receiving ether is supported. - */ - __publicField(this, "receive"); - __privateAdd(this, _errors, void 0); - __privateAdd(this, _events, void 0); - __privateAdd(this, _functions, void 0); - // #structs: Map; - __privateAdd(this, _abiCoder, void 0); - let abi2 = []; - if (typeof fragments === "string") { - abi2 = JSON.parse(fragments); - } else { - abi2 = fragments; - } - __privateSet(this, _functions, /* @__PURE__ */ new Map()); - __privateSet(this, _errors, /* @__PURE__ */ new Map()); - __privateSet(this, _events, /* @__PURE__ */ new Map()); - const frags = []; - for (const a3 of abi2) { - try { - frags.push(Fragment.from(a3)); - } catch (error) { - console.log("EE", error); - } - } - defineProperties(this, { - fragments: Object.freeze(frags) - }); - let fallback = null; - let receive = false; - __privateSet(this, _abiCoder, this.getAbiCoder()); - this.fragments.forEach((fragment, index2) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - defineProperties(this, { - deploy: fragment - }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } else { - assertArgument(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index2}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - bucket = __privateGet(this, _functions); - break; - case "event": - bucket = __privateGet(this, _events); - break; - case "error": - bucket = __privateGet(this, _errors); - break; - default: - return; - } - const signature2 = fragment.format(); - if (bucket.has(signature2)) { - return; - } - bucket.set(signature2, fragment); - }); - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()") - }); - } - defineProperties(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format2 = minimal ? "minimal" : "full"; - const abi2 = this.fragments.map((f3) => f3.format(format2)); - return abi2; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi2 = this.fragments.map((f3) => f3.format("json")); - return JSON.stringify(abi2.map((j2) => JSON.parse(j2))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return AbiCoder.defaultAbiCoder(); - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key2) { - const fragment = __privateMethod(this, _getFunction, getFunction_fn).call(this, key2, null, false); - assertArgument(fragment, "no matching function", "key", key2); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key2) { - return !!__privateMethod(this, _getFunction, getFunction_fn).call(this, key2, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key2, values) { - return __privateMethod(this, _getFunction, getFunction_fn).call(this, key2, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(__privateGet(this, _functions).keys()); - names.sort((a3, b2) => a3.localeCompare(b2)); - for (let i3 = 0; i3 < names.length; i3++) { - const name2 = names[i3]; - callback(__privateGet(this, _functions).get(name2), i3); - } - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key2) { - const fragment = __privateMethod(this, _getEvent, getEvent_fn).call(this, key2, null, false); - assertArgument(fragment, "no matching event", "key", key2); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key2) { - return !!__privateMethod(this, _getEvent, getEvent_fn).call(this, key2, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key2, values) { - return __privateMethod(this, _getEvent, getEvent_fn).call(this, key2, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(__privateGet(this, _events).keys()); - names.sort((a3, b2) => a3.localeCompare(b2)); - for (let i3 = 0; i3 < names.length; i3++) { - const name2 = names[i3]; - callback(__privateGet(this, _events).get(name2), i3); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key2, values) { - if (isHexString(key2)) { - const selector = key2.toLowerCase(); - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of __privateGet(this, _errors).values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - if (key2.indexOf("(") === -1) { - const matching = []; - for (const [name2, fragment] of __privateGet(this, _errors)) { - if (name2.split( - "(" - /* fix:) */ - )[0] === key2) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key2 === "Error") { - return ErrorFragment.from("error Error(string)"); - } - if (key2 === "Panic") { - return ErrorFragment.from("error Panic(uint256)"); - } - return null; - } else if (matching.length > 1) { - const matchStr = matching.map((m3) => JSON.stringify(m3.format())).join(", "); - assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key2); - } - return matching[0]; - } - key2 = ErrorFragment.from(key2).format(); - if (key2 === "Error(string)") { - return ErrorFragment.from("error Error(string)"); - } - if (key2 === "Panic(uint256)") { - return ErrorFragment.from("error Panic(uint256)"); - } - const result = __privateGet(this, _errors).get(key2); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(__privateGet(this, _errors).keys()); - names.sort((a3, b2) => a3.localeCompare(b2)); - for (let i3 = 0; i3 < names.length; i3++) { - const name2 = names[i3]; - callback(__privateGet(this, _errors).get(name2), i3); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return __privateGet(this, _abiCoder).decode(params, data); - } - _encodeParams(params, values) { - return __privateGet(this, _abiCoder).encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data) { - if (typeof fragment === "string") { - const f3 = this.getError(fragment); - assertArgument(f3, "unknown error", "fragment", fragment); - fragment = f3; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof fragment === "string") { - const f3 = this.getError(fragment); - assertArgument(f3, "unknown error", "fragment", fragment); - fragment = f3; - } - return concat$1([fragment.selector, this._encodeParams(fragment.inputs, values || [])]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data) { - if (typeof fragment === "string") { - const f3 = this.getFunction(fragment); - assertArgument(f3, "unknown function", "fragment", fragment); - fragment = f3; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof fragment === "string") { - const f3 = this.getFunction(fragment); - assertArgument(f3, "unknown function", "fragment", fragment); - fragment = f3; - } - return concat$1([fragment.selector, this._encodeParams(fragment.inputs, values || [])]); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data) { - if (typeof fragment === "string") { - const f3 = this.getFunction(fragment); - assertArgument(f3, "unknown function", "fragment", fragment); - fragment = f3; - } - let message2 = "invalid length for result data"; - const bytes2 = getBytesCopy(data); - if (bytes2.length % 32 === 0) { - try { - return __privateGet(this, _abiCoder).decode(fragment.outputs, bytes2); - } catch (error) { - message2 = "could not decode result data"; - } - } - assert$a(false, message2, "BAD_DATA", { - value: hexlify(bytes2), - info: { method: fragment.name, signature: fragment.format() } - }); - } - makeError(_data5, tx) { - const data = getBytes(_data5, "data"); - const error = AbiCoder.getBuiltinCallException("call", tx, data); - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - const ef2 = this.getError(selector); - if (ef2) { - try { - const args = __privateGet(this, _abiCoder).decode(ef2.inputs, data.slice(4)); - error.revert = { - name: ef2.name, - signature: ef2.format(), - args - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } catch (e18) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof fragment === "string") { - const f3 = this.getFunction(fragment); - assertArgument(f3, "unknown function", "fragment", fragment); - fragment = f3; - } - return hexlify(__privateGet(this, _abiCoder).encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ - // Create the filter for the event with search criteria (e.g. for eth_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof fragment === "string") { - const f3 = this.getEvent(fragment); - assertArgument(f3, "unknown event", "eventFragment", fragment); - fragment = f3; - } - assert$a(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { - count: values.length, - expectedCount: fragment.inputs.length - }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - const encodeTopic = (param, value) => { - if (param.type === "string") { - return id(value); - } else if (param.type === "bytes") { - return keccak256(hexlify(value)); - } - if (param.type === "bool" && typeof value === "boolean") { - value = value ? "0x01" : "0x00"; - } - if (param.type.match(/^u?int/)) { - value = toBeHex(value); - } - if (param.type === "address") { - __privateGet(this, _abiCoder).encode(["address"], [value]); - } - return zeroPadValue(hexlify(value), 32); - }; - values.forEach((value, index2) => { - const param = fragment.inputs[index2]; - if (!param.indexed) { - assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); - return; - } - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); - } else if (Array.isArray(value)) { - topics.push(value.map((value2) => encodeTopic(param, value2))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof fragment === "string") { - const f3 = this.getEvent(fragment); - assertArgument(f3, "unknown event", "eventFragment", fragment); - fragment = f3; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index2) => { - const value = values[index2]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)); - } else if (param.type === "bytes") { - topics.push(keccak256(value)); - } else if (param.baseType === "tuple" || param.baseType === "array") { - throw new Error("not implemented"); - } else { - topics.push(__privateGet(this, _abiCoder).encode([param.type], [value])); - } - } else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: __privateGet(this, _abiCoder).encode(dataTypes, dataValues), - topics - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { - if (typeof fragment === "string") { - const f3 = this.getEvent(fragment); - assertArgument(f3, "unknown event", "eventFragment", fragment); - fragment = f3; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index2) => { - if (param.indexed) { - if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } else { - indexed.push(param); - dynamic.push(false); - } - } else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = topics != null ? __privateGet(this, _abiCoder).decode(indexed, concat$1(topics)) : null; - const resultNonIndexed = __privateGet(this, _abiCoder).decode(nonIndexed, data, true); - const values = []; - const keys2 = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index2) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } else if (dynamic[index2]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } else { - try { - value = resultIndexed[indexedIndex++]; - } catch (error) { - value = error; - } - } - } else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } catch (error) { - value = error; - } - } - values.push(value); - keys2.push(param.name || null); - }); - return Result.fromItems(values, keys2); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - if (!fragment) { - return null; - } - const args = __privateGet(this, _abiCoder).decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log2) { - const fragment = this.getEvent(log2.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log2.data, log2.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data) { - const hexData = hexlify(data); - const fragment = this.getError(dataSlice(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = __privateGet(this, _abiCoder).decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - if (value instanceof _Interface) { - return value; - } - if (typeof value === "string") { - return new _Interface(JSON.parse(value)); - } - if (typeof value.format === "function") { - return new _Interface(value.format("json")); - } - return new _Interface(value); - } -}; -_errors = new WeakMap(); -_events = new WeakMap(); -_functions = new WeakMap(); -_abiCoder = new WeakMap(); -_getFunction = new WeakSet(); -getFunction_fn = function(key2, values, forceUnique) { - if (isHexString(key2)) { - const selector = key2.toLowerCase(); - for (const fragment of __privateGet(this, _functions).values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - if (key2.indexOf("(") === -1) { - const matching = []; - for (const [name2, fragment] of __privateGet(this, _functions)) { - if (name2.split( - "(" - /* fix:) */ - )[0] === key2) { - matching.push(fragment); - } - } - if (values) { - const lastValue = values.length > 0 ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - for (let i3 = matching.length - 1; i3 >= 0; i3--) { - const inputs = matching[i3].inputs.length; - if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i3, 1); - } - } - for (let i3 = matching.length - 1; i3 >= 0; i3--) { - const inputs = matching[i3].inputs; - for (let j2 = 0; j2 < values.length; j2++) { - if (!Typed.isTyped(values[j2])) { - continue; - } - if (j2 >= inputs.length) { - if (values[j2].type === "overrides") { - continue; - } - matching.splice(i3, 1); - break; - } - if (values[j2].type !== inputs[j2].baseType) { - matching.splice(i3, 1); - break; - } - } - } - } - if (matching.length === 1 && values && values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || Array.isArray(lastArg) || typeof lastArg !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m3) => JSON.stringify(m3.format())).join(", "); - assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key2); - } - return matching[0]; - } - const result = __privateGet(this, _functions).get(FunctionFragment.from(key2).format()); - if (result) { - return result; - } - return null; -}; -_getEvent = new WeakSet(); -getEvent_fn = function(key2, values, forceUnique) { - if (isHexString(key2)) { - const eventTopic = key2.toLowerCase(); - for (const fragment of __privateGet(this, _events).values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - if (key2.indexOf("(") === -1) { - const matching = []; - for (const [name2, fragment] of __privateGet(this, _events)) { - if (name2.split( - "(" - /* fix:) */ - )[0] === key2) { - matching.push(fragment); - } - } - if (values) { - for (let i3 = matching.length - 1; i3 >= 0; i3--) { - if (matching[i3].inputs.length < values.length) { - matching.splice(i3, 1); - } - } - for (let i3 = matching.length - 1; i3 >= 0; i3--) { - const inputs = matching[i3].inputs; - for (let j2 = 0; j2 < values.length; j2++) { - if (!Typed.isTyped(values[j2])) { - continue; - } - if (values[j2].type !== inputs[j2].baseType) { - matching.splice(i3, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m3) => JSON.stringify(m3.format())).join(", "); - assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key2); - } - return matching[0]; - } - const result = __privateGet(this, _events).get(EventFragment.from(key2).format()); - if (result) { - return result; - } - return null; -}; -let Interface = _Interface; -const splitSignature = (sigBytes) => Signature$4.from(sigBytes); -const joinSignature = (splitSig) => Signature$4.from(splitSig).serialized; -const arrayify = (value) => getBytes(value); -const FormatTypes = { - sighash: "sighash", - minimal: "minimal", - full: "full", - json: "json" -}; -const isValidMnemonic = Mnemonic.isValidMnemonic; -computeHmac.register((algorithm, key2, data) => { - return computeHmac._(algorithm, Buffer.from(key2), Buffer.from(data)); -}); -const ethersUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - AbiCoder, - FormatTypes, - Interface, - Mnemonic, - Signature: Signature$4, - SigningKey, - Wordlist, - arrayify, - concat: concat$1, - ethersHDNodeWallet: HDNodeWallet, - id, - isValidMnemonic, - joinSignature, - keccak256, - recoverAddress, - sha256: sha256$1, - splitSignature, - toUtf8Bytes, - toUtf8String, - wordlists -}, Symbol.toStringTag, { value: "Module" })); -const ADDRESS_SIZE = 34; -const ADDRESS_PREFIX = "41"; -const ADDRESS_PREFIX_BYTE = 65; -const ADDRESS_PREFIX_REGEX = /^(41)/; -const TRON_BIP39_PATH_PREFIX = "m/44'/195'"; -const TRON_BIP39_PATH_INDEX_0 = TRON_BIP39_PATH_PREFIX + "/0'/0/0"; -function fromHex(address2) { - if (!isHex(address2)) - return address2; - return getBase58CheckAddress(hexStr2byteArray(address2.replace(/^0x/, ADDRESS_PREFIX))); -} -function toHex$1(address2) { - if (isHex(address2)) - return address2.toLowerCase().replace(/^0x/, ADDRESS_PREFIX); - return byteArray2hexStr(decodeBase58Address(address2)).toLowerCase(); -} -function getChecksumAddress(address2) { - address2 = address2.toLowerCase(); - const chars = address2.substring(2).split(""); - const expanded = new Uint8Array(40); - for (let i3 = 0; i3 < 40; i3++) { - expanded[i3] = chars[i3].charCodeAt(0); - } - const hashed = hexStr2byteArray(keccak256(expanded).slice(2)); - for (let i3 = 0; i3 < 40; i3 += 2) { - if (hashed[i3 >> 1] >> 4 >= 8) { - chars[i3] = chars[i3].toUpperCase(); - } - if ((hashed[i3 >> 1] & 15) >= 8) { - chars[i3 + 1] = chars[i3 + 1].toUpperCase(); - } - } - return ADDRESS_PREFIX + chars.join(""); -} -function toChecksumAddress(address2) { - if (!isAddress(address2)) - throw new Error(`'${address2}' is not a valid address string`); - return getChecksumAddress(toHex$1(address2)); -} -function isChecksumAddress(address2) { - if (!isHex(address2) || address2.length !== 42) - return false; - try { - return toChecksumAddress(address2) === address2; - } catch { - return false; - } -} -function fromPrivateKey(privateKey, strict = false) { - try { - return pkToAddress(privateKey, strict); - } catch { - return false; - } -} -function isAddress(address2) { - if (!address2 || !isString$1(address2)) - return false; - if (address2.length === 42) { - try { - return isAddress(getBase58CheckAddress(hexStr2byteArray(address2))); - } catch (err) { - return false; - } - } - try { - return isAddressValid(address2); - } catch (err) { - return false; - } -} -const address = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - ADDRESS_PREFIX, - ADDRESS_PREFIX_BYTE, - ADDRESS_PREFIX_REGEX, - ADDRESS_SIZE, - TRON_BIP39_PATH_INDEX_0, - TRON_BIP39_PATH_PREFIX, - fromHex, - fromPrivateKey, - isAddress, - isChecksumAddress, - toChecksumAddress, - toHex: toHex$1 -}, Symbol.toStringTag, { value: "Module" })); -const ALPHABET$1 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -const ALPHABET_MAP = {}; -for (let i3 = 0; i3 < ALPHABET$1.length; i3++) - ALPHABET_MAP[ALPHABET$1.charAt(i3)] = i3; -const BASE = 58; -function encode58(buffer2) { - if (buffer2.length === 0) - return ""; - let i3; - let j2; - const digits = [0]; - for (i3 = 0; i3 < buffer2.length; i3++) { - for (j2 = 0; j2 < digits.length; j2++) - digits[j2] <<= 8; - digits[0] += buffer2[i3]; - let carry = 0; - for (j2 = 0; j2 < digits.length; ++j2) { - digits[j2] += carry; - carry = digits[j2] / BASE | 0; - digits[j2] %= BASE; - } - while (carry) { - digits.push(carry % BASE); - carry = carry / BASE | 0; - } - } - for (i3 = 0; buffer2[i3] === 0 && i3 < buffer2.length - 1; i3++) - digits.push(0); - return digits.reverse().map((digit) => ALPHABET$1[digit]).join(""); -} -function decode58(string2) { - if (string2.length === 0) - return []; - let i3; - let j2; - const bytes2 = [0]; - for (i3 = 0; i3 < string2.length; i3++) { - const c2 = string2[i3]; - if (!(c2 in ALPHABET_MAP)) - throw new Error("Non-base58 character"); - for (j2 = 0; j2 < bytes2.length; j2++) - bytes2[j2] *= BASE; - bytes2[0] += ALPHABET_MAP[c2]; - let carry = 0; - for (j2 = 0; j2 < bytes2.length; ++j2) { - bytes2[j2] += carry; - carry = bytes2[j2] >> 8; - bytes2[j2] &= 255; - } - while (carry) { - bytes2.push(carry & 255); - carry >>= 8; - } - } - for (i3 = 0; string2[i3] === "1" && i3 < string2.length - 1; i3++) - bytes2.push(0); - return bytes2.reverse(); -} -const base58$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - decode58, - encode58 -}, Symbol.toStringTag, { value: "Module" })); -function bind$1(fn2, thisArg) { - return function wrap2() { - return fn2.apply(thisArg, arguments); - }; -} -const { toString: toString$3 } = Object.prototype; -const { getPrototypeOf } = Object; -const kindOf = ((cache) => (thing) => { - const str = toString$3.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); -})(/* @__PURE__ */ Object.create(null)); -const kindOfTest = (type2) => { - type2 = type2.toLowerCase(); - return (thing) => kindOf(thing) === type2; -}; -const typeOfTest = (type2) => (thing) => typeof thing === type2; -const { isArray } = Array; -const isUndefined = typeOfTest("undefined"); -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); -} -const isArrayBuffer = kindOfTest("ArrayBuffer"); -function isArrayBufferView(val) { - let result; - if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; -} -const isString = typeOfTest("string"); -const isFunction = typeOfTest("function"); -const isNumber = typeOfTest("number"); -const isObject$1 = (thing) => thing !== null && typeof thing === "object"; -const isBoolean = (thing) => thing === true || thing === false; -const isPlainObject = (val) => { - if (kindOf(val) !== "object") { - return false; - } - const prototype2 = getPrototypeOf(val); - return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); -}; -const isDate = kindOfTest("Date"); -const isFile = kindOfTest("File"); -const isBlob = kindOfTest("Blob"); -const isFileList = kindOfTest("FileList"); -const isStream = (val) => isObject$1(val) && isFunction(val.pipe); -const isFormData = (thing) => { - let kind; - return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance - kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]")); -}; -const isURLSearchParams = kindOfTest("URLSearchParams"); -const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); -const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); -function forEach(obj, fn2, { allOwnKeys = false } = {}) { - if (obj === null || typeof obj === "undefined") { - return; - } - let i3; - let l2; - if (typeof obj !== "object") { - obj = [obj]; - } - if (isArray(obj)) { - for (i3 = 0, l2 = obj.length; i3 < l2; i3++) { - fn2.call(null, obj[i3], i3, obj); - } - } else { - const keys2 = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys2.length; - let key2; - for (i3 = 0; i3 < len; i3++) { - key2 = keys2[i3]; - fn2.call(null, obj[key2], key2, obj); - } - } -} -function findKey(obj, key2) { - key2 = key2.toLowerCase(); - const keys2 = Object.keys(obj); - let i3 = keys2.length; - let _key; - while (i3-- > 0) { - _key = keys2[i3]; - if (key2 === _key.toLowerCase()) { - return _key; - } - } - return null; -} -const _global = (() => { - if (typeof globalThis !== "undefined") - return globalThis; - return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; -})(); -const isContextDefined = (context) => !isUndefined(context) && context !== _global; -function merge() { - const { caseless } = isContextDefined(this) && this || {}; - const result = {}; - const assignValue = (val, key2) => { - const targetKey = caseless && findKey(result, key2) || key2; - if (isPlainObject(result[targetKey]) && isPlainObject(val)) { - result[targetKey] = merge(result[targetKey], val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else { - result[targetKey] = val; - } - }; - for (let i3 = 0, l2 = arguments.length; i3 < l2; i3++) { - arguments[i3] && forEach(arguments[i3], assignValue); - } - return result; -} -const extend = (a3, b2, thisArg, { allOwnKeys } = {}) => { - forEach(b2, (val, key2) => { - if (thisArg && isFunction(val)) { - a3[key2] = bind$1(val, thisArg); - } else { - a3[key2] = val; - } - }, { allOwnKeys }); - return a3; -}; -const stripBOM = (content) => { - if (content.charCodeAt(0) === 65279) { - content = content.slice(1); - } - return content; -}; -const inherits$3 = (constructor, superConstructor, props, descriptors2) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors2); - constructor.prototype.constructor = constructor; - Object.defineProperty(constructor, "super", { - value: superConstructor.prototype - }); - props && Object.assign(constructor.prototype, props); -}; -const toFlatObject = (sourceObj, destObj, filter2, propFilter) => { - let props; - let i3; - let prop; - const merged = {}; - destObj = destObj || {}; - if (sourceObj == null) - return destObj; - do { - props = Object.getOwnPropertyNames(sourceObj); - i3 = props.length; - while (i3-- > 0) { - prop = props[i3]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter2 !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype); - return destObj; -}; -const endsWith = (str, searchString, position) => { - str = String(str); - if (position === void 0 || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; -}; -const toArray = (thing) => { - if (!thing) - return null; - if (isArray(thing)) - return thing; - let i3 = thing.length; - if (!isNumber(i3)) - return null; - const arr = new Array(i3); - while (i3-- > 0) { - arr[i3] = thing[i3]; - } - return arr; -}; -const isTypedArray = ((TypedArray) => { - return (thing) => { - return TypedArray && thing instanceof TypedArray; - }; -})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); -const forEachEntry = (obj, fn2) => { - const generator = obj && obj[Symbol.iterator]; - const iterator = generator.call(obj); - let result; - while ((result = iterator.next()) && !result.done) { - const pair = result.value; - fn2.call(obj, pair[0], pair[1]); - } -}; -const matchAll = (regExp, str) => { - let matches2; - const arr = []; - while ((matches2 = regExp.exec(str)) !== null) { - arr.push(matches2); - } - return arr; -}; -const isHTMLForm = kindOfTest("HTMLFormElement"); -const toCamelCase = (str) => { - return str.toLowerCase().replace( - /[-_\s]([a-z\d])(\w*)/g, - function replacer(m3, p1, p22) { - return p1.toUpperCase() + p22; - } - ); -}; -const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); -const isRegExp = kindOfTest("RegExp"); -const reduceDescriptors = (obj, reducer) => { - const descriptors2 = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; - forEach(descriptors2, (descriptor, name2) => { - let ret; - if ((ret = reducer(descriptor, name2, obj)) !== false) { - reducedDescriptors[name2] = ret || descriptor; - } - }); - Object.defineProperties(obj, reducedDescriptors); -}; -const freezeMethods = (obj) => { - reduceDescriptors(obj, (descriptor, name2) => { - if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name2) !== -1) { - return false; - } - const value = obj[name2]; - if (!isFunction(value)) - return; - descriptor.enumerable = false; - if ("writable" in descriptor) { - descriptor.writable = false; - return; - } - if (!descriptor.set) { - descriptor.set = () => { - throw Error("Can not rewrite read-only method '" + name2 + "'"); - }; - } - }); -}; -const toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - const define2 = (arr) => { - arr.forEach((value) => { - obj[value] = true; - }); - }; - isArray(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter)); - return obj; -}; -const noop$1 = () => { -}; -const toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite(value = +value) ? value : defaultValue; -}; -const ALPHA = "abcdefghijklmnopqrstuvwxyz"; -const DIGIT = "0123456789"; -const ALPHABET = { - DIGIT, - ALPHA, - ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT -}; -const generateString = (size2 = 16, alphabet2 = ALPHABET.ALPHA_DIGIT) => { - let str = ""; - const { length } = alphabet2; - while (size2--) { - str += alphabet2[Math.random() * length | 0]; - } - return str; -}; -function isSpecCompliantForm(thing) { - return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]); -} -const toJSONObject = (obj) => { - const stack = new Array(10); - const visit = (source, i3) => { - if (isObject$1(source)) { - if (stack.indexOf(source) >= 0) { - return; - } - if (!("toJSON" in source)) { - stack[i3] = source; - const target = isArray(source) ? [] : {}; - forEach(source, (value, key2) => { - const reducedValue = visit(value, i3 + 1); - !isUndefined(reducedValue) && (target[key2] = reducedValue); - }); - stack[i3] = void 0; - return target; - } - } - return source; - }; - return visit(obj, 0); -}; -const isAsyncFn = kindOfTest("AsyncFunction"); -const isThenable = (thing) => thing && (isObject$1(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); -const _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - return postMessageSupported ? ((token2, callbacks) => { - _global.addEventListener("message", ({ source, data }) => { - if (source === _global && data === token2) { - callbacks.length && callbacks.shift()(); - } - }, false); - return (cb2) => { - callbacks.push(cb2); - _global.postMessage(token2, "*"); - }; - })(`axios@${Math.random()}`, []) : (cb2) => setTimeout(cb2); -})( - typeof setImmediate === "function", - isFunction(_global.postMessage) -); -const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; -const utils$j = { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject: isObject$1, - isPlainObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, - isUndefined, - isDate, - isFile, - isBlob, - isRegExp, - isFunction, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge, - extend, - trim, - stripBOM, - inherits: inherits$3, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty, - hasOwnProp: hasOwnProperty, - // an alias to avoid ESLint no-prototype-builtins detection - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop: noop$1, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - ALPHABET, - generateString, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap -}; -function AxiosError(message2, code2, config2, request, response) { - Error.call(this); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = new Error().stack; - } - this.message = message2; - this.name = "AxiosError"; - code2 && (this.code = code2); - config2 && (this.config = config2); - request && (this.request = request); - response && (this.response = response); -} -utils$j.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: utils$j.toJSONObject(this.config), - code: this.code, - status: this.response && this.response.status ? this.response.status : null - }; - } -}); -const prototype$1 = AxiosError.prototype; -const descriptors = {}; -[ - "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", - "ERR_NOT_SUPPORT", - "ERR_INVALID_URL" - // eslint-disable-next-line func-names -].forEach((code2) => { - descriptors[code2] = { value: code2 }; -}); -Object.defineProperties(AxiosError, descriptors); -Object.defineProperty(prototype$1, "isAxiosError", { value: true }); -AxiosError.from = (error, code2, config2, request, response, customProps) => { - const axiosError = Object.create(prototype$1); - utils$j.toFlatObject(error, axiosError, function filter2(obj) { - return obj !== Error.prototype; - }, (prop) => { - return prop !== "isAxiosError"; - }); - AxiosError.call(axiosError, error.message, code2, config2, request, response); - axiosError.cause = error; - axiosError.name = error.name; - customProps && Object.assign(axiosError, customProps); - return axiosError; -}; -const httpAdapter = null; -function isVisitable(thing) { - return utils$j.isPlainObject(thing) || utils$j.isArray(thing); -} -function removeBrackets(key2) { - return utils$j.endsWith(key2, "[]") ? key2.slice(0, -2) : key2; -} -function renderKey(path, key2, dots) { - if (!path) - return key2; - return path.concat(key2).map(function each(token2, i3) { - token2 = removeBrackets(token2); - return !dots && i3 ? "[" + token2 + "]" : token2; - }).join(dots ? "." : ""); -} -function isFlatArray(arr) { - return utils$j.isArray(arr) && !arr.some(isVisitable); -} -const predicates = utils$j.toFlatObject(utils$j, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); -}); -function toFormData(obj, formData, options) { - if (!utils$j.isObject(obj)) { - throw new TypeError("target must be an object"); - } - formData = formData || new FormData(); - options = utils$j.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - return !utils$j.isUndefined(source[option]); - }); - const metaTokens = options.metaTokens; - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; - const useBlob = _Blob && utils$j.isSpecCompliantForm(formData); - if (!utils$j.isFunction(visitor)) { - throw new TypeError("visitor must be a function"); - } - function convertValue(value) { - if (value === null) - return ""; - if (utils$j.isDate(value)) { - return value.toISOString(); - } - if (!useBlob && utils$j.isBlob(value)) { - throw new AxiosError("Blob is not supported. Use a Buffer instead."); - } - if (utils$j.isArrayBuffer(value) || utils$j.isTypedArray(value)) { - return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); - } - return value; - } - function defaultVisitor(value, key2, path) { - let arr = value; - if (value && !path && typeof value === "object") { - if (utils$j.endsWith(key2, "{}")) { - key2 = metaTokens ? key2 : key2.slice(0, -2); - value = JSON.stringify(value); - } else if (utils$j.isArray(value) && isFlatArray(value) || (utils$j.isFileList(value) || utils$j.endsWith(key2, "[]")) && (arr = utils$j.toArray(value))) { - key2 = removeBrackets(key2); - arr.forEach(function each(el2, index2) { - !(utils$j.isUndefined(el2) || el2 === null) && formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true ? renderKey([key2], index2, dots) : indexes === null ? key2 : key2 + "[]", - convertValue(el2) - ); - }); - return false; - } - } - if (isVisitable(value)) { - return true; - } - formData.append(renderKey(path, key2, dots), convertValue(value)); - return false; - } - const stack = []; - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable - }); - function build(value, path) { - if (utils$j.isUndefined(value)) - return; - if (stack.indexOf(value) !== -1) { - throw Error("Circular reference detected in " + path.join(".")); - } - stack.push(value); - utils$j.forEach(value, function each(el2, key2) { - const result = !(utils$j.isUndefined(el2) || el2 === null) && visitor.call( - formData, - el2, - utils$j.isString(key2) ? key2.trim() : key2, - path, - exposedHelpers - ); - if (result === true) { - build(el2, path ? path.concat(key2) : [key2]); - } - }); - stack.pop(); - } - if (!utils$j.isObject(obj)) { - throw new TypeError("data must be an object"); - } - build(obj); - return formData; -} -function encode$3(str) { - const charMap = { - "!": "%21", - "'": "%27", - "(": "%28", - ")": "%29", - "~": "%7E", - "%20": "+", - "%00": "\0" - }; - return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { - return charMap[match]; - }); -} -function AxiosURLSearchParams(params, options) { - this._pairs = []; - params && toFormData(params, this, options); -} -const prototype = AxiosURLSearchParams.prototype; -prototype.append = function append(name2, value) { - this._pairs.push([name2, value]); -}; -prototype.toString = function toString2(encoder2) { - const _encode4 = encoder2 ? function(value) { - return encoder2.call(this, value, encode$3); - } : encode$3; - return this._pairs.map(function each(pair) { - return _encode4(pair[0]) + "=" + _encode4(pair[1]); - }, "").join("&"); -}; -function encode$2(val) { - return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); -} -function buildURL(url, params, options) { - if (!params) { - return url; - } - const _encode4 = options && options.encode || encode$2; - const serializeFn = options && options.serialize; - let serializedParams; - if (serializeFn) { - serializedParams = serializeFn(params, options); - } else { - serializedParams = utils$j.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode4); - } - if (serializedParams) { - const hashmarkIndex = url.indexOf("#"); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; - } - return url; -} -class InterceptorManager { - constructor() { - this.handlers = []; - } - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; - } - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise - */ - eject(id2) { - if (this.handlers[id2]) { - this.handlers[id2] = null; - } - } - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn2) { - utils$j.forEach(this.handlers, function forEachHandler(h4) { - if (h4 !== null) { - fn2(h4); - } - }); - } -} -const InterceptorManager$1 = InterceptorManager; -const transitionalDefaults = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false -}; -const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams; -const FormData$1 = typeof FormData !== "undefined" ? FormData : null; -const Blob$1 = typeof Blob !== "undefined" ? Blob : null; -const platform$1 = { - isBrowser: true, - classes: { - URLSearchParams: URLSearchParams$1, - FormData: FormData$1, - Blob: Blob$1 - }, - protocols: ["http", "https", "file", "blob", "url", "data"] -}; -const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; -const hasStandardBrowserEnv = ((product) => { - return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0; -})(typeof navigator !== "undefined" && navigator.product); -const hasStandardBrowserWebWorkerEnv = (() => { - return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; -})(); -const origin = hasBrowserEnv && window.location.href || "http://localhost"; -const utils$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - hasBrowserEnv, - hasStandardBrowserEnv, - hasStandardBrowserWebWorkerEnv, - origin -}, Symbol.toStringTag, { value: "Module" })); -const platform = { - ...utils$i, - ...platform$1 -}; -function toURLEncodedForm(data, options) { - return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ - visitor: function(value, key2, path, helpers) { - if (platform.isNode && utils$j.isBuffer(value)) { - this.append(key2, value.toString("base64")); - return false; - } - return helpers.defaultVisitor.apply(this, arguments); - } - }, options)); -} -function parsePropPath(name2) { - return utils$j.matchAll(/\w+|\[(\w*)]/g, name2).map((match) => { - return match[0] === "[]" ? "" : match[1] || match[0]; - }); -} -function arrayToObject(arr) { - const obj = {}; - const keys2 = Object.keys(arr); - let i3; - const len = keys2.length; - let key2; - for (i3 = 0; i3 < len; i3++) { - key2 = keys2[i3]; - obj[key2] = arr[key2]; - } - return obj; -} -function formDataToJSON(formData) { - function buildPath(path, value, target, index2) { - let name2 = path[index2++]; - if (name2 === "__proto__") - return true; - const isNumericKey = Number.isFinite(+name2); - const isLast = index2 >= path.length; - name2 = !name2 && utils$j.isArray(target) ? target.length : name2; - if (isLast) { - if (utils$j.hasOwnProp(target, name2)) { - target[name2] = [target[name2], value]; - } else { - target[name2] = value; - } - return !isNumericKey; - } - if (!target[name2] || !utils$j.isObject(target[name2])) { - target[name2] = []; - } - const result = buildPath(path, value, target[name2], index2); - if (result && utils$j.isArray(target[name2])) { - target[name2] = arrayToObject(target[name2]); - } - return !isNumericKey; - } - if (utils$j.isFormData(formData) && utils$j.isFunction(formData.entries)) { - const obj = {}; - utils$j.forEachEntry(formData, (name2, value) => { - buildPath(parsePropPath(name2), value, obj, 0); - }); - return obj; - } - return null; -} -function stringifySafely(rawValue, parser, encoder2) { - if (utils$j.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils$j.trim(rawValue); - } catch (e18) { - if (e18.name !== "SyntaxError") { - throw e18; - } - } - } - return (encoder2 || JSON.stringify)(rawValue); -} -const defaults = { - transitional: transitionalDefaults, - adapter: ["xhr", "http", "fetch"], - transformRequest: [function transformRequest(data, headers) { - const contentType = headers.getContentType() || ""; - const hasJSONContentType = contentType.indexOf("application/json") > -1; - const isObjectPayload = utils$j.isObject(data); - if (isObjectPayload && utils$j.isHTMLForm(data)) { - data = new FormData(data); - } - const isFormData2 = utils$j.isFormData(data); - if (isFormData2) { - return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - } - if (utils$j.isArrayBuffer(data) || utils$j.isBuffer(data) || utils$j.isStream(data) || utils$j.isFile(data) || utils$j.isBlob(data) || utils$j.isReadableStream(data)) { - return data; - } - if (utils$j.isArrayBufferView(data)) { - return data.buffer; - } - if (utils$j.isURLSearchParams(data)) { - headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); - return data.toString(); - } - let isFileList2; - if (isObjectPayload) { - if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { - return toURLEncodedForm(data, this.formSerializer).toString(); - } - if ((isFileList2 = utils$j.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { - const _FormData = this.env && this.env.FormData; - return toFormData( - isFileList2 ? { "files[]": data } : data, - _FormData && new _FormData(), - this.formSerializer - ); - } - } - if (isObjectPayload || hasJSONContentType) { - headers.setContentType("application/json", false); - return stringifySafely(data); - } - return data; - }], - transformResponse: [function transformResponse(data) { - const transitional2 = this.transitional || defaults.transitional; - const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing; - const JSONRequested = this.responseType === "json"; - if (utils$j.isResponse(data) || utils$j.isReadableStream(data)) { - return data; - } - if (data && utils$j.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { - const silentJSONParsing = transitional2 && transitional2.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - try { - return JSON.parse(data); - } catch (e18) { - if (strictJSONParsing) { - if (e18.name === "SyntaxError") { - throw AxiosError.from(e18, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); - } - throw e18; - } - } - } - return data; - }], - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - xsrfCookieName: "XSRF-TOKEN", - xsrfHeaderName: "X-XSRF-TOKEN", - maxContentLength: -1, - maxBodyLength: -1, - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob - }, - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - headers: { - common: { - "Accept": "application/json, text/plain, */*", - "Content-Type": void 0 - } - } -}; -utils$j.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { - defaults.headers[method] = {}; -}); -const defaults$1 = defaults; -const ignoreDuplicateOf = utils$j.toObjectSet([ - "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" -]); -const parseHeaders = (rawHeaders) => { - const parsed = {}; - let key2; - let val; - let i3; - rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { - i3 = line.indexOf(":"); - key2 = line.substring(0, i3).trim().toLowerCase(); - val = line.substring(i3 + 1).trim(); - if (!key2 || parsed[key2] && ignoreDuplicateOf[key2]) { - return; - } - if (key2 === "set-cookie") { - if (parsed[key2]) { - parsed[key2].push(val); - } else { - parsed[key2] = [val]; - } - } else { - parsed[key2] = parsed[key2] ? parsed[key2] + ", " + val : val; - } - }); - return parsed; -}; -const $internals = Symbol("internals"); -function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); -} -function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - return utils$j.isArray(value) ? value.map(normalizeValue) : String(value); -} -function parseTokens(str) { - const tokens = /* @__PURE__ */ Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - while (match = tokensRE.exec(str)) { - tokens[match[1]] = match[2]; - } - return tokens; -} -const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); -function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) { - if (utils$j.isFunction(filter2)) { - return filter2.call(this, value, header); - } - if (isHeaderNameFilter) { - value = header; - } - if (!utils$j.isString(value)) - return; - if (utils$j.isString(filter2)) { - return value.indexOf(filter2) !== -1; - } - if (utils$j.isRegExp(filter2)) { - return filter2.test(value); - } -} -function formatHeader(header) { - return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w2, char, str) => { - return char.toUpperCase() + str; - }); -} -function buildAccessors(obj, header) { - const accessorName = utils$j.toCamelCase(" " + header); - ["get", "set", "has"].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - value: function(arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); - }); -} -class AxiosHeaders { - constructor(headers) { - headers && this.set(headers); - } - set(header, valueOrRewrite, rewrite) { - const self2 = this; - function setHeader(_value2, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - if (!lHeader) { - throw new Error("header name must be a non-empty string"); - } - const key2 = utils$j.findKey(self2, lHeader); - if (!key2 || self2[key2] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key2] !== false) { - self2[key2 || _header] = normalizeValue(_value2); - } - } - const setHeaders = (headers, _rewrite) => utils$j.forEach(headers, (_value2, _header) => setHeader(_value2, _header, _rewrite)); - if (utils$j.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils$j.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$j.isHeaders(header)) { - for (const [key2, value] of header.entries()) { - setHeader(value, key2, rewrite); - } - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - return this; - } - get(header, parser) { - header = normalizeHeader(header); - if (header) { - const key2 = utils$j.findKey(this, header); - if (key2) { - const value = this[key2]; - if (!parser) { - return value; - } - if (parser === true) { - return parseTokens(value); - } - if (utils$j.isFunction(parser)) { - return parser.call(this, value, key2); - } - if (utils$j.isRegExp(parser)) { - return parser.exec(value); - } - throw new TypeError("parser must be boolean|regexp|function"); - } - } - } - has(header, matcher) { - header = normalizeHeader(header); - if (header) { - const key2 = utils$j.findKey(this, header); - return !!(key2 && this[key2] !== void 0 && (!matcher || matchHeaderValue(this, this[key2], key2, matcher))); - } - return false; - } - delete(header, matcher) { - const self2 = this; - let deleted = false; - function deleteHeader(_header) { - _header = normalizeHeader(_header); - if (_header) { - const key2 = utils$j.findKey(self2, _header); - if (key2 && (!matcher || matchHeaderValue(self2, self2[key2], key2, matcher))) { - delete self2[key2]; - deleted = true; - } - } - } - if (utils$j.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - return deleted; - } - clear(matcher) { - const keys2 = Object.keys(this); - let i3 = keys2.length; - let deleted = false; - while (i3--) { - const key2 = keys2[i3]; - if (!matcher || matchHeaderValue(this, this[key2], key2, matcher, true)) { - delete this[key2]; - deleted = true; - } - } - return deleted; - } - normalize(format2) { - const self2 = this; - const headers = {}; - utils$j.forEach(this, (value, header) => { - const key2 = utils$j.findKey(headers, header); - if (key2) { - self2[key2] = normalizeValue(value); - delete self2[header]; - return; - } - const normalized = format2 ? formatHeader(header) : String(header).trim(); - if (normalized !== header) { - delete self2[header]; - } - self2[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - toJSON(asStrings) { - const obj = /* @__PURE__ */ Object.create(null); - utils$j.forEach(this, (value, header) => { - value != null && value !== false && (obj[header] = asStrings && utils$j.isArray(value) ? value.join(", ") : value); - }); - return obj; - } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); - } - get [Symbol.toStringTag]() { - return "AxiosHeaders"; - } - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - static concat(first, ...targets) { - const computed = new this(first); - targets.forEach((target) => computed.set(target)); - return computed; - } - static accessor(header) { - const internals = this[$internals] = this[$internals] = { - accessors: {} - }; - const accessors = internals.accessors; - const prototype2 = this.prototype; - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype2, _header); - accessors[lHeader] = true; - } - } - utils$j.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - return this; - } -} -AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); -utils$j.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key2) => { - let mapped = key2[0].toUpperCase() + key2.slice(1); - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - } - }; -}); -utils$j.freezeMethods(AxiosHeaders); -const AxiosHeaders$1 = AxiosHeaders; -function transformData(fns, response) { - const config2 = this || defaults$1; - const context = response || config2; - const headers = AxiosHeaders$1.from(context.headers); - let data = context.data; - utils$j.forEach(fns, function transform(fn2) { - data = fn2.call(config2, data, headers.normalize(), response ? response.status : void 0); - }); - headers.normalize(); - return data; -} -function isCancel(value) { - return !!(value && value.__CANCEL__); -} -function CanceledError(message2, config2, request) { - AxiosError.call(this, message2 == null ? "canceled" : message2, AxiosError.ERR_CANCELED, config2, request); - this.name = "CanceledError"; -} -utils$j.inherits(CanceledError, AxiosError, { - __CANCEL__: true -}); -function settle(resolve, reject, response) { - const validateStatus2 = response.config.validateStatus; - if (!response.status || !validateStatus2 || validateStatus2(response.status)) { - resolve(response); - } else { - reject(new AxiosError( - "Request failed with status code " + response.status, - [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); - } -} -function parseProtocol(url) { - const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); - return match && match[1] || ""; -} -function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes2 = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - min = min !== void 0 ? min : 1e3; - return function push(chunkLength) { - const now = Date.now(); - const startedAt = timestamps[tail]; - if (!firstSampleTS) { - firstSampleTS = now; - } - bytes2[head] = chunkLength; - timestamps[head] = now; - let i3 = tail; - let bytesCount = 0; - while (i3 !== head) { - bytesCount += bytes2[i3++]; - i3 = i3 % samplesCount; - } - head = (head + 1) % samplesCount; - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - if (now - firstSampleTS < min) { - return; - } - const passed = startedAt && now - startedAt; - return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; - }; -} -function throttle(fn2, freq) { - let timestamp = 0; - let threshold = 1e3 / freq; - let lastArgs; - let timer2; - const invoke = (args, now = Date.now()) => { - timestamp = now; - lastArgs = null; - if (timer2) { - clearTimeout(timer2); - timer2 = null; - } - fn2.apply(null, args); - }; - const throttled = (...args) => { - const now = Date.now(); - const passed = now - timestamp; - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer2) { - timer2 = setTimeout(() => { - timer2 = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; -} -const progressEventReducer = (listener, isDownloadStream, freq = 3) => { - let bytesNotified = 0; - const _speedometer = speedometer(50, 250); - return throttle((e18) => { - const loaded = e18.loaded; - const total = e18.lengthComputable ? e18.total : void 0; - const progressBytes = loaded - bytesNotified; - const rate = _speedometer(progressBytes); - const inRange2 = loaded <= total; - bytesNotified = loaded; - const data = { - loaded, - total, - progress: total ? loaded / total : void 0, - bytes: progressBytes, - rate: rate ? rate : void 0, - estimated: rate && total && inRange2 ? (total - loaded) / rate : void 0, - event: e18, - lengthComputable: total != null, - [isDownloadStream ? "download" : "upload"]: true - }; - listener(data); - }, freq); -}; -const progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - return [(loaded) => throttled[0]({ - lengthComputable, - total, - loaded - }), throttled[1]]; -}; -const asyncDecorator = (fn2) => (...args) => utils$j.asap(() => fn2(...args)); -const isURLSameOrigin = platform.hasStandardBrowserEnv ? ( - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - function standardBrowserEnv() { - const msie = /(msie|trident)/i.test(navigator.userAgent); - const urlParsingNode = document.createElement("a"); - let originURL; - function resolveURL(url) { - let href = url; - if (msie) { - urlParsingNode.setAttribute("href", href); - href = urlParsingNode.href; - } - urlParsingNode.setAttribute("href", href); - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "", - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "", - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "", - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname - }; - } - originURL = resolveURL(window.location.href); - return function isURLSameOrigin2(requestURL) { - const parsed = utils$j.isString(requestURL) ? resolveURL(requestURL) : requestURL; - return parsed.protocol === originURL.protocol && parsed.host === originURL.host; - }; - }() -) : ( - // Non standard browser envs (web workers, react-native) lack needed support. - function nonStandardBrowserEnv() { - return function isURLSameOrigin2() { - return true; - }; - }() -); -const cookies = platform.hasStandardBrowserEnv ? ( - // Standard browser envs support document.cookie - { - write(name2, value, expires, path, domain, secure) { - const cookie = [name2 + "=" + encodeURIComponent(value)]; - utils$j.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString()); - utils$j.isString(path) && cookie.push("path=" + path); - utils$j.isString(domain) && cookie.push("domain=" + domain); - secure === true && cookie.push("secure"); - document.cookie = cookie.join("; "); - }, - read(name2) { - const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)")); - return match ? decodeURIComponent(match[3]) : null; - }, - remove(name2) { - this.write(name2, "", Date.now() - 864e5); - } - } -) : ( - // Non-standard browser env (web workers, react-native) lack needed support. - { - write() { - }, - read() { - return null; - }, - remove() { - } - } -); -function isAbsoluteURL(url) { - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); -} -function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; -} -function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -} -const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; -function mergeConfig(config1, config2) { - config2 = config2 || {}; - const config3 = {}; - function getMergedValue(target, source, caseless) { - if (utils$j.isPlainObject(target) && utils$j.isPlainObject(source)) { - return utils$j.merge.call({ caseless }, target, source); - } else if (utils$j.isPlainObject(source)) { - return utils$j.merge({}, source); - } else if (utils$j.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(a3, b2, caseless) { - if (!utils$j.isUndefined(b2)) { - return getMergedValue(a3, b2, caseless); - } else if (!utils$j.isUndefined(a3)) { - return getMergedValue(void 0, a3, caseless); - } - } - function valueFromConfig2(a3, b2) { - if (!utils$j.isUndefined(b2)) { - return getMergedValue(void 0, b2); - } - } - function defaultToConfig2(a3, b2) { - if (!utils$j.isUndefined(b2)) { - return getMergedValue(void 0, b2); - } else if (!utils$j.isUndefined(a3)) { - return getMergedValue(void 0, a3); - } - } - function mergeDirectKeys(a3, b2, prop) { - if (prop in config2) { - return getMergedValue(a3, b2); - } else if (prop in config1) { - return getMergedValue(void 0, a3); - } - } - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a3, b2) => mergeDeepProperties(headersToObject(a3), headersToObject(b2), true) - }; - utils$j.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { - const merge2 = mergeMap[prop] || mergeDeepProperties; - const configValue = merge2(config1[prop], config2[prop], prop); - utils$j.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config3[prop] = configValue); - }); - return config3; -} -const resolveConfig = (config2) => { - const newConfig = mergeConfig({}, config2); - let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; - newConfig.headers = headers = AxiosHeaders$1.from(headers); - newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config2.params, config2.paramsSerializer); - if (auth) { - headers.set( - "Authorization", - "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) - ); - } - let contentType; - if (utils$j.isFormData(data)) { - if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { - headers.setContentType(void 0); - } else if ((contentType = headers.getContentType()) !== false) { - const [type2, ...tokens] = contentType ? contentType.split(";").map((token2) => token2.trim()).filter(Boolean) : []; - headers.setContentType([type2 || "multipart/form-data", ...tokens].join("; ")); - } - } - if (platform.hasStandardBrowserEnv) { - withXSRFToken && utils$j.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); - if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - return newConfig; -}; -const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; -const xhrAdapter = isXHRAdapterSupported && function(config2) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - const _config = resolveConfig(config2); - let requestData = _config.data; - const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; - let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; - function done() { - flushUpload && flushUpload(); - flushDownload && flushDownload(); - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - _config.signal && _config.signal.removeEventListener("abort", onCanceled); - } - let request = new XMLHttpRequest(); - request.open(_config.method.toUpperCase(), _config.url, true); - request.timeout = _config.timeout; - function onloadend() { - if (!request) { - return; - } - const responseHeaders = AxiosHeaders$1.from( - "getAllResponseHeaders" in request && request.getAllResponseHeaders() - ); - const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config2, - request - }; - settle(function _resolve(value) { - resolve(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); - request = null; - } - if ("onloadend" in request) { - request.onloadend = onloadend; - } else { - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { - return; - } - setTimeout(onloadend); - }; - } - request.onabort = function handleAbort() { - if (!request) { - return; - } - reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config2, request)); - request = null; - }; - request.onerror = function handleError() { - reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config2, request)); - request = null; - }; - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional2 = _config.transitional || transitionalDefaults; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject(new AxiosError( - timeoutErrorMessage, - transitional2.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config2, - request - )); - request = null; - }; - requestData === void 0 && requestHeaders.setContentType(null); - if ("setRequestHeader" in request) { - utils$j.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key2) { - request.setRequestHeader(key2, val); - }); - } - if (!utils$j.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - if (responseType && responseType !== "json") { - request.responseType = _config.responseType; - } - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request.addEventListener("progress", downloadThrottled); - } - if (onUploadProgress && request.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - request.upload.addEventListener("progress", uploadThrottled); - request.upload.addEventListener("loadend", flushUpload); - } - if (_config.cancelToken || _config.signal) { - onCanceled = (cancel) => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError(null, config2, request) : cancel); - request.abort(); - request = null; - }; - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); - } - } - const protocol = parseProtocol(_config.url); - if (protocol && platform.protocols.indexOf(protocol) === -1) { - reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config2)); - return; - } - request.send(requestData || null); - }); -}; -const composeSignals = (signals, timeout) => { - let controller = new AbortController(); - let aborted; - const onabort = function(cancel) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = cancel instanceof Error ? cancel : this.reason; - controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); - } - }; - let timer2 = timeout && setTimeout(() => { - onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); - }, timeout); - const unsubscribe = () => { - if (signals) { - timer2 && clearTimeout(timer2); - timer2 = null; - signals.forEach((signal2) => { - signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort)); - }); - signals = null; - } - }; - signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort)); - const { signal } = controller; - signal.unsubscribe = unsubscribe; - return [signal, () => { - timer2 && clearTimeout(timer2); - timer2 = null; - }]; -}; -const composeSignals$1 = composeSignals; -const streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - if (!chunkSize || len < chunkSize) { - yield chunk; - return; - } - let pos = 0; - let end; - while (pos < len) { - end = pos + chunkSize; - yield chunk.slice(pos, end); - pos = end; - } -}; -const readBytes = async function* (iterable, chunkSize, encode5) { - for await (const chunk of iterable) { - yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : await encode5(String(chunk)), chunkSize); - } -}; -const trackStream = (stream2, chunkSize, onProgress, onFinish, encode5) => { - const iterator = readBytes(stream2, chunkSize, encode5); - let bytes2 = 0; - let done; - let _onFinish = (e18) => { - if (!done) { - done = true; - onFinish && onFinish(e18); - } - }; - return new ReadableStream({ - async pull(controller) { - try { - const { done: done2, value } = await iterator.next(); - if (done2) { - _onFinish(); - controller.close(); - return; - } - let len = value.byteLength; - if (onProgress) { - let loadedBytes = bytes2 += len; - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }, - cancel(reason) { - _onFinish(reason); - return iterator.return(); - } - }, { - highWaterMark: 2 - }); -}; -const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function"; -const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function"; -const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder2) => (str) => encoder2.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer())); -const test = (fn2, ...args) => { - try { - return !!fn2(...args); - } catch (e18) { - return false; - } -}; -const supportsRequestStream = isReadableStreamSupported && test(() => { - let duplexAccessed = false; - const hasContentType = new Request(platform.origin, { - body: new ReadableStream(), - method: "POST", - get duplex() { - duplexAccessed = true; - return "half"; - } - }).headers.has("Content-Type"); - return duplexAccessed && !hasContentType; -}); -const DEFAULT_CHUNK_SIZE = 64 * 1024; -const supportsResponseStream = isReadableStreamSupported && test(() => utils$j.isReadableStream(new Response("").body)); -const resolvers = { - stream: supportsResponseStream && ((res) => res.body) -}; -isFetchSupported && ((res) => { - ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type2) => { - !resolvers[type2] && (resolvers[type2] = utils$j.isFunction(res[type2]) ? (res2) => res2[type2]() : (_3, config2) => { - throw new AxiosError(`Response type '${type2}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config2); - }); - }); -})(new Response()); -const getBodyLength = async (body) => { - if (body == null) { - return 0; - } - if (utils$j.isBlob(body)) { - return body.size; - } - if (utils$j.isSpecCompliantForm(body)) { - return (await new Request(body).arrayBuffer()).byteLength; - } - if (utils$j.isArrayBufferView(body) || utils$j.isArrayBuffer(body)) { - return body.byteLength; - } - if (utils$j.isURLSearchParams(body)) { - body = body + ""; - } - if (utils$j.isString(body)) { - return (await encodeText(body)).byteLength; - } -}; -const resolveBodyLength = async (headers, body) => { - const length = utils$j.toFiniteNumber(headers.getContentLength()); - return length == null ? getBodyLength(body) : length; -}; -const fetchAdapter = isFetchSupported && (async (config2) => { - let { - url, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = "same-origin", - fetchOptions - } = resolveConfig(config2); - responseType = responseType ? (responseType + "").toLowerCase() : "text"; - let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals$1([signal, cancelToken], timeout) : []; - let finished2, request; - const onFinish = () => { - !finished2 && setTimeout(() => { - composedSignal && composedSignal.unsubscribe(); - }); - finished2 = true; - }; - let requestContentLength; - try { - if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { - let _request = new Request(url, { - method: "POST", - body: data, - duplex: "half" - }); - let contentTypeHeader; - if (utils$j.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { - headers.setContentType(contentTypeHeader); - } - if (_request.body) { - const [onProgress, flush] = progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - ); - data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText); - } - } - if (!utils$j.isString(withCredentials)) { - withCredentials = withCredentials ? "include" : "omit"; - } - request = new Request(url, { - ...fetchOptions, - signal: composedSignal, - method: method.toUpperCase(), - headers: headers.normalize().toJSON(), - body: data, - duplex: "half", - credentials: withCredentials - }); - let response = await fetch(request); - const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); - if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) { - const options = {}; - ["status", "statusText", "headers"].forEach((prop) => { - options[prop] = response[prop]; - }); - const responseContentLength = utils$j.toFiniteNumber(response.headers.get("content-length")); - const [onProgress, flush] = onDownloadProgress && progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - ) || []; - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { - flush && flush(); - isStreamResponse && onFinish(); - }, encodeText), - options - ); - } - responseType = responseType || "text"; - let responseData = await resolvers[utils$j.findKey(resolvers, responseType) || "text"](response, config2); - !isStreamResponse && onFinish(); - stopTimeout && stopTimeout(); - return await new Promise((resolve, reject) => { - settle(resolve, reject, { - data: responseData, - headers: AxiosHeaders$1.from(response.headers), - status: response.status, - statusText: response.statusText, - config: config2, - request - }); - }); - } catch (err) { - onFinish(); - if (err && err.name === "TypeError" && /fetch/i.test(err.message)) { - throw Object.assign( - new AxiosError("Network Error", AxiosError.ERR_NETWORK, config2, request), - { - cause: err.cause || err - } - ); - } - throw AxiosError.from(err, err && err.code, config2, request); - } -}); -const knownAdapters = { - http: httpAdapter, - xhr: xhrAdapter, - fetch: fetchAdapter -}; -utils$j.forEach(knownAdapters, (fn2, value) => { - if (fn2) { - try { - Object.defineProperty(fn2, "name", { value }); - } catch (e18) { - } - Object.defineProperty(fn2, "adapterName", { value }); - } -}); -const renderReason = (reason) => `- ${reason}`; -const isResolvedHandle = (adapter) => utils$j.isFunction(adapter) || adapter === null || adapter === false; -const adapters = { - getAdapter: (adapters2) => { - adapters2 = utils$j.isArray(adapters2) ? adapters2 : [adapters2]; - const { length } = adapters2; - let nameOrAdapter; - let adapter; - const rejectedReasons = {}; - for (let i3 = 0; i3 < length; i3++) { - nameOrAdapter = adapters2[i3]; - let id2; - adapter = nameOrAdapter; - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id2 = String(nameOrAdapter)).toLowerCase()]; - if (adapter === void 0) { - throw new AxiosError(`Unknown adapter '${id2}'`); - } - } - if (adapter) { - break; - } - rejectedReasons[id2 || "#" + i3] = adapter; - } - if (!adapter) { - const reasons = Object.entries(rejectedReasons).map( - ([id2, state]) => `adapter ${id2} ` + (state === false ? "is not supported by the environment" : "is not available in the build") - ); - let s2 = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; - throw new AxiosError( - `There is no suitable adapter to dispatch the request ` + s2, - "ERR_NOT_SUPPORT" - ); - } - return adapter; - }, - adapters: knownAdapters -}; -function throwIfCancellationRequested(config2) { - if (config2.cancelToken) { - config2.cancelToken.throwIfRequested(); - } - if (config2.signal && config2.signal.aborted) { - throw new CanceledError(null, config2); - } -} -function dispatchRequest(config2) { - throwIfCancellationRequested(config2); - config2.headers = AxiosHeaders$1.from(config2.headers); - config2.data = transformData.call( - config2, - config2.transformRequest - ); - if (["post", "put", "patch"].indexOf(config2.method) !== -1) { - config2.headers.setContentType("application/x-www-form-urlencoded", false); - } - const adapter = adapters.getAdapter(config2.adapter || defaults$1.adapter); - return adapter(config2).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config2); - response.data = transformData.call( - config2, - config2.transformResponse, - response - ); - response.headers = AxiosHeaders$1.from(response.headers); - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config2); - if (reason && reason.response) { - reason.response.data = transformData.call( - config2, - config2.transformResponse, - reason.response - ); - reason.response.headers = AxiosHeaders$1.from(reason.response.headers); - } - } - return Promise.reject(reason); - }); -} -const VERSION = "1.7.4"; -const validators$1 = {}; -["object", "boolean", "number", "function", "string", "symbol"].forEach((type2, i3) => { - validators$1[type2] = function validator2(thing) { - return typeof thing === type2 || "a" + (i3 < 1 ? "n " : " ") + type2; - }; -}); -const deprecatedWarnings = {}; -validators$1.transitional = function transitional(validator2, version2, message2) { - function formatMessage(opt, desc) { - return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message2 ? ". " + message2 : ""); - } - return (value, opt, opts) => { - if (validator2 === false) { - throw new AxiosError( - formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")), - AxiosError.ERR_DEPRECATED - ); - } - if (version2 && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - console.warn( - formatMessage( - opt, - " has been deprecated since v" + version2 + " and will be removed in the near future" - ) - ); - } - return validator2 ? validator2(value, opt, opts) : true; - }; -}; -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== "object") { - throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE); - } - const keys2 = Object.keys(options); - let i3 = keys2.length; - while (i3-- > 0) { - const opt = keys2[i3]; - const validator2 = schema[opt]; - if (validator2) { - const value = options[opt]; - const result = value === void 0 || validator2(value, opt, options); - if (result !== true) { - throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION); - } - } -} -const validator = { - assertOptions, - validators: validators$1 -}; -const validators = validator.validators; -class Axios { - constructor(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager$1(), - response: new InterceptorManager$1() - }; - } - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - async request(configOrUrl, config2) { - try { - return await this._request(configOrUrl, config2); - } catch (err) { - if (err instanceof Error) { - let dummy; - Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error(); - const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; - try { - if (!err.stack) { - err.stack = stack; - } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { - err.stack += "\n" + stack; - } - } catch (e18) { - } - } - throw err; - } - } - _request(configOrUrl, config2) { - if (typeof configOrUrl === "string") { - config2 = config2 || {}; - config2.url = configOrUrl; - } else { - config2 = configOrUrl || {}; - } - config2 = mergeConfig(this.defaults, config2); - const { transitional: transitional2, paramsSerializer, headers } = config2; - if (transitional2 !== void 0) { - validator.assertOptions(transitional2, { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean) - }, false); - } - if (paramsSerializer != null) { - if (utils$j.isFunction(paramsSerializer)) { - config2.paramsSerializer = { - serialize: paramsSerializer - }; - } else { - validator.assertOptions(paramsSerializer, { - encode: validators.function, - serialize: validators.function - }, true); - } - } - config2.method = (config2.method || this.defaults.method || "get").toLowerCase(); - let contextHeaders = headers && utils$j.merge( - headers.common, - headers[config2.method] - ); - headers && utils$j.forEach( - ["delete", "get", "head", "post", "put", "patch", "common"], - (method) => { - delete headers[method]; - } - ); - config2.headers = AxiosHeaders$1.concat(contextHeaders, headers); - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) { - return; - } - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - let promise; - let i3 = 0; - let len; - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), void 0]; - chain.unshift.apply(chain, requestInterceptorChain); - chain.push.apply(chain, responseInterceptorChain); - len = chain.length; - promise = Promise.resolve(config2); - while (i3 < len) { - promise = promise.then(chain[i3++], chain[i3++]); - } - return promise; - } - len = requestInterceptorChain.length; - let newConfig = config2; - i3 = 0; - while (i3 < len) { - const onFulfilled = requestInterceptorChain[i3++]; - const onRejected = requestInterceptorChain[i3++]; - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected.call(this, error); - break; - } - } - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - return Promise.reject(error); - } - i3 = 0; - len = responseInterceptorChain.length; - while (i3 < len) { - promise = promise.then(responseInterceptorChain[i3++], responseInterceptorChain[i3++]); - } - return promise; - } - getUri(config2) { - config2 = mergeConfig(this.defaults, config2); - const fullPath = buildFullPath(config2.baseURL, config2.url); - return buildURL(fullPath, config2.params, config2.paramsSerializer); - } -} -utils$j.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { - Axios.prototype[method] = function(url, config2) { - return this.request(mergeConfig(config2 || {}, { - method, - url, - data: (config2 || {}).data - })); - }; -}); -utils$j.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config2) { - return this.request(mergeConfig(config2 || {}, { - method, - headers: isForm ? { - "Content-Type": "multipart/form-data" - } : {}, - url, - data - })); - }; - } - Axios.prototype[method] = generateHTTPMethod(); - Axios.prototype[method + "Form"] = generateHTTPMethod(true); -}); -const Axios$1 = Axios; -class CancelToken { - constructor(executor) { - if (typeof executor !== "function") { - throw new TypeError("executor must be a function."); - } - let resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - const token2 = this; - this.promise.then((cancel) => { - if (!token2._listeners) - return; - let i3 = token2._listeners.length; - while (i3-- > 0) { - token2._listeners[i3](cancel); - } - token2._listeners = null; - }); - this.promise.then = (onfulfilled) => { - let _resolve; - const promise = new Promise((resolve) => { - token2.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); - promise.cancel = function reject() { - token2.unsubscribe(_resolve); - }; - return promise; - }; - executor(function cancel(message2, config2, request) { - if (token2.reason) { - return; - } - token2.reason = new CanceledError(message2, config2, request); - resolvePromise(token2.reason); - }); - } - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - /** - * Subscribe to the cancel signal - */ - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - /** - * Unsubscribe from the cancel signal - */ - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index2 = this._listeners.indexOf(listener); - if (index2 !== -1) { - this._listeners.splice(index2, 1); - } - } - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - static source() { - let cancel; - const token2 = new CancelToken(function executor(c2) { - cancel = c2; - }); - return { - token: token2, - cancel - }; - } -} -const CancelToken$1 = CancelToken; -function spread(callback) { - return function wrap2(arr) { - return callback.apply(null, arr); - }; -} -function isAxiosError(payload) { - return utils$j.isObject(payload) && payload.isAxiosError === true; -} -const HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511 -}; -Object.entries(HttpStatusCode).forEach(([key2, value]) => { - HttpStatusCode[value] = key2; -}); -const HttpStatusCode$1 = HttpStatusCode; -function createInstance(defaultConfig) { - const context = new Axios$1(defaultConfig); - const instance2 = bind$1(Axios$1.prototype.request, context); - utils$j.extend(instance2, Axios$1.prototype, context, { allOwnKeys: true }); - utils$j.extend(instance2, context, null, { allOwnKeys: true }); - instance2.create = function create3(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - return instance2; -} -const axios = createInstance(defaults$1); -axios.Axios = Axios$1; -axios.CanceledError = CanceledError; -axios.CancelToken = CancelToken$1; -axios.isCancel = isCancel; -axios.VERSION = VERSION; -axios.toFormData = toFormData; -axios.AxiosError = AxiosError; -axios.Cancel = axios.CanceledError; -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = spread; -axios.isAxiosError = isAxiosError; -axios.mergeConfig = mergeConfig; -axios.AxiosHeaders = AxiosHeaders$1; -axios.formToJSON = (thing) => formDataToJSON(utils$j.isHTMLForm(thing) ? new FormData(thing) : thing); -axios.getAdapter = adapters.getAdapter; -axios.HttpStatusCode = HttpStatusCode$1; -axios.default = axios; -const et$1 = axios; -class HttpProvider { - constructor(host, timeout = 3e4, user = "", password = "", headers = {}, statusPage = "/") { - __publicField(this, "host"); - __publicField(this, "timeout"); - __publicField(this, "user"); - __publicField(this, "password"); - __publicField(this, "headers"); - __publicField(this, "statusPage"); - __publicField(this, "instance"); - if (!isValidURL(host)) - throw new Error("Invalid URL provided to HttpProvider"); - if (isNaN(timeout) || timeout < 0) - throw new Error("Invalid timeout duration provided"); - if (!isObject$2(headers)) - throw new Error("Invalid headers object provided"); - host = host.replace(/\/+$/, ""); - this.host = host; - this.timeout = timeout; - this.user = user; - this.password = password; - this.headers = headers; - this.statusPage = statusPage; - this.instance = et$1.create({ - baseURL: host, - timeout, - headers, - auth: user ? { - username: user, - password - } : void 0 - }); - } - setStatusPage(statusPage = "/") { - this.statusPage = statusPage; - } - async isConnected(statusPage = this.statusPage) { - return this.request(statusPage).then((data) => { - return hasProperties(data, "blockID", "block_header"); - }).catch(() => false); - } - request(url, payload = {}, method = "get") { - method = method.toLowerCase(); - return this.instance.request({ - data: method == "post" && Object.keys(payload).length ? payload : null, - params: method == "get" && payload, - url, - method - }).then(({ data }) => data); - } -} -const providers = { HttpProvider }; -var eventemitter3 = { exports: {} }; -(function(module) { - var has = Object.prototype.hasOwnProperty, prefix = "~"; - function Events() { - } - if (Object.create) { - Events.prototype = /* @__PURE__ */ Object.create(null); - if (!new Events().__proto__) - prefix = false; - } - function EE2(fn2, context, once3) { - this.fn = fn2; - this.context = context; - this.once = once3 || false; - } - function addListener2(emitter, event, fn2, context, once3) { - if (typeof fn2 !== "function") { - throw new TypeError("The listener must be a function"); - } - var listener = new EE2(fn2, context || emitter, once3), evt = prefix ? prefix + event : event; - if (!emitter._events[evt]) - emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) - emitter._events[evt].push(listener); - else - emitter._events[evt] = [emitter._events[evt], listener]; - return emitter; - } - function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) - emitter._events = new Events(); - else - delete emitter._events[evt]; - } - function EventEmitter2() { - this._events = new Events(); - this._eventsCount = 0; - } - EventEmitter2.prototype.eventNames = function eventNames2() { - var names = [], events2, name2; - if (this._eventsCount === 0) - return names; - for (name2 in events2 = this._events) { - if (has.call(events2, name2)) - names.push(prefix ? name2.slice(1) : name2); - } - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events2)); - } - return names; - }; - EventEmitter2.prototype.listeners = function listeners3(event) { - var evt = prefix ? prefix + event : event, handlers = this._events[evt]; - if (!handlers) - return []; - if (handlers.fn) - return [handlers.fn]; - for (var i3 = 0, l2 = handlers.length, ee2 = new Array(l2); i3 < l2; i3++) { - ee2[i3] = handlers[i3].fn; - } - return ee2; - }; - EventEmitter2.prototype.listenerCount = function listenerCount2(event) { - var evt = prefix ? prefix + event : event, listeners3 = this._events[evt]; - if (!listeners3) - return 0; - if (listeners3.fn) - return 1; - return listeners3.length; - }; - EventEmitter2.prototype.emit = function emit2(event, a1, a22, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - if (!this._events[evt]) - return false; - var listeners3 = this._events[evt], len = arguments.length, args, i3; - if (listeners3.fn) { - if (listeners3.once) - this.removeListener(event, listeners3.fn, void 0, true); - switch (len) { - case 1: - return listeners3.fn.call(listeners3.context), true; - case 2: - return listeners3.fn.call(listeners3.context, a1), true; - case 3: - return listeners3.fn.call(listeners3.context, a1, a22), true; - case 4: - return listeners3.fn.call(listeners3.context, a1, a22, a3), true; - case 5: - return listeners3.fn.call(listeners3.context, a1, a22, a3, a4), true; - case 6: - return listeners3.fn.call(listeners3.context, a1, a22, a3, a4, a5), true; - } - for (i3 = 1, args = new Array(len - 1); i3 < len; i3++) { - args[i3 - 1] = arguments[i3]; - } - listeners3.fn.apply(listeners3.context, args); - } else { - var length = listeners3.length, j2; - for (i3 = 0; i3 < length; i3++) { - if (listeners3[i3].once) - this.removeListener(event, listeners3[i3].fn, void 0, true); - switch (len) { - case 1: - listeners3[i3].fn.call(listeners3[i3].context); - break; - case 2: - listeners3[i3].fn.call(listeners3[i3].context, a1); - break; - case 3: - listeners3[i3].fn.call(listeners3[i3].context, a1, a22); - break; - case 4: - listeners3[i3].fn.call(listeners3[i3].context, a1, a22, a3); - break; - default: - if (!args) - for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) { - args[j2 - 1] = arguments[j2]; - } - listeners3[i3].fn.apply(listeners3[i3].context, args); - } - } - } - return true; - }; - EventEmitter2.prototype.on = function on2(event, fn2, context) { - return addListener2(this, event, fn2, context, false); - }; - EventEmitter2.prototype.once = function once3(event, fn2, context) { - return addListener2(this, event, fn2, context, true); - }; - EventEmitter2.prototype.removeListener = function removeListener2(event, fn2, context, once3) { - var evt = prefix ? prefix + event : event; - if (!this._events[evt]) - return this; - if (!fn2) { - clearEvent(this, evt); - return this; - } - var listeners3 = this._events[evt]; - if (listeners3.fn) { - if (listeners3.fn === fn2 && (!once3 || listeners3.once) && (!context || listeners3.context === context)) { - clearEvent(this, evt); - } - } else { - for (var i3 = 0, events2 = [], length = listeners3.length; i3 < length; i3++) { - if (listeners3[i3].fn !== fn2 || once3 && !listeners3[i3].once || context && listeners3[i3].context !== context) { - events2.push(listeners3[i3]); - } - } - if (events2.length) - this._events[evt] = events2.length === 1 ? events2[0] : events2; - else - clearEvent(this, evt); - } - return this; - }; - EventEmitter2.prototype.removeAllListeners = function removeAllListeners2(event) { - var evt; - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) - clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - return this; - }; - EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; - EventEmitter2.prototype.addListener = EventEmitter2.prototype.on; - EventEmitter2.prefixed = prefix; - EventEmitter2.EventEmitter = EventEmitter2; - { - module.exports = EventEmitter2; - } -})(eventemitter3); -var eventemitter3Exports = eventemitter3.exports; -const EventEmitter$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(eventemitter3Exports); -var semver$1 = { exports: {} }; -(function(module, exports) { - exports = module.exports = SemVer; - var debug; - if (typeof process === "object" && process.env && {}.NODE_DEBUG && /\bsemver\b/i.test({}.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug = function() { - }; - } - exports.SEMVER_SPEC_VERSION = "2.0.0"; - var MAX_LENGTH = 256; - var MAX_SAFE_INTEGER2 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ - 9007199254740991; - var MAX_SAFE_COMPONENT_LENGTH = 16; - var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; - var re2 = exports.re = []; - var safeRe = exports.safeRe = []; - var src2 = exports.src = []; - var R3 = 0; - var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; - var safeRegexReplacements = [ - ["\\s", 1], - ["\\d", MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] - ]; - function makeSafeRe(value) { - for (var i4 = 0; i4 < safeRegexReplacements.length; i4++) { - var token2 = safeRegexReplacements[i4][0]; - var max = safeRegexReplacements[i4][1]; - value = value.split(token2 + "*").join(token2 + "{0," + max + "}").split(token2 + "+").join(token2 + "{1," + max + "}"); - } - return value; - } - var NUMERICIDENTIFIER = R3++; - src2[NUMERICIDENTIFIER] = "0|[1-9]\\d*"; - var NUMERICIDENTIFIERLOOSE = R3++; - src2[NUMERICIDENTIFIERLOOSE] = "\\d+"; - var NONNUMERICIDENTIFIER = R3++; - src2[NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*"; - var MAINVERSION = R3++; - src2[MAINVERSION] = "(" + src2[NUMERICIDENTIFIER] + ")\\.(" + src2[NUMERICIDENTIFIER] + ")\\.(" + src2[NUMERICIDENTIFIER] + ")"; - var MAINVERSIONLOOSE = R3++; - src2[MAINVERSIONLOOSE] = "(" + src2[NUMERICIDENTIFIERLOOSE] + ")\\.(" + src2[NUMERICIDENTIFIERLOOSE] + ")\\.(" + src2[NUMERICIDENTIFIERLOOSE] + ")"; - var PRERELEASEIDENTIFIER = R3++; - src2[PRERELEASEIDENTIFIER] = "(?:" + src2[NUMERICIDENTIFIER] + "|" + src2[NONNUMERICIDENTIFIER] + ")"; - var PRERELEASEIDENTIFIERLOOSE = R3++; - src2[PRERELEASEIDENTIFIERLOOSE] = "(?:" + src2[NUMERICIDENTIFIERLOOSE] + "|" + src2[NONNUMERICIDENTIFIER] + ")"; - var PRERELEASE = R3++; - src2[PRERELEASE] = "(?:-(" + src2[PRERELEASEIDENTIFIER] + "(?:\\." + src2[PRERELEASEIDENTIFIER] + ")*))"; - var PRERELEASELOOSE = R3++; - src2[PRERELEASELOOSE] = "(?:-?(" + src2[PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src2[PRERELEASEIDENTIFIERLOOSE] + ")*))"; - var BUILDIDENTIFIER = R3++; - src2[BUILDIDENTIFIER] = LETTERDASHNUMBER + "+"; - var BUILD = R3++; - src2[BUILD] = "(?:\\+(" + src2[BUILDIDENTIFIER] + "(?:\\." + src2[BUILDIDENTIFIER] + ")*))"; - var FULL = R3++; - var FULLPLAIN = "v?" + src2[MAINVERSION] + src2[PRERELEASE] + "?" + src2[BUILD] + "?"; - src2[FULL] = "^" + FULLPLAIN + "$"; - var LOOSEPLAIN = "[v=\\s]*" + src2[MAINVERSIONLOOSE] + src2[PRERELEASELOOSE] + "?" + src2[BUILD] + "?"; - var LOOSE = R3++; - src2[LOOSE] = "^" + LOOSEPLAIN + "$"; - var GTLT = R3++; - src2[GTLT] = "((?:<|>)?=?)"; - var XRANGEIDENTIFIERLOOSE = R3++; - src2[XRANGEIDENTIFIERLOOSE] = src2[NUMERICIDENTIFIERLOOSE] + "|x|X|\\*"; - var XRANGEIDENTIFIER = R3++; - src2[XRANGEIDENTIFIER] = src2[NUMERICIDENTIFIER] + "|x|X|\\*"; - var XRANGEPLAIN = R3++; - src2[XRANGEPLAIN] = "[v=\\s]*(" + src2[XRANGEIDENTIFIER] + ")(?:\\.(" + src2[XRANGEIDENTIFIER] + ")(?:\\.(" + src2[XRANGEIDENTIFIER] + ")(?:" + src2[PRERELEASE] + ")?" + src2[BUILD] + "?)?)?"; - var XRANGEPLAINLOOSE = R3++; - src2[XRANGEPLAINLOOSE] = "[v=\\s]*(" + src2[XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src2[XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src2[XRANGEIDENTIFIERLOOSE] + ")(?:" + src2[PRERELEASELOOSE] + ")?" + src2[BUILD] + "?)?)?"; - var XRANGE = R3++; - src2[XRANGE] = "^" + src2[GTLT] + "\\s*" + src2[XRANGEPLAIN] + "$"; - var XRANGELOOSE = R3++; - src2[XRANGELOOSE] = "^" + src2[GTLT] + "\\s*" + src2[XRANGEPLAINLOOSE] + "$"; - var COERCE = R3++; - src2[COERCE] = "(?:^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])"; - var LONETILDE = R3++; - src2[LONETILDE] = "(?:~>?)"; - var TILDETRIM = R3++; - src2[TILDETRIM] = "(\\s*)" + src2[LONETILDE] + "\\s+"; - re2[TILDETRIM] = new RegExp(src2[TILDETRIM], "g"); - safeRe[TILDETRIM] = new RegExp(makeSafeRe(src2[TILDETRIM]), "g"); - var tildeTrimReplace = "$1~"; - var TILDE = R3++; - src2[TILDE] = "^" + src2[LONETILDE] + src2[XRANGEPLAIN] + "$"; - var TILDELOOSE = R3++; - src2[TILDELOOSE] = "^" + src2[LONETILDE] + src2[XRANGEPLAINLOOSE] + "$"; - var LONECARET = R3++; - src2[LONECARET] = "(?:\\^)"; - var CARETTRIM = R3++; - src2[CARETTRIM] = "(\\s*)" + src2[LONECARET] + "\\s+"; - re2[CARETTRIM] = new RegExp(src2[CARETTRIM], "g"); - safeRe[CARETTRIM] = new RegExp(makeSafeRe(src2[CARETTRIM]), "g"); - var caretTrimReplace = "$1^"; - var CARET = R3++; - src2[CARET] = "^" + src2[LONECARET] + src2[XRANGEPLAIN] + "$"; - var CARETLOOSE = R3++; - src2[CARETLOOSE] = "^" + src2[LONECARET] + src2[XRANGEPLAINLOOSE] + "$"; - var COMPARATORLOOSE = R3++; - src2[COMPARATORLOOSE] = "^" + src2[GTLT] + "\\s*(" + LOOSEPLAIN + ")$|^$"; - var COMPARATOR = R3++; - src2[COMPARATOR] = "^" + src2[GTLT] + "\\s*(" + FULLPLAIN + ")$|^$"; - var COMPARATORTRIM = R3++; - src2[COMPARATORTRIM] = "(\\s*)" + src2[GTLT] + "\\s*(" + LOOSEPLAIN + "|" + src2[XRANGEPLAIN] + ")"; - re2[COMPARATORTRIM] = new RegExp(src2[COMPARATORTRIM], "g"); - safeRe[COMPARATORTRIM] = new RegExp(makeSafeRe(src2[COMPARATORTRIM]), "g"); - var comparatorTrimReplace = "$1$2$3"; - var HYPHENRANGE = R3++; - src2[HYPHENRANGE] = "^\\s*(" + src2[XRANGEPLAIN] + ")\\s+-\\s+(" + src2[XRANGEPLAIN] + ")\\s*$"; - var HYPHENRANGELOOSE = R3++; - src2[HYPHENRANGELOOSE] = "^\\s*(" + src2[XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src2[XRANGEPLAINLOOSE] + ")\\s*$"; - var STAR = R3++; - src2[STAR] = "(<|>)?=?\\s*\\*"; - for (var i3 = 0; i3 < R3; i3++) { - debug(i3, src2[i3]); - if (!re2[i3]) { - re2[i3] = new RegExp(src2[i3]); - safeRe[i3] = new RegExp(makeSafeRe(src2[i3])); - } - } - exports.parse = parse2; - function parse2(version2, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (version2 instanceof SemVer) { - return version2; - } - if (typeof version2 !== "string") { - return null; - } - if (version2.length > MAX_LENGTH) { - return null; - } - var r2 = options.loose ? safeRe[LOOSE] : safeRe[FULL]; - if (!r2.test(version2)) { - return null; - } - try { - return new SemVer(version2, options); - } catch (er2) { - return null; - } - } - exports.valid = valid; - function valid(version2, options) { - var v6 = parse2(version2, options); - return v6 ? v6.version : null; - } - exports.clean = clean; - function clean(version2, options) { - var s2 = parse2(version2.trim().replace(/^[=v]+/, ""), options); - return s2 ? s2.version : null; - } - exports.SemVer = SemVer; - function SemVer(version2, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (version2 instanceof SemVer) { - if (version2.loose === options.loose) { - return version2; - } else { - version2 = version2.version; - } - } else if (typeof version2 !== "string") { - throw new TypeError("Invalid Version: " + version2); - } - if (version2.length > MAX_LENGTH) { - throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); - } - if (!(this instanceof SemVer)) { - return new SemVer(version2, options); - } - debug("SemVer", version2, options); - this.options = options; - this.loose = !!options.loose; - var m3 = version2.trim().match(options.loose ? safeRe[LOOSE] : safeRe[FULL]); - if (!m3) { - throw new TypeError("Invalid Version: " + version2); - } - this.raw = version2; - this.major = +m3[1]; - this.minor = +m3[2]; - this.patch = +m3[3]; - if (this.major > MAX_SAFE_INTEGER2 || this.major < 0) { - throw new TypeError("Invalid major version"); - } - if (this.minor > MAX_SAFE_INTEGER2 || this.minor < 0) { - throw new TypeError("Invalid minor version"); - } - if (this.patch > MAX_SAFE_INTEGER2 || this.patch < 0) { - throw new TypeError("Invalid patch version"); - } - if (!m3[4]) { - this.prerelease = []; - } else { - this.prerelease = m3[4].split(".").map(function(id2) { - if (/^[0-9]+$/.test(id2)) { - var num = +id2; - if (num >= 0 && num < MAX_SAFE_INTEGER2) { - return num; - } - } - return id2; - }); - } - this.build = m3[5] ? m3[5].split(".") : []; - this.format(); - } - SemVer.prototype.format = function() { - this.version = this.major + "." + this.minor + "." + this.patch; - if (this.prerelease.length) { - this.version += "-" + this.prerelease.join("."); - } - return this.version; - }; - SemVer.prototype.toString = function() { - return this.version; - }; - SemVer.prototype.compare = function(other) { - debug("SemVer.compare", this.version, this.options, other); - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - return this.compareMain(other) || this.comparePre(other); - }; - SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); - }; - SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; - } - var i4 = 0; - do { - var a3 = this.prerelease[i4]; - var b2 = other.prerelease[i4]; - debug("prerelease compare", i4, a3, b2); - if (a3 === void 0 && b2 === void 0) { - return 0; - } else if (b2 === void 0) { - return 1; - } else if (a3 === void 0) { - return -1; - } else if (a3 === b2) { - continue; - } else { - return compareIdentifiers(a3, b2); - } - } while (++i4); - }; - SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier); - break; - case "prepatch": - this.prerelease.length = 0; - this.inc("patch", identifier); - this.inc("pre", identifier); - break; - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier); - } - this.inc("pre", identifier); - break; - case "major": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - case "pre": - if (this.prerelease.length === 0) { - this.prerelease = [0]; - } else { - var i4 = this.prerelease.length; - while (--i4 >= 0) { - if (typeof this.prerelease[i4] === "number") { - this.prerelease[i4]++; - i4 = -2; - } - } - if (i4 === -1) { - this.prerelease.push(0); - } - } - if (identifier) { - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; - } - } - break; - default: - throw new Error("invalid increment argument: " + release); - } - this.format(); - this.raw = this.version; - return this; - }; - exports.inc = inc; - function inc(version2, release, loose, identifier) { - if (typeof loose === "string") { - identifier = loose; - loose = void 0; - } - try { - return new SemVer(version2, loose).inc(release, identifier).version; - } catch (er2) { - return null; - } - } - exports.diff = diff; - function diff(version1, version2) { - if (eq7(version1, version2)) { - return null; - } else { - var v12 = parse2(version1); - var v22 = parse2(version2); - var prefix = ""; - if (v12.prerelease.length || v22.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; - } - for (var key2 in v12) { - if (key2 === "major" || key2 === "minor" || key2 === "patch") { - if (v12[key2] !== v22[key2]) { - return prefix + key2; - } - } - } - return defaultResult; - } - } - exports.compareIdentifiers = compareIdentifiers; - var numeric2 = /^[0-9]+$/; - function compareIdentifiers(a3, b2) { - var anum = numeric2.test(a3); - var bnum = numeric2.test(b2); - if (anum && bnum) { - a3 = +a3; - b2 = +b2; - } - return a3 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a3 < b2 ? -1 : 1; - } - exports.rcompareIdentifiers = rcompareIdentifiers; - function rcompareIdentifiers(a3, b2) { - return compareIdentifiers(b2, a3); - } - exports.major = major; - function major(a3, loose) { - return new SemVer(a3, loose).major; - } - exports.minor = minor; - function minor(a3, loose) { - return new SemVer(a3, loose).minor; - } - exports.patch = patch; - function patch(a3, loose) { - return new SemVer(a3, loose).patch; - } - exports.compare = compare2; - function compare2(a3, b2, loose) { - return new SemVer(a3, loose).compare(new SemVer(b2, loose)); - } - exports.compareLoose = compareLoose; - function compareLoose(a3, b2) { - return compare2(a3, b2, true); - } - exports.rcompare = rcompare; - function rcompare(a3, b2, loose) { - return compare2(b2, a3, loose); - } - exports.sort = sort; - function sort(list, loose) { - return list.sort(function(a3, b2) { - return exports.compare(a3, b2, loose); - }); - } - exports.rsort = rsort; - function rsort(list, loose) { - return list.sort(function(a3, b2) { - return exports.rcompare(a3, b2, loose); - }); - } - exports.gt = gt2; - function gt2(a3, b2, loose) { - return compare2(a3, b2, loose) > 0; - } - exports.lt = lt2; - function lt2(a3, b2, loose) { - return compare2(a3, b2, loose) < 0; - } - exports.eq = eq7; - function eq7(a3, b2, loose) { - return compare2(a3, b2, loose) === 0; - } - exports.neq = neq; - function neq(a3, b2, loose) { - return compare2(a3, b2, loose) !== 0; - } - exports.gte = gte; - function gte(a3, b2, loose) { - return compare2(a3, b2, loose) >= 0; - } - exports.lte = lte; - function lte(a3, b2, loose) { - return compare2(a3, b2, loose) <= 0; - } - exports.cmp = cmp; - function cmp(a3, op, b2, loose) { - switch (op) { - case "===": - if (typeof a3 === "object") - a3 = a3.version; - if (typeof b2 === "object") - b2 = b2.version; - return a3 === b2; - case "!==": - if (typeof a3 === "object") - a3 = a3.version; - if (typeof b2 === "object") - b2 = b2.version; - return a3 !== b2; - case "": - case "=": - case "==": - return eq7(a3, b2, loose); - case "!=": - return neq(a3, b2, loose); - case ">": - return gt2(a3, b2, loose); - case ">=": - return gte(a3, b2, loose); - case "<": - return lt2(a3, b2, loose); - case "<=": - return lte(a3, b2, loose); - default: - throw new TypeError("Invalid operator: " + op); - } - } - exports.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } - } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug("comparator", comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; - } - debug("comp", this); - } - var ANY = {}; - Comparator.prototype.parse = function(comp) { - var r2 = this.options.loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR]; - var m3 = comp.match(r2); - if (!m3) { - throw new TypeError("Invalid comparator: " + comp); - } - this.operator = m3[1]; - if (this.operator === "=") { - this.operator = ""; - } - if (!m3[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m3[2], this.options.loose); - } - }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version2) { - debug("Comparator.test", version2, this.options.loose); - if (this.semver === ANY) { - return true; - } - if (typeof version2 === "string") { - version2 = new SemVer(version2, this.options); - } - return cmp(version2, this.operator, this.semver, this.options); - }; - Comparator.prototype.intersects = function(comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError("a Comparator is required"); - } - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - var rangeTmp; - if (this.operator === "") { - rangeTmp = new Range(comp.value, options); - return satisfies(this.value, rangeTmp, options); - } else if (comp.operator === "") { - rangeTmp = new Range(this.value, options); - return satisfies(comp.semver, rangeTmp, options); - } - var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">"); - var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<"); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<="); - var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<")); - var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">")); - return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; - }; - exports.Range = Range; - function Range(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (range instanceof Range) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range(range.raw, options); - } - } - if (range instanceof Comparator) { - return new Range(range.value, options); - } - if (!(this instanceof Range)) { - return new Range(range, options); - } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c2) { - return c2.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); - } - this.format(); - } - Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(" ").trim(); - }).join("||").trim(); - return this.range; - }; - Range.prototype.toString = function() { - return this.range; - }; - Range.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr2 = loose ? safeRe[HYPHENRANGELOOSE] : safeRe[HYPHENRANGE]; - range = range.replace(hr2, hyphenReplace); - debug("hyphen replace", range); - range = range.replace(safeRe[COMPARATORTRIM], comparatorTrimReplace); - debug("comparator trim", range, safeRe[COMPARATORTRIM]); - range = range.replace(safeRe[TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[CARETTRIM], caretTrimReplace); - var compRe = loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range.prototype.intersects = function(range, options) { - if (!(range instanceof Range)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return thisComparators.every(function(thisComparator) { - return range.set.some(function(rangeComparators) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); - }; - exports.toComparators = toComparators; - function toComparators(range, options) { - return new Range(range, options).set.map(function(comp) { - return comp.map(function(c2) { - return c2.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug("comp", comp, options); - comp = replaceCarets(comp, options); - debug("caret", comp); - comp = replaceTildes(comp, options); - debug("tildes", comp); - comp = replaceXRanges(comp, options); - debug("xrange", comp); - comp = replaceStars(comp, options); - debug("stars", comp); - return comp; - } - function isX(id2) { - return !id2 || id2.toLowerCase() === "x" || id2 === "*"; - } - function replaceTildes(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceTilde(comp2, options); - }).join(" "); - } - function replaceTilde(comp, options) { - var r2 = options.loose ? safeRe[TILDELOOSE] : safeRe[TILDE]; - return comp.replace(r2, function(_3, M3, m3, p3, pr2) { - debug("tilde", comp, _3, M3, m3, p3, pr2); - var ret; - if (isX(M3)) { - ret = ""; - } else if (isX(m3)) { - ret = ">=" + M3 + ".0.0 <" + (+M3 + 1) + ".0.0"; - } else if (isX(p3)) { - ret = ">=" + M3 + "." + m3 + ".0 <" + M3 + "." + (+m3 + 1) + ".0"; - } else if (pr2) { - debug("replaceTilde pr", pr2); - ret = ">=" + M3 + "." + m3 + "." + p3 + "-" + pr2 + " <" + M3 + "." + (+m3 + 1) + ".0"; - } else { - ret = ">=" + M3 + "." + m3 + "." + p3 + " <" + M3 + "." + (+m3 + 1) + ".0"; - } - debug("tilde return", ret); - return ret; - }); - } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug("caret", comp, options); - var r2 = options.loose ? safeRe[CARETLOOSE] : safeRe[CARET]; - return comp.replace(r2, function(_3, M3, m3, p3, pr2) { - debug("caret", comp, _3, M3, m3, p3, pr2); - var ret; - if (isX(M3)) { - ret = ""; - } else if (isX(m3)) { - ret = ">=" + M3 + ".0.0 <" + (+M3 + 1) + ".0.0"; - } else if (isX(p3)) { - if (M3 === "0") { - ret = ">=" + M3 + "." + m3 + ".0 <" + M3 + "." + (+m3 + 1) + ".0"; - } else { - ret = ">=" + M3 + "." + m3 + ".0 <" + (+M3 + 1) + ".0.0"; - } - } else if (pr2) { - debug("replaceCaret pr", pr2); - if (M3 === "0") { - if (m3 === "0") { - ret = ">=" + M3 + "." + m3 + "." + p3 + "-" + pr2 + " <" + M3 + "." + m3 + "." + (+p3 + 1); - } else { - ret = ">=" + M3 + "." + m3 + "." + p3 + "-" + pr2 + " <" + M3 + "." + (+m3 + 1) + ".0"; - } - } else { - ret = ">=" + M3 + "." + m3 + "." + p3 + "-" + pr2 + " <" + (+M3 + 1) + ".0.0"; - } - } else { - debug("no pr"); - if (M3 === "0") { - if (m3 === "0") { - ret = ">=" + M3 + "." + m3 + "." + p3 + " <" + M3 + "." + m3 + "." + (+p3 + 1); - } else { - ret = ">=" + M3 + "." + m3 + "." + p3 + " <" + M3 + "." + (+m3 + 1) + ".0"; - } - } else { - ret = ">=" + M3 + "." + m3 + "." + p3 + " <" + (+M3 + 1) + ".0.0"; - } - } - debug("caret return", ret); - return ret; - }); - } - function replaceXRanges(comp, options) { - debug("replaceXRanges", comp, options); - return comp.split(/\s+/).map(function(comp2) { - return replaceXRange(comp2, options); - }).join(" "); - } - function replaceXRange(comp, options) { - comp = comp.trim(); - var r2 = options.loose ? safeRe[XRANGELOOSE] : safeRe[XRANGE]; - return comp.replace(r2, function(ret, gtlt, M3, m3, p3, pr2) { - debug("xRange", comp, ret, gtlt, M3, m3, p3, pr2); - var xM = isX(M3); - var xm = xM || isX(m3); - var xp = xm || isX(p3); - var anyX = xp; - if (gtlt === "=" && anyX) { - gtlt = ""; - } - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0"; - } else { - ret = "*"; - } - } else if (gtlt && anyX) { - if (xm) { - m3 = 0; - } - p3 = 0; - if (gtlt === ">") { - gtlt = ">="; - if (xm) { - M3 = +M3 + 1; - m3 = 0; - p3 = 0; - } else { - m3 = +m3 + 1; - p3 = 0; - } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M3 = +M3 + 1; - } else { - m3 = +m3 + 1; - } - } - ret = gtlt + M3 + "." + m3 + "." + p3; - } else if (xm) { - ret = ">=" + M3 + ".0.0 <" + (+M3 + 1) + ".0.0"; - } else if (xp) { - ret = ">=" + M3 + "." + m3 + ".0 <" + M3 + "." + (+m3 + 1) + ".0"; - } - debug("xRange return", ret); - return ret; - }); - } - function replaceStars(comp, options) { - debug("replaceStars", comp, options); - return comp.trim().replace(safeRe[STAR], ""); - } - function hyphenReplace($02, from2, fM, fm, fp, fpr, fb2, to2, tM, tm, tp, tpr, tb2) { - if (isX(fM)) { - from2 = ""; - } else if (isX(fm)) { - from2 = ">=" + fM + ".0.0"; - } else if (isX(fp)) { - from2 = ">=" + fM + "." + fm + ".0"; - } else { - from2 = ">=" + from2; - } - if (isX(tM)) { - to2 = ""; - } else if (isX(tm)) { - to2 = "<" + (+tM + 1) + ".0.0"; - } else if (isX(tp)) { - to2 = "<" + tM + "." + (+tm + 1) + ".0"; - } else if (tpr) { - to2 = "<=" + tM + "." + tm + "." + tp + "-" + tpr; - } else { - to2 = "<=" + to2; - } - return (from2 + " " + to2).trim(); - } - Range.prototype.test = function(version2) { - if (!version2) { - return false; - } - if (typeof version2 === "string") { - version2 = new SemVer(version2, this.options); - } - for (var i4 = 0; i4 < this.set.length; i4++) { - if (testSet(this.set[i4], version2, this.options)) { - return true; - } - } - return false; - }; - function testSet(set2, version2, options) { - for (var i4 = 0; i4 < set2.length; i4++) { - if (!set2[i4].test(version2)) { - return false; - } - } - if (version2.prerelease.length && !options.includePrerelease) { - for (i4 = 0; i4 < set2.length; i4++) { - debug(set2[i4].semver); - if (set2[i4].semver === ANY) { - continue; - } - if (set2[i4].semver.prerelease.length > 0) { - var allowed = set2[i4].semver; - if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { - return true; - } - } - } - return false; - } - return true; - } - exports.satisfies = satisfies; - function satisfies(version2, range, options) { - try { - range = new Range(range, options); - } catch (er2) { - return false; - } - return range.test(version2); - } - exports.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range(range, options); - } catch (er2) { - return null; - } - versions.forEach(function(v6) { - if (rangeObj.test(v6)) { - if (!max || maxSV.compare(v6) === -1) { - max = v6; - maxSV = new SemVer(max, options); - } - } - }); - return max; - } - exports.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range(range, options); - } catch (er2) { - return null; - } - versions.forEach(function(v6) { - if (rangeObj.test(v6)) { - if (!min || minSV.compare(v6) === 1) { - min = v6; - minSV = new SemVer(min, options); - } - } - }); - return min; - } - exports.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; - } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i4 = 0; i4 < range.set.length; ++i4) { - var comparators = range.set[i4]; - comparators.forEach(function(comparator) { - var compver = new SemVer(comparator.semver.version); - switch (comparator.operator) { - case ">": - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - compver.raw = compver.format(); - case "": - case ">=": - if (!minver || gt2(minver, compver)) { - minver = compver; - } - break; - case "<": - case "<=": - break; - default: - throw new Error("Unexpected operation: " + comparator.operator); - } - }); - } - if (minver && range.test(minver)) { - return minver; - } - return null; - } - exports.validRange = validRange; - function validRange(range, options) { - try { - return new Range(range, options).range || "*"; - } catch (er2) { - return null; - } - } - exports.ltr = ltr; - function ltr(version2, range, options) { - return outside(version2, range, "<", options); - } - exports.gtr = gtr; - function gtr(version2, range, options) { - return outside(version2, range, ">", options); - } - exports.outside = outside; - function outside(version2, range, hilo, options) { - version2 = new SemVer(version2, options); - range = new Range(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt2; - ltefn = lte; - ltfn = lt2; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt2; - ltefn = gte; - ltfn = gt2; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - if (satisfies(version2, range, options)) { - return false; - } - for (var i4 = 0; i4 < range.set.length; ++i4) { - var comparators = range.set[i4]; - var high = null; - var low = null; - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); - if (high.operator === comp || high.operator === ecomp) { - return false; - } - if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version2, low.semver)) { - return false; - } - } - return true; - } - exports.prerelease = prerelease; - function prerelease(version2, options) { - var parsed = parse2(version2, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; - } - exports.intersects = intersects; - function intersects(r1, r2, options) { - r1 = new Range(r1, options); - r2 = new Range(r2, options); - return r1.intersects(r2); - } - exports.coerce = coerce2; - function coerce2(version2) { - if (version2 instanceof SemVer) { - return version2; - } - if (typeof version2 !== "string") { - return null; - } - var match = version2.match(safeRe[COERCE]); - if (match == null) { - return null; - } - return parse2(match[1] + "." + (match[2] || "0") + "." + (match[3] || "0")); - } -})(semver$1, semver$1.exports); -var semverExports = semver$1.exports; -const semver = /* @__PURE__ */ getDefaultExportFromCjs$1(semverExports); -const abiCoder = new AbiCoder(); -function _addressToHex(value) { - return TronWeb.address.toHex(value).replace(ADDRESS_PREFIX_REGEX, "0x"); -} -function decodeParams(names, types2, output2, ignoreMethodHash = false) { - if (ignoreMethodHash && output2.replace(/^0x/, "").length % 64 === 8) - output2 = "0x" + output2.replace(/^0x/, "").substring(8); - if (output2.replace(/^0x/, "").length % 64) { - throw new Error("The encoded string is not valid. Its length must be a multiple of 64."); - } - types2 = types2.map((type2) => { - if (/trcToken/.test(type2)) { - type2 = type2.replace(/trcToken/, "uint256"); - } - return type2; - }); - return abiCoder.decode(types2, output2).reduce((obj, arg, index2) => { - if (types2[index2] == "address") { - arg = ADDRESS_PREFIX + arg.substr(2).toLowerCase(); - } - if (names.length) { - obj[names[index2]] = arg; - } else { - obj.push(arg); - } - return obj; - }, names.length ? {} : []); -} -function encodeParams(types2, values) { - for (let i3 = 0; i3 < types2.length; i3++) { - if (types2[i3] === "address") { - values[i3] = TronWeb.address.toHex(values[i3]).replace(ADDRESS_PREFIX_REGEX, "0x"); - } - } - return abiCoder.encode(types2, values); -} -function extractSize(type2) { - const size2 = type2.match(/([a-zA-Z0-9])(\[.*\])/); - return size2 ? size2[2] : ""; -} -function extractArrayDim(type2) { - const size2 = extractSize(type2); - return (size2.match(/\]\[/g) || []).length + 1; -} -function encodeParamsV2ByABI(funABI, args) { - const types2 = []; - const buildFullTypeDefinition = (typeDef) => { - if (typeDef && typeDef.type.indexOf("tuple") === 0 && typeDef.components) { - const innerTypes = typeDef.components.map((innerType) => { - return buildFullTypeDefinition(innerType); - }); - return `tuple(${innerTypes.join(",")})${extractSize(typeDef.type)}`; - } - if (/trcToken/.test(typeDef.type)) - return typeDef.type.replace(/trcToken/, "uint256"); - return typeDef.type; - }; - const convertTypes = (types3) => { - for (let i3 = 0; i3 < types3.length; i3++) { - const type2 = types3[i3]; - if (/trcToken/.test(type2)) - types3[i3] = type2.replace(/trcToken/, "uint256"); - } - }; - const convertAddresses = (addrArr) => { - if (Array.isArray(addrArr)) { - addrArr.forEach((addrs, i3) => { - addrArr[i3] = convertAddresses(addrs); - }); - return addrArr; - } else { - return _addressToHex(addrArr); - } - }; - const mapTuple = (components, args2, dimension) => { - if (dimension > 1) { - if (args2.length) { - args2.forEach((arg) => { - mapTuple(components, arg, dimension - 1); - }); - } - } else { - if (args2.length && dimension) { - args2.forEach((arg) => { - encodeArgs(components, arg); - }); - } - } - }; - const encodeArgs = (inputs = [], args2) => { - if (inputs.length) - inputs.forEach((input, i3) => { - const type2 = input.type; - if (args2[i3]) { - if (type2 === "address") - args2[i3] = _addressToHex(args2[i3]); - else if (type2.match(/^([^\x5b]*)(\x5b|$)/)[0] === "address[") - convertAddresses(args2[i3]); - else if (type2.indexOf("tuple") === 0) - if (extractSize(type2)) { - const dimension = extractArrayDim(type2); - mapTuple(input.components, args2[i3], dimension); - } else - encodeArgs(input.components, args2[i3]); - } - }); - }; - if (funABI.inputs && funABI.inputs.length) { - for (let i3 = 0; i3 < funABI.inputs.length; i3++) { - const type2 = funABI.inputs[i3].type; - if (type2 === "bool" && args[i3] === "false") { - args[i3] = false; - } - types2.push(type2.indexOf("tuple") === 0 ? buildFullTypeDefinition(funABI.inputs[i3]) : type2); - if (args.length < types2.length) { - args.push(""); - } - } - } - encodeArgs(funABI.inputs, args); - convertTypes(types2); - return abiCoder.encode(types2, args); -} -function decodeParamsV2ByABI(funABI, data) { - const convertTypeNames = (types2) => { - for (let i3 = 0; i3 < types2.length; i3++) { - const type2 = types2[i3]; - if (/^trcToken/.test(type2)) - types2[i3] = type2.replace(/^trcToken/, "uint256"); - } - }; - const convertAddresses = (addrArr) => { - if (Array.isArray(addrArr)) { - addrArr.forEach((addrs, i3) => { - addrArr[i3] = convertAddresses(addrs); - }); - return addrArr; - } else { - return TronWeb.address.toHex(addrArr); - } - }; - const mapTuple = (components, args, dimension) => { - if (dimension > 1) { - if (args.length) { - args.forEach((arg) => { - mapTuple(components, arg, dimension - 1); - }); - } - } else { - if (args.length && dimension) { - args.forEach((arg) => { - decodeResult(components, arg); - }); - } - } - }; - const buildFullTypeNameDefinition = (typeDef) => { - const name2 = typeDef.name ? ` ${typeDef.name}` : ""; - if (typeDef && typeDef.type.indexOf("tuple") === 0 && typeDef.components) { - const innerTypes = typeDef.components.map((innerType) => { - return buildFullTypeNameDefinition(innerType); - }); - return `tuple(${innerTypes.join(",")})${extractSize(typeDef.type)}${name2}`; - } - if (/trcToken/.test(typeDef.type)) - return typeDef.type.replace(/trcToken/, "uint256") + name2; - return typeDef.type + name2; - }; - const decodeResult = (outputs, result) => { - if (outputs.length) - outputs.forEach((output2, i3) => { - const { type: type2, name: name2 } = output2; - if (result[i3]) { - if (type2 === "address") { - result[i3] = TronWeb.address.toHex(result[i3]); - if (name2) - result[name2] = TronWeb.address.toHex(result[i3]); - } else if (type2.match(/^([^\x5b]*)(\x5b|$)/)[0] === "address[") { - convertAddresses(result[i3]); - if (name2) - result[name2] = convertAddresses(result[i3]); - } else if (type2.indexOf("tuple") === 0) { - if (extractSize(type2)) { - const dimension = extractArrayDim(type2); - mapTuple(output2.components, result[i3], dimension); - } else - decodeResult(output2.components, result[i3]); - if (name2) - result[name2] = result[i3]; - } else { - if (name2) - result[name2] = result[i3]; - } - } else { - if (name2) - result[name2] = result[i3]; - } - }); - }; - if ("outputs" in funABI && funABI.outputs && funABI.outputs.length > 0) { - const outputTypes = []; - for (let i3 = 0; i3 < funABI.outputs.length; i3++) { - const type2 = funABI.outputs[i3].type; - const name2 = funABI.outputs[i3].name ? ` ${funABI.outputs[i3].name}` : ""; - outputTypes.push(type2.indexOf("tuple") === 0 ? buildFullTypeNameDefinition(funABI.outputs[i3]) : type2 + name2); - } - convertTypeNames(outputTypes); - if (!data || !data.length) - data = new Uint8Array(32 * funABI.outputs.length); - const decodeRes = abiCoder.decode(outputTypes, data); - const decodeResCopy = decodeRes.toArray(true); - decodeResult(funABI.outputs, decodeResCopy); - return decodeResCopy; - } - return []; -} -const abi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - decodeParams, - decodeParamsV2ByABI, - encodeParams, - encodeParamsV2ByABI -}, Symbol.toStringTag, { value: "Module" })); -class Validator { - invalid(param) { - return param.msg || `Invalid ${param.name}${param.type === "address" ? " address" : ""} provided`; - } - notPositive(param) { - return `${param.name} must be a positive integer`; - } - notEqual(param) { - var _a3, _b2; - return param.msg || `${(_a3 = param.names) == null ? void 0 : _a3[0]} can not be equal to ${(_b2 = param.names) == null ? void 0 : _b2[1]}`; - } - notValid(params) { - const normalized = {}; - let no2 = false; - for (const param of params) { - const { name: name2, names, value, type: type2, gt: gt2, lt: lt2, gte, lte, optional: optional2 } = param; - if (optional2 && (!isNotNullOrUndefined(value) || type2 !== "boolean" && value === false)) - continue; - normalized[name2] = param.value; - switch (type2) { - case "address": - if (!isAddress(value)) { - no2 = true; - } else { - normalized[name2] = toHex$1(value); - } - break; - case "integer": - if (!isInteger(value) || typeof gt2 === "number" && value <= gt2 || typeof lt2 === "number" && value >= lt2 || typeof gte === "number" && value < gte || typeof lte === "number" && value > lte) { - no2 = true; - } - break; - case "positive-integer": - if (!isInteger(value) || value <= 0) { - throw new Error(this.notPositive(param)); - } - break; - case "tokenId": - if (!isString$1(value) || !value.length) { - no2 = true; - } - break; - case "notEmptyObject": - if (!isObject$2(value) || !Object.keys(value).length) { - no2 = true; - } - break; - case "notEqual": - if (names && normalized[names[0]] === normalized[names[1]]) { - throw new Error(this.notEqual(param)); - } - break; - case "resource": - if (!["BANDWIDTH", "ENERGY"].includes(value)) { - no2 = true; - } - break; - case "url": - if (!isValidURL(value)) { - no2 = true; - } - break; - case "hex": - if (!isHex(value)) { - no2 = true; - } - break; - case "array": - if (!Array.isArray(value)) { - no2 = true; - } - break; - case "not-empty-string": - if (!isString$1(value) || !value.length) { - no2 = true; - } - break; - case "boolean": - if (!isBoolean$1(value)) { - no2 = true; - } - break; - case "string": - if (!isString$1(value) || typeof gt2 === "number" && value.length <= gt2 || typeof lt2 === "number" && value.length >= lt2 || typeof gte === "number" && value.length < gte || typeof lte === "number" && value.length > lte) { - no2 = true; - } - break; - } - if (no2) { - throw new Error(this.invalid(param)); - } - } - return false; - } -} -var ContractType; -(function(ContractType2) { - ContractType2["AccountCreateContract"] = "AccountCreateContract"; - ContractType2["TransferContract"] = "TransferContract"; - ContractType2["TransferAssetContract"] = "TransferAssetContract"; - ContractType2["VoteAssetContract"] = "VoteAssetContract"; - ContractType2["VoteWitnessContract"] = "VoteWitnessContract"; - ContractType2["WitnessCreateContract"] = "WitnessCreateContract"; - ContractType2["AssetIssueContract"] = "AssetIssueContract"; - ContractType2["WitnessUpdateContract"] = "WitnessUpdateContract"; - ContractType2["ParticipateAssetIssueContract"] = "ParticipateAssetIssueContract"; - ContractType2["AccountUpdateContract"] = "AccountUpdateContract"; - ContractType2["FreezeBalanceContract"] = "FreezeBalanceContract"; - ContractType2["UnfreezeBalanceContract"] = "UnfreezeBalanceContract"; - ContractType2["CancelAllUnfreezeV2Contract"] = "CancelAllUnfreezeV2Contract"; - ContractType2["WithdrawBalanceContract"] = "WithdrawBalanceContract"; - ContractType2["UnfreezeAssetContract"] = "UnfreezeAssetContract"; - ContractType2["UpdateAssetContract"] = "UpdateAssetContract"; - ContractType2["ProposalCreateContract"] = "ProposalCreateContract"; - ContractType2["ProposalApproveContract"] = "ProposalApproveContract"; - ContractType2["ProposalDeleteContract"] = "ProposalDeleteContract"; - ContractType2["SetAccountIdContract"] = "SetAccountIdContract"; - ContractType2["CustomContract"] = "CustomContract"; - ContractType2["CreateSmartContract"] = "CreateSmartContract"; - ContractType2["TriggerSmartContract"] = "TriggerSmartContract"; - ContractType2["GetContract"] = "GetContract"; - ContractType2["UpdateSettingContract"] = "UpdateSettingContract"; - ContractType2["ExchangeCreateContract"] = "ExchangeCreateContract"; - ContractType2["ExchangeInjectContract"] = "ExchangeInjectContract"; - ContractType2["ExchangeWithdrawContract"] = "ExchangeWithdrawContract"; - ContractType2["ExchangeTransactionContract"] = "ExchangeTransactionContract"; - ContractType2["UpdateEnergyLimitContract"] = "UpdateEnergyLimitContract"; - ContractType2["AccountPermissionUpdateContract"] = "AccountPermissionUpdateContract"; - ContractType2["ClearABIContract"] = "ClearABIContract"; - ContractType2["UpdateBrokerageContract"] = "UpdateBrokerageContract"; - ContractType2["ShieldedTransferContract"] = "ShieldedTransferContract"; - ContractType2["MarketSellAssetContract"] = "MarketSellAssetContract"; - ContractType2["MarketCancelOrderContract"] = "MarketCancelOrderContract"; - ContractType2["FreezeBalanceV2Contract"] = "FreezeBalanceV2Contract"; - ContractType2["UnfreezeBalanceV2Contract"] = "UnfreezeBalanceV2Contract"; - ContractType2["WithdrawExpireUnfreezeContract"] = "WithdrawExpireUnfreezeContract"; - ContractType2["DelegateResourceContract"] = "DelegateResourceContract"; - ContractType2["UnDelegateResourceContract"] = "UnDelegateResourceContract"; - ContractType2["UNRECOGNIZED"] = "UNRECOGNIZED"; -})(ContractType || (ContractType = {})); -var Permission_PermissionType; -(function(Permission_PermissionType2) { - Permission_PermissionType2[Permission_PermissionType2["Owner"] = 0] = "Owner"; - Permission_PermissionType2[Permission_PermissionType2["Witness"] = 1] = "Witness"; - Permission_PermissionType2[Permission_PermissionType2["Active"] = 2] = "Active"; - Permission_PermissionType2[Permission_PermissionType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; -})(Permission_PermissionType || (Permission_PermissionType = {})); -var AccountType; -(function(AccountType2) { - AccountType2[AccountType2["Normal"] = 0] = "Normal"; - AccountType2[AccountType2["AssetIssue"] = 1] = "AssetIssue"; - AccountType2[AccountType2["Contract"] = 2] = "Contract"; - AccountType2[AccountType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; -})(AccountType || (AccountType = {})); -var any_pb = {}; -var googleProtobuf = {}; -(function(exports) { - var aa2 = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a3, b2, c2) { - a3 != Array.prototype && a3 != Object.prototype && (a3[b2] = c2.value); - }, e18 = "undefined" != typeof window && window === commonjsGlobal ? commonjsGlobal : "undefined" != typeof commonjsGlobal && null != commonjsGlobal ? commonjsGlobal : commonjsGlobal; - function ba2(a3, b2) { - if (b2) { - var c2 = e18; - a3 = a3.split("."); - for (var d4 = 0; d4 < a3.length - 1; d4++) { - var f3 = a3[d4]; - f3 in c2 || (c2[f3] = {}); - c2 = c2[f3]; - } - a3 = a3[a3.length - 1]; - d4 = c2[a3]; - b2 = b2(d4); - b2 != d4 && null != b2 && aa2(c2, a3, { configurable: true, writable: true, value: b2 }); - } - } - function ca2(a3) { - var b2 = 0; - return function() { - return b2 < a3.length ? { done: false, value: a3[b2++] } : { done: true }; - }; - } - function da2() { - da2 = function() { - }; - e18.Symbol || (e18.Symbol = ea2); - } - function fa2(a3, b2) { - this.a = a3; - aa2(this, "description", { configurable: true, writable: true, value: b2 }); - } - fa2.prototype.toString = function() { - return this.a; - }; - var ea2 = function() { - function a3(c2) { - if (this instanceof a3) - throw new TypeError("Symbol is not a constructor"); - return new fa2("jscomp_symbol_" + (c2 || "") + "_" + b2++, c2); - } - var b2 = 0; - return a3; - }(); - function ha2() { - da2(); - var a3 = e18.Symbol.iterator; - a3 || (a3 = e18.Symbol.iterator = e18.Symbol("Symbol.iterator")); - "function" != typeof Array.prototype[a3] && aa2(Array.prototype, a3, { configurable: true, writable: true, value: function() { - return ia2(ca2(this)); - } }); - ha2 = function() { - }; - } - function ia2(a3) { - ha2(); - a3 = { next: a3 }; - a3[e18.Symbol.iterator] = function() { - return this; - }; - return a3; - } - function ja2(a3, b2) { - ha2(); - a3 instanceof String && (a3 += ""); - var c2 = 0, d4 = { next: function() { - if (c2 < a3.length) { - var f3 = c2++; - return { value: b2(f3, a3[f3]), done: false }; - } - d4.next = function() { - return { done: true, value: void 0 }; - }; - return d4.next(); - } }; - d4[Symbol.iterator] = function() { - return d4; - }; - return d4; - } - ba2("Array.prototype.entries", function(a3) { - return a3 ? a3 : function() { - return ja2(this, function(b2, c2) { - return [b2, c2]; - }); - }; - }); - var ka2 = commonjsGlobal || self; - function g3(a3, b2, c2) { - a3 = a3.split("."); - c2 = c2 || ka2; - a3[0] in c2 || "undefined" == typeof c2.execScript || c2.execScript("var " + a3[0]); - for (var d4; a3.length && (d4 = a3.shift()); ) - a3.length || void 0 === b2 ? c2[d4] && c2[d4] !== Object.prototype[d4] ? c2 = c2[d4] : c2 = c2[d4] = {} : c2[d4] = b2; - } - function k2(a3) { - var b2 = typeof a3; - if ("object" == b2) - if (a3) { - if (a3 instanceof Array) - return "array"; - if (a3 instanceof Object) - return b2; - var c2 = Object.prototype.toString.call(a3); - if ("[object Window]" == c2) - return "object"; - if ("[object Array]" == c2 || "number" == typeof a3.length && "undefined" != typeof a3.splice && "undefined" != typeof a3.propertyIsEnumerable && !a3.propertyIsEnumerable("splice")) - return "array"; - if ("[object Function]" == c2 || "undefined" != typeof a3.call && "undefined" != typeof a3.propertyIsEnumerable && !a3.propertyIsEnumerable("call")) - return "function"; - } else - return "null"; - else if ("function" == b2 && "undefined" == typeof a3.call) - return "object"; - return b2; - } - function la2(a3) { - var b2 = typeof a3; - return "object" == b2 && null != a3 || "function" == b2; - } - function ma2(a3, b2, c2) { - g3(a3, b2, c2); - } - function na2(a3, b2) { - function c2() { - } - c2.prototype = b2.prototype; - a3.prototype = new c2(); - a3.prototype.constructor = a3; - } - var oa2 = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); - function pa2(a3, b2) { - for (var c2, d4, f3 = 1; f3 < arguments.length; f3++) { - d4 = arguments[f3]; - for (c2 in d4) - a3[c2] = d4[c2]; - for (var h4 = 0; h4 < oa2.length; h4++) - c2 = oa2[h4], Object.prototype.hasOwnProperty.call(d4, c2) && (a3[c2] = d4[c2]); - } - } - var qa2 = Array.prototype.forEach ? function(a3, b2) { - Array.prototype.forEach.call(a3, b2, void 0); - } : function(a3, b2) { - for (var c2 = a3.length, d4 = "string" === typeof a3 ? a3.split("") : a3, f3 = 0; f3 < c2; f3++) - f3 in d4 && b2.call(void 0, d4[f3], f3, a3); - }, l2 = Array.prototype.map ? function(a3, b2) { - return Array.prototype.map.call(a3, b2, void 0); - } : function(a3, b2) { - for (var c2 = a3.length, d4 = Array(c2), f3 = "string" === typeof a3 ? a3.split("") : a3, h4 = 0; h4 < c2; h4++) - h4 in f3 && (d4[h4] = b2.call(void 0, f3[h4], h4, a3)); - return d4; - }; - function ra2(a3, b2, c2) { - return 2 >= arguments.length ? Array.prototype.slice.call(a3, b2) : Array.prototype.slice.call(a3, b2, c2); - } - function sa2(a3, b2, c2, d4) { - var f3 = "Assertion failed"; - if (c2) { - f3 += ": " + c2; - var h4 = d4; - } else - a3 && (f3 += ": " + a3, h4 = b2); - throw Error(f3, h4 || []); - } - function n4(a3, b2, c2) { - for (var d4 = [], f3 = 2; f3 < arguments.length; ++f3) - d4[f3 - 2] = arguments[f3]; - a3 || sa2("", null, b2, d4); - return a3; - } - function ta2(a3, b2, c2) { - for (var d4 = [], f3 = 2; f3 < arguments.length; ++f3) - d4[f3 - 2] = arguments[f3]; - "string" !== typeof a3 && sa2("Expected string but got %s: %s.", [k2(a3), a3], b2, d4); - } - function ua2(a3, b2, c2) { - for (var d4 = [], f3 = 2; f3 < arguments.length; ++f3) - d4[f3 - 2] = arguments[f3]; - Array.isArray(a3) || sa2("Expected array but got %s: %s.", [k2(a3), a3], b2, d4); - } - function p3(a3, b2) { - for (var c2 = [], d4 = 1; d4 < arguments.length; ++d4) - c2[d4 - 1] = arguments[d4]; - throw Error("Failure" + (a3 ? ": " + a3 : ""), c2); - } - function q2(a3, b2, c2, d4) { - for (var f3 = [], h4 = 3; h4 < arguments.length; ++h4) - f3[h4 - 3] = arguments[h4]; - a3 instanceof b2 || sa2("Expected instanceof %s but got %s.", [va2(b2), va2(a3)], c2, f3); - } - function va2(a3) { - return a3 instanceof Function ? a3.displayName || a3.name || "unknown type name" : a3 instanceof Object ? a3.constructor.displayName || a3.constructor.name || Object.prototype.toString.call(a3) : null === a3 ? "null" : typeof a3; - } - function r2(a3, b2) { - this.c = a3; - this.b = b2; - this.a = {}; - this.arrClean = true; - if (0 < this.c.length) { - for (a3 = 0; a3 < this.c.length; a3++) { - b2 = this.c[a3]; - var c2 = b2[0]; - this.a[c2.toString()] = new wa2(c2, b2[1]); - } - this.arrClean = true; - } - } - g3("jspb.Map", r2, void 0); - r2.prototype.g = function() { - if (this.arrClean) { - if (this.b) { - var a3 = this.a, b2; - for (b2 in a3) - if (Object.prototype.hasOwnProperty.call(a3, b2)) { - var c2 = a3[b2].a; - c2 && c2.g(); - } - } - } else { - this.c.length = 0; - a3 = u2(this); - a3.sort(); - for (b2 = 0; b2 < a3.length; b2++) { - var d4 = this.a[a3[b2]]; - (c2 = d4.a) && c2.g(); - this.c.push([d4.key, d4.value]); - } - this.arrClean = true; - } - return this.c; - }; - r2.prototype.toArray = r2.prototype.g; - r2.prototype.Mc = function(a3, b2) { - for (var c2 = this.g(), d4 = [], f3 = 0; f3 < c2.length; f3++) { - var h4 = this.a[c2[f3][0].toString()]; - v6(this, h4); - var m3 = h4.a; - m3 ? (n4(b2), d4.push([h4.key, b2(a3, m3)])) : d4.push([h4.key, h4.value]); - } - return d4; - }; - r2.prototype.toObject = r2.prototype.Mc; - r2.fromObject = function(a3, b2, c2) { - b2 = new r2([], b2); - for (var d4 = 0; d4 < a3.length; d4++) { - var f3 = a3[d4][0], h4 = c2(a3[d4][1]); - b2.set(f3, h4); - } - return b2; - }; - function w2(a3) { - this.a = 0; - this.b = a3; - } - w2.prototype.next = function() { - return this.a < this.b.length ? { done: false, value: this.b[this.a++] } : { done: true, value: void 0 }; - }; - "undefined" != typeof Symbol && (w2.prototype[Symbol.iterator] = function() { - return this; - }); - r2.prototype.Jb = function() { - return u2(this).length; - }; - r2.prototype.getLength = r2.prototype.Jb; - r2.prototype.clear = function() { - this.a = {}; - this.arrClean = false; - }; - r2.prototype.clear = r2.prototype.clear; - r2.prototype.Cb = function(a3) { - a3 = a3.toString(); - var b2 = this.a.hasOwnProperty(a3); - delete this.a[a3]; - this.arrClean = false; - return b2; - }; - r2.prototype.del = r2.prototype.Cb; - r2.prototype.Eb = function() { - var a3 = [], b2 = u2(this); - b2.sort(); - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = this.a[b2[c2]]; - a3.push([d4.key, d4.value]); - } - return a3; - }; - r2.prototype.getEntryList = r2.prototype.Eb; - r2.prototype.entries = function() { - var a3 = [], b2 = u2(this); - b2.sort(); - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = this.a[b2[c2]]; - a3.push([d4.key, v6(this, d4)]); - } - return new w2(a3); - }; - r2.prototype.entries = r2.prototype.entries; - r2.prototype.keys = function() { - var a3 = [], b2 = u2(this); - b2.sort(); - for (var c2 = 0; c2 < b2.length; c2++) - a3.push(this.a[b2[c2]].key); - return new w2(a3); - }; - r2.prototype.keys = r2.prototype.keys; - r2.prototype.values = function() { - var a3 = [], b2 = u2(this); - b2.sort(); - for (var c2 = 0; c2 < b2.length; c2++) - a3.push(v6(this, this.a[b2[c2]])); - return new w2(a3); - }; - r2.prototype.values = r2.prototype.values; - r2.prototype.forEach = function(a3, b2) { - var c2 = u2(this); - c2.sort(); - for (var d4 = 0; d4 < c2.length; d4++) { - var f3 = this.a[c2[d4]]; - a3.call(b2, v6(this, f3), f3.key, this); - } - }; - r2.prototype.forEach = r2.prototype.forEach; - r2.prototype.set = function(a3, b2) { - var c2 = new wa2(a3); - this.b ? (c2.a = b2, c2.value = b2.g()) : c2.value = b2; - this.a[a3.toString()] = c2; - this.arrClean = false; - return this; - }; - r2.prototype.set = r2.prototype.set; - function v6(a3, b2) { - return a3.b ? (b2.a || (b2.a = new a3.b(b2.value)), b2.a) : b2.value; - } - r2.prototype.get = function(a3) { - if (a3 = this.a[a3.toString()]) - return v6(this, a3); - }; - r2.prototype.get = r2.prototype.get; - r2.prototype.has = function(a3) { - return a3.toString() in this.a; - }; - r2.prototype.has = r2.prototype.has; - r2.prototype.Jc = function(a3, b2, c2, d4, f3) { - var h4 = u2(this); - h4.sort(); - for (var m3 = 0; m3 < h4.length; m3++) { - var t2 = this.a[h4[m3]]; - b2.Va(a3); - c2.call(b2, 1, t2.key); - this.b ? d4.call(b2, 2, v6(this, t2), f3) : d4.call(b2, 2, t2.value); - b2.Ya(); - } - }; - r2.prototype.serializeBinary = r2.prototype.Jc; - r2.deserializeBinary = function(a3, b2, c2, d4, f3, h4, m3) { - for (; b2.oa() && !b2.bb(); ) { - var t2 = b2.c; - 1 == t2 ? h4 = c2.call(b2) : 2 == t2 && (a3.b ? (n4(f3), m3 || (m3 = new a3.b()), d4.call(b2, m3, f3)) : m3 = d4.call(b2)); - } - n4(void 0 != h4); - n4(void 0 != m3); - a3.set(h4, m3); - }; - function u2(a3) { - a3 = a3.a; - var b2 = [], c2; - for (c2 in a3) - Object.prototype.hasOwnProperty.call(a3, c2) && b2.push(c2); - return b2; - } - function wa2(a3, b2) { - this.key = a3; - this.value = b2; - this.a = void 0; - } - function xa2(a3) { - if (8192 >= a3.length) - return String.fromCharCode.apply(null, a3); - for (var b2 = "", c2 = 0; c2 < a3.length; c2 += 8192) - b2 += String.fromCharCode.apply(null, ra2(a3, c2, c2 + 8192)); - return b2; - } - var ya2 = { "\0": "\\0", "\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", " ": "\\t", "\v": "\\x0B", '"': '\\"', "\\": "\\\\", "<": "\\u003C" }, za2 = { "'": "\\'" }; - var Aa2 = {}, x3 = null; - function Ba2(a3, b2) { - void 0 === b2 && (b2 = 0); - Ca2(); - b2 = Aa2[b2]; - for (var c2 = [], d4 = 0; d4 < a3.length; d4 += 3) { - var f3 = a3[d4], h4 = d4 + 1 < a3.length, m3 = h4 ? a3[d4 + 1] : 0, t2 = d4 + 2 < a3.length, B2 = t2 ? a3[d4 + 2] : 0, M3 = f3 >> 2; - f3 = (f3 & 3) << 4 | m3 >> 4; - m3 = (m3 & 15) << 2 | B2 >> 6; - B2 &= 63; - t2 || (B2 = 64, h4 || (m3 = 64)); - c2.push(b2[M3], b2[f3], b2[m3] || "", b2[B2] || ""); - } - return c2.join(""); - } - function Da2(a3) { - var b2 = a3.length, c2 = 3 * b2 / 4; - c2 % 3 ? c2 = Math.floor(c2) : -1 != "=.".indexOf(a3[b2 - 1]) && (c2 = -1 != "=.".indexOf(a3[b2 - 2]) ? c2 - 2 : c2 - 1); - var d4 = new Uint8Array(c2), f3 = 0; - Ea2(a3, function(h4) { - d4[f3++] = h4; - }); - return d4.subarray(0, f3); - } - function Ea2(a3, b2) { - function c2(B2) { - for (; d4 < a3.length; ) { - var M3 = a3.charAt(d4++), La2 = x3[M3]; - if (null != La2) - return La2; - if (!/^[\s\xa0]*$/.test(M3)) - throw Error("Unknown base64 encoding at char: " + M3); - } - return B2; - } - Ca2(); - for (var d4 = 0; ; ) { - var f3 = c2(-1), h4 = c2(0), m3 = c2(64), t2 = c2(64); - if (64 === t2 && -1 === f3) - break; - b2(f3 << 2 | h4 >> 4); - 64 != m3 && (b2(h4 << 4 & 240 | m3 >> 2), 64 != t2 && b2(m3 << 6 & 192 | t2)); - } - } - function Ca2() { - if (!x3) { - x3 = {}; - for (var a3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""), b2 = ["+/=", "+/", "-_=", "-_.", "-_"], c2 = 0; 5 > c2; c2++) { - var d4 = a3.concat(b2[c2].split("")); - Aa2[c2] = d4; - for (var f3 = 0; f3 < d4.length; f3++) { - var h4 = d4[f3]; - void 0 === x3[h4] && (x3[h4] = f3); - } - } - } - } - g3("jspb.ConstBinaryMessage", function() { - }, void 0); - g3("jspb.BinaryMessage", function() { - }, void 0); - g3("jspb.BinaryConstants.FieldType", { yb: -1, ee: 1, FLOAT: 2, ke: 3, te: 4, je: 5, xb: 6, wb: 7, BOOL: 8, re: 9, ie: 10, le: 11, ce: 12, se: 13, ge: 14, me: 15, ne: 16, oe: 17, pe: 18, he: 30, ve: 31 }, void 0); - g3("jspb.BinaryConstants.WireType", { yb: -1, ue: 0, xb: 1, de: 2, qe: 3, fe: 4, wb: 5 }, void 0); - g3("jspb.BinaryConstants.FieldTypeToWireType", function(a3) { - switch (a3) { - case 5: - case 3: - case 13: - case 4: - case 17: - case 18: - case 8: - case 14: - case 31: - return 0; - case 1: - case 6: - case 16: - case 30: - return 1; - case 9: - case 11: - case 12: - return 2; - case 2: - case 7: - case 15: - return 5; - default: - return -1; - } - }, void 0); - g3("jspb.BinaryConstants.INVALID_FIELD_NUMBER", -1, void 0); - g3("jspb.BinaryConstants.FLOAT32_EPS", 1401298464324817e-60, void 0); - g3("jspb.BinaryConstants.FLOAT32_MIN", 11754943508222875e-54, void 0); - g3("jspb.BinaryConstants.FLOAT32_MAX", 34028234663852886e22, void 0); - g3("jspb.BinaryConstants.FLOAT64_EPS", 5e-324, void 0); - g3("jspb.BinaryConstants.FLOAT64_MIN", 22250738585072014e-324, void 0); - g3("jspb.BinaryConstants.FLOAT64_MAX", 17976931348623157e292, void 0); - g3("jspb.BinaryConstants.TWO_TO_20", 1048576, void 0); - g3("jspb.BinaryConstants.TWO_TO_23", 8388608, void 0); - g3("jspb.BinaryConstants.TWO_TO_31", 2147483648, void 0); - g3("jspb.BinaryConstants.TWO_TO_32", 4294967296, void 0); - g3("jspb.BinaryConstants.TWO_TO_52", 4503599627370496, void 0); - g3("jspb.BinaryConstants.TWO_TO_63", 9223372036854776e3, void 0); - g3("jspb.BinaryConstants.TWO_TO_64", 18446744073709552e3, void 0); - g3("jspb.BinaryConstants.ZERO_HASH", "\0\0\0\0\0\0\0\0", void 0); - var y3 = 0, z3 = 0; - g3("jspb.utils.getSplit64Low", function() { - return y3; - }, void 0); - g3("jspb.utils.getSplit64High", function() { - return z3; - }, void 0); - function Fa2(a3) { - var b2 = a3 >>> 0; - a3 = Math.floor((a3 - b2) / 4294967296) >>> 0; - y3 = b2; - z3 = a3; - } - g3("jspb.utils.splitUint64", Fa2, void 0); - function A2(a3) { - var b2 = 0 > a3; - a3 = Math.abs(a3); - var c2 = a3 >>> 0; - a3 = Math.floor((a3 - c2) / 4294967296); - a3 >>>= 0; - b2 && (a3 = ~a3 >>> 0, c2 = (~c2 >>> 0) + 1, 4294967295 < c2 && (c2 = 0, a3++, 4294967295 < a3 && (a3 = 0))); - y3 = c2; - z3 = a3; - } - g3("jspb.utils.splitInt64", A2, void 0); - function Ga2(a3) { - var b2 = 0 > a3; - a3 = 2 * Math.abs(a3); - Fa2(a3); - a3 = y3; - var c2 = z3; - b2 && (0 == a3 ? 0 == c2 ? c2 = a3 = 4294967295 : (c2--, a3 = 4294967295) : a3--); - y3 = a3; - z3 = c2; - } - g3("jspb.utils.splitZigzag64", Ga2, void 0); - function Ha2(a3) { - var b2 = 0 > a3 ? 1 : 0; - a3 = b2 ? -a3 : a3; - if (0 === a3) - 0 < 1 / a3 ? y3 = z3 = 0 : (z3 = 0, y3 = 2147483648); - else if (isNaN(a3)) - z3 = 0, y3 = 2147483647; - else if (34028234663852886e22 < a3) - z3 = 0, y3 = (b2 << 31 | 2139095040) >>> 0; - else if (11754943508222875e-54 > a3) - a3 = Math.round(a3 / Math.pow(2, -149)), z3 = 0, y3 = (b2 << 31 | a3) >>> 0; - else { - var c2 = Math.floor(Math.log(a3) / Math.LN2); - a3 *= Math.pow(2, -c2); - a3 = Math.round(8388608 * a3); - 16777216 <= a3 && ++c2; - z3 = 0; - y3 = (b2 << 31 | c2 + 127 << 23 | a3 & 8388607) >>> 0; - } - } - g3("jspb.utils.splitFloat32", Ha2, void 0); - function Ia2(a3) { - var b2 = 0 > a3 ? 1 : 0; - a3 = b2 ? -a3 : a3; - if (0 === a3) - z3 = 0 < 1 / a3 ? 0 : 2147483648, y3 = 0; - else if (isNaN(a3)) - z3 = 2147483647, y3 = 4294967295; - else if (17976931348623157e292 < a3) - z3 = (b2 << 31 | 2146435072) >>> 0, y3 = 0; - else if (22250738585072014e-324 > a3) - a3 /= Math.pow(2, -1074), z3 = (b2 << 31 | a3 / 4294967296) >>> 0, y3 = a3 >>> 0; - else { - var c2 = a3, d4 = 0; - if (2 <= c2) - for (; 2 <= c2 && 1023 > d4; ) - d4++, c2 /= 2; - else - for (; 1 > c2 && -1022 < d4; ) - c2 *= 2, d4--; - a3 *= Math.pow(2, -d4); - z3 = (b2 << 31 | d4 + 1023 << 20 | 1048576 * a3 & 1048575) >>> 0; - y3 = 4503599627370496 * a3 >>> 0; - } - } - g3("jspb.utils.splitFloat64", Ia2, void 0); - function C3(a3) { - var b2 = a3.charCodeAt(4), c2 = a3.charCodeAt(5), d4 = a3.charCodeAt(6), f3 = a3.charCodeAt(7); - y3 = a3.charCodeAt(0) + (a3.charCodeAt(1) << 8) + (a3.charCodeAt(2) << 16) + (a3.charCodeAt(3) << 24) >>> 0; - z3 = b2 + (c2 << 8) + (d4 << 16) + (f3 << 24) >>> 0; - } - g3("jspb.utils.splitHash64", C3, void 0); - function D2(a3, b2) { - return 4294967296 * b2 + (a3 >>> 0); - } - g3("jspb.utils.joinUint64", D2, void 0); - function E2(a3, b2) { - var c2 = b2 & 2147483648; - c2 && (a3 = ~a3 + 1 >>> 0, b2 = ~b2 >>> 0, 0 == a3 && (b2 = b2 + 1 >>> 0)); - a3 = D2(a3, b2); - return c2 ? -a3 : a3; - } - g3("jspb.utils.joinInt64", E2, void 0); - function Ja2(a3, b2, c2) { - var d4 = b2 >> 31; - return c2(a3 << 1 ^ d4, (b2 << 1 | a3 >>> 31) ^ d4); - } - g3("jspb.utils.toZigzag64", Ja2, void 0); - function Ka2(a3, b2) { - return Ma2(a3, b2, E2); - } - g3("jspb.utils.joinZigzag64", Ka2, void 0); - function Ma2(a3, b2, c2) { - var d4 = -(a3 & 1); - return c2((a3 >>> 1 | b2 << 31) ^ d4, b2 >>> 1 ^ d4); - } - g3("jspb.utils.fromZigzag64", Ma2, void 0); - function Na2(a3) { - var b2 = 2 * (a3 >> 31) + 1, c2 = a3 >>> 23 & 255; - a3 &= 8388607; - return 255 == c2 ? a3 ? NaN : Infinity * b2 : 0 == c2 ? b2 * Math.pow(2, -149) * a3 : b2 * Math.pow(2, c2 - 150) * (a3 + Math.pow(2, 23)); - } - g3("jspb.utils.joinFloat32", Na2, void 0); - function Oa2(a3, b2) { - var c2 = 2 * (b2 >> 31) + 1, d4 = b2 >>> 20 & 2047; - a3 = 4294967296 * (b2 & 1048575) + a3; - return 2047 == d4 ? a3 ? NaN : Infinity * c2 : 0 == d4 ? c2 * Math.pow(2, -1074) * a3 : c2 * Math.pow(2, d4 - 1075) * (a3 + 4503599627370496); - } - g3("jspb.utils.joinFloat64", Oa2, void 0); - function Pa2(a3, b2) { - return String.fromCharCode(a3 >>> 0 & 255, a3 >>> 8 & 255, a3 >>> 16 & 255, a3 >>> 24 & 255, b2 >>> 0 & 255, b2 >>> 8 & 255, b2 >>> 16 & 255, b2 >>> 24 & 255); - } - g3("jspb.utils.joinHash64", Pa2, void 0); - g3("jspb.utils.DIGITS", "0123456789abcdef".split(""), void 0); - function F2(a3, b2) { - function c2(f3, h4) { - f3 = f3 ? String(f3) : ""; - return h4 ? "0000000".slice(f3.length) + f3 : f3; - } - if (2097151 >= b2) - return "" + D2(a3, b2); - var d4 = (a3 >>> 24 | b2 << 8) >>> 0 & 16777215; - b2 = b2 >> 16 & 65535; - a3 = (a3 & 16777215) + 6777216 * d4 + 6710656 * b2; - d4 += 8147497 * b2; - b2 *= 2; - 1e7 <= a3 && (d4 += Math.floor(a3 / 1e7), a3 %= 1e7); - 1e7 <= d4 && (b2 += Math.floor(d4 / 1e7), d4 %= 1e7); - return c2(b2, 0) + c2(d4, b2) + c2(a3, 1); - } - g3("jspb.utils.joinUnsignedDecimalString", F2, void 0); - function G2(a3, b2) { - var c2 = b2 & 2147483648; - c2 && (a3 = ~a3 + 1 >>> 0, b2 = ~b2 + (0 == a3 ? 1 : 0) >>> 0); - a3 = F2(a3, b2); - return c2 ? "-" + a3 : a3; - } - g3("jspb.utils.joinSignedDecimalString", G2, void 0); - function Qa2(a3, b2) { - C3(a3); - a3 = y3; - var c2 = z3; - return b2 ? G2(a3, c2) : F2(a3, c2); - } - g3("jspb.utils.hash64ToDecimalString", Qa2, void 0); - g3("jspb.utils.hash64ArrayToDecimalStrings", function(a3, b2) { - for (var c2 = Array(a3.length), d4 = 0; d4 < a3.length; d4++) - c2[d4] = Qa2(a3[d4], b2); - return c2; - }, void 0); - function H2(a3) { - function b2(m3, t2) { - for (var B2 = 0; 8 > B2 && (1 !== m3 || 0 < t2); B2++) - t2 = m3 * f3[B2] + t2, f3[B2] = t2 & 255, t2 >>>= 8; - } - function c2() { - for (var m3 = 0; 8 > m3; m3++) - f3[m3] = ~f3[m3] & 255; - } - n4(0 < a3.length); - var d4 = false; - "-" === a3[0] && (d4 = true, a3 = a3.slice(1)); - for (var f3 = [0, 0, 0, 0, 0, 0, 0, 0], h4 = 0; h4 < a3.length; h4++) - b2(10, a3.charCodeAt(h4) - 48); - d4 && (c2(), b2(1, 1)); - return xa2(f3); - } - g3("jspb.utils.decimalStringToHash64", H2, void 0); - g3("jspb.utils.splitDecimalString", function(a3) { - C3(H2(a3)); - }, void 0); - function Ra2(a3) { - return String.fromCharCode(10 > a3 ? 48 + a3 : 87 + a3); - } - function Sa2(a3) { - return 97 <= a3 ? a3 - 97 + 10 : a3 - 48; - } - g3("jspb.utils.hash64ToHexString", function(a3) { - var b2 = Array(18); - b2[0] = "0"; - b2[1] = "x"; - for (var c2 = 0; 8 > c2; c2++) { - var d4 = a3.charCodeAt(7 - c2); - b2[2 * c2 + 2] = Ra2(d4 >> 4); - b2[2 * c2 + 3] = Ra2(d4 & 15); - } - return b2.join(""); - }, void 0); - g3("jspb.utils.hexStringToHash64", function(a3) { - a3 = a3.toLowerCase(); - n4(18 == a3.length); - n4("0" == a3[0]); - n4("x" == a3[1]); - for (var b2 = "", c2 = 0; 8 > c2; c2++) - b2 = String.fromCharCode(16 * Sa2(a3.charCodeAt(2 * c2 + 2)) + Sa2(a3.charCodeAt(2 * c2 + 3))) + b2; - return b2; - }, void 0); - g3("jspb.utils.hash64ToNumber", function(a3, b2) { - C3(a3); - a3 = y3; - var c2 = z3; - return b2 ? E2(a3, c2) : D2(a3, c2); - }, void 0); - g3("jspb.utils.numberToHash64", function(a3) { - A2(a3); - return Pa2(y3, z3); - }, void 0); - g3("jspb.utils.countVarints", function(a3, b2, c2) { - for (var d4 = 0, f3 = b2; f3 < c2; f3++) - d4 += a3[f3] >> 7; - return c2 - b2 - d4; - }, void 0); - g3("jspb.utils.countVarintFields", function(a3, b2, c2, d4) { - var f3 = 0; - d4 *= 8; - if (128 > d4) - for (; b2 < c2 && a3[b2++] == d4; ) - for (f3++; ; ) { - var h4 = a3[b2++]; - if (0 == (h4 & 128)) - break; - } - else - for (; b2 < c2; ) { - for (h4 = d4; 128 < h4; ) { - if (a3[b2] != (h4 & 127 | 128)) - return f3; - b2++; - h4 >>= 7; - } - if (a3[b2++] != h4) - break; - for (f3++; h4 = a3[b2++], 0 != (h4 & 128); ) - ; - } - return f3; - }, void 0); - function Ta2(a3, b2, c2, d4, f3) { - var h4 = 0; - if (128 > d4) - for (; b2 < c2 && a3[b2++] == d4; ) - h4++, b2 += f3; - else - for (; b2 < c2; ) { - for (var m3 = d4; 128 < m3; ) { - if (a3[b2++] != (m3 & 127 | 128)) - return h4; - m3 >>= 7; - } - if (a3[b2++] != m3) - break; - h4++; - b2 += f3; - } - return h4; - } - g3("jspb.utils.countFixed32Fields", function(a3, b2, c2, d4) { - return Ta2(a3, b2, c2, 8 * d4 + 5, 4); - }, void 0); - g3("jspb.utils.countFixed64Fields", function(a3, b2, c2, d4) { - return Ta2(a3, b2, c2, 8 * d4 + 1, 8); - }, void 0); - g3("jspb.utils.countDelimitedFields", function(a3, b2, c2, d4) { - var f3 = 0; - for (d4 = 8 * d4 + 2; b2 < c2; ) { - for (var h4 = d4; 128 < h4; ) { - if (a3[b2++] != (h4 & 127 | 128)) - return f3; - h4 >>= 7; - } - if (a3[b2++] != h4) - break; - f3++; - for (var m3 = 0, t2 = 1; h4 = a3[b2++], m3 += (h4 & 127) * t2, t2 *= 128, 0 != (h4 & 128); ) - ; - b2 += m3; - } - return f3; - }, void 0); - g3("jspb.utils.debugBytesToTextFormat", function(a3) { - var b2 = '"'; - if (a3) { - a3 = Ua2(a3); - for (var c2 = 0; c2 < a3.length; c2++) - b2 += "\\x", 16 > a3[c2] && (b2 += "0"), b2 += a3[c2].toString(16); - } - return b2 + '"'; - }, void 0); - g3("jspb.utils.debugScalarToTextFormat", function(a3) { - if ("string" === typeof a3) { - a3 = String(a3); - for (var b2 = ['"'], c2 = 0; c2 < a3.length; c2++) { - var d4 = a3.charAt(c2), f3 = d4.charCodeAt(0), h4 = c2 + 1, m3; - if (!(m3 = ya2[d4])) { - if (!(31 < f3 && 127 > f3)) - if (f3 = d4, f3 in za2) - d4 = za2[f3]; - else if (f3 in ya2) - d4 = za2[f3] = ya2[f3]; - else { - m3 = f3.charCodeAt(0); - if (31 < m3 && 127 > m3) - d4 = f3; - else { - if (256 > m3) { - if (d4 = "\\x", 16 > m3 || 256 < m3) - d4 += "0"; - } else - d4 = "\\u", 4096 > m3 && (d4 += "0"); - d4 += m3.toString(16).toUpperCase(); - } - d4 = za2[f3] = d4; - } - m3 = d4; - } - b2[h4] = m3; - } - b2.push('"'); - a3 = b2.join(""); - } else - a3 = a3.toString(); - return a3; - }, void 0); - g3("jspb.utils.stringToByteArray", function(a3) { - for (var b2 = new Uint8Array(a3.length), c2 = 0; c2 < a3.length; c2++) { - var d4 = a3.charCodeAt(c2); - if (255 < d4) - throw Error("Conversion error: string contains codepoint outside of byte range"); - b2[c2] = d4; - } - return b2; - }, void 0); - function Ua2(a3) { - if (a3.constructor === Uint8Array) - return a3; - if (a3.constructor === ArrayBuffer) - return new Uint8Array(a3); - if (a3.constructor === Array) - return new Uint8Array(a3); - if (a3.constructor === String) - return Da2(a3); - if (a3 instanceof Uint8Array) - return new Uint8Array(a3.buffer, a3.byteOffset, a3.byteLength); - p3("Type not convertible to Uint8Array."); - return new Uint8Array(0); - } - g3("jspb.utils.byteSourceToUint8Array", Ua2, void 0); - function I2(a3, b2, c2) { - this.b = null; - this.a = this.c = this.h = 0; - this.v = false; - a3 && this.H(a3, b2, c2); - } - g3("jspb.BinaryDecoder", I2, void 0); - var Va2 = []; - I2.getInstanceCacheLength = function() { - return Va2.length; - }; - function Wa2(a3, b2, c2) { - if (Va2.length) { - var d4 = Va2.pop(); - a3 && d4.H(a3, b2, c2); - return d4; - } - return new I2(a3, b2, c2); - } - I2.alloc = Wa2; - I2.prototype.Ca = function() { - this.clear(); - 100 > Va2.length && Va2.push(this); - }; - I2.prototype.free = I2.prototype.Ca; - I2.prototype.clone = function() { - return Wa2(this.b, this.h, this.c - this.h); - }; - I2.prototype.clone = I2.prototype.clone; - I2.prototype.clear = function() { - this.b = null; - this.a = this.c = this.h = 0; - this.v = false; - }; - I2.prototype.clear = I2.prototype.clear; - I2.prototype.Y = function() { - return this.b; - }; - I2.prototype.getBuffer = I2.prototype.Y; - I2.prototype.H = function(a3, b2, c2) { - this.b = Ua2(a3); - this.h = void 0 !== b2 ? b2 : 0; - this.c = void 0 !== c2 ? this.h + c2 : this.b.length; - this.a = this.h; - }; - I2.prototype.setBlock = I2.prototype.H; - I2.prototype.Db = function() { - return this.c; - }; - I2.prototype.getEnd = I2.prototype.Db; - I2.prototype.setEnd = function(a3) { - this.c = a3; - }; - I2.prototype.setEnd = I2.prototype.setEnd; - I2.prototype.reset = function() { - this.a = this.h; - }; - I2.prototype.reset = I2.prototype.reset; - I2.prototype.B = function() { - return this.a; - }; - I2.prototype.getCursor = I2.prototype.B; - I2.prototype.Ma = function(a3) { - this.a = a3; - }; - I2.prototype.setCursor = I2.prototype.Ma; - I2.prototype.advance = function(a3) { - this.a += a3; - n4(this.a <= this.c); - }; - I2.prototype.advance = I2.prototype.advance; - I2.prototype.ya = function() { - return this.a == this.c; - }; - I2.prototype.atEnd = I2.prototype.ya; - I2.prototype.Qb = function() { - return this.a > this.c; - }; - I2.prototype.pastEnd = I2.prototype.Qb; - I2.prototype.getError = function() { - return this.v || 0 > this.a || this.a > this.c; - }; - I2.prototype.getError = I2.prototype.getError; - I2.prototype.w = function(a3) { - for (var b2 = 128, c2 = 0, d4 = 0, f3 = 0; 4 > f3 && 128 <= b2; f3++) - b2 = this.b[this.a++], c2 |= (b2 & 127) << 7 * f3; - 128 <= b2 && (b2 = this.b[this.a++], c2 |= (b2 & 127) << 28, d4 |= (b2 & 127) >> 4); - if (128 <= b2) - for (f3 = 0; 5 > f3 && 128 <= b2; f3++) - b2 = this.b[this.a++], d4 |= (b2 & 127) << 7 * f3 + 3; - if (128 > b2) - return a3(c2 >>> 0, d4 >>> 0); - p3("Failed to read varint, encoding is invalid."); - this.v = true; - }; - I2.prototype.readSplitVarint64 = I2.prototype.w; - I2.prototype.ea = function(a3) { - return this.w(function(b2, c2) { - return Ma2(b2, c2, a3); - }); - }; - I2.prototype.readSplitZigzagVarint64 = I2.prototype.ea; - I2.prototype.ta = function(a3) { - var b2 = this.b, c2 = this.a; - this.a += 8; - for (var d4 = 0, f3 = 0, h4 = c2 + 7; h4 >= c2; h4--) - d4 = d4 << 8 | b2[h4], f3 = f3 << 8 | b2[h4 + 4]; - return a3(d4, f3); - }; - I2.prototype.readSplitFixed64 = I2.prototype.ta; - I2.prototype.kb = function() { - for (; this.b[this.a] & 128; ) - this.a++; - this.a++; - }; - I2.prototype.skipVarint = I2.prototype.kb; - I2.prototype.mb = function(a3) { - for (; 128 < a3; ) - this.a--, a3 >>>= 7; - this.a--; - }; - I2.prototype.unskipVarint = I2.prototype.mb; - I2.prototype.o = function() { - var a3 = this.b; - var b2 = a3[this.a]; - var c2 = b2 & 127; - if (128 > b2) - return this.a += 1, n4(this.a <= this.c), c2; - b2 = a3[this.a + 1]; - c2 |= (b2 & 127) << 7; - if (128 > b2) - return this.a += 2, n4(this.a <= this.c), c2; - b2 = a3[this.a + 2]; - c2 |= (b2 & 127) << 14; - if (128 > b2) - return this.a += 3, n4(this.a <= this.c), c2; - b2 = a3[this.a + 3]; - c2 |= (b2 & 127) << 21; - if (128 > b2) - return this.a += 4, n4(this.a <= this.c), c2; - b2 = a3[this.a + 4]; - c2 |= (b2 & 15) << 28; - if (128 > b2) - return this.a += 5, n4(this.a <= this.c), c2 >>> 0; - this.a += 5; - 128 <= a3[this.a++] && 128 <= a3[this.a++] && 128 <= a3[this.a++] && 128 <= a3[this.a++] && 128 <= a3[this.a++] && n4(false); - n4(this.a <= this.c); - return c2; - }; - I2.prototype.readUnsignedVarint32 = I2.prototype.o; - I2.prototype.da = function() { - return ~~this.o(); - }; - I2.prototype.readSignedVarint32 = I2.prototype.da; - I2.prototype.O = function() { - return this.o().toString(); - }; - I2.prototype.Ea = function() { - return this.da().toString(); - }; - I2.prototype.readSignedVarint32String = I2.prototype.Ea; - I2.prototype.Ia = function() { - var a3 = this.o(); - return a3 >>> 1 ^ -(a3 & 1); - }; - I2.prototype.readZigzagVarint32 = I2.prototype.Ia; - I2.prototype.Ga = function() { - return this.w(D2); - }; - I2.prototype.readUnsignedVarint64 = I2.prototype.Ga; - I2.prototype.Ha = function() { - return this.w(F2); - }; - I2.prototype.readUnsignedVarint64String = I2.prototype.Ha; - I2.prototype.sa = function() { - return this.w(E2); - }; - I2.prototype.readSignedVarint64 = I2.prototype.sa; - I2.prototype.Fa = function() { - return this.w(G2); - }; - I2.prototype.readSignedVarint64String = I2.prototype.Fa; - I2.prototype.Ja = function() { - return this.w(Ka2); - }; - I2.prototype.readZigzagVarint64 = I2.prototype.Ja; - I2.prototype.fb = function() { - return this.ea(Pa2); - }; - I2.prototype.readZigzagVarintHash64 = I2.prototype.fb; - I2.prototype.Ka = function() { - return this.ea(G2); - }; - I2.prototype.readZigzagVarint64String = I2.prototype.Ka; - I2.prototype.Gc = function() { - var a3 = this.b[this.a]; - this.a += 1; - n4(this.a <= this.c); - return a3; - }; - I2.prototype.readUint8 = I2.prototype.Gc; - I2.prototype.Ec = function() { - var a3 = this.b[this.a], b2 = this.b[this.a + 1]; - this.a += 2; - n4(this.a <= this.c); - return a3 << 0 | b2 << 8; - }; - I2.prototype.readUint16 = I2.prototype.Ec; - I2.prototype.m = function() { - var a3 = this.b[this.a], b2 = this.b[this.a + 1], c2 = this.b[this.a + 2], d4 = this.b[this.a + 3]; - this.a += 4; - n4(this.a <= this.c); - return (a3 << 0 | b2 << 8 | c2 << 16 | d4 << 24) >>> 0; - }; - I2.prototype.readUint32 = I2.prototype.m; - I2.prototype.ga = function() { - var a3 = this.m(), b2 = this.m(); - return D2(a3, b2); - }; - I2.prototype.readUint64 = I2.prototype.ga; - I2.prototype.ha = function() { - var a3 = this.m(), b2 = this.m(); - return F2(a3, b2); - }; - I2.prototype.readUint64String = I2.prototype.ha; - I2.prototype.Xb = function() { - var a3 = this.b[this.a]; - this.a += 1; - n4(this.a <= this.c); - return a3 << 24 >> 24; - }; - I2.prototype.readInt8 = I2.prototype.Xb; - I2.prototype.Vb = function() { - var a3 = this.b[this.a], b2 = this.b[this.a + 1]; - this.a += 2; - n4(this.a <= this.c); - return (a3 << 0 | b2 << 8) << 16 >> 16; - }; - I2.prototype.readInt16 = I2.prototype.Vb; - I2.prototype.P = function() { - var a3 = this.b[this.a], b2 = this.b[this.a + 1], c2 = this.b[this.a + 2], d4 = this.b[this.a + 3]; - this.a += 4; - n4(this.a <= this.c); - return a3 << 0 | b2 << 8 | c2 << 16 | d4 << 24; - }; - I2.prototype.readInt32 = I2.prototype.P; - I2.prototype.ba = function() { - var a3 = this.m(), b2 = this.m(); - return E2(a3, b2); - }; - I2.prototype.readInt64 = I2.prototype.ba; - I2.prototype.ca = function() { - var a3 = this.m(), b2 = this.m(); - return G2(a3, b2); - }; - I2.prototype.readInt64String = I2.prototype.ca; - I2.prototype.aa = function() { - var a3 = this.m(); - return Na2(a3); - }; - I2.prototype.readFloat = I2.prototype.aa; - I2.prototype.Z = function() { - var a3 = this.m(), b2 = this.m(); - return Oa2(a3, b2); - }; - I2.prototype.readDouble = I2.prototype.Z; - I2.prototype.pa = function() { - return !!this.b[this.a++]; - }; - I2.prototype.readBool = I2.prototype.pa; - I2.prototype.ra = function() { - return this.da(); - }; - I2.prototype.readEnum = I2.prototype.ra; - I2.prototype.fa = function(a3) { - var b2 = this.b, c2 = this.a; - a3 = c2 + a3; - for (var d4 = [], f3 = ""; c2 < a3; ) { - var h4 = b2[c2++]; - if (128 > h4) - d4.push(h4); - else if (192 > h4) - continue; - else if (224 > h4) { - var m3 = b2[c2++]; - d4.push((h4 & 31) << 6 | m3 & 63); - } else if (240 > h4) { - m3 = b2[c2++]; - var t2 = b2[c2++]; - d4.push((h4 & 15) << 12 | (m3 & 63) << 6 | t2 & 63); - } else if (248 > h4) { - m3 = b2[c2++]; - t2 = b2[c2++]; - var B2 = b2[c2++]; - h4 = (h4 & 7) << 18 | (m3 & 63) << 12 | (t2 & 63) << 6 | B2 & 63; - h4 -= 65536; - d4.push((h4 >> 10 & 1023) + 55296, (h4 & 1023) + 56320); - } - 8192 <= d4.length && (f3 += String.fromCharCode.apply(null, d4), d4.length = 0); - } - f3 += xa2(d4); - this.a = c2; - return f3; - }; - I2.prototype.readString = I2.prototype.fa; - I2.prototype.Dc = function() { - var a3 = this.o(); - return this.fa(a3); - }; - I2.prototype.readStringWithLength = I2.prototype.Dc; - I2.prototype.qa = function(a3) { - if (0 > a3 || this.a + a3 > this.b.length) - return this.v = true, p3("Invalid byte length!"), new Uint8Array(0); - var b2 = this.b.subarray(this.a, this.a + a3); - this.a += a3; - n4(this.a <= this.c); - return b2; - }; - I2.prototype.readBytes = I2.prototype.qa; - I2.prototype.ia = function() { - return this.w(Pa2); - }; - I2.prototype.readVarintHash64 = I2.prototype.ia; - I2.prototype.$ = function() { - var a3 = this.b, b2 = this.a, c2 = a3[b2], d4 = a3[b2 + 1], f3 = a3[b2 + 2], h4 = a3[b2 + 3], m3 = a3[b2 + 4], t2 = a3[b2 + 5], B2 = a3[b2 + 6]; - a3 = a3[b2 + 7]; - this.a += 8; - return String.fromCharCode(c2, d4, f3, h4, m3, t2, B2, a3); - }; - I2.prototype.readFixedHash64 = I2.prototype.$; - function J2(a3, b2, c2) { - this.a = Wa2(a3, b2, c2); - this.O = this.a.B(); - this.b = this.c = -1; - this.h = false; - this.v = null; - } - g3("jspb.BinaryReader", J2, void 0); - var K3 = []; - J2.clearInstanceCache = function() { - K3 = []; - }; - J2.getInstanceCacheLength = function() { - return K3.length; - }; - function Xa2(a3, b2, c2) { - if (K3.length) { - var d4 = K3.pop(); - a3 && d4.a.H(a3, b2, c2); - return d4; - } - return new J2(a3, b2, c2); - } - J2.alloc = Xa2; - J2.prototype.zb = Xa2; - J2.prototype.alloc = J2.prototype.zb; - J2.prototype.Ca = function() { - this.a.clear(); - this.b = this.c = -1; - this.h = false; - this.v = null; - 100 > K3.length && K3.push(this); - }; - J2.prototype.free = J2.prototype.Ca; - J2.prototype.Fb = function() { - return this.O; - }; - J2.prototype.getFieldCursor = J2.prototype.Fb; - J2.prototype.B = function() { - return this.a.B(); - }; - J2.prototype.getCursor = J2.prototype.B; - J2.prototype.Y = function() { - return this.a.Y(); - }; - J2.prototype.getBuffer = J2.prototype.Y; - J2.prototype.Hb = function() { - return this.c; - }; - J2.prototype.getFieldNumber = J2.prototype.Hb; - J2.prototype.Lb = function() { - return this.b; - }; - J2.prototype.getWireType = J2.prototype.Lb; - J2.prototype.Mb = function() { - return 2 == this.b; - }; - J2.prototype.isDelimited = J2.prototype.Mb; - J2.prototype.bb = function() { - return 4 == this.b; - }; - J2.prototype.isEndGroup = J2.prototype.bb; - J2.prototype.getError = function() { - return this.h || this.a.getError(); - }; - J2.prototype.getError = J2.prototype.getError; - J2.prototype.H = function(a3, b2, c2) { - this.a.H(a3, b2, c2); - this.b = this.c = -1; - }; - J2.prototype.setBlock = J2.prototype.H; - J2.prototype.reset = function() { - this.a.reset(); - this.b = this.c = -1; - }; - J2.prototype.reset = J2.prototype.reset; - J2.prototype.advance = function(a3) { - this.a.advance(a3); - }; - J2.prototype.advance = J2.prototype.advance; - J2.prototype.oa = function() { - if (this.a.ya()) - return false; - if (this.getError()) - return p3("Decoder hit an error"), false; - this.O = this.a.B(); - var a3 = this.a.o(), b2 = a3 >>> 3; - a3 &= 7; - if (0 != a3 && 5 != a3 && 1 != a3 && 2 != a3 && 3 != a3 && 4 != a3) - return p3("Invalid wire type: %s (at position %s)", a3, this.O), this.h = true, false; - this.c = b2; - this.b = a3; - return true; - }; - J2.prototype.nextField = J2.prototype.oa; - J2.prototype.Oa = function() { - this.a.mb(this.c << 3 | this.b); - }; - J2.prototype.unskipHeader = J2.prototype.Oa; - J2.prototype.Lc = function() { - var a3 = this.c; - for (this.Oa(); this.oa() && this.c == a3; ) - this.C(); - this.a.ya() || this.Oa(); - }; - J2.prototype.skipMatchingFields = J2.prototype.Lc; - J2.prototype.lb = function() { - 0 != this.b ? (p3("Invalid wire type for skipVarintField"), this.C()) : this.a.kb(); - }; - J2.prototype.skipVarintField = J2.prototype.lb; - J2.prototype.gb = function() { - if (2 != this.b) - p3("Invalid wire type for skipDelimitedField"), this.C(); - else { - var a3 = this.a.o(); - this.a.advance(a3); - } - }; - J2.prototype.skipDelimitedField = J2.prototype.gb; - J2.prototype.hb = function() { - 5 != this.b ? (p3("Invalid wire type for skipFixed32Field"), this.C()) : this.a.advance(4); - }; - J2.prototype.skipFixed32Field = J2.prototype.hb; - J2.prototype.ib = function() { - 1 != this.b ? (p3("Invalid wire type for skipFixed64Field"), this.C()) : this.a.advance(8); - }; - J2.prototype.skipFixed64Field = J2.prototype.ib; - J2.prototype.jb = function() { - var a3 = this.c; - do { - if (!this.oa()) { - p3("Unmatched start-group tag: stream EOF"); - this.h = true; - break; - } - if (4 == this.b) { - this.c != a3 && (p3("Unmatched end-group tag"), this.h = true); - break; - } - this.C(); - } while (1); - }; - J2.prototype.skipGroup = J2.prototype.jb; - J2.prototype.C = function() { - switch (this.b) { - case 0: - this.lb(); - break; - case 1: - this.ib(); - break; - case 2: - this.gb(); - break; - case 5: - this.hb(); - break; - case 3: - this.jb(); - break; - default: - p3("Invalid wire encoding for field."); - } - }; - J2.prototype.skipField = J2.prototype.C; - J2.prototype.Hc = function(a3, b2) { - null === this.v && (this.v = {}); - n4(!this.v[a3]); - this.v[a3] = b2; - }; - J2.prototype.registerReadCallback = J2.prototype.Hc; - J2.prototype.Ic = function(a3) { - n4(null !== this.v); - a3 = this.v[a3]; - n4(a3); - return a3(this); - }; - J2.prototype.runReadCallback = J2.prototype.Ic; - J2.prototype.Yb = function(a3, b2) { - n4(2 == this.b); - var c2 = this.a.c, d4 = this.a.o(); - d4 = this.a.B() + d4; - this.a.setEnd(d4); - b2(a3, this); - this.a.Ma(d4); - this.a.setEnd(c2); - }; - J2.prototype.readMessage = J2.prototype.Yb; - J2.prototype.Ub = function(a3, b2, c2) { - n4(3 == this.b); - n4(this.c == a3); - c2(b2, this); - this.h || 4 == this.b || (p3("Group submessage did not end with an END_GROUP tag"), this.h = true); - }; - J2.prototype.readGroup = J2.prototype.Ub; - J2.prototype.Gb = function() { - n4(2 == this.b); - var a3 = this.a.o(), b2 = this.a.B(), c2 = b2 + a3; - a3 = Wa2(this.a.Y(), b2, a3); - this.a.Ma(c2); - return a3; - }; - J2.prototype.getFieldDecoder = J2.prototype.Gb; - J2.prototype.P = function() { - n4(0 == this.b); - return this.a.da(); - }; - J2.prototype.readInt32 = J2.prototype.P; - J2.prototype.Wb = function() { - n4(0 == this.b); - return this.a.Ea(); - }; - J2.prototype.readInt32String = J2.prototype.Wb; - J2.prototype.ba = function() { - n4(0 == this.b); - return this.a.sa(); - }; - J2.prototype.readInt64 = J2.prototype.ba; - J2.prototype.ca = function() { - n4(0 == this.b); - return this.a.Fa(); - }; - J2.prototype.readInt64String = J2.prototype.ca; - J2.prototype.m = function() { - n4(0 == this.b); - return this.a.o(); - }; - J2.prototype.readUint32 = J2.prototype.m; - J2.prototype.Fc = function() { - n4(0 == this.b); - return this.a.O(); - }; - J2.prototype.readUint32String = J2.prototype.Fc; - J2.prototype.ga = function() { - n4(0 == this.b); - return this.a.Ga(); - }; - J2.prototype.readUint64 = J2.prototype.ga; - J2.prototype.ha = function() { - n4(0 == this.b); - return this.a.Ha(); - }; - J2.prototype.readUint64String = J2.prototype.ha; - J2.prototype.zc = function() { - n4(0 == this.b); - return this.a.Ia(); - }; - J2.prototype.readSint32 = J2.prototype.zc; - J2.prototype.Ac = function() { - n4(0 == this.b); - return this.a.Ja(); - }; - J2.prototype.readSint64 = J2.prototype.Ac; - J2.prototype.Bc = function() { - n4(0 == this.b); - return this.a.Ka(); - }; - J2.prototype.readSint64String = J2.prototype.Bc; - J2.prototype.Rb = function() { - n4(5 == this.b); - return this.a.m(); - }; - J2.prototype.readFixed32 = J2.prototype.Rb; - J2.prototype.Sb = function() { - n4(1 == this.b); - return this.a.ga(); - }; - J2.prototype.readFixed64 = J2.prototype.Sb; - J2.prototype.Tb = function() { - n4(1 == this.b); - return this.a.ha(); - }; - J2.prototype.readFixed64String = J2.prototype.Tb; - J2.prototype.vc = function() { - n4(5 == this.b); - return this.a.P(); - }; - J2.prototype.readSfixed32 = J2.prototype.vc; - J2.prototype.wc = function() { - n4(5 == this.b); - return this.a.P().toString(); - }; - J2.prototype.readSfixed32String = J2.prototype.wc; - J2.prototype.xc = function() { - n4(1 == this.b); - return this.a.ba(); - }; - J2.prototype.readSfixed64 = J2.prototype.xc; - J2.prototype.yc = function() { - n4(1 == this.b); - return this.a.ca(); - }; - J2.prototype.readSfixed64String = J2.prototype.yc; - J2.prototype.aa = function() { - n4(5 == this.b); - return this.a.aa(); - }; - J2.prototype.readFloat = J2.prototype.aa; - J2.prototype.Z = function() { - n4(1 == this.b); - return this.a.Z(); - }; - J2.prototype.readDouble = J2.prototype.Z; - J2.prototype.pa = function() { - n4(0 == this.b); - return !!this.a.o(); - }; - J2.prototype.readBool = J2.prototype.pa; - J2.prototype.ra = function() { - n4(0 == this.b); - return this.a.sa(); - }; - J2.prototype.readEnum = J2.prototype.ra; - J2.prototype.fa = function() { - n4(2 == this.b); - var a3 = this.a.o(); - return this.a.fa(a3); - }; - J2.prototype.readString = J2.prototype.fa; - J2.prototype.qa = function() { - n4(2 == this.b); - var a3 = this.a.o(); - return this.a.qa(a3); - }; - J2.prototype.readBytes = J2.prototype.qa; - J2.prototype.ia = function() { - n4(0 == this.b); - return this.a.ia(); - }; - J2.prototype.readVarintHash64 = J2.prototype.ia; - J2.prototype.Cc = function() { - n4(0 == this.b); - return this.a.fb(); - }; - J2.prototype.readSintHash64 = J2.prototype.Cc; - J2.prototype.w = function(a3) { - n4(0 == this.b); - return this.a.w(a3); - }; - J2.prototype.readSplitVarint64 = J2.prototype.w; - J2.prototype.ea = function(a3) { - n4(0 == this.b); - return this.a.w(function(b2, c2) { - return Ma2(b2, c2, a3); - }); - }; - J2.prototype.readSplitZigzagVarint64 = J2.prototype.ea; - J2.prototype.$ = function() { - n4(1 == this.b); - return this.a.$(); - }; - J2.prototype.readFixedHash64 = J2.prototype.$; - J2.prototype.ta = function(a3) { - n4(1 == this.b); - return this.a.ta(a3); - }; - J2.prototype.readSplitFixed64 = J2.prototype.ta; - function L4(a3, b2) { - n4(2 == a3.b); - var c2 = a3.a.o(); - c2 = a3.a.B() + c2; - for (var d4 = []; a3.a.B() < c2; ) - d4.push(b2.call(a3.a)); - return d4; - } - J2.prototype.gc = function() { - return L4(this, this.a.da); - }; - J2.prototype.readPackedInt32 = J2.prototype.gc; - J2.prototype.hc = function() { - return L4(this, this.a.Ea); - }; - J2.prototype.readPackedInt32String = J2.prototype.hc; - J2.prototype.ic = function() { - return L4(this, this.a.sa); - }; - J2.prototype.readPackedInt64 = J2.prototype.ic; - J2.prototype.jc = function() { - return L4(this, this.a.Fa); - }; - J2.prototype.readPackedInt64String = J2.prototype.jc; - J2.prototype.qc = function() { - return L4(this, this.a.o); - }; - J2.prototype.readPackedUint32 = J2.prototype.qc; - J2.prototype.rc = function() { - return L4(this, this.a.O); - }; - J2.prototype.readPackedUint32String = J2.prototype.rc; - J2.prototype.sc = function() { - return L4(this, this.a.Ga); - }; - J2.prototype.readPackedUint64 = J2.prototype.sc; - J2.prototype.tc = function() { - return L4(this, this.a.Ha); - }; - J2.prototype.readPackedUint64String = J2.prototype.tc; - J2.prototype.nc = function() { - return L4(this, this.a.Ia); - }; - J2.prototype.readPackedSint32 = J2.prototype.nc; - J2.prototype.oc = function() { - return L4(this, this.a.Ja); - }; - J2.prototype.readPackedSint64 = J2.prototype.oc; - J2.prototype.pc = function() { - return L4(this, this.a.Ka); - }; - J2.prototype.readPackedSint64String = J2.prototype.pc; - J2.prototype.bc = function() { - return L4(this, this.a.m); - }; - J2.prototype.readPackedFixed32 = J2.prototype.bc; - J2.prototype.cc = function() { - return L4(this, this.a.ga); - }; - J2.prototype.readPackedFixed64 = J2.prototype.cc; - J2.prototype.dc = function() { - return L4(this, this.a.ha); - }; - J2.prototype.readPackedFixed64String = J2.prototype.dc; - J2.prototype.kc = function() { - return L4(this, this.a.P); - }; - J2.prototype.readPackedSfixed32 = J2.prototype.kc; - J2.prototype.lc = function() { - return L4(this, this.a.ba); - }; - J2.prototype.readPackedSfixed64 = J2.prototype.lc; - J2.prototype.mc = function() { - return L4(this, this.a.ca); - }; - J2.prototype.readPackedSfixed64String = J2.prototype.mc; - J2.prototype.fc = function() { - return L4(this, this.a.aa); - }; - J2.prototype.readPackedFloat = J2.prototype.fc; - J2.prototype.$b = function() { - return L4(this, this.a.Z); - }; - J2.prototype.readPackedDouble = J2.prototype.$b; - J2.prototype.Zb = function() { - return L4(this, this.a.pa); - }; - J2.prototype.readPackedBool = J2.prototype.Zb; - J2.prototype.ac = function() { - return L4(this, this.a.ra); - }; - J2.prototype.readPackedEnum = J2.prototype.ac; - J2.prototype.uc = function() { - return L4(this, this.a.ia); - }; - J2.prototype.readPackedVarintHash64 = J2.prototype.uc; - J2.prototype.ec = function() { - return L4(this, this.a.$); - }; - J2.prototype.readPackedFixedHash64 = J2.prototype.ec; - function Ya2(a3, b2, c2, d4, f3) { - this.ma = a3; - this.Ba = b2; - this.la = c2; - this.Na = d4; - this.na = f3; - } - g3("jspb.ExtensionFieldInfo", Ya2, void 0); - function Za2(a3, b2, c2, d4, f3, h4) { - this.Za = a3; - this.za = b2; - this.Aa = c2; - this.Wa = d4; - this.Ab = f3; - this.Nb = h4; - } - g3("jspb.ExtensionFieldBinaryInfo", Za2, void 0); - Ya2.prototype.F = function() { - return !!this.la; - }; - Ya2.prototype.isMessageType = Ya2.prototype.F; - function N2() { - } - g3("jspb.Message", N2, void 0); - N2.GENERATE_TO_OBJECT = true; - N2.GENERATE_FROM_OBJECT = true; - var $a2 = "function" == typeof Uint8Array; - N2.prototype.Ib = function() { - return this.b; - }; - N2.prototype.getJsPbMessageId = N2.prototype.Ib; - N2.initialize = function(a3, b2, c2, d4, f3, h4) { - a3.f = null; - b2 || (b2 = c2 ? [c2] : []); - a3.b = c2 ? String(c2) : void 0; - a3.D = 0 === c2 ? -1 : 0; - a3.u = b2; - a: { - c2 = a3.u.length; - b2 = -1; - if (c2 && (b2 = c2 - 1, c2 = a3.u[b2], !(null === c2 || "object" != typeof c2 || Array.isArray(c2) || $a2 && c2 instanceof Uint8Array))) { - a3.G = b2 - a3.D; - a3.i = c2; - break a; - } - -1 < d4 ? (a3.G = Math.max(d4, b2 + 1 - a3.D), a3.i = null) : a3.G = Number.MAX_VALUE; - } - a3.a = {}; - if (f3) - for (d4 = 0; d4 < f3.length; d4++) - b2 = f3[d4], b2 < a3.G ? (b2 += a3.D, a3.u[b2] = a3.u[b2] || ab2) : (bb2(a3), a3.i[b2] = a3.i[b2] || ab2); - if (h4 && h4.length) - for (d4 = 0; d4 < h4.length; d4++) - cb2(a3, h4[d4]); - }; - var ab2 = Object.freeze ? Object.freeze([]) : []; - function bb2(a3) { - var b2 = a3.G + a3.D; - a3.u[b2] || (a3.i = a3.u[b2] = {}); - } - function db2(a3, b2, c2) { - for (var d4 = [], f3 = 0; f3 < a3.length; f3++) - d4[f3] = b2.call(a3[f3], c2, a3[f3]); - return d4; - } - N2.toObjectList = db2; - N2.toObjectExtension = function(a3, b2, c2, d4, f3) { - for (var h4 in c2) { - var m3 = c2[h4], t2 = d4.call(a3, m3); - if (null != t2) { - for (var B2 in m3.Ba) - if (m3.Ba.hasOwnProperty(B2)) - break; - b2[B2] = m3.Na ? m3.na ? db2(t2, m3.Na, f3) : m3.Na(f3, t2) : t2; - } - } - }; - N2.serializeBinaryExtensions = function(a3, b2, c2, d4) { - for (var f3 in c2) { - var h4 = c2[f3], m3 = h4.Za; - if (!h4.Aa) - throw Error("Message extension present that was generated without binary serialization support"); - var t2 = d4.call(a3, m3); - if (null != t2) - if (m3.F()) - if (h4.Wa) - h4.Aa.call(b2, m3.ma, t2, h4.Wa); - else - throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format"); - else - h4.Aa.call(b2, m3.ma, t2); - } - }; - N2.readBinaryExtension = function(a3, b2, c2, d4, f3) { - var h4 = c2[b2.c]; - if (h4) { - c2 = h4.Za; - if (!h4.za) - throw Error("Deserializing extension whose generated code does not support binary format"); - if (c2.F()) { - var m3 = new c2.la(); - h4.za.call(b2, m3, h4.Ab); - } else - m3 = h4.za.call(b2); - c2.na && !h4.Nb ? (b2 = d4.call(a3, c2)) ? b2.push(m3) : f3.call(a3, c2, [m3]) : f3.call(a3, c2, m3); - } else - b2.C(); - }; - function O3(a3, b2) { - if (b2 < a3.G) { - b2 += a3.D; - var c2 = a3.u[b2]; - return c2 === ab2 ? a3.u[b2] = [] : c2; - } - if (a3.i) - return c2 = a3.i[b2], c2 === ab2 ? a3.i[b2] = [] : c2; - } - N2.getField = O3; - N2.getRepeatedField = function(a3, b2) { - return O3(a3, b2); - }; - function eb2(a3, b2) { - a3 = O3(a3, b2); - return null == a3 ? a3 : +a3; - } - N2.getOptionalFloatingPointField = eb2; - function fb2(a3, b2) { - a3 = O3(a3, b2); - return null == a3 ? a3 : !!a3; - } - N2.getBooleanField = fb2; - N2.getRepeatedFloatingPointField = function(a3, b2) { - var c2 = O3(a3, b2); - a3.a || (a3.a = {}); - if (!a3.a[b2]) { - for (var d4 = 0; d4 < c2.length; d4++) - c2[d4] = +c2[d4]; - a3.a[b2] = true; - } - return c2; - }; - N2.getRepeatedBooleanField = function(a3, b2) { - var c2 = O3(a3, b2); - a3.a || (a3.a = {}); - if (!a3.a[b2]) { - for (var d4 = 0; d4 < c2.length; d4++) - c2[d4] = !!c2[d4]; - a3.a[b2] = true; - } - return c2; - }; - function gb2(a3) { - if (null == a3 || "string" === typeof a3) - return a3; - if ($a2 && a3 instanceof Uint8Array) - return Ba2(a3); - p3("Cannot coerce to b64 string: " + k2(a3)); - return null; - } - N2.bytesAsB64 = gb2; - function hb2(a3) { - if (null == a3 || a3 instanceof Uint8Array) - return a3; - if ("string" === typeof a3) - return Da2(a3); - p3("Cannot coerce to Uint8Array: " + k2(a3)); - return null; - } - N2.bytesAsU8 = hb2; - N2.bytesListAsB64 = function(a3) { - ib2(a3); - return a3.length && "string" !== typeof a3[0] ? l2(a3, gb2) : a3; - }; - N2.bytesListAsU8 = function(a3) { - ib2(a3); - return !a3.length || a3[0] instanceof Uint8Array ? a3 : l2(a3, hb2); - }; - function ib2(a3) { - if (a3 && 1 < a3.length) { - var b2 = k2(a3[0]); - qa2(a3, function(c2) { - k2(c2) != b2 && p3("Inconsistent type in JSPB repeated field array. Got " + k2(c2) + " expected " + b2); - }); - } - } - function jb2(a3, b2, c2) { - a3 = O3(a3, b2); - return null == a3 ? c2 : a3; - } - N2.getFieldWithDefault = jb2; - N2.getBooleanFieldWithDefault = function(a3, b2, c2) { - a3 = fb2(a3, b2); - return null == a3 ? c2 : a3; - }; - N2.getFloatingPointFieldWithDefault = function(a3, b2, c2) { - a3 = eb2(a3, b2); - return null == a3 ? c2 : a3; - }; - N2.getFieldProto3 = jb2; - N2.getMapField = function(a3, b2, c2, d4) { - a3.f || (a3.f = {}); - if (b2 in a3.f) - return a3.f[b2]; - var f3 = O3(a3, b2); - if (!f3) { - if (c2) - return; - f3 = []; - P2(a3, b2, f3); - } - return a3.f[b2] = new r2(f3, d4); - }; - function P2(a3, b2, c2) { - q2(a3, N2); - b2 < a3.G ? a3.u[b2 + a3.D] = c2 : (bb2(a3), a3.i[b2] = c2); - return a3; - } - N2.setField = P2; - N2.setProto3IntField = function(a3, b2, c2) { - return Q2(a3, b2, c2, 0); - }; - N2.setProto3FloatField = function(a3, b2, c2) { - return Q2(a3, b2, c2, 0); - }; - N2.setProto3BooleanField = function(a3, b2, c2) { - return Q2(a3, b2, c2, false); - }; - N2.setProto3StringField = function(a3, b2, c2) { - return Q2(a3, b2, c2, ""); - }; - N2.setProto3BytesField = function(a3, b2, c2) { - return Q2(a3, b2, c2, ""); - }; - N2.setProto3EnumField = function(a3, b2, c2) { - return Q2(a3, b2, c2, 0); - }; - N2.setProto3StringIntField = function(a3, b2, c2) { - return Q2(a3, b2, c2, "0"); - }; - function Q2(a3, b2, c2, d4) { - q2(a3, N2); - c2 !== d4 ? P2(a3, b2, c2) : b2 < a3.G ? a3.u[b2 + a3.D] = null : (bb2(a3), delete a3.i[b2]); - return a3; - } - N2.addToRepeatedField = function(a3, b2, c2, d4) { - q2(a3, N2); - b2 = O3(a3, b2); - void 0 != d4 ? b2.splice(d4, 0, c2) : b2.push(c2); - return a3; - }; - function kb2(a3, b2, c2, d4) { - q2(a3, N2); - (c2 = cb2(a3, c2)) && c2 !== b2 && void 0 !== d4 && (a3.f && c2 in a3.f && (a3.f[c2] = void 0), P2(a3, c2, void 0)); - return P2(a3, b2, d4); - } - N2.setOneofField = kb2; - function cb2(a3, b2) { - for (var c2, d4, f3 = 0; f3 < b2.length; f3++) { - var h4 = b2[f3], m3 = O3(a3, h4); - null != m3 && (c2 = h4, d4 = m3, P2(a3, h4, void 0)); - } - return c2 ? (P2(a3, c2, d4), c2) : 0; - } - N2.computeOneofCase = cb2; - N2.getWrapperField = function(a3, b2, c2, d4) { - a3.f || (a3.f = {}); - if (!a3.f[c2]) { - var f3 = O3(a3, c2); - if (d4 || f3) - a3.f[c2] = new b2(f3); - } - return a3.f[c2]; - }; - N2.getRepeatedWrapperField = function(a3, b2, c2) { - lb2(a3, b2, c2); - b2 = a3.f[c2]; - b2 == ab2 && (b2 = a3.f[c2] = []); - return b2; - }; - function lb2(a3, b2, c2) { - a3.f || (a3.f = {}); - if (!a3.f[c2]) { - for (var d4 = O3(a3, c2), f3 = [], h4 = 0; h4 < d4.length; h4++) - f3[h4] = new b2(d4[h4]); - a3.f[c2] = f3; - } - } - N2.setWrapperField = function(a3, b2, c2) { - q2(a3, N2); - a3.f || (a3.f = {}); - var d4 = c2 ? c2.g() : c2; - a3.f[b2] = c2; - return P2(a3, b2, d4); - }; - N2.setOneofWrapperField = function(a3, b2, c2, d4) { - q2(a3, N2); - a3.f || (a3.f = {}); - var f3 = d4 ? d4.g() : d4; - a3.f[b2] = d4; - return kb2(a3, b2, c2, f3); - }; - N2.setRepeatedWrapperField = function(a3, b2, c2) { - q2(a3, N2); - a3.f || (a3.f = {}); - c2 = c2 || []; - for (var d4 = [], f3 = 0; f3 < c2.length; f3++) - d4[f3] = c2[f3].g(); - a3.f[b2] = c2; - return P2(a3, b2, d4); - }; - N2.addToRepeatedWrapperField = function(a3, b2, c2, d4, f3) { - lb2(a3, d4, b2); - var h4 = a3.f[b2]; - h4 || (h4 = a3.f[b2] = []); - c2 = c2 ? c2 : new d4(); - a3 = O3(a3, b2); - void 0 != f3 ? (h4.splice(f3, 0, c2), a3.splice(f3, 0, c2.g())) : (h4.push(c2), a3.push(c2.g())); - return c2; - }; - N2.toMap = function(a3, b2, c2, d4) { - for (var f3 = {}, h4 = 0; h4 < a3.length; h4++) - f3[b2.call(a3[h4])] = c2 ? c2.call(a3[h4], d4, a3[h4]) : a3[h4]; - return f3; - }; - function mb2(a3) { - if (a3.f) - for (var b2 in a3.f) { - var c2 = a3.f[b2]; - if (Array.isArray(c2)) - for (var d4 = 0; d4 < c2.length; d4++) - c2[d4] && c2[d4].g(); - else - c2 && c2.g(); - } - } - N2.prototype.g = function() { - mb2(this); - return this.u; - }; - N2.prototype.toArray = N2.prototype.g; - N2.prototype.toString = function() { - mb2(this); - return this.u.toString(); - }; - N2.prototype.getExtension = function(a3) { - if (this.i) { - this.f || (this.f = {}); - var b2 = a3.ma; - if (a3.na) { - if (a3.F()) - return this.f[b2] || (this.f[b2] = l2(this.i[b2] || [], function(c2) { - return new a3.la(c2); - })), this.f[b2]; - } else if (a3.F()) - return !this.f[b2] && this.i[b2] && (this.f[b2] = new a3.la(this.i[b2])), this.f[b2]; - return this.i[b2]; - } - }; - N2.prototype.getExtension = N2.prototype.getExtension; - N2.prototype.Kc = function(a3, b2) { - this.f || (this.f = {}); - bb2(this); - var c2 = a3.ma; - a3.na ? (b2 = b2 || [], a3.F() ? (this.f[c2] = b2, this.i[c2] = l2(b2, function(d4) { - return d4.g(); - })) : this.i[c2] = b2) : a3.F() ? (this.f[c2] = b2, this.i[c2] = b2 ? b2.g() : b2) : this.i[c2] = b2; - return this; - }; - N2.prototype.setExtension = N2.prototype.Kc; - N2.difference = function(a3, b2) { - if (!(a3 instanceof b2.constructor)) - throw Error("Messages have different types."); - var c2 = a3.g(); - b2 = b2.g(); - var d4 = [], f3 = 0, h4 = c2.length > b2.length ? c2.length : b2.length; - a3.b && (d4[0] = a3.b, f3 = 1); - for (; f3 < h4; f3++) - nb2(c2[f3], b2[f3]) || (d4[f3] = b2[f3]); - return new a3.constructor(d4); - }; - N2.equals = function(a3, b2) { - return a3 == b2 || !(!a3 || !b2) && a3 instanceof b2.constructor && nb2(a3.g(), b2.g()); - }; - function ob2(a3, b2) { - a3 = a3 || {}; - b2 = b2 || {}; - var c2 = {}, d4; - for (d4 in a3) - c2[d4] = 0; - for (d4 in b2) - c2[d4] = 0; - for (d4 in c2) - if (!nb2(a3[d4], b2[d4])) - return false; - return true; - } - N2.compareExtensions = ob2; - function nb2(a3, b2) { - if (a3 == b2) - return true; - if (!la2(a3) || !la2(b2)) - return "number" === typeof a3 && isNaN(a3) || "number" === typeof b2 && isNaN(b2) ? String(a3) == String(b2) : false; - if (a3.constructor != b2.constructor) - return false; - if ($a2 && a3.constructor === Uint8Array) { - if (a3.length != b2.length) - return false; - for (var c2 = 0; c2 < a3.length; c2++) - if (a3[c2] != b2[c2]) - return false; - return true; - } - if (a3.constructor === Array) { - var d4 = void 0, f3 = void 0, h4 = Math.max(a3.length, b2.length); - for (c2 = 0; c2 < h4; c2++) { - var m3 = a3[c2], t2 = b2[c2]; - m3 && m3.constructor == Object && (n4(void 0 === d4), n4(c2 === a3.length - 1), d4 = m3, m3 = void 0); - t2 && t2.constructor == Object && (n4(void 0 === f3), n4(c2 === b2.length - 1), f3 = t2, t2 = void 0); - if (!nb2(m3, t2)) - return false; - } - return d4 || f3 ? (d4 = d4 || {}, f3 = f3 || {}, ob2(d4, f3)) : true; - } - if (a3.constructor === Object) - return ob2(a3, b2); - throw Error("Invalid type in JSPB array"); - } - N2.compareFields = nb2; - N2.prototype.Bb = function() { - return pb2(this); - }; - N2.prototype.cloneMessage = N2.prototype.Bb; - N2.prototype.clone = function() { - return pb2(this); - }; - N2.prototype.clone = N2.prototype.clone; - N2.clone = function(a3) { - return pb2(a3); - }; - function pb2(a3) { - return new a3.constructor(qb2(a3.g())); - } - N2.copyInto = function(a3, b2) { - q2(a3, N2); - q2(b2, N2); - n4(a3.constructor == b2.constructor, "Copy source and target message should have the same type."); - a3 = pb2(a3); - for (var c2 = b2.g(), d4 = a3.g(), f3 = c2.length = 0; f3 < d4.length; f3++) - c2[f3] = d4[f3]; - b2.f = a3.f; - b2.i = a3.i; - }; - function qb2(a3) { - if (Array.isArray(a3)) { - for (var b2 = Array(a3.length), c2 = 0; c2 < a3.length; c2++) { - var d4 = a3[c2]; - null != d4 && (b2[c2] = "object" == typeof d4 ? qb2(n4(d4)) : d4); - } - return b2; - } - if ($a2 && a3 instanceof Uint8Array) - return new Uint8Array(a3); - b2 = {}; - for (c2 in a3) - d4 = a3[c2], null != d4 && (b2[c2] = "object" == typeof d4 ? qb2(n4(d4)) : d4); - return b2; - } - N2.registerMessageType = function(a3, b2) { - b2.we = a3; - }; - var R3 = { dump: function(a3) { - q2(a3, N2, "jspb.Message instance expected"); - n4(a3.getExtension, "Only unobfuscated and unoptimized compilation modes supported."); - return R3.X(a3); - } }; - g3("jspb.debug.dump", R3.dump, void 0); - R3.X = function(a3) { - var b2 = k2(a3); - if ("number" == b2 || "string" == b2 || "boolean" == b2 || "null" == b2 || "undefined" == b2 || "undefined" !== typeof Uint8Array && a3 instanceof Uint8Array) - return a3; - if ("array" == b2) - return ua2(a3), l2(a3, R3.X); - if (a3 instanceof r2) { - var c2 = {}; - a3 = a3.entries(); - for (var d4 = a3.next(); !d4.done; d4 = a3.next()) - c2[d4.value[0]] = R3.X(d4.value[1]); - return c2; - } - q2(a3, N2, "Only messages expected: " + a3); - b2 = a3.constructor; - var f3 = { $name: b2.name || b2.displayName }; - for (t2 in b2.prototype) { - var h4 = /^get([A-Z]\w*)/.exec(t2); - if (h4 && "getExtension" != t2 && "getJsPbMessageId" != t2) { - var m3 = "has" + h4[1]; - if (!a3[m3] || a3[m3]()) - m3 = a3[t2](), f3[R3.$a(h4[1])] = R3.X(m3); - } - } - if (a3.extensionObject_) - return f3.$extensions = "Recursive dumping of extensions not supported in compiled code. Switch to uncompiled or dump extension object directly", f3; - for (d4 in b2.extensions) - if (/^\d+$/.test(d4)) { - m3 = b2.extensions[d4]; - var t2 = a3.getExtension(m3); - h4 = void 0; - m3 = m3.Ba; - var B2 = [], M3 = 0; - for (h4 in m3) - B2[M3++] = h4; - h4 = B2[0]; - null != t2 && (c2 || (c2 = f3.$extensions = {}), c2[R3.$a(h4)] = R3.X(t2)); - } - return f3; - }; - R3.$a = function(a3) { - return a3.replace(/^[A-Z]/, function(b2) { - return b2.toLowerCase(); - }); - }; - function S4() { - this.a = []; - } - g3("jspb.BinaryEncoder", S4, void 0); - S4.prototype.length = function() { - return this.a.length; - }; - S4.prototype.length = S4.prototype.length; - S4.prototype.end = function() { - var a3 = this.a; - this.a = []; - return a3; - }; - S4.prototype.end = S4.prototype.end; - S4.prototype.l = function(a3, b2) { - n4(a3 == Math.floor(a3)); - n4(b2 == Math.floor(b2)); - n4(0 <= a3 && 4294967296 > a3); - for (n4(0 <= b2 && 4294967296 > b2); 0 < b2 || 127 < a3; ) - this.a.push(a3 & 127 | 128), a3 = (a3 >>> 7 | b2 << 25) >>> 0, b2 >>>= 7; - this.a.push(a3); - }; - S4.prototype.writeSplitVarint64 = S4.prototype.l; - S4.prototype.A = function(a3, b2) { - n4(a3 == Math.floor(a3)); - n4(b2 == Math.floor(b2)); - n4(0 <= a3 && 4294967296 > a3); - n4(0 <= b2 && 4294967296 > b2); - this.s(a3); - this.s(b2); - }; - S4.prototype.writeSplitFixed64 = S4.prototype.A; - S4.prototype.j = function(a3) { - n4(a3 == Math.floor(a3)); - for (n4(0 <= a3 && 4294967296 > a3); 127 < a3; ) - this.a.push(a3 & 127 | 128), a3 >>>= 7; - this.a.push(a3); - }; - S4.prototype.writeUnsignedVarint32 = S4.prototype.j; - S4.prototype.M = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-2147483648 <= a3 && 2147483648 > a3); - if (0 <= a3) - this.j(a3); - else { - for (var b2 = 0; 9 > b2; b2++) - this.a.push(a3 & 127 | 128), a3 >>= 7; - this.a.push(1); - } - }; - S4.prototype.writeSignedVarint32 = S4.prototype.M; - S4.prototype.va = function(a3) { - n4(a3 == Math.floor(a3)); - n4(0 <= a3 && 18446744073709552e3 > a3); - A2(a3); - this.l(y3, z3); - }; - S4.prototype.writeUnsignedVarint64 = S4.prototype.va; - S4.prototype.ua = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-9223372036854776e3 <= a3 && 9223372036854776e3 > a3); - A2(a3); - this.l(y3, z3); - }; - S4.prototype.writeSignedVarint64 = S4.prototype.ua; - S4.prototype.wa = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-2147483648 <= a3 && 2147483648 > a3); - this.j((a3 << 1 ^ a3 >> 31) >>> 0); - }; - S4.prototype.writeZigzagVarint32 = S4.prototype.wa; - S4.prototype.xa = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-9223372036854776e3 <= a3 && 9223372036854776e3 > a3); - Ga2(a3); - this.l(y3, z3); - }; - S4.prototype.writeZigzagVarint64 = S4.prototype.xa; - S4.prototype.Ta = function(a3) { - this.W(H2(a3)); - }; - S4.prototype.writeZigzagVarint64String = S4.prototype.Ta; - S4.prototype.W = function(a3) { - var b2 = this; - C3(a3); - Ja2(y3, z3, function(c2, d4) { - b2.l(c2 >>> 0, d4 >>> 0); - }); - }; - S4.prototype.writeZigzagVarintHash64 = S4.prototype.W; - S4.prototype.be = function(a3) { - n4(a3 == Math.floor(a3)); - n4(0 <= a3 && 256 > a3); - this.a.push(a3 >>> 0 & 255); - }; - S4.prototype.writeUint8 = S4.prototype.be; - S4.prototype.ae = function(a3) { - n4(a3 == Math.floor(a3)); - n4(0 <= a3 && 65536 > a3); - this.a.push(a3 >>> 0 & 255); - this.a.push(a3 >>> 8 & 255); - }; - S4.prototype.writeUint16 = S4.prototype.ae; - S4.prototype.s = function(a3) { - n4(a3 == Math.floor(a3)); - n4(0 <= a3 && 4294967296 > a3); - this.a.push(a3 >>> 0 & 255); - this.a.push(a3 >>> 8 & 255); - this.a.push(a3 >>> 16 & 255); - this.a.push(a3 >>> 24 & 255); - }; - S4.prototype.writeUint32 = S4.prototype.s; - S4.prototype.V = function(a3) { - n4(a3 == Math.floor(a3)); - n4(0 <= a3 && 18446744073709552e3 > a3); - Fa2(a3); - this.s(y3); - this.s(z3); - }; - S4.prototype.writeUint64 = S4.prototype.V; - S4.prototype.Qc = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-128 <= a3 && 128 > a3); - this.a.push(a3 >>> 0 & 255); - }; - S4.prototype.writeInt8 = S4.prototype.Qc; - S4.prototype.Pc = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-32768 <= a3 && 32768 > a3); - this.a.push(a3 >>> 0 & 255); - this.a.push(a3 >>> 8 & 255); - }; - S4.prototype.writeInt16 = S4.prototype.Pc; - S4.prototype.S = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-2147483648 <= a3 && 2147483648 > a3); - this.a.push(a3 >>> 0 & 255); - this.a.push(a3 >>> 8 & 255); - this.a.push(a3 >>> 16 & 255); - this.a.push(a3 >>> 24 & 255); - }; - S4.prototype.writeInt32 = S4.prototype.S; - S4.prototype.T = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-9223372036854776e3 <= a3 && 9223372036854776e3 > a3); - A2(a3); - this.A(y3, z3); - }; - S4.prototype.writeInt64 = S4.prototype.T; - S4.prototype.ka = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-9223372036854776e3 <= +a3 && 9223372036854776e3 > +a3); - C3(H2(a3)); - this.A(y3, z3); - }; - S4.prototype.writeInt64String = S4.prototype.ka; - S4.prototype.L = function(a3) { - n4(Infinity === a3 || -Infinity === a3 || isNaN(a3) || -34028234663852886e22 <= a3 && 34028234663852886e22 >= a3); - Ha2(a3); - this.s(y3); - }; - S4.prototype.writeFloat = S4.prototype.L; - S4.prototype.J = function(a3) { - n4(Infinity === a3 || -Infinity === a3 || isNaN(a3) || -17976931348623157e292 <= a3 && 17976931348623157e292 >= a3); - Ia2(a3); - this.s(y3); - this.s(z3); - }; - S4.prototype.writeDouble = S4.prototype.J; - S4.prototype.I = function(a3) { - n4("boolean" === typeof a3 || "number" === typeof a3); - this.a.push(a3 ? 1 : 0); - }; - S4.prototype.writeBool = S4.prototype.I; - S4.prototype.R = function(a3) { - n4(a3 == Math.floor(a3)); - n4(-2147483648 <= a3 && 2147483648 > a3); - this.M(a3); - }; - S4.prototype.writeEnum = S4.prototype.R; - S4.prototype.ja = function(a3) { - this.a.push.apply(this.a, a3); - }; - S4.prototype.writeBytes = S4.prototype.ja; - S4.prototype.N = function(a3) { - C3(a3); - this.l(y3, z3); - }; - S4.prototype.writeVarintHash64 = S4.prototype.N; - S4.prototype.K = function(a3) { - C3(a3); - this.s(y3); - this.s(z3); - }; - S4.prototype.writeFixedHash64 = S4.prototype.K; - S4.prototype.U = function(a3) { - var b2 = this.a.length; - ta2(a3); - for (var c2 = 0; c2 < a3.length; c2++) { - var d4 = a3.charCodeAt(c2); - if (128 > d4) - this.a.push(d4); - else if (2048 > d4) - this.a.push(d4 >> 6 | 192), this.a.push(d4 & 63 | 128); - else if (65536 > d4) - if (55296 <= d4 && 56319 >= d4 && c2 + 1 < a3.length) { - var f3 = a3.charCodeAt(c2 + 1); - 56320 <= f3 && 57343 >= f3 && (d4 = 1024 * (d4 - 55296) + f3 - 56320 + 65536, this.a.push(d4 >> 18 | 240), this.a.push(d4 >> 12 & 63 | 128), this.a.push(d4 >> 6 & 63 | 128), this.a.push(d4 & 63 | 128), c2++); - } else - this.a.push(d4 >> 12 | 224), this.a.push(d4 >> 6 & 63 | 128), this.a.push(d4 & 63 | 128); - } - return this.a.length - b2; - }; - S4.prototype.writeString = S4.prototype.U; - function T9(a3, b2) { - this.lo = a3; - this.hi = b2; - } - g3("jspb.arith.UInt64", T9, void 0); - T9.prototype.cmp = function(a3) { - return this.hi < a3.hi || this.hi == a3.hi && this.lo < a3.lo ? -1 : this.hi == a3.hi && this.lo == a3.lo ? 0 : 1; - }; - T9.prototype.cmp = T9.prototype.cmp; - T9.prototype.La = function() { - return new T9((this.lo >>> 1 | (this.hi & 1) << 31) >>> 0, this.hi >>> 1 >>> 0); - }; - T9.prototype.rightShift = T9.prototype.La; - T9.prototype.Da = function() { - return new T9(this.lo << 1 >>> 0, (this.hi << 1 | this.lo >>> 31) >>> 0); - }; - T9.prototype.leftShift = T9.prototype.Da; - T9.prototype.cb = function() { - return !!(this.hi & 2147483648); - }; - T9.prototype.msb = T9.prototype.cb; - T9.prototype.Ob = function() { - return !!(this.lo & 1); - }; - T9.prototype.lsb = T9.prototype.Ob; - T9.prototype.Ua = function() { - return 0 == this.lo && 0 == this.hi; - }; - T9.prototype.zero = T9.prototype.Ua; - T9.prototype.add = function(a3) { - return new T9((this.lo + a3.lo & 4294967295) >>> 0 >>> 0, ((this.hi + a3.hi & 4294967295) >>> 0) + (4294967296 <= this.lo + a3.lo ? 1 : 0) >>> 0); - }; - T9.prototype.add = T9.prototype.add; - T9.prototype.sub = function(a3) { - return new T9((this.lo - a3.lo & 4294967295) >>> 0 >>> 0, ((this.hi - a3.hi & 4294967295) >>> 0) - (0 > this.lo - a3.lo ? 1 : 0) >>> 0); - }; - T9.prototype.sub = T9.prototype.sub; - function rb2(a3, b2) { - var c2 = a3 & 65535; - a3 >>>= 16; - var d4 = b2 & 65535, f3 = b2 >>> 16; - b2 = c2 * d4 + 65536 * (c2 * f3 & 65535) + 65536 * (a3 * d4 & 65535); - for (c2 = a3 * f3 + (c2 * f3 >>> 16) + (a3 * d4 >>> 16); 4294967296 <= b2; ) - b2 -= 4294967296, c2 += 1; - return new T9(b2 >>> 0, c2 >>> 0); - } - T9.mul32x32 = rb2; - T9.prototype.eb = function(a3) { - var b2 = rb2(this.lo, a3); - a3 = rb2(this.hi, a3); - a3.hi = a3.lo; - a3.lo = 0; - return b2.add(a3); - }; - T9.prototype.mul = T9.prototype.eb; - T9.prototype.Xa = function(a3) { - if (0 == a3) - return []; - var b2 = new T9(0, 0), c2 = new T9(this.lo, this.hi); - a3 = new T9(a3, 0); - for (var d4 = new T9(1, 0); !a3.cb(); ) - a3 = a3.Da(), d4 = d4.Da(); - for (; !d4.Ua(); ) - 0 >= a3.cmp(c2) && (b2 = b2.add(d4), c2 = c2.sub(a3)), a3 = a3.La(), d4 = d4.La(); - return [b2, c2]; - }; - T9.prototype.div = T9.prototype.Xa; - T9.prototype.toString = function() { - for (var a3 = "", b2 = this; !b2.Ua(); ) { - b2 = b2.Xa(10); - var c2 = b2[0]; - a3 = b2[1].lo + a3; - b2 = c2; - } - "" == a3 && (a3 = "0"); - return a3; - }; - T9.prototype.toString = T9.prototype.toString; - function U5(a3) { - for (var b2 = new T9(0, 0), c2 = new T9(0, 0), d4 = 0; d4 < a3.length; d4++) { - if ("0" > a3[d4] || "9" < a3[d4]) - return null; - c2.lo = parseInt(a3[d4], 10); - b2 = b2.eb(10).add(c2); - } - return b2; - } - T9.fromString = U5; - T9.prototype.clone = function() { - return new T9(this.lo, this.hi); - }; - T9.prototype.clone = T9.prototype.clone; - function V3(a3, b2) { - this.lo = a3; - this.hi = b2; - } - g3("jspb.arith.Int64", V3, void 0); - V3.prototype.add = function(a3) { - return new V3((this.lo + a3.lo & 4294967295) >>> 0 >>> 0, ((this.hi + a3.hi & 4294967295) >>> 0) + (4294967296 <= this.lo + a3.lo ? 1 : 0) >>> 0); - }; - V3.prototype.add = V3.prototype.add; - V3.prototype.sub = function(a3) { - return new V3((this.lo - a3.lo & 4294967295) >>> 0 >>> 0, ((this.hi - a3.hi & 4294967295) >>> 0) - (0 > this.lo - a3.lo ? 1 : 0) >>> 0); - }; - V3.prototype.sub = V3.prototype.sub; - V3.prototype.clone = function() { - return new V3(this.lo, this.hi); - }; - V3.prototype.clone = V3.prototype.clone; - V3.prototype.toString = function() { - var a3 = 0 != (this.hi & 2147483648), b2 = new T9(this.lo, this.hi); - a3 && (b2 = new T9(0, 0).sub(b2)); - return (a3 ? "-" : "") + b2.toString(); - }; - V3.prototype.toString = V3.prototype.toString; - function sb2(a3) { - var b2 = 0 < a3.length && "-" == a3[0]; - b2 && (a3 = a3.substring(1)); - a3 = U5(a3); - if (null === a3) - return null; - b2 && (a3 = new T9(0, 0).sub(a3)); - return new V3(a3.lo, a3.hi); - } - V3.fromString = sb2; - function W2() { - this.c = []; - this.b = 0; - this.a = new S4(); - this.h = []; - } - g3("jspb.BinaryWriter", W2, void 0); - function tb2(a3, b2) { - var c2 = a3.a.end(); - a3.c.push(c2); - a3.c.push(b2); - a3.b += c2.length + b2.length; - } - function X2(a3, b2) { - Y2(a3, b2, 2); - b2 = a3.a.end(); - a3.c.push(b2); - a3.b += b2.length; - b2.push(a3.b); - return b2; - } - function Z2(a3, b2) { - var c2 = b2.pop(); - c2 = a3.b + a3.a.length() - c2; - for (n4(0 <= c2); 127 < c2; ) - b2.push(c2 & 127 | 128), c2 >>>= 7, a3.b++; - b2.push(c2); - a3.b++; - } - W2.prototype.pb = function(a3, b2, c2) { - tb2(this, a3.subarray(b2, c2)); - }; - W2.prototype.writeSerializedMessage = W2.prototype.pb; - W2.prototype.Pb = function(a3, b2, c2) { - null != a3 && null != b2 && null != c2 && this.pb(a3, b2, c2); - }; - W2.prototype.maybeWriteSerializedMessage = W2.prototype.Pb; - W2.prototype.reset = function() { - this.c = []; - this.a.end(); - this.b = 0; - this.h = []; - }; - W2.prototype.reset = W2.prototype.reset; - W2.prototype.ab = function() { - n4(0 == this.h.length); - for (var a3 = new Uint8Array(this.b + this.a.length()), b2 = this.c, c2 = b2.length, d4 = 0, f3 = 0; f3 < c2; f3++) { - var h4 = b2[f3]; - a3.set(h4, d4); - d4 += h4.length; - } - b2 = this.a.end(); - a3.set(b2, d4); - d4 += b2.length; - n4(d4 == a3.length); - this.c = [a3]; - return a3; - }; - W2.prototype.getResultBuffer = W2.prototype.ab; - W2.prototype.Kb = function(a3) { - return Ba2(this.ab(), a3); - }; - W2.prototype.getResultBase64String = W2.prototype.Kb; - W2.prototype.Va = function(a3) { - this.h.push(X2(this, a3)); - }; - W2.prototype.beginSubMessage = W2.prototype.Va; - W2.prototype.Ya = function() { - n4(0 <= this.h.length); - Z2(this, this.h.pop()); - }; - W2.prototype.endSubMessage = W2.prototype.Ya; - function Y2(a3, b2, c2) { - n4(1 <= b2 && b2 == Math.floor(b2)); - a3.a.j(8 * b2 + c2); - } - W2.prototype.Nc = function(a3, b2, c2) { - switch (a3) { - case 1: - this.J(b2, c2); - break; - case 2: - this.L(b2, c2); - break; - case 3: - this.T(b2, c2); - break; - case 4: - this.V(b2, c2); - break; - case 5: - this.S(b2, c2); - break; - case 6: - this.Qa(b2, c2); - break; - case 7: - this.Pa(b2, c2); - break; - case 8: - this.I(b2, c2); - break; - case 9: - this.U(b2, c2); - break; - case 10: - p3("Group field type not supported in writeAny()"); - break; - case 11: - p3("Message field type not supported in writeAny()"); - break; - case 12: - this.ja(b2, c2); - break; - case 13: - this.s(b2, c2); - break; - case 14: - this.R(b2, c2); - break; - case 15: - this.Ra(b2, c2); - break; - case 16: - this.Sa(b2, c2); - break; - case 17: - this.rb(b2, c2); - break; - case 18: - this.sb(b2, c2); - break; - case 30: - this.K(b2, c2); - break; - case 31: - this.N(b2, c2); - break; - default: - p3("Invalid field type in writeAny()"); - } - }; - W2.prototype.writeAny = W2.prototype.Nc; - function ub2(a3, b2, c2) { - null != c2 && (Y2(a3, b2, 0), a3.a.j(c2)); - } - function vb2(a3, b2, c2) { - null != c2 && (Y2(a3, b2, 0), a3.a.M(c2)); - } - W2.prototype.S = function(a3, b2) { - null != b2 && (n4(-2147483648 <= b2 && 2147483648 > b2), vb2(this, a3, b2)); - }; - W2.prototype.writeInt32 = W2.prototype.S; - W2.prototype.ob = function(a3, b2) { - null != b2 && (b2 = parseInt(b2, 10), n4(-2147483648 <= b2 && 2147483648 > b2), vb2(this, a3, b2)); - }; - W2.prototype.writeInt32String = W2.prototype.ob; - W2.prototype.T = function(a3, b2) { - null != b2 && (n4(-9223372036854776e3 <= b2 && 9223372036854776e3 > b2), null != b2 && (Y2(this, a3, 0), this.a.ua(b2))); - }; - W2.prototype.writeInt64 = W2.prototype.T; - W2.prototype.ka = function(a3, b2) { - null != b2 && (b2 = sb2(b2), Y2(this, a3, 0), this.a.l(b2.lo, b2.hi)); - }; - W2.prototype.writeInt64String = W2.prototype.ka; - W2.prototype.s = function(a3, b2) { - null != b2 && (n4(0 <= b2 && 4294967296 > b2), ub2(this, a3, b2)); - }; - W2.prototype.writeUint32 = W2.prototype.s; - W2.prototype.ub = function(a3, b2) { - null != b2 && (b2 = parseInt(b2, 10), n4(0 <= b2 && 4294967296 > b2), ub2(this, a3, b2)); - }; - W2.prototype.writeUint32String = W2.prototype.ub; - W2.prototype.V = function(a3, b2) { - null != b2 && (n4(0 <= b2 && 18446744073709552e3 > b2), null != b2 && (Y2(this, a3, 0), this.a.va(b2))); - }; - W2.prototype.writeUint64 = W2.prototype.V; - W2.prototype.vb = function(a3, b2) { - null != b2 && (b2 = U5(b2), Y2(this, a3, 0), this.a.l(b2.lo, b2.hi)); - }; - W2.prototype.writeUint64String = W2.prototype.vb; - W2.prototype.rb = function(a3, b2) { - null != b2 && (n4(-2147483648 <= b2 && 2147483648 > b2), null != b2 && (Y2(this, a3, 0), this.a.wa(b2))); - }; - W2.prototype.writeSint32 = W2.prototype.rb; - W2.prototype.sb = function(a3, b2) { - null != b2 && (n4(-9223372036854776e3 <= b2 && 9223372036854776e3 > b2), null != b2 && (Y2(this, a3, 0), this.a.xa(b2))); - }; - W2.prototype.writeSint64 = W2.prototype.sb; - W2.prototype.$d = function(a3, b2) { - null != b2 && null != b2 && (Y2(this, a3, 0), this.a.W(b2)); - }; - W2.prototype.writeSintHash64 = W2.prototype.$d; - W2.prototype.Zd = function(a3, b2) { - null != b2 && null != b2 && (Y2(this, a3, 0), this.a.Ta(b2)); - }; - W2.prototype.writeSint64String = W2.prototype.Zd; - W2.prototype.Pa = function(a3, b2) { - null != b2 && (n4(0 <= b2 && 4294967296 > b2), Y2(this, a3, 5), this.a.s(b2)); - }; - W2.prototype.writeFixed32 = W2.prototype.Pa; - W2.prototype.Qa = function(a3, b2) { - null != b2 && (n4(0 <= b2 && 18446744073709552e3 > b2), Y2(this, a3, 1), this.a.V(b2)); - }; - W2.prototype.writeFixed64 = W2.prototype.Qa; - W2.prototype.nb = function(a3, b2) { - null != b2 && (b2 = U5(b2), Y2(this, a3, 1), this.a.A(b2.lo, b2.hi)); - }; - W2.prototype.writeFixed64String = W2.prototype.nb; - W2.prototype.Ra = function(a3, b2) { - null != b2 && (n4(-2147483648 <= b2 && 2147483648 > b2), Y2(this, a3, 5), this.a.S(b2)); - }; - W2.prototype.writeSfixed32 = W2.prototype.Ra; - W2.prototype.Sa = function(a3, b2) { - null != b2 && (n4(-9223372036854776e3 <= b2 && 9223372036854776e3 > b2), Y2(this, a3, 1), this.a.T(b2)); - }; - W2.prototype.writeSfixed64 = W2.prototype.Sa; - W2.prototype.qb = function(a3, b2) { - null != b2 && (b2 = sb2(b2), Y2(this, a3, 1), this.a.A(b2.lo, b2.hi)); - }; - W2.prototype.writeSfixed64String = W2.prototype.qb; - W2.prototype.L = function(a3, b2) { - null != b2 && (Y2(this, a3, 5), this.a.L(b2)); - }; - W2.prototype.writeFloat = W2.prototype.L; - W2.prototype.J = function(a3, b2) { - null != b2 && (Y2(this, a3, 1), this.a.J(b2)); - }; - W2.prototype.writeDouble = W2.prototype.J; - W2.prototype.I = function(a3, b2) { - null != b2 && (n4("boolean" === typeof b2 || "number" === typeof b2), Y2(this, a3, 0), this.a.I(b2)); - }; - W2.prototype.writeBool = W2.prototype.I; - W2.prototype.R = function(a3, b2) { - null != b2 && (n4(-2147483648 <= b2 && 2147483648 > b2), Y2(this, a3, 0), this.a.M(b2)); - }; - W2.prototype.writeEnum = W2.prototype.R; - W2.prototype.U = function(a3, b2) { - null != b2 && (a3 = X2(this, a3), this.a.U(b2), Z2(this, a3)); - }; - W2.prototype.writeString = W2.prototype.U; - W2.prototype.ja = function(a3, b2) { - null != b2 && (b2 = Ua2(b2), Y2(this, a3, 2), this.a.j(b2.length), tb2(this, b2)); - }; - W2.prototype.writeBytes = W2.prototype.ja; - W2.prototype.Rc = function(a3, b2, c2) { - null != b2 && (a3 = X2(this, a3), c2(b2, this), Z2(this, a3)); - }; - W2.prototype.writeMessage = W2.prototype.Rc; - W2.prototype.Sc = function(a3, b2, c2) { - null != b2 && (Y2(this, 1, 3), Y2(this, 2, 0), this.a.M(a3), a3 = X2(this, 3), c2(b2, this), Z2(this, a3), Y2(this, 1, 4)); - }; - W2.prototype.writeMessageSet = W2.prototype.Sc; - W2.prototype.Oc = function(a3, b2, c2) { - null != b2 && (Y2(this, a3, 3), c2(b2, this), Y2(this, a3, 4)); - }; - W2.prototype.writeGroup = W2.prototype.Oc; - W2.prototype.K = function(a3, b2) { - null != b2 && (n4(8 == b2.length), Y2(this, a3, 1), this.a.K(b2)); - }; - W2.prototype.writeFixedHash64 = W2.prototype.K; - W2.prototype.N = function(a3, b2) { - null != b2 && (n4(8 == b2.length), Y2(this, a3, 0), this.a.N(b2)); - }; - W2.prototype.writeVarintHash64 = W2.prototype.N; - W2.prototype.A = function(a3, b2, c2) { - Y2(this, a3, 1); - this.a.A(b2, c2); - }; - W2.prototype.writeSplitFixed64 = W2.prototype.A; - W2.prototype.l = function(a3, b2, c2) { - Y2(this, a3, 0); - this.a.l(b2, c2); - }; - W2.prototype.writeSplitVarint64 = W2.prototype.l; - W2.prototype.tb = function(a3, b2, c2) { - Y2(this, a3, 0); - var d4 = this.a; - Ja2(b2, c2, function(f3, h4) { - d4.l(f3 >>> 0, h4 >>> 0); - }); - }; - W2.prototype.writeSplitZigzagVarint64 = W2.prototype.tb; - W2.prototype.Ed = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - vb2(this, a3, b2[c2]); - }; - W2.prototype.writeRepeatedInt32 = W2.prototype.Ed; - W2.prototype.Fd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.ob(a3, b2[c2]); - }; - W2.prototype.writeRepeatedInt32String = W2.prototype.Fd; - W2.prototype.Gd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = b2[c2]; - null != d4 && (Y2(this, a3, 0), this.a.ua(d4)); - } - }; - W2.prototype.writeRepeatedInt64 = W2.prototype.Gd; - W2.prototype.Qd = function(a3, b2, c2, d4) { - if (null != b2) - for (var f3 = 0; f3 < b2.length; f3++) - this.A(a3, c2(b2[f3]), d4(b2[f3])); - }; - W2.prototype.writeRepeatedSplitFixed64 = W2.prototype.Qd; - W2.prototype.Rd = function(a3, b2, c2, d4) { - if (null != b2) - for (var f3 = 0; f3 < b2.length; f3++) - this.l(a3, c2(b2[f3]), d4(b2[f3])); - }; - W2.prototype.writeRepeatedSplitVarint64 = W2.prototype.Rd; - W2.prototype.Sd = function(a3, b2, c2, d4) { - if (null != b2) - for (var f3 = 0; f3 < b2.length; f3++) - this.tb(a3, c2(b2[f3]), d4(b2[f3])); - }; - W2.prototype.writeRepeatedSplitZigzagVarint64 = W2.prototype.Sd; - W2.prototype.Hd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.ka(a3, b2[c2]); - }; - W2.prototype.writeRepeatedInt64String = W2.prototype.Hd; - W2.prototype.Ud = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - ub2(this, a3, b2[c2]); - }; - W2.prototype.writeRepeatedUint32 = W2.prototype.Ud; - W2.prototype.Vd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.ub(a3, b2[c2]); - }; - W2.prototype.writeRepeatedUint32String = W2.prototype.Vd; - W2.prototype.Wd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = b2[c2]; - null != d4 && (Y2(this, a3, 0), this.a.va(d4)); - } - }; - W2.prototype.writeRepeatedUint64 = W2.prototype.Wd; - W2.prototype.Xd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.vb(a3, b2[c2]); - }; - W2.prototype.writeRepeatedUint64String = W2.prototype.Xd; - W2.prototype.Md = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = b2[c2]; - null != d4 && (Y2(this, a3, 0), this.a.wa(d4)); - } - }; - W2.prototype.writeRepeatedSint32 = W2.prototype.Md; - W2.prototype.Nd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = b2[c2]; - null != d4 && (Y2(this, a3, 0), this.a.xa(d4)); - } - }; - W2.prototype.writeRepeatedSint64 = W2.prototype.Nd; - W2.prototype.Od = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = b2[c2]; - null != d4 && (Y2(this, a3, 0), this.a.Ta(d4)); - } - }; - W2.prototype.writeRepeatedSint64String = W2.prototype.Od; - W2.prototype.Pd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = b2[c2]; - null != d4 && (Y2(this, a3, 0), this.a.W(d4)); - } - }; - W2.prototype.writeRepeatedSintHash64 = W2.prototype.Pd; - W2.prototype.yd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.Pa(a3, b2[c2]); - }; - W2.prototype.writeRepeatedFixed32 = W2.prototype.yd; - W2.prototype.zd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.Qa(a3, b2[c2]); - }; - W2.prototype.writeRepeatedFixed64 = W2.prototype.zd; - W2.prototype.Ad = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.nb(a3, b2[c2]); - }; - W2.prototype.writeRepeatedFixed64String = W2.prototype.Ad; - W2.prototype.Jd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.Ra(a3, b2[c2]); - }; - W2.prototype.writeRepeatedSfixed32 = W2.prototype.Jd; - W2.prototype.Kd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.Sa(a3, b2[c2]); - }; - W2.prototype.writeRepeatedSfixed64 = W2.prototype.Kd; - W2.prototype.Ld = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.qb(a3, b2[c2]); - }; - W2.prototype.writeRepeatedSfixed64String = W2.prototype.Ld; - W2.prototype.Cd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.L(a3, b2[c2]); - }; - W2.prototype.writeRepeatedFloat = W2.prototype.Cd; - W2.prototype.wd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.J(a3, b2[c2]); - }; - W2.prototype.writeRepeatedDouble = W2.prototype.wd; - W2.prototype.ud = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.I(a3, b2[c2]); - }; - W2.prototype.writeRepeatedBool = W2.prototype.ud; - W2.prototype.xd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.R(a3, b2[c2]); - }; - W2.prototype.writeRepeatedEnum = W2.prototype.xd; - W2.prototype.Td = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.U(a3, b2[c2]); - }; - W2.prototype.writeRepeatedString = W2.prototype.Td; - W2.prototype.vd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.ja(a3, b2[c2]); - }; - W2.prototype.writeRepeatedBytes = W2.prototype.vd; - W2.prototype.Id = function(a3, b2, c2) { - if (null != b2) - for (var d4 = 0; d4 < b2.length; d4++) { - var f3 = X2(this, a3); - c2(b2[d4], this); - Z2(this, f3); - } - }; - W2.prototype.writeRepeatedMessage = W2.prototype.Id; - W2.prototype.Dd = function(a3, b2, c2) { - if (null != b2) - for (var d4 = 0; d4 < b2.length; d4++) - Y2(this, a3, 3), c2(b2[d4], this), Y2(this, a3, 4); - }; - W2.prototype.writeRepeatedGroup = W2.prototype.Dd; - W2.prototype.Bd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.K(a3, b2[c2]); - }; - W2.prototype.writeRepeatedFixedHash64 = W2.prototype.Bd; - W2.prototype.Yd = function(a3, b2) { - if (null != b2) - for (var c2 = 0; c2 < b2.length; c2++) - this.N(a3, b2[c2]); - }; - W2.prototype.writeRepeatedVarintHash64 = W2.prototype.Yd; - W2.prototype.ad = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.M(b2[c2]); - Z2(this, a3); - } - }; - W2.prototype.writePackedInt32 = W2.prototype.ad; - W2.prototype.bd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.M(parseInt(b2[c2], 10)); - Z2(this, a3); - } - }; - W2.prototype.writePackedInt32String = W2.prototype.bd; - W2.prototype.cd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.ua(b2[c2]); - Z2(this, a3); - } - }; - W2.prototype.writePackedInt64 = W2.prototype.cd; - W2.prototype.md = function(a3, b2, c2, d4) { - if (null != b2) { - a3 = X2(this, a3); - for (var f3 = 0; f3 < b2.length; f3++) - this.a.A(c2(b2[f3]), d4(b2[f3])); - Z2(this, a3); - } - }; - W2.prototype.writePackedSplitFixed64 = W2.prototype.md; - W2.prototype.nd = function(a3, b2, c2, d4) { - if (null != b2) { - a3 = X2(this, a3); - for (var f3 = 0; f3 < b2.length; f3++) - this.a.l(c2(b2[f3]), d4(b2[f3])); - Z2(this, a3); - } - }; - W2.prototype.writePackedSplitVarint64 = W2.prototype.nd; - W2.prototype.od = function(a3, b2, c2, d4) { - if (null != b2) { - a3 = X2(this, a3); - for (var f3 = this.a, h4 = 0; h4 < b2.length; h4++) - Ja2(c2(b2[h4]), d4(b2[h4]), function(m3, t2) { - f3.l(m3 >>> 0, t2 >>> 0); - }); - Z2(this, a3); - } - }; - W2.prototype.writePackedSplitZigzagVarint64 = W2.prototype.od; - W2.prototype.dd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = sb2(b2[c2]); - this.a.l(d4.lo, d4.hi); - } - Z2(this, a3); - } - }; - W2.prototype.writePackedInt64String = W2.prototype.dd; - W2.prototype.pd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.j(b2[c2]); - Z2(this, a3); - } - }; - W2.prototype.writePackedUint32 = W2.prototype.pd; - W2.prototype.qd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.j(parseInt(b2[c2], 10)); - Z2(this, a3); - } - }; - W2.prototype.writePackedUint32String = W2.prototype.qd; - W2.prototype.rd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.va(b2[c2]); - Z2(this, a3); - } - }; - W2.prototype.writePackedUint64 = W2.prototype.rd; - W2.prototype.sd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) { - var d4 = U5(b2[c2]); - this.a.l(d4.lo, d4.hi); - } - Z2(this, a3); - } - }; - W2.prototype.writePackedUint64String = W2.prototype.sd; - W2.prototype.hd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.wa(b2[c2]); - Z2(this, a3); - } - }; - W2.prototype.writePackedSint32 = W2.prototype.hd; - W2.prototype.jd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.xa(b2[c2]); - Z2(this, a3); - } - }; - W2.prototype.writePackedSint64 = W2.prototype.jd; - W2.prototype.kd = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.W(H2(b2[c2])); - Z2(this, a3); - } - }; - W2.prototype.writePackedSint64String = W2.prototype.kd; - W2.prototype.ld = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.W(b2[c2]); - Z2(this, a3); - } - }; - W2.prototype.writePackedSintHash64 = W2.prototype.ld; - W2.prototype.Wc = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(4 * b2.length), a3 = 0; a3 < b2.length; a3++) - this.a.s(b2[a3]); - }; - W2.prototype.writePackedFixed32 = W2.prototype.Wc; - W2.prototype.Xc = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) - this.a.V(b2[a3]); - }; - W2.prototype.writePackedFixed64 = W2.prototype.Xc; - W2.prototype.Yc = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) { - var c2 = U5(b2[a3]); - this.a.A(c2.lo, c2.hi); - } - }; - W2.prototype.writePackedFixed64String = W2.prototype.Yc; - W2.prototype.ed = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(4 * b2.length), a3 = 0; a3 < b2.length; a3++) - this.a.S(b2[a3]); - }; - W2.prototype.writePackedSfixed32 = W2.prototype.ed; - W2.prototype.fd = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) - this.a.T(b2[a3]); - }; - W2.prototype.writePackedSfixed64 = W2.prototype.fd; - W2.prototype.gd = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) - this.a.ka(b2[a3]); - }; - W2.prototype.writePackedSfixed64String = W2.prototype.gd; - W2.prototype.$c = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(4 * b2.length), a3 = 0; a3 < b2.length; a3++) - this.a.L(b2[a3]); - }; - W2.prototype.writePackedFloat = W2.prototype.$c; - W2.prototype.Uc = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) - this.a.J(b2[a3]); - }; - W2.prototype.writePackedDouble = W2.prototype.Uc; - W2.prototype.Tc = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(b2.length), a3 = 0; a3 < b2.length; a3++) - this.a.I(b2[a3]); - }; - W2.prototype.writePackedBool = W2.prototype.Tc; - W2.prototype.Vc = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.R(b2[c2]); - Z2(this, a3); - } - }; - W2.prototype.writePackedEnum = W2.prototype.Vc; - W2.prototype.Zc = function(a3, b2) { - if (null != b2 && b2.length) - for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) - this.a.K(b2[a3]); - }; - W2.prototype.writePackedFixedHash64 = W2.prototype.Zc; - W2.prototype.td = function(a3, b2) { - if (null != b2 && b2.length) { - a3 = X2(this, a3); - for (var c2 = 0; c2 < b2.length; c2++) - this.a.N(b2[c2]); - Z2(this, a3); - } - }; - W2.prototype.writePackedVarintHash64 = W2.prototype.td; - exports.debug = R3, exports.Map = r2, exports.Message = N2, exports.BinaryReader = J2, exports.BinaryWriter = W2, exports.ExtensionFieldInfo = Ya2, exports.ExtensionFieldBinaryInfo = Za2, exports.exportSymbol = ma2, exports.inherits = na2, exports.object = { extend: pa2 }, exports.typeOf = k2; -})(googleProtobuf); -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - goog.exportSymbol("proto.google.protobuf.Any", null, global2); - proto.google.protobuf.Any = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(proto.google.protobuf.Any, jspb.Message); - if (goog.DEBUG && !COMPILED) { - proto.google.protobuf.Any.displayName = "proto.google.protobuf.Any"; - } - if (jspb.Message.GENERATE_TO_OBJECT) { - proto.google.protobuf.Any.prototype.toObject = function(opt_includeInstance) { - return proto.google.protobuf.Any.toObject(opt_includeInstance, this); - }; - proto.google.protobuf.Any.toObject = function(includeInstance, msg) { - var obj = { - typeUrl: jspb.Message.getFieldWithDefault(msg, 1, ""), - value: msg.getValue_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - proto.google.protobuf.Any.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new proto.google.protobuf.Any(); - return proto.google.protobuf.Any.deserializeBinaryFromReader(msg, reader); - }; - proto.google.protobuf.Any.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setTypeUrl(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - proto.google.protobuf.Any.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.google.protobuf.Any.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - proto.google.protobuf.Any.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getTypeUrl(); - if (f3.length > 0) { - writer.writeString( - 1, - f3 - ); - } - f3 = message2.getValue_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - }; - proto.google.protobuf.Any.prototype.getTypeUrl = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - proto.google.protobuf.Any.prototype.setTypeUrl = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); - }; - proto.google.protobuf.Any.prototype.getValue = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - proto.google.protobuf.Any.prototype.getValue_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getValue() - ) - ); - }; - proto.google.protobuf.Any.prototype.getValue_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getValue() - ) - ); - }; - proto.google.protobuf.Any.prototype.setValue = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - goog.object.extend(exports, proto.google.protobuf); - proto.google.protobuf.Any.prototype.getTypeName = function() { - return this.getTypeUrl().split("/").pop(); - }; - proto.google.protobuf.Any.prototype.pack = function(serialized, name2, opt_typeUrlPrefix) { - if (!opt_typeUrlPrefix) { - opt_typeUrlPrefix = "type.googleapis.com/"; - } - if (opt_typeUrlPrefix.substr(-1) != "/") { - this.setTypeUrl(opt_typeUrlPrefix + "/" + name2); - } else { - this.setTypeUrl(opt_typeUrlPrefix + name2); - } - this.setValue(serialized); - }; - proto.google.protobuf.Any.prototype.unpack = function(deserialize2, name2) { - if (this.getTypeName() == name2) { - return deserialize2(this.getValue_asU8()); - } else { - return null; - } - }; -})(any_pb); -const google_protobuf_any_pb = /* @__PURE__ */ getDefaultExportFromCjs$1(any_pb); -var Tron_pb = {}; -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - var google_protobuf_any_pb2 = any_pb; - goog.object.extend(proto, google_protobuf_any_pb2); - goog.exportSymbol("TronWebProto.Account", null, global2); - goog.exportSymbol("TronWebProto.Account.AccountResource", null, global2); - goog.exportSymbol("TronWebProto.Account.Frozen", null, global2); - goog.exportSymbol("TronWebProto.AccountId", null, global2); - goog.exportSymbol("TronWebProto.AccountType", null, global2); - goog.exportSymbol("TronWebProto.DelegatedResource", null, global2); - goog.exportSymbol("TronWebProto.Exchange", null, global2); - goog.exportSymbol("TronWebProto.Key", null, global2); - goog.exportSymbol("TronWebProto.MarketOrderDetail", null, global2); - goog.exportSymbol("TronWebProto.Permission", null, global2); - goog.exportSymbol("TronWebProto.Permission.PermissionType", null, global2); - goog.exportSymbol("TronWebProto.Proposal", null, global2); - goog.exportSymbol("TronWebProto.Proposal.State", null, global2); - goog.exportSymbol("TronWebProto.Transaction", null, global2); - goog.exportSymbol("TronWebProto.Transaction.Contract", null, global2); - goog.exportSymbol("TronWebProto.Transaction.Contract.ContractType", null, global2); - goog.exportSymbol("TronWebProto.Transaction.Result", null, global2); - goog.exportSymbol("TronWebProto.Transaction.Result.code", null, global2); - goog.exportSymbol("TronWebProto.Transaction.Result.contractResult", null, global2); - goog.exportSymbol("TronWebProto.Transaction.raw", null, global2); - goog.exportSymbol("TronWebProto.Vote", null, global2); - goog.exportSymbol("TronWebProto.Votes", null, global2); - goog.exportSymbol("TronWebProto.Witness", null, global2); - goog.exportSymbol("TronWebProto.authority", null, global2); - TronWebProto.AccountId = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.AccountId, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AccountId.displayName = "TronWebProto.AccountId"; - } - TronWebProto.Vote = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.Vote, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Vote.displayName = "TronWebProto.Vote"; - } - TronWebProto.Proposal = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Proposal.repeatedFields_, null); - }; - goog.inherits(TronWebProto.Proposal, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Proposal.displayName = "TronWebProto.Proposal"; - } - TronWebProto.Exchange = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.Exchange, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Exchange.displayName = "TronWebProto.Exchange"; - } - TronWebProto.Account = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Account.repeatedFields_, null); - }; - goog.inherits(TronWebProto.Account, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Account.displayName = "TronWebProto.Account"; - } - TronWebProto.Account.Frozen = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.Account.Frozen, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Account.Frozen.displayName = "TronWebProto.Account.Frozen"; - } - TronWebProto.Account.AccountResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.Account.AccountResource, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Account.AccountResource.displayName = "TronWebProto.Account.AccountResource"; - } - TronWebProto.Key = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.Key, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Key.displayName = "TronWebProto.Key"; - } - TronWebProto.DelegatedResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.DelegatedResource, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.DelegatedResource.displayName = "TronWebProto.DelegatedResource"; - } - TronWebProto.authority = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.authority, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.authority.displayName = "TronWebProto.authority"; - } - TronWebProto.Permission = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Permission.repeatedFields_, null); - }; - goog.inherits(TronWebProto.Permission, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Permission.displayName = "TronWebProto.Permission"; - } - TronWebProto.Witness = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.Witness, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Witness.displayName = "TronWebProto.Witness"; - } - TronWebProto.Votes = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Votes.repeatedFields_, null); - }; - goog.inherits(TronWebProto.Votes, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Votes.displayName = "TronWebProto.Votes"; - } - TronWebProto.MarketOrderDetail = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.MarketOrderDetail, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.MarketOrderDetail.displayName = "TronWebProto.MarketOrderDetail"; - } - TronWebProto.Transaction = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Transaction.repeatedFields_, null); - }; - goog.inherits(TronWebProto.Transaction, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Transaction.displayName = "TronWebProto.Transaction"; - } - TronWebProto.Transaction.Contract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.Transaction.Contract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Transaction.Contract.displayName = "TronWebProto.Transaction.Contract"; - } - TronWebProto.Transaction.Result = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Transaction.Result.repeatedFields_, null); - }; - goog.inherits(TronWebProto.Transaction.Result, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Transaction.Result.displayName = "TronWebProto.Transaction.Result"; - } - TronWebProto.Transaction.raw = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Transaction.raw.repeatedFields_, null); - }; - goog.inherits(TronWebProto.Transaction.raw, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.Transaction.raw.displayName = "TronWebProto.Transaction.raw"; - } - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AccountId.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AccountId.toObject(opt_includeInstance, this); - }; - TronWebProto.AccountId.toObject = function(includeInstance, msg) { - var obj = { - name: msg.getName_asB64(), - address: msg.getAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AccountId.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AccountId(); - return TronWebProto.AccountId.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AccountId.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setName(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AccountId.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AccountId.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AccountId.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getName_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - }; - TronWebProto.AccountId.prototype.getName = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.AccountId.prototype.getName_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getName() - ) - ); - }; - TronWebProto.AccountId.prototype.getName_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getName() - ) - ); - }; - TronWebProto.AccountId.prototype.setName = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.AccountId.prototype.getAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.AccountId.prototype.getAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAddress() - ) - ); - }; - TronWebProto.AccountId.prototype.getAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAddress() - ) - ); - }; - TronWebProto.AccountId.prototype.setAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Vote.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Vote.toObject(opt_includeInstance, this); - }; - TronWebProto.Vote.toObject = function(includeInstance, msg) { - var obj = { - voteAddress: msg.getVoteAddress_asB64(), - voteCount: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Vote.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Vote(); - return TronWebProto.Vote.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Vote.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setVoteAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setVoteCount(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Vote.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Vote.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Vote.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getVoteAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getVoteCount(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - }; - TronWebProto.Vote.prototype.getVoteAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.Vote.prototype.getVoteAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getVoteAddress() - ) - ); - }; - TronWebProto.Vote.prototype.getVoteAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getVoteAddress() - ) - ); - }; - TronWebProto.Vote.prototype.setVoteAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.Vote.prototype.getVoteCount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.Vote.prototype.setVoteCount = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.Proposal.repeatedFields_ = [6]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Proposal.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Proposal.toObject(opt_includeInstance, this); - }; - TronWebProto.Proposal.toObject = function(includeInstance, msg) { - var f3, obj = { - proposalId: jspb.Message.getFieldWithDefault(msg, 1, 0), - proposerAddress: msg.getProposerAddress_asB64(), - parametersMap: (f3 = msg.getParametersMap()) ? f3.toObject(includeInstance, void 0) : [], - expirationTime: jspb.Message.getFieldWithDefault(msg, 4, 0), - createTime: jspb.Message.getFieldWithDefault(msg, 5, 0), - approvalsList: msg.getApprovalsList_asB64(), - state: jspb.Message.getFieldWithDefault(msg, 7, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Proposal.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Proposal(); - return TronWebProto.Proposal.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Proposal.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setProposalId(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setProposerAddress(value); - break; - case 3: - var value = msg.getParametersMap(); - reader.readMessage(value, function(message2, reader2) { - jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readInt64, null, 0, 0); - }); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExpirationTime(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setCreateTime(value); - break; - case 6: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.addApprovals(value); - break; - case 7: - var value = ( - /** @type {!TronWebProto.Proposal.State} */ - reader.readEnum() - ); - msg.setState(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Proposal.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Proposal.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Proposal.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getProposalId(); - if (f3 !== 0) { - writer.writeInt64( - 1, - f3 - ); - } - f3 = message2.getProposerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - f3 = message2.getParametersMap(true); - if (f3 && f3.getLength() > 0) { - f3.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeInt64, jspb.BinaryWriter.prototype.writeInt64); - } - f3 = message2.getExpirationTime(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - f3 = message2.getCreateTime(); - if (f3 !== 0) { - writer.writeInt64( - 5, - f3 - ); - } - f3 = message2.getApprovalsList_asU8(); - if (f3.length > 0) { - writer.writeRepeatedBytes( - 6, - f3 - ); - } - f3 = message2.getState(); - if (f3 !== 0) { - writer.writeEnum( - 7, - f3 - ); - } - }; - TronWebProto.Proposal.State = { - PENDING: 0, - DISAPPROVED: 1, - APPROVED: 2, - CANCELED: 3 - }; - TronWebProto.Proposal.prototype.getProposalId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.Proposal.prototype.setProposalId = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.Proposal.prototype.getProposerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.Proposal.prototype.getProposerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getProposerAddress() - ) - ); - }; - TronWebProto.Proposal.prototype.getProposerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getProposerAddress() - ) - ); - }; - TronWebProto.Proposal.prototype.setProposerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.Proposal.prototype.getParametersMap = function(opt_noLazyCreate) { - return ( - /** @type {!jspb.Map} */ - jspb.Message.getMapField( - this, - 3, - opt_noLazyCreate, - null - ) - ); - }; - TronWebProto.Proposal.prototype.clearParametersMap = function() { - this.getParametersMap().clear(); - return this; - }; - TronWebProto.Proposal.prototype.getExpirationTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.Proposal.prototype.setExpirationTime = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - TronWebProto.Proposal.prototype.getCreateTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.Proposal.prototype.setCreateTime = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - TronWebProto.Proposal.prototype.getApprovalsList = function() { - return ( - /** @type {!(Array|Array)} */ - jspb.Message.getRepeatedField(this, 6) - ); - }; - TronWebProto.Proposal.prototype.getApprovalsList_asB64 = function() { - return ( - /** @type {!Array} */ - jspb.Message.bytesListAsB64( - this.getApprovalsList() - ) - ); - }; - TronWebProto.Proposal.prototype.getApprovalsList_asU8 = function() { - return ( - /** @type {!Array} */ - jspb.Message.bytesListAsU8( - this.getApprovalsList() - ) - ); - }; - TronWebProto.Proposal.prototype.setApprovalsList = function(value) { - return jspb.Message.setField(this, 6, value || []); - }; - TronWebProto.Proposal.prototype.addApprovals = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); - }; - TronWebProto.Proposal.prototype.clearApprovalsList = function() { - return this.setApprovalsList([]); - }; - TronWebProto.Proposal.prototype.getState = function() { - return ( - /** @type {!TronWebProto.Proposal.State} */ - jspb.Message.getFieldWithDefault(this, 7, 0) - ); - }; - TronWebProto.Proposal.prototype.setState = function(value) { - return jspb.Message.setProto3EnumField(this, 7, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Exchange.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Exchange.toObject(opt_includeInstance, this); - }; - TronWebProto.Exchange.toObject = function(includeInstance, msg) { - var obj = { - exchangeId: jspb.Message.getFieldWithDefault(msg, 1, 0), - creatorAddress: msg.getCreatorAddress_asB64(), - createTime: jspb.Message.getFieldWithDefault(msg, 3, 0), - firstTokenId: msg.getFirstTokenId_asB64(), - firstTokenBalance: jspb.Message.getFieldWithDefault(msg, 7, 0), - secondTokenId: msg.getSecondTokenId_asB64(), - secondTokenBalance: jspb.Message.getFieldWithDefault(msg, 9, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Exchange.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Exchange(); - return TronWebProto.Exchange.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Exchange.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExchangeId(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setCreatorAddress(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setCreateTime(value); - break; - case 6: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setFirstTokenId(value); - break; - case 7: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFirstTokenBalance(value); - break; - case 8: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setSecondTokenId(value); - break; - case 9: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setSecondTokenBalance(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Exchange.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Exchange.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Exchange.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getExchangeId(); - if (f3 !== 0) { - writer.writeInt64( - 1, - f3 - ); - } - f3 = message2.getCreatorAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - f3 = message2.getCreateTime(); - if (f3 !== 0) { - writer.writeInt64( - 3, - f3 - ); - } - f3 = message2.getFirstTokenId_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 6, - f3 - ); - } - f3 = message2.getFirstTokenBalance(); - if (f3 !== 0) { - writer.writeInt64( - 7, - f3 - ); - } - f3 = message2.getSecondTokenId_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 8, - f3 - ); - } - f3 = message2.getSecondTokenBalance(); - if (f3 !== 0) { - writer.writeInt64( - 9, - f3 - ); - } - }; - TronWebProto.Exchange.prototype.getExchangeId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.Exchange.prototype.setExchangeId = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.Exchange.prototype.getCreatorAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.Exchange.prototype.getCreatorAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getCreatorAddress() - ) - ); - }; - TronWebProto.Exchange.prototype.getCreatorAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getCreatorAddress() - ) - ); - }; - TronWebProto.Exchange.prototype.setCreatorAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.Exchange.prototype.getCreateTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.Exchange.prototype.setCreateTime = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.Exchange.prototype.getFirstTokenId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 6, "") - ); - }; - TronWebProto.Exchange.prototype.getFirstTokenId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getFirstTokenId() - ) - ); - }; - TronWebProto.Exchange.prototype.getFirstTokenId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getFirstTokenId() - ) - ); - }; - TronWebProto.Exchange.prototype.setFirstTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 6, value); - }; - TronWebProto.Exchange.prototype.getFirstTokenBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 7, 0) - ); - }; - TronWebProto.Exchange.prototype.setFirstTokenBalance = function(value) { - return jspb.Message.setProto3IntField(this, 7, value); - }; - TronWebProto.Exchange.prototype.getSecondTokenId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 8, "") - ); - }; - TronWebProto.Exchange.prototype.getSecondTokenId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getSecondTokenId() - ) - ); - }; - TronWebProto.Exchange.prototype.getSecondTokenId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getSecondTokenId() - ) - ); - }; - TronWebProto.Exchange.prototype.setSecondTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 8, value); - }; - TronWebProto.Exchange.prototype.getSecondTokenBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 9, 0) - ); - }; - TronWebProto.Exchange.prototype.setSecondTokenBalance = function(value) { - return jspb.Message.setProto3IntField(this, 9, value); - }; - TronWebProto.Account.repeatedFields_ = [5, 7, 16, 33]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Account.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Account.toObject(opt_includeInstance, this); - }; - TronWebProto.Account.toObject = function(includeInstance, msg) { - var f3, obj = { - accountName: msg.getAccountName_asB64(), - type: jspb.Message.getFieldWithDefault(msg, 2, 0), - address: msg.getAddress_asB64(), - balance: jspb.Message.getFieldWithDefault(msg, 4, 0), - votesList: jspb.Message.toObjectList( - msg.getVotesList(), - TronWebProto.Vote.toObject, - includeInstance - ), - assetMap: (f3 = msg.getAssetMap()) ? f3.toObject(includeInstance, void 0) : [], - assetv2Map: (f3 = msg.getAssetv2Map()) ? f3.toObject(includeInstance, void 0) : [], - frozenList: jspb.Message.toObjectList( - msg.getFrozenList(), - TronWebProto.Account.Frozen.toObject, - includeInstance - ), - netUsage: jspb.Message.getFieldWithDefault(msg, 8, 0), - acquiredDelegatedFrozenBalanceForBandwidth: jspb.Message.getFieldWithDefault(msg, 41, 0), - delegatedFrozenBalanceForBandwidth: jspb.Message.getFieldWithDefault(msg, 42, 0), - oldTronPower: jspb.Message.getFieldWithDefault(msg, 46, 0), - tronPower: (f3 = msg.getTronPower()) && TronWebProto.Account.Frozen.toObject(includeInstance, f3), - assetOptimized: jspb.Message.getBooleanFieldWithDefault(msg, 60, false), - createTime: jspb.Message.getFieldWithDefault(msg, 9, 0), - latestOprationTime: jspb.Message.getFieldWithDefault(msg, 10, 0), - allowance: jspb.Message.getFieldWithDefault(msg, 11, 0), - latestWithdrawTime: jspb.Message.getFieldWithDefault(msg, 12, 0), - code: msg.getCode_asB64(), - isWitness: jspb.Message.getBooleanFieldWithDefault(msg, 14, false), - isCommittee: jspb.Message.getBooleanFieldWithDefault(msg, 15, false), - frozenSupplyList: jspb.Message.toObjectList( - msg.getFrozenSupplyList(), - TronWebProto.Account.Frozen.toObject, - includeInstance - ), - assetIssuedName: msg.getAssetIssuedName_asB64(), - assetIssuedId: msg.getAssetIssuedId_asB64(), - latestAssetOperationTimeMap: (f3 = msg.getLatestAssetOperationTimeMap()) ? f3.toObject(includeInstance, void 0) : [], - latestAssetOperationTimev2Map: (f3 = msg.getLatestAssetOperationTimev2Map()) ? f3.toObject(includeInstance, void 0) : [], - freeNetUsage: jspb.Message.getFieldWithDefault(msg, 19, 0), - freeAssetNetUsageMap: (f3 = msg.getFreeAssetNetUsageMap()) ? f3.toObject(includeInstance, void 0) : [], - freeAssetNetUsagev2Map: (f3 = msg.getFreeAssetNetUsagev2Map()) ? f3.toObject(includeInstance, void 0) : [], - latestConsumeTime: jspb.Message.getFieldWithDefault(msg, 21, 0), - latestConsumeFreeTime: jspb.Message.getFieldWithDefault(msg, 22, 0), - accountId: msg.getAccountId_asB64(), - accountResource: (f3 = msg.getAccountResource()) && TronWebProto.Account.AccountResource.toObject(includeInstance, f3), - codehash: msg.getCodehash_asB64(), - ownerPermission: (f3 = msg.getOwnerPermission()) && TronWebProto.Permission.toObject(includeInstance, f3), - witnessPermission: (f3 = msg.getWitnessPermission()) && TronWebProto.Permission.toObject(includeInstance, f3), - activePermissionList: jspb.Message.toObjectList( - msg.getActivePermissionList(), - TronWebProto.Permission.toObject, - includeInstance - ) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Account.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Account(); - return TronWebProto.Account.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Account.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAccountName(value); - break; - case 2: - var value = ( - /** @type {!TronWebProto.AccountType} */ - reader.readEnum() - ); - msg.setType(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAddress(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setBalance(value); - break; - case 5: - var value = new TronWebProto.Vote(); - reader.readMessage(value, TronWebProto.Vote.deserializeBinaryFromReader); - msg.addVotes(value); - break; - case 6: - var value = msg.getAssetMap(); - reader.readMessage(value, function(message2, reader2) { - jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); - }); - break; - case 56: - var value = msg.getAssetv2Map(); - reader.readMessage(value, function(message2, reader2) { - jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); - }); - break; - case 7: - var value = new TronWebProto.Account.Frozen(); - reader.readMessage(value, TronWebProto.Account.Frozen.deserializeBinaryFromReader); - msg.addFrozen(value); - break; - case 8: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setNetUsage(value); - break; - case 41: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setAcquiredDelegatedFrozenBalanceForBandwidth(value); - break; - case 42: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setDelegatedFrozenBalanceForBandwidth(value); - break; - case 46: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setOldTronPower(value); - break; - case 47: - var value = new TronWebProto.Account.Frozen(); - reader.readMessage(value, TronWebProto.Account.Frozen.deserializeBinaryFromReader); - msg.setTronPower(value); - break; - case 60: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setAssetOptimized(value); - break; - case 9: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setCreateTime(value); - break; - case 10: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setLatestOprationTime(value); - break; - case 11: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setAllowance(value); - break; - case 12: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setLatestWithdrawTime(value); - break; - case 13: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setCode(value); - break; - case 14: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setIsWitness(value); - break; - case 15: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setIsCommittee(value); - break; - case 16: - var value = new TronWebProto.Account.Frozen(); - reader.readMessage(value, TronWebProto.Account.Frozen.deserializeBinaryFromReader); - msg.addFrozenSupply(value); - break; - case 17: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAssetIssuedName(value); - break; - case 57: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAssetIssuedId(value); - break; - case 18: - var value = msg.getLatestAssetOperationTimeMap(); - reader.readMessage(value, function(message2, reader2) { - jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); - }); - break; - case 58: - var value = msg.getLatestAssetOperationTimev2Map(); - reader.readMessage(value, function(message2, reader2) { - jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); - }); - break; - case 19: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFreeNetUsage(value); - break; - case 20: - var value = msg.getFreeAssetNetUsageMap(); - reader.readMessage(value, function(message2, reader2) { - jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); - }); - break; - case 59: - var value = msg.getFreeAssetNetUsagev2Map(); - reader.readMessage(value, function(message2, reader2) { - jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); - }); - break; - case 21: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setLatestConsumeTime(value); - break; - case 22: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setLatestConsumeFreeTime(value); - break; - case 23: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAccountId(value); - break; - case 26: - var value = new TronWebProto.Account.AccountResource(); - reader.readMessage(value, TronWebProto.Account.AccountResource.deserializeBinaryFromReader); - msg.setAccountResource(value); - break; - case 30: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setCodehash(value); - break; - case 31: - var value = new TronWebProto.Permission(); - reader.readMessage(value, TronWebProto.Permission.deserializeBinaryFromReader); - msg.setOwnerPermission(value); - break; - case 32: - var value = new TronWebProto.Permission(); - reader.readMessage(value, TronWebProto.Permission.deserializeBinaryFromReader); - msg.setWitnessPermission(value); - break; - case 33: - var value = new TronWebProto.Permission(); - reader.readMessage(value, TronWebProto.Permission.deserializeBinaryFromReader); - msg.addActivePermission(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Account.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Account.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Account.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAccountName_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getType(); - if (f3 !== 0) { - writer.writeEnum( - 2, - f3 - ); - } - f3 = message2.getAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getBalance(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - f3 = message2.getVotesList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 5, - f3, - TronWebProto.Vote.serializeBinaryToWriter - ); - } - f3 = message2.getAssetMap(true); - if (f3 && f3.getLength() > 0) { - f3.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); - } - f3 = message2.getAssetv2Map(true); - if (f3 && f3.getLength() > 0) { - f3.serializeBinary(56, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); - } - f3 = message2.getFrozenList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 7, - f3, - TronWebProto.Account.Frozen.serializeBinaryToWriter - ); - } - f3 = message2.getNetUsage(); - if (f3 !== 0) { - writer.writeInt64( - 8, - f3 - ); - } - f3 = message2.getAcquiredDelegatedFrozenBalanceForBandwidth(); - if (f3 !== 0) { - writer.writeInt64( - 41, - f3 - ); - } - f3 = message2.getDelegatedFrozenBalanceForBandwidth(); - if (f3 !== 0) { - writer.writeInt64( - 42, - f3 - ); - } - f3 = message2.getOldTronPower(); - if (f3 !== 0) { - writer.writeInt64( - 46, - f3 - ); - } - f3 = message2.getTronPower(); - if (f3 != null) { - writer.writeMessage( - 47, - f3, - TronWebProto.Account.Frozen.serializeBinaryToWriter - ); - } - f3 = message2.getAssetOptimized(); - if (f3) { - writer.writeBool( - 60, - f3 - ); - } - f3 = message2.getCreateTime(); - if (f3 !== 0) { - writer.writeInt64( - 9, - f3 - ); - } - f3 = message2.getLatestOprationTime(); - if (f3 !== 0) { - writer.writeInt64( - 10, - f3 - ); - } - f3 = message2.getAllowance(); - if (f3 !== 0) { - writer.writeInt64( - 11, - f3 - ); - } - f3 = message2.getLatestWithdrawTime(); - if (f3 !== 0) { - writer.writeInt64( - 12, - f3 - ); - } - f3 = message2.getCode_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 13, - f3 - ); - } - f3 = message2.getIsWitness(); - if (f3) { - writer.writeBool( - 14, - f3 - ); - } - f3 = message2.getIsCommittee(); - if (f3) { - writer.writeBool( - 15, - f3 - ); - } - f3 = message2.getFrozenSupplyList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 16, - f3, - TronWebProto.Account.Frozen.serializeBinaryToWriter - ); - } - f3 = message2.getAssetIssuedName_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 17, - f3 - ); - } - f3 = message2.getAssetIssuedId_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 57, - f3 - ); - } - f3 = message2.getLatestAssetOperationTimeMap(true); - if (f3 && f3.getLength() > 0) { - f3.serializeBinary(18, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); - } - f3 = message2.getLatestAssetOperationTimev2Map(true); - if (f3 && f3.getLength() > 0) { - f3.serializeBinary(58, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); - } - f3 = message2.getFreeNetUsage(); - if (f3 !== 0) { - writer.writeInt64( - 19, - f3 - ); - } - f3 = message2.getFreeAssetNetUsageMap(true); - if (f3 && f3.getLength() > 0) { - f3.serializeBinary(20, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); - } - f3 = message2.getFreeAssetNetUsagev2Map(true); - if (f3 && f3.getLength() > 0) { - f3.serializeBinary(59, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); - } - f3 = message2.getLatestConsumeTime(); - if (f3 !== 0) { - writer.writeInt64( - 21, - f3 - ); - } - f3 = message2.getLatestConsumeFreeTime(); - if (f3 !== 0) { - writer.writeInt64( - 22, - f3 - ); - } - f3 = message2.getAccountId_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 23, - f3 - ); - } - f3 = message2.getAccountResource(); - if (f3 != null) { - writer.writeMessage( - 26, - f3, - TronWebProto.Account.AccountResource.serializeBinaryToWriter - ); - } - f3 = message2.getCodehash_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 30, - f3 - ); - } - f3 = message2.getOwnerPermission(); - if (f3 != null) { - writer.writeMessage( - 31, - f3, - TronWebProto.Permission.serializeBinaryToWriter - ); - } - f3 = message2.getWitnessPermission(); - if (f3 != null) { - writer.writeMessage( - 32, - f3, - TronWebProto.Permission.serializeBinaryToWriter - ); - } - f3 = message2.getActivePermissionList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 33, - f3, - TronWebProto.Permission.serializeBinaryToWriter - ); - } - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Account.Frozen.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Account.Frozen.toObject(opt_includeInstance, this); - }; - TronWebProto.Account.Frozen.toObject = function(includeInstance, msg) { - var obj = { - frozenBalance: jspb.Message.getFieldWithDefault(msg, 1, 0), - expireTime: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Account.Frozen.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Account.Frozen(); - return TronWebProto.Account.Frozen.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Account.Frozen.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFrozenBalance(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExpireTime(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Account.Frozen.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Account.Frozen.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Account.Frozen.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getFrozenBalance(); - if (f3 !== 0) { - writer.writeInt64( - 1, - f3 - ); - } - f3 = message2.getExpireTime(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - }; - TronWebProto.Account.Frozen.prototype.getFrozenBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.Account.Frozen.prototype.setFrozenBalance = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.Account.Frozen.prototype.getExpireTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.Account.Frozen.prototype.setExpireTime = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Account.AccountResource.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Account.AccountResource.toObject(opt_includeInstance, this); - }; - TronWebProto.Account.AccountResource.toObject = function(includeInstance, msg) { - var f3, obj = { - energyUsage: jspb.Message.getFieldWithDefault(msg, 1, 0), - frozenBalanceForEnergy: (f3 = msg.getFrozenBalanceForEnergy()) && TronWebProto.Account.Frozen.toObject(includeInstance, f3), - latestConsumeTimeForEnergy: jspb.Message.getFieldWithDefault(msg, 3, 0), - acquiredDelegatedFrozenBalanceForEnergy: jspb.Message.getFieldWithDefault(msg, 4, 0), - delegatedFrozenBalanceForEnergy: jspb.Message.getFieldWithDefault(msg, 5, 0), - storageLimit: jspb.Message.getFieldWithDefault(msg, 6, 0), - storageUsage: jspb.Message.getFieldWithDefault(msg, 7, 0), - latestExchangeStorageTime: jspb.Message.getFieldWithDefault(msg, 8, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Account.AccountResource.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Account.AccountResource(); - return TronWebProto.Account.AccountResource.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Account.AccountResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setEnergyUsage(value); - break; - case 2: - var value = new TronWebProto.Account.Frozen(); - reader.readMessage(value, TronWebProto.Account.Frozen.deserializeBinaryFromReader); - msg.setFrozenBalanceForEnergy(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setLatestConsumeTimeForEnergy(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setAcquiredDelegatedFrozenBalanceForEnergy(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setDelegatedFrozenBalanceForEnergy(value); - break; - case 6: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setStorageLimit(value); - break; - case 7: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setStorageUsage(value); - break; - case 8: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setLatestExchangeStorageTime(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Account.AccountResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Account.AccountResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Account.AccountResource.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getEnergyUsage(); - if (f3 !== 0) { - writer.writeInt64( - 1, - f3 - ); - } - f3 = message2.getFrozenBalanceForEnergy(); - if (f3 != null) { - writer.writeMessage( - 2, - f3, - TronWebProto.Account.Frozen.serializeBinaryToWriter - ); - } - f3 = message2.getLatestConsumeTimeForEnergy(); - if (f3 !== 0) { - writer.writeInt64( - 3, - f3 - ); - } - f3 = message2.getAcquiredDelegatedFrozenBalanceForEnergy(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - f3 = message2.getDelegatedFrozenBalanceForEnergy(); - if (f3 !== 0) { - writer.writeInt64( - 5, - f3 - ); - } - f3 = message2.getStorageLimit(); - if (f3 !== 0) { - writer.writeInt64( - 6, - f3 - ); - } - f3 = message2.getStorageUsage(); - if (f3 !== 0) { - writer.writeInt64( - 7, - f3 - ); - } - f3 = message2.getLatestExchangeStorageTime(); - if (f3 !== 0) { - writer.writeInt64( - 8, - f3 - ); - } - }; - TronWebProto.Account.AccountResource.prototype.getEnergyUsage = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.Account.AccountResource.prototype.setEnergyUsage = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.Account.AccountResource.prototype.getFrozenBalanceForEnergy = function() { - return ( - /** @type{?TronWebProto.Account.Frozen} */ - jspb.Message.getWrapperField(this, TronWebProto.Account.Frozen, 2) - ); - }; - TronWebProto.Account.AccountResource.prototype.setFrozenBalanceForEnergy = function(value) { - return jspb.Message.setWrapperField(this, 2, value); - }; - TronWebProto.Account.AccountResource.prototype.clearFrozenBalanceForEnergy = function() { - return this.setFrozenBalanceForEnergy(void 0); - }; - TronWebProto.Account.AccountResource.prototype.hasFrozenBalanceForEnergy = function() { - return jspb.Message.getField(this, 2) != null; - }; - TronWebProto.Account.AccountResource.prototype.getLatestConsumeTimeForEnergy = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.Account.AccountResource.prototype.setLatestConsumeTimeForEnergy = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.Account.AccountResource.prototype.getAcquiredDelegatedFrozenBalanceForEnergy = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.Account.AccountResource.prototype.setAcquiredDelegatedFrozenBalanceForEnergy = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - TronWebProto.Account.AccountResource.prototype.getDelegatedFrozenBalanceForEnergy = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.Account.AccountResource.prototype.setDelegatedFrozenBalanceForEnergy = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - TronWebProto.Account.AccountResource.prototype.getStorageLimit = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 6, 0) - ); - }; - TronWebProto.Account.AccountResource.prototype.setStorageLimit = function(value) { - return jspb.Message.setProto3IntField(this, 6, value); - }; - TronWebProto.Account.AccountResource.prototype.getStorageUsage = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 7, 0) - ); - }; - TronWebProto.Account.AccountResource.prototype.setStorageUsage = function(value) { - return jspb.Message.setProto3IntField(this, 7, value); - }; - TronWebProto.Account.AccountResource.prototype.getLatestExchangeStorageTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 8, 0) - ); - }; - TronWebProto.Account.AccountResource.prototype.setLatestExchangeStorageTime = function(value) { - return jspb.Message.setProto3IntField(this, 8, value); - }; - TronWebProto.Account.prototype.getAccountName = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.Account.prototype.getAccountName_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAccountName() - ) - ); - }; - TronWebProto.Account.prototype.getAccountName_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAccountName() - ) - ); - }; - TronWebProto.Account.prototype.setAccountName = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.Account.prototype.getType = function() { - return ( - /** @type {!TronWebProto.AccountType} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.Account.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); - }; - TronWebProto.Account.prototype.getAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.Account.prototype.getAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAddress() - ) - ); - }; - TronWebProto.Account.prototype.getAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAddress() - ) - ); - }; - TronWebProto.Account.prototype.setAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.Account.prototype.getBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.Account.prototype.setBalance = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - TronWebProto.Account.prototype.getVotesList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.Vote, 5) - ); - }; - TronWebProto.Account.prototype.setVotesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 5, value); - }; - TronWebProto.Account.prototype.addVotes = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, TronWebProto.Vote, opt_index); - }; - TronWebProto.Account.prototype.clearVotesList = function() { - return this.setVotesList([]); - }; - TronWebProto.Account.prototype.getAssetMap = function(opt_noLazyCreate) { - return ( - /** @type {!jspb.Map} */ - jspb.Message.getMapField( - this, - 6, - opt_noLazyCreate, - null - ) - ); - }; - TronWebProto.Account.prototype.clearAssetMap = function() { - this.getAssetMap().clear(); - return this; - }; - TronWebProto.Account.prototype.getAssetv2Map = function(opt_noLazyCreate) { - return ( - /** @type {!jspb.Map} */ - jspb.Message.getMapField( - this, - 56, - opt_noLazyCreate, - null - ) - ); - }; - TronWebProto.Account.prototype.clearAssetv2Map = function() { - this.getAssetv2Map().clear(); - return this; - }; - TronWebProto.Account.prototype.getFrozenList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.Account.Frozen, 7) - ); - }; - TronWebProto.Account.prototype.setFrozenList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 7, value); - }; - TronWebProto.Account.prototype.addFrozen = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, TronWebProto.Account.Frozen, opt_index); - }; - TronWebProto.Account.prototype.clearFrozenList = function() { - return this.setFrozenList([]); - }; - TronWebProto.Account.prototype.getNetUsage = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 8, 0) - ); - }; - TronWebProto.Account.prototype.setNetUsage = function(value) { - return jspb.Message.setProto3IntField(this, 8, value); - }; - TronWebProto.Account.prototype.getAcquiredDelegatedFrozenBalanceForBandwidth = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 41, 0) - ); - }; - TronWebProto.Account.prototype.setAcquiredDelegatedFrozenBalanceForBandwidth = function(value) { - return jspb.Message.setProto3IntField(this, 41, value); - }; - TronWebProto.Account.prototype.getDelegatedFrozenBalanceForBandwidth = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 42, 0) - ); - }; - TronWebProto.Account.prototype.setDelegatedFrozenBalanceForBandwidth = function(value) { - return jspb.Message.setProto3IntField(this, 42, value); - }; - TronWebProto.Account.prototype.getOldTronPower = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 46, 0) - ); - }; - TronWebProto.Account.prototype.setOldTronPower = function(value) { - return jspb.Message.setProto3IntField(this, 46, value); - }; - TronWebProto.Account.prototype.getTronPower = function() { - return ( - /** @type{?TronWebProto.Account.Frozen} */ - jspb.Message.getWrapperField(this, TronWebProto.Account.Frozen, 47) - ); - }; - TronWebProto.Account.prototype.setTronPower = function(value) { - return jspb.Message.setWrapperField(this, 47, value); - }; - TronWebProto.Account.prototype.clearTronPower = function() { - return this.setTronPower(void 0); - }; - TronWebProto.Account.prototype.hasTronPower = function() { - return jspb.Message.getField(this, 47) != null; - }; - TronWebProto.Account.prototype.getAssetOptimized = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 60, false) - ); - }; - TronWebProto.Account.prototype.setAssetOptimized = function(value) { - return jspb.Message.setProto3BooleanField(this, 60, value); - }; - TronWebProto.Account.prototype.getCreateTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 9, 0) - ); - }; - TronWebProto.Account.prototype.setCreateTime = function(value) { - return jspb.Message.setProto3IntField(this, 9, value); - }; - TronWebProto.Account.prototype.getLatestOprationTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 10, 0) - ); - }; - TronWebProto.Account.prototype.setLatestOprationTime = function(value) { - return jspb.Message.setProto3IntField(this, 10, value); - }; - TronWebProto.Account.prototype.getAllowance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 11, 0) - ); - }; - TronWebProto.Account.prototype.setAllowance = function(value) { - return jspb.Message.setProto3IntField(this, 11, value); - }; - TronWebProto.Account.prototype.getLatestWithdrawTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 12, 0) - ); - }; - TronWebProto.Account.prototype.setLatestWithdrawTime = function(value) { - return jspb.Message.setProto3IntField(this, 12, value); - }; - TronWebProto.Account.prototype.getCode = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 13, "") - ); - }; - TronWebProto.Account.prototype.getCode_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getCode() - ) - ); - }; - TronWebProto.Account.prototype.getCode_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getCode() - ) - ); - }; - TronWebProto.Account.prototype.setCode = function(value) { - return jspb.Message.setProto3BytesField(this, 13, value); - }; - TronWebProto.Account.prototype.getIsWitness = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 14, false) - ); - }; - TronWebProto.Account.prototype.setIsWitness = function(value) { - return jspb.Message.setProto3BooleanField(this, 14, value); - }; - TronWebProto.Account.prototype.getIsCommittee = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 15, false) - ); - }; - TronWebProto.Account.prototype.setIsCommittee = function(value) { - return jspb.Message.setProto3BooleanField(this, 15, value); - }; - TronWebProto.Account.prototype.getFrozenSupplyList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.Account.Frozen, 16) - ); - }; - TronWebProto.Account.prototype.setFrozenSupplyList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 16, value); - }; - TronWebProto.Account.prototype.addFrozenSupply = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 16, opt_value, TronWebProto.Account.Frozen, opt_index); - }; - TronWebProto.Account.prototype.clearFrozenSupplyList = function() { - return this.setFrozenSupplyList([]); - }; - TronWebProto.Account.prototype.getAssetIssuedName = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 17, "") - ); - }; - TronWebProto.Account.prototype.getAssetIssuedName_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAssetIssuedName() - ) - ); - }; - TronWebProto.Account.prototype.getAssetIssuedName_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAssetIssuedName() - ) - ); - }; - TronWebProto.Account.prototype.setAssetIssuedName = function(value) { - return jspb.Message.setProto3BytesField(this, 17, value); - }; - TronWebProto.Account.prototype.getAssetIssuedId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 57, "") - ); - }; - TronWebProto.Account.prototype.getAssetIssuedId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAssetIssuedId() - ) - ); - }; - TronWebProto.Account.prototype.getAssetIssuedId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAssetIssuedId() - ) - ); - }; - TronWebProto.Account.prototype.setAssetIssuedId = function(value) { - return jspb.Message.setProto3BytesField(this, 57, value); - }; - TronWebProto.Account.prototype.getLatestAssetOperationTimeMap = function(opt_noLazyCreate) { - return ( - /** @type {!jspb.Map} */ - jspb.Message.getMapField( - this, - 18, - opt_noLazyCreate, - null - ) - ); - }; - TronWebProto.Account.prototype.clearLatestAssetOperationTimeMap = function() { - this.getLatestAssetOperationTimeMap().clear(); - return this; - }; - TronWebProto.Account.prototype.getLatestAssetOperationTimev2Map = function(opt_noLazyCreate) { - return ( - /** @type {!jspb.Map} */ - jspb.Message.getMapField( - this, - 58, - opt_noLazyCreate, - null - ) - ); - }; - TronWebProto.Account.prototype.clearLatestAssetOperationTimev2Map = function() { - this.getLatestAssetOperationTimev2Map().clear(); - return this; - }; - TronWebProto.Account.prototype.getFreeNetUsage = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 19, 0) - ); - }; - TronWebProto.Account.prototype.setFreeNetUsage = function(value) { - return jspb.Message.setProto3IntField(this, 19, value); - }; - TronWebProto.Account.prototype.getFreeAssetNetUsageMap = function(opt_noLazyCreate) { - return ( - /** @type {!jspb.Map} */ - jspb.Message.getMapField( - this, - 20, - opt_noLazyCreate, - null - ) - ); - }; - TronWebProto.Account.prototype.clearFreeAssetNetUsageMap = function() { - this.getFreeAssetNetUsageMap().clear(); - return this; - }; - TronWebProto.Account.prototype.getFreeAssetNetUsagev2Map = function(opt_noLazyCreate) { - return ( - /** @type {!jspb.Map} */ - jspb.Message.getMapField( - this, - 59, - opt_noLazyCreate, - null - ) - ); - }; - TronWebProto.Account.prototype.clearFreeAssetNetUsagev2Map = function() { - this.getFreeAssetNetUsagev2Map().clear(); - return this; - }; - TronWebProto.Account.prototype.getLatestConsumeTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 21, 0) - ); - }; - TronWebProto.Account.prototype.setLatestConsumeTime = function(value) { - return jspb.Message.setProto3IntField(this, 21, value); - }; - TronWebProto.Account.prototype.getLatestConsumeFreeTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 22, 0) - ); - }; - TronWebProto.Account.prototype.setLatestConsumeFreeTime = function(value) { - return jspb.Message.setProto3IntField(this, 22, value); - }; - TronWebProto.Account.prototype.getAccountId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 23, "") - ); - }; - TronWebProto.Account.prototype.getAccountId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAccountId() - ) - ); - }; - TronWebProto.Account.prototype.getAccountId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAccountId() - ) - ); - }; - TronWebProto.Account.prototype.setAccountId = function(value) { - return jspb.Message.setProto3BytesField(this, 23, value); - }; - TronWebProto.Account.prototype.getAccountResource = function() { - return ( - /** @type{?TronWebProto.Account.AccountResource} */ - jspb.Message.getWrapperField(this, TronWebProto.Account.AccountResource, 26) - ); - }; - TronWebProto.Account.prototype.setAccountResource = function(value) { - return jspb.Message.setWrapperField(this, 26, value); - }; - TronWebProto.Account.prototype.clearAccountResource = function() { - return this.setAccountResource(void 0); - }; - TronWebProto.Account.prototype.hasAccountResource = function() { - return jspb.Message.getField(this, 26) != null; - }; - TronWebProto.Account.prototype.getCodehash = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 30, "") - ); - }; - TronWebProto.Account.prototype.getCodehash_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getCodehash() - ) - ); - }; - TronWebProto.Account.prototype.getCodehash_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getCodehash() - ) - ); - }; - TronWebProto.Account.prototype.setCodehash = function(value) { - return jspb.Message.setProto3BytesField(this, 30, value); - }; - TronWebProto.Account.prototype.getOwnerPermission = function() { - return ( - /** @type{?TronWebProto.Permission} */ - jspb.Message.getWrapperField(this, TronWebProto.Permission, 31) - ); - }; - TronWebProto.Account.prototype.setOwnerPermission = function(value) { - return jspb.Message.setWrapperField(this, 31, value); - }; - TronWebProto.Account.prototype.clearOwnerPermission = function() { - return this.setOwnerPermission(void 0); - }; - TronWebProto.Account.prototype.hasOwnerPermission = function() { - return jspb.Message.getField(this, 31) != null; - }; - TronWebProto.Account.prototype.getWitnessPermission = function() { - return ( - /** @type{?TronWebProto.Permission} */ - jspb.Message.getWrapperField(this, TronWebProto.Permission, 32) - ); - }; - TronWebProto.Account.prototype.setWitnessPermission = function(value) { - return jspb.Message.setWrapperField(this, 32, value); - }; - TronWebProto.Account.prototype.clearWitnessPermission = function() { - return this.setWitnessPermission(void 0); - }; - TronWebProto.Account.prototype.hasWitnessPermission = function() { - return jspb.Message.getField(this, 32) != null; - }; - TronWebProto.Account.prototype.getActivePermissionList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.Permission, 33) - ); - }; - TronWebProto.Account.prototype.setActivePermissionList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 33, value); - }; - TronWebProto.Account.prototype.addActivePermission = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 33, opt_value, TronWebProto.Permission, opt_index); - }; - TronWebProto.Account.prototype.clearActivePermissionList = function() { - return this.setActivePermissionList([]); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Key.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Key.toObject(opt_includeInstance, this); - }; - TronWebProto.Key.toObject = function(includeInstance, msg) { - var obj = { - address: msg.getAddress_asB64(), - weight: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Key.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Key(); - return TronWebProto.Key.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Key.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setWeight(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Key.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Key.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Key.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getWeight(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - }; - TronWebProto.Key.prototype.getAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.Key.prototype.getAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAddress() - ) - ); - }; - TronWebProto.Key.prototype.getAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAddress() - ) - ); - }; - TronWebProto.Key.prototype.setAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.Key.prototype.getWeight = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.Key.prototype.setWeight = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.DelegatedResource.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.DelegatedResource.toObject(opt_includeInstance, this); - }; - TronWebProto.DelegatedResource.toObject = function(includeInstance, msg) { - var obj = { - from: msg.getFrom_asB64(), - to: msg.getTo_asB64(), - frozenBalanceForBandwidth: jspb.Message.getFieldWithDefault(msg, 3, 0), - frozenBalanceForEnergy: jspb.Message.getFieldWithDefault(msg, 4, 0), - expireTimeForBandwidth: jspb.Message.getFieldWithDefault(msg, 5, 0), - expireTimeForEnergy: jspb.Message.getFieldWithDefault(msg, 6, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.DelegatedResource.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.DelegatedResource(); - return TronWebProto.DelegatedResource.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.DelegatedResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setFrom(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setTo(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFrozenBalanceForBandwidth(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFrozenBalanceForEnergy(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExpireTimeForBandwidth(value); - break; - case 6: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExpireTimeForEnergy(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.DelegatedResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.DelegatedResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.DelegatedResource.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getFrom_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getTo_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - f3 = message2.getFrozenBalanceForBandwidth(); - if (f3 !== 0) { - writer.writeInt64( - 3, - f3 - ); - } - f3 = message2.getFrozenBalanceForEnergy(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - f3 = message2.getExpireTimeForBandwidth(); - if (f3 !== 0) { - writer.writeInt64( - 5, - f3 - ); - } - f3 = message2.getExpireTimeForEnergy(); - if (f3 !== 0) { - writer.writeInt64( - 6, - f3 - ); - } - }; - TronWebProto.DelegatedResource.prototype.getFrom = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.DelegatedResource.prototype.getFrom_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getFrom() - ) - ); - }; - TronWebProto.DelegatedResource.prototype.getFrom_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getFrom() - ) - ); - }; - TronWebProto.DelegatedResource.prototype.setFrom = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.DelegatedResource.prototype.getTo = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.DelegatedResource.prototype.getTo_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getTo() - ) - ); - }; - TronWebProto.DelegatedResource.prototype.getTo_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getTo() - ) - ); - }; - TronWebProto.DelegatedResource.prototype.setTo = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.DelegatedResource.prototype.getFrozenBalanceForBandwidth = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.DelegatedResource.prototype.setFrozenBalanceForBandwidth = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.DelegatedResource.prototype.getFrozenBalanceForEnergy = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.DelegatedResource.prototype.setFrozenBalanceForEnergy = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - TronWebProto.DelegatedResource.prototype.getExpireTimeForBandwidth = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.DelegatedResource.prototype.setExpireTimeForBandwidth = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - TronWebProto.DelegatedResource.prototype.getExpireTimeForEnergy = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 6, 0) - ); - }; - TronWebProto.DelegatedResource.prototype.setExpireTimeForEnergy = function(value) { - return jspb.Message.setProto3IntField(this, 6, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.authority.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.authority.toObject(opt_includeInstance, this); - }; - TronWebProto.authority.toObject = function(includeInstance, msg) { - var f3, obj = { - account: (f3 = msg.getAccount()) && TronWebProto.AccountId.toObject(includeInstance, f3), - permissionName: msg.getPermissionName_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.authority.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.authority(); - return TronWebProto.authority.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.authority.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new TronWebProto.AccountId(); - reader.readMessage(value, TronWebProto.AccountId.deserializeBinaryFromReader); - msg.setAccount(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setPermissionName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.authority.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.authority.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.authority.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAccount(); - if (f3 != null) { - writer.writeMessage( - 1, - f3, - TronWebProto.AccountId.serializeBinaryToWriter - ); - } - f3 = message2.getPermissionName_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - }; - TronWebProto.authority.prototype.getAccount = function() { - return ( - /** @type{?TronWebProto.AccountId} */ - jspb.Message.getWrapperField(this, TronWebProto.AccountId, 1) - ); - }; - TronWebProto.authority.prototype.setAccount = function(value) { - return jspb.Message.setWrapperField(this, 1, value); - }; - TronWebProto.authority.prototype.clearAccount = function() { - return this.setAccount(void 0); - }; - TronWebProto.authority.prototype.hasAccount = function() { - return jspb.Message.getField(this, 1) != null; - }; - TronWebProto.authority.prototype.getPermissionName = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.authority.prototype.getPermissionName_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getPermissionName() - ) - ); - }; - TronWebProto.authority.prototype.getPermissionName_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getPermissionName() - ) - ); - }; - TronWebProto.authority.prototype.setPermissionName = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.Permission.repeatedFields_ = [7]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Permission.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Permission.toObject(opt_includeInstance, this); - }; - TronWebProto.Permission.toObject = function(includeInstance, msg) { - var obj = { - type: jspb.Message.getFieldWithDefault(msg, 1, 0), - id: jspb.Message.getFieldWithDefault(msg, 2, 0), - permissionName: jspb.Message.getFieldWithDefault(msg, 3, ""), - threshold: jspb.Message.getFieldWithDefault(msg, 4, 0), - parentId: jspb.Message.getFieldWithDefault(msg, 5, 0), - operations: msg.getOperations_asB64(), - keysList: jspb.Message.toObjectList( - msg.getKeysList(), - TronWebProto.Key.toObject, - includeInstance - ) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Permission.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Permission(); - return TronWebProto.Permission.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Permission.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!TronWebProto.Permission.PermissionType} */ - reader.readEnum() - ); - msg.setType(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt32() - ); - msg.setId(value); - break; - case 3: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setPermissionName(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setThreshold(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt32() - ); - msg.setParentId(value); - break; - case 6: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOperations(value); - break; - case 7: - var value = new TronWebProto.Key(); - reader.readMessage(value, TronWebProto.Key.deserializeBinaryFromReader); - msg.addKeys(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Permission.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Permission.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Permission.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getType(); - if (f3 !== 0) { - writer.writeEnum( - 1, - f3 - ); - } - f3 = message2.getId(); - if (f3 !== 0) { - writer.writeInt32( - 2, - f3 - ); - } - f3 = message2.getPermissionName(); - if (f3.length > 0) { - writer.writeString( - 3, - f3 - ); - } - f3 = message2.getThreshold(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - f3 = message2.getParentId(); - if (f3 !== 0) { - writer.writeInt32( - 5, - f3 - ); - } - f3 = message2.getOperations_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 6, - f3 - ); - } - f3 = message2.getKeysList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 7, - f3, - TronWebProto.Key.serializeBinaryToWriter - ); - } - }; - TronWebProto.Permission.PermissionType = { - OWNER: 0, - WITNESS: 1, - ACTIVE: 2 - }; - TronWebProto.Permission.prototype.getType = function() { - return ( - /** @type {!TronWebProto.Permission.PermissionType} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.Permission.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); - }; - TronWebProto.Permission.prototype.getId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.Permission.prototype.setId = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.Permission.prototype.getPermissionName = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.Permission.prototype.setPermissionName = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); - }; - TronWebProto.Permission.prototype.getThreshold = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.Permission.prototype.setThreshold = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - TronWebProto.Permission.prototype.getParentId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.Permission.prototype.setParentId = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - TronWebProto.Permission.prototype.getOperations = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 6, "") - ); - }; - TronWebProto.Permission.prototype.getOperations_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOperations() - ) - ); - }; - TronWebProto.Permission.prototype.getOperations_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOperations() - ) - ); - }; - TronWebProto.Permission.prototype.setOperations = function(value) { - return jspb.Message.setProto3BytesField(this, 6, value); - }; - TronWebProto.Permission.prototype.getKeysList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.Key, 7) - ); - }; - TronWebProto.Permission.prototype.setKeysList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 7, value); - }; - TronWebProto.Permission.prototype.addKeys = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, TronWebProto.Key, opt_index); - }; - TronWebProto.Permission.prototype.clearKeysList = function() { - return this.setKeysList([]); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Witness.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Witness.toObject(opt_includeInstance, this); - }; - TronWebProto.Witness.toObject = function(includeInstance, msg) { - var obj = { - address: msg.getAddress_asB64(), - votecount: jspb.Message.getFieldWithDefault(msg, 2, 0), - pubkey: msg.getPubkey_asB64(), - url: jspb.Message.getFieldWithDefault(msg, 4, ""), - totalproduced: jspb.Message.getFieldWithDefault(msg, 5, 0), - totalmissed: jspb.Message.getFieldWithDefault(msg, 6, 0), - latestblocknum: jspb.Message.getFieldWithDefault(msg, 7, 0), - latestslotnum: jspb.Message.getFieldWithDefault(msg, 8, 0), - isjobs: jspb.Message.getBooleanFieldWithDefault(msg, 9, false) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Witness.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Witness(); - return TronWebProto.Witness.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Witness.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setVotecount(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setPubkey(value); - break; - case 4: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setUrl(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setTotalproduced(value); - break; - case 6: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setTotalmissed(value); - break; - case 7: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setLatestblocknum(value); - break; - case 8: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setLatestslotnum(value); - break; - case 9: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setIsjobs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Witness.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Witness.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Witness.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getVotecount(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - f3 = message2.getPubkey_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getUrl(); - if (f3.length > 0) { - writer.writeString( - 4, - f3 - ); - } - f3 = message2.getTotalproduced(); - if (f3 !== 0) { - writer.writeInt64( - 5, - f3 - ); - } - f3 = message2.getTotalmissed(); - if (f3 !== 0) { - writer.writeInt64( - 6, - f3 - ); - } - f3 = message2.getLatestblocknum(); - if (f3 !== 0) { - writer.writeInt64( - 7, - f3 - ); - } - f3 = message2.getLatestslotnum(); - if (f3 !== 0) { - writer.writeInt64( - 8, - f3 - ); - } - f3 = message2.getIsjobs(); - if (f3) { - writer.writeBool( - 9, - f3 - ); - } - }; - TronWebProto.Witness.prototype.getAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.Witness.prototype.getAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAddress() - ) - ); - }; - TronWebProto.Witness.prototype.getAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAddress() - ) - ); - }; - TronWebProto.Witness.prototype.setAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.Witness.prototype.getVotecount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.Witness.prototype.setVotecount = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.Witness.prototype.getPubkey = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.Witness.prototype.getPubkey_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getPubkey() - ) - ); - }; - TronWebProto.Witness.prototype.getPubkey_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getPubkey() - ) - ); - }; - TronWebProto.Witness.prototype.setPubkey = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.Witness.prototype.getUrl = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 4, "") - ); - }; - TronWebProto.Witness.prototype.setUrl = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); - }; - TronWebProto.Witness.prototype.getTotalproduced = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.Witness.prototype.setTotalproduced = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - TronWebProto.Witness.prototype.getTotalmissed = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 6, 0) - ); - }; - TronWebProto.Witness.prototype.setTotalmissed = function(value) { - return jspb.Message.setProto3IntField(this, 6, value); - }; - TronWebProto.Witness.prototype.getLatestblocknum = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 7, 0) - ); - }; - TronWebProto.Witness.prototype.setLatestblocknum = function(value) { - return jspb.Message.setProto3IntField(this, 7, value); - }; - TronWebProto.Witness.prototype.getLatestslotnum = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 8, 0) - ); - }; - TronWebProto.Witness.prototype.setLatestslotnum = function(value) { - return jspb.Message.setProto3IntField(this, 8, value); - }; - TronWebProto.Witness.prototype.getIsjobs = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 9, false) - ); - }; - TronWebProto.Witness.prototype.setIsjobs = function(value) { - return jspb.Message.setProto3BooleanField(this, 9, value); - }; - TronWebProto.Votes.repeatedFields_ = [2, 3]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Votes.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Votes.toObject(opt_includeInstance, this); - }; - TronWebProto.Votes.toObject = function(includeInstance, msg) { - var obj = { - address: msg.getAddress_asB64(), - oldVotesList: jspb.Message.toObjectList( - msg.getOldVotesList(), - TronWebProto.Vote.toObject, - includeInstance - ), - newVotesList: jspb.Message.toObjectList( - msg.getNewVotesList(), - TronWebProto.Vote.toObject, - includeInstance - ) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Votes.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Votes(); - return TronWebProto.Votes.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Votes.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAddress(value); - break; - case 2: - var value = new TronWebProto.Vote(); - reader.readMessage(value, TronWebProto.Vote.deserializeBinaryFromReader); - msg.addOldVotes(value); - break; - case 3: - var value = new TronWebProto.Vote(); - reader.readMessage(value, TronWebProto.Vote.deserializeBinaryFromReader); - msg.addNewVotes(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Votes.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Votes.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Votes.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getOldVotesList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 2, - f3, - TronWebProto.Vote.serializeBinaryToWriter - ); - } - f3 = message2.getNewVotesList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 3, - f3, - TronWebProto.Vote.serializeBinaryToWriter - ); - } - }; - TronWebProto.Votes.prototype.getAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.Votes.prototype.getAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAddress() - ) - ); - }; - TronWebProto.Votes.prototype.getAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAddress() - ) - ); - }; - TronWebProto.Votes.prototype.setAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.Votes.prototype.getOldVotesList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.Vote, 2) - ); - }; - TronWebProto.Votes.prototype.setOldVotesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 2, value); - }; - TronWebProto.Votes.prototype.addOldVotes = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, TronWebProto.Vote, opt_index); - }; - TronWebProto.Votes.prototype.clearOldVotesList = function() { - return this.setOldVotesList([]); - }; - TronWebProto.Votes.prototype.getNewVotesList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.Vote, 3) - ); - }; - TronWebProto.Votes.prototype.setNewVotesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); - }; - TronWebProto.Votes.prototype.addNewVotes = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, TronWebProto.Vote, opt_index); - }; - TronWebProto.Votes.prototype.clearNewVotesList = function() { - return this.setNewVotesList([]); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.MarketOrderDetail.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.MarketOrderDetail.toObject(opt_includeInstance, this); - }; - TronWebProto.MarketOrderDetail.toObject = function(includeInstance, msg) { - var obj = { - makerorderid: msg.getMakerorderid_asB64(), - takerorderid: msg.getTakerorderid_asB64(), - fillsellquantity: jspb.Message.getFieldWithDefault(msg, 3, 0), - fillbuyquantity: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.MarketOrderDetail.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.MarketOrderDetail(); - return TronWebProto.MarketOrderDetail.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.MarketOrderDetail.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setMakerorderid(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setTakerorderid(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFillsellquantity(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFillbuyquantity(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.MarketOrderDetail.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.MarketOrderDetail.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.MarketOrderDetail.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getMakerorderid_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getTakerorderid_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - f3 = message2.getFillsellquantity(); - if (f3 !== 0) { - writer.writeInt64( - 3, - f3 - ); - } - f3 = message2.getFillbuyquantity(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - }; - TronWebProto.MarketOrderDetail.prototype.getMakerorderid = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.MarketOrderDetail.prototype.getMakerorderid_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getMakerorderid() - ) - ); - }; - TronWebProto.MarketOrderDetail.prototype.getMakerorderid_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getMakerorderid() - ) - ); - }; - TronWebProto.MarketOrderDetail.prototype.setMakerorderid = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.MarketOrderDetail.prototype.getTakerorderid = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.MarketOrderDetail.prototype.getTakerorderid_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getTakerorderid() - ) - ); - }; - TronWebProto.MarketOrderDetail.prototype.getTakerorderid_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getTakerorderid() - ) - ); - }; - TronWebProto.MarketOrderDetail.prototype.setTakerorderid = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.MarketOrderDetail.prototype.getFillsellquantity = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.MarketOrderDetail.prototype.setFillsellquantity = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.MarketOrderDetail.prototype.getFillbuyquantity = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.MarketOrderDetail.prototype.setFillbuyquantity = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - TronWebProto.Transaction.repeatedFields_ = [2, 5]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Transaction.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Transaction.toObject(opt_includeInstance, this); - }; - TronWebProto.Transaction.toObject = function(includeInstance, msg) { - var f3, obj = { - rawData: (f3 = msg.getRawData()) && TronWebProto.Transaction.raw.toObject(includeInstance, f3), - signatureList: msg.getSignatureList_asB64(), - retList: jspb.Message.toObjectList( - msg.getRetList(), - TronWebProto.Transaction.Result.toObject, - includeInstance - ) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Transaction.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Transaction(); - return TronWebProto.Transaction.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Transaction.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new TronWebProto.Transaction.raw(); - reader.readMessage(value, TronWebProto.Transaction.raw.deserializeBinaryFromReader); - msg.setRawData(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.addSignature(value); - break; - case 5: - var value = new TronWebProto.Transaction.Result(); - reader.readMessage(value, TronWebProto.Transaction.Result.deserializeBinaryFromReader); - msg.addRet(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Transaction.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Transaction.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Transaction.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getRawData(); - if (f3 != null) { - writer.writeMessage( - 1, - f3, - TronWebProto.Transaction.raw.serializeBinaryToWriter - ); - } - f3 = message2.getSignatureList_asU8(); - if (f3.length > 0) { - writer.writeRepeatedBytes( - 2, - f3 - ); - } - f3 = message2.getRetList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 5, - f3, - TronWebProto.Transaction.Result.serializeBinaryToWriter - ); - } - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Transaction.Contract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Transaction.Contract.toObject(opt_includeInstance, this); - }; - TronWebProto.Transaction.Contract.toObject = function(includeInstance, msg) { - var f3, obj = { - type: jspb.Message.getFieldWithDefault(msg, 1, 0), - parameter: (f3 = msg.getParameter()) && google_protobuf_any_pb2.Any.toObject(includeInstance, f3), - provider: msg.getProvider_asB64(), - contractname: msg.getContractname_asB64(), - permissionId: jspb.Message.getFieldWithDefault(msg, 5, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Transaction.Contract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Transaction.Contract(); - return TronWebProto.Transaction.Contract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Transaction.Contract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!TronWebProto.Transaction.Contract.ContractType} */ - reader.readEnum() - ); - msg.setType(value); - break; - case 2: - var value = new google_protobuf_any_pb2.Any(); - reader.readMessage(value, google_protobuf_any_pb2.Any.deserializeBinaryFromReader); - msg.setParameter(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setProvider(value); - break; - case 4: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setContractname(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt32() - ); - msg.setPermissionId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Transaction.Contract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Transaction.Contract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Transaction.Contract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getType(); - if (f3 !== 0) { - writer.writeEnum( - 1, - f3 - ); - } - f3 = message2.getParameter(); - if (f3 != null) { - writer.writeMessage( - 2, - f3, - google_protobuf_any_pb2.Any.serializeBinaryToWriter - ); - } - f3 = message2.getProvider_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getContractname_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 4, - f3 - ); - } - f3 = message2.getPermissionId(); - if (f3 !== 0) { - writer.writeInt32( - 5, - f3 - ); - } - }; - TronWebProto.Transaction.Contract.ContractType = { - ACCOUNTCREATECONTRACT: 0, - TRANSFERCONTRACT: 1, - TRANSFERASSETCONTRACT: 2, - VOTEASSETCONTRACT: 3, - VOTEWITNESSCONTRACT: 4, - WITNESSCREATECONTRACT: 5, - ASSETISSUECONTRACT: 6, - WITNESSUPDATECONTRACT: 8, - PARTICIPATEASSETISSUECONTRACT: 9, - ACCOUNTUPDATECONTRACT: 10, - FREEZEBALANCECONTRACT: 11, - UNFREEZEBALANCECONTRACT: 12, - WITHDRAWBALANCECONTRACT: 13, - UNFREEZEASSETCONTRACT: 14, - UPDATEASSETCONTRACT: 15, - PROPOSALCREATECONTRACT: 16, - PROPOSALAPPROVECONTRACT: 17, - PROPOSALDELETECONTRACT: 18, - SETACCOUNTIDCONTRACT: 19, - CUSTOMCONTRACT: 20, - CREATESMARTCONTRACT: 30, - TRIGGERSMARTCONTRACT: 31, - GETCONTRACT: 32, - UPDATESETTINGCONTRACT: 33, - EXCHANGECREATECONTRACT: 41, - EXCHANGEINJECTCONTRACT: 42, - EXCHANGEWITHDRAWCONTRACT: 43, - EXCHANGETRANSACTIONCONTRACT: 44, - UPDATEENERGYLIMITCONTRACT: 45, - ACCOUNTPERMISSIONUPDATECONTRACT: 46, - CLEARABICONTRACT: 48, - UPDATEBROKERAGECONTRACT: 49, - SHIELDEDTRANSFERCONTRACT: 51, - MARKETSELLASSETCONTRACT: 52, - MARKETCANCELORDERCONTRACT: 53, - FREEZEBALANCEV2CONTRACT: 54, - UNFREEZEBALANCEV2CONTRACT: 55, - WITHDRAWEXPIREUNFREEZECONTRACT: 56, - DELEGATERESOURCECONTRACT: 57, - UNDELEGATERESOURCECONTRACT: 58, - CANCELALLUNFREEZEV2CONTRACT: 59 - }; - TronWebProto.Transaction.Contract.prototype.getType = function() { - return ( - /** @type {!TronWebProto.Transaction.Contract.ContractType} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.Transaction.Contract.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); - }; - TronWebProto.Transaction.Contract.prototype.getParameter = function() { - return ( - /** @type{?TronWebProto.Any} */ - jspb.Message.getWrapperField(this, google_protobuf_any_pb2.Any, 2) - ); - }; - TronWebProto.Transaction.Contract.prototype.setParameter = function(value) { - return jspb.Message.setWrapperField(this, 2, value); - }; - TronWebProto.Transaction.Contract.prototype.clearParameter = function() { - return this.setParameter(void 0); - }; - TronWebProto.Transaction.Contract.prototype.hasParameter = function() { - return jspb.Message.getField(this, 2) != null; - }; - TronWebProto.Transaction.Contract.prototype.getProvider = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.Transaction.Contract.prototype.getProvider_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getProvider() - ) - ); - }; - TronWebProto.Transaction.Contract.prototype.getProvider_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getProvider() - ) - ); - }; - TronWebProto.Transaction.Contract.prototype.setProvider = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.Transaction.Contract.prototype.getContractname = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 4, "") - ); - }; - TronWebProto.Transaction.Contract.prototype.getContractname_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getContractname() - ) - ); - }; - TronWebProto.Transaction.Contract.prototype.getContractname_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getContractname() - ) - ); - }; - TronWebProto.Transaction.Contract.prototype.setContractname = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); - }; - TronWebProto.Transaction.Contract.prototype.getPermissionId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.Transaction.Contract.prototype.setPermissionId = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - TronWebProto.Transaction.Result.repeatedFields_ = [26]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Transaction.Result.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Transaction.Result.toObject(opt_includeInstance, this); - }; - TronWebProto.Transaction.Result.toObject = function(includeInstance, msg) { - var obj = { - fee: jspb.Message.getFieldWithDefault(msg, 1, 0), - ret: jspb.Message.getFieldWithDefault(msg, 2, 0), - contractret: jspb.Message.getFieldWithDefault(msg, 3, 0), - assetissueid: jspb.Message.getFieldWithDefault(msg, 14, ""), - withdrawAmount: jspb.Message.getFieldWithDefault(msg, 15, 0), - unfreezeAmount: jspb.Message.getFieldWithDefault(msg, 16, 0), - exchangeReceivedAmount: jspb.Message.getFieldWithDefault(msg, 18, 0), - exchangeInjectAnotherAmount: jspb.Message.getFieldWithDefault(msg, 19, 0), - exchangeWithdrawAnotherAmount: jspb.Message.getFieldWithDefault(msg, 20, 0), - exchangeId: jspb.Message.getFieldWithDefault(msg, 21, 0), - shieldedTransactionFee: jspb.Message.getFieldWithDefault(msg, 22, 0), - orderid: msg.getOrderid_asB64(), - orderdetailsList: jspb.Message.toObjectList( - msg.getOrderdetailsList(), - TronWebProto.MarketOrderDetail.toObject, - includeInstance - ) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Transaction.Result.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Transaction.Result(); - return TronWebProto.Transaction.Result.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Transaction.Result.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFee(value); - break; - case 2: - var value = ( - /** @type {!TronWebProto.Transaction.Result.code} */ - reader.readEnum() - ); - msg.setRet(value); - break; - case 3: - var value = ( - /** @type {!TronWebProto.Transaction.Result.contractResult} */ - reader.readEnum() - ); - msg.setContractret(value); - break; - case 14: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setAssetissueid(value); - break; - case 15: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setWithdrawAmount(value); - break; - case 16: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setUnfreezeAmount(value); - break; - case 18: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExchangeReceivedAmount(value); - break; - case 19: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExchangeInjectAnotherAmount(value); - break; - case 20: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExchangeWithdrawAnotherAmount(value); - break; - case 21: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExchangeId(value); - break; - case 22: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setShieldedTransactionFee(value); - break; - case 25: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOrderid(value); - break; - case 26: - var value = new TronWebProto.MarketOrderDetail(); - reader.readMessage(value, TronWebProto.MarketOrderDetail.deserializeBinaryFromReader); - msg.addOrderdetails(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Transaction.Result.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Transaction.Result.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Transaction.Result.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getFee(); - if (f3 !== 0) { - writer.writeInt64( - 1, - f3 - ); - } - f3 = message2.getRet(); - if (f3 !== 0) { - writer.writeEnum( - 2, - f3 - ); - } - f3 = message2.getContractret(); - if (f3 !== 0) { - writer.writeEnum( - 3, - f3 - ); - } - f3 = message2.getAssetissueid(); - if (f3.length > 0) { - writer.writeString( - 14, - f3 - ); - } - f3 = message2.getWithdrawAmount(); - if (f3 !== 0) { - writer.writeInt64( - 15, - f3 - ); - } - f3 = message2.getUnfreezeAmount(); - if (f3 !== 0) { - writer.writeInt64( - 16, - f3 - ); - } - f3 = message2.getExchangeReceivedAmount(); - if (f3 !== 0) { - writer.writeInt64( - 18, - f3 - ); - } - f3 = message2.getExchangeInjectAnotherAmount(); - if (f3 !== 0) { - writer.writeInt64( - 19, - f3 - ); - } - f3 = message2.getExchangeWithdrawAnotherAmount(); - if (f3 !== 0) { - writer.writeInt64( - 20, - f3 - ); - } - f3 = message2.getExchangeId(); - if (f3 !== 0) { - writer.writeInt64( - 21, - f3 - ); - } - f3 = message2.getShieldedTransactionFee(); - if (f3 !== 0) { - writer.writeInt64( - 22, - f3 - ); - } - f3 = message2.getOrderid_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 25, - f3 - ); - } - f3 = message2.getOrderdetailsList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 26, - f3, - TronWebProto.MarketOrderDetail.serializeBinaryToWriter - ); - } - }; - TronWebProto.Transaction.Result.code = { - SUCESS: 0, - FAILED: 1 - }; - TronWebProto.Transaction.Result.contractResult = { - DEFAULT: 0, - SUCCESS: 1, - REVERT: 2, - BAD_JUMP_DESTINATION: 3, - OUT_OF_MEMORY: 4, - PRECOMPILED_CONTRACT: 5, - STACK_TOO_SMALL: 6, - STACK_TOO_LARGE: 7, - ILLEGAL_OPERATION: 8, - STACK_OVERFLOW: 9, - OUT_OF_ENERGY: 10, - OUT_OF_TIME: 11, - JVM_STACK_OVER_FLOW: 12, - UNKNOWN: 13, - TRANSFER_FAILED: 14, - INVALID_CODE: 15 - }; - TronWebProto.Transaction.Result.prototype.getFee = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setFee = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.Transaction.Result.prototype.getRet = function() { - return ( - /** @type {!TronWebProto.Transaction.Result.code} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setRet = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); - }; - TronWebProto.Transaction.Result.prototype.getContractret = function() { - return ( - /** @type {!TronWebProto.Transaction.Result.contractResult} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setContractret = function(value) { - return jspb.Message.setProto3EnumField(this, 3, value); - }; - TronWebProto.Transaction.Result.prototype.getAssetissueid = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 14, "") - ); - }; - TronWebProto.Transaction.Result.prototype.setAssetissueid = function(value) { - return jspb.Message.setProto3StringField(this, 14, value); - }; - TronWebProto.Transaction.Result.prototype.getWithdrawAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 15, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setWithdrawAmount = function(value) { - return jspb.Message.setProto3IntField(this, 15, value); - }; - TronWebProto.Transaction.Result.prototype.getUnfreezeAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 16, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setUnfreezeAmount = function(value) { - return jspb.Message.setProto3IntField(this, 16, value); - }; - TronWebProto.Transaction.Result.prototype.getExchangeReceivedAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 18, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setExchangeReceivedAmount = function(value) { - return jspb.Message.setProto3IntField(this, 18, value); - }; - TronWebProto.Transaction.Result.prototype.getExchangeInjectAnotherAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 19, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setExchangeInjectAnotherAmount = function(value) { - return jspb.Message.setProto3IntField(this, 19, value); - }; - TronWebProto.Transaction.Result.prototype.getExchangeWithdrawAnotherAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 20, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setExchangeWithdrawAnotherAmount = function(value) { - return jspb.Message.setProto3IntField(this, 20, value); - }; - TronWebProto.Transaction.Result.prototype.getExchangeId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 21, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setExchangeId = function(value) { - return jspb.Message.setProto3IntField(this, 21, value); - }; - TronWebProto.Transaction.Result.prototype.getShieldedTransactionFee = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 22, 0) - ); - }; - TronWebProto.Transaction.Result.prototype.setShieldedTransactionFee = function(value) { - return jspb.Message.setProto3IntField(this, 22, value); - }; - TronWebProto.Transaction.Result.prototype.getOrderid = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 25, "") - ); - }; - TronWebProto.Transaction.Result.prototype.getOrderid_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOrderid() - ) - ); - }; - TronWebProto.Transaction.Result.prototype.getOrderid_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOrderid() - ) - ); - }; - TronWebProto.Transaction.Result.prototype.setOrderid = function(value) { - return jspb.Message.setProto3BytesField(this, 25, value); - }; - TronWebProto.Transaction.Result.prototype.getOrderdetailsList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.MarketOrderDetail, 26) - ); - }; - TronWebProto.Transaction.Result.prototype.setOrderdetailsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 26, value); - }; - TronWebProto.Transaction.Result.prototype.addOrderdetails = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 26, opt_value, TronWebProto.MarketOrderDetail, opt_index); - }; - TronWebProto.Transaction.Result.prototype.clearOrderdetailsList = function() { - return this.setOrderdetailsList([]); - }; - TronWebProto.Transaction.raw.repeatedFields_ = [9, 11]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.Transaction.raw.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.Transaction.raw.toObject(opt_includeInstance, this); - }; - TronWebProto.Transaction.raw.toObject = function(includeInstance, msg) { - var obj = { - refBlockBytes: msg.getRefBlockBytes_asB64(), - refBlockNum: jspb.Message.getFieldWithDefault(msg, 3, 0), - refBlockHash: msg.getRefBlockHash_asB64(), - expiration: jspb.Message.getFieldWithDefault(msg, 8, 0), - authsList: jspb.Message.toObjectList( - msg.getAuthsList(), - TronWebProto.authority.toObject, - includeInstance - ), - data: msg.getData_asB64(), - contractList: jspb.Message.toObjectList( - msg.getContractList(), - TronWebProto.Transaction.Contract.toObject, - includeInstance - ), - scripts: msg.getScripts_asB64(), - timestamp: jspb.Message.getFieldWithDefault(msg, 14, 0), - feeLimit: jspb.Message.getFieldWithDefault(msg, 18, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.Transaction.raw.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.Transaction.raw(); - return TronWebProto.Transaction.raw.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.Transaction.raw.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setRefBlockBytes(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setRefBlockNum(value); - break; - case 4: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setRefBlockHash(value); - break; - case 8: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExpiration(value); - break; - case 9: - var value = new TronWebProto.authority(); - reader.readMessage(value, TronWebProto.authority.deserializeBinaryFromReader); - msg.addAuths(value); - break; - case 10: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setData(value); - break; - case 11: - var value = new TronWebProto.Transaction.Contract(); - reader.readMessage(value, TronWebProto.Transaction.Contract.deserializeBinaryFromReader); - msg.addContract(value); - break; - case 12: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setScripts(value); - break; - case 14: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setTimestamp(value); - break; - case 18: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFeeLimit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.Transaction.raw.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.Transaction.raw.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.Transaction.raw.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getRefBlockBytes_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getRefBlockNum(); - if (f3 !== 0) { - writer.writeInt64( - 3, - f3 - ); - } - f3 = message2.getRefBlockHash_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 4, - f3 - ); - } - f3 = message2.getExpiration(); - if (f3 !== 0) { - writer.writeInt64( - 8, - f3 - ); - } - f3 = message2.getAuthsList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 9, - f3, - TronWebProto.authority.serializeBinaryToWriter - ); - } - f3 = message2.getData_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 10, - f3 - ); - } - f3 = message2.getContractList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 11, - f3, - TronWebProto.Transaction.Contract.serializeBinaryToWriter - ); - } - f3 = message2.getScripts_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 12, - f3 - ); - } - f3 = message2.getTimestamp(); - if (f3 !== 0) { - writer.writeInt64( - 14, - f3 - ); - } - f3 = message2.getFeeLimit(); - if (f3 !== 0) { - writer.writeInt64( - 18, - f3 - ); - } - }; - TronWebProto.Transaction.raw.prototype.getRefBlockBytes = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.Transaction.raw.prototype.getRefBlockBytes_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getRefBlockBytes() - ) - ); - }; - TronWebProto.Transaction.raw.prototype.getRefBlockBytes_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getRefBlockBytes() - ) - ); - }; - TronWebProto.Transaction.raw.prototype.setRefBlockBytes = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.Transaction.raw.prototype.getRefBlockNum = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.Transaction.raw.prototype.setRefBlockNum = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.Transaction.raw.prototype.getRefBlockHash = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 4, "") - ); - }; - TronWebProto.Transaction.raw.prototype.getRefBlockHash_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getRefBlockHash() - ) - ); - }; - TronWebProto.Transaction.raw.prototype.getRefBlockHash_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getRefBlockHash() - ) - ); - }; - TronWebProto.Transaction.raw.prototype.setRefBlockHash = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); - }; - TronWebProto.Transaction.raw.prototype.getExpiration = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 8, 0) - ); - }; - TronWebProto.Transaction.raw.prototype.setExpiration = function(value) { - return jspb.Message.setProto3IntField(this, 8, value); - }; - TronWebProto.Transaction.raw.prototype.getAuthsList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.authority, 9) - ); - }; - TronWebProto.Transaction.raw.prototype.setAuthsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 9, value); - }; - TronWebProto.Transaction.raw.prototype.addAuths = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, TronWebProto.authority, opt_index); - }; - TronWebProto.Transaction.raw.prototype.clearAuthsList = function() { - return this.setAuthsList([]); - }; - TronWebProto.Transaction.raw.prototype.getData = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 10, "") - ); - }; - TronWebProto.Transaction.raw.prototype.getData_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getData() - ) - ); - }; - TronWebProto.Transaction.raw.prototype.getData_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getData() - ) - ); - }; - TronWebProto.Transaction.raw.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 10, value); - }; - TronWebProto.Transaction.raw.prototype.getContractList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.Transaction.Contract, 11) - ); - }; - TronWebProto.Transaction.raw.prototype.setContractList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 11, value); - }; - TronWebProto.Transaction.raw.prototype.addContract = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, TronWebProto.Transaction.Contract, opt_index); - }; - TronWebProto.Transaction.raw.prototype.clearContractList = function() { - return this.setContractList([]); - }; - TronWebProto.Transaction.raw.prototype.getScripts = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 12, "") - ); - }; - TronWebProto.Transaction.raw.prototype.getScripts_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getScripts() - ) - ); - }; - TronWebProto.Transaction.raw.prototype.getScripts_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getScripts() - ) - ); - }; - TronWebProto.Transaction.raw.prototype.setScripts = function(value) { - return jspb.Message.setProto3BytesField(this, 12, value); - }; - TronWebProto.Transaction.raw.prototype.getTimestamp = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 14, 0) - ); - }; - TronWebProto.Transaction.raw.prototype.setTimestamp = function(value) { - return jspb.Message.setProto3IntField(this, 14, value); - }; - TronWebProto.Transaction.raw.prototype.getFeeLimit = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 18, 0) - ); - }; - TronWebProto.Transaction.raw.prototype.setFeeLimit = function(value) { - return jspb.Message.setProto3IntField(this, 18, value); - }; - TronWebProto.Transaction.prototype.getRawData = function() { - return ( - /** @type{?TronWebProto.Transaction.raw} */ - jspb.Message.getWrapperField(this, TronWebProto.Transaction.raw, 1) - ); - }; - TronWebProto.Transaction.prototype.setRawData = function(value) { - return jspb.Message.setWrapperField(this, 1, value); - }; - TronWebProto.Transaction.prototype.clearRawData = function() { - return this.setRawData(void 0); - }; - TronWebProto.Transaction.prototype.hasRawData = function() { - return jspb.Message.getField(this, 1) != null; - }; - TronWebProto.Transaction.prototype.getSignatureList = function() { - return ( - /** @type {!(Array|Array)} */ - jspb.Message.getRepeatedField(this, 2) - ); - }; - TronWebProto.Transaction.prototype.getSignatureList_asB64 = function() { - return ( - /** @type {!Array} */ - jspb.Message.bytesListAsB64( - this.getSignatureList() - ) - ); - }; - TronWebProto.Transaction.prototype.getSignatureList_asU8 = function() { - return ( - /** @type {!Array} */ - jspb.Message.bytesListAsU8( - this.getSignatureList() - ) - ); - }; - TronWebProto.Transaction.prototype.setSignatureList = function(value) { - return jspb.Message.setField(this, 2, value || []); - }; - TronWebProto.Transaction.prototype.addSignature = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 2, value, opt_index); - }; - TronWebProto.Transaction.prototype.clearSignatureList = function() { - return this.setSignatureList([]); - }; - TronWebProto.Transaction.prototype.getRetList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.Transaction.Result, 5) - ); - }; - TronWebProto.Transaction.prototype.setRetList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 5, value); - }; - TronWebProto.Transaction.prototype.addRet = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, TronWebProto.Transaction.Result, opt_index); - }; - TronWebProto.Transaction.prototype.clearRetList = function() { - return this.setRetList([]); - }; - TronWebProto.AccountType = { - NORMAL: 0, - ASSETISSUE: 1, - CONTRACT: 2 - }; - goog.object.extend(exports, TronWebProto); -})(Tron_pb); -var balance_contract_pb = {}; -var common_pb = {}; -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - goog.exportSymbol("TronWebProto.ResourceCode", null, global2); - TronWebProto.ResourceCode = { - BANDWIDTH: 0, - ENERGY: 1, - TRON_POWER: 2 - }; - goog.object.extend(exports, TronWebProto); -})(common_pb); -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - var core_contract_common_pb = common_pb; - goog.object.extend(proto, core_contract_common_pb); - goog.exportSymbol("TronWebProto.AccountBalanceRequest", null, global2); - goog.exportSymbol("TronWebProto.AccountBalanceResponse", null, global2); - goog.exportSymbol("TronWebProto.AccountIdentifier", null, global2); - goog.exportSymbol("TronWebProto.AccountTrace", null, global2); - goog.exportSymbol("TronWebProto.BlockBalanceTrace", null, global2); - goog.exportSymbol("TronWebProto.BlockBalanceTrace.BlockIdentifier", null, global2); - goog.exportSymbol("TronWebProto.CancelAllUnfreezeV2Contract", null, global2); - goog.exportSymbol("TronWebProto.DelegateResourceContract", null, global2); - goog.exportSymbol("TronWebProto.FreezeBalanceContract", null, global2); - goog.exportSymbol("TronWebProto.FreezeBalanceV2Contract", null, global2); - goog.exportSymbol("TronWebProto.TransactionBalanceTrace", null, global2); - goog.exportSymbol("TronWebProto.TransactionBalanceTrace.Operation", null, global2); - goog.exportSymbol("TronWebProto.TransferContract", null, global2); - goog.exportSymbol("TronWebProto.UnDelegateResourceContract", null, global2); - goog.exportSymbol("TronWebProto.UnfreezeBalanceContract", null, global2); - goog.exportSymbol("TronWebProto.UnfreezeBalanceV2Contract", null, global2); - goog.exportSymbol("TronWebProto.WithdrawBalanceContract", null, global2); - goog.exportSymbol("TronWebProto.WithdrawExpireUnfreezeContract", null, global2); - TronWebProto.FreezeBalanceContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.FreezeBalanceContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.FreezeBalanceContract.displayName = "TronWebProto.FreezeBalanceContract"; - } - TronWebProto.UnfreezeBalanceContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.UnfreezeBalanceContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.UnfreezeBalanceContract.displayName = "TronWebProto.UnfreezeBalanceContract"; - } - TronWebProto.WithdrawBalanceContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.WithdrawBalanceContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.WithdrawBalanceContract.displayName = "TronWebProto.WithdrawBalanceContract"; - } - TronWebProto.TransferContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.TransferContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.TransferContract.displayName = "TronWebProto.TransferContract"; - } - TronWebProto.TransactionBalanceTrace = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.TransactionBalanceTrace.repeatedFields_, null); - }; - goog.inherits(TronWebProto.TransactionBalanceTrace, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.TransactionBalanceTrace.displayName = "TronWebProto.TransactionBalanceTrace"; - } - TronWebProto.TransactionBalanceTrace.Operation = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.TransactionBalanceTrace.Operation, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.TransactionBalanceTrace.Operation.displayName = "TronWebProto.TransactionBalanceTrace.Operation"; - } - TronWebProto.BlockBalanceTrace = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.BlockBalanceTrace.repeatedFields_, null); - }; - goog.inherits(TronWebProto.BlockBalanceTrace, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.BlockBalanceTrace.displayName = "TronWebProto.BlockBalanceTrace"; - } - TronWebProto.BlockBalanceTrace.BlockIdentifier = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.BlockBalanceTrace.BlockIdentifier, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.BlockBalanceTrace.BlockIdentifier.displayName = "TronWebProto.BlockBalanceTrace.BlockIdentifier"; - } - TronWebProto.AccountTrace = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.AccountTrace, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AccountTrace.displayName = "TronWebProto.AccountTrace"; - } - TronWebProto.AccountIdentifier = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.AccountIdentifier, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AccountIdentifier.displayName = "TronWebProto.AccountIdentifier"; - } - TronWebProto.AccountBalanceRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.AccountBalanceRequest, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AccountBalanceRequest.displayName = "TronWebProto.AccountBalanceRequest"; - } - TronWebProto.AccountBalanceResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.AccountBalanceResponse, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AccountBalanceResponse.displayName = "TronWebProto.AccountBalanceResponse"; - } - TronWebProto.FreezeBalanceV2Contract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.FreezeBalanceV2Contract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.FreezeBalanceV2Contract.displayName = "TronWebProto.FreezeBalanceV2Contract"; - } - TronWebProto.UnfreezeBalanceV2Contract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.UnfreezeBalanceV2Contract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.UnfreezeBalanceV2Contract.displayName = "TronWebProto.UnfreezeBalanceV2Contract"; - } - TronWebProto.WithdrawExpireUnfreezeContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.WithdrawExpireUnfreezeContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.WithdrawExpireUnfreezeContract.displayName = "TronWebProto.WithdrawExpireUnfreezeContract"; - } - TronWebProto.DelegateResourceContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.DelegateResourceContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.DelegateResourceContract.displayName = "TronWebProto.DelegateResourceContract"; - } - TronWebProto.UnDelegateResourceContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.UnDelegateResourceContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.UnDelegateResourceContract.displayName = "TronWebProto.UnDelegateResourceContract"; - } - TronWebProto.CancelAllUnfreezeV2Contract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.CancelAllUnfreezeV2Contract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.CancelAllUnfreezeV2Contract.displayName = "TronWebProto.CancelAllUnfreezeV2Contract"; - } - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.FreezeBalanceContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.FreezeBalanceContract.toObject(opt_includeInstance, this); - }; - TronWebProto.FreezeBalanceContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - frozenBalance: jspb.Message.getFieldWithDefault(msg, 2, 0), - frozenDuration: jspb.Message.getFieldWithDefault(msg, 3, 0), - resource: jspb.Message.getFieldWithDefault(msg, 10, 0), - receiverAddress: msg.getReceiverAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.FreezeBalanceContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.FreezeBalanceContract(); - return TronWebProto.FreezeBalanceContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.FreezeBalanceContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFrozenBalance(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFrozenDuration(value); - break; - case 10: - var value = ( - /** @type {!TronWebProto.ResourceCode} */ - reader.readEnum() - ); - msg.setResource(value); - break; - case 15: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setReceiverAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.FreezeBalanceContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.FreezeBalanceContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.FreezeBalanceContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getFrozenBalance(); - if (f3 !== 0) { - writer.writeInt64(2, f3); - } - f3 = message2.getFrozenDuration(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - f3 = message2.getResource(); - if (f3 !== 0) { - writer.writeEnum(10, f3); - } - f3 = message2.getReceiverAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(15, f3); - } - }; - TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.FreezeBalanceContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.FreezeBalanceContract.prototype.getFrozenBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.FreezeBalanceContract.prototype.setFrozenBalance = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.FreezeBalanceContract.prototype.getFrozenDuration = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.FreezeBalanceContract.prototype.setFrozenDuration = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.FreezeBalanceContract.prototype.getResource = function() { - return ( - /** @type {!TronWebProto.ResourceCode} */ - jspb.Message.getFieldWithDefault(this, 10, 0) - ); - }; - TronWebProto.FreezeBalanceContract.prototype.setResource = function(value) { - return jspb.Message.setProto3EnumField(this, 10, value); - }; - TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 15, "") - ); - }; - TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getReceiverAddress()) - ); - }; - TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getReceiverAddress()) - ); - }; - TronWebProto.FreezeBalanceContract.prototype.setReceiverAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 15, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.UnfreezeBalanceContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.UnfreezeBalanceContract.toObject(opt_includeInstance, this); - }; - TronWebProto.UnfreezeBalanceContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - resource: jspb.Message.getFieldWithDefault(msg, 10, 0), - receiverAddress: msg.getReceiverAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.UnfreezeBalanceContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.UnfreezeBalanceContract(); - return TronWebProto.UnfreezeBalanceContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.UnfreezeBalanceContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 10: - var value = ( - /** @type {!TronWebProto.ResourceCode} */ - reader.readEnum() - ); - msg.setResource(value); - break; - case 15: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setReceiverAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.UnfreezeBalanceContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.UnfreezeBalanceContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.UnfreezeBalanceContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getResource(); - if (f3 !== 0) { - writer.writeEnum(10, f3); - } - f3 = message2.getReceiverAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(15, f3); - } - }; - TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.UnfreezeBalanceContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.UnfreezeBalanceContract.prototype.getResource = function() { - return ( - /** @type {!TronWebProto.ResourceCode} */ - jspb.Message.getFieldWithDefault(this, 10, 0) - ); - }; - TronWebProto.UnfreezeBalanceContract.prototype.setResource = function(value) { - return jspb.Message.setProto3EnumField(this, 10, value); - }; - TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 15, "") - ); - }; - TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getReceiverAddress()) - ); - }; - TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getReceiverAddress()) - ); - }; - TronWebProto.UnfreezeBalanceContract.prototype.setReceiverAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 15, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.WithdrawBalanceContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.WithdrawBalanceContract.toObject(opt_includeInstance, this); - }; - TronWebProto.WithdrawBalanceContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.WithdrawBalanceContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.WithdrawBalanceContract(); - return TronWebProto.WithdrawBalanceContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.WithdrawBalanceContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.WithdrawBalanceContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.WithdrawBalanceContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.WithdrawBalanceContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - }; - TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.WithdrawBalanceContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.TransferContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.TransferContract.toObject(opt_includeInstance, this); - }; - TronWebProto.TransferContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - toAddress: msg.getToAddress_asB64(), - amount: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.TransferContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.TransferContract(); - return TronWebProto.TransferContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.TransferContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setToAddress(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setAmount(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.TransferContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.TransferContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.TransferContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getToAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - f3 = message2.getAmount(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - }; - TronWebProto.TransferContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.TransferContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.TransferContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.TransferContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.TransferContract.prototype.getToAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.TransferContract.prototype.getToAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getToAddress()) - ); - }; - TronWebProto.TransferContract.prototype.getToAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getToAddress()) - ); - }; - TronWebProto.TransferContract.prototype.setToAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.TransferContract.prototype.getAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.TransferContract.prototype.setAmount = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.TransactionBalanceTrace.repeatedFields_ = [2]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.TransactionBalanceTrace.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.TransactionBalanceTrace.toObject(opt_includeInstance, this); - }; - TronWebProto.TransactionBalanceTrace.toObject = function(includeInstance, msg) { - var obj = { - transactionIdentifier: msg.getTransactionIdentifier_asB64(), - operationList: jspb.Message.toObjectList( - msg.getOperationList(), - TronWebProto.TransactionBalanceTrace.Operation.toObject, - includeInstance - ), - type: jspb.Message.getFieldWithDefault(msg, 3, ""), - status: jspb.Message.getFieldWithDefault(msg, 4, "") - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.TransactionBalanceTrace.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.TransactionBalanceTrace(); - return TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setTransactionIdentifier(value); - break; - case 2: - var value = new TronWebProto.TransactionBalanceTrace.Operation(); - reader.readMessage(value, TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader); - msg.addOperation(value); - break; - case 3: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setType(value); - break; - case 4: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setStatus(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.TransactionBalanceTrace.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getTransactionIdentifier_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getOperationList(); - if (f3.length > 0) { - writer.writeRepeatedMessage(2, f3, TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter); - } - f3 = message2.getType(); - if (f3.length > 0) { - writer.writeString(3, f3); - } - f3 = message2.getStatus(); - if (f3.length > 0) { - writer.writeString(4, f3); - } - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.TransactionBalanceTrace.Operation.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.TransactionBalanceTrace.Operation.toObject(opt_includeInstance, this); - }; - TronWebProto.TransactionBalanceTrace.Operation.toObject = function(includeInstance, msg) { - var obj = { - operationIdentifier: jspb.Message.getFieldWithDefault(msg, 1, 0), - address: msg.getAddress_asB64(), - amount: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.TransactionBalanceTrace.Operation.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.TransactionBalanceTrace.Operation(); - return TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setOperationIdentifier(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAddress(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setAmount(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.TransactionBalanceTrace.Operation.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOperationIdentifier(); - if (f3 !== 0) { - writer.writeInt64(1, f3); - } - f3 = message2.getAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - f3 = message2.getAmount(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - }; - TronWebProto.TransactionBalanceTrace.Operation.prototype.getOperationIdentifier = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.TransactionBalanceTrace.Operation.prototype.setOperationIdentifier = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getAddress()) - ); - }; - TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getAddress()) - ); - }; - TronWebProto.TransactionBalanceTrace.Operation.prototype.setAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.TransactionBalanceTrace.Operation.prototype.getAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.TransactionBalanceTrace.Operation.prototype.setAmount = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getTransactionIdentifier()) - ); - }; - TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getTransactionIdentifier()) - ); - }; - TronWebProto.TransactionBalanceTrace.prototype.setTransactionIdentifier = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.TransactionBalanceTrace.prototype.getOperationList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.TransactionBalanceTrace.Operation, 2) - ); - }; - TronWebProto.TransactionBalanceTrace.prototype.setOperationList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 2, value); - }; - TronWebProto.TransactionBalanceTrace.prototype.addOperation = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, TronWebProto.TransactionBalanceTrace.Operation, opt_index); - }; - TronWebProto.TransactionBalanceTrace.prototype.clearOperationList = function() { - return this.setOperationList([]); - }; - TronWebProto.TransactionBalanceTrace.prototype.getType = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.TransactionBalanceTrace.prototype.setType = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); - }; - TronWebProto.TransactionBalanceTrace.prototype.getStatus = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 4, "") - ); - }; - TronWebProto.TransactionBalanceTrace.prototype.setStatus = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); - }; - TronWebProto.BlockBalanceTrace.repeatedFields_ = [3]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.BlockBalanceTrace.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.BlockBalanceTrace.toObject(opt_includeInstance, this); - }; - TronWebProto.BlockBalanceTrace.toObject = function(includeInstance, msg) { - var f3, obj = { - blockIdentifier: (f3 = msg.getBlockIdentifier()) && TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(includeInstance, f3), - timestamp: jspb.Message.getFieldWithDefault(msg, 2, 0), - transactionBalanceTraceList: jspb.Message.toObjectList( - msg.getTransactionBalanceTraceList(), - TronWebProto.TransactionBalanceTrace.toObject, - includeInstance - ) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.BlockBalanceTrace.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.BlockBalanceTrace(); - return TronWebProto.BlockBalanceTrace.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.BlockBalanceTrace.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new TronWebProto.BlockBalanceTrace.BlockIdentifier(); - reader.readMessage(value, TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader); - msg.setBlockIdentifier(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setTimestamp(value); - break; - case 3: - var value = new TronWebProto.TransactionBalanceTrace(); - reader.readMessage(value, TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader); - msg.addTransactionBalanceTrace(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.BlockBalanceTrace.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.BlockBalanceTrace.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.BlockBalanceTrace.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getBlockIdentifier(); - if (f3 != null) { - writer.writeMessage(1, f3, TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter); - } - f3 = message2.getTimestamp(); - if (f3 !== 0) { - writer.writeInt64(2, f3); - } - f3 = message2.getTransactionBalanceTraceList(); - if (f3.length > 0) { - writer.writeRepeatedMessage(3, f3, TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter); - } - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(opt_includeInstance, this); - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject = function(includeInstance, msg) { - var obj = { - hash: msg.getHash_asB64(), - number: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.BlockBalanceTrace.BlockIdentifier(); - return TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setHash(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setNumber(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getHash_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getNumber(); - if (f3 !== 0) { - writer.writeInt64(2, f3); - } - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getHash()) - ); - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getHash()) - ); - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.setHash = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getNumber = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.setNumber = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.BlockBalanceTrace.prototype.getBlockIdentifier = function() { - return ( - /** @type{?TronWebProto.BlockBalanceTrace.BlockIdentifier} */ - jspb.Message.getWrapperField(this, TronWebProto.BlockBalanceTrace.BlockIdentifier, 1) - ); - }; - TronWebProto.BlockBalanceTrace.prototype.setBlockIdentifier = function(value) { - return jspb.Message.setWrapperField(this, 1, value); - }; - TronWebProto.BlockBalanceTrace.prototype.clearBlockIdentifier = function() { - return this.setBlockIdentifier(void 0); - }; - TronWebProto.BlockBalanceTrace.prototype.hasBlockIdentifier = function() { - return jspb.Message.getField(this, 1) != null; - }; - TronWebProto.BlockBalanceTrace.prototype.getTimestamp = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.BlockBalanceTrace.prototype.setTimestamp = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.BlockBalanceTrace.prototype.getTransactionBalanceTraceList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.TransactionBalanceTrace, 3) - ); - }; - TronWebProto.BlockBalanceTrace.prototype.setTransactionBalanceTraceList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); - }; - TronWebProto.BlockBalanceTrace.prototype.addTransactionBalanceTrace = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, TronWebProto.TransactionBalanceTrace, opt_index); - }; - TronWebProto.BlockBalanceTrace.prototype.clearTransactionBalanceTraceList = function() { - return this.setTransactionBalanceTraceList([]); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AccountTrace.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AccountTrace.toObject(opt_includeInstance, this); - }; - TronWebProto.AccountTrace.toObject = function(includeInstance, msg) { - var obj = { - balance: jspb.Message.getFieldWithDefault(msg, 1, 0), - placeholder: jspb.Message.getFieldWithDefault(msg, 99, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AccountTrace.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AccountTrace(); - return TronWebProto.AccountTrace.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AccountTrace.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setBalance(value); - break; - case 99: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setPlaceholder(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AccountTrace.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AccountTrace.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AccountTrace.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getBalance(); - if (f3 !== 0) { - writer.writeInt64(1, f3); - } - f3 = message2.getPlaceholder(); - if (f3 !== 0) { - writer.writeInt64(99, f3); - } - }; - TronWebProto.AccountTrace.prototype.getBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.AccountTrace.prototype.setBalance = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.AccountTrace.prototype.getPlaceholder = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 99, 0) - ); - }; - TronWebProto.AccountTrace.prototype.setPlaceholder = function(value) { - return jspb.Message.setProto3IntField(this, 99, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AccountIdentifier.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AccountIdentifier.toObject(opt_includeInstance, this); - }; - TronWebProto.AccountIdentifier.toObject = function(includeInstance, msg) { - var obj = { - address: msg.getAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AccountIdentifier.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AccountIdentifier(); - return TronWebProto.AccountIdentifier.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AccountIdentifier.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AccountIdentifier.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AccountIdentifier.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AccountIdentifier.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - }; - TronWebProto.AccountIdentifier.prototype.getAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.AccountIdentifier.prototype.getAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getAddress()) - ); - }; - TronWebProto.AccountIdentifier.prototype.getAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getAddress()) - ); - }; - TronWebProto.AccountIdentifier.prototype.setAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AccountBalanceRequest.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AccountBalanceRequest.toObject(opt_includeInstance, this); - }; - TronWebProto.AccountBalanceRequest.toObject = function(includeInstance, msg) { - var f3, obj = { - accountIdentifier: (f3 = msg.getAccountIdentifier()) && TronWebProto.AccountIdentifier.toObject(includeInstance, f3), - blockIdentifier: (f3 = msg.getBlockIdentifier()) && TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(includeInstance, f3) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AccountBalanceRequest.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AccountBalanceRequest(); - return TronWebProto.AccountBalanceRequest.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AccountBalanceRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new TronWebProto.AccountIdentifier(); - reader.readMessage(value, TronWebProto.AccountIdentifier.deserializeBinaryFromReader); - msg.setAccountIdentifier(value); - break; - case 2: - var value = new TronWebProto.BlockBalanceTrace.BlockIdentifier(); - reader.readMessage(value, TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader); - msg.setBlockIdentifier(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AccountBalanceRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AccountBalanceRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AccountBalanceRequest.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAccountIdentifier(); - if (f3 != null) { - writer.writeMessage(1, f3, TronWebProto.AccountIdentifier.serializeBinaryToWriter); - } - f3 = message2.getBlockIdentifier(); - if (f3 != null) { - writer.writeMessage(2, f3, TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter); - } - }; - TronWebProto.AccountBalanceRequest.prototype.getAccountIdentifier = function() { - return ( - /** @type{?TronWebProto.AccountIdentifier} */ - jspb.Message.getWrapperField(this, TronWebProto.AccountIdentifier, 1) - ); - }; - TronWebProto.AccountBalanceRequest.prototype.setAccountIdentifier = function(value) { - return jspb.Message.setWrapperField(this, 1, value); - }; - TronWebProto.AccountBalanceRequest.prototype.clearAccountIdentifier = function() { - return this.setAccountIdentifier(void 0); - }; - TronWebProto.AccountBalanceRequest.prototype.hasAccountIdentifier = function() { - return jspb.Message.getField(this, 1) != null; - }; - TronWebProto.AccountBalanceRequest.prototype.getBlockIdentifier = function() { - return ( - /** @type{?TronWebProto.BlockBalanceTrace.BlockIdentifier} */ - jspb.Message.getWrapperField(this, TronWebProto.BlockBalanceTrace.BlockIdentifier, 2) - ); - }; - TronWebProto.AccountBalanceRequest.prototype.setBlockIdentifier = function(value) { - return jspb.Message.setWrapperField(this, 2, value); - }; - TronWebProto.AccountBalanceRequest.prototype.clearBlockIdentifier = function() { - return this.setBlockIdentifier(void 0); - }; - TronWebProto.AccountBalanceRequest.prototype.hasBlockIdentifier = function() { - return jspb.Message.getField(this, 2) != null; - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AccountBalanceResponse.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AccountBalanceResponse.toObject(opt_includeInstance, this); - }; - TronWebProto.AccountBalanceResponse.toObject = function(includeInstance, msg) { - var f3, obj = { - balance: jspb.Message.getFieldWithDefault(msg, 1, 0), - blockIdentifier: (f3 = msg.getBlockIdentifier()) && TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(includeInstance, f3) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AccountBalanceResponse.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AccountBalanceResponse(); - return TronWebProto.AccountBalanceResponse.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AccountBalanceResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setBalance(value); - break; - case 2: - var value = new TronWebProto.BlockBalanceTrace.BlockIdentifier(); - reader.readMessage(value, TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader); - msg.setBlockIdentifier(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AccountBalanceResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AccountBalanceResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AccountBalanceResponse.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getBalance(); - if (f3 !== 0) { - writer.writeInt64(1, f3); - } - f3 = message2.getBlockIdentifier(); - if (f3 != null) { - writer.writeMessage(2, f3, TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter); - } - }; - TronWebProto.AccountBalanceResponse.prototype.getBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.AccountBalanceResponse.prototype.setBalance = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.AccountBalanceResponse.prototype.getBlockIdentifier = function() { - return ( - /** @type{?TronWebProto.BlockBalanceTrace.BlockIdentifier} */ - jspb.Message.getWrapperField(this, TronWebProto.BlockBalanceTrace.BlockIdentifier, 2) - ); - }; - TronWebProto.AccountBalanceResponse.prototype.setBlockIdentifier = function(value) { - return jspb.Message.setWrapperField(this, 2, value); - }; - TronWebProto.AccountBalanceResponse.prototype.clearBlockIdentifier = function() { - return this.setBlockIdentifier(void 0); - }; - TronWebProto.AccountBalanceResponse.prototype.hasBlockIdentifier = function() { - return jspb.Message.getField(this, 2) != null; - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.FreezeBalanceV2Contract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.FreezeBalanceV2Contract.toObject(opt_includeInstance, this); - }; - TronWebProto.FreezeBalanceV2Contract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - frozenBalance: jspb.Message.getFieldWithDefault(msg, 2, 0), - resource: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.FreezeBalanceV2Contract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.FreezeBalanceV2Contract(); - return TronWebProto.FreezeBalanceV2Contract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.FreezeBalanceV2Contract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFrozenBalance(value); - break; - case 3: - var value = ( - /** @type {!TronWebProto.ResourceCode} */ - reader.readEnum() - ); - msg.setResource(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.FreezeBalanceV2Contract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.FreezeBalanceV2Contract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.FreezeBalanceV2Contract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getFrozenBalance(); - if (f3 !== 0) { - writer.writeInt64(2, f3); - } - f3 = message2.getResource(); - if (f3 !== 0) { - writer.writeEnum(3, f3); - } - }; - TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.FreezeBalanceV2Contract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.FreezeBalanceV2Contract.prototype.getFrozenBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.FreezeBalanceV2Contract.prototype.setFrozenBalance = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.FreezeBalanceV2Contract.prototype.getResource = function() { - return ( - /** @type {!TronWebProto.ResourceCode} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.FreezeBalanceV2Contract.prototype.setResource = function(value) { - return jspb.Message.setProto3EnumField(this, 3, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.UnfreezeBalanceV2Contract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.UnfreezeBalanceV2Contract.toObject(opt_includeInstance, this); - }; - TronWebProto.UnfreezeBalanceV2Contract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - unfreezeBalance: jspb.Message.getFieldWithDefault(msg, 2, 0), - resource: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.UnfreezeBalanceV2Contract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.UnfreezeBalanceV2Contract(); - return TronWebProto.UnfreezeBalanceV2Contract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.UnfreezeBalanceV2Contract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setUnfreezeBalance(value); - break; - case 3: - var value = ( - /** @type {!TronWebProto.ResourceCode} */ - reader.readEnum() - ); - msg.setResource(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.UnfreezeBalanceV2Contract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.UnfreezeBalanceV2Contract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.UnfreezeBalanceV2Contract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getUnfreezeBalance(); - if (f3 !== 0) { - writer.writeInt64(2, f3); - } - f3 = message2.getResource(); - if (f3 !== 0) { - writer.writeEnum(3, f3); - } - }; - TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.UnfreezeBalanceV2Contract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.UnfreezeBalanceV2Contract.prototype.getUnfreezeBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.UnfreezeBalanceV2Contract.prototype.setUnfreezeBalance = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.UnfreezeBalanceV2Contract.prototype.getResource = function() { - return ( - /** @type {!TronWebProto.ResourceCode} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.UnfreezeBalanceV2Contract.prototype.setResource = function(value) { - return jspb.Message.setProto3EnumField(this, 3, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.WithdrawExpireUnfreezeContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.WithdrawExpireUnfreezeContract.toObject(opt_includeInstance, this); - }; - TronWebProto.WithdrawExpireUnfreezeContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.WithdrawExpireUnfreezeContract(); - return TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.WithdrawExpireUnfreezeContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.WithdrawExpireUnfreezeContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.WithdrawExpireUnfreezeContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - }; - TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.WithdrawExpireUnfreezeContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.DelegateResourceContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.DelegateResourceContract.toObject(opt_includeInstance, this); - }; - TronWebProto.DelegateResourceContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - resource: jspb.Message.getFieldWithDefault(msg, 2, 0), - balance: jspb.Message.getFieldWithDefault(msg, 3, 0), - receiverAddress: msg.getReceiverAddress_asB64(), - lock: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), - lockPeriod: jspb.Message.getFieldWithDefault(msg, 6, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.DelegateResourceContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.DelegateResourceContract(); - return TronWebProto.DelegateResourceContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.DelegateResourceContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!TronWebProto.ResourceCode} */ - reader.readEnum() - ); - msg.setResource(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setBalance(value); - break; - case 4: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setReceiverAddress(value); - break; - case 5: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setLock(value); - break; - case 6: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setLockPeriod(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.DelegateResourceContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.DelegateResourceContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.DelegateResourceContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getResource(); - if (f3 !== 0) { - writer.writeEnum(2, f3); - } - f3 = message2.getBalance(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - f3 = message2.getReceiverAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(4, f3); - } - f3 = message2.getLock(); - if (f3) { - writer.writeBool(5, f3); - } - f3 = message2.getLockPeriod(); - if (f3 !== 0) { - writer.writeInt64(6, f3); - } - }; - TronWebProto.DelegateResourceContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.DelegateResourceContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.DelegateResourceContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.DelegateResourceContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.DelegateResourceContract.prototype.getResource = function() { - return ( - /** @type {!TronWebProto.ResourceCode} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.DelegateResourceContract.prototype.setResource = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); - }; - TronWebProto.DelegateResourceContract.prototype.getBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.DelegateResourceContract.prototype.setBalance = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.DelegateResourceContract.prototype.getReceiverAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 4, "") - ); - }; - TronWebProto.DelegateResourceContract.prototype.getReceiverAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getReceiverAddress()) - ); - }; - TronWebProto.DelegateResourceContract.prototype.getReceiverAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getReceiverAddress()) - ); - }; - TronWebProto.DelegateResourceContract.prototype.setReceiverAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); - }; - TronWebProto.DelegateResourceContract.prototype.getLock = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 5, false) - ); - }; - TronWebProto.DelegateResourceContract.prototype.setLock = function(value) { - return jspb.Message.setProto3BooleanField(this, 5, value); - }; - TronWebProto.DelegateResourceContract.prototype.getLockPeriod = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 6, 0) - ); - }; - TronWebProto.DelegateResourceContract.prototype.setLockPeriod = function(value) { - return jspb.Message.setProto3IntField(this, 6, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.UnDelegateResourceContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.UnDelegateResourceContract.toObject(opt_includeInstance, this); - }; - TronWebProto.UnDelegateResourceContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - resource: jspb.Message.getFieldWithDefault(msg, 2, 0), - balance: jspb.Message.getFieldWithDefault(msg, 3, 0), - receiverAddress: msg.getReceiverAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.UnDelegateResourceContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.UnDelegateResourceContract(); - return TronWebProto.UnDelegateResourceContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.UnDelegateResourceContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!TronWebProto.ResourceCode} */ - reader.readEnum() - ); - msg.setResource(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setBalance(value); - break; - case 4: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setReceiverAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.UnDelegateResourceContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.UnDelegateResourceContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.UnDelegateResourceContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getResource(); - if (f3 !== 0) { - writer.writeEnum(2, f3); - } - f3 = message2.getBalance(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - f3 = message2.getReceiverAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(4, f3); - } - }; - TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.UnDelegateResourceContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.UnDelegateResourceContract.prototype.getResource = function() { - return ( - /** @type {!TronWebProto.ResourceCode} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.UnDelegateResourceContract.prototype.setResource = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); - }; - TronWebProto.UnDelegateResourceContract.prototype.getBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.UnDelegateResourceContract.prototype.setBalance = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 4, "") - ); - }; - TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getReceiverAddress()) - ); - }; - TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getReceiverAddress()) - ); - }; - TronWebProto.UnDelegateResourceContract.prototype.setReceiverAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.CancelAllUnfreezeV2Contract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.CancelAllUnfreezeV2Contract.toObject(opt_includeInstance, this); - }; - TronWebProto.CancelAllUnfreezeV2Contract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.CancelAllUnfreezeV2Contract(); - return TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.CancelAllUnfreezeV2Contract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.CancelAllUnfreezeV2Contract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.CancelAllUnfreezeV2Contract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - }; - TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.CancelAllUnfreezeV2Contract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - goog.object.extend(exports, TronWebProto); -})(balance_contract_pb); -var asset_issue_contract_pb = {}; -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - goog.exportSymbol("TronWebProto.AssetIssueContract", null, global2); - goog.exportSymbol("TronWebProto.AssetIssueContract.FrozenSupply", null, global2); - goog.exportSymbol("TronWebProto.ParticipateAssetIssueContract", null, global2); - goog.exportSymbol("TronWebProto.TransferAssetContract", null, global2); - goog.exportSymbol("TronWebProto.UnfreezeAssetContract", null, global2); - goog.exportSymbol("TronWebProto.UpdateAssetContract", null, global2); - TronWebProto.AssetIssueContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.AssetIssueContract.repeatedFields_, null); - }; - goog.inherits(TronWebProto.AssetIssueContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AssetIssueContract.displayName = "TronWebProto.AssetIssueContract"; - } - TronWebProto.AssetIssueContract.FrozenSupply = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.AssetIssueContract.FrozenSupply, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AssetIssueContract.FrozenSupply.displayName = "TronWebProto.AssetIssueContract.FrozenSupply"; - } - TronWebProto.TransferAssetContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.TransferAssetContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.TransferAssetContract.displayName = "TronWebProto.TransferAssetContract"; - } - TronWebProto.UnfreezeAssetContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.UnfreezeAssetContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.UnfreezeAssetContract.displayName = "TronWebProto.UnfreezeAssetContract"; - } - TronWebProto.UpdateAssetContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.UpdateAssetContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.UpdateAssetContract.displayName = "TronWebProto.UpdateAssetContract"; - } - TronWebProto.ParticipateAssetIssueContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ParticipateAssetIssueContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ParticipateAssetIssueContract.displayName = "TronWebProto.ParticipateAssetIssueContract"; - } - TronWebProto.AssetIssueContract.repeatedFields_ = [5]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AssetIssueContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AssetIssueContract.toObject(opt_includeInstance, this); - }; - TronWebProto.AssetIssueContract.toObject = function(includeInstance, msg) { - var obj = { - id: jspb.Message.getFieldWithDefault(msg, 41, ""), - ownerAddress: msg.getOwnerAddress_asB64(), - name: msg.getName_asB64(), - abbr: msg.getAbbr_asB64(), - totalSupply: jspb.Message.getFieldWithDefault(msg, 4, 0), - frozenSupplyList: jspb.Message.toObjectList( - msg.getFrozenSupplyList(), - TronWebProto.AssetIssueContract.FrozenSupply.toObject, - includeInstance - ), - trxNum: jspb.Message.getFieldWithDefault(msg, 6, 0), - precision: jspb.Message.getFieldWithDefault(msg, 7, 0), - num: jspb.Message.getFieldWithDefault(msg, 8, 0), - startTime: jspb.Message.getFieldWithDefault(msg, 9, 0), - endTime: jspb.Message.getFieldWithDefault(msg, 10, 0), - order: jspb.Message.getFieldWithDefault(msg, 11, 0), - voteScore: jspb.Message.getFieldWithDefault(msg, 16, 0), - description: msg.getDescription_asB64(), - url: msg.getUrl_asB64(), - freeAssetNetLimit: jspb.Message.getFieldWithDefault(msg, 22, 0), - publicFreeAssetNetLimit: jspb.Message.getFieldWithDefault(msg, 23, 0), - publicFreeAssetNetUsage: jspb.Message.getFieldWithDefault(msg, 24, 0), - publicLatestFreeNetTime: jspb.Message.getFieldWithDefault(msg, 25, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AssetIssueContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AssetIssueContract(); - return TronWebProto.AssetIssueContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AssetIssueContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 41: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setId(value); - break; - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setName(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAbbr(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setTotalSupply(value); - break; - case 5: - var value = new TronWebProto.AssetIssueContract.FrozenSupply(); - reader.readMessage(value, TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader); - msg.addFrozenSupply(value); - break; - case 6: - var value = ( - /** @type {number} */ - reader.readInt32() - ); - msg.setTrxNum(value); - break; - case 7: - var value = ( - /** @type {number} */ - reader.readInt32() - ); - msg.setPrecision(value); - break; - case 8: - var value = ( - /** @type {number} */ - reader.readInt32() - ); - msg.setNum(value); - break; - case 9: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setStartTime(value); - break; - case 10: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setEndTime(value); - break; - case 11: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setOrder(value); - break; - case 16: - var value = ( - /** @type {number} */ - reader.readInt32() - ); - msg.setVoteScore(value); - break; - case 20: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setDescription(value); - break; - case 21: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setUrl(value); - break; - case 22: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFreeAssetNetLimit(value); - break; - case 23: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setPublicFreeAssetNetLimit(value); - break; - case 24: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setPublicFreeAssetNetUsage(value); - break; - case 25: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setPublicLatestFreeNetTime(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AssetIssueContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AssetIssueContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AssetIssueContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getId(); - if (f3.length > 0) { - writer.writeString( - 41, - f3 - ); - } - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getName_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - f3 = message2.getAbbr_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getTotalSupply(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - f3 = message2.getFrozenSupplyList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 5, - f3, - TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter - ); - } - f3 = message2.getTrxNum(); - if (f3 !== 0) { - writer.writeInt32( - 6, - f3 - ); - } - f3 = message2.getPrecision(); - if (f3 !== 0) { - writer.writeInt32( - 7, - f3 - ); - } - f3 = message2.getNum(); - if (f3 !== 0) { - writer.writeInt32( - 8, - f3 - ); - } - f3 = message2.getStartTime(); - if (f3 !== 0) { - writer.writeInt64( - 9, - f3 - ); - } - f3 = message2.getEndTime(); - if (f3 !== 0) { - writer.writeInt64( - 10, - f3 - ); - } - f3 = message2.getOrder(); - if (f3 !== 0) { - writer.writeInt64( - 11, - f3 - ); - } - f3 = message2.getVoteScore(); - if (f3 !== 0) { - writer.writeInt32( - 16, - f3 - ); - } - f3 = message2.getDescription_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 20, - f3 - ); - } - f3 = message2.getUrl_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 21, - f3 - ); - } - f3 = message2.getFreeAssetNetLimit(); - if (f3 !== 0) { - writer.writeInt64( - 22, - f3 - ); - } - f3 = message2.getPublicFreeAssetNetLimit(); - if (f3 !== 0) { - writer.writeInt64( - 23, - f3 - ); - } - f3 = message2.getPublicFreeAssetNetUsage(); - if (f3 !== 0) { - writer.writeInt64( - 24, - f3 - ); - } - f3 = message2.getPublicLatestFreeNetTime(); - if (f3 !== 0) { - writer.writeInt64( - 25, - f3 - ); - } - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AssetIssueContract.FrozenSupply.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AssetIssueContract.FrozenSupply.toObject(opt_includeInstance, this); - }; - TronWebProto.AssetIssueContract.FrozenSupply.toObject = function(includeInstance, msg) { - var obj = { - frozenAmount: jspb.Message.getFieldWithDefault(msg, 1, 0), - frozenDays: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AssetIssueContract.FrozenSupply(); - return TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFrozenAmount(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFrozenDays(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AssetIssueContract.FrozenSupply.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getFrozenAmount(); - if (f3 !== 0) { - writer.writeInt64( - 1, - f3 - ); - } - f3 = message2.getFrozenDays(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - }; - TronWebProto.AssetIssueContract.FrozenSupply.prototype.getFrozenAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.AssetIssueContract.FrozenSupply.prototype.setFrozenAmount = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.AssetIssueContract.FrozenSupply.prototype.getFrozenDays = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.AssetIssueContract.FrozenSupply.prototype.setFrozenDays = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.AssetIssueContract.prototype.getId = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 41, "") - ); - }; - TronWebProto.AssetIssueContract.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 41, value); - }; - TronWebProto.AssetIssueContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.AssetIssueContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.AssetIssueContract.prototype.getName = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.AssetIssueContract.prototype.getName_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getName() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.getName_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getName() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.setName = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.AssetIssueContract.prototype.getAbbr = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.AssetIssueContract.prototype.getAbbr_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAbbr() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.getAbbr_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAbbr() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.setAbbr = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.AssetIssueContract.prototype.getTotalSupply = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setTotalSupply = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - TronWebProto.AssetIssueContract.prototype.getFrozenSupplyList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.AssetIssueContract.FrozenSupply, 5) - ); - }; - TronWebProto.AssetIssueContract.prototype.setFrozenSupplyList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 5, value); - }; - TronWebProto.AssetIssueContract.prototype.addFrozenSupply = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, TronWebProto.AssetIssueContract.FrozenSupply, opt_index); - }; - TronWebProto.AssetIssueContract.prototype.clearFrozenSupplyList = function() { - return this.setFrozenSupplyList([]); - }; - TronWebProto.AssetIssueContract.prototype.getTrxNum = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 6, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setTrxNum = function(value) { - return jspb.Message.setProto3IntField(this, 6, value); - }; - TronWebProto.AssetIssueContract.prototype.getPrecision = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 7, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setPrecision = function(value) { - return jspb.Message.setProto3IntField(this, 7, value); - }; - TronWebProto.AssetIssueContract.prototype.getNum = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 8, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setNum = function(value) { - return jspb.Message.setProto3IntField(this, 8, value); - }; - TronWebProto.AssetIssueContract.prototype.getStartTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 9, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setStartTime = function(value) { - return jspb.Message.setProto3IntField(this, 9, value); - }; - TronWebProto.AssetIssueContract.prototype.getEndTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 10, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setEndTime = function(value) { - return jspb.Message.setProto3IntField(this, 10, value); - }; - TronWebProto.AssetIssueContract.prototype.getOrder = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 11, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setOrder = function(value) { - return jspb.Message.setProto3IntField(this, 11, value); - }; - TronWebProto.AssetIssueContract.prototype.getVoteScore = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 16, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setVoteScore = function(value) { - return jspb.Message.setProto3IntField(this, 16, value); - }; - TronWebProto.AssetIssueContract.prototype.getDescription = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 20, "") - ); - }; - TronWebProto.AssetIssueContract.prototype.getDescription_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getDescription() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.getDescription_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getDescription() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.setDescription = function(value) { - return jspb.Message.setProto3BytesField(this, 20, value); - }; - TronWebProto.AssetIssueContract.prototype.getUrl = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 21, "") - ); - }; - TronWebProto.AssetIssueContract.prototype.getUrl_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getUrl() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.getUrl_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getUrl() - ) - ); - }; - TronWebProto.AssetIssueContract.prototype.setUrl = function(value) { - return jspb.Message.setProto3BytesField(this, 21, value); - }; - TronWebProto.AssetIssueContract.prototype.getFreeAssetNetLimit = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 22, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setFreeAssetNetLimit = function(value) { - return jspb.Message.setProto3IntField(this, 22, value); - }; - TronWebProto.AssetIssueContract.prototype.getPublicFreeAssetNetLimit = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 23, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setPublicFreeAssetNetLimit = function(value) { - return jspb.Message.setProto3IntField(this, 23, value); - }; - TronWebProto.AssetIssueContract.prototype.getPublicFreeAssetNetUsage = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 24, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setPublicFreeAssetNetUsage = function(value) { - return jspb.Message.setProto3IntField(this, 24, value); - }; - TronWebProto.AssetIssueContract.prototype.getPublicLatestFreeNetTime = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 25, 0) - ); - }; - TronWebProto.AssetIssueContract.prototype.setPublicLatestFreeNetTime = function(value) { - return jspb.Message.setProto3IntField(this, 25, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.TransferAssetContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.TransferAssetContract.toObject(opt_includeInstance, this); - }; - TronWebProto.TransferAssetContract.toObject = function(includeInstance, msg) { - var obj = { - assetName: msg.getAssetName_asB64(), - ownerAddress: msg.getOwnerAddress_asB64(), - toAddress: msg.getToAddress_asB64(), - amount: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.TransferAssetContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.TransferAssetContract(); - return TronWebProto.TransferAssetContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.TransferAssetContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAssetName(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setToAddress(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setAmount(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.TransferAssetContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.TransferAssetContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.TransferAssetContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAssetName_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - f3 = message2.getToAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getAmount(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - }; - TronWebProto.TransferAssetContract.prototype.getAssetName = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.TransferAssetContract.prototype.getAssetName_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAssetName() - ) - ); - }; - TronWebProto.TransferAssetContract.prototype.getAssetName_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAssetName() - ) - ); - }; - TronWebProto.TransferAssetContract.prototype.setAssetName = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.TransferAssetContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.TransferAssetContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.TransferAssetContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.TransferAssetContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.TransferAssetContract.prototype.getToAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.TransferAssetContract.prototype.getToAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getToAddress() - ) - ); - }; - TronWebProto.TransferAssetContract.prototype.getToAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getToAddress() - ) - ); - }; - TronWebProto.TransferAssetContract.prototype.setToAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.TransferAssetContract.prototype.getAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.TransferAssetContract.prototype.setAmount = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.UnfreezeAssetContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.UnfreezeAssetContract.toObject(opt_includeInstance, this); - }; - TronWebProto.UnfreezeAssetContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.UnfreezeAssetContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.UnfreezeAssetContract(); - return TronWebProto.UnfreezeAssetContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.UnfreezeAssetContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.UnfreezeAssetContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.UnfreezeAssetContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.UnfreezeAssetContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - }; - TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.UnfreezeAssetContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.UpdateAssetContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.UpdateAssetContract.toObject(opt_includeInstance, this); - }; - TronWebProto.UpdateAssetContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - description: msg.getDescription_asB64(), - url: msg.getUrl_asB64(), - newLimit: jspb.Message.getFieldWithDefault(msg, 4, 0), - newPublicLimit: jspb.Message.getFieldWithDefault(msg, 5, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.UpdateAssetContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.UpdateAssetContract(); - return TronWebProto.UpdateAssetContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.UpdateAssetContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setDescription(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setUrl(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setNewLimit(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setNewPublicLimit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.UpdateAssetContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.UpdateAssetContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.UpdateAssetContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getDescription_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - f3 = message2.getUrl_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getNewLimit(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - f3 = message2.getNewPublicLimit(); - if (f3 !== 0) { - writer.writeInt64( - 5, - f3 - ); - } - }; - TronWebProto.UpdateAssetContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.UpdateAssetContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.UpdateAssetContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.UpdateAssetContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.UpdateAssetContract.prototype.getDescription = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.UpdateAssetContract.prototype.getDescription_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getDescription() - ) - ); - }; - TronWebProto.UpdateAssetContract.prototype.getDescription_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getDescription() - ) - ); - }; - TronWebProto.UpdateAssetContract.prototype.setDescription = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.UpdateAssetContract.prototype.getUrl = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.UpdateAssetContract.prototype.getUrl_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getUrl() - ) - ); - }; - TronWebProto.UpdateAssetContract.prototype.getUrl_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getUrl() - ) - ); - }; - TronWebProto.UpdateAssetContract.prototype.setUrl = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.UpdateAssetContract.prototype.getNewLimit = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.UpdateAssetContract.prototype.setNewLimit = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - TronWebProto.UpdateAssetContract.prototype.getNewPublicLimit = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.UpdateAssetContract.prototype.setNewPublicLimit = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ParticipateAssetIssueContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ParticipateAssetIssueContract.toObject(opt_includeInstance, this); - }; - TronWebProto.ParticipateAssetIssueContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - toAddress: msg.getToAddress_asB64(), - assetName: msg.getAssetName_asB64(), - amount: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ParticipateAssetIssueContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ParticipateAssetIssueContract(); - return TronWebProto.ParticipateAssetIssueContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ParticipateAssetIssueContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setToAddress(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAssetName(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setAmount(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ParticipateAssetIssueContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ParticipateAssetIssueContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ParticipateAssetIssueContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getToAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - f3 = message2.getAssetName_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getAmount(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getToAddress() - ) - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getToAddress() - ) - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.setToAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getAssetName() - ) - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getAssetName() - ) - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.setAssetName = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.getAmount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.ParticipateAssetIssueContract.prototype.setAmount = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - goog.object.extend(exports, TronWebProto); -})(asset_issue_contract_pb); -var smart_contract_pb = {}; -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - var core_Tron_pb = Tron_pb; - goog.object.extend(proto, core_Tron_pb); - goog.exportSymbol("TronWebProto.ClearABIContract", null, global2); - goog.exportSymbol("TronWebProto.ContractState", null, global2); - goog.exportSymbol("TronWebProto.CreateSmartContract", null, global2); - goog.exportSymbol("TronWebProto.SmartContract", null, global2); - goog.exportSymbol("TronWebProto.SmartContract.ABI", null, global2); - goog.exportSymbol("TronWebProto.SmartContract.ABI.Entry", null, global2); - goog.exportSymbol("TronWebProto.SmartContract.ABI.Entry.EntryType", null, global2); - goog.exportSymbol("TronWebProto.SmartContract.ABI.Entry.Param", null, global2); - goog.exportSymbol("TronWebProto.SmartContract.ABI.Entry.StateMutabilityType", null, global2); - goog.exportSymbol("TronWebProto.SmartContractDataWrapper", null, global2); - goog.exportSymbol("TronWebProto.TriggerSmartContract", null, global2); - goog.exportSymbol("TronWebProto.UpdateEnergyLimitContract", null, global2); - goog.exportSymbol("TronWebProto.UpdateSettingContract", null, global2); - TronWebProto.SmartContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.SmartContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.SmartContract.displayName = "TronWebProto.SmartContract"; - } - TronWebProto.SmartContract.ABI = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.SmartContract.ABI.repeatedFields_, null); - }; - goog.inherits(TronWebProto.SmartContract.ABI, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.SmartContract.ABI.displayName = "TronWebProto.SmartContract.ABI"; - } - TronWebProto.SmartContract.ABI.Entry = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.SmartContract.ABI.Entry.repeatedFields_, null); - }; - goog.inherits(TronWebProto.SmartContract.ABI.Entry, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.SmartContract.ABI.Entry.displayName = "TronWebProto.SmartContract.ABI.Entry"; - } - TronWebProto.SmartContract.ABI.Entry.Param = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.SmartContract.ABI.Entry.Param, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.SmartContract.ABI.Entry.Param.displayName = "TronWebProto.SmartContract.ABI.Entry.Param"; - } - TronWebProto.ContractState = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ContractState, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ContractState.displayName = "TronWebProto.ContractState"; - } - TronWebProto.CreateSmartContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.CreateSmartContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.CreateSmartContract.displayName = "TronWebProto.CreateSmartContract"; - } - TronWebProto.TriggerSmartContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.TriggerSmartContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.TriggerSmartContract.displayName = "TronWebProto.TriggerSmartContract"; - } - TronWebProto.ClearABIContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ClearABIContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ClearABIContract.displayName = "TronWebProto.ClearABIContract"; - } - TronWebProto.UpdateSettingContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.UpdateSettingContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.UpdateSettingContract.displayName = "TronWebProto.UpdateSettingContract"; - } - TronWebProto.UpdateEnergyLimitContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.UpdateEnergyLimitContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.UpdateEnergyLimitContract.displayName = "TronWebProto.UpdateEnergyLimitContract"; - } - TronWebProto.SmartContractDataWrapper = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.SmartContractDataWrapper, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.SmartContractDataWrapper.displayName = "TronWebProto.SmartContractDataWrapper"; - } - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.SmartContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.SmartContract.toObject(opt_includeInstance, this); - }; - TronWebProto.SmartContract.toObject = function(includeInstance, msg) { - var f3, obj = { - originAddress: msg.getOriginAddress_asB64(), - contractAddress: msg.getContractAddress_asB64(), - abi: (f3 = msg.getAbi()) && TronWebProto.SmartContract.ABI.toObject(includeInstance, f3), - bytecode: msg.getBytecode_asB64(), - callValue: jspb.Message.getFieldWithDefault(msg, 5, 0), - consumeUserResourcePercent: jspb.Message.getFieldWithDefault(msg, 6, 0), - name: jspb.Message.getFieldWithDefault(msg, 7, ""), - originEnergyLimit: jspb.Message.getFieldWithDefault(msg, 8, 0), - codeHash: msg.getCodeHash_asB64(), - trxHash: msg.getTrxHash_asB64(), - version: jspb.Message.getFieldWithDefault(msg, 11, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.SmartContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.SmartContract(); - return TronWebProto.SmartContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.SmartContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOriginAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setContractAddress(value); - break; - case 3: - var value = new TronWebProto.SmartContract.ABI(); - reader.readMessage(value, TronWebProto.SmartContract.ABI.deserializeBinaryFromReader); - msg.setAbi(value); - break; - case 4: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setBytecode(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setCallValue(value); - break; - case 6: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setConsumeUserResourcePercent(value); - break; - case 7: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setName(value); - break; - case 8: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setOriginEnergyLimit(value); - break; - case 9: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setCodeHash(value); - break; - case 10: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setTrxHash(value); - break; - case 11: - var value = ( - /** @type {number} */ - reader.readInt32() - ); - msg.setVersion(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.SmartContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.SmartContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.SmartContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOriginAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getContractAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - f3 = message2.getAbi(); - if (f3 != null) { - writer.writeMessage(3, f3, TronWebProto.SmartContract.ABI.serializeBinaryToWriter); - } - f3 = message2.getBytecode_asU8(); - if (f3.length > 0) { - writer.writeBytes(4, f3); - } - f3 = message2.getCallValue(); - if (f3 !== 0) { - writer.writeInt64(5, f3); - } - f3 = message2.getConsumeUserResourcePercent(); - if (f3 !== 0) { - writer.writeInt64(6, f3); - } - f3 = message2.getName(); - if (f3.length > 0) { - writer.writeString(7, f3); - } - f3 = message2.getOriginEnergyLimit(); - if (f3 !== 0) { - writer.writeInt64(8, f3); - } - f3 = message2.getCodeHash_asU8(); - if (f3.length > 0) { - writer.writeBytes(9, f3); - } - f3 = message2.getTrxHash_asU8(); - if (f3.length > 0) { - writer.writeBytes(10, f3); - } - f3 = message2.getVersion(); - if (f3 !== 0) { - writer.writeInt32(11, f3); - } - }; - TronWebProto.SmartContract.ABI.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.SmartContract.ABI.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.SmartContract.ABI.toObject(opt_includeInstance, this); - }; - TronWebProto.SmartContract.ABI.toObject = function(includeInstance, msg) { - var obj = { - entrysList: jspb.Message.toObjectList( - msg.getEntrysList(), - TronWebProto.SmartContract.ABI.Entry.toObject, - includeInstance - ) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.SmartContract.ABI.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.SmartContract.ABI(); - return TronWebProto.SmartContract.ABI.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.SmartContract.ABI.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new TronWebProto.SmartContract.ABI.Entry(); - reader.readMessage(value, TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader); - msg.addEntrys(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.SmartContract.ABI.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.SmartContract.ABI.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.SmartContract.ABI.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getEntrysList(); - if (f3.length > 0) { - writer.writeRepeatedMessage(1, f3, TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter); - } - }; - TronWebProto.SmartContract.ABI.Entry.repeatedFields_ = [4, 5]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.SmartContract.ABI.Entry.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.SmartContract.ABI.Entry.toObject(opt_includeInstance, this); - }; - TronWebProto.SmartContract.ABI.Entry.toObject = function(includeInstance, msg) { - var obj = { - anonymous: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), - constant: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), - name: jspb.Message.getFieldWithDefault(msg, 3, ""), - inputsList: jspb.Message.toObjectList( - msg.getInputsList(), - TronWebProto.SmartContract.ABI.Entry.Param.toObject, - includeInstance - ), - outputsList: jspb.Message.toObjectList( - msg.getOutputsList(), - TronWebProto.SmartContract.ABI.Entry.Param.toObject, - includeInstance - ), - type: jspb.Message.getFieldWithDefault(msg, 6, 0), - payable: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), - statemutability: jspb.Message.getFieldWithDefault(msg, 8, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.SmartContract.ABI.Entry.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.SmartContract.ABI.Entry(); - return TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setAnonymous(value); - break; - case 2: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setConstant(value); - break; - case 3: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setName(value); - break; - case 4: - var value = new TronWebProto.SmartContract.ABI.Entry.Param(); - reader.readMessage(value, TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader); - msg.addInputs(value); - break; - case 5: - var value = new TronWebProto.SmartContract.ABI.Entry.Param(); - reader.readMessage(value, TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader); - msg.addOutputs(value); - break; - case 6: - var value = ( - /** @type {!TronWebProto.SmartContract.ABI.Entry.EntryType} */ - reader.readEnum() - ); - msg.setType(value); - break; - case 7: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setPayable(value); - break; - case 8: - var value = ( - /** @type {!TronWebProto.SmartContract.ABI.Entry.StateMutabilityType} */ - reader.readEnum() - ); - msg.setStatemutability(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.SmartContract.ABI.Entry.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAnonymous(); - if (f3) { - writer.writeBool(1, f3); - } - f3 = message2.getConstant(); - if (f3) { - writer.writeBool(2, f3); - } - f3 = message2.getName(); - if (f3.length > 0) { - writer.writeString(3, f3); - } - f3 = message2.getInputsList(); - if (f3.length > 0) { - writer.writeRepeatedMessage(4, f3, TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter); - } - f3 = message2.getOutputsList(); - if (f3.length > 0) { - writer.writeRepeatedMessage(5, f3, TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter); - } - f3 = message2.getType(); - if (f3 !== 0) { - writer.writeEnum(6, f3); - } - f3 = message2.getPayable(); - if (f3) { - writer.writeBool(7, f3); - } - f3 = message2.getStatemutability(); - if (f3 !== 0) { - writer.writeEnum(8, f3); - } - }; - TronWebProto.SmartContract.ABI.Entry.EntryType = { - UNKNOWNENTRYTYPE: 0, - CONSTRUCTOR: 1, - FUNCTION: 2, - EVENT: 3, - FALLBACK: 4, - RECEIVE: 5, - ERROR: 6 - }; - TronWebProto.SmartContract.ABI.Entry.StateMutabilityType = { - UNKNOWNMUTABILITYTYPE: 0, - PURE: 1, - VIEW: 2, - NONPAYABLE: 3, - PAYABLE: 4 - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.SmartContract.ABI.Entry.Param.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.SmartContract.ABI.Entry.Param.toObject(opt_includeInstance, this); - }; - TronWebProto.SmartContract.ABI.Entry.Param.toObject = function(includeInstance, msg) { - var obj = { - indexed: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), - name: jspb.Message.getFieldWithDefault(msg, 2, ""), - type: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.SmartContract.ABI.Entry.Param(); - return TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setIndexed(value); - break; - case 2: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setName(value); - break; - case 3: - var value = ( - /** @type {string} */ - reader.readString() - ); - msg.setType(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.SmartContract.ABI.Entry.Param.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getIndexed(); - if (f3) { - writer.writeBool(1, f3); - } - f3 = message2.getName(); - if (f3.length > 0) { - writer.writeString(2, f3); - } - f3 = message2.getType(); - if (f3.length > 0) { - writer.writeString(3, f3); - } - }; - TronWebProto.SmartContract.ABI.Entry.Param.prototype.getIndexed = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 1, false) - ); - }; - TronWebProto.SmartContract.ABI.Entry.Param.prototype.setIndexed = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); - }; - TronWebProto.SmartContract.ABI.Entry.Param.prototype.getName = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.SmartContract.ABI.Entry.Param.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); - }; - TronWebProto.SmartContract.ABI.Entry.Param.prototype.getType = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.SmartContract.ABI.Entry.Param.prototype.setType = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.getAnonymous = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 1, false) - ); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.setAnonymous = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.getConstant = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 2, false) - ); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.setConstant = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.getName = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.getInputsList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.SmartContract.ABI.Entry.Param, 4) - ); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.setInputsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 4, value); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.addInputs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, TronWebProto.SmartContract.ABI.Entry.Param, opt_index); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.clearInputsList = function() { - return this.setInputsList([]); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.getOutputsList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.SmartContract.ABI.Entry.Param, 5) - ); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.setOutputsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 5, value); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.addOutputs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, TronWebProto.SmartContract.ABI.Entry.Param, opt_index); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.clearOutputsList = function() { - return this.setOutputsList([]); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.getType = function() { - return ( - /** @type {!TronWebProto.SmartContract.ABI.Entry.EntryType} */ - jspb.Message.getFieldWithDefault(this, 6, 0) - ); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 6, value); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.getPayable = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 7, false) - ); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.setPayable = function(value) { - return jspb.Message.setProto3BooleanField(this, 7, value); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.getStatemutability = function() { - return ( - /** @type {!TronWebProto.SmartContract.ABI.Entry.StateMutabilityType} */ - jspb.Message.getFieldWithDefault(this, 8, 0) - ); - }; - TronWebProto.SmartContract.ABI.Entry.prototype.setStatemutability = function(value) { - return jspb.Message.setProto3EnumField(this, 8, value); - }; - TronWebProto.SmartContract.ABI.prototype.getEntrysList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.SmartContract.ABI.Entry, 1) - ); - }; - TronWebProto.SmartContract.ABI.prototype.setEntrysList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); - }; - TronWebProto.SmartContract.ABI.prototype.addEntrys = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, TronWebProto.SmartContract.ABI.Entry, opt_index); - }; - TronWebProto.SmartContract.ABI.prototype.clearEntrysList = function() { - return this.setEntrysList([]); - }; - TronWebProto.SmartContract.prototype.getOriginAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.SmartContract.prototype.getOriginAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOriginAddress()) - ); - }; - TronWebProto.SmartContract.prototype.getOriginAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOriginAddress()) - ); - }; - TronWebProto.SmartContract.prototype.setOriginAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.SmartContract.prototype.getContractAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.SmartContract.prototype.getContractAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getContractAddress()) - ); - }; - TronWebProto.SmartContract.prototype.getContractAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getContractAddress()) - ); - }; - TronWebProto.SmartContract.prototype.setContractAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.SmartContract.prototype.getAbi = function() { - return ( - /** @type{?TronWebProto.SmartContract.ABI} */ - jspb.Message.getWrapperField(this, TronWebProto.SmartContract.ABI, 3) - ); - }; - TronWebProto.SmartContract.prototype.setAbi = function(value) { - return jspb.Message.setWrapperField(this, 3, value); - }; - TronWebProto.SmartContract.prototype.clearAbi = function() { - return this.setAbi(void 0); - }; - TronWebProto.SmartContract.prototype.hasAbi = function() { - return jspb.Message.getField(this, 3) != null; - }; - TronWebProto.SmartContract.prototype.getBytecode = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 4, "") - ); - }; - TronWebProto.SmartContract.prototype.getBytecode_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getBytecode()) - ); - }; - TronWebProto.SmartContract.prototype.getBytecode_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getBytecode()) - ); - }; - TronWebProto.SmartContract.prototype.setBytecode = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); - }; - TronWebProto.SmartContract.prototype.getCallValue = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.SmartContract.prototype.setCallValue = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - TronWebProto.SmartContract.prototype.getConsumeUserResourcePercent = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 6, 0) - ); - }; - TronWebProto.SmartContract.prototype.setConsumeUserResourcePercent = function(value) { - return jspb.Message.setProto3IntField(this, 6, value); - }; - TronWebProto.SmartContract.prototype.getName = function() { - return ( - /** @type {string} */ - jspb.Message.getFieldWithDefault(this, 7, "") - ); - }; - TronWebProto.SmartContract.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 7, value); - }; - TronWebProto.SmartContract.prototype.getOriginEnergyLimit = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 8, 0) - ); - }; - TronWebProto.SmartContract.prototype.setOriginEnergyLimit = function(value) { - return jspb.Message.setProto3IntField(this, 8, value); - }; - TronWebProto.SmartContract.prototype.getCodeHash = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 9, "") - ); - }; - TronWebProto.SmartContract.prototype.getCodeHash_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getCodeHash()) - ); - }; - TronWebProto.SmartContract.prototype.getCodeHash_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getCodeHash()) - ); - }; - TronWebProto.SmartContract.prototype.setCodeHash = function(value) { - return jspb.Message.setProto3BytesField(this, 9, value); - }; - TronWebProto.SmartContract.prototype.getTrxHash = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 10, "") - ); - }; - TronWebProto.SmartContract.prototype.getTrxHash_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getTrxHash()) - ); - }; - TronWebProto.SmartContract.prototype.getTrxHash_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getTrxHash()) - ); - }; - TronWebProto.SmartContract.prototype.setTrxHash = function(value) { - return jspb.Message.setProto3BytesField(this, 10, value); - }; - TronWebProto.SmartContract.prototype.getVersion = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 11, 0) - ); - }; - TronWebProto.SmartContract.prototype.setVersion = function(value) { - return jspb.Message.setProto3IntField(this, 11, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ContractState.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ContractState.toObject(opt_includeInstance, this); - }; - TronWebProto.ContractState.toObject = function(includeInstance, msg) { - var obj = { - energyUsage: jspb.Message.getFieldWithDefault(msg, 1, 0), - energyFactor: jspb.Message.getFieldWithDefault(msg, 2, 0), - updateCycle: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ContractState.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ContractState(); - return TronWebProto.ContractState.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ContractState.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setEnergyUsage(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setEnergyFactor(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setUpdateCycle(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ContractState.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ContractState.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ContractState.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getEnergyUsage(); - if (f3 !== 0) { - writer.writeInt64(1, f3); - } - f3 = message2.getEnergyFactor(); - if (f3 !== 0) { - writer.writeInt64(2, f3); - } - f3 = message2.getUpdateCycle(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - }; - TronWebProto.ContractState.prototype.getEnergyUsage = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 1, 0) - ); - }; - TronWebProto.ContractState.prototype.setEnergyUsage = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); - }; - TronWebProto.ContractState.prototype.getEnergyFactor = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.ContractState.prototype.setEnergyFactor = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.ContractState.prototype.getUpdateCycle = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.ContractState.prototype.setUpdateCycle = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.CreateSmartContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.CreateSmartContract.toObject(opt_includeInstance, this); - }; - TronWebProto.CreateSmartContract.toObject = function(includeInstance, msg) { - var f3, obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - newContract: (f3 = msg.getNewContract()) && TronWebProto.SmartContract.toObject(includeInstance, f3), - callTokenValue: jspb.Message.getFieldWithDefault(msg, 3, 0), - tokenId: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.CreateSmartContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.CreateSmartContract(); - return TronWebProto.CreateSmartContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.CreateSmartContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = new TronWebProto.SmartContract(); - reader.readMessage(value, TronWebProto.SmartContract.deserializeBinaryFromReader); - msg.setNewContract(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setCallTokenValue(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setTokenId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.CreateSmartContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.CreateSmartContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.CreateSmartContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getNewContract(); - if (f3 != null) { - writer.writeMessage(2, f3, TronWebProto.SmartContract.serializeBinaryToWriter); - } - f3 = message2.getCallTokenValue(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - f3 = message2.getTokenId(); - if (f3 !== 0) { - writer.writeInt64(4, f3); - } - }; - TronWebProto.CreateSmartContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.CreateSmartContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.CreateSmartContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.CreateSmartContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.CreateSmartContract.prototype.getNewContract = function() { - return ( - /** @type{?TronWebProto.SmartContract} */ - jspb.Message.getWrapperField(this, TronWebProto.SmartContract, 2) - ); - }; - TronWebProto.CreateSmartContract.prototype.setNewContract = function(value) { - return jspb.Message.setWrapperField(this, 2, value); - }; - TronWebProto.CreateSmartContract.prototype.clearNewContract = function() { - return this.setNewContract(void 0); - }; - TronWebProto.CreateSmartContract.prototype.hasNewContract = function() { - return jspb.Message.getField(this, 2) != null; - }; - TronWebProto.CreateSmartContract.prototype.getCallTokenValue = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.CreateSmartContract.prototype.setCallTokenValue = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.CreateSmartContract.prototype.getTokenId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.CreateSmartContract.prototype.setTokenId = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.TriggerSmartContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.TriggerSmartContract.toObject(opt_includeInstance, this); - }; - TronWebProto.TriggerSmartContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - contractAddress: msg.getContractAddress_asB64(), - callValue: jspb.Message.getFieldWithDefault(msg, 3, 0), - data: msg.getData_asB64(), - callTokenValue: jspb.Message.getFieldWithDefault(msg, 5, 0), - tokenId: jspb.Message.getFieldWithDefault(msg, 6, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.TriggerSmartContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.TriggerSmartContract(); - return TronWebProto.TriggerSmartContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.TriggerSmartContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setContractAddress(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setCallValue(value); - break; - case 4: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setData(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setCallTokenValue(value); - break; - case 6: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setTokenId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.TriggerSmartContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.TriggerSmartContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.TriggerSmartContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getContractAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - f3 = message2.getCallValue(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - f3 = message2.getData_asU8(); - if (f3.length > 0) { - writer.writeBytes(4, f3); - } - f3 = message2.getCallTokenValue(); - if (f3 !== 0) { - writer.writeInt64(5, f3); - } - f3 = message2.getTokenId(); - if (f3 !== 0) { - writer.writeInt64(6, f3); - } - }; - TronWebProto.TriggerSmartContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.TriggerSmartContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.TriggerSmartContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.TriggerSmartContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.TriggerSmartContract.prototype.getContractAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.TriggerSmartContract.prototype.getContractAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getContractAddress()) - ); - }; - TronWebProto.TriggerSmartContract.prototype.getContractAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getContractAddress()) - ); - }; - TronWebProto.TriggerSmartContract.prototype.setContractAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.TriggerSmartContract.prototype.getCallValue = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.TriggerSmartContract.prototype.setCallValue = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.TriggerSmartContract.prototype.getData = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 4, "") - ); - }; - TronWebProto.TriggerSmartContract.prototype.getData_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getData()) - ); - }; - TronWebProto.TriggerSmartContract.prototype.getData_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getData()) - ); - }; - TronWebProto.TriggerSmartContract.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); - }; - TronWebProto.TriggerSmartContract.prototype.getCallTokenValue = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.TriggerSmartContract.prototype.setCallTokenValue = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - TronWebProto.TriggerSmartContract.prototype.getTokenId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 6, 0) - ); - }; - TronWebProto.TriggerSmartContract.prototype.setTokenId = function(value) { - return jspb.Message.setProto3IntField(this, 6, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ClearABIContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ClearABIContract.toObject(opt_includeInstance, this); - }; - TronWebProto.ClearABIContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - contractAddress: msg.getContractAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ClearABIContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ClearABIContract(); - return TronWebProto.ClearABIContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ClearABIContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setContractAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ClearABIContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ClearABIContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ClearABIContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getContractAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - }; - TronWebProto.ClearABIContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.ClearABIContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.ClearABIContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.ClearABIContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.ClearABIContract.prototype.getContractAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.ClearABIContract.prototype.getContractAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getContractAddress()) - ); - }; - TronWebProto.ClearABIContract.prototype.getContractAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getContractAddress()) - ); - }; - TronWebProto.ClearABIContract.prototype.setContractAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.UpdateSettingContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.UpdateSettingContract.toObject(opt_includeInstance, this); - }; - TronWebProto.UpdateSettingContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - contractAddress: msg.getContractAddress_asB64(), - consumeUserResourcePercent: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.UpdateSettingContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.UpdateSettingContract(); - return TronWebProto.UpdateSettingContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.UpdateSettingContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setContractAddress(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setConsumeUserResourcePercent(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.UpdateSettingContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.UpdateSettingContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.UpdateSettingContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getContractAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - f3 = message2.getConsumeUserResourcePercent(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - }; - TronWebProto.UpdateSettingContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.UpdateSettingContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.UpdateSettingContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.UpdateSettingContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.UpdateSettingContract.prototype.getContractAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.UpdateSettingContract.prototype.getContractAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getContractAddress()) - ); - }; - TronWebProto.UpdateSettingContract.prototype.getContractAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getContractAddress()) - ); - }; - TronWebProto.UpdateSettingContract.prototype.setContractAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.UpdateSettingContract.prototype.getConsumeUserResourcePercent = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.UpdateSettingContract.prototype.setConsumeUserResourcePercent = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.UpdateEnergyLimitContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.UpdateEnergyLimitContract.toObject(opt_includeInstance, this); - }; - TronWebProto.UpdateEnergyLimitContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - contractAddress: msg.getContractAddress_asB64(), - originEnergyLimit: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.UpdateEnergyLimitContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.UpdateEnergyLimitContract(); - return TronWebProto.UpdateEnergyLimitContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.UpdateEnergyLimitContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setContractAddress(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setOriginEnergyLimit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.UpdateEnergyLimitContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.UpdateEnergyLimitContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.UpdateEnergyLimitContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getContractAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - f3 = message2.getOriginEnergyLimit(); - if (f3 !== 0) { - writer.writeInt64(3, f3); - } - }; - TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.UpdateEnergyLimitContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getContractAddress()) - ); - }; - TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getContractAddress()) - ); - }; - TronWebProto.UpdateEnergyLimitContract.prototype.setContractAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.UpdateEnergyLimitContract.prototype.getOriginEnergyLimit = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.UpdateEnergyLimitContract.prototype.setOriginEnergyLimit = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.SmartContractDataWrapper.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.SmartContractDataWrapper.toObject(opt_includeInstance, this); - }; - TronWebProto.SmartContractDataWrapper.toObject = function(includeInstance, msg) { - var f3, obj = { - smartContract: (f3 = msg.getSmartContract()) && TronWebProto.SmartContract.toObject(includeInstance, f3), - runtimecode: msg.getRuntimecode_asB64(), - contractState: (f3 = msg.getContractState()) && TronWebProto.ContractState.toObject(includeInstance, f3) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.SmartContractDataWrapper.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.SmartContractDataWrapper(); - return TronWebProto.SmartContractDataWrapper.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.SmartContractDataWrapper.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new TronWebProto.SmartContract(); - reader.readMessage(value, TronWebProto.SmartContract.deserializeBinaryFromReader); - msg.setSmartContract(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setRuntimecode(value); - break; - case 3: - var value = new TronWebProto.ContractState(); - reader.readMessage(value, TronWebProto.ContractState.deserializeBinaryFromReader); - msg.setContractState(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.SmartContractDataWrapper.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.SmartContractDataWrapper.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.SmartContractDataWrapper.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getSmartContract(); - if (f3 != null) { - writer.writeMessage(1, f3, TronWebProto.SmartContract.serializeBinaryToWriter); - } - f3 = message2.getRuntimecode_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - f3 = message2.getContractState(); - if (f3 != null) { - writer.writeMessage(3, f3, TronWebProto.ContractState.serializeBinaryToWriter); - } - }; - TronWebProto.SmartContractDataWrapper.prototype.getSmartContract = function() { - return ( - /** @type{?TronWebProto.SmartContract} */ - jspb.Message.getWrapperField(this, TronWebProto.SmartContract, 1) - ); - }; - TronWebProto.SmartContractDataWrapper.prototype.setSmartContract = function(value) { - return jspb.Message.setWrapperField(this, 1, value); - }; - TronWebProto.SmartContractDataWrapper.prototype.clearSmartContract = function() { - return this.setSmartContract(void 0); - }; - TronWebProto.SmartContractDataWrapper.prototype.hasSmartContract = function() { - return jspb.Message.getField(this, 1) != null; - }; - TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getRuntimecode()) - ); - }; - TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getRuntimecode()) - ); - }; - TronWebProto.SmartContractDataWrapper.prototype.setRuntimecode = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.SmartContractDataWrapper.prototype.getContractState = function() { - return ( - /** @type{?TronWebProto.ContractState} */ - jspb.Message.getWrapperField(this, TronWebProto.ContractState, 3) - ); - }; - TronWebProto.SmartContractDataWrapper.prototype.setContractState = function(value) { - return jspb.Message.setWrapperField(this, 3, value); - }; - TronWebProto.SmartContractDataWrapper.prototype.clearContractState = function() { - return this.setContractState(void 0); - }; - TronWebProto.SmartContractDataWrapper.prototype.hasContractState = function() { - return jspb.Message.getField(this, 3) != null; - }; - goog.object.extend(exports, TronWebProto); -})(smart_contract_pb); -var witness_contract_pb = {}; -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - goog.exportSymbol("TronWebProto.VoteWitnessContract", null, global2); - goog.exportSymbol("TronWebProto.VoteWitnessContract.Vote", null, global2); - goog.exportSymbol("TronWebProto.WitnessCreateContract", null, global2); - goog.exportSymbol("TronWebProto.WitnessUpdateContract", null, global2); - TronWebProto.WitnessCreateContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.WitnessCreateContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.WitnessCreateContract.displayName = "TronWebProto.WitnessCreateContract"; - } - TronWebProto.WitnessUpdateContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.WitnessUpdateContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.WitnessUpdateContract.displayName = "TronWebProto.WitnessUpdateContract"; - } - TronWebProto.VoteWitnessContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.VoteWitnessContract.repeatedFields_, null); - }; - goog.inherits(TronWebProto.VoteWitnessContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.VoteWitnessContract.displayName = "TronWebProto.VoteWitnessContract"; - } - TronWebProto.VoteWitnessContract.Vote = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.VoteWitnessContract.Vote, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.VoteWitnessContract.Vote.displayName = "TronWebProto.VoteWitnessContract.Vote"; - } - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.WitnessCreateContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.WitnessCreateContract.toObject(opt_includeInstance, this); - }; - TronWebProto.WitnessCreateContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - url: msg.getUrl_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.WitnessCreateContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.WitnessCreateContract(); - return TronWebProto.WitnessCreateContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.WitnessCreateContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setUrl(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.WitnessCreateContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.WitnessCreateContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.WitnessCreateContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getUrl_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - }; - TronWebProto.WitnessCreateContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.WitnessCreateContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.WitnessCreateContract.prototype.getUrl = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.WitnessCreateContract.prototype.getUrl_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getUrl() - ) - ); - }; - TronWebProto.WitnessCreateContract.prototype.getUrl_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getUrl() - ) - ); - }; - TronWebProto.WitnessCreateContract.prototype.setUrl = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.WitnessUpdateContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.WitnessUpdateContract.toObject(opt_includeInstance, this); - }; - TronWebProto.WitnessUpdateContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - updateUrl: msg.getUpdateUrl_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.WitnessUpdateContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.WitnessUpdateContract(); - return TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 12: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setUpdateUrl(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.WitnessUpdateContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.WitnessUpdateContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.WitnessUpdateContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getUpdateUrl_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 12, - f3 - ); - } - }; - TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.WitnessUpdateContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 12, "") - ); - }; - TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getUpdateUrl() - ) - ); - }; - TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getUpdateUrl() - ) - ); - }; - TronWebProto.WitnessUpdateContract.prototype.setUpdateUrl = function(value) { - return jspb.Message.setProto3BytesField(this, 12, value); - }; - TronWebProto.VoteWitnessContract.repeatedFields_ = [2]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.VoteWitnessContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.VoteWitnessContract.toObject(opt_includeInstance, this); - }; - TronWebProto.VoteWitnessContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - votesList: jspb.Message.toObjectList( - msg.getVotesList(), - TronWebProto.VoteWitnessContract.Vote.toObject, - includeInstance - ), - support: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.VoteWitnessContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.VoteWitnessContract(); - return TronWebProto.VoteWitnessContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.VoteWitnessContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = new TronWebProto.VoteWitnessContract.Vote(); - reader.readMessage(value, TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader); - msg.addVotes(value); - break; - case 3: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setSupport(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.VoteWitnessContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.VoteWitnessContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.VoteWitnessContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getVotesList(); - if (f3.length > 0) { - writer.writeRepeatedMessage( - 2, - f3, - TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter - ); - } - f3 = message2.getSupport(); - if (f3) { - writer.writeBool( - 3, - f3 - ); - } - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.VoteWitnessContract.Vote.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.VoteWitnessContract.Vote.toObject(opt_includeInstance, this); - }; - TronWebProto.VoteWitnessContract.Vote.toObject = function(includeInstance, msg) { - var obj = { - voteAddress: msg.getVoteAddress_asB64(), - voteCount: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.VoteWitnessContract.Vote.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.VoteWitnessContract.Vote(); - return TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setVoteAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setVoteCount(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.VoteWitnessContract.Vote.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getVoteAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getVoteCount(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - }; - TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getVoteAddress() - ) - ); - }; - TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getVoteAddress() - ) - ); - }; - TronWebProto.VoteWitnessContract.Vote.prototype.setVoteAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.VoteWitnessContract.Vote.prototype.getVoteCount = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.VoteWitnessContract.Vote.prototype.setVoteCount = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.VoteWitnessContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.VoteWitnessContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.VoteWitnessContract.prototype.getVotesList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, TronWebProto.VoteWitnessContract.Vote, 2) - ); - }; - TronWebProto.VoteWitnessContract.prototype.setVotesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 2, value); - }; - TronWebProto.VoteWitnessContract.prototype.addVotes = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, TronWebProto.VoteWitnessContract.Vote, opt_index); - }; - TronWebProto.VoteWitnessContract.prototype.clearVotesList = function() { - return this.setVotesList([]); - }; - TronWebProto.VoteWitnessContract.prototype.getSupport = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 3, false) - ); - }; - TronWebProto.VoteWitnessContract.prototype.setSupport = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); - }; - goog.object.extend(exports, TronWebProto); -})(witness_contract_pb); -var storage_contract_pb = {}; -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - goog.exportSymbol("TronWebProto.BuyStorageBytesContract", null, global2); - goog.exportSymbol("TronWebProto.BuyStorageContract", null, global2); - goog.exportSymbol("TronWebProto.SellStorageContract", null, global2); - goog.exportSymbol("TronWebProto.UpdateBrokerageContract", null, global2); - TronWebProto.BuyStorageBytesContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.BuyStorageBytesContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.BuyStorageBytesContract.displayName = "TronWebProto.BuyStorageBytesContract"; - } - TronWebProto.BuyStorageContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.BuyStorageContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.BuyStorageContract.displayName = "TronWebProto.BuyStorageContract"; - } - TronWebProto.SellStorageContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.SellStorageContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.SellStorageContract.displayName = "TronWebProto.SellStorageContract"; - } - TronWebProto.UpdateBrokerageContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.UpdateBrokerageContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.UpdateBrokerageContract.displayName = "TronWebProto.UpdateBrokerageContract"; - } - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.BuyStorageBytesContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.BuyStorageBytesContract.toObject(opt_includeInstance, this); - }; - TronWebProto.BuyStorageBytesContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - bytes: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.BuyStorageBytesContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.BuyStorageBytesContract(); - return TronWebProto.BuyStorageBytesContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.BuyStorageBytesContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setBytes(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.BuyStorageBytesContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.BuyStorageBytesContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.BuyStorageBytesContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getBytes(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - }; - TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.BuyStorageBytesContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.BuyStorageBytesContract.prototype.getBytes = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.BuyStorageBytesContract.prototype.setBytes = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.BuyStorageContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.BuyStorageContract.toObject(opt_includeInstance, this); - }; - TronWebProto.BuyStorageContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - quant: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.BuyStorageContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.BuyStorageContract(); - return TronWebProto.BuyStorageContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.BuyStorageContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setQuant(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.BuyStorageContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.BuyStorageContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.BuyStorageContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getQuant(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - }; - TronWebProto.BuyStorageContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.BuyStorageContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.BuyStorageContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.BuyStorageContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.BuyStorageContract.prototype.getQuant = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.BuyStorageContract.prototype.setQuant = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.SellStorageContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.SellStorageContract.toObject(opt_includeInstance, this); - }; - TronWebProto.SellStorageContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - storageBytes: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.SellStorageContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.SellStorageContract(); - return TronWebProto.SellStorageContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.SellStorageContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setStorageBytes(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.SellStorageContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.SellStorageContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.SellStorageContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getStorageBytes(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - }; - TronWebProto.SellStorageContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.SellStorageContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.SellStorageContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.SellStorageContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.SellStorageContract.prototype.getStorageBytes = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.SellStorageContract.prototype.setStorageBytes = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.UpdateBrokerageContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.UpdateBrokerageContract.toObject(opt_includeInstance, this); - }; - TronWebProto.UpdateBrokerageContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - brokerage: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.UpdateBrokerageContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.UpdateBrokerageContract(); - return TronWebProto.UpdateBrokerageContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.UpdateBrokerageContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt32() - ); - msg.setBrokerage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.UpdateBrokerageContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.UpdateBrokerageContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.UpdateBrokerageContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getBrokerage(); - if (f3 !== 0) { - writer.writeInt32( - 2, - f3 - ); - } - }; - TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.UpdateBrokerageContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.UpdateBrokerageContract.prototype.getBrokerage = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.UpdateBrokerageContract.prototype.setBrokerage = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - goog.object.extend(exports, TronWebProto); -})(storage_contract_pb); -var account_contract_pb = {}; -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - var core_Tron_pb = Tron_pb; - goog.object.extend(proto, core_Tron_pb); - goog.exportSymbol("TronWebProto.AccountCreateContract", null, global2); - goog.exportSymbol("TronWebProto.AccountPermissionUpdateContract", null, global2); - goog.exportSymbol("TronWebProto.AccountUpdateContract", null, global2); - goog.exportSymbol("TronWebProto.SetAccountIdContract", null, global2); - TronWebProto.AccountCreateContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.AccountCreateContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AccountCreateContract.displayName = "TronWebProto.AccountCreateContract"; - } - TronWebProto.AccountUpdateContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.AccountUpdateContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AccountUpdateContract.displayName = "TronWebProto.AccountUpdateContract"; - } - TronWebProto.SetAccountIdContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.SetAccountIdContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.SetAccountIdContract.displayName = "TronWebProto.SetAccountIdContract"; - } - TronWebProto.AccountPermissionUpdateContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.AccountPermissionUpdateContract.repeatedFields_, null); - }; - goog.inherits(TronWebProto.AccountPermissionUpdateContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.AccountPermissionUpdateContract.displayName = "TronWebProto.AccountPermissionUpdateContract"; - } - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AccountCreateContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AccountCreateContract.toObject(opt_includeInstance, this); - }; - TronWebProto.AccountCreateContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - accountAddress: msg.getAccountAddress_asB64(), - type: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AccountCreateContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AccountCreateContract(); - return TronWebProto.AccountCreateContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AccountCreateContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAccountAddress(value); - break; - case 3: - var value = ( - /** @type {!TronWebProto.AccountType} */ - reader.readEnum() - ); - msg.setType(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AccountCreateContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AccountCreateContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AccountCreateContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getAccountAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - f3 = message2.getType(); - if (f3 !== 0) { - writer.writeEnum(3, f3); - } - }; - TronWebProto.AccountCreateContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.AccountCreateContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.AccountCreateContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.AccountCreateContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.AccountCreateContract.prototype.getAccountAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.AccountCreateContract.prototype.getAccountAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getAccountAddress()) - ); - }; - TronWebProto.AccountCreateContract.prototype.getAccountAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getAccountAddress()) - ); - }; - TronWebProto.AccountCreateContract.prototype.setAccountAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.AccountCreateContract.prototype.getType = function() { - return ( - /** @type {!TronWebProto.AccountType} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.AccountCreateContract.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 3, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AccountUpdateContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AccountUpdateContract.toObject(opt_includeInstance, this); - }; - TronWebProto.AccountUpdateContract.toObject = function(includeInstance, msg) { - var obj = { - accountName: msg.getAccountName_asB64(), - ownerAddress: msg.getOwnerAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AccountUpdateContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AccountUpdateContract(); - return TronWebProto.AccountUpdateContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AccountUpdateContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAccountName(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AccountUpdateContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AccountUpdateContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AccountUpdateContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAccountName_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - }; - TronWebProto.AccountUpdateContract.prototype.getAccountName = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.AccountUpdateContract.prototype.getAccountName_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getAccountName()) - ); - }; - TronWebProto.AccountUpdateContract.prototype.getAccountName_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getAccountName()) - ); - }; - TronWebProto.AccountUpdateContract.prototype.setAccountName = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.AccountUpdateContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.AccountUpdateContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.AccountUpdateContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.AccountUpdateContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.SetAccountIdContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.SetAccountIdContract.toObject(opt_includeInstance, this); - }; - TronWebProto.SetAccountIdContract.toObject = function(includeInstance, msg) { - var obj = { - accountId: msg.getAccountId_asB64(), - ownerAddress: msg.getOwnerAddress_asB64() - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.SetAccountIdContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.SetAccountIdContract(); - return TronWebProto.SetAccountIdContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.SetAccountIdContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setAccountId(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.SetAccountIdContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.SetAccountIdContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.SetAccountIdContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getAccountId_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(2, f3); - } - }; - TronWebProto.SetAccountIdContract.prototype.getAccountId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.SetAccountIdContract.prototype.getAccountId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getAccountId()) - ); - }; - TronWebProto.SetAccountIdContract.prototype.getAccountId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getAccountId()) - ); - }; - TronWebProto.SetAccountIdContract.prototype.setAccountId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.SetAccountIdContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.SetAccountIdContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.SetAccountIdContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.SetAccountIdContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.AccountPermissionUpdateContract.repeatedFields_ = [4]; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.AccountPermissionUpdateContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.AccountPermissionUpdateContract.toObject(opt_includeInstance, this); - }; - TronWebProto.AccountPermissionUpdateContract.toObject = function(includeInstance, msg) { - var f3, obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - owner: (f3 = msg.getOwner()) && core_Tron_pb.Permission.toObject(includeInstance, f3), - witness: (f3 = msg.getWitness()) && core_Tron_pb.Permission.toObject(includeInstance, f3), - activesList: jspb.Message.toObjectList(msg.getActivesList(), core_Tron_pb.Permission.toObject, includeInstance) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.AccountPermissionUpdateContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.AccountPermissionUpdateContract(); - return TronWebProto.AccountPermissionUpdateContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.AccountPermissionUpdateContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = new core_Tron_pb.Permission(); - reader.readMessage(value, core_Tron_pb.Permission.deserializeBinaryFromReader); - msg.setOwner(value); - break; - case 3: - var value = new core_Tron_pb.Permission(); - reader.readMessage(value, core_Tron_pb.Permission.deserializeBinaryFromReader); - msg.setWitness(value); - break; - case 4: - var value = new core_Tron_pb.Permission(); - reader.readMessage(value, core_Tron_pb.Permission.deserializeBinaryFromReader); - msg.addActives(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.AccountPermissionUpdateContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.AccountPermissionUpdateContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.AccountPermissionUpdateContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes(1, f3); - } - f3 = message2.getOwner(); - if (f3 != null) { - writer.writeMessage(2, f3, core_Tron_pb.Permission.serializeBinaryToWriter); - } - f3 = message2.getWitness(); - if (f3 != null) { - writer.writeMessage(3, f3, core_Tron_pb.Permission.serializeBinaryToWriter); - } - f3 = message2.getActivesList(); - if (f3.length > 0) { - writer.writeRepeatedMessage(4, f3, core_Tron_pb.Permission.serializeBinaryToWriter); - } - }; - TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64(this.getOwnerAddress()) - ); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8(this.getOwnerAddress()) - ); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.getOwner = function() { - return ( - /** @type{?TronWebProto.Permission} */ - jspb.Message.getWrapperField(this, core_Tron_pb.Permission, 2) - ); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.setOwner = function(value) { - return jspb.Message.setWrapperField(this, 2, value); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.clearOwner = function() { - return this.setOwner(void 0); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.hasOwner = function() { - return jspb.Message.getField(this, 2) != null; - }; - TronWebProto.AccountPermissionUpdateContract.prototype.getWitness = function() { - return ( - /** @type{?TronWebProto.Permission} */ - jspb.Message.getWrapperField(this, core_Tron_pb.Permission, 3) - ); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.setWitness = function(value) { - return jspb.Message.setWrapperField(this, 3, value); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.clearWitness = function() { - return this.setWitness(void 0); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.hasWitness = function() { - return jspb.Message.getField(this, 3) != null; - }; - TronWebProto.AccountPermissionUpdateContract.prototype.getActivesList = function() { - return ( - /** @type{!Array} */ - jspb.Message.getRepeatedWrapperField(this, core_Tron_pb.Permission, 4) - ); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.setActivesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 4, value); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.addActives = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, TronWebProto.Permission, opt_index); - }; - TronWebProto.AccountPermissionUpdateContract.prototype.clearActivesList = function() { - return this.setActivesList([]); - }; - goog.object.extend(exports, TronWebProto); -})(account_contract_pb); -var proposal_contract_pb = {}; -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - goog.exportSymbol("TronWebProto.ProposalApproveContract", null, global2); - goog.exportSymbol("TronWebProto.ProposalCreateContract", null, global2); - goog.exportSymbol("TronWebProto.ProposalDeleteContract", null, global2); - TronWebProto.ProposalApproveContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ProposalApproveContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ProposalApproveContract.displayName = "TronWebProto.ProposalApproveContract"; - } - TronWebProto.ProposalCreateContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ProposalCreateContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ProposalCreateContract.displayName = "TronWebProto.ProposalCreateContract"; - } - TronWebProto.ProposalDeleteContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ProposalDeleteContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ProposalDeleteContract.displayName = "TronWebProto.ProposalDeleteContract"; - } - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ProposalApproveContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ProposalApproveContract.toObject(opt_includeInstance, this); - }; - TronWebProto.ProposalApproveContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - proposalId: jspb.Message.getFieldWithDefault(msg, 2, 0), - isAddApproval: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ProposalApproveContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ProposalApproveContract(); - return TronWebProto.ProposalApproveContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ProposalApproveContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setProposalId(value); - break; - case 3: - var value = ( - /** @type {boolean} */ - reader.readBool() - ); - msg.setIsAddApproval(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ProposalApproveContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ProposalApproveContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ProposalApproveContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getProposalId(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - f3 = message2.getIsAddApproval(); - if (f3) { - writer.writeBool( - 3, - f3 - ); - } - }; - TronWebProto.ProposalApproveContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.ProposalApproveContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ProposalApproveContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ProposalApproveContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.ProposalApproveContract.prototype.getProposalId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.ProposalApproveContract.prototype.setProposalId = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.ProposalApproveContract.prototype.getIsAddApproval = function() { - return ( - /** @type {boolean} */ - jspb.Message.getBooleanFieldWithDefault(this, 3, false) - ); - }; - TronWebProto.ProposalApproveContract.prototype.setIsAddApproval = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ProposalCreateContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ProposalCreateContract.toObject(opt_includeInstance, this); - }; - TronWebProto.ProposalCreateContract.toObject = function(includeInstance, msg) { - var f3, obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - parametersMap: (f3 = msg.getParametersMap()) ? f3.toObject(includeInstance, void 0) : [] - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ProposalCreateContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ProposalCreateContract(); - return TronWebProto.ProposalCreateContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ProposalCreateContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = msg.getParametersMap(); - reader.readMessage(value, function(message2, reader2) { - jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readInt64, null, 0, 0); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ProposalCreateContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ProposalCreateContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ProposalCreateContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getParametersMap(true); - if (f3 && f3.getLength() > 0) { - f3.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeInt64, jspb.BinaryWriter.prototype.writeInt64); - } - }; - TronWebProto.ProposalCreateContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.ProposalCreateContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ProposalCreateContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ProposalCreateContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.ProposalCreateContract.prototype.getParametersMap = function(opt_noLazyCreate) { - return ( - /** @type {!jspb.Map} */ - jspb.Message.getMapField( - this, - 2, - opt_noLazyCreate, - null - ) - ); - }; - TronWebProto.ProposalCreateContract.prototype.clearParametersMap = function() { - this.getParametersMap().clear(); - return this; - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ProposalDeleteContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ProposalDeleteContract.toObject(opt_includeInstance, this); - }; - TronWebProto.ProposalDeleteContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - proposalId: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ProposalDeleteContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ProposalDeleteContract(); - return TronWebProto.ProposalDeleteContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ProposalDeleteContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setProposalId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ProposalDeleteContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ProposalDeleteContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ProposalDeleteContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getProposalId(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - }; - TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ProposalDeleteContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.ProposalDeleteContract.prototype.getProposalId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.ProposalDeleteContract.prototype.setProposalId = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - goog.object.extend(exports, TronWebProto); -})(proposal_contract_pb); -var exchange_contract_pb = {}; -(function(exports) { - var jspb = googleProtobuf; - var goog = jspb; - var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { - return this; - }).call(null) || Function("return this")(); - goog.exportSymbol("TronWebProto.ExchangeCreateContract", null, global2); - goog.exportSymbol("TronWebProto.ExchangeInjectContract", null, global2); - goog.exportSymbol("TronWebProto.ExchangeTransactionContract", null, global2); - goog.exportSymbol("TronWebProto.ExchangeWithdrawContract", null, global2); - TronWebProto.ExchangeCreateContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ExchangeCreateContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ExchangeCreateContract.displayName = "TronWebProto.ExchangeCreateContract"; - } - TronWebProto.ExchangeInjectContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ExchangeInjectContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ExchangeInjectContract.displayName = "TronWebProto.ExchangeInjectContract"; - } - TronWebProto.ExchangeWithdrawContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ExchangeWithdrawContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ExchangeWithdrawContract.displayName = "TronWebProto.ExchangeWithdrawContract"; - } - TronWebProto.ExchangeTransactionContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); - }; - goog.inherits(TronWebProto.ExchangeTransactionContract, jspb.Message); - if (goog.DEBUG && !COMPILED) { - TronWebProto.ExchangeTransactionContract.displayName = "TronWebProto.ExchangeTransactionContract"; - } - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ExchangeCreateContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ExchangeCreateContract.toObject(opt_includeInstance, this); - }; - TronWebProto.ExchangeCreateContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - firstTokenId: msg.getFirstTokenId_asB64(), - firstTokenBalance: jspb.Message.getFieldWithDefault(msg, 3, 0), - secondTokenId: msg.getSecondTokenId_asB64(), - secondTokenBalance: jspb.Message.getFieldWithDefault(msg, 5, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ExchangeCreateContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ExchangeCreateContract(); - return TronWebProto.ExchangeCreateContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ExchangeCreateContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setFirstTokenId(value); - break; - case 3: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setFirstTokenBalance(value); - break; - case 4: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setSecondTokenId(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setSecondTokenBalance(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ExchangeCreateContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ExchangeCreateContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ExchangeCreateContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getFirstTokenId_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 2, - f3 - ); - } - f3 = message2.getFirstTokenBalance(); - if (f3 !== 0) { - writer.writeInt64( - 3, - f3 - ); - } - f3 = message2.getSecondTokenId_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 4, - f3 - ); - } - f3 = message2.getSecondTokenBalance(); - if (f3 !== 0) { - writer.writeInt64( - 5, - f3 - ); - } - }; - TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ExchangeCreateContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 2, "") - ); - }; - TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getFirstTokenId() - ) - ); - }; - TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getFirstTokenId() - ) - ); - }; - TronWebProto.ExchangeCreateContract.prototype.setFirstTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); - }; - TronWebProto.ExchangeCreateContract.prototype.getFirstTokenBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 3, 0) - ); - }; - TronWebProto.ExchangeCreateContract.prototype.setFirstTokenBalance = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); - }; - TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 4, "") - ); - }; - TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getSecondTokenId() - ) - ); - }; - TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getSecondTokenId() - ) - ); - }; - TronWebProto.ExchangeCreateContract.prototype.setSecondTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); - }; - TronWebProto.ExchangeCreateContract.prototype.getSecondTokenBalance = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.ExchangeCreateContract.prototype.setSecondTokenBalance = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ExchangeInjectContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ExchangeInjectContract.toObject(opt_includeInstance, this); - }; - TronWebProto.ExchangeInjectContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - exchangeId: jspb.Message.getFieldWithDefault(msg, 2, 0), - tokenId: msg.getTokenId_asB64(), - quant: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ExchangeInjectContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ExchangeInjectContract(); - return TronWebProto.ExchangeInjectContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ExchangeInjectContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExchangeId(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setTokenId(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setQuant(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ExchangeInjectContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ExchangeInjectContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ExchangeInjectContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getExchangeId(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - f3 = message2.getTokenId_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getQuant(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - }; - TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ExchangeInjectContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.ExchangeInjectContract.prototype.getExchangeId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.ExchangeInjectContract.prototype.setExchangeId = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.ExchangeInjectContract.prototype.getTokenId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.ExchangeInjectContract.prototype.getTokenId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getTokenId() - ) - ); - }; - TronWebProto.ExchangeInjectContract.prototype.getTokenId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getTokenId() - ) - ); - }; - TronWebProto.ExchangeInjectContract.prototype.setTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.ExchangeInjectContract.prototype.getQuant = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.ExchangeInjectContract.prototype.setQuant = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ExchangeWithdrawContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ExchangeWithdrawContract.toObject(opt_includeInstance, this); - }; - TronWebProto.ExchangeWithdrawContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - exchangeId: jspb.Message.getFieldWithDefault(msg, 2, 0), - tokenId: msg.getTokenId_asB64(), - quant: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ExchangeWithdrawContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ExchangeWithdrawContract(); - return TronWebProto.ExchangeWithdrawContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ExchangeWithdrawContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExchangeId(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setTokenId(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setQuant(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ExchangeWithdrawContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ExchangeWithdrawContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ExchangeWithdrawContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getExchangeId(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - f3 = message2.getTokenId_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getQuant(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - }; - TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ExchangeWithdrawContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.ExchangeWithdrawContract.prototype.getExchangeId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.ExchangeWithdrawContract.prototype.setExchangeId = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.ExchangeWithdrawContract.prototype.getTokenId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.ExchangeWithdrawContract.prototype.getTokenId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getTokenId() - ) - ); - }; - TronWebProto.ExchangeWithdrawContract.prototype.getTokenId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getTokenId() - ) - ); - }; - TronWebProto.ExchangeWithdrawContract.prototype.setTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.ExchangeWithdrawContract.prototype.getQuant = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.ExchangeWithdrawContract.prototype.setQuant = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - if (jspb.Message.GENERATE_TO_OBJECT) { - TronWebProto.ExchangeTransactionContract.prototype.toObject = function(opt_includeInstance) { - return TronWebProto.ExchangeTransactionContract.toObject(opt_includeInstance, this); - }; - TronWebProto.ExchangeTransactionContract.toObject = function(includeInstance, msg) { - var obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - exchangeId: jspb.Message.getFieldWithDefault(msg, 2, 0), - tokenId: msg.getTokenId_asB64(), - quant: jspb.Message.getFieldWithDefault(msg, 4, 0), - expected: jspb.Message.getFieldWithDefault(msg, 5, 0) - }; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; - }; - } - TronWebProto.ExchangeTransactionContract.deserializeBinary = function(bytes2) { - var reader = new jspb.BinaryReader(bytes2); - var msg = new TronWebProto.ExchangeTransactionContract(); - return TronWebProto.ExchangeTransactionContract.deserializeBinaryFromReader(msg, reader); - }; - TronWebProto.ExchangeTransactionContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setOwnerAddress(value); - break; - case 2: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExchangeId(value); - break; - case 3: - var value = ( - /** @type {!Uint8Array} */ - reader.readBytes() - ); - msg.setTokenId(value); - break; - case 4: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setQuant(value); - break; - case 5: - var value = ( - /** @type {number} */ - reader.readInt64() - ); - msg.setExpected(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - TronWebProto.ExchangeTransactionContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - TronWebProto.ExchangeTransactionContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - TronWebProto.ExchangeTransactionContract.serializeBinaryToWriter = function(message2, writer) { - var f3 = void 0; - f3 = message2.getOwnerAddress_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 1, - f3 - ); - } - f3 = message2.getExchangeId(); - if (f3 !== 0) { - writer.writeInt64( - 2, - f3 - ); - } - f3 = message2.getTokenId_asU8(); - if (f3.length > 0) { - writer.writeBytes( - 3, - f3 - ); - } - f3 = message2.getQuant(); - if (f3 !== 0) { - writer.writeInt64( - 4, - f3 - ); - } - f3 = message2.getExpected(); - if (f3 !== 0) { - writer.writeInt64( - 5, - f3 - ); - } - }; - TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 1, "") - ); - }; - TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getOwnerAddress() - ) - ); - }; - TronWebProto.ExchangeTransactionContract.prototype.setOwnerAddress = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); - }; - TronWebProto.ExchangeTransactionContract.prototype.getExchangeId = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 2, 0) - ); - }; - TronWebProto.ExchangeTransactionContract.prototype.setExchangeId = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); - }; - TronWebProto.ExchangeTransactionContract.prototype.getTokenId = function() { - return ( - /** @type {!(string|Uint8Array)} */ - jspb.Message.getFieldWithDefault(this, 3, "") - ); - }; - TronWebProto.ExchangeTransactionContract.prototype.getTokenId_asB64 = function() { - return ( - /** @type {string} */ - jspb.Message.bytesAsB64( - this.getTokenId() - ) - ); - }; - TronWebProto.ExchangeTransactionContract.prototype.getTokenId_asU8 = function() { - return ( - /** @type {!Uint8Array} */ - jspb.Message.bytesAsU8( - this.getTokenId() - ) - ); - }; - TronWebProto.ExchangeTransactionContract.prototype.setTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); - }; - TronWebProto.ExchangeTransactionContract.prototype.getQuant = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 4, 0) - ); - }; - TronWebProto.ExchangeTransactionContract.prototype.setQuant = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); - }; - TronWebProto.ExchangeTransactionContract.prototype.getExpected = function() { - return ( - /** @type {number} */ - jspb.Message.getFieldWithDefault(this, 5, 0) - ); - }; - TronWebProto.ExchangeTransactionContract.prototype.setExpected = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); - }; - goog.object.extend(exports, TronWebProto); -})(exchange_contract_pb); -const { Transaction: Transaction2, Permission, Key } = globalThis.TronWebProto; -const { TransferContract, FreezeBalanceContract, UnfreezeBalanceContract, WithdrawBalanceContract, FreezeBalanceV2Contract, UnfreezeBalanceV2Contract, WithdrawExpireUnfreezeContract, DelegateResourceContract, UnDelegateResourceContract } = globalThis.TronWebProto; -const { TransferAssetContract, ParticipateAssetIssueContract, AssetIssueContract, UpdateAssetContract } = globalThis.TronWebProto; -const { TriggerSmartContract, ClearABIContract, UpdateEnergyLimitContract, UpdateSettingContract, CreateSmartContract, SmartContract } = globalThis.TronWebProto; -const { ResourceCode: ResourceCode$1 } = globalThis.TronWebProto; -const { WitnessCreateContract, VoteWitnessContract } = globalThis.TronWebProto; -const { UpdateBrokerageContract } = globalThis.TronWebProto; -const { AccountCreateContract, AccountUpdateContract, SetAccountIdContract, AccountPermissionUpdateContract } = globalThis.TronWebProto; -const { ProposalCreateContract, ProposalDeleteContract, ProposalApproveContract } = globalThis.TronWebProto; -const { ExchangeCreateContract, ExchangeInjectContract, ExchangeWithdrawContract, ExchangeTransactionContract } = globalThis.TronWebProto; -const fromHexString = (hexString) => { - if (!hexString || hexString.length === 0) - return new Uint8Array([]); - return new Uint8Array(TronWeb.address.toHex(hexString).match(/.{1,2}/g).map((byte2) => parseInt(byte2, 16))); -}; -const stringToUint8Array = (hexString) => { - if (!hexString || hexString.length === 0) - return new Uint8Array([]); - return new Uint8Array((isHex(hexString) ? hexString : TronWeb.toHex(hexString)).replace(/^0x/, "").match(/.{1,2}/g).map((byte2) => parseInt(byte2, 16))); -}; -const flexToUint8Array = (str, visible) => { - if (!visible) - return stringToUint8Array(str.replace(/^0x/, "")); - return stringToUint8Array(TronWeb.fromUtf8(str).replace(/^0x/, "")); -}; -const sha3$1 = (string2, prefix = true) => { - return (prefix ? "0x" : "") + keccak256(Buffer.from(string2, "utf-8")).toString().substring(2); -}; -const buildCommonTransaction = (message2, contractType, typeName, permissionId) => { - const anyValue = new google_protobuf_any_pb.Any(); - anyValue.pack(message2.serializeBinary(), "protocol." + typeName); - const contract = new Transaction2.Contract(); - contract.setType(contractType); - contract.setParameter(anyValue); - if (permissionId) { - contract.setPermissionId(permissionId); - } - const raw = new Transaction2.raw(); - raw.addContract(contract); - const transaction2 = new Transaction2(); - transaction2.setRawData(raw); - return transaction2; -}; -const buildTransferContract = (value, options) => { - const { to_address, owner_address, amount } = value; - const transferContract = new TransferContract(); - transferContract.setToAddress(fromHexString(to_address)); - transferContract.setOwnerAddress(fromHexString(owner_address)); - transferContract.setAmount(amount); - return buildCommonTransaction(transferContract, Transaction2.Contract.ContractType.TRANSFERCONTRACT, "TransferContract", options.Permission_id); -}; -const buildTransferAssetContract = (value, options) => { - const { to_address, owner_address, amount, asset_name } = value; - const transferContract = new TransferAssetContract(); - transferContract.setToAddress(fromHexString(to_address)); - transferContract.setOwnerAddress(fromHexString(owner_address)); - transferContract.setAssetName(flexToUint8Array(asset_name, options.visible)); - transferContract.setAmount(amount); - return buildCommonTransaction(transferContract, Transaction2.Contract.ContractType.TRANSFERASSETCONTRACT, "TransferAssetContract", options.Permission_id); -}; -const buildParticipateAssetIssueContract = (value, options) => { - const pbObj = new ParticipateAssetIssueContract(); - pbObj.setToAddress(fromHexString(value.to_address)); - pbObj.setOwnerAddress(fromHexString(value.owner_address)); - pbObj.setAssetName(flexToUint8Array(value.asset_name, options.visible)); - pbObj.setAmount(value.amount); - return buildCommonTransaction(pbObj, Transaction2.Contract.ContractType.PARTICIPATEASSETISSUECONTRACT, "ParticipateAssetIssueContract", options.Permission_id); -}; -const buildTriggerSmartContract = (value, options) => { - const triggerSmartContract = new TriggerSmartContract(); - const { owner_address, contract_address, parameter = "", function_selector, call_value, call_token_value, token_id, data } = value; - triggerSmartContract.setOwnerAddress(fromHexString(owner_address)); - triggerSmartContract.setContractAddress(fromHexString(contract_address)); - triggerSmartContract.setCallValue(call_value); - if (data) { - triggerSmartContract.setData(stringToUint8Array(data)); - } else if (function_selector) { - const contractData = sha3$1(function_selector).substring(2, 10) + parameter; - triggerSmartContract.setData(stringToUint8Array(contractData)); - } - if (token_id) { - triggerSmartContract.setTokenId(token_id); - } - if (call_token_value) { - triggerSmartContract.setCallTokenValue(call_token_value); - } - return buildCommonTransaction(triggerSmartContract, Transaction2.Contract.ContractType.TRIGGERSMARTCONTRACT, "TriggerSmartContract", options.Permission_id); -}; -const buildFreezeBalanceContract = (value, options) => { - const freezeBalanceContract = new FreezeBalanceContract(); - const { owner_address, frozen_balance, frozen_duration, resource, receiver_address } = value; - freezeBalanceContract.setOwnerAddress(fromHexString(owner_address)); - freezeBalanceContract.setFrozenBalance(frozen_balance); - freezeBalanceContract.setFrozenDuration(frozen_duration); - if (resource) { - freezeBalanceContract.setResource(ResourceCode$1[resource]); - } - if (receiver_address) { - freezeBalanceContract.setReceiverAddress(fromHexString(receiver_address)); - } - return buildCommonTransaction(freezeBalanceContract, Transaction2.Contract.ContractType.FREEZEBALANCECONTRACT, "FreezeBalanceContract", options.Permission_id); -}; -const buildUnfreezeBalanceContract = (value, options) => { - const unfreezeBalanceContract = new UnfreezeBalanceContract(); - const { owner_address, resource, receiver_address } = value; - unfreezeBalanceContract.setOwnerAddress(fromHexString(owner_address)); - if (resource) { - unfreezeBalanceContract.setResource(ResourceCode$1[resource]); - } - if (receiver_address) { - unfreezeBalanceContract.setReceiverAddress(fromHexString(receiver_address)); - } - return buildCommonTransaction(unfreezeBalanceContract, Transaction2.Contract.ContractType.UNFREEZEBALANCECONTRACT, "UnfreezeBalanceContract", options.Permission_id); -}; -const buildWithdrawBalanceContract = (value, options) => { - const withdrawbalanceContract = new WithdrawBalanceContract(); - const { owner_address } = value; - withdrawbalanceContract.setOwnerAddress(fromHexString(owner_address)); - return buildCommonTransaction(withdrawbalanceContract, Transaction2.Contract.ContractType.WITHDRAWBALANCECONTRACT, "WithdrawBalanceContract", options.Permission_id); -}; -const buildFreezeBalanceV2Contract = (value, options) => { - const freezeBalanceV2Contract = new FreezeBalanceV2Contract(); - const { owner_address, frozen_balance, resource } = value; - freezeBalanceV2Contract.setOwnerAddress(fromHexString(owner_address)); - freezeBalanceV2Contract.setFrozenBalance(frozen_balance); - freezeBalanceV2Contract.setResource(ResourceCode$1[resource]); - return buildCommonTransaction(freezeBalanceV2Contract, Transaction2.Contract.ContractType.FREEZEBALANCEV2CONTRACT, "FreezeBalanceV2Contract", options.Permission_id); -}; -const buildCancelFreezeBalanceV2Contract = (value, options) => { - const withdrawExpireUnfreeze = new WithdrawExpireUnfreezeContract(); - const { owner_address } = value; - withdrawExpireUnfreeze.setOwnerAddress(fromHexString(owner_address)); - return buildCommonTransaction(withdrawExpireUnfreeze, Transaction2.Contract.ContractType.CANCELALLUNFREEZEV2CONTRACT, "CancelAllUnfreezeV2Contract", options.Permission_id); -}; -const buildUnfreezeBalanceV2Contract = (value, options) => { - const unfreezeBalanceV2Contract = new UnfreezeBalanceV2Contract(); - const { owner_address, unfreeze_balance, resource } = value; - unfreezeBalanceV2Contract.setOwnerAddress(fromHexString(owner_address)); - unfreezeBalanceV2Contract.setUnfreezeBalance(unfreeze_balance); - unfreezeBalanceV2Contract.setResource(ResourceCode$1[resource]); - return buildCommonTransaction(unfreezeBalanceV2Contract, Transaction2.Contract.ContractType.UNFREEZEBALANCEV2CONTRACT, "UnfreezeBalanceV2Contract", options.Permission_id); -}; -const buildDelegateResourceContract = (value, options) => { - const delegateResourceContract = new DelegateResourceContract(); - const { owner_address, receiver_address, balance, resource, lock = false, lock_period } = value; - delegateResourceContract.setOwnerAddress(fromHexString(owner_address)); - delegateResourceContract.setBalance(balance); - delegateResourceContract.setResource(ResourceCode$1[resource]); - delegateResourceContract.setLock(lock); - delegateResourceContract.setLockPeriod(lock_period); - delegateResourceContract.setReceiverAddress(fromHexString(receiver_address)); - return buildCommonTransaction(delegateResourceContract, Transaction2.Contract.ContractType.DELEGATERESOURCECONTRACT, "DelegateResourceContract", options.Permission_id); -}; -const buildUnDelegateResourceContract = (value, options) => { - const unDelegateResourceContract = new UnDelegateResourceContract(); - const { owner_address, receiver_address, balance, resource } = value; - unDelegateResourceContract.setOwnerAddress(fromHexString(owner_address)); - unDelegateResourceContract.setBalance(balance); - unDelegateResourceContract.setResource(ResourceCode$1[resource]); - unDelegateResourceContract.setReceiverAddress(fromHexString(receiver_address)); - return buildCommonTransaction(unDelegateResourceContract, Transaction2.Contract.ContractType.UNDELEGATERESOURCECONTRACT, "UnDelegateResourceContract", options.Permission_id); -}; -const buildWithdrawExpireUnfreezeContract = (value, options) => { - const withdrawExpireUnfreeze = new WithdrawExpireUnfreezeContract(); - const { owner_address } = value; - withdrawExpireUnfreeze.setOwnerAddress(fromHexString(owner_address)); - return buildCommonTransaction(withdrawExpireUnfreeze, Transaction2.Contract.ContractType.WITHDRAWEXPIREUNFREEZECONTRACT, "WithdrawExpireUnfreezeContract", options.Permission_id); -}; -const buildCreateWitness = (value, options) => { - const createWitnessContract = new WitnessCreateContract(); - const { owner_address, url } = value; - createWitnessContract.setOwnerAddress(fromHexString(owner_address)); - createWitnessContract.setUrl(stringToUint8Array(url.replace(/^0x/, ""))); - return buildCommonTransaction(createWitnessContract, Transaction2.Contract.ContractType.WITNESSCREATECONTRACT, "WitnessCreateContract", options.Permission_id); -}; -const buildVoteWitnessAccount = (value, options) => { - const voteWitnessContract = new VoteWitnessContract(); - const { owner_address, votes } = value; - voteWitnessContract.setOwnerAddress(fromHexString(owner_address)); - votes.forEach((voteItem) => { - const vote = new VoteWitnessContract.Vote(); - const { vote_address, vote_count } = voteItem; - vote.setVoteAddress(fromHexString(vote_address)); - const numberOfVotes = parseInt(vote_count); - vote.setVoteCount(numberOfVotes); - voteWitnessContract.addVotes(vote); - }); - return buildCommonTransaction(voteWitnessContract, Transaction2.Contract.ContractType.VOTEWITNESSCONTRACT, "VoteWitnessContract", options.Permission_id); -}; -const buildCreateSmartContract = (value, options) => { - const params = (value == null ? void 0 : value.new_contract) ? { - ...{ - owner_address: value.owner_address, - call_token_value: value.call_token_value, - token_id: value.token_id - }, - ...value.new_contract - } : value; - const { owner_address, consume_user_resource_percent, origin_energy_limit, abi: abi2, bytecode = "", parameter = "", call_value, call_token_value, token_id, name: contracName } = params; - let { origin_address } = params; - const createSmartContract = new CreateSmartContract(); - createSmartContract.setOwnerAddress(fromHexString(owner_address)); - if (token_id) { - createSmartContract.setTokenId(token_id); - } - if (call_token_value) { - createSmartContract.setCallTokenValue(call_token_value); - } - const smartContractBuilder = new SmartContract(); - if (abi2) { - let abiJson; - if (typeof abi2 === "string") { - abiJson = JSON.parse(abi2); - } else { - abiJson = (abi2 == null ? void 0 : abi2.entrys) || []; - } - const abiBuilder = new SmartContract.ABI(); - const buildEntryParam = (data) => { - const param = new SmartContract.ABI.Entry.Param(); - const { indexed, name: name2, type: type2 } = data; - if (indexed === true) { - param.setIndexed(true); - } - param.setName(name2); - param.setType(type2); - return param; - }; - const entryBuilders = abiJson.map((entry) => { - const { anonymous, constant, name: name2, inputs, outputs, type: type2, payable, stateMutability } = entry; - const entryBuilder = new SmartContract.ABI.Entry(); - entryBuilder.setAnonymous(anonymous); - entryBuilder.setConstant(constant); - entryBuilder.setName(name2); - if (inputs) { - entryBuilder.setInputsList(inputs.map((input) => buildEntryParam(input))); - } - if (outputs) { - entryBuilder.setOutputsList(outputs.map((output2) => buildEntryParam(output2))); - } - if (type2) { - entryBuilder.setType(SmartContract.ABI.Entry.EntryType[type2.toUpperCase()]); - } - entryBuilder.setPayable(payable); - if (stateMutability) { - entryBuilder.setStatemutability(SmartContract.ABI.Entry.StateMutabilityType[stateMutability.toUpperCase()]); - } - return entryBuilder; - }); - abiBuilder.setEntrysList(entryBuilders); - smartContractBuilder.setAbi(abiBuilder); - } - if (call_value) { - smartContractBuilder.setCallValue(call_value); - } - smartContractBuilder.setConsumeUserResourcePercent(consume_user_resource_percent); - smartContractBuilder.setOriginEnergyLimit(origin_energy_limit); - if (!origin_address) { - origin_address = owner_address; - } - smartContractBuilder.setOriginAddress(fromHexString(origin_address)); - if (bytecode) { - const bytecodeParameter = bytecode.replace(/^0x/, "") + parameter.replace(/^0x/, ""); - smartContractBuilder.setBytecode(stringToUint8Array(bytecodeParameter)); - } - smartContractBuilder.setName(contracName); - createSmartContract.setNewContract(smartContractBuilder); - return buildCommonTransaction(createSmartContract, Transaction2.Contract.ContractType.CREATESMARTCONTRACT, "CreateSmartContract", options.Permission_id); -}; -const buildClearABIContract = (value, options) => { - const { contract_address, owner_address } = value; - const clearABIContract = new ClearABIContract(); - clearABIContract.setOwnerAddress(fromHexString(owner_address)); - clearABIContract.setContractAddress(fromHexString(contract_address)); - return buildCommonTransaction(clearABIContract, Transaction2.Contract.ContractType.CLEARABICONTRACT, "ClearABIContract", options.Permission_id); -}; -const buildUpdateBrokerageContract = (value, options) => { - const { brokerage, owner_address } = value; - const updateBrokerageContract = new UpdateBrokerageContract(); - updateBrokerageContract.setOwnerAddress(fromHexString(owner_address)); - updateBrokerageContract.setBrokerage(brokerage); - return buildCommonTransaction(updateBrokerageContract, Transaction2.Contract.ContractType.UPDATEBROKERAGECONTRACT, "UpdateBrokerageContract", options.Permission_id); -}; -const buildAssetIssueContract = (value, options) => { - const { owner_address, name: name2, abbr, description: description2, url, total_supply, trx_num, num, start_time, end_time, precision, free_asset_net_limit, public_free_asset_net_limit, public_free_asset_net_usage = 0, public_latest_free_net_time = 0, vote_score = 0, frozen_supply } = value; - const assetIssueContract = new AssetIssueContract(); - assetIssueContract.setOwnerAddress(fromHexString(owner_address)); - if (name2) { - assetIssueContract.setName(stringToUint8Array(name2.replace(/^0x/, ""))); - } - if (abbr) { - assetIssueContract.setAbbr(stringToUint8Array(abbr.replace(/^0x/, ""))); - } - assetIssueContract.setTotalSupply(total_supply); - assetIssueContract.setNum(num); - assetIssueContract.setEndTime(end_time); - assetIssueContract.setStartTime(start_time); - assetIssueContract.setTrxNum(trx_num); - assetIssueContract.setVoteScore(vote_score); - if (precision) { - assetIssueContract.setPrecision(precision); - } - if (public_latest_free_net_time) { - assetIssueContract.setPublicLatestFreeNetTime(public_latest_free_net_time); - } - if (description2) { - assetIssueContract.setDescription(stringToUint8Array(description2.replace(/^0x/, ""))); - } - if (url) { - assetIssueContract.setUrl(stringToUint8Array(url.replace(/^0x/, ""))); - } - assetIssueContract.setPublicFreeAssetNetUsage(public_free_asset_net_usage); - assetIssueContract.setFreeAssetNetLimit(free_asset_net_limit); - assetIssueContract.setPublicFreeAssetNetLimit(public_free_asset_net_limit); - if (frozen_supply) { - const frozenSupplyContract = new AssetIssueContract.FrozenSupply(); - frozenSupplyContract.setFrozenAmount(frozen_supply.length ? frozen_supply[0].frozen_amount : frozen_supply.frozen_amount); - frozenSupplyContract.setFrozenDays(frozen_supply.length ? frozen_supply[0].frozen_days : frozen_supply.frozen_days); - assetIssueContract.addFrozenSupply(frozenSupplyContract); - } - return buildCommonTransaction(assetIssueContract, Transaction2.Contract.ContractType.ASSETISSUECONTRACT, "AssetIssueContract", options.Permission_id); -}; -const buildAccountCreateContract = (value, options) => { - const accountCreateContract = new AccountCreateContract(); - const { account_address, owner_address } = value; - accountCreateContract.setOwnerAddress(fromHexString(owner_address)); - accountCreateContract.setAccountAddress(fromHexString(account_address.replace(/^0x/, ""))); - return buildCommonTransaction(accountCreateContract, Transaction2.Contract.ContractType.ACCOUNTCREATECONTRACT, "AccountCreateContract", options.Permission_id); -}; -const buildAccountUpdateContract = (value, options) => { - const accountUpdateContract = new AccountUpdateContract(); - const { account_name, owner_address } = value; - accountUpdateContract.setOwnerAddress(fromHexString(owner_address)); - accountUpdateContract.setAccountName(stringToUint8Array(account_name.replace(/^0x/, ""))); - return buildCommonTransaction(accountUpdateContract, Transaction2.Contract.ContractType.ACCOUNTUPDATECONTRACT, "AccountUpdateContract", options.Permission_id); -}; -const buildSetAccountIdContract = (value, options) => { - const setAccountIdContract = new SetAccountIdContract(); - const { account_id, owner_address } = value; - setAccountIdContract.setOwnerAddress(fromHexString(owner_address)); - setAccountIdContract.setAccountId(stringToUint8Array(account_id.replace(/^0x/, ""))); - return buildCommonTransaction(setAccountIdContract, Transaction2.Contract.ContractType.SETACCOUNTIDCONTRACT, "SetAccountIdContract", options.Permission_id); -}; -const buildProposalCreateContract = (value, options) => { - const proposalCreateContract = new ProposalCreateContract(); - const { owner_address, parameters } = value; - proposalCreateContract.setOwnerAddress(fromHexString(owner_address)); - parameters.forEach((parameter) => { - proposalCreateContract.getParametersMap().set(parameter.key, parameter.value); - }); - return buildCommonTransaction(proposalCreateContract, Transaction2.Contract.ContractType.PROPOSALCREATECONTRACT, "ProposalCreateContract", options.Permission_id); -}; -const buildProposalDeleteContract = (value, options) => { - const proposalDeleteContract = new ProposalDeleteContract(); - const { owner_address, proposal_id } = value; - proposalDeleteContract.setOwnerAddress(fromHexString(owner_address)); - proposalDeleteContract.setProposalId(proposal_id); - return buildCommonTransaction(proposalDeleteContract, Transaction2.Contract.ContractType.PROPOSALDELETECONTRACT, "ProposalDeleteContract", options.Permission_id); -}; -const buildVoteProposalContract = (value, options) => { - const proposalVoteContract = new ProposalApproveContract(); - const { owner_address, proposal_id, is_add_approval } = value; - proposalVoteContract.setOwnerAddress(fromHexString(owner_address)); - proposalVoteContract.setProposalId(proposal_id); - proposalVoteContract.setIsAddApproval(is_add_approval); - return buildCommonTransaction(proposalVoteContract, Transaction2.Contract.ContractType.PROPOSALAPPROVECONTRACT, "ProposalApproveContract", options.Permission_id); -}; -const buildExchangeCreateContract = (value, options) => { - const exchangeCreateContract = new ExchangeCreateContract(); - const { owner_address, first_token_id, first_token_balance, second_token_id, second_token_balance } = value; - exchangeCreateContract.setOwnerAddress(fromHexString(owner_address)); - exchangeCreateContract.setFirstTokenId(flexToUint8Array(first_token_id, options.visible)); - exchangeCreateContract.setFirstTokenBalance(first_token_balance); - exchangeCreateContract.setSecondTokenId(flexToUint8Array(second_token_id, options.visible)); - exchangeCreateContract.setSecondTokenBalance(second_token_balance); - return buildCommonTransaction(exchangeCreateContract, Transaction2.Contract.ContractType.EXCHANGECREATECONTRACT, "ExchangeCreateContract", options.Permission_id); -}; -const buildExchangeInjectContract = (value, options) => { - const exchangeInjectContract = new ExchangeInjectContract(); - const { owner_address, exchange_id, token_id, quant } = value; - exchangeInjectContract.setOwnerAddress(fromHexString(owner_address)); - exchangeInjectContract.setExchangeId(exchange_id); - exchangeInjectContract.setTokenId(flexToUint8Array(token_id, options.visible)); - exchangeInjectContract.setQuant(quant); - return buildCommonTransaction(exchangeInjectContract, Transaction2.Contract.ContractType.EXCHANGEINJECTCONTRACT, "ExchangeInjectContract", options.Permission_id); -}; -const buildExchangeWithdrawContract = (value, options) => { - const exchangeWithdrawContract = new ExchangeWithdrawContract(); - const { owner_address, exchange_id, token_id, quant } = value; - exchangeWithdrawContract.setOwnerAddress(fromHexString(owner_address)); - exchangeWithdrawContract.setExchangeId(exchange_id); - exchangeWithdrawContract.setTokenId(flexToUint8Array(token_id, options.visible)); - exchangeWithdrawContract.setQuant(quant); - return buildCommonTransaction(exchangeWithdrawContract, Transaction2.Contract.ContractType.EXCHANGEWITHDRAWCONTRACT, "ExchangeWithdrawContract", options.Permission_id); -}; -const buildExchangeTransactionContract = (value, options) => { - const exchangeTransactionContract = new ExchangeTransactionContract(); - const { owner_address, exchange_id, token_id, quant, expected } = value; - exchangeTransactionContract.setOwnerAddress(fromHexString(owner_address)); - exchangeTransactionContract.setExchangeId(exchange_id); - exchangeTransactionContract.setTokenId(flexToUint8Array(token_id, options.visible)); - exchangeTransactionContract.setQuant(quant); - exchangeTransactionContract.setExpected(expected); - return buildCommonTransaction(exchangeTransactionContract, Transaction2.Contract.ContractType.EXCHANGETRANSACTIONCONTRACT, "ExchangeTransactionContract", options.Permission_id); -}; -const buildUpdateSettingContract = (value, options) => { - const updateSettingContract = new UpdateSettingContract(); - const { owner_address, contract_address, consume_user_resource_percent } = value; - updateSettingContract.setOwnerAddress(fromHexString(owner_address)); - updateSettingContract.setContractAddress(fromHexString(contract_address)); - updateSettingContract.setConsumeUserResourcePercent(consume_user_resource_percent); - return buildCommonTransaction(updateSettingContract, Transaction2.Contract.ContractType.UPDATESETTINGCONTRACT, "UpdateSettingContract", options.Permission_id); -}; -const buildUpdateEnergyLimitContract = (value, options) => { - const updateEnergyLimitContract = new UpdateEnergyLimitContract(); - const { owner_address, contract_address, origin_energy_limit } = value; - updateEnergyLimitContract.setOwnerAddress(fromHexString(owner_address)); - updateEnergyLimitContract.setContractAddress(fromHexString(contract_address)); - updateEnergyLimitContract.setOriginEnergyLimit(origin_energy_limit); - return buildCommonTransaction(updateEnergyLimitContract, Transaction2.Contract.ContractType.UPDATEENERGYLIMITCONTRACT, "UpdateEnergyLimitContract", options.Permission_id); -}; -const buildAccountPermissionUpdateContract = (value, options) => { - const accountPermissionUpdateContract = new AccountPermissionUpdateContract(); - const { owner_address, owner, witness, actives } = value; - accountPermissionUpdateContract.setOwnerAddress(fromHexString(owner_address)); - const getType = (type2) => { - if (isNaN(type2)) - return type2 === "Active" ? 2 : type2 === "Witness" ? 1 : 0; - return type2; - }; - const buildPermission = (data) => { - const permission = new Permission(); - const { type: type2, id: id2, permission_name, threshold, parentId, operations, keys: keys2 } = data; - permission.setType(getType(type2)); - permission.setId(id2); - permission.setPermissionName(permission_name); - permission.setThreshold(threshold); - if (parentId) { - permission.setParentId(parentId); - } - if (operations) { - permission.setOperations(stringToUint8Array(operations)); - } - if (keys2) { - permission.setKeysList(keys2.map((key2) => { - const keyBuilder = new Key(); - keyBuilder.setAddress(fromHexString(key2.address)); - keyBuilder.setWeight(key2.weight); - return keyBuilder; - })); - } - return permission; - }; - if (owner) { - accountPermissionUpdateContract.setOwner(buildPermission(owner)); - } - if (witness) { - accountPermissionUpdateContract.setWitness(buildPermission(witness)); - } - if (actives) { - if (Array.isArray(actives)) { - accountPermissionUpdateContract.setActivesList(actives.map((active) => buildPermission(active))); - } else { - accountPermissionUpdateContract.setActivesList([buildPermission(actives)]); - } - } - return buildCommonTransaction(accountPermissionUpdateContract, Transaction2.Contract.ContractType.ACCOUNTPERMISSIONUPDATECONTRACT, "AccountPermissionUpdateContract", options.Permission_id); -}; -const buildUpdateAssetContract = (value, options) => { - const updateAssetContract = new UpdateAssetContract(); - const { owner_address, description: description2, url, new_limit, new_public_limit } = value; - updateAssetContract.setOwnerAddress(fromHexString(owner_address)); - if (description2) { - updateAssetContract.setDescription(stringToUint8Array(description2.replace(/^0x/, ""))); - } - if (url) { - updateAssetContract.setUrl(stringToUint8Array(url.replace(/^0x/, ""))); - } - if (new_limit) { - updateAssetContract.setNewLimit(new_limit); - } - if (new_public_limit) { - updateAssetContract.setNewPublicLimit(new_public_limit); - } - return buildCommonTransaction(updateAssetContract, Transaction2.Contract.ContractType.UPDATEASSETCONTRACT, "UpdateAssetContract", options.Permission_id); -}; -const contractJsonToProtobuf = (contract, value, options) => { - switch (contract.type) { - case "TransferContract": - return buildTransferContract(value, options); - case "TransferAssetContract": - return buildTransferAssetContract(value, options); - case "ParticipateAssetIssueContract": - return buildParticipateAssetIssueContract(value, options); - case "TriggerSmartContract": - return buildTriggerSmartContract(value, options); - case "FreezeBalanceContract": - return buildFreezeBalanceContract(value, options); - case "UnfreezeBalanceContract": - return buildUnfreezeBalanceContract(value, options); - case "WithdrawBalanceContract": - return buildWithdrawBalanceContract(value, options); - case "FreezeBalanceV2Contract": - return buildFreezeBalanceV2Contract(value, options); - case "CancelAllUnfreezeV2Contract": - return buildCancelFreezeBalanceV2Contract(value, options); - case "UnfreezeBalanceV2Contract": - return buildUnfreezeBalanceV2Contract(value, options); - case "DelegateResourceContract": - return buildDelegateResourceContract(value, options); - case "UnDelegateResourceContract": - return buildUnDelegateResourceContract(value, options); - case "WithdrawExpireUnfreezeContract": - return buildWithdrawExpireUnfreezeContract(value, options); - case "WitnessCreateContract": - return buildCreateWitness(value, options); - case "VoteWitnessContract": - return buildVoteWitnessAccount(value, options); - case "CreateSmartContract": - return buildCreateSmartContract(value, options); - case "ClearABIContract": - return buildClearABIContract(value, options); - case "UpdateBrokerageContract": - return buildUpdateBrokerageContract(value, options); - case "AssetIssueContract": - return buildAssetIssueContract(value, options); - case "AccountCreateContract": - return buildAccountCreateContract(value, options); - case "AccountUpdateContract": - return buildAccountUpdateContract(value, options); - case "SetAccountIdContract": - return buildSetAccountIdContract(value, options); - case "ProposalCreateContract": - return buildProposalCreateContract(value, options); - case "ProposalDeleteContract": - return buildProposalDeleteContract(value, options); - case "ProposalApproveContract": - return buildVoteProposalContract(value, options); - case "ExchangeCreateContract": - return buildExchangeCreateContract(value, options); - case "ExchangeInjectContract": - return buildExchangeInjectContract(value, options); - case "ExchangeWithdrawContract": - return buildExchangeWithdrawContract(value, options); - case "ExchangeTransactionContract": - return buildExchangeTransactionContract(value, options); - case "UpdateSettingContract": - return buildUpdateSettingContract(value, options); - case "UpdateEnergyLimitContract": - return buildUpdateEnergyLimitContract(value, options); - case "AccountPermissionUpdateContract": - return buildAccountPermissionUpdateContract(value, options); - case "UpdateAssetContract": - return buildUpdateAssetContract(value, options); - } -}; -const txJsonToPb = (transaction2) => { - const rawData = transaction2["raw_data"]; - const contractJson = rawData.contract[0]; - const data = contractJson.parameter.value; - const options = { Permission_id: contractJson.Permission_id, visible: transaction2.visible }; - const transactionObj = contractJsonToProtobuf(contractJson, data, options); - const rawDataObj = transactionObj.getRawData(); - rawDataObj.setRefBlockBytes(stringToUint8Array(rawData.ref_block_bytes)); - rawDataObj.setRefBlockHash(stringToUint8Array(rawData.ref_block_hash)); - if (rawData.data) { - rawDataObj.setData(stringToUint8Array(rawData.data)); - } - if (rawData.fee_limit) { - rawDataObj.setFeeLimit(rawData.fee_limit); - } - if (rawData.expiration) { - rawDataObj.setExpiration(rawData.expiration); - } - if (rawData.timestamp) { - rawDataObj.setTimestamp(rawData.timestamp); - } - transactionObj.setRawData(rawDataObj); - return transactionObj; -}; -const txJsonToPbWithArgs = (transaction2, args = {}, options = {}) => { - const rawData = transaction2["raw_data"]; - const contractJson = rawData.contract[0]; - const transactionObj = contractJsonToProtobuf(contractJson, args, { - Permission_id: args == null ? void 0 : args.Permission_id - }); - const rawDataObj = transactionObj.getRawData(); - rawDataObj.setRefBlockBytes(stringToUint8Array(rawData.ref_block_bytes)); - rawDataObj.setRefBlockHash(stringToUint8Array(rawData.ref_block_hash)); - if (options.data) { - rawDataObj.setData(stringToUint8Array(options.data.replace(/^0x/, ""))); - } - if (options.fee_limit || args.fee_limit) { - rawDataObj.setFeeLimit(options.fee_limit || args.fee_limit); - } - if (rawData.expiration) { - rawDataObj.setExpiration(rawData.expiration); - } - if (rawData.timestamp) { - rawDataObj.setTimestamp(rawData.timestamp); - } - transactionObj.setRawData(rawDataObj); - return transactionObj; -}; -const compareTransaction = (transaction2, transactionPb) => { - const rawDataBytes = transactionPb.getRawData().serializeBinary(); - const rawDataHex = byteArray2hexStr(rawDataBytes); - const txID = sha256$1(rawDataBytes); - return rawDataHex.toLowerCase() === transaction2.raw_data_hex.toLowerCase() && txID.replace(/^0x/, "").toLowerCase() === transaction2.txID.replace(/^0x/, "").toLowerCase(); -}; -const txPbToRawDataHex = (pb2) => { - return byteArray2hexStr(pb2.getRawData().serializeBinary()); -}; -const txCheck = (transaction2) => { - const transactionPb = txJsonToPb(transaction2); - return compareTransaction(transaction2, transactionPb); -}; -const txCheckWithArgs = (transaction2, args, options) => { - const transactionPb = txJsonToPbWithArgs(transaction2, args, options); - return compareTransaction(transaction2, transactionPb); -}; -const txPbToTxID = (transactionPb) => { - const rawDataBytes = transactionPb.getRawData().serializeBinary(); - const txID = sha256$1(rawDataBytes); - return txID; -}; -const transaction = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - txCheck, - txCheckWithArgs, - txJsonToPb, - txJsonToPbWithArgs, - txPbToRawDataHex, - txPbToTxID -}, Symbol.toStringTag, { value: "Module" })); -function fromUtf8(value) { - return TronWeb.fromUtf8(value).replace(/^0x/, ""); -} -function deepCopyJson(json) { - return JSON.parse(JSON.stringify(json)); -} -function resultManager(transaction2, data, options) { - if (transaction2.Error) - throw new Error(transaction2.Error); - if (transaction2.result && transaction2.result.message) { - throw new Error(TronWeb.toUtf8(transaction2.result.message)); - } - const authResult = txCheckWithArgs(transaction2, data, options); - if (authResult) { - return transaction2; - } - throw new Error("Invalid transaction"); -} -function resultManagerTriggerSmartContract(transaction2, data, options) { - if (transaction2.Error) - throw new Error(transaction2.Error); - if (transaction2.result && transaction2.result.message) { - throw new Error(TronWeb.toUtf8(transaction2.result.message)); - } - if (!(options._isConstant || options.estimateEnergy)) { - const authResult = txCheckWithArgs(transaction2.transaction, data, options); - if (authResult) { - return transaction2; - } - throw new Error("Invalid transaction"); - } - return transaction2; -} -function genContractAddress(ownerAddress, txID) { - return "41" + keccak256(Buffer.from(txID + ownerAddress, "hex")).toString().substring(2).slice(24); -} -function getHeaderInfo(node2) { - return node2.request("wallet/getblock", { detail: false }, "post").then((data) => { - return { - ref_block_bytes: data.block_header.raw_data.number.toString(16).slice(-4).padStart(4, "0"), - ref_block_hash: data.blockID.slice(16, 32), - expiration: data.block_header.raw_data.timestamp + 60 * 1e3, - timestamp: data.block_header.raw_data.timestamp - }; - }); -} -function checkBlockHeader(options = {}) { - if (typeof options["ref_block_bytes"] === "undefined" && typeof options["ref_block_hash"] === "undefined" && typeof options["expiration"] === "undefined" && typeof options["timestamp"] === "undefined") { - return false; - } - if (typeof options["ref_block_bytes"] !== "string") { - throw new Error("Invalid ref_block_bytes provided."); - } - if (typeof options["ref_block_hash"] !== "string") { - throw new Error("Invalid ref_block_hash provided."); - } - if (typeof options["expiration"] !== "number") { - throw new Error("Invalid expiration provided."); - } - if (typeof options["timestamp"] !== "number") { - throw new Error("Invalid timestamp provided."); - } - return true; -} -async function createTransaction(tronWeb, type2, value, Permission_id, options = {}) { - const tx = { - visible: false, - txID: "", - raw_data_hex: "", - raw_data: { - contract: [ - { - parameter: { - value, - type_url: `type.googleapis.com/protocol.${type2}` - }, - type: type2 - } - ], - ...checkBlockHeader(options) ? {} : await getHeaderInfo(tronWeb.fullNode), - ...options - } - }; - if (Permission_id) { - tx.raw_data.contract[0].Permission_id = Permission_id; - } - const pb2 = txJsonToPb(tx); - tx.txID = txPbToTxID(pb2).replace(/^0x/, ""); - tx.raw_data_hex = txPbToRawDataHex(pb2).toLowerCase(); - return tx; -} -function getTransactionOptions(options = {}) { - const ret = {}; - if (checkBlockHeader(options.blockHeader)) { - ret["ref_block_bytes"] = options.blockHeader["ref_block_bytes"]; - ret["ref_block_hash"] = options.blockHeader["ref_block_hash"]; - ret["expiration"] = options.blockHeader["expiration"]; - ret["timestamp"] = options.blockHeader["timestamp"]; - } - return ret; -} -class TransactionBuilder { - constructor(tronWeb) { - __publicField(this, "tronWeb"); - __publicField(this, "validator"); - if (!tronWeb || !(tronWeb instanceof TronWeb)) { - throw new Error("Expected instance of TronWeb"); - } - this.tronWeb = tronWeb; - this.validator = new Validator(); - } - async sendTrx(to2, amount = 0, from2 = this.tronWeb.defaultAddress.hex, options = {}) { - amount = parseInt(amount); - this.validator.notValid([ - { - name: "recipient", - type: "address", - value: to2 - }, - { - name: "origin", - type: "address", - value: from2 - }, - { - names: ["recipient", "origin"], - type: "notEqual", - msg: "Cannot transfer TRX to the same account" - }, - { - name: "amount", - type: "integer", - gt: 0, - value: amount - } - ]); - const data = { - to_address: toHex$1(to2), - owner_address: toHex$1(from2), - amount - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.TransferContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async sendToken(to2, amount = 0, tokenId, from2 = this.tronWeb.defaultAddress.hex, options = {}) { - amount = parseInt(amount); - this.validator.notValid([ - { - name: "recipient", - type: "address", - value: to2 - }, - { - name: "origin", - type: "address", - value: from2 - }, - { - names: ["recipient", "origin"], - type: "notEqual", - msg: "Cannot transfer tokens to the same account" - }, - { - name: "amount", - type: "integer", - gt: 0, - value: amount - }, - { - name: "token ID", - type: "tokenId", - value: tokenId - } - ]); - const data = { - to_address: toHex$1(to2), - owner_address: toHex$1(from2), - asset_name: fromUtf8(tokenId), - amount - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.TransferAssetContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async purchaseToken(issuerAddress, tokenId, amount = 0, buyer = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "buyer", - type: "address", - value: buyer - }, - { - name: "issuer", - type: "address", - value: issuerAddress - }, - { - names: ["buyer", "issuer"], - type: "notEqual", - msg: "Cannot purchase tokens from same account" - }, - { - name: "amount", - type: "integer", - gt: 0, - value: amount - }, - { - name: "token ID", - type: "tokenId", - value: tokenId - } - ]); - const data = { - to_address: toHex$1(issuerAddress), - owner_address: toHex$1(buyer), - asset_name: fromUtf8(tokenId), - amount: parseInt(amount) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ParticipateAssetIssueContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async freezeBalance(amount = 0, duration = 3, resource = "BANDWIDTH", ownerAddress = this.tronWeb.defaultAddress.hex, receiverAddress, options = {}) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: ownerAddress - }, - { - name: "receiver", - type: "address", - value: receiverAddress, - optional: true - }, - { - name: "amount", - type: "integer", - gt: 0, - value: amount - }, - { - name: "duration", - type: "integer", - gte: 3, - value: duration - }, - { - name: "resource", - type: "resource", - value: resource, - msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' - } - ]); - const data = { - owner_address: toHex$1(ownerAddress), - frozen_balance: parseInt(amount), - frozen_duration: parseInt(String(duration)) - }; - if (resource !== "BANDWIDTH") { - data.resource = resource; - } - if (isNotNullOrUndefined(receiverAddress) && toHex$1(receiverAddress) !== toHex$1(ownerAddress)) { - data.receiver_address = toHex$1(receiverAddress); - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.FreezeBalanceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async unfreezeBalance(resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, receiverAddress, options = {}) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - }, - { - name: "receiver", - type: "address", - value: receiverAddress, - optional: true - }, - { - name: "resource", - type: "resource", - value: resource, - msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' - } - ]); - const data = { - owner_address: toHex$1(address2) - }; - if (resource !== "BANDWIDTH") { - data.resource = resource; - } - if (isNotNullOrUndefined(receiverAddress) && toHex$1(receiverAddress) !== toHex$1(address2)) { - data.receiver_address = toHex$1(receiverAddress); - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.UnfreezeBalanceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async freezeBalanceV2(amount = 0, resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - }, - { - name: "amount", - type: "integer", - gt: 0, - value: amount - }, - { - name: "resource", - type: "resource", - value: resource, - msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' - } - ]); - const data = { - owner_address: toHex$1(address2), - frozen_balance: parseInt(amount) - }; - if (resource !== "BANDWIDTH") { - data.resource = resource; - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.FreezeBalanceV2Contract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async unfreezeBalanceV2(amount = 0, resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - }, - { - name: "amount", - type: "integer", - gt: 0, - value: amount - }, - { - name: "resource", - type: "resource", - value: resource, - msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' - } - ]); - const data = { - owner_address: toHex$1(address2), - unfreeze_balance: parseInt(amount) - }; - if (resource !== "BANDWIDTH") { - data.resource = resource; - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.UnfreezeBalanceV2Contract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async cancelUnfreezeBalanceV2(address2 = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - } - ]); - const data = { - owner_address: toHex$1(address2) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.CancelAllUnfreezeV2Contract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async delegateResource(amount = 0, receiverAddress, resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, lock = false, lockPeriod, options = {}) { - this.validator.notValid([ - { - name: "amount", - type: "integer", - gt: 0, - value: amount - }, - { - name: "resource", - type: "resource", - value: resource, - msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' - }, - { - name: "receiver", - type: "address", - value: receiverAddress - }, - { - name: "origin", - type: "address", - value: address2 - }, - { - name: "lock", - type: "boolean", - value: lock - }, - { - name: "lock period", - type: "integer", - gte: 0, - value: lockPeriod, - optional: true - } - ]); - if (toHex$1(receiverAddress) === toHex$1(address2)) { - throw new Error("Receiver address must not be the same as owner address"); - } - const data = { - owner_address: toHex$1(address2), - receiver_address: toHex$1(receiverAddress), - balance: parseInt(amount) - }; - if (resource !== "BANDWIDTH") { - data.resource = resource; - } - if (lock) { - data.lock = lock; - if (isNotNullOrUndefined(lockPeriod)) { - data.lock_period = lockPeriod; - } - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.DelegateResourceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async undelegateResource(amount = 0, receiverAddress, resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - }, - { - name: "receiver", - type: "address", - value: receiverAddress - }, - { - name: "amount", - type: "integer", - gt: 0, - value: amount - }, - { - name: "resource", - type: "resource", - value: resource, - msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' - } - ]); - if (toHex$1(receiverAddress) === toHex$1(address2)) { - throw new Error("Receiver address must not be the same as owner address"); - } - const data = { - owner_address: toHex$1(address2), - receiver_address: toHex$1(receiverAddress), - balance: parseInt(amount) - }; - if (resource !== "BANDWIDTH") { - data.resource = resource; - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.UnDelegateResourceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async withdrawExpireUnfreeze(address2 = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - } - ]); - const data = { - owner_address: toHex$1(address2) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.WithdrawExpireUnfreezeContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async withdrawBlockRewards(address2 = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - } - ]); - const data = { - owner_address: toHex$1(address2) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.WithdrawBalanceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async applyForSR(address2 = this.tronWeb.defaultAddress.hex, url = "", options = {}) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - }, - { - name: "url", - type: "url", - value: url, - msg: "Invalid url provided" - }, - { - name: "url", - type: "string", - value: url, - lte: 256, - msg: "Invalid url provided" - } - ]); - const data = { - owner_address: toHex$1(address2), - url: fromUtf8(url) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.WitnessCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async vote(votes = {}, voterAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "voter", - type: "address", - value: voterAddress - }, - { - name: "votes", - type: "notEmptyObject", - value: votes - } - ]); - const entries = Object.entries(votes); - for (const [srAddress, voteCount] of entries) { - this.validator.notValid([ - { - name: "SR", - type: "address", - value: srAddress - }, - { - name: "vote count", - type: "integer", - gt: 0, - value: voteCount, - msg: "Invalid vote count provided for SR: " + srAddress - } - ]); - } - const voteList = entries.map(([srAddress, voteCount]) => { - return { - vote_address: toHex$1(srAddress), - vote_count: parseInt(voteCount) - }; - }); - const data = { - owner_address: toHex$1(voterAddress), - votes: voteList - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.VoteWitnessContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async createSmartContract(options = {}, issuerAddress = this.tronWeb.defaultAddress.hex) { - var _a3; - const feeLimit = options.feeLimit || this.tronWeb.feeLimit; - let userFeePercentage = options.userFeePercentage; - if (typeof userFeePercentage !== "number" && !userFeePercentage) { - userFeePercentage = 100; - } - const originEnergyLimit = options.originEnergyLimit || 1e7; - const callValue = options.callValue || 0; - const tokenValue = options.tokenValue; - const tokenId = options.tokenId || options.token_id; - let { abi: abi2 } = options; - const { parameters = [] } = options; - let parameter = ""; - const { bytecode = false, name: name2 = "" } = options; - if (abi2 && isString$1(abi2)) { - try { - abi2 = JSON.parse(abi2); - } catch { - throw new Error("Invalid options.abi provided"); - } - } - const newAbi = abi2; - let entries = newAbi; - if (newAbi.entrys) { - entries = newAbi.entrys; - } - if (!isArray$1(entries)) - throw new Error("Invalid options.abi provided"); - const payable = entries.some((func) => { - return func.type === "constructor" && "payable" === func.stateMutability.toLowerCase(); - }); - this.validator.notValid([ - { - name: "bytecode", - type: "hex", - value: bytecode - }, - { - name: "feeLimit", - type: "integer", - value: feeLimit, - gt: 0 - }, - { - name: "callValue", - type: "integer", - value: callValue, - gte: 0 - }, - { - name: "userFeePercentage", - type: "integer", - value: userFeePercentage, - gte: 0, - lte: 100 - }, - { - name: "originEnergyLimit", - type: "integer", - value: originEnergyLimit, - gte: 0, - lte: 1e7 - }, - { - name: "parameters", - type: "array", - value: parameters - }, - { - name: "issuer", - type: "address", - value: issuerAddress - }, - { - name: "tokenValue", - type: "integer", - value: tokenValue, - gte: 0, - optional: true - }, - { - name: "tokenId", - type: "integer", - value: tokenId, - gte: 0, - optional: true - } - ]); - if (!payable && (callValue > 0 || tokenValue > 0)) - throw new Error("When contract is not payable, options.callValue and options.tokenValue must be 0"); - const { rawParameter, funcABIV2, parametersV2 } = options; - if (rawParameter && isString$1(rawParameter)) { - parameter = rawParameter.replace(/^(0x)/, ""); - } else if (funcABIV2) { - parameter = encodeParamsV2ByABI(funcABIV2, parametersV2).replace(/^(0x)/, ""); - } else { - let constructorParams = entries.find((it2) => { - return it2.type === "constructor"; - }); - if (typeof constructorParams !== "undefined" && constructorParams) { - const abiCoder2 = new AbiCoder(); - const types2 = []; - const values = []; - constructorParams = constructorParams.inputs; - if (parameters.length != constructorParams.length) - throw new Error(`constructor needs ${constructorParams.length} but ${parameters.length} provided`); - for (let i3 = 0; i3 < parameters.length; i3++) { - let type2 = constructorParams[i3].type; - let value = parameters[i3]; - if (!type2 || !isString$1(type2) || !type2.length) - throw new Error("Invalid parameter type provided: " + type2); - const replaceAddressPrefix = (value2) => { - if (isArray$1(value2)) { - return value2.map((v6) => replaceAddressPrefix(v6)); - } - return toHex$1(value2).replace(ADDRESS_PREFIX_REGEX, "0x"); - }; - if (type2 === "address") - value = replaceAddressPrefix(value); - else if (((_a3 = type2.match(/^([^\x5b]*)(\x5b|$)/)) == null ? void 0 : _a3[0]) === "address[") - value = replaceAddressPrefix(value); - else if (/trcToken/.test(type2)) { - type2 = type2.replace(/trcToken/, "uint256"); - } - types2.push(type2); - values.push(value); - } - try { - parameter = abiCoder2.encode(types2, values).replace(/^(0x)/, ""); - } catch (ex2) { - throw new Error(ex2); - } - } else { - parameter = ""; - } - } - const args = { - owner_address: toHex$1(issuerAddress), - fee_limit: parseInt(feeLimit), - call_value: parseInt(callValue), - consume_user_resource_percent: userFeePercentage, - origin_energy_limit: originEnergyLimit, - abi: JSON.stringify(abi2), - bytecode, - parameter, - name: name2 - }; - if (isNotNullOrUndefined(tokenValue)) { - args.call_token_value = parseInt(tokenValue); - } - if (isNotNullOrUndefined(tokenId)) { - args.token_id = parseInt(tokenId); - } - const contract = {}; - contract.owner_address = args.owner_address; - if (isNotNullOrUndefined(args.call_token_value)) { - contract.call_token_value = args.call_token_value; - } - if (isNotNullOrUndefined(args.token_id)) { - contract.token_id = args.token_id; - } - const new_contract = contract.new_contract = {}; - if (args.abi) { - new_contract.abi = { - entrys: JSON.parse(args.abi) - }; - } else { - new_contract.abi = {}; - } - if (args.call_value) { - new_contract.call_value = args.call_value; - } - new_contract.consume_user_resource_percent = args.consume_user_resource_percent; - new_contract.origin_energy_limit = args.origin_energy_limit; - new_contract.origin_address = args.origin_address ?? args.owner_address; - if (args.bytecode + args.parameter) { - new_contract.bytecode = (args.bytecode + args.parameter).replace(/^0x/, ""); - } - if (isNotNullOrUndefined(args.name)) { - new_contract.name = args.name; - } - const transactionOptions = getTransactionOptions(options); - const tx = await createTransaction(this.tronWeb, ContractType.CreateSmartContract, contract, options == null ? void 0 : options.permissionId, { - ...transactionOptions, - fee_limit: args.fee_limit - }); - tx.contract_address = genContractAddress(args.owner_address, tx.txID); - return tx; - } - async triggerSmartContract(contractAddress, functionSelector, options, parameters, issuerAddress) { - var _a3; - const params = [ - contractAddress, - functionSelector, - options, - parameters, - issuerAddress - ]; - if (typeof params[2] !== "object") { - params[2] = { - feeLimit: params[2], - callValue: params[3] - }; - params.splice(3, 1); - } - if ((_a3 = params[2]) == null ? void 0 : _a3.txLocal) { - return this._triggerSmartContractLocal(...params); - } - return this._triggerSmartContract(...params); - } - async triggerConstantContract(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { - options._isConstant = true; - return this._triggerSmartContract(contractAddress, functionSelector, options, parameters, issuerAddress); - } - async triggerConfirmedConstantContract(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { - options._isConstant = true; - options.confirmed = true; - return this._triggerSmartContract(contractAddress, functionSelector, options, parameters, issuerAddress); - } - async estimateEnergy(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { - options.estimateEnergy = true; - const result = await this._triggerSmartContract(contractAddress, functionSelector, options, parameters, issuerAddress); - return result; - } - async deployConstantContract(options = { input: "", ownerAddress: "" }) { - const { input, ownerAddress, tokenId, tokenValue, callValue = 0 } = options; - this.validator.notValid([ - { - name: "input", - type: "not-empty-string", - value: input - }, - { - name: "callValue", - type: "integer", - value: callValue, - gte: 0 - }, - { - name: "owner", - type: "address", - value: ownerAddress - }, - { - name: "tokenValue", - type: "integer", - value: tokenValue, - gte: 0, - optional: true - }, - { - name: "tokenId", - type: "integer", - value: tokenId, - gte: 0, - optional: true - } - ]); - const args = { - data: input, - owner_address: toHex$1(ownerAddress), - call_value: callValue - }; - if (tokenId) { - args.token_id = tokenId; - } - if (tokenValue) { - args.call_token_value = tokenValue; - } - const pathInfo = `wallet${options.confirmed ? "solidity" : ""}/estimateenergy`; - const transaction2 = await this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(pathInfo, args, "post"); - if (transaction2.Error) - throw new Error(transaction2.Error); - if (transaction2.result && transaction2.result.message) { - throw new Error(this.tronWeb.toUtf8(transaction2.result.message)); - } - return transaction2; - } - _getTriggerSmartContractArgs(contractAddress, functionSelector, options, parameters, issuerAddress, tokenValue, tokenId, callValue, feeLimit) { - var _a3; - const args = { - contract_address: toHex$1(contractAddress), - owner_address: toHex$1(issuerAddress) - }; - if (functionSelector && isString$1(functionSelector)) { - functionSelector = functionSelector.replace(/\s*/g, ""); - let parameterStr; - if (parameters.length) { - const abiCoder2 = new AbiCoder(); - let types2 = []; - const values = []; - for (let i3 = 0; i3 < parameters.length; i3++) { - let { value } = parameters[i3]; - const { type: type2 } = parameters[i3]; - if (!type2 || !isString$1(type2) || !type2.length) - throw new Error("Invalid parameter type provided: " + type2); - const replaceAddressPrefix = (value2) => { - if (isArray$1(value2)) { - return value2.map((v6) => replaceAddressPrefix(v6)); - } - return toHex$1(value2).replace(ADDRESS_PREFIX_REGEX, "0x"); - }; - if (type2 === "address") - value = replaceAddressPrefix(value); - else if (((_a3 = type2.match(/^([^\x5b]*)(\x5b|$)/)) == null ? void 0 : _a3[0]) === "address[") - value = replaceAddressPrefix(value); - types2.push(type2); - values.push(value); - } - try { - types2 = types2.map((type2) => { - if (/trcToken/.test(type2)) { - type2 = type2.replace(/trcToken/, "uint256"); - } - return type2; - }); - parameterStr = abiCoder2.encode(types2, values).replace(/^(0x)/, ""); - } catch (ex2) { - throw new Error(ex2); - } - } else - parameterStr = ""; - if (options.funcABIV2) { - parameterStr = encodeParamsV2ByABI(options.funcABIV2, options.parametersV2).replace(/^(0x)/, ""); - } - if (options.shieldedParameter && isString$1(options.shieldedParameter)) { - parameterStr = options.shieldedParameter.replace(/^(0x)/, ""); - } - if (options.rawParameter && isString$1(options.rawParameter)) { - parameterStr = options.rawParameter.replace(/^(0x)/, ""); - } - args.function_selector = functionSelector; - args.parameter = parameterStr; - } else if (options.input) { - args.data = options.input; - } - args.call_value = parseInt(callValue); - if (isNotNullOrUndefined(tokenValue)) - args.call_token_value = parseInt(tokenValue); - if (isNotNullOrUndefined(tokenId)) - args.token_id = parseInt(tokenId); - if (!(options._isConstant || options.estimateEnergy)) { - args.fee_limit = parseInt(feeLimit); - } - if (options.permissionId) { - args.Permission_id = options.permissionId; - } - return args; - } - async _triggerSmartContractLocal(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { - const { tokenValue, tokenId, callValue, feeLimit } = Object.assign({ - callValue: 0, - feeLimit: this.tronWeb.feeLimit - }, options); - this.validator.notValid([ - { - name: "feeLimit", - type: "integer", - value: feeLimit, - gt: 0 - }, - { - name: "callValue", - type: "integer", - value: callValue, - gte: 0 - }, - { - name: "parameters", - type: "array", - value: parameters - }, - { - name: "contract", - type: "address", - value: contractAddress - }, - { - name: "issuer", - type: "address", - value: issuerAddress, - optional: true - }, - { - name: "tokenValue", - type: "integer", - value: tokenValue, - gte: 0, - optional: true - }, - { - name: "tokenId", - type: "integer", - value: tokenId, - gte: 0, - optional: true - } - ]); - const args = this._getTriggerSmartContractArgs(contractAddress, functionSelector, options, parameters, issuerAddress, tokenValue, tokenId, callValue, feeLimit); - if (args.function_selector) { - args.data = keccak256(Buffer.from(args.function_selector, "utf-8")).toString().substring(2, 10) + args.parameter; - } - const value = { - data: args.data, - owner_address: args.owner_address, - contract_address: args.contract_address - }; - if (args.call_value) { - value.call_value = args.call_value; - } - if (args.call_token_value) { - value.call_token_value = args.call_token_value; - } - if (args.token_id) { - value.token_id = args.token_id; - } - const transactionOptions = getTransactionOptions(options); - const transaction2 = await createTransaction(this.tronWeb, ContractType.TriggerSmartContract, value, options.permissionId, { - ...transactionOptions, - fee_limit: args.fee_limit - }); - return { - result: { - result: true - }, - transaction: transaction2 - }; - } - async _triggerSmartContract(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { - const { tokenValue, tokenId, callValue, feeLimit } = Object.assign({ - callValue: 0, - feeLimit: this.tronWeb.feeLimit - }, options); - this.validator.notValid([ - { - name: "feeLimit", - type: "integer", - value: feeLimit, - gt: 0 - }, - { - name: "callValue", - type: "integer", - value: callValue, - gte: 0 - }, - { - name: "parameters", - type: "array", - value: parameters - }, - { - name: "contract", - type: "address", - value: contractAddress - }, - { - name: "issuer", - type: "address", - value: issuerAddress, - optional: true - }, - { - name: "tokenValue", - type: "integer", - value: tokenValue, - gte: 0, - optional: true - }, - { - name: "tokenId", - type: "integer", - value: tokenId, - gte: 0, - optional: true - } - ]); - const args = this._getTriggerSmartContractArgs(contractAddress, functionSelector, options, parameters, issuerAddress, tokenValue, tokenId, callValue, feeLimit); - let pathInfo = "triggersmartcontract"; - if (options._isConstant) { - pathInfo = "triggerconstantcontract"; - } else if (options.estimateEnergy) { - pathInfo = "estimateenergy"; - } - pathInfo = `wallet${options.confirmed ? "solidity" : ""}/${pathInfo}`; - const transaction2 = await this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(pathInfo, args, "post"); - return resultManagerTriggerSmartContract(transaction2, args, options); - } - async clearABI(contractAddress, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - if (!TronWeb.isAddress(contractAddress)) - throw new Error("Invalid contract address provided"); - if (!TronWeb.isAddress(ownerAddress)) - throw new Error("Invalid owner address provided"); - const data = { - contract_address: toHex$1(contractAddress), - owner_address: toHex$1(ownerAddress) - }; - if (this.tronWeb.trx.cache.contracts[contractAddress]) { - delete this.tronWeb.trx.cache.contracts[contractAddress]; - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ClearABIContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async updateBrokerage(brokerage, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - if (!isNotNullOrUndefined(brokerage)) - throw new Error("Invalid brokerage provided"); - if (!isInteger(brokerage) || brokerage < 0 || brokerage > 100) - throw new Error("Brokerage must be an integer between 0 and 100"); - if (!TronWeb.isAddress(ownerAddress)) - throw new Error("Invalid owner address provided"); - const data = { - brokerage: parseInt(brokerage), - owner_address: toHex$1(ownerAddress) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.UpdateBrokerageContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async createToken(options = {}, issuerAddress = this.tronWeb.defaultAddress.hex) { - const { - name: name2 = false, - abbreviation = false, - description: description2 = "", - url = false, - totalSupply = 0, - trxRatio = 1, - // How much TRX will `tokenRatio` cost - tokenRatio = 1, - // How many tokens will `trxRatio` afford - saleStart = Date.now(), - saleEnd = false, - freeBandwidth = 0, - // The creator's "donated" bandwidth for use by token holders - freeBandwidthLimit = 0, - // Out of `totalFreeBandwidth`, the amount each token holder get - frozenAmount = 0, - frozenDuration = 0, - // for now there is no default for the following values - voteScore, - precision - } = options; - this.validator.notValid([ - { - name: "Supply amount", - type: "positive-integer", - value: totalSupply - }, - { - name: "TRX ratio", - type: "positive-integer", - value: trxRatio - }, - { - name: "Token ratio", - type: "positive-integer", - value: tokenRatio - }, - { - name: "token abbreviation", - type: "string", - value: abbreviation, - lte: 32, - gt: 0 - }, - { - name: "token name", - type: "not-empty-string", - value: name2 - }, - { - name: "token description", - type: "string", - value: description2, - lte: 200 - }, - { - name: "token url", - type: "url", - value: url - }, - { - name: "token url", - type: "string", - value: url, - lte: 256 - }, - { - name: "issuer", - type: "address", - value: issuerAddress - }, - { - name: "sale start timestamp", - type: "integer", - value: saleStart, - gte: Date.now() - }, - { - name: "sale end timestamp", - type: "integer", - value: saleEnd, - gt: saleStart - }, - { - name: "Frozen supply", - type: "integer", - value: frozenAmount, - gte: 0 - }, - { - name: "Frozen duration", - type: "integer", - value: frozenDuration, - gte: 0 - } - ]); - if (isNotNullOrUndefined(voteScore) && (!isInteger(voteScore) || voteScore <= 0)) - throw new Error("voteScore must be a positive integer greater than 0"); - if (isNotNullOrUndefined(precision) && (!isInteger(precision) || precision < 0 || precision > 6)) - throw new Error("precision must be a positive integer >= 0 and <= 6"); - const data = { - owner_address: toHex$1(issuerAddress), - name: fromUtf8(name2), - abbr: fromUtf8(abbreviation), - description: fromUtf8(description2), - url: fromUtf8(url), - total_supply: parseInt(totalSupply), - trx_num: parseInt(trxRatio), - num: parseInt(tokenRatio), - start_time: parseInt(saleStart), - end_time: parseInt(saleEnd), - frozen_supply: [ - { - frozen_amount: parseInt(frozenAmount), - frozen_days: parseInt(frozenDuration) - } - ] - }; - ["name", "abbr", "description", "url"].forEach((key2) => { - if (!data[key2]) { - delete data[key2]; - } - }); - if (!(parseInt(frozenAmount) > 0)) { - delete data.frozen_supply; - } - if (freeBandwidth && !isNaN(parseInt(freeBandwidth)) && parseInt(freeBandwidth) >= 0) { - data.free_asset_net_limit = parseInt(freeBandwidth); - } - if (freeBandwidthLimit && !isNaN(parseInt(freeBandwidthLimit)) && parseInt(freeBandwidthLimit) >= 0) { - data.public_free_asset_net_limit = parseInt(freeBandwidthLimit); - } - if (precision && !isNaN(parseInt(precision))) { - data.precision = parseInt(precision); - } - if (voteScore && !isNaN(parseInt(voteScore))) { - data.vote_score = parseInt(voteScore); - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.AssetIssueContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async createAccount(accountAddress, address2 = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "account", - type: "address", - value: accountAddress - }, - { - name: "origin", - type: "address", - value: address2 - } - ]); - const data = { - owner_address: toHex$1(address2), - account_address: toHex$1(accountAddress) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.AccountCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async updateAccount(accountName, address2 = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "Name", - type: "string", - lte: 200, - gt: 0, - value: accountName, - msg: "Invalid accountName" - }, - { - name: "origin", - type: "address", - value: address2 - } - ]); - const data = { - account_name: fromUtf8(accountName), - owner_address: toHex$1(address2) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.AccountUpdateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async setAccountId(accountId, address2 = this.tronWeb.defaultAddress.hex, options = {}) { - if (accountId && isString$1(accountId) && accountId.startsWith("0x")) { - accountId = accountId.slice(2); - } - this.validator.notValid([ - { - name: "accountId", - type: "hex", - value: accountId - }, - { - name: "accountId", - type: "string", - lte: 32, - gte: 8, - value: accountId - }, - { - name: "origin", - type: "address", - value: address2 - } - ]); - const data = { - account_id: accountId, - owner_address: toHex$1(address2) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.SetAccountIdContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async updateToken(options = {}, issuerAddress = this.tronWeb.defaultAddress.hex) { - const { - description: description2 = "", - url = false, - freeBandwidth = 0, - // The creator's "donated" bandwidth for use by token holders - freeBandwidthLimit = 0 - // Out of `totalFreeBandwidth`, the amount each token holder get - } = options; - this.validator.notValid([ - { - name: "token description", - type: "string", - value: description2, - lte: 200 - }, - { - name: "token url", - type: "url", - value: url - }, - { - name: "token url", - type: "string", - value: url, - lte: 256 - }, - { - name: "issuer", - type: "address", - value: issuerAddress - } - ]); - const data = { - owner_address: toHex$1(issuerAddress), - description: fromUtf8(description2), - url: fromUtf8(url) - }; - if (freeBandwidth && !isNaN(parseInt(freeBandwidth)) && parseInt(freeBandwidth) >= 0) { - data.new_limit = parseInt(freeBandwidth); - } - if (freeBandwidthLimit && !isNaN(parseInt(freeBandwidthLimit)) && parseInt(freeBandwidthLimit) >= 0) { - data.new_public_limit = parseInt(freeBandwidthLimit); - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.UpdateAssetContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async sendAsset(to2, amount = 0, tokenId, from2 = this.tronWeb.defaultAddress.hex, options = {}) { - return this.sendToken(to2, amount, tokenId, from2, options); - } - async purchaseAsset(issuerAddress, tokenId, amount = 0, buyer = this.tronWeb.defaultAddress.hex, options = {}) { - return this.purchaseToken(issuerAddress, tokenId, amount, buyer, options); - } - async createAsset(options, issuerAddress) { - return this.createToken(options, issuerAddress); - } - async updateAsset(options = {}, issuerAddress = this.tronWeb.defaultAddress.hex) { - return this.updateToken(options, issuerAddress); - } - /** - * Creates a proposal to modify the network. - * Can only be created by a current Super Representative. - */ - async createProposal(parameters, issuerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "issuer", - type: "address", - value: issuerAddress - } - ]); - const invalid = "Invalid proposal parameters provided"; - if (!parameters) - throw new Error(invalid); - const newParams = isArray$1(parameters) ? parameters : [parameters]; - for (const parameter of newParams) { - if (!isObject$2(parameter)) - throw new Error(invalid); - } - const data = { - owner_address: toHex$1(issuerAddress), - parameters: newParams - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ProposalCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - /** - * Deletes a network modification proposal that the owner issued. - * Only current Super Representative can vote on a proposal. - */ - async deleteProposal(proposalID, issuerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "issuer", - type: "address", - value: issuerAddress - }, - { - name: "proposalID", - type: "integer", - value: proposalID, - gte: 0 - } - ]); - const data = { - owner_address: toHex$1(issuerAddress), - proposal_id: parseInt(proposalID) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ProposalDeleteContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - /** - * Adds a vote to an issued network modification proposal. - * Only current Super Representative can vote on a proposal. - */ - async voteProposal(proposalID, isApproval = false, voterAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "voter", - type: "address", - value: voterAddress - }, - { - name: "proposalID", - type: "integer", - value: proposalID, - gte: 0 - }, - { - name: "has approval", - type: "boolean", - value: isApproval - } - ]); - const data = { - owner_address: toHex$1(voterAddress), - proposal_id: parseInt(proposalID), - is_add_approval: isApproval - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ProposalApproveContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - /** - * Create an exchange between a token and TRX. - * Token Name should be a CASE SENSITIVE string. - * PLEASE VERIFY THIS ON TRONSCAN. - */ - async createTRXExchange(tokenName, tokenBalance, trxBalance, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "owner", - type: "address", - value: ownerAddress - }, - { - name: "token name", - type: "not-empty-string", - value: tokenName - }, - { - name: "token balance", - type: "positive-integer", - value: tokenBalance - }, - { - name: "trx balance", - type: "positive-integer", - value: trxBalance - } - ]); - const data = { - owner_address: toHex$1(ownerAddress), - first_token_id: fromUtf8(tokenName), - first_token_balance: tokenBalance, - second_token_id: "5f", - // Constant for TRX. - second_token_balance: trxBalance - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ExchangeCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - /** - * Create an exchange between a token and another token. - * DO NOT USE THIS FOR TRX. - * Token Names should be a CASE SENSITIVE string. - * PLEASE VERIFY THIS ON TRONSCAN. - */ - async createTokenExchange(firstTokenName, firstTokenBalance, secondTokenName, secondTokenBalance, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "owner", - type: "address", - value: ownerAddress - }, - { - name: "first token name", - type: "not-empty-string", - value: firstTokenName - }, - { - name: "second token name", - type: "not-empty-string", - value: secondTokenName - }, - { - name: "first token balance", - type: "positive-integer", - value: firstTokenBalance - }, - { - name: "second token balance", - type: "positive-integer", - value: secondTokenBalance - } - ]); - const data = { - owner_address: toHex$1(ownerAddress), - first_token_id: fromUtf8(firstTokenName), - first_token_balance: firstTokenBalance, - second_token_id: fromUtf8(secondTokenName), - second_token_balance: secondTokenBalance - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ExchangeCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - /** - * Adds tokens into a bancor style exchange. - * Will add both tokens at market rate. - * Use "_" for the constant value for TRX. - */ - async injectExchangeTokens(exchangeID, tokenName, tokenAmount, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "owner", - type: "address", - value: ownerAddress - }, - { - name: "token name", - type: "not-empty-string", - value: tokenName - }, - { - name: "token amount", - type: "integer", - value: tokenAmount, - gte: 1 - }, - { - name: "exchangeID", - type: "integer", - value: exchangeID, - gte: 0 - } - ]); - const data = { - owner_address: toHex$1(ownerAddress), - exchange_id: parseInt(exchangeID), - token_id: fromUtf8(tokenName), - quant: parseInt(tokenAmount) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ExchangeInjectContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - /** - * Withdraws tokens from a bancor style exchange. - * Will withdraw at market rate both tokens. - * Use "_" for the constant value for TRX. - */ - async withdrawExchangeTokens(exchangeID, tokenName, tokenAmount, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "owner", - type: "address", - value: ownerAddress - }, - { - name: "token name", - type: "not-empty-string", - value: tokenName - }, - { - name: "token amount", - type: "integer", - value: tokenAmount, - gte: 1 - }, - { - name: "exchangeID", - type: "integer", - value: exchangeID, - gte: 0 - } - ]); - const data = { - owner_address: toHex$1(ownerAddress), - exchange_id: parseInt(exchangeID), - token_id: fromUtf8(tokenName), - quant: parseInt(tokenAmount) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ExchangeWithdrawContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - /** - * Trade tokens on a bancor style exchange. - * Expected value is a validation and used to cap the total amt of token 2 spent. - * Use "_" for the constant value for TRX. - */ - async tradeExchangeTokens(exchangeID, tokenName, tokenAmountSold, tokenAmountExpected, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "owner", - type: "address", - value: ownerAddress - }, - { - name: "token name", - type: "not-empty-string", - value: tokenName - }, - { - name: "tokenAmountSold", - type: "integer", - value: tokenAmountSold, - gte: 1 - }, - { - name: "tokenAmountExpected", - type: "integer", - value: tokenAmountExpected, - gte: 1 - }, - { - name: "exchangeID", - type: "integer", - value: exchangeID, - gte: 0 - } - ]); - const data = { - owner_address: toHex$1(ownerAddress), - exchange_id: parseInt(exchangeID), - token_id: TronWeb.fromAscii(tokenName).replace(/^0x/, ""), - quant: parseInt(tokenAmountSold), - expected: parseInt(tokenAmountExpected) - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.ExchangeTransactionContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - /** - * Update userFeePercentage. - */ - async updateSetting(contractAddress, userFeePercentage, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "owner", - type: "address", - value: ownerAddress - }, - { - name: "contract", - type: "address", - value: contractAddress - }, - { - name: "userFeePercentage", - type: "integer", - value: userFeePercentage, - gte: 0, - lte: 100 - } - ]); - const data = { - owner_address: toHex$1(ownerAddress), - contract_address: toHex$1(contractAddress), - consume_user_resource_percent: userFeePercentage - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.UpdateSettingContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - /** - * Update energy limit. - */ - async updateEnergyLimit(contractAddress, originEnergyLimit = 0, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { - this.validator.notValid([ - { - name: "owner", - type: "address", - value: ownerAddress - }, - { - name: "contract", - type: "address", - value: contractAddress - }, - { - name: "originEnergyLimit", - type: "integer", - value: originEnergyLimit, - gte: 0, - lte: 1e7 - } - ]); - const data = { - owner_address: toHex$1(ownerAddress), - contract_address: toHex$1(contractAddress), - origin_energy_limit: originEnergyLimit - }; - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.UpdateEnergyLimitContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - checkPermissions(permissions, type2) { - if (permissions) { - if (permissions.type !== type2 || !permissions.permission_name || !isString$1(permissions.permission_name) || !isInteger(permissions.threshold) || permissions.threshold < 1 || !permissions.keys) { - return false; - } - for (const key2 of permissions.keys) { - if (!TronWeb.isAddress(key2.address) || !isInteger(key2.weight) || key2.weight > permissions.threshold || key2.weight < 1 || type2 === 2 && !permissions.operations) { - return false; - } - } - } - return true; - } - async updateAccountPermissions(ownerAddress = this.tronWeb.defaultAddress.hex, ownerPermission, witnessPermission, activesPermissions, options = {}) { - var _a3; - if (!TronWeb.isAddress(ownerAddress)) - throw new Error("Invalid ownerAddress provided"); - if (!this.checkPermissions(ownerPermission, 0)) { - throw new Error("Invalid ownerPermissions provided"); - } - if (!this.checkPermissions(witnessPermission, 1)) { - throw new Error("Invalid witnessPermissions provided"); - } - if (!Array.isArray(activesPermissions)) { - activesPermissions = [activesPermissions]; - } - for (const activesPermission of activesPermissions) { - if (!this.checkPermissions(activesPermission, 2)) { - throw new Error("Invalid activesPermissions provided"); - } - } - const data = { - owner_address: toHex$1(ownerAddress) - }; - if (ownerPermission) { - const _ownerPermissions = deepCopyJson(ownerPermission); - if ("type" in _ownerPermissions) { - delete _ownerPermissions.type; - } - _ownerPermissions.keys = (_a3 = _ownerPermissions.keys) == null ? void 0 : _a3.map(({ address: address2, weight }) => ({ - address: this.tronWeb.address.toHex(address2), - weight - })); - data.owner = _ownerPermissions; - } - if (witnessPermission) { - const _witnessPermissions = deepCopyJson(witnessPermission); - _witnessPermissions.type = "Witness"; - _witnessPermissions.keys = _witnessPermissions.keys.map(({ address: address2, weight }) => ({ - address: this.tronWeb.address.toHex(address2), - weight - })); - data.witness = _witnessPermissions; - } - if (activesPermissions) { - const _activesPermissions = deepCopyJson(activesPermissions); - _activesPermissions.forEach((activePermissions) => { - activePermissions.type = "Active"; - }); - _activesPermissions.forEach((_activesPermission) => { - _activesPermission.keys = _activesPermission.keys.map(({ address: address2, weight }) => ({ - address: this.tronWeb.address.toHex(address2), - weight - })); - }); - data.actives = _activesPermissions; - } - const transactionOptions = getTransactionOptions(options); - return createTransaction(this.tronWeb, ContractType.AccountPermissionUpdateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); - } - async newTxID(transaction2, options = {}) { - if (options == null ? void 0 : options.txLocal) { - const contract = transaction2.raw_data.contract[0]; - try { - const tx = await createTransaction(this.tronWeb, contract.type, contract.parameter.value, contract.Permission_id, { - fee_limit: transaction2.raw_data.fee_limit, - data: transaction2.raw_data.data, - ref_block_bytes: transaction2.raw_data.ref_block_bytes, - ref_block_hash: transaction2.raw_data.ref_block_hash, - expiration: transaction2.raw_data.expiration, - timestamp: transaction2.raw_data.timestamp - }); - tx.signature = transaction2.signature; - tx.visible = transaction2.visible; - return tx; - } catch (e18) { - throw new Error("Error generating a new transaction id."); - } - } - try { - const res = await this.tronWeb.fullNode.request("wallet/getsignweight", transaction2, "post"); - if (typeof transaction2.visible === "boolean") { - res.transaction.transaction.visible = transaction2.visible; - } - return resultManager( - res.transaction.transaction, - { - ...transaction2.raw_data.contract[0].parameter.value, - Permission_id: transaction2.raw_data.contract[0].Permission_id - }, - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - /* @ts-ignore */ - { data: transaction2.raw_data.data, fee_limit: transaction2.raw_data.fee_limit } - ); - } catch (e18) { - throw new Error("Error generating a new transaction id."); - } - } - async alterTransaction(transaction2, options = {}) { - if (Reflect.has(transaction2, "signature")) - throw new Error("You can not extend the expiration of a signed transaction."); - if (options.data) { - if (options.dataFormat !== "hex") - options.data = TronWeb.toHex(options.data); - options.data = options.data.replace(/^0x/, ""); - if (options.data.length === 0) - throw new Error("Invalid data provided"); - transaction2.raw_data.data = options.data; - } - if (options.extension) { - options.extension = parseInt(options.extension * 1e3); - if (isNaN(options.extension) || transaction2.raw_data.expiration + options.extension <= Date.now() + 3e3) - throw new Error("Invalid extension provided"); - transaction2.raw_data.expiration += options.extension; - } - return await this.newTxID(transaction2, { txLocal: options.txLocal }); - } - async extendExpiration(transaction2, extension, options = {}) { - return await this.alterTransaction(transaction2, { extension, txLocal: options == null ? void 0 : options.txLocal }); - } - async addUpdateData(transaction2, data, dataFormat = "utf8", options = {}) { - return this.alterTransaction(transaction2, { data, dataFormat, txLocal: options == null ? void 0 : options.txLocal }); - } -} -const TRX_MESSAGE_HEADER = "TRON Signed Message:\n32"; -const ETH_MESSAGE_HEADER = "Ethereum Signed Message:\n32"; -function toHex(value) { - return TronWeb.address.toHex(value); -} -class Trx { - constructor(tronWeb) { - __publicField(this, "tronWeb"); - __publicField(this, "cache"); - __publicField(this, "validator"); - __publicField(this, "signMessage"); - __publicField(this, "sendAsset"); - __publicField(this, "send"); - __publicField(this, "sendTrx"); - __publicField(this, "broadcast"); - __publicField(this, "broadcastHex"); - __publicField(this, "signTransaction"); - this.tronWeb = tronWeb; - this.cache = { - contracts: {} - }; - this.validator = new Validator(); - this.signMessage = this.sign; - this.sendAsset = this.sendToken; - this.send = this.sendTransaction; - this.sendTrx = this.sendTransaction; - this.broadcast = this.sendRawTransaction; - this.broadcastHex = this.sendHexTransaction; - this.signTransaction = this.sign; - } - _parseToken(token2) { - return { - ...token2, - name: this.tronWeb.toUtf8(token2.name), - abbr: token2.abbr && this.tronWeb.toUtf8(token2.abbr), - description: token2.description && this.tronWeb.toUtf8(token2.description), - url: token2.url && this.tronWeb.toUtf8(token2.url) - }; - } - getCurrentBlock() { - return this.tronWeb.fullNode.request("wallet/getnowblock"); - } - getConfirmedCurrentBlock() { - return this.tronWeb.solidityNode.request("walletsolidity/getnowblock"); - } - async getBlock(block = this.tronWeb.defaultBlock) { - if (block === false) { - throw new Error("No block identifier provided"); - } - if (block == "earliest") - block = 0; - if (block == "latest") - return this.getCurrentBlock(); - if (isNaN(+block) && utils$h.isHex(block.toString())) - return this.getBlockByHash(block); - return this.getBlockByNumber(block); - } - async getBlockByHash(blockHash) { - const block = await this.tronWeb.fullNode.request("wallet/getblockbyid", { - value: blockHash - }, "post"); - if (!Object.keys(block).length) { - throw new Error("Block not found"); - } - return block; - } - async getBlockByNumber(blockID) { - if (!utils$h.isInteger(blockID) || blockID < 0) { - throw new Error("Invalid block number provided"); - } - return this.tronWeb.fullNode.request("wallet/getblockbynum", { - num: parseInt(blockID) - }, "post").then((block) => { - if (!Object.keys(block).length) { - throw new Error("Block not found"); - } - return block; - }); - } - async getBlockTransactionCount(block = this.tronWeb.defaultBlock) { - const { transactions = [] } = await this.getBlock(block); - return transactions.length; - } - async getTransactionFromBlock(block = this.tronWeb.defaultBlock, index2) { - const { transactions } = await this.getBlock(block); - if (!transactions) { - throw new Error("Transaction not found in block"); - } - if (index2 >= 0 && index2 < transactions.length) - return transactions[index2]; - else - throw new Error("Invalid transaction index provided"); - } - async getTransactionsFromBlock(block = this.tronWeb.defaultBlock) { - const { transactions } = await this.getBlock(block); - if (!transactions) { - throw new Error("Transaction not found in block"); - } - return transactions; - } - async getTransaction(transactionID) { - const transaction2 = await this.tronWeb.fullNode.request("wallet/gettransactionbyid", { - value: transactionID - }, "post"); - if (!Object.keys(transaction2).length) { - throw new Error("Transaction not found"); - } - return transaction2; - } - async getConfirmedTransaction(transactionID) { - const transaction2 = await this.tronWeb.solidityNode.request("walletsolidity/gettransactionbyid", { - value: transactionID - }, "post"); - if (!Object.keys(transaction2).length) { - throw new Error("Transaction not found"); - } - return transaction2; - } - getUnconfirmedTransactionInfo(transactionID) { - return this.tronWeb.fullNode.request("wallet/gettransactioninfobyid", { value: transactionID }, "post"); - } - getTransactionInfo(transactionID) { - return this.tronWeb.solidityNode.request("walletsolidity/gettransactioninfobyid", { value: transactionID }, "post"); - } - getTransactionsToAddress(address2 = this.tronWeb.defaultAddress.hex, limit = 30, offset2 = 0) { - return this.getTransactionsRelated(this.tronWeb.address.toHex(address2), "to", limit, offset2); - } - getTransactionsFromAddress(address2 = this.tronWeb.defaultAddress.hex, limit = 30, offset2 = 0) { - return this.getTransactionsRelated(this.tronWeb.address.toHex(address2), "from", limit, offset2); - } - async getTransactionsRelated(address2 = this.tronWeb.defaultAddress.hex, direction = "all", limit = 30, offset2 = 0) { - if (!["to", "from", "all"].includes(direction)) { - throw new Error('Invalid direction provided: Expected "to", "from" or "all"'); - } - if (direction == "all") { - const [from2, to2] = await Promise.all([ - this.getTransactionsRelated(address2, "from", limit, offset2), - this.getTransactionsRelated(address2, "to", limit, offset2) - ]); - return [ - ...from2.map((tx) => (tx.direction = "from", tx)), - ...to2.map((tx) => (tx.direction = "to", tx)) - ].sort((a3, b2) => { - return b2.raw_data.timestamp - a3.raw_data.timestamp; - }); - } - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - if (!utils$h.isInteger(limit) || limit < 0 || offset2 && limit < 1) { - throw new Error("Invalid limit provided"); - } - if (!utils$h.isInteger(offset2) || offset2 < 0) { - throw new Error("Invalid offset provided"); - } - address2 = this.tronWeb.address.toHex(address2); - return this.tronWeb.solidityNode.request(`walletextension/gettransactions${direction}this`, { - account: { - address: address2 - }, - offset: offset2, - limit - }, "post").then(({ transaction: transaction2 }) => { - return transaction2; - }); - } - async getAccount(address2 = this.tronWeb.defaultAddress.hex) { - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - address2 = this.tronWeb.address.toHex(address2); - return this.tronWeb.solidityNode.request("walletsolidity/getaccount", { - address: address2 - }, "post"); - } - getAccountById(id2) { - return this.getAccountInfoById(id2, { confirmed: true }); - } - async getAccountInfoById(id2, options) { - this.validator.notValid([ - { - name: "accountId", - type: "hex", - value: id2 - }, - { - name: "accountId", - type: "string", - lte: 32, - gte: 8, - value: id2 - } - ]); - if (id2.startsWith("0x")) { - id2 = id2.slice(2); - } - return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getaccountbyid`, { - account_id: id2 - }, "post"); - } - async getBalance(address2 = this.tronWeb.defaultAddress.hex) { - const { balance = 0 } = await this.getAccount(address2); - return balance; - } - async getUnconfirmedAccount(address2 = this.tronWeb.defaultAddress.hex) { - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - address2 = this.tronWeb.address.toHex(address2); - return this.tronWeb.fullNode.request("wallet/getaccount", { - address: address2 - }, "post"); - } - getUnconfirmedAccountById(id2) { - return this.getAccountInfoById(id2, { confirmed: false }); - } - async getUnconfirmedBalance(address2 = this.tronWeb.defaultAddress.hex) { - const { balance = 0 } = await this.getUnconfirmedAccount(address2); - return balance; - } - async getBandwidth(address2 = this.tronWeb.defaultAddress.hex) { - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - address2 = this.tronWeb.address.toHex(address2); - return this.tronWeb.fullNode.request("wallet/getaccountnet", { - address: address2 - }, "post").then(({ freeNetUsed = 0, freeNetLimit = 0, NetUsed = 0, NetLimit = 0 }) => { - return freeNetLimit - freeNetUsed + (NetLimit - NetUsed); - }); - } - async getTokensIssuedByAddress(address2 = this.tronWeb.defaultAddress.hex) { - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - address2 = this.tronWeb.address.toHex(address2); - return this.tronWeb.fullNode.request("wallet/getassetissuebyaccount", { - address: address2 - }, "post").then(({ assetIssue }) => { - if (!assetIssue) - return {}; - const tokens = assetIssue.map((token2) => { - return this._parseToken(token2); - }).reduce((tokens2, token2) => { - return tokens2[token2.name] = token2, tokens2; - }, {}); - return tokens; - }); - } - async getTokenFromID(tokenID) { - if (utils$h.isInteger(tokenID)) - tokenID = tokenID.toString(); - if (!utils$h.isString(tokenID) || !tokenID.length) { - throw new Error("Invalid token ID provided"); - } - return this.tronWeb.fullNode.request("wallet/getassetissuebyname", { - value: this.tronWeb.fromUtf8(tokenID) - }, "post").then((token2) => { - if (!token2.name) { - throw new Error("Token does not exist"); - } - return this._parseToken(token2); - }); - } - async listNodes() { - const { nodes = [] } = await this.tronWeb.fullNode.request("wallet/listnodes"); - return nodes.map(({ address: { host, port } }) => `${this.tronWeb.toUtf8(host)}:${port}`); - } - async getBlockRange(start = 0, end = 30) { - if (!utils$h.isInteger(start) || start < 0) { - throw new Error("Invalid start of range provided"); - } - if (!utils$h.isInteger(end) || end < start) { - throw new Error("Invalid end of range provided"); - } - if (end + 1 - start > 100) { - throw new Error("Invalid range size, which should be no more than 100."); - } - return this.tronWeb.fullNode.request("wallet/getblockbylimitnext", { - startNum: parseInt(start), - endNum: parseInt(end) + 1 - }, "post").then(({ block = [] }) => block); - } - async listSuperRepresentatives() { - const { witnesses = [] } = await this.tronWeb.fullNode.request("wallet/listwitnesses"); - return witnesses; - } - async listTokens(limit = 0, offset2 = 0) { - if (!utils$h.isInteger(limit) || limit < 0 || offset2 && limit < 1) { - throw new Error("Invalid limit provided"); - } - if (!utils$h.isInteger(offset2) || offset2 < 0) { - throw new Error("Invalid offset provided"); - } - if (!limit) { - return this.tronWeb.fullNode.request("wallet/getassetissuelist").then(({ assetIssue = [] }) => assetIssue.map((token2) => this._parseToken(token2))); - } - return this.tronWeb.fullNode.request("wallet/getpaginatedassetissuelist", { - offset: parseInt(offset2), - limit: parseInt(limit) - }, "post").then(({ assetIssue = [] }) => assetIssue.map((token2) => this._parseToken(token2))); - } - async timeUntilNextVoteCycle() { - const { num = -1 } = await this.tronWeb.fullNode.request("wallet/getnextmaintenancetime"); - if (num == -1) { - throw new Error("Failed to get time until next vote cycle"); - } - return Math.floor(num / 1e3); - } - async getContract(contractAddress) { - if (!this.tronWeb.isAddress(contractAddress)) { - throw new Error("Invalid contract address provided"); - } - if (this.cache.contracts[contractAddress]) { - return this.cache.contracts[contractAddress]; - } - contractAddress = this.tronWeb.address.toHex(contractAddress); - const contract = await this.tronWeb.fullNode.request("wallet/getcontract", { - value: contractAddress - }); - if (contract.Error) { - throw new Error("Contract does not exist"); - } - this.cache.contracts[contractAddress] = contract; - return contract; - } - ecRecover(transaction2) { - return Trx.ecRecover(transaction2); - } - static ecRecover(transaction2) { - var _a3; - if (!txCheck(transaction2)) { - throw new Error("Invalid transaction"); - } - if (!((_a3 = transaction2.signature) == null ? void 0 : _a3.length)) { - throw new Error("Transaction is not signed"); - } - if (transaction2.signature.length === 1) { - const tronAddress = ecRecover(transaction2.txID, transaction2.signature[0]); - return TronWeb.address.fromHex(tronAddress); - } - return transaction2.signature.map((sig) => { - const tronAddress = ecRecover(transaction2.txID, sig); - return TronWeb.address.fromHex(tronAddress); - }); - } - async verifyMessage(message2, signature2, address2 = this.tronWeb.defaultAddress.base58, useTronHeader = true) { - if (!utils$h.isHex(message2)) { - throw new Error("Expected hex message input"); - } - if (Trx.verifySignature(message2, address2, signature2, useTronHeader)) { - return true; - } - throw new Error("Signature does not match"); - } - static verifySignature(message2, address2, signature2, useTronHeader = true) { - message2 = message2.replace(/^0x/, ""); - const messageBytes = [ - ...toUtf8Bytes(useTronHeader ? TRX_MESSAGE_HEADER : ETH_MESSAGE_HEADER), - ...utils$h.code.hexStr2byteArray(message2) - ]; - const messageDigest = keccak256(new Uint8Array(messageBytes)); - const recovered = recoverAddress(messageDigest, Signature$4.from(`0x${signature2.replace(/^0x/, "")}`)); - const tronAddress = ADDRESS_PREFIX + recovered.substr(2); - const base58Address = TronWeb.address.fromHex(tronAddress); - return base58Address == TronWeb.address.fromHex(address2); - } - async verifyMessageV2(message2, signature2) { - return Trx.verifyMessageV2(message2, signature2); - } - static verifyMessageV2(message2, signature2) { - return utils$h.message.verifyMessage(message2, signature2); - } - verifyTypedData(domain, types2, value, signature2, address2 = this.tronWeb.defaultAddress.base58) { - if (Trx.verifyTypedData(domain, types2, value, signature2, address2)) - return true; - throw new Error("Signature does not match"); - } - static verifyTypedData(domain, types2, value, signature2, address2) { - const messageDigest = utils$h._TypedDataEncoder.hash(domain, types2, value); - const recovered = recoverAddress(messageDigest, Signature$4.from(`0x${signature2.replace(/^0x/, "")}`)); - const tronAddress = ADDRESS_PREFIX + recovered.substr(2); - const base58Address = TronWeb.address.fromHex(tronAddress); - return base58Address == TronWeb.address.fromHex(address2); - } - async sign(transaction2, privateKey = this.tronWeb.defaultPrivateKey, useTronHeader = true, multisig = false) { - if (utils$h.isString(transaction2)) { - if (!utils$h.isHex(transaction2)) { - throw new Error("Expected hex message input"); - } - return Trx.signString(transaction2, privateKey, useTronHeader); - } - if (!utils$h.isObject(transaction2)) { - throw new Error("Invalid transaction provided"); - } - if (!multisig && transaction2.signature) { - throw new Error("Transaction is already signed"); - } - if (!multisig) { - const address2 = this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(privateKey)).toLowerCase(); - if (address2 !== this.tronWeb.address.toHex(transaction2.raw_data.contract[0].parameter.value.owner_address)) { - throw new Error("Private key does not match address in transaction"); - } - if (!txCheck(transaction2)) { - throw new Error("Invalid transaction"); - } - } - return utils$h.crypto.signTransaction(privateKey, transaction2); - } - static signString(message2, privateKey, useTronHeader = true) { - message2 = message2.replace(/^0x/, ""); - const value = `0x${privateKey.replace(/^0x/, "")}`; - const signingKey = new SigningKey(value); - const messageBytes = [ - ...toUtf8Bytes(useTronHeader ? TRX_MESSAGE_HEADER : ETH_MESSAGE_HEADER), - ...utils$h.code.hexStr2byteArray(message2) - ]; - const messageDigest = keccak256(new Uint8Array(messageBytes)); - const signature2 = signingKey.sign(messageDigest); - const signatureHex = ["0x", signature2.r.substring(2), signature2.s.substring(2), Number(signature2.v).toString(16)].join(""); - return signatureHex; - } - /** - * sign message v2 for verified header length - * - * @param {message to be signed, should be Bytes or string} message - * @param {privateKey for signature} privateKey - * @param {reserved} options - */ - signMessageV2(message2, privateKey = this.tronWeb.defaultPrivateKey) { - return Trx.signMessageV2(message2, privateKey); - } - static signMessageV2(message2, privateKey) { - return utils$h.message.signMessage(message2, privateKey); - } - _signTypedData(domain, types2, value, privateKey = this.tronWeb.defaultPrivateKey) { - return Trx._signTypedData(domain, types2, value, privateKey); - } - static _signTypedData(domain, types2, value, privateKey) { - return utils$h.crypto._signTypedData(domain, types2, value, privateKey); - } - async multiSign(transaction2, privateKey = this.tronWeb.defaultPrivateKey, permissionId = 0) { - if (!utils$h.isObject(transaction2) || !transaction2.raw_data || !transaction2.raw_data.contract) { - throw new Error("Invalid transaction provided"); - } - if (!transaction2.raw_data.contract[0].Permission_id && permissionId > 0) { - transaction2.raw_data.contract[0].Permission_id = permissionId; - const address2 = this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(privateKey)).toLowerCase(); - const signWeight = await this.getSignWeight(transaction2, permissionId); - if (signWeight.result.code === "PERMISSION_ERROR") { - throw new Error(signWeight.result.message); - } - let foundKey = false; - signWeight.permission.keys.map((key2) => { - if (key2.address === address2) - foundKey = true; - }); - if (!foundKey) { - throw new Error(privateKey + " has no permission to sign"); - } - if (signWeight.approved_list && signWeight.approved_list.indexOf(address2) != -1) { - throw new Error(privateKey + " already sign transaction"); - } - if (signWeight.transaction && signWeight.transaction.transaction) { - transaction2 = signWeight.transaction.transaction; - if (permissionId > 0) { - transaction2.raw_data.contract[0].Permission_id = permissionId; - } - } else { - throw new Error("Invalid transaction provided"); - } - } - if (!txCheck(transaction2)) { - throw new Error("Invalid transaction"); - } - return utils$h.crypto.signTransaction(privateKey, transaction2); - } - async getApprovedList(transaction2) { - if (!utils$h.isObject(transaction2)) { - throw new Error("Invalid transaction provided"); - } - return this.tronWeb.fullNode.request("wallet/getapprovedlist", transaction2, "post"); - } - async getSignWeight(transaction2, permissionId) { - if (!utils$h.isObject(transaction2) || !transaction2.raw_data || !transaction2.raw_data.contract) - throw new Error("Invalid transaction provided"); - if (utils$h.isInteger(permissionId)) { - transaction2.raw_data.contract[0].Permission_id = parseInt(permissionId); - } else if (typeof transaction2.raw_data.contract[0].Permission_id !== "number") { - transaction2.raw_data.contract[0].Permission_id = 0; - } - return this.tronWeb.fullNode.request("wallet/getsignweight", transaction2, "post"); - } - async sendRawTransaction(signedTransaction) { - if (!utils$h.isObject(signedTransaction)) { - throw new Error("Invalid transaction provided"); - } - if (!signedTransaction.signature || !utils$h.isArray(signedTransaction.signature)) { - throw new Error("Transaction is not signed"); - } - const result = await this.tronWeb.fullNode.request("wallet/broadcasttransaction", signedTransaction, "post"); - return { - ...result, - transaction: signedTransaction - }; - } - async sendHexTransaction(signedHexTransaction) { - if (!utils$h.isHex(signedHexTransaction)) { - throw new Error("Invalid hex transaction provided"); - } - const params = { - transaction: signedHexTransaction - }; - const result = await this.tronWeb.fullNode.request("wallet/broadcasthex", params, "post"); - if (result.result) { - return { - ...result, - transaction: JSON.parse(result.transaction), - hexTransaction: signedHexTransaction - }; - } - return result; - } - async sendTransaction(to2, amount, options = {}) { - if (typeof options === "string") - options = { privateKey: options }; - if (!this.tronWeb.isAddress(to2)) { - throw new Error("Invalid recipient provided"); - } - if (!utils$h.isInteger(amount) || amount <= 0) { - throw new Error("Invalid amount provided"); - } - options = { - privateKey: this.tronWeb.defaultPrivateKey, - address: this.tronWeb.defaultAddress.hex, - ...options - }; - if (!options.privateKey && !options.address) { - throw new Error("Function requires either a private key or address to be set"); - } - const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; - const transaction2 = await this.tronWeb.transactionBuilder.sendTrx(to2, amount, address2); - const signedTransaction = await this.sign(transaction2, options.privateKey); - const result = await this.sendRawTransaction(signedTransaction); - return result; - } - async sendToken(to2, amount, tokenID, options = {}) { - if (typeof options === "string") - options = { privateKey: options }; - if (!this.tronWeb.isAddress(to2)) { - throw new Error("Invalid recipient provided"); - } - if (!utils$h.isInteger(amount) || amount <= 0) { - throw new Error("Invalid amount provided"); - } - if (utils$h.isInteger(tokenID)) - tokenID = tokenID.toString(); - if (!utils$h.isString(tokenID)) { - throw new Error("Invalid token ID provided"); - } - options = { - privateKey: this.tronWeb.defaultPrivateKey, - address: this.tronWeb.defaultAddress.hex, - ...options - }; - if (!options.privateKey && !options.address) { - throw new Error("Function requires either a private key or address to be set"); - } - const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; - const transaction2 = await this.tronWeb.transactionBuilder.sendToken(to2, amount, tokenID, address2); - const signedTransaction = await this.sign(transaction2, options.privateKey); - const result = await this.sendRawTransaction(signedTransaction); - return result; - } - /** - * Freezes an amount of TRX. - * Will give bandwidth OR Energy and TRON Power(voting rights) - * to the owner of the frozen tokens. - * - * @param amount - is the number of frozen trx - * @param duration - is the duration in days to be frozen - * @param resource - is the type, must be either "ENERGY" or "BANDWIDTH" - * @param options - */ - async freezeBalance(amount = 0, duration = 3, resource = "BANDWIDTH", options = {}, receiverAddress) { - if (typeof options === "string") - options = { privateKey: options }; - if (!["BANDWIDTH", "ENERGY"].includes(resource)) { - throw new Error('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'); - } - if (!utils$h.isInteger(amount) || amount <= 0) { - throw new Error("Invalid amount provided"); - } - if (!utils$h.isInteger(duration) || duration < 3) { - throw new Error("Invalid duration provided, minimum of 3 days"); - } - options = { - privateKey: this.tronWeb.defaultPrivateKey, - address: this.tronWeb.defaultAddress.hex, - ...options - }; - if (!options.privateKey && !options.address) { - throw new Error("Function requires either a private key or address to be set"); - } - const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; - const freezeBalance = await this.tronWeb.transactionBuilder.freezeBalance(amount, duration, resource, address2, receiverAddress); - const signedTransaction = await this.sign(freezeBalance, options.privateKey); - const result = await this.sendRawTransaction(signedTransaction); - return result; - } - /** - * Unfreeze TRX that has passed the minimum freeze duration. - * Unfreezing will remove bandwidth and TRON Power. - * - * @param resource - is the type, must be either "ENERGY" or "BANDWIDTH" - * @param options - */ - async unfreezeBalance(resource = "BANDWIDTH", options = {}, receiverAddress) { - if (typeof options === "string") - options = { privateKey: options }; - if (!["BANDWIDTH", "ENERGY"].includes(resource)) { - throw new Error('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'); - } - options = { - privateKey: this.tronWeb.defaultPrivateKey, - address: this.tronWeb.defaultAddress.hex, - ...options - }; - if (!options.privateKey && !options.address) { - throw new Error("Function requires either a private key or address to be set"); - } - const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; - const unfreezeBalance = await this.tronWeb.transactionBuilder.unfreezeBalance(resource, address2, receiverAddress); - const signedTransaction = await this.sign(unfreezeBalance, options.privateKey); - const result = await this.sendRawTransaction(signedTransaction); - return result; - } - /** - * Modify account name - * Note: Username is allowed to edit only once. - * - * @param privateKey - Account private Key - * @param accountName - name of the account - * - * @return modified Transaction Object - */ - async updateAccount(accountName, options = {}) { - if (typeof options === "string") - options = { privateKey: options }; - if (!utils$h.isString(accountName) || !accountName.length) { - throw new Error("Name must be a string"); - } - options = { - privateKey: this.tronWeb.defaultPrivateKey, - address: this.tronWeb.defaultAddress.hex, - ...options - }; - if (!options.privateKey && !options.address) - throw Error("Function requires either a private key or address to be set"); - const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; - const updateAccount = await this.tronWeb.transactionBuilder.updateAccount(accountName, address2); - const signedTransaction = await this.sign(updateAccount, options.privateKey); - const result = await this.sendRawTransaction(signedTransaction); - return result; - } - /** - * Gets a network modification proposal by ID. - */ - async getProposal(proposalID) { - if (!utils$h.isInteger(proposalID) || proposalID < 0) { - throw new Error("Invalid proposalID provided"); - } - return this.tronWeb.fullNode.request("wallet/getproposalbyid", { - id: parseInt(proposalID) - }, "post"); - } - /** - * Lists all network modification proposals. - */ - async listProposals() { - const { proposals = [] } = await this.tronWeb.fullNode.request("wallet/listproposals", {}, "post"); - return proposals; - } - /** - * Lists all parameters available for network modification proposals. - */ - async getChainParameters() { - const { chainParameter = [] } = await this.tronWeb.fullNode.request("wallet/getchainparameters", {}, "post"); - return chainParameter; - } - /** - * Get the account resources - */ - async getAccountResources(address2 = this.tronWeb.defaultAddress.hex) { - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - return this.tronWeb.fullNode.request("wallet/getaccountresource", { - address: this.tronWeb.address.toHex(address2) - }, "post"); - } - /** - * Query the amount of resources of a specific resourceType delegated by fromAddress to toAddress - */ - async getDelegatedResourceV2(fromAddress = this.tronWeb.defaultAddress.hex, toAddress = this.tronWeb.defaultAddress.hex, options = { confirmed: true }) { - if (!this.tronWeb.isAddress(fromAddress)) { - throw new Error("Invalid address provided"); - } - if (!this.tronWeb.isAddress(toAddress)) { - throw new Error("Invalid address provided"); - } - return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getdelegatedresourcev2`, { - fromAddress: toHex(fromAddress), - toAddress: toHex(toAddress) - }, "post"); - } - /** - * Query the resource delegation index by an account - */ - async getDelegatedResourceAccountIndexV2(address2 = this.tronWeb.defaultAddress.hex, options = { confirmed: true }) { - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getdelegatedresourceaccountindexv2`, { - value: toHex(address2) - }, "post"); - } - /** - * Query the amount of delegatable resources of the specified resource Type for target address, unit is sun. - */ - async getCanDelegatedMaxSize(address2 = this.tronWeb.defaultAddress.hex, resource = "BANDWIDTH", options = { confirmed: true }) { - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - this.validator.notValid([ - { - name: "resource", - type: "resource", - value: resource, - msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' - } - ]); - return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getcandelegatedmaxsize`, { - owner_address: toHex(address2), - type: resource === "ENERGY" ? 1 : 0 - }, "post"); - } - /** - * Remaining times of available unstaking API - */ - async getAvailableUnfreezeCount(address2 = this.tronWeb.defaultAddress.hex, options = { confirmed: true }) { - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getavailableunfreezecount`, { - owner_address: toHex(address2) - }, "post"); - } - /** - * Query the withdrawable balance at the specified timestamp - */ - async getCanWithdrawUnfreezeAmount(address2 = this.tronWeb.defaultAddress.hex, timestamp = Date.now(), options = { confirmed: true }) { - if (!this.tronWeb.isAddress(address2)) { - throw new Error("Invalid address provided"); - } - if (!utils$h.isInteger(timestamp) || timestamp < 0) { - throw new Error("Invalid timestamp provided"); - } - return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getcanwithdrawunfreezeamount`, { - owner_address: toHex(address2), - timestamp - }, "post"); - } - /** - * Get the exchange ID. - */ - async getExchangeByID(exchangeID) { - if (!utils$h.isInteger(exchangeID) || exchangeID < 0) { - throw new Error("Invalid exchangeID provided"); - } - return this.tronWeb.fullNode.request("wallet/getexchangebyid", { - id: exchangeID - }, "post"); - } - /** - * Lists the exchanges - */ - async listExchanges() { - return this.tronWeb.fullNode.request("wallet/listexchanges", {}, "post").then(({ exchanges = [] }) => exchanges); - } - /** - * Lists all network modification proposals. - */ - async listExchangesPaginated(limit = 10, offset2 = 0) { - return this.tronWeb.fullNode.request("wallet/getpaginatedexchangelist", { - limit, - offset: offset2 - }, "post").then(({ exchanges = [] }) => exchanges); - } - /** - * Get info about thre node - */ - async getNodeInfo() { - return this.tronWeb.fullNode.request("wallet/getnodeinfo", {}, "post"); - } - async getTokenListByName(tokenID) { - if (utils$h.isInteger(tokenID)) - tokenID = tokenID.toString(); - if (!utils$h.isString(tokenID) || !tokenID.length) { - throw new Error("Invalid token ID provided"); - } - return this.tronWeb.fullNode.request("wallet/getassetissuelistbyname", { - value: this.tronWeb.fromUtf8(tokenID) - }, "post").then((token2) => { - if (Array.isArray(token2.assetIssue)) { - return token2.assetIssue.map((t2) => this._parseToken(t2)); - } else if (!token2.name) { - throw new Error("Token does not exist"); - } - return this._parseToken(token2); - }); - } - getTokenByID(tokenID) { - if (utils$h.isInteger(tokenID)) - tokenID = tokenID.toString(); - if (!utils$h.isString(tokenID) || !tokenID.length) { - throw new Error("Invalid token ID provided"); - } - return this.tronWeb.fullNode.request("wallet/getassetissuebyid", { - value: tokenID - }, "post").then((token2) => { - if (!token2.name) { - throw new Error("Token does not exist"); - } - return this._parseToken(token2); - }); - } - async getReward(address2, options = {}) { - options.confirmed = true; - return this._getReward(address2, options); - } - async getUnconfirmedReward(address2, options = {}) { - options.confirmed = false; - return this._getReward(address2, options); - } - async getBrokerage(address2, options = {}) { - options.confirmed = true; - return this._getBrokerage(address2, options); - } - async getUnconfirmedBrokerage(address2, options = {}) { - options.confirmed = false; - return this._getBrokerage(address2, options); - } - async _getReward(address2 = this.tronWeb.defaultAddress.hex, options) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - } - ]); - const data = { - address: toHex(address2) - }; - return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getReward`, data, "post").then((result = { reward: void 0 }) => { - if (typeof result.reward === "undefined") { - throw new Error("Not found."); - } - return result.reward; - }); - } - async _getBrokerage(address2 = this.tronWeb.defaultAddress.hex, options) { - this.validator.notValid([ - { - name: "origin", - type: "address", - value: address2 - } - ]); - const data = { - address: toHex(address2) - }; - return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getBrokerage`, data, "post").then((result = {}) => { - if (typeof result.brokerage === "undefined") { - throw new Error("Not found."); - } - return result.brokerage; - }); - } - async getBandwidthPrices() { - return this.tronWeb.fullNode.request("wallet/getbandwidthprices", {}, "post").then((result = {}) => { - if (typeof result.prices === "undefined") { - throw new Error("Not found."); - } - return result.prices; - }); - } - async getEnergyPrices() { - return this.tronWeb.fullNode.request("wallet/getenergyprices", {}, "post").then((result = {}) => { - if (typeof result.prices === "undefined") { - throw new Error("Not found."); - } - return result.prices; - }); - } -} -const getFunctionSelector = (abi2) => { - if ("stateMutability" in abi2) { - abi2.stateMutability = abi2.stateMutability ? abi2.stateMutability.toLowerCase() : "nonpayable"; - } - abi2.type = abi2.type ? abi2.type.toLowerCase() : ""; - if (abi2.type === "fallback" || abi2.type === "receive") - return "0x"; - const iface = new utils$h.ethersUtils.Interface([abi2]); - let obj; - if (abi2.type === "event") { - obj = iface.getEvent(abi2.name); - } else { - obj = iface.getFunction(abi2.name); - } - if (obj) { - return obj.format("sighash"); - } - throw new Error("unknown function"); -}; -const decodeOutput = (abi2, output2) => { - return decodeParamsV2ByABI(abi2, output2); -}; -class Method { - constructor(contract, abi2) { - __publicField(this, "tronWeb"); - __publicField(this, "contract"); - __publicField(this, "abi"); - __publicField(this, "name"); - __publicField(this, "inputs"); - __publicField(this, "outputs"); - __publicField(this, "functionSelector"); - __publicField(this, "signature"); - __publicField(this, "defaultOptions"); - this.tronWeb = contract.tronWeb; - this.contract = contract; - this.abi = abi2; - this.name = abi2.name || abi2.type; - this.inputs = abi2.inputs || []; - this.outputs = []; - if ("outputs" in abi2 && abi2.outputs) { - this.outputs = abi2.outputs; - } - this.functionSelector = getFunctionSelector(abi2); - this.signature = sha3(this.functionSelector, false).slice(0, 8); - this.defaultOptions = { - feeLimit: this.tronWeb.feeLimit, - callValue: 0, - userFeePercentage: 100, - shouldPollResponse: false - // Only used for sign() - }; - } - decodeInput(data) { - const abi2 = JSON.parse(JSON.stringify(this.abi)); - abi2.outputs = abi2.inputs; - return decodeOutput(abi2, "0x" + data); - } - onMethod(...args) { - let rawParameter = ""; - if (this.abi && !/event/i.test(this.abi.type)) { - rawParameter = encodeParamsV2ByABI(this.abi, args); - } - return { - call: async (options = {}) => { - options = { - ...options, - rawParameter - }; - return await this._call([], [], options); - }, - send: async (options = {}, privateKey = this.tronWeb.defaultPrivateKey) => { - options = { - ...options, - rawParameter - }; - return await this._send([], [], options, privateKey); - } - }; - } - async _call(types2, args, options = {}) { - if (types2.length !== args.length) { - throw new Error("Invalid argument count provided"); - } - if (!this.contract.address) { - throw new Error("Smart contract is missing address"); - } - if (!this.contract.deployed) { - throw new Error("Calling smart contracts requires you to load the contract first"); - } - if ("stateMutability" in this.abi) { - const { stateMutability } = this.abi; - if (stateMutability && !["pure", "view"].includes(stateMutability.toLowerCase())) { - throw new Error(`Methods with state mutability "${stateMutability}" must use send()`); - } - } - options = { - ...this.defaultOptions, - from: this.tronWeb.defaultAddress.hex, - ...options, - _isConstant: true - }; - const parameters = args.map((value, index2) => ({ - type: types2[index2], - value - })); - const transaction2 = await this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address, this.functionSelector, options, parameters, options.from ? this.tronWeb.address.toHex(options.from) : void 0); - if (!utils$h.hasProperty(transaction2, "constant_result")) { - throw new Error("Failed to execute"); - } - const len = transaction2.constant_result[0].length; - if (len === 0 || len % 64 === 8) { - let msg = "The call has been reverted or has thrown an error."; - if (len !== 0) { - msg += " Error message: "; - let msg2 = ""; - const chunk = transaction2.constant_result[0].substring(8); - for (let i3 = 0; i3 < len - 8; i3 += 64) { - msg2 += this.tronWeb.toUtf8(chunk.substring(i3, i3 + 64)); - } - msg += msg2.replace(/(\u0000|\u000b|\f)+/g, " ").replace(/ +/g, " ").replace(/\s+$/g, ""); - } - throw new Error(msg); - } - let output2 = decodeOutput(this.abi, "0x" + transaction2.constant_result[0]); - if (output2.length === 1 && Object.keys(output2).length === 1) { - output2 = output2[0]; - } - return output2; - } - async _send(types2, args, options = {}, privateKey = this.tronWeb.defaultPrivateKey) { - if (types2.length !== args.length) { - throw new Error("Invalid argument count provided"); - } - if (!this.contract.address) { - throw new Error("Smart contract is missing address"); - } - if (!this.contract.deployed) { - throw new Error("Calling smart contracts requires you to load the contract first"); - } - const { stateMutability } = this.abi; - if (["pure", "view"].includes(stateMutability.toLowerCase())) { - throw new Error(`Methods with state mutability "${stateMutability}" must use call()`); - } - if (!["payable"].includes(stateMutability.toLowerCase())) { - options.callValue = 0; - } - options = { - ...this.defaultOptions, - from: this.tronWeb.defaultAddress.hex, - ...options - }; - const parameters = args.map((value, index2) => ({ - type: types2[index2], - value - })); - const address2 = privateKey ? this.tronWeb.address.fromPrivateKey(privateKey) : this.tronWeb.defaultAddress.base58; - const transaction2 = await this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address, this.functionSelector, options, parameters, this.tronWeb.address.toHex(address2)); - if (!transaction2.result || !transaction2.result.result) { - throw new Error("Unknown error: " + JSON.stringify(transaction2, null, 2)); - } - const signedTransaction = await this.tronWeb.trx.sign(transaction2.transaction, privateKey); - if (!signedTransaction.signature) { - if (!privateKey) { - throw new Error("Transaction was not signed properly"); - } - throw new Error("Invalid private key provided"); - } - const broadcast = await this.tronWeb.trx.sendRawTransaction(signedTransaction); - if (broadcast.code) { - const err = { - error: broadcast.code, - message: broadcast.code - }; - if (broadcast.message) - err.message = this.tronWeb.toUtf8(broadcast.message); - const error = new Error(err.message); - error.error = broadcast.code; - throw error; - } - if (!options.shouldPollResponse) { - return signedTransaction.txID; - } - const checkResult = async (index2) => { - if (index2 === (options.pollTimes || 20)) { - const error = new Error("Cannot find result in solidity node"); - error.error = "Cannot find result in solidity node"; - error.transaction = signedTransaction; - throw error; - } - const output2 = await this.tronWeb.trx.getTransactionInfo(signedTransaction.txID); - if (!Object.keys(output2).length) { - await new Promise((r2) => setTimeout(r2, 3e3)); - return checkResult(index2 + 1); - } - if (output2.result && output2.result === "FAILED") { - const error = new Error(this.tronWeb.toUtf8(output2.resMessage)); - error.error = this.tronWeb.toUtf8(output2.resMessage); - error.transaction = signedTransaction; - error.output = output2; - throw error; - } - if (!utils$h.hasProperty(output2, "contractResult")) { - const error = new Error("Failed to execute: " + JSON.stringify(output2, null, 2)); - error.error = "Failed to execute: " + JSON.stringify(output2, null, 2); - error.transaction = signedTransaction; - error.output = output2; - throw error; - } - if (options.rawResponse) { - return output2; - } - let decoded = decodeOutput(this.abi, "0x" + output2.contractResult[0]); - if (decoded.length === 1 && Object.keys(decoded).length === 1) { - decoded = decoded[0]; - } - if (options.keepTxID) { - return [signedTransaction.txID, decoded]; - } - return decoded; - }; - return checkResult(0); - } -} -class Contract { - constructor(tronWeb, abi2 = [], address2) { - __publicField(this, "tronWeb"); - __publicField(this, "abi"); - __publicField(this, "address"); - __publicField(this, "eventListener"); - __publicField(this, "bytecode"); - __publicField(this, "deployed"); - __publicField(this, "lastBlock"); - __publicField(this, "methods"); - __publicField(this, "methodInstances"); - __publicField(this, "props"); - if (!tronWeb || !(tronWeb instanceof TronWeb)) - throw new Error("Expected instance of TronWeb"); - this.tronWeb = tronWeb; - this.address = address2; - this.abi = abi2; - this.eventListener = false; - this.bytecode = false; - this.deployed = false; - this.lastBlock = false; - this.methods = {}; - this.methodInstances = {}; - this.props = []; - if (utils$h.address.isAddress(address2)) { - this.deployed = true; - } else { - this.address = false; - } - this.loadAbi(abi2); - } - hasProperty(property) { - return this.hasOwnProperty(property) || this.__proto__.hasOwnProperty(property); - } - loadAbi(abi2) { - this.abi = abi2; - this.methods = {}; - this.props.forEach((prop) => delete this[prop]); - abi2.forEach((func) => { - if (!func.type || /constructor|error/i.test(func.type)) - return; - const method = new Method(this, func); - const methodCall = method.onMethod.bind(method); - const { name: name2, functionSelector, signature: signature2 } = method; - this.methods[name2] = methodCall; - this.methods[functionSelector] = methodCall; - this.methods[signature2] = methodCall; - this.methodInstances[name2] = method; - this.methodInstances[functionSelector] = method; - this.methodInstances[signature2] = method; - if (!this.hasProperty(name2)) { - this[name2] = methodCall; - this.props.push(name2); - } - if (!this.hasProperty(functionSelector)) { - this[functionSelector] = methodCall; - this.props.push(functionSelector); - } - if (!this.hasProperty(signature2)) { - this[signature2] = methodCall; - this.props.push(signature2); - } - }); - } - decodeInput(data) { - const methodName = data.substring(0, 8); - const inputData = data.substring(8); - if (!this.methodInstances[methodName]) - throw new Error("Contract method " + methodName + " not found"); - const methodInstance = this.methodInstances[methodName]; - return { - name: methodInstance.name, - params: this.methodInstances[methodName].decodeInput(inputData) - }; - } - async new(options, privateKey = this.tronWeb.defaultPrivateKey) { - const address2 = this.tronWeb.address.fromPrivateKey(privateKey); - const transaction2 = await this.tronWeb.transactionBuilder.createSmartContract(options, address2); - const signedTransaction = await this.tronWeb.trx.sign(transaction2, privateKey); - const contract = await this.tronWeb.trx.sendRawTransaction(signedTransaction); - if (contract.code) { - throw { - error: contract.code, - message: this.tronWeb.toUtf8(contract.message) - }; - } - await utils$h.sleep(3e3); - return this.at(signedTransaction.contract_address); - } - async at(contractAddress) { - try { - const contract = await this.tronWeb.trx.getContract(contractAddress); - if (!contract.contract_address) { - throw new Error("Unknown error: " + JSON.stringify(contract, null, 2)); - } - this.address = contract.contract_address; - this.bytecode = contract.bytecode; - this.deployed = true; - this.loadAbi(contract.abi ? contract.abi.entrys ? contract.abi.entrys : [] : []); - return this; - } catch (ex2) { - if (ex2.toString().includes("does not exist")) { - throw new Error("Contract has not been deployed on the network"); - } - throw new Error(ex2); - } - } -} -class Plugin { - constructor(tronWeb, options = {}) { - __publicField(this, "tronWeb"); - __publicField(this, "pluginNoOverride"); - __publicField(this, "disablePlugins"); - if (!tronWeb || !(tronWeb instanceof TronWeb)) - throw new Error("Expected instance of TronWeb"); - this.tronWeb = tronWeb; - this.pluginNoOverride = ["register"]; - this.disablePlugins = !!options.disablePlugins; - } - register(Plugin2, options) { - let pluginInterface = { - requires: "0.0.0", - components: {} - }; - const result = { - libs: [], - plugged: [], - skipped: [], - error: void 0 - }; - if (this.disablePlugins) { - result.error = "This instance of TronWeb has plugins disabled."; - return result; - } - const plugin = new Plugin2(this.tronWeb); - if (utils$h.isFunction(plugin.pluginInterface)) { - pluginInterface = plugin.pluginInterface(options); - } - if (semver.satisfies(TronWeb.version, pluginInterface.requires)) { - if (pluginInterface.fullClass) { - const className = plugin.constructor.name; - const classInstanceName = className.substring(0, 1).toLowerCase() + className.substring(1); - if (className !== classInstanceName) { - Object.assign(TronWeb, { - [className]: Plugin2 - }); - Object.assign(this.tronWeb, { - [classInstanceName]: plugin - }); - result.libs.push(className); - } - } else { - for (const component in pluginInterface.components) { - if (!this.tronWeb.hasOwnProperty(component)) { - continue; - } - const methods = pluginInterface.components[component]; - const pluginNoOverride = this.tronWeb[component].pluginNoOverride || []; - for (const method in methods) { - if (method === "constructor" || this.tronWeb[component][method] && (pluginNoOverride.includes(method) || // blacklisted methods - /^_/.test(method))) { - result.skipped.push(method); - continue; - } - this.tronWeb[component][method] = methods[method].bind(this.tronWeb[component]); - result.plugged.push(method); - } - } - } - } else { - throw new Error("The plugin is not compatible with this version of TronWeb"); - } - return result; - } -} -let Event$1 = class Event2 { - constructor(tronWeb) { - __publicField(this, "tronWeb"); - if (!tronWeb || !(tronWeb instanceof TronWeb)) - throw new Error("Expected instance of TronWeb"); - this.tronWeb = tronWeb; - } - setServer(eventServer, healthcheck = "healthcheck") { - if (!eventServer) - return this.tronWeb.eventServer = void 0; - if (utils$h.isString(eventServer)) - eventServer = new HttpProvider(eventServer); - if (!this.tronWeb.isValidProvider(eventServer)) - throw new Error("Invalid event server provided"); - this.tronWeb.eventServer = eventServer; - this.tronWeb.eventServer.isConnected = () => this.tronWeb.eventServer.request(healthcheck).then(() => true).catch(() => false); - } - async getEventsByContractAddress(contractAddress, options = {}) { - const newOptions = Object.assign({ - limit: 20 - }, options); - const { eventName, blockNumber, onlyUnconfirmed, onlyConfirmed, minBlockTimestamp, maxBlockTimestamp, orderBy, fingerprint } = newOptions; - let { limit } = newOptions; - if (!this.tronWeb.eventServer) { - throw new Error("No event server configured"); - } - if (!this.tronWeb.isAddress(contractAddress)) { - throw new Error("Invalid contract address provided"); - } - if (typeof minBlockTimestamp !== "undefined" && !utils$h.isInteger(minBlockTimestamp)) { - throw new Error("Invalid minBlockTimestamp provided"); - } - if (typeof maxBlockTimestamp !== "undefined" && !utils$h.isInteger(maxBlockTimestamp)) { - throw new Error("Invalid maxBlockTimestamp provided"); - } - if (utils$h.isInteger(limit) && limit > 200) { - console.warn("Defaulting to maximum accepted limit: 200"); - limit = 200; - } - const qs2 = {}; - if (eventName) - qs2.event_name = eventName; - if (blockNumber) - qs2.block_number = blockNumber; - if (typeof onlyUnconfirmed === "boolean") - qs2.only_unconfirmed = onlyUnconfirmed; - if (typeof onlyConfirmed === "boolean") - qs2.only_confirmed = onlyConfirmed; - if (minBlockTimestamp) - qs2.min_block_timestamp = minBlockTimestamp; - if (maxBlockTimestamp) - qs2.max_block_timestamp = maxBlockTimestamp; - if (orderBy) - qs2.order_by = orderBy; - if (fingerprint) - qs2.fingerprint = fingerprint; - if (utils$h.isInteger(limit)) - qs2.limit = limit; - const res = await this.tronWeb.eventServer.request(`v1/contracts/${this.tronWeb.address.fromHex(contractAddress)}/events?${new URLSearchParams(qs2).toString()}`); - if (res.success) { - return res; - } - throw new Error(res.error); - } - async getEventsByTransactionID(transactionID, options = {}) { - if (!this.tronWeb.eventServer) { - throw new Error("No event server configured"); - } - const qs2 = {}; - if (typeof options.only_unconfirmed === "boolean") { - qs2.only_unconfirmed = options.only_unconfirmed; - } - if (typeof options.only_confirmed === "boolean") { - qs2.only_confirmed = options.only_confirmed; - } - return this.tronWeb.eventServer.request(`v1/transactions/${transactionID}/events?${new URLSearchParams(qs2).toString()}`).then((res) => { - if (res.success) { - return res; - } - throw new Error(JSON.parse(res.error).message); - }); - } - async getEventsByBlockNumber(blockNumber, options = {}) { - if (!this.tronWeb.eventServer) { - throw new Error("No event server configured"); - } - const qs2 = {}; - if (typeof options.only_confirmed === "boolean") { - qs2.only_confirmed = options.only_confirmed; - } - if (options.limit) { - qs2.limit = options.limit; - } - if (options.fingerprint) { - qs2.fingerprint = options.fingerprint; - } - return this.tronWeb.eventServer.request(`v1/blocks/${blockNumber}/events?${new URLSearchParams(qs2).toString()}`).then((res) => { - if (res.success) { - return res; - } - throw new Error(res.error); - }); - } - async getEventsOfLatestBlock(options = {}) { - if (!this.tronWeb.eventServer) { - throw new Error("No event server configured"); - } - const qs2 = {}; - if (typeof options.only_confirmed === "boolean") { - qs2.only_confirmed = options.only_confirmed; - } - return this.tronWeb.eventServer.request(`v1/blocks/latest/events?${new URLSearchParams(qs2).toString()}`).then((res) => { - if (res.success) { - return res; - } - throw new Error(res.error); - }); - } -}; -const DEFAULT_VERSION = "4.7.1"; -const FEE_LIMIT = 15e7; -const version$2 = "6.0.0"; -function isValidOptions(options) { - return !!options && typeof options === "object" && (!!options.fullNode || !!options.fullHost); -} -const _TronWeb = class _TronWeb extends EventEmitter$2 { - constructor(options, solidityNode = "", eventServer, privateKey = "") { - super(); - __publicField(this, "providers"); - __publicField(this, "BigNumber"); - __publicField(this, "transactionBuilder"); - __publicField(this, "trx"); - __publicField(this, "plugin"); - __publicField(this, "event"); - __publicField(this, "version"); - __publicField(this, "utils"); - __publicField(this, "defaultBlock"); - __publicField(this, "defaultPrivateKey"); - __publicField(this, "defaultAddress"); - __publicField(this, "fullnodeVersion"); - __publicField(this, "feeLimit"); - __publicField(this, "fullNode"); - __publicField(this, "solidityNode"); - __publicField(this, "eventServer"); - __publicField(this, "address"); - __publicField(this, "sha3"); - __publicField(this, "toHex"); - __publicField(this, "toUtf8"); - __publicField(this, "fromUtf8"); - __publicField(this, "toAscii"); - __publicField(this, "fromAscii"); - __publicField(this, "toDecimal"); - __publicField(this, "fromDecimal"); - __publicField(this, "fromSun"); - __publicField(this, "toSun"); - __publicField(this, "toBigNumber"); - __publicField(this, "isAddress"); - __publicField(this, "createAccount"); - __publicField(this, "createRandom"); - __publicField(this, "fromMnemonic"); - let fullNode; - let headers = false; - let eventHeaders = false; - if (isValidOptions(options)) { - fullNode = options.fullNode || options.fullHost; - solidityNode = options.solidityNode || options.fullHost; - eventServer = options.eventServer || options.fullHost; - headers = options.headers || false; - eventHeaders = options.eventHeaders || headers; - privateKey = options.privateKey; - } else { - fullNode = options; - } - if (utils$h.isString(fullNode)) - fullNode = new providers.HttpProvider(fullNode); - if (utils$h.isString(solidityNode)) - solidityNode = new providers.HttpProvider(solidityNode); - if (utils$h.isString(eventServer)) - eventServer = new providers.HttpProvider(eventServer); - this.event = new Event$1(this); - this.transactionBuilder = new TransactionBuilder(this); - this.trx = new Trx(this); - this.plugin = new Plugin(this, { - disablePlugins: isValidOptions(options) ? options.disablePlugins : false - }); - this.utils = utils$h; - this.setFullNode(fullNode); - this.setSolidityNode(solidityNode); - this.setEventServer(eventServer); - this.providers = providers; - this.BigNumber = BigNumber; - this.defaultBlock = false; - this.defaultPrivateKey = false; - this.defaultAddress = { - hex: false, - base58: false - }; - this.version = _TronWeb.version; - this.sha3 = _TronWeb.sha3; - this.fromUtf8 = _TronWeb.fromUtf8; - this.address = _TronWeb.address; - this.toAscii = _TronWeb.toAscii; - this.toUtf8 = _TronWeb.toUtf8; - this.isAddress = _TronWeb.isAddress; - this.fromAscii = _TronWeb.fromAscii; - this.toHex = _TronWeb.toHex; - this.toBigNumber = _TronWeb.toBigNumber; - this.toDecimal = _TronWeb.toDecimal; - this.fromDecimal = _TronWeb.fromDecimal; - this.toSun = _TronWeb.toSun; - this.fromSun = _TronWeb.fromSun; - this.createAccount = _TronWeb.createAccount; - this.createRandom = _TronWeb.createRandom; - this.fromMnemonic = _TronWeb.fromMnemonic; - if (privateKey) - this.setPrivateKey(privateKey); - this.fullnodeVersion = DEFAULT_VERSION; - this.feeLimit = FEE_LIMIT; - if (headers) { - this.setFullNodeHeader(headers); - } - if (eventHeaders) { - this.setEventHeader(eventHeaders); - } - } - async getFullnodeVersion() { - try { - const nodeInfo = await this.trx.getNodeInfo(); - this.fullnodeVersion = nodeInfo.configNodeInfo.codeVersion; - if (this.fullnodeVersion.split(".").length === 2) { - this.fullnodeVersion += ".0"; - } - } catch (err) { - this.fullnodeVersion = DEFAULT_VERSION; - } - } - setDefaultBlock(blockID = false) { - if ([false, "latest", "earliest", 0].includes(blockID)) { - return this.defaultBlock = blockID; - } - if (!utils$h.isInteger(blockID) || !blockID) - throw new Error("Invalid block ID provided"); - return this.defaultBlock = Math.abs(blockID); - } - setPrivateKey(privateKey) { - try { - this.setAddress(_TronWeb.address.fromPrivateKey(privateKey)); - } catch { - throw new Error("Invalid private key provided"); - } - this.defaultPrivateKey = privateKey; - this.emit("privateKeyChanged", privateKey); - } - setAddress(address2) { - if (!_TronWeb.isAddress(address2)) - throw new Error("Invalid address provided"); - const hex = _TronWeb.address.toHex(address2); - const base582 = _TronWeb.address.fromHex(address2); - if (this.defaultPrivateKey && _TronWeb.address.fromPrivateKey(this.defaultPrivateKey) !== base582) - this.defaultPrivateKey = false; - this.defaultAddress = { - hex, - base58: base582 - }; - this.emit("addressChanged", { hex, base58: base582 }); - } - fullnodeSatisfies(version2) { - return semver.satisfies(this.fullnodeVersion, version2); - } - isValidProvider(provider) { - return Object.values(providers).some((knownProvider) => provider instanceof knownProvider); - } - setFullNode(fullNode) { - if (isString$1(fullNode)) - fullNode = new providers.HttpProvider(fullNode); - if (!this.isValidProvider(fullNode)) - throw new Error("Invalid full node provided"); - this.fullNode = fullNode; - this.fullNode.setStatusPage("wallet/getnowblock"); - } - setSolidityNode(solidityNode) { - if (utils$h.isString(solidityNode)) - solidityNode = new providers.HttpProvider(solidityNode); - if (!this.isValidProvider(solidityNode)) - throw new Error("Invalid solidity node provided"); - this.solidityNode = solidityNode; - this.solidityNode.setStatusPage("walletsolidity/getnowblock"); - } - setEventServer(eventServer, healthcheck) { - this.event.setServer(eventServer, healthcheck); - } - setHeader(headers = {}) { - const fullNode = new providers.HttpProvider(this.fullNode.host, 3e4, "", "", headers); - const solidityNode = new providers.HttpProvider(this.solidityNode.host, 3e4, "", "", headers); - const eventServer = new providers.HttpProvider(this.eventServer.host, 3e4, "", "", headers); - this.setFullNode(fullNode); - this.setSolidityNode(solidityNode); - this.setEventServer(eventServer); - } - setFullNodeHeader(headers = {}) { - const fullNode = new providers.HttpProvider(this.fullNode.host, 3e4, "", "", headers); - const solidityNode = new providers.HttpProvider(this.solidityNode.host, 3e4, "", "", headers); - this.setFullNode(fullNode); - this.setSolidityNode(solidityNode); - } - setEventHeader(headers = {}) { - const eventServer = new providers.HttpProvider(this.eventServer.host, 3e4, "", "", headers); - this.setEventServer(eventServer); - } - currentProviders() { - return { - fullNode: this.fullNode, - solidityNode: this.solidityNode, - eventServer: this.eventServer - }; - } - currentProvider() { - return this.currentProviders(); - } - getEventResult(...params) { - return this.event.getEventsByContractAddress(...params); - } - getEventByTransactionID(...params) { - return this.event.getEventsByTransactionID(...params); - } - contract(abi2 = [], address2) { - return new Contract(this, abi2, address2); - } - static get address() { - return { - fromHex(address2) { - return fromHex(address2); - }, - toHex(address2) { - return toHex$1(address2); - }, - toChecksumAddress(address2) { - return toChecksumAddress(address2); - }, - isChecksumAddress(address2) { - return isChecksumAddress(address2); - }, - fromPrivateKey(privateKey, strict = false) { - return fromPrivateKey(privateKey, strict); - } - }; - } - static sha3(string2, prefix = true) { - return (prefix ? "0x" : "") + keccak256(Buffer.from(string2, "utf-8")).toString().substring(2); - } - static toHex(val) { - if (utils$h.isBoolean(val)) - return _TronWeb.fromDecimal(+val); - if (utils$h.isBigNumber(val)) - return _TronWeb.fromDecimal(val); - if (typeof val === "object") - return _TronWeb.fromUtf8(JSON.stringify(val)); - if (utils$h.isString(val)) { - if (/^(-|)0x/.test(val)) - return val; - if (!isFinite(val) || /^\s*$/.test(val)) - return _TronWeb.fromUtf8(val); - } - const result = _TronWeb.fromDecimal(val); - if (result === "0xNaN") { - throw new Error("The passed value is not convertible to a hex string"); - } else { - return result; - } - } - static toUtf8(hex) { - if (utils$h.isHex(hex)) { - hex = hex.replace(/^0x/, ""); - return Buffer.from(hex, "hex").toString("utf8"); - } else { - throw new Error("The passed value is not a valid hex string"); - } - } - static fromUtf8(string2) { - if (!utils$h.isString(string2)) { - throw new Error("The passed value is not a valid utf-8 string"); - } - return "0x" + Buffer.from(string2, "utf8").toString("hex"); - } - static toAscii(hex) { - if (utils$h.isHex(hex)) { - let str = ""; - let i3 = 0; - const l2 = hex.length; - if (hex.substring(0, 2) === "0x") { - i3 = 2; - } - for (; i3 < l2; i3 += 2) { - const code2 = parseInt(hex.substr(i3, 2), 16); - str += String.fromCharCode(code2); - } - return str; - } else { - throw new Error("The passed value is not a valid hex string"); - } - } - static fromAscii(string2, padding2) { - if (!utils$h.isString(string2)) { - throw new Error("The passed value is not a valid utf-8 string"); - } - return "0x" + Buffer.from(string2, "ascii").toString("hex").padEnd(padding2, "0"); - } - static toDecimal(value) { - return _TronWeb.toBigNumber(value).toNumber(); - } - static fromDecimal(value) { - const number2 = _TronWeb.toBigNumber(value); - const result = number2.toString(16); - return number2.isLessThan(0) ? "-0x" + result.substr(1) : "0x" + result; - } - static fromSun(sun) { - const trx = _TronWeb.toBigNumber(sun).div(1e6); - return utils$h.isBigNumber(sun) ? trx : trx.toString(10); - } - static toSun(trx) { - const sun = _TronWeb.toBigNumber(trx).times(1e6); - return utils$h.isBigNumber(trx) ? sun : sun.toString(10); - } - static toBigNumber(amount = 0) { - if (utils$h.isBigNumber(amount)) - return amount; - if (utils$h.isString(amount) && /^(-|)0x/.test(amount)) - return new BigNumber(amount.replace("0x", ""), 16); - return new BigNumber(amount.toString(10), 10); - } - static isAddress(address2 = "") { - return isAddress(address2); - } - static async createAccount() { - const account = utils$h.accounts.generateAccount(); - return account; - } - static createRandom(...params) { - const account = utils$h.accounts.generateRandom(...params); - return account; - } - static fromMnemonic(...params) { - const account = utils$h.accounts.generateAccountWithMnemonic(...params); - return account; - } - async isConnected() { - return { - fullNode: await this.fullNode.isConnected(), - solidityNode: await this.solidityNode.isConnected(), - eventServer: this.eventServer && await this.eventServer.isConnected() - }; - } -}; -__publicField(_TronWeb, "version", version$2); -let TronWeb = _TronWeb; -function getAddress(address2) { - return TronWeb.address.toHex(address2).replace(ADDRESS_PREFIX_REGEX, "0x"); -} -function getTronAddress(address2) { - return TronWeb.address.toHex(address2); -} -const padding = new Uint8Array(32); -padding.fill(0); -const BN__1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -function hexPadRight(value) { - const bytes2 = getBytes(value); - const padOffset = bytes2.length % 32; - if (padOffset) { - return concat$1([bytes2, padding.slice(padOffset)]); - } - return hexlify(bytes2); -} -const hexTrue = toBeHex(BN_1, 32); -const hexFalse = toBeHex(BN_0, 32); -const domainFieldTypes = { - name: "string", - version: "string", - chainId: "uint256", - verifyingContract: "address", - salt: "bytes32" -}; -const domainFieldNames = ["name", "version", "chainId", "verifyingContract", "salt"]; -function checkString(key2) { - return function(value) { - assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key2)}`, `domain.${key2}`, value); - return value; - }; -} -const domainChecks = { - name: checkString("name"), - version: checkString("version"), - chainId: function(_value2) { - const value = getBigInt(_value2, "domain.chainId"); - assertArgument(value >= 0, "invalid chain ID", "domain.chainId", _value2); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function(value) { - try { - return getTronAddress(value).toLowerCase(); - } catch (error) { - } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function(value) { - const bytes2 = getBytes(value, "domain.salt"); - assertArgument(bytes2.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes2); - } -}; -function getBaseEncoder(type2) { - { - const match = type2.match(/^(u?)int(\d*)$/); - if (match) { - const signed = match[1] === ""; - const width = parseInt(match[2] || "256"); - assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type2); - const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); - const boundsLower = signed ? (boundsUpper + BN_1) * BN__1 : BN_0; - return function(_value2) { - const value = getBigInt(_value2, "value"); - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type2}`, "value", value); - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - { - const match = type2.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type2); - return function(value) { - const bytes2 = getBytes(value); - assertArgument(bytes2.length === width, `invalid length for ${type2}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type2) { - case "trcToken": - return getBaseEncoder("uint256"); - case "address": - return function(value) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": - return function(value) { - return !value ? hexFalse : hexTrue; - }; - case "bytes": - return function(value) { - return keccak256(value); - }; - case "string": - return function(value) { - return id(value); - }; - } - return null; -} -function encodeType(name2, fields) { - return `${name2}(${fields.map(({ name: name3, type: type2 }) => type2 + " " + name3).join(",")})`; -} -const _TypedDataEncoder = class _TypedDataEncoder { - /** - * Create a new **TypedDataEncoder** for %%types%%. - * - * This performs all necessary checking that types are valid and - * do not violate the [[link-eip-712]] structural constraints as - * well as computes the [[primaryType]]. - */ - constructor(types2) { - __privateAdd(this, _getEncoder2); - /** - * The primary type for the structured [[types]]. - * - * This is derived automatically from the [[types]], since no - * recursion is possible, once the DAG for the types is consturcted - * internally, the primary type must be the only remaining type with - * no parent nodes. - */ - __publicField(this, "primaryType"); - __privateAdd(this, _types2, void 0); - __privateAdd(this, _fullTypes2, void 0); - __privateAdd(this, _encoderCache2, void 0); - __privateSet(this, _types2, JSON.stringify(types2)); - __privateSet(this, _fullTypes2, /* @__PURE__ */ new Map()); - __privateSet(this, _encoderCache2, /* @__PURE__ */ new Map()); - const links = /* @__PURE__ */ new Map(); - const parents = /* @__PURE__ */ new Map(); - const subtypes = /* @__PURE__ */ new Map(); - Object.keys(types2).forEach((type2) => { - links.set(type2, /* @__PURE__ */ new Set()); - parents.set(type2, []); - subtypes.set(type2, /* @__PURE__ */ new Set()); - }); - for (const name2 in types2) { - const uniqueNames = /* @__PURE__ */ new Set(); - for (const field of types2[name2]) { - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name2)}`, "types", types2); - uniqueNames.add(field.name); - const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1] || null; - assertArgument(baseType !== name2, `circular type reference to ${JSON.stringify(baseType)}`, "types", types2); - const encoder2 = getBaseEncoder(baseType); - if (encoder2) { - continue; - } - assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types2); - parents.get(baseType).push(name2); - links.get(name2).add(baseType); - } - } - const primaryTypes = Array.from(parents.keys()).filter((n4) => parents.get(n4).length === 0); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", types2); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t2) => JSON.stringify(t2)).join(", ")}`, "types", types2); - defineProperties(this, { primaryType: primaryTypes[0] }); - function checkCircular(type2, found) { - assertArgument(!found.has(type2), `circular type reference to ${JSON.stringify(type2)}`, "types", types2); - found.add(type2); - for (const child of links.get(type2)) { - if (!parents.has(child)) { - continue; - } - checkCircular(child, found); - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type2); - } - checkCircular(this.primaryType, /* @__PURE__ */ new Set()); - for (const [name2, set2] of subtypes) { - const st2 = Array.from(set2); - st2.sort(); - __privateGet(this, _fullTypes2).set(name2, encodeType(name2, types2[name2]) + st2.map((t2) => encodeType(t2, types2[t2])).join("")); - } - } - /** - * The types. - */ - get types() { - return JSON.parse(__privateGet(this, _types2)); - } - /** - * Returnthe encoder for the specific %%type%%. - */ - getEncoder(type2) { - let encoder2 = __privateGet(this, _encoderCache2).get(type2); - if (!encoder2) { - encoder2 = __privateMethod(this, _getEncoder2, getEncoder_fn2).call(this, type2); - __privateGet(this, _encoderCache2).set(type2, encoder2); - } - return encoder2; - } - /** - * Return the full type for %%name%%. - */ - encodeType(name2) { - const result = __privateGet(this, _fullTypes2).get(name2); - assertArgument(result, `unknown type: ${JSON.stringify(name2)}`, "name", name2); - return result; - } - /** - * Return the encoded %%value%% for the %%type%%. - */ - encodeData(type2, value) { - return this.getEncoder(type2)(value); - } - /** - * Returns the hash of %%value%% for the type of %%name%%. - */ - hashStruct(name2, value) { - return keccak256(this.encodeData(name2, value)); - } - /** - * Return the fulled encoded %%value%% for the [[types]]. - */ - encode(value) { - return this.encodeData(this.primaryType, value); - } - /** - * Return the hash of the fully encoded %%value%% for the [[types]]. - */ - hash(value) { - return this.hashStruct(this.primaryType, value); - } - /** - * @_ignore: - */ - _visit(type2, value, callback) { - { - const encoder2 = getBaseEncoder(type2); - if (encoder2) { - return callback(type2, value); - } - } - const match = type2.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - return value.map((v6) => this._visit(match[1], v6, callback)); - } - const fields = this.types[type2]; - if (fields) { - return fields.reduce((accum, { name: name2, type: type3 }) => { - accum[name2] = this._visit(type3, value[name2], callback); - return accum; - }, {}); - } - assertArgument(false, `unknown type: ${type2}`, "type", type2); - } - /** - * Call %%calback%% for each value in %%value%%, passing the type and - * component within %%value%%. - * - * This is useful for replacing addresses or other transformation that - * may be desired on each component, based on its type. - */ - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - /** - * Create a new **TypedDataEncoder** for %%types%%. - */ - static from(types2) { - return new _TypedDataEncoder(types2); - } - /** - * Return the primary type for %%types%%. - */ - static getPrimaryType(types2) { - return _TypedDataEncoder.from(types2).primaryType; - } - /** - * Return the hashed struct for %%value%% using %%types%% and %%name%%. - */ - static hashStruct(name2, types2, value) { - return _TypedDataEncoder.from(types2).hashStruct(name2, value); - } - /** - * Return the domain hash for %%domain%%. - */ - static hashDomain(domain) { - const domainFields = []; - for (const name2 in domain) { - if (domain[name2] == null) { - continue; - } - const type2 = domainFieldTypes[name2]; - assertArgument(type2, `invalid typed-data domain key: ${JSON.stringify(name2)}`, "domain", domain); - domainFields.push({ name: name2, type: type2 }); - } - domainFields.sort((a3, b2) => { - return domainFieldNames.indexOf(a3.name) - domainFieldNames.indexOf(b2.name); - }); - return _TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - /** - * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static encode(domain, types2, value) { - return concat$1(["0x1901", _TypedDataEncoder.hashDomain(domain), _TypedDataEncoder.from(types2).hash(value)]); - } - /** - * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static hash(domain, types2, value) { - return keccak256(_TypedDataEncoder.encode(domain, types2, value)); - } - // Replaces all address types with ENS names with their looked up address - /** - * Resolves to the value from resolving all addresses in %%value%% for - * %%types%% and the %%domain%%. - */ - static async resolveNames(domain, types2, value, resolveName) { - domain = Object.assign({}, domain); - for (const key2 in domain) { - if (domain[key2] == null) { - delete domain[key2]; - } - } - const ensCache = {}; - if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - const encoder2 = _TypedDataEncoder.from(types2); - encoder2.visit(value, (type2, value2) => { - if (type2 === "address" && !isHexString(value2, 20)) { - ensCache[value2] = "0x"; - } - return value2; - }); - for (const name2 in ensCache) { - ensCache[name2] = await resolveName(name2); - } - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - value = encoder2.visit(value, (type2, value2) => { - if (type2 === "address" && ensCache[value2]) { - return ensCache[value2]; - } - return value2; - }); - return { domain, value }; - } - /** - * Returns the JSON-encoded payload expected by nodes which implement - * the JSON-RPC [[link-eip-712]] method. - */ - static getPayload(domain, types2, value) { - _TypedDataEncoder.hashDomain(domain); - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name2) => { - const value2 = domain[name2]; - if (value2 == null) { - return; - } - domainValues[name2] = domainChecks[name2](value2); - domainTypes.push({ name: name2, type: domainFieldTypes[name2] }); - }); - const encoder2 = _TypedDataEncoder.from(types2); - const typesWithDomain = Object.assign({}, types2); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types2); - typesWithDomain.EIP712Domain = domainTypes; - encoder2.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder2.primaryType, - message: encoder2.visit(value, (type2, value2) => { - if (type2.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value2)); - } - if (type2.match(/^u?int/)) { - return getBigInt(value2).toString(); - } - switch (type2) { - case "trcToken": - return getBigInt(value2).toString(); - case "address": - return value2.toLowerCase(); - case "bool": - return !!value2; - case "string": - assertArgument(typeof value2 === "string", "invalid string", "value", value2); - return value2; - } - assertArgument(false, "unsupported type", "type", type2); - }) - }; - } -}; -_types2 = new WeakMap(); -_fullTypes2 = new WeakMap(); -_encoderCache2 = new WeakMap(); -_getEncoder2 = new WeakSet(); -getEncoder_fn2 = function(type2) { - { - const encoder2 = getBaseEncoder(type2); - if (encoder2) { - return encoder2; - } - } - const match = type2.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - const subtype = match[1]; - const subEncoder = this.getEncoder(subtype); - return (value) => { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - let result = value.map(subEncoder); - if (__privateGet(this, _fullTypes2).has(subtype)) { - result = result.map(keccak256); - } - return keccak256(concat$1(result)); - }; - } - const fields = this.types[type2]; - if (fields) { - const encodedType = id(__privateGet(this, _fullTypes2).get(type2)); - return (value) => { - const values = fields.map(({ name: name2, type: type3 }) => { - const result = this.getEncoder(type3)(value[name2]); - if (__privateGet(this, _fullTypes2).has(type3)) { - return keccak256(result); - } - return result; - }); - values.unshift(encodedType); - return concat$1(values); - }; - } - assertArgument(false, `unknown type: ${type2}`, "type", type2); -}; -let TypedDataEncoder = _TypedDataEncoder; -function normalizePrivateKeyBytes(priKeyBytes) { - return hexStr2byteArray(byteArray2hexStr(priKeyBytes).padStart(64, "0")); -} -function getBase58CheckAddress(addressBytes) { - const hash0 = SHA2563(addressBytes); - const hash1 = SHA2563(hash0); - let checkSum = hash1.slice(0, 4); - checkSum = addressBytes.concat(checkSum); - return encode58(checkSum); -} -function decodeBase58Address(base58Sting) { - if (typeof base58Sting != "string") - return false; - if (base58Sting.length <= 4) - return false; - let address2 = decode58(base58Sting); - if (base58Sting.length <= 4) - return false; - const len = address2.length; - const offset2 = len - 4; - const checkSum = address2.slice(offset2); - address2 = address2.slice(0, offset2); - const hash0 = SHA2563(address2); - const hash1 = SHA2563(hash0); - const checkSum1 = hash1.slice(0, 4); - if (checkSum[0] == checkSum1[0] && checkSum[1] == checkSum1[1] && checkSum[2] == checkSum1[2] && checkSum[3] == checkSum1[3]) { - return address2; - } - throw new Error("Invalid address provided"); -} -function signTransaction(priKeyBytes, transaction2) { - if (typeof priKeyBytes === "string") - priKeyBytes = hexStr2byteArray(priKeyBytes); - const txID = transaction2.txID; - const signature2 = ECKeySign(hexStr2byteArray(txID), priKeyBytes); - if (Array.isArray(transaction2.signature)) { - if (!transaction2.signature.includes(signature2)) - transaction2.signature.push(signature2); - } else - transaction2.signature = [signature2]; - return transaction2; -} -function ecRecover(signedData, signature2) { - signedData = "0x" + signedData.replace(/^0x/, ""); - signature2 = "0x" + signature2.replace(/^0x/, ""); - const recovered = recoverAddress(arrayify(signedData), Signature$4.from(signature2)); - const tronAddress = ADDRESS_PREFIX + recovered.substring(2); - return tronAddress; -} -function arrayToBase64String(a3) { - return btoa(String.fromCharCode(...a3)); -} -function signBytes(privateKey, contents) { - if (typeof privateKey === "string") - privateKey = hexStr2byteArray(privateKey); - const hashBytes = SHA2563(contents); - const signBytes2 = ECKeySign(hashBytes, privateKey); - return signBytes2; -} -function _signTypedData(domain, types2, value, privateKey) { - const key2 = `0x${privateKey.replace(/^0x/, "")}`; - const signingKey = new SigningKey(key2); - const messageDigest = TypedDataEncoder.hash(domain, types2, value); - const signature2 = signingKey.sign(messageDigest); - const signatureHex = ["0x", signature2.r.substring(2), signature2.s.substring(2), Number(signature2.v).toString(16)].join(""); - return signatureHex; -} -function getRowBytesFromTransactionBase64(base64Data) { - const bytesDecode = base64DecodeFromString(base64Data); - const transaction2 = globalThis.proto.protocol.Transaction.deserializeBinary(bytesDecode); - const raw = transaction2.getRawData(); - return raw.serializeBinary(); -} -function genPriKey() { - const priKey = secp256k1$2.utils.randomPrivateKey(); - let priKeyHex = byteArray2hexStr(priKey); - priKeyHex = priKeyHex.padStart(64, "0"); - return hexStr2byteArray(priKeyHex); -} -function computeAddress(pubBytes2) { - if (pubBytes2.length === 65) - pubBytes2 = pubBytes2.slice(1); - const hash3 = keccak256(new Uint8Array(pubBytes2)).toString().substring(2); - const addressHex = ADDRESS_PREFIX + hash3.substring(24); - return hexStr2byteArray(addressHex); -} -function getAddressFromPriKey(priKeyBytes) { - const pubBytes2 = getPubKeyFromPriKey(priKeyBytes); - return computeAddress(pubBytes2); -} -function decode58Check(addressStr) { - const decodeCheck = decode58(addressStr); - if (decodeCheck.length <= 4) - return false; - const decodeData2 = decodeCheck.slice(0, decodeCheck.length - 4); - const hash0 = SHA2563(decodeData2); - const hash1 = SHA2563(hash0); - if (hash1[0] === decodeCheck[decodeData2.length] && hash1[1] === decodeCheck[decodeData2.length + 1] && hash1[2] === decodeCheck[decodeData2.length + 2] && hash1[3] === decodeCheck[decodeData2.length + 3]) { - return decodeData2; - } - return false; -} -function isAddressValid(base58Str) { - if (typeof base58Str !== "string") - return false; - if (base58Str.length !== ADDRESS_SIZE) - return false; - let address2 = decode58(base58Str); - if (address2.length !== 25) - return false; - if (address2[0] !== ADDRESS_PREFIX_BYTE) - return false; - const checkSum = address2.slice(21); - address2 = address2.slice(0, 21); - const hash0 = SHA2563(address2); - const hash1 = SHA2563(hash0); - const checkSum1 = hash1.slice(0, 4); - if (checkSum[0] == checkSum1[0] && checkSum[1] == checkSum1[1] && checkSum[2] == checkSum1[2] && checkSum[3] == checkSum1[3]) { - return true; - } - return false; -} -function getBase58CheckAddressFromPriKeyBase64String(priKeyBase64String) { - const priKeyBytes = base64DecodeFromString(priKeyBase64String); - const pubBytes2 = getPubKeyFromPriKey(priKeyBytes); - const addressBytes = computeAddress(pubBytes2); - return getBase58CheckAddress(addressBytes); -} -function getHexStrAddressFromPriKeyBase64String(priKeyBase64String) { - const priKeyBytes = base64DecodeFromString(priKeyBase64String); - const pubBytes2 = getPubKeyFromPriKey(priKeyBytes); - const addressBytes = computeAddress(pubBytes2); - const addressHex = byteArray2hexStr(addressBytes); - return addressHex; -} -function getAddressFromPriKeyBase64String(priKeyBase64String) { - const priKeyBytes = base64DecodeFromString(priKeyBase64String); - const pubBytes2 = getPubKeyFromPriKey(priKeyBytes); - const addressBytes = computeAddress(pubBytes2); - const addressBase64 = base64EncodeToString(addressBytes); - return addressBase64; -} -function getPubKeyFromPriKey(priKeyBytes) { - const pubkey = secp256k1$2.ProjectivePoint.fromPrivateKey(new Uint8Array(normalizePrivateKeyBytes(priKeyBytes))); - const x3 = pubkey.x; - const y3 = pubkey.y; - const xHex = x3.toString(16).padStart(64, "0"); - const yHex = y3.toString(16).padStart(64, "0"); - const pubkeyHex = `04${xHex}${yHex}`; - const pubkeyBytes = hexStr2byteArray(pubkeyHex); - return pubkeyBytes; -} -function ECKeySign(hashBytes, priKeyBytes) { - const signature2 = secp256k1$2.sign(byteArray2hexStr(hashBytes), byteArray2hexStr(priKeyBytes)); - const r2 = signature2.r.toString(16); - const s2 = signature2.s.toString(16); - const v6 = signature2.recovery + 27; - return r2.padStart(64, "0") + s2.padStart(64, "0") + byte2hexStr(v6); -} -function SHA2563(msgBytes) { - const msgHex = byteArray2hexStr(msgBytes); - const hashHex = sha256$1("0x" + msgHex).replace(/^0x/, ""); - return hexStr2byteArray(hashHex); -} -function passwordToAddress(password) { - const com_priKeyBytes = base64DecodeFromString(password); - const com_addressBytes = getAddressFromPriKey(com_priKeyBytes); - return getBase58CheckAddress(com_addressBytes); -} -function pkToAddress(privateKey, strict = false) { - const com_priKeyBytes = hexStr2byteArray(privateKey, strict); - const com_addressBytes = getAddressFromPriKey(com_priKeyBytes); - return getBase58CheckAddress(com_addressBytes); -} -function sha3(string2, prefix = true) { - return (prefix ? "0x" : "") + keccak256(Buffer.from(string2, "utf-8")).toString().substring(2); -} -const crypto$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - ECKeySign, - SHA256: SHA2563, - _signTypedData, - arrayToBase64String, - computeAddress, - decode58Check, - decodeBase58Address, - ecRecover, - genPriKey, - getAddressFromPriKey, - getAddressFromPriKeyBase64String, - getBase58CheckAddress, - getBase58CheckAddressFromPriKeyBase64String, - getHexStrAddressFromPriKeyBase64String, - getPubKeyFromPriKey, - getRowBytesFromTransactionBase64, - isAddressValid, - passwordToAddress, - pkToAddress, - sha3, - signBytes, - signTransaction -}, Symbol.toStringTag, { value: "Module" })); -const INVALID_TRON_PATH_ERROR_MSG = "Invalid tron path provided"; -function generateAccount() { - const priKeyBytes = genPriKey(); - const pubKeyBytes = getPubKeyFromPriKey(priKeyBytes); - const addressBytes = getAddressFromPriKey(priKeyBytes); - const privateKey = byteArray2hexStr(priKeyBytes); - const publicKey2 = byteArray2hexStr(pubKeyBytes); - return { - privateKey, - publicKey: publicKey2, - address: { - base58: getBase58CheckAddress(addressBytes), - hex: byteArray2hexStr(addressBytes) - } - }; -} -function generateRandom(password = "", path = TRON_BIP39_PATH_INDEX_0, wordlist2) { - const account = HDNodeWallet.createRandom(password, path, wordlist2); - const result = { - mnemonic: account.mnemonic, - privateKey: account.privateKey, - publicKey: account.signingKey.publicKey, - address: pkToAddress(account.privateKey.replace(/^0x/, "")), - path: account.path - }; - return result; -} -function generateAccountWithMnemonic(mnemonic, path = TRON_BIP39_PATH_INDEX_0, password = "", wordlist2 = null) { - if (!String(path).match(/^m\/44\'\/195\'/)) { - throw new Error(INVALID_TRON_PATH_ERROR_MSG); - } - const account = HDNodeWallet.fromMnemonic(Mnemonic.fromPhrase(mnemonic, password, wordlist2), path); - const result = { - mnemonic: account.mnemonic, - privateKey: account.privateKey, - publicKey: account.signingKey.publicKey, - address: pkToAddress(account.privateKey.replace(/^0x/, "")) - }; - return result; -} -const accounts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - generateAccount, - generateAccountWithMnemonic, - generateRandom -}, Symbol.toStringTag, { value: "Module" })); -const TRON_MESSAGE_PREFIX = "TRON Signed Message:\n"; -function hashMessage(message2) { - if (typeof message2 === "string") { - message2 = toUtf8Bytes(message2); - } else if (Array.isArray(message2)) { - message2 = new Uint8Array(message2); - } - return keccak256(concat$1([toUtf8Bytes(TRON_MESSAGE_PREFIX), toUtf8Bytes(String(message2.length)), message2])); -} -function signMessage(message2, privateKey) { - if (!privateKey.match(/^0x/)) { - privateKey = "0x" + privateKey; - } - const signingKey = new SigningKey(privateKey); - const messageDigest = hashMessage(message2); - const signature2 = signingKey.sign(messageDigest); - return joinSignature(signature2); -} -function verifyMessage(message2, signature2) { - if (!signature2.match(/^0x/)) { - signature2 = "0x" + signature2; - } - const recovered = recoverAddress(hashMessage(message2), signature2); - const base58Address = getBase58CheckAddress(hexStr2byteArray(recovered.replace(/^0x/, ADDRESS_PREFIX))); - return base58Address; -} -const message = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - TRON_MESSAGE_PREFIX, - hashMessage, - signMessage, - verifyMessage -}, Symbol.toStringTag, { value: "Module" })); -const utils$g = { - ...validations, - address, - code, - accounts, - base58: base58$1, - bytes: bytes$1, - crypto: crypto$3, - abi, - message, - _TypedDataEncoder: TypedDataEncoder, - transaction, - ethersUtils -}; -const utils$h = utils$g; -var ResourceCode; -(function(ResourceCode2) { - ResourceCode2[ResourceCode2["BANDWIDTH"] = 0] = "BANDWIDTH"; - ResourceCode2[ResourceCode2["ENERGY"] = 1] = "ENERGY"; - ResourceCode2[ResourceCode2["TRON_POWER"] = 2] = "TRON_POWER"; -})(ResourceCode || (ResourceCode = {})); -var TransactionSignWeight_response_code; -(function(TransactionSignWeight_response_code2) { - TransactionSignWeight_response_code2["ENOUGH_PERMISSION"] = "ENOUGH_PERMISSION"; - TransactionSignWeight_response_code2["NOT_ENOUGH_PERMISSION"] = "NOT_ENOUGH_PERMISSION"; - TransactionSignWeight_response_code2["SIGNATURE_FORMAT_ERROR"] = "SIGNATURE_FORMAT_ERROR"; - TransactionSignWeight_response_code2["COMPUTE_ADDRESS_ERROR"] = "COMPUTE_ADDRESS_ERROR"; - TransactionSignWeight_response_code2["PERMISSION_ERROR"] = "PERMISSION_ERROR"; - TransactionSignWeight_response_code2["OTHER_ERROR"] = "OTHER_ERROR"; -})(TransactionSignWeight_response_code || (TransactionSignWeight_response_code = {})); -var BroadcastReturn_response_code; -(function(BroadcastReturn_response_code2) { - BroadcastReturn_response_code2[BroadcastReturn_response_code2["SUCCESS"] = 0] = "SUCCESS"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["SIGERROR"] = 1] = "SIGERROR"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["CONTRACT_VALIDATE_ERROR"] = 2] = "CONTRACT_VALIDATE_ERROR"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["CONTRACT_EXE_ERROR"] = 3] = "CONTRACT_EXE_ERROR"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["BANDWITH_ERROR"] = 4] = "BANDWITH_ERROR"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["DUP_TRANSACTION_ERROR"] = 5] = "DUP_TRANSACTION_ERROR"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["TAPOS_ERROR"] = 6] = "TAPOS_ERROR"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["TOO_BIG_TRANSACTION_ERROR"] = 7] = "TOO_BIG_TRANSACTION_ERROR"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["TRANSACTION_EXPIRATION_ERROR"] = 8] = "TRANSACTION_EXPIRATION_ERROR"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["SERVER_BUSY"] = 9] = "SERVER_BUSY"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["NO_CONNECTION"] = 10] = "NO_CONNECTION"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["NOT_ENOUGH_EFFECTIVE_CONNECTION"] = 11] = "NOT_ENOUGH_EFFECTIVE_CONNECTION"; - BroadcastReturn_response_code2[BroadcastReturn_response_code2["OTHER_ERROR"] = 20] = "OTHER_ERROR"; -})(BroadcastReturn_response_code || (BroadcastReturn_response_code = {})); -var ProposalState; -(function(ProposalState2) { - ProposalState2[ProposalState2["PENDING"] = 0] = "PENDING"; - ProposalState2[ProposalState2["DISAPPROVED"] = 1] = "DISAPPROVED"; - ProposalState2[ProposalState2["APPROVED"] = 2] = "APPROVED"; - ProposalState2[ProposalState2["CANCELED"] = 3] = "CANCELED"; -})(ProposalState || (ProposalState = {})); -var NetworkType; -(function(NetworkType2) { - NetworkType2["Mainnet"] = "Mainnet"; - NetworkType2["Shasta"] = "Shasta"; - NetworkType2["Nile"] = "Nile"; - NetworkType2["Unknown"] = "Unknown"; -})(NetworkType || (NetworkType = {})); -var ChainNetwork; -(function(ChainNetwork2) { - ChainNetwork2["Mainnet"] = "Mainnet"; - ChainNetwork2["Shasta"] = "Shasta"; - ChainNetwork2["Nile"] = "Nile"; -})(ChainNetwork || (ChainNetwork = {})); -function isInBrowser() { - return typeof window !== "undefined" && typeof document !== "undefined" && typeof navigator !== "undefined"; -} -function isInMobileBrowser() { - return typeof navigator !== "undefined" && navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i); -} -var __awaiter$3 = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve) { - resolve(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e18) { - reject(e18); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e18) { - reject(e18); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -function supportTron() { - return !!(window.tron && window.tron.isTronLink); -} -function supportTronLink() { - return !!(supportTron() || window.tronLink || window.tronWeb); -} -function isInTronLinkApp() { - return isInBrowser() && typeof window.iTron !== "undefined"; -} -function openTronLink({ dappIcon, dappName } = { dappIcon: "", dappName: "" }) { - if (!supportTronLink() && isInMobileBrowser() && !isInTronLinkApp()) { - let defaultDappName = "", defaultDappIcon = ""; - try { - defaultDappName = document.title; - const link = document.querySelector('link[rel*="icon"]'); - if (link) { - defaultDappIcon = new URL(link.getAttribute("href") || "", location.href).toString(); - } - } catch (e18) { - } - const { origin: origin2, pathname, search, hash: hash3 } = window.location; - const url = origin2 + pathname + search + (hash3.includes("?") ? hash3 : `${hash3}?_=1`); - const params = { - action: "open", - actionId: Date.now() + "", - callbackUrl: "http://someurl.com", - // no need callback - dappIcon: dappIcon || defaultDappIcon, - dappName: dappName || defaultDappName, - url, - protocol: "TronLink", - version: "1.0", - chainId: "0x2b6653dc" - }; - window.location.href = `tronlinkoutside://pull.activity?param=${encodeURIComponent(JSON.stringify(params))}`; - return true; - } - return false; -} -function waitTronwebReady(tronObj) { - return __awaiter$3(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => { - const interval = setInterval(() => { - if (tronObj.tronWeb) { - clearInterval(interval); - clearTimeout(timeout); - resolve(); - } - }, 50); - const timeout = setTimeout(() => { - clearInterval(interval); - reject("`window.tron.tronweb` is not ready."); - }, 2e3); - }); - }); -} -var __awaiter$2 = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve) { - resolve(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e18) { - reject(e18); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e18) { - reject(e18); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const chainIdNetworkMap = { - "0x2b6653dc": NetworkType.Mainnet, - "0x94a9059e": NetworkType.Shasta, - "0xcd8690dc": NetworkType.Nile -}; -function getNetworkInfoByTronWeb(tronWeb) { - return __awaiter$2(this, void 0, void 0, function* () { - var _a3, _b2, _c2; - const { blockID = "" } = yield tronWeb.trx.getBlockByNumber(0); - const chainId = `0x${blockID.slice(-8)}`; - return { - networkType: chainIdNetworkMap[chainId] || NetworkType.Unknown, - chainId, - fullNode: ((_a3 = tronWeb.fullNode) === null || _a3 === void 0 ? void 0 : _a3.host) || "", - solidityNode: ((_b2 = tronWeb.solidityNode) === null || _b2 === void 0 ? void 0 : _b2.host) || "", - eventServer: ((_c2 = tronWeb.eventServer) === null || _c2 === void 0 ? void 0 : _c2.host) || "" - }; - }); -} -const TronLinkAdapterName = "TronLink"; -class TronLinkAdapter extends Adapter { - // record if first connect event has emitted or not - constructor(config2 = {}) { - super(); - this.name = TronLinkAdapterName; - this.url = "https://www.tronlink.org/"; - this.icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF0AAABdCAYAAADHcWrDAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABdoAMABAAAAAEAAABdAAAAAMkTBfIAAAFZaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIj4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+Chle4QcAABZhSURBVHgB7V0JlBTVuf6runtWllkA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K+AvNnyZH0Xsb+eO/wWrg46Do/7gYAAAAABJRU5ErkJggg=="; - this._readyState = isInBrowser() ? WalletReadyState.Loading : WalletReadyState.NotFound; - this._state = AdapterState.Loading; - this._supportNewTronProtocol = false; - this._tronLinkMessageHandler = (e18) => { - var _a3, _b2, _c2, _d2, _e3; - const message2 = (_a3 = e18.data) === null || _a3 === void 0 ? void 0 : _a3.message; - if (!message2) { - return; - } - if (message2.action === "accountsChanged") { - setTimeout(() => { - var _a4; - const preAddr = this.address || ""; - if ((_a4 = this._wallet) === null || _a4 === void 0 ? void 0 : _a4.ready) { - const address2 = message2.data.address; - this.setAddress(address2); - this.setState(AdapterState.Connected); - } else { - this.setAddress(null); - this.setState(AdapterState.Disconnect); - } - this.emit("accountsChanged", this.address || "", preAddr); - if (!preAddr && this.address) { - this.emit("connect", this.address); - } else if (preAddr && !this.address) { - this.emit("disconnect"); - } - }, 200); - } else if (message2.action === "setNode") { - this.emit("chainChanged", { chainId: ((_c2 = (_b2 = message2.data) === null || _b2 === void 0 ? void 0 : _b2.node) === null || _c2 === void 0 ? void 0 : _c2.chainId) || "" }); - } else if (message2.action === "connect") { - const address2 = ((_e3 = (_d2 = this._wallet.tronWeb) === null || _d2 === void 0 ? void 0 : _d2.defaultAddress) === null || _e3 === void 0 ? void 0 : _e3.base58) || ""; - this.setAddress(address2); - this.setState(AdapterState.Connected); - this.emit("connect", address2); - } else if (message2.action === "disconnect") { - this.setAddress(null); - this.setState(AdapterState.Disconnect); - this.emit("disconnect"); - } - }; - this._onChainChanged = (data) => { - this.emit("chainChanged", data); - }; - this._onAccountsChanged = () => { - var _a3, _b2, _c2; - const preAddr = this.address || ""; - const curAddr = ((_a3 = this._wallet) === null || _a3 === void 0 ? void 0 : _a3.tronWeb) && ((_c2 = (_b2 = this._wallet) === null || _b2 === void 0 ? void 0 : _b2.tronWeb.defaultAddress) === null || _c2 === void 0 ? void 0 : _c2.base58) || ""; - if (!curAddr) { - this.setAddress(null); - this.setState(AdapterState.Disconnect); - } else { - const address2 = curAddr; - this.setAddress(address2); - this.setState(AdapterState.Connected); - } - this.emit("accountsChanged", this.address || "", preAddr); - if (!preAddr && this.address) { - this.emit("connect", this.address); - } else if (preAddr && !this.address) { - this.emit("disconnect"); - } - }; - this._checkPromise = null; - this._updateWallet = () => { - var _a3, _b2, _c2, _d2, _e3, _f3, _g2, _h3; - let state = this.state; - let address2 = this.address; - if (isInMobileBrowser()) { - if (window.tronLink) { - this._wallet = window.tronLink; - } else { - this._wallet = { - ready: !!((_a3 = window.tronWeb) === null || _a3 === void 0 ? void 0 : _a3.defaultAddress), - tronWeb: window.tronWeb, - request: () => Promise.resolve(true) - }; - } - address2 = ((_c2 = (_b2 = this._wallet.tronWeb) === null || _b2 === void 0 ? void 0 : _b2.defaultAddress) === null || _c2 === void 0 ? void 0 : _c2.base58) || null; - state = address2 ? AdapterState.Connected : AdapterState.Disconnect; - } else if (window.tron && window.tron.isTronLink) { - this._supportNewTronProtocol = true; - this._wallet = window.tron; - this._listenTronEvent(); - address2 = this._wallet.tronWeb && ((_e3 = (_d2 = this._wallet.tronWeb) === null || _d2 === void 0 ? void 0 : _d2.defaultAddress) === null || _e3 === void 0 ? void 0 : _e3.base58) || null; - state = address2 ? AdapterState.Connected : AdapterState.Disconnect; - } else if (window.tronLink) { - this._wallet = window.tronLink; - this._listenTronLinkEvent(); - address2 = ((_g2 = (_f3 = this._wallet.tronWeb) === null || _f3 === void 0 ? void 0 : _f3.defaultAddress) === null || _g2 === void 0 ? void 0 : _g2.base58) || null; - state = this._wallet.ready ? AdapterState.Connected : AdapterState.Disconnect; - } else if (window.tronWeb) { - this._wallet = { - ready: window.tronWeb.ready, - tronWeb: window.tronWeb, - request: () => Promise.resolve(true) - }; - address2 = ((_h3 = this._wallet.tronWeb.defaultAddress) === null || _h3 === void 0 ? void 0 : _h3.base58) || null; - state = this._wallet.ready ? AdapterState.Connected : AdapterState.Disconnect; - } else { - this._wallet = null; - address2 = null; - state = AdapterState.NotFound; - } - if (isInMobileBrowser() && state === AdapterState.Disconnect) { - this.checkForWalletReadyForApp(); - } - this.setAddress(address2); - this.setState(state); - }; - this.checkReadyInterval = null; - const { checkTimeout = 30 * 1e3, dappIcon = "", dappName = "", openUrlWhenWalletNotFound = true, openTronLinkAppOnMobile = true } = config2; - if (typeof checkTimeout !== "number") { - throw new Error("[TronLinkAdapter] config.checkTimeout should be a number"); - } - this.config = { - checkTimeout, - openTronLinkAppOnMobile, - openUrlWhenWalletNotFound, - dappIcon, - dappName - }; - this._connecting = false; - this._wallet = null; - this._address = null; - if (!isInBrowser()) { - this._readyState = WalletReadyState.NotFound; - this.setState(AdapterState.NotFound); - return; - } - if (supportTron() || isInMobileBrowser() && (window.tronLink || window.tronWeb)) { - this._readyState = WalletReadyState.Found; - this._updateWallet(); - } else { - this._checkWallet().then(() => { - if (this.connected) { - this.emit("connect", this.address || ""); - } - }); - } - } - get address() { - return this._address; - } - get state() { - return this._state; - } - get readyState() { - return this._readyState; - } - get connecting() { - return this._connecting; - } - /** - * Get network information used by TronLink. - * @returns {Network} Current network information. - */ - network() { - return __awaiter$2(this, void 0, void 0, function* () { - var _a3; - try { - yield this._checkWallet(); - if (this.state !== AdapterState.Connected) - throw new WalletDisconnectedError2(); - const tronWeb = ((_a3 = this._wallet) === null || _a3 === void 0 ? void 0 : _a3.tronWeb) || window.tronWeb; - if (!tronWeb) - throw new WalletDisconnectedError2(); - try { - return yield getNetworkInfoByTronWeb(tronWeb); - } catch (e18) { - throw new WalletGetNetworkError(e18 === null || e18 === void 0 ? void 0 : e18.message, e18); - } - } catch (e18) { - this.emit("error", e18); - throw e18; - } - }); - } - connect() { - return __awaiter$2(this, void 0, void 0, function* () { - var _a3, _b2; - try { - this.checkIfOpenTronLink(); - if (this.connected || this.connecting) - return; - yield this._checkWallet(); - if (this.state === AdapterState.NotFound) { - if (this.config.openUrlWhenWalletNotFound !== false && isInBrowser()) { - window.open(this.url, "_blank"); - } - throw new WalletNotFoundError(); - } - if (!this._wallet) - return; - this._connecting = true; - if (this._supportNewTronProtocol) { - const wallet = this._wallet; - try { - const res = yield wallet.request({ method: "eth_requestAccounts" }); - const address2 = res[0]; - this.setAddress(address2); - this.setState(AdapterState.Connected); - this._listenTronEvent(); - if (!this._wallet.tronWeb) { - yield waitTronwebReady(this._wallet); - } - } catch (error) { - let message2 = (error === null || error === void 0 ? void 0 : error.message) || error || "Connect TronLink wallet failed."; - if (error.code === -32002) { - message2 = "The same DApp has already initiated a request to connect to TronLink wallet, and the pop-up window has not been closed."; - } - if (error.code === 4001) { - message2 = "The user rejected connection."; - } - throw new WalletConnectionError2(message2, error); - } - } else if (window.tronLink) { - const wallet = this._wallet; - try { - const res = yield wallet.request({ method: "tron_requestAccounts" }); - if (!res) { - throw new WalletConnectionError2("TronLink wallet is locked or no wallet account is avaliable."); - } - if (res.code === 4e3) { - throw new WalletConnectionError2("The same DApp has already initiated a request to connect to TronLink wallet, and the pop-up window has not been closed."); - } - if (res.code === 4001) { - throw new WalletConnectionError2("The user rejected connection."); - } - } catch (error) { - throw new WalletConnectionError2(error === null || error === void 0 ? void 0 : error.message, error); - } - const address2 = ((_a3 = wallet.tronWeb.defaultAddress) === null || _a3 === void 0 ? void 0 : _a3.base58) || ""; - this.setAddress(address2); - this.setState(AdapterState.Connected); - this._listenTronLinkEvent(); - } else if (window.tronWeb) { - const wallet = this._wallet; - const address2 = ((_b2 = wallet.tronWeb.defaultAddress) === null || _b2 === void 0 ? void 0 : _b2.base58) || ""; - this.setAddress(address2); - this.setState(AdapterState.Connected); - } else { - throw new WalletConnectionError2("Cannot connect wallet."); - } - this.connected && this.emit("connect", this.address || ""); - } catch (error) { - this.emit("error", error); - throw error; - } finally { - this._connecting = false; - } - }); - } - disconnect() { - return __awaiter$2(this, void 0, void 0, function* () { - if (this._supportNewTronProtocol) { - this._stopListenTronEvent(); - } else { - this._stopListenTronLinkEvent(); - } - if (this.state !== AdapterState.Connected) { - return; - } - this.setAddress(null); - this.setState(AdapterState.Disconnect); - this.emit("disconnect"); - }); - } - signTransaction(transaction2, privateKey) { - return __awaiter$2(this, void 0, void 0, function* () { - try { - const wallet = yield this.checkAndGetWallet(); - try { - return yield wallet.tronWeb.trx.sign(transaction2, privateKey); - } catch (error) { - if (error instanceof Error) { - throw new WalletSignTransactionError2(error.message, error); - } else { - throw new WalletSignTransactionError2(error, new Error(error)); - } - } - } catch (error) { - this.emit("error", error); - throw error; - } - }); - } - multiSign(transaction2, privateKey, permissionId) { - return __awaiter$2(this, void 0, void 0, function* () { - try { - const wallet = yield this.checkAndGetWallet(); - try { - return yield wallet.tronWeb.trx.multiSign(transaction2, privateKey, permissionId); - } catch (error) { - if (error instanceof Error) { - throw new WalletSignTransactionError2(error.message, error); - } else { - throw new WalletSignTransactionError2(error, new Error(error)); - } - } - } catch (error) { - this.emit("error", error); - throw error; - } - }); - } - signMessage(message2, privateKey) { - return __awaiter$2(this, void 0, void 0, function* () { - try { - const wallet = yield this.checkAndGetWallet(); - try { - return yield wallet.tronWeb.trx.signMessageV2(message2, privateKey); - } catch (error) { - if (error instanceof Error) { - throw new WalletSignMessageError2(error.message, error); - } else { - throw new WalletSignMessageError2(error, new Error(error)); - } - } - } catch (error) { - this.emit("error", error); - throw error; - } - }); - } - /** - * Switch to target chain. If current chain is the same as target chain, the call will success immediately. - * Available chainIds: - * - Mainnet: 0x2b6653dc - * - Shasta: 0x94a9059e - * - Nile: 0xcd8690dc - * @param chainId chainId - */ - switchChain(chainId) { - return __awaiter$2(this, void 0, void 0, function* () { - try { - yield this._checkWallet(); - if (this.state === AdapterState.NotFound) { - if (this.config.openUrlWhenWalletNotFound !== false && isInBrowser()) { - window.open(this.url, "_blank"); - } - throw new WalletNotFoundError(); - } - if (!this._supportNewTronProtocol) { - throw new WalletSwitchChainError("Current version of TronLink doesn't support switch chain operation."); - } - const wallet = this._wallet; - try { - yield wallet.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId }] - }); - } catch (e18) { - throw new WalletSwitchChainError((e18 === null || e18 === void 0 ? void 0 : e18.message) || e18, e18 instanceof Error ? e18 : new Error(e18)); - } - } catch (error) { - this.emit("error", error); - throw error; - } - }); - } - checkAndGetWallet() { - return __awaiter$2(this, void 0, void 0, function* () { - this.checkIfOpenTronLink(); - yield this._checkWallet(); - if (this.state !== AdapterState.Connected) - throw new WalletDisconnectedError2(); - const wallet = this._wallet; - if (!wallet || !wallet.tronWeb) - throw new WalletDisconnectedError2(); - return wallet; - }); - } - _listenTronLinkEvent() { - this._stopListenTronLinkEvent(); - window.addEventListener("message", this._tronLinkMessageHandler); - } - _stopListenTronLinkEvent() { - window.removeEventListener("message", this._tronLinkMessageHandler); - } - checkIfOpenTronLink() { - const { dappName = "", dappIcon = "" } = this.config; - if (this.config.openTronLinkAppOnMobile === false) { - return; - } - if (openTronLink({ dappIcon, dappName })) { - throw new WalletNotFoundError(); - } - } - // following code is for TIP-1193 - _listenTronEvent() { - this._stopListenTronEvent(); - this._stopListenTronLinkEvent(); - const wallet = this._wallet; - wallet.on("chainChanged", this._onChainChanged); - wallet.on("accountsChanged", this._onAccountsChanged); - } - _stopListenTronEvent() { - const wallet = this._wallet; - wallet.removeListener("chainChanged", this._onChainChanged); - wallet.removeListener("accountsChanged", this._onAccountsChanged); - } - /** - * check if wallet exists by interval, the promise only resolve when wallet detected or timeout - * @returns if wallet exists - */ - _checkWallet() { - if (this.readyState === WalletReadyState.Found) { - return Promise.resolve(true); - } - if (this._checkPromise) { - return this._checkPromise; - } - const interval = 100; - const checkTronTimes = Math.floor(2e3 / interval); - const maxTimes = Math.floor(this.config.checkTimeout / interval); - let times = 0, timer2; - this._checkPromise = new Promise((resolve) => { - const check = () => { - times++; - const isSupport = times < checkTronTimes && !isInMobileBrowser() ? supportTron() : supportTronLink(); - if (isSupport || times > maxTimes) { - timer2 && clearInterval(timer2); - this._readyState = isSupport ? WalletReadyState.Found : WalletReadyState.NotFound; - this._updateWallet(); - this.emit("readyStateChanged", this.readyState); - resolve(isSupport); - } - }; - timer2 = setInterval(check, interval); - check(); - }); - return this._checkPromise; - } - checkForWalletReadyForApp() { - if (this.checkReadyInterval) { - return; - } - let times = 0; - const maxTimes = Math.floor(this.config.checkTimeout / 200); - const check = () => { - var _a3, _b2; - if (window.tronLink ? (_a3 = window.tronLink.tronWeb) === null || _a3 === void 0 ? void 0 : _a3.defaultAddress : (_b2 = window.tronWeb) === null || _b2 === void 0 ? void 0 : _b2.defaultAddress) { - this.checkReadyInterval && clearInterval(this.checkReadyInterval); - this.checkReadyInterval = null; - this._updateWallet(); - this.emit("connect", this.address || ""); - } else if (times > maxTimes) { - this.checkReadyInterval && clearInterval(this.checkReadyInterval); - this.checkReadyInterval = null; - } else { - times++; - } - }; - this.checkReadyInterval = setInterval(check, 200); - } - setAddress(address2) { - this._address = address2; - } - setState(state) { - const preState = this.state; - if (state !== preState) { - this._state = state; - this.emit("stateChanged", state); - } - } -} -var __awaiter$1 = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve) { - resolve(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e18) { - reject(e18); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e18) { - reject(e18); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const initialState = { - wallet: null, - address: null, - connected: false, - adapter: null -}; -const WalletProvider = function({ children, adapters: adaptersPro = null, onError = (error) => console.error(error), onReadyStateChanged, onConnect, onDisconnect, onAccountsChanged, onChainChanged, onAdapterChanged, localStorageKey = "tronAdapterName", autoConnect = true, disableAutoConnectOnLoad = false }) { - const [name2, setName] = useLocalStorage(localStorageKey, null); - const [{ wallet, connected, address: address2, adapter }, setState] = reactExports.useState(initialState); - const [connecting, setConnecting] = reactExports.useState(false); - const [disconnecting, setDisconnecting] = reactExports.useState(false); - const isConnecting = reactExports.useRef(false); - const isDisconnecting = reactExports.useRef(false); - const adapters2 = reactExports.useMemo(() => { - if (adaptersPro === null) { - return [new TronLinkAdapter()]; - } - return adaptersPro; - }, [adaptersPro]); - const [wallets2, setWallets] = reactExports.useState(() => adapters2.map((adapter2) => ({ - adapter: adapter2, - state: adapter2.state - }))); - reactExports.useEffect(function() { - setWallets((prevWallets) => adapters2.map((adapter2, index2) => { - const wallet2 = prevWallets[index2]; - if (wallet2 && wallet2.adapter === adapter2 && wallet2.state === adapter2.state) { - return wallet2; - } - return { - adapter: adapter2, - state: adapter2.state - }; - })); - function handleStateChange() { - setWallets((prevWallets) => { - const index2 = prevWallets.findIndex((wallet2) => wallet2.adapter === this); - if (index2 === -1) { - return prevWallets; - } - return prevWallets.map((wallet2, idx) => { - if (idx === index2) { - return Object.assign(Object.assign({}, wallet2), { state: wallet2.adapter.state }); - } - return wallet2; - }); - }); - } - adapters2.forEach((adapter2) => adapter2.on("stateChanged", handleStateChange, adapter2)); - return () => adapters2.forEach((adapter2) => adapter2.off("stateChanged", handleStateChange, adapter2)); - }, [adapters2]); - reactExports.useEffect(function() { - const wallet2 = name2 && wallets2.find((item) => item.adapter.name === name2); - if (wallet2) { - setState({ - wallet: wallet2, - adapter: wallet2.adapter, - connected: wallet2.adapter.connected, - address: wallet2.adapter.address - }); - } else { - setState(initialState); - } - }, [name2, wallets2]); - const preAdapter = reactExports.useRef(null); - reactExports.useEffect(function() { - if (adapter !== preAdapter.current) { - onAdapterChanged === null || onAdapterChanged === void 0 ? void 0 : onAdapterChanged(adapter); - preAdapter.current = adapter; - } - }, [adapter, onAdapterChanged]); - const handleConnect = reactExports.useCallback(function(addr) { - if (!adapter) { - return setName(null); - } - setState((state) => Object.assign(Object.assign({}, state), { connected: adapter.connected, address: adapter.address })); - onConnect === null || onConnect === void 0 ? void 0 : onConnect(addr); - }, [adapter, setName, onConnect]); - const handleError = reactExports.useCallback(function(error) { - onError(error); - return error; - }, [onError]); - const handleAccountChange = reactExports.useCallback(function(address3, preAddr) { - setState((state) => Object.assign(Object.assign({}, state), { address: address3 })); - onAccountsChanged === null || onAccountsChanged === void 0 ? void 0 : onAccountsChanged(address3, preAddr); - }, [onAccountsChanged]); - const handleDisconnect = reactExports.useCallback(function() { - onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect(); - }, [onDisconnect]); - const handleReadyStateChanged = reactExports.useCallback(function(readyState) { - onReadyStateChanged === null || onReadyStateChanged === void 0 ? void 0 : onReadyStateChanged(readyState); - }, [onReadyStateChanged]); - const handleChainChanged = reactExports.useCallback(function(chainData) { - onChainChanged === null || onChainChanged === void 0 ? void 0 : onChainChanged(chainData); - }, [onChainChanged]); - reactExports.useEffect(function() { - if (adapter) { - adapter.on("connect", handleConnect); - adapter.on("error", handleError); - adapter.on("accountsChanged", handleAccountChange); - adapter.on("chainChanged", handleChainChanged); - adapter.on("readyStateChanged", handleReadyStateChanged); - adapter.on("disconnect", handleDisconnect); - return () => { - adapter.off("connect", handleConnect); - adapter.off("error", handleError); - adapter.off("accountsChanged", handleAccountChange); - adapter.off("chainChanged", handleChainChanged); - adapter.off("readyStateChanged", handleReadyStateChanged); - adapter.off("disconnect", handleDisconnect); - }; - } - }, [ - adapter, - handleConnect, - handleError, - handleAccountChange, - handleChainChanged, - handleReadyStateChanged, - handleDisconnect - ]); - reactExports.useEffect(() => { - return () => { - adapter === null || adapter === void 0 ? void 0 : adapter.disconnect(); - }; - }, [adapter]); - const hasManuallySetName = reactExports.useRef(false); - reactExports.useEffect(function() { - const canAutoConnect = autoConnect && (!disableAutoConnectOnLoad || hasManuallySetName.current); - if (isConnecting.current || !canAutoConnect || !adapter || adapter.state !== AdapterState$1.Disconnect) { - return; - } - (function connect3() { - return __awaiter$1(this, void 0, void 0, function* () { - isConnecting.current = true; - setConnecting(true); - try { - yield adapter.connect(); - } catch (error) { - } finally { - setConnecting(false); - isConnecting.current = false; - } - }); - })(); - }, [isConnecting, autoConnect, adapter, setName, disableAutoConnectOnLoad]); - const select2 = reactExports.useCallback((name3) => { - hasManuallySetName.current = true; - setName(name3); - }, [setName]); - const connect2 = reactExports.useCallback(function() { - return __awaiter$1(this, void 0, void 0, function* () { - if (isConnecting.current || isDisconnecting.current || connected) { - return; - } - if (!adapter) - throw handleError(new WalletNotSelectedError2()); - isConnecting.current = true; - setConnecting(true); - try { - yield adapter.connect(); - } catch (error) { - setName(null); - throw error; - } finally { - setConnecting(false); - isConnecting.current = false; - } - }); - }, [isConnecting, isDisconnecting, adapter, connected, handleError, setName]); - const disconnect2 = reactExports.useCallback(function() { - return __awaiter$1(this, void 0, void 0, function* () { - if (isDisconnecting.current) - return; - if (!adapter) - return setName(null); - isDisconnecting.current = true; - setDisconnecting(true); - try { - yield adapter.disconnect(); - setName(null); - } catch (error) { - setName(null); - throw error; - } finally { - setDisconnecting(false); - isDisconnecting.current = false; - } - }); - }, [adapter, isDisconnecting, setName]); - const signTransaction2 = reactExports.useCallback(function(transaction2, privateKey) { - return __awaiter$1(this, void 0, void 0, function* () { - if (!adapter) - throw handleError(new WalletNotSelectedError2()); - return yield adapter.signTransaction(transaction2, privateKey); - }); - }, [adapter, handleError]); - const signMessage2 = reactExports.useCallback(function(message2, privateKey) { - return __awaiter$1(this, void 0, void 0, function* () { - if (!adapter) - throw handleError(new WalletNotSelectedError2()); - return yield adapter.signMessage(message2, privateKey); - }); - }, [adapter, handleError]); - return W$2.createElement(WalletContext.Provider, { value: { - disableAutoConnectOnLoad, - autoConnect, - wallets: wallets2, - wallet, - address: address2, - connecting, - connected, - disconnecting, - select: select2, - connect: connect2, - disconnect: disconnect2, - signTransaction: signTransaction2, - signMessage: signMessage2 - } }, children); -}; -var browser$2 = {}; -var canPromise$1 = function() { - return typeof Promise === "function" && Promise.prototype && Promise.prototype.then; -}; -var qrcode = {}; -var utils$f = {}; -let toSJISFunction; -const CODEWORDS_COUNT = [ - 0, - // Not used - 26, - 44, - 70, - 100, - 134, - 172, - 196, - 242, - 292, - 346, - 404, - 466, - 532, - 581, - 655, - 733, - 815, - 901, - 991, - 1085, - 1156, - 1258, - 1364, - 1474, - 1588, - 1706, - 1828, - 1921, - 2051, - 2185, - 2323, - 2465, - 2611, - 2761, - 2876, - 3034, - 3196, - 3362, - 3532, - 3706 -]; -utils$f.getSymbolSize = function getSymbolSize(version2) { - if (!version2) - throw new Error('"version" cannot be null or undefined'); - if (version2 < 1 || version2 > 40) - throw new Error('"version" should be in range from 1 to 40'); - return version2 * 4 + 17; -}; -utils$f.getSymbolTotalCodewords = function getSymbolTotalCodewords(version2) { - return CODEWORDS_COUNT[version2]; -}; -utils$f.getBCHDigit = function(data) { - let digit = 0; - while (data !== 0) { - digit++; - data >>>= 1; - } - return digit; -}; -utils$f.setToSJISFunction = function setToSJISFunction(f3) { - if (typeof f3 !== "function") { - throw new Error('"toSJISFunc" is not a valid function.'); - } - toSJISFunction = f3; -}; -utils$f.isKanjiModeEnabled = function() { - return typeof toSJISFunction !== "undefined"; -}; -utils$f.toSJIS = function toSJIS(kanji2) { - return toSJISFunction(kanji2); -}; -var errorCorrectionLevel = {}; -(function(exports) { - exports.L = { bit: 1 }; - exports.M = { bit: 0 }; - exports.Q = { bit: 3 }; - exports.H = { bit: 2 }; - function fromString2(string2) { - if (typeof string2 !== "string") { - throw new Error("Param is not a string"); - } - const lcStr = string2.toLowerCase(); - switch (lcStr) { - case "l": - case "low": - return exports.L; - case "m": - case "medium": - return exports.M; - case "q": - case "quartile": - return exports.Q; - case "h": - case "high": - return exports.H; - default: - throw new Error("Unknown EC Level: " + string2); - } - } - exports.isValid = function isValid2(level) { - return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4; - }; - exports.from = function from2(value, defaultValue) { - if (exports.isValid(value)) { - return value; - } - try { - return fromString2(value); - } catch (e18) { - return defaultValue; - } - }; -})(errorCorrectionLevel); -function BitBuffer$1() { - this.buffer = []; - this.length = 0; -} -BitBuffer$1.prototype = { - get: function(index2) { - const bufIndex = Math.floor(index2 / 8); - return (this.buffer[bufIndex] >>> 7 - index2 % 8 & 1) === 1; - }, - put: function(num, length) { - for (let i3 = 0; i3 < length; i3++) { - this.putBit((num >>> length - i3 - 1 & 1) === 1); - } - }, - getLengthInBits: function() { - return this.length; - }, - putBit: function(bit) { - const bufIndex = Math.floor(this.length / 8); - if (this.buffer.length <= bufIndex) { - this.buffer.push(0); - } - if (bit) { - this.buffer[bufIndex] |= 128 >>> this.length % 8; - } - this.length++; - } -}; -var bitBuffer = BitBuffer$1; -function BitMatrix$1(size2) { - if (!size2 || size2 < 1) { - throw new Error("BitMatrix size must be defined and greater than 0"); - } - this.size = size2; - this.data = new Uint8Array(size2 * size2); - this.reservedBit = new Uint8Array(size2 * size2); -} -BitMatrix$1.prototype.set = function(row, col, value, reserved) { - const index2 = row * this.size + col; - this.data[index2] = value; - if (reserved) - this.reservedBit[index2] = true; -}; -BitMatrix$1.prototype.get = function(row, col) { - return this.data[row * this.size + col]; -}; -BitMatrix$1.prototype.xor = function(row, col, value) { - this.data[row * this.size + col] ^= value; -}; -BitMatrix$1.prototype.isReserved = function(row, col) { - return this.reservedBit[row * this.size + col]; -}; -var bitMatrix = BitMatrix$1; -var alignmentPattern = {}; -(function(exports) { - const getSymbolSize3 = utils$f.getSymbolSize; - exports.getRowColCoords = function getRowColCoords(version2) { - if (version2 === 1) - return []; - const posCount = Math.floor(version2 / 7) + 2; - const size2 = getSymbolSize3(version2); - const intervals = size2 === 145 ? 26 : Math.ceil((size2 - 13) / (2 * posCount - 2)) * 2; - const positions = [size2 - 7]; - for (let i3 = 1; i3 < posCount - 1; i3++) { - positions[i3] = positions[i3 - 1] - intervals; - } - positions.push(6); - return positions.reverse(); - }; - exports.getPositions = function getPositions2(version2) { - const coords = []; - const pos = exports.getRowColCoords(version2); - const posLength = pos.length; - for (let i3 = 0; i3 < posLength; i3++) { - for (let j2 = 0; j2 < posLength; j2++) { - if (i3 === 0 && j2 === 0 || // top-left - i3 === 0 && j2 === posLength - 1 || // bottom-left - i3 === posLength - 1 && j2 === 0) { - continue; - } - coords.push([pos[i3], pos[j2]]); - } - } - return coords; - }; -})(alignmentPattern); -var finderPattern = {}; -const getSymbolSize2 = utils$f.getSymbolSize; -const FINDER_PATTERN_SIZE = 7; -finderPattern.getPositions = function getPositions(version2) { - const size2 = getSymbolSize2(version2); - return [ - // top-left - [0, 0], - // top-right - [size2 - FINDER_PATTERN_SIZE, 0], - // bottom-left - [0, size2 - FINDER_PATTERN_SIZE] - ]; -}; -var maskPattern = {}; -(function(exports) { - exports.Patterns = { - PATTERN000: 0, - PATTERN001: 1, - PATTERN010: 2, - PATTERN011: 3, - PATTERN100: 4, - PATTERN101: 5, - PATTERN110: 6, - PATTERN111: 7 - }; - const PenaltyScores = { - N1: 3, - N2: 3, - N3: 40, - N4: 10 - }; - exports.isValid = function isValid2(mask2) { - return mask2 != null && mask2 !== "" && !isNaN(mask2) && mask2 >= 0 && mask2 <= 7; - }; - exports.from = function from2(value) { - return exports.isValid(value) ? parseInt(value, 10) : void 0; - }; - exports.getPenaltyN1 = function getPenaltyN1(data) { - const size2 = data.size; - let points = 0; - let sameCountCol = 0; - let sameCountRow = 0; - let lastCol = null; - let lastRow = null; - for (let row = 0; row < size2; row++) { - sameCountCol = sameCountRow = 0; - lastCol = lastRow = null; - for (let col = 0; col < size2; col++) { - let module = data.get(row, col); - if (module === lastCol) { - sameCountCol++; - } else { - if (sameCountCol >= 5) - points += PenaltyScores.N1 + (sameCountCol - 5); - lastCol = module; - sameCountCol = 1; - } - module = data.get(col, row); - if (module === lastRow) { - sameCountRow++; - } else { - if (sameCountRow >= 5) - points += PenaltyScores.N1 + (sameCountRow - 5); - lastRow = module; - sameCountRow = 1; - } - } - if (sameCountCol >= 5) - points += PenaltyScores.N1 + (sameCountCol - 5); - if (sameCountRow >= 5) - points += PenaltyScores.N1 + (sameCountRow - 5); - } - return points; - }; - exports.getPenaltyN2 = function getPenaltyN2(data) { - const size2 = data.size; - let points = 0; - for (let row = 0; row < size2 - 1; row++) { - for (let col = 0; col < size2 - 1; col++) { - const last = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1); - if (last === 4 || last === 0) - points++; - } - } - return points * PenaltyScores.N2; - }; - exports.getPenaltyN3 = function getPenaltyN3(data) { - const size2 = data.size; - let points = 0; - let bitsCol = 0; - let bitsRow = 0; - for (let row = 0; row < size2; row++) { - bitsCol = bitsRow = 0; - for (let col = 0; col < size2; col++) { - bitsCol = bitsCol << 1 & 2047 | data.get(row, col); - if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) - points++; - bitsRow = bitsRow << 1 & 2047 | data.get(col, row); - if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) - points++; - } - } - return points * PenaltyScores.N3; - }; - exports.getPenaltyN4 = function getPenaltyN4(data) { - let darkCount = 0; - const modulesCount = data.data.length; - for (let i3 = 0; i3 < modulesCount; i3++) - darkCount += data.data[i3]; - const k2 = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10); - return k2 * PenaltyScores.N4; - }; - function getMaskAt(maskPattern2, i3, j2) { - switch (maskPattern2) { - case exports.Patterns.PATTERN000: - return (i3 + j2) % 2 === 0; - case exports.Patterns.PATTERN001: - return i3 % 2 === 0; - case exports.Patterns.PATTERN010: - return j2 % 3 === 0; - case exports.Patterns.PATTERN011: - return (i3 + j2) % 3 === 0; - case exports.Patterns.PATTERN100: - return (Math.floor(i3 / 2) + Math.floor(j2 / 3)) % 2 === 0; - case exports.Patterns.PATTERN101: - return i3 * j2 % 2 + i3 * j2 % 3 === 0; - case exports.Patterns.PATTERN110: - return (i3 * j2 % 2 + i3 * j2 % 3) % 2 === 0; - case exports.Patterns.PATTERN111: - return (i3 * j2 % 3 + (i3 + j2) % 2) % 2 === 0; - default: - throw new Error("bad maskPattern:" + maskPattern2); - } - } - exports.applyMask = function applyMask(pattern, data) { - const size2 = data.size; - for (let col = 0; col < size2; col++) { - for (let row = 0; row < size2; row++) { - if (data.isReserved(row, col)) - continue; - data.xor(row, col, getMaskAt(pattern, row, col)); - } - } - }; - exports.getBestMask = function getBestMask(data, setupFormatFunc) { - const numPatterns = Object.keys(exports.Patterns).length; - let bestPattern = 0; - let lowerPenalty = Infinity; - for (let p3 = 0; p3 < numPatterns; p3++) { - setupFormatFunc(p3); - exports.applyMask(p3, data); - const penalty = exports.getPenaltyN1(data) + exports.getPenaltyN2(data) + exports.getPenaltyN3(data) + exports.getPenaltyN4(data); - exports.applyMask(p3, data); - if (penalty < lowerPenalty) { - lowerPenalty = penalty; - bestPattern = p3; - } - } - return bestPattern; - }; -})(maskPattern); -var errorCorrectionCode = {}; -const ECLevel$1 = errorCorrectionLevel; -const EC_BLOCKS_TABLE = [ - // L M Q H - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 2, - 2, - 1, - 2, - 2, - 4, - 1, - 2, - 4, - 4, - 2, - 4, - 4, - 4, - 2, - 4, - 6, - 5, - 2, - 4, - 6, - 6, - 2, - 5, - 8, - 8, - 4, - 5, - 8, - 8, - 4, - 5, - 8, - 11, - 4, - 8, - 10, - 11, - 4, - 9, - 12, - 16, - 4, - 9, - 16, - 16, - 6, - 10, - 12, - 18, - 6, - 10, - 17, - 16, - 6, - 11, - 16, - 19, - 6, - 13, - 18, - 21, - 7, - 14, - 21, - 25, - 8, - 16, - 20, - 25, - 8, - 17, - 23, - 25, - 9, - 17, - 23, - 34, - 9, - 18, - 25, - 30, - 10, - 20, - 27, - 32, - 12, - 21, - 29, - 35, - 12, - 23, - 34, - 37, - 12, - 25, - 34, - 40, - 13, - 26, - 35, - 42, - 14, - 28, - 38, - 45, - 15, - 29, - 40, - 48, - 16, - 31, - 43, - 51, - 17, - 33, - 45, - 54, - 18, - 35, - 48, - 57, - 19, - 37, - 51, - 60, - 19, - 38, - 53, - 63, - 20, - 40, - 56, - 66, - 21, - 43, - 59, - 70, - 22, - 45, - 62, - 74, - 24, - 47, - 65, - 77, - 25, - 49, - 68, - 81 -]; -const EC_CODEWORDS_TABLE = [ - // L M Q H - 7, - 10, - 13, - 17, - 10, - 16, - 22, - 28, - 15, - 26, - 36, - 44, - 20, - 36, - 52, - 64, - 26, - 48, - 72, - 88, - 36, - 64, - 96, - 112, - 40, - 72, - 108, - 130, - 48, - 88, - 132, - 156, - 60, - 110, - 160, - 192, - 72, - 130, - 192, - 224, - 80, - 150, - 224, - 264, - 96, - 176, - 260, - 308, - 104, - 198, - 288, - 352, - 120, - 216, - 320, - 384, - 132, - 240, - 360, - 432, - 144, - 280, - 408, - 480, - 168, - 308, - 448, - 532, - 180, - 338, - 504, - 588, - 196, - 364, - 546, - 650, - 224, - 416, - 600, - 700, - 224, - 442, - 644, - 750, - 252, - 476, - 690, - 816, - 270, - 504, - 750, - 900, - 300, - 560, - 810, - 960, - 312, - 588, - 870, - 1050, - 336, - 644, - 952, - 1110, - 360, - 700, - 1020, - 1200, - 390, - 728, - 1050, - 1260, - 420, - 784, - 1140, - 1350, - 450, - 812, - 1200, - 1440, - 480, - 868, - 1290, - 1530, - 510, - 924, - 1350, - 1620, - 540, - 980, - 1440, - 1710, - 570, - 1036, - 1530, - 1800, - 570, - 1064, - 1590, - 1890, - 600, - 1120, - 1680, - 1980, - 630, - 1204, - 1770, - 2100, - 660, - 1260, - 1860, - 2220, - 720, - 1316, - 1950, - 2310, - 750, - 1372, - 2040, - 2430 -]; -errorCorrectionCode.getBlocksCount = function getBlocksCount(version2, errorCorrectionLevel2) { - switch (errorCorrectionLevel2) { - case ECLevel$1.L: - return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 0]; - case ECLevel$1.M: - return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 1]; - case ECLevel$1.Q: - return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 2]; - case ECLevel$1.H: - return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 3]; - default: - return void 0; - } -}; -errorCorrectionCode.getTotalCodewordsCount = function getTotalCodewordsCount(version2, errorCorrectionLevel2) { - switch (errorCorrectionLevel2) { - case ECLevel$1.L: - return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 0]; - case ECLevel$1.M: - return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 1]; - case ECLevel$1.Q: - return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 2]; - case ECLevel$1.H: - return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 3]; - default: - return void 0; - } -}; -var polynomial = {}; -var galoisField = {}; -const EXP_TABLE = new Uint8Array(512); -const LOG_TABLE = new Uint8Array(256); -(function initTables() { - let x3 = 1; - for (let i3 = 0; i3 < 255; i3++) { - EXP_TABLE[i3] = x3; - LOG_TABLE[x3] = i3; - x3 <<= 1; - if (x3 & 256) { - x3 ^= 285; - } - } - for (let i3 = 255; i3 < 512; i3++) { - EXP_TABLE[i3] = EXP_TABLE[i3 - 255]; - } -})(); -galoisField.log = function log(n4) { - if (n4 < 1) - throw new Error("log(" + n4 + ")"); - return LOG_TABLE[n4]; -}; -galoisField.exp = function exp(n4) { - return EXP_TABLE[n4]; -}; -galoisField.mul = function mul(x3, y3) { - if (x3 === 0 || y3 === 0) - return 0; - return EXP_TABLE[LOG_TABLE[x3] + LOG_TABLE[y3]]; -}; -(function(exports) { - const GF = galoisField; - exports.mul = function mul6(p1, p22) { - const coeff = new Uint8Array(p1.length + p22.length - 1); - for (let i3 = 0; i3 < p1.length; i3++) { - for (let j2 = 0; j2 < p22.length; j2++) { - coeff[i3 + j2] ^= GF.mul(p1[i3], p22[j2]); - } - } - return coeff; - }; - exports.mod = function mod2(divident, divisor) { - let result = new Uint8Array(divident); - while (result.length - divisor.length >= 0) { - const coeff = result[0]; - for (let i3 = 0; i3 < divisor.length; i3++) { - result[i3] ^= GF.mul(divisor[i3], coeff); - } - let offset2 = 0; - while (offset2 < result.length && result[offset2] === 0) - offset2++; - result = result.slice(offset2); - } - return result; - }; - exports.generateECPolynomial = function generateECPolynomial(degree) { - let poly = new Uint8Array([1]); - for (let i3 = 0; i3 < degree; i3++) { - poly = exports.mul(poly, new Uint8Array([1, GF.exp(i3)])); - } - return poly; - }; -})(polynomial); -const Polynomial = polynomial; -function ReedSolomonEncoder$1(degree) { - this.genPoly = void 0; - this.degree = degree; - if (this.degree) - this.initialize(this.degree); -} -ReedSolomonEncoder$1.prototype.initialize = function initialize(degree) { - this.degree = degree; - this.genPoly = Polynomial.generateECPolynomial(this.degree); -}; -ReedSolomonEncoder$1.prototype.encode = function encode2(data) { - if (!this.genPoly) { - throw new Error("Encoder not initialized"); - } - const paddedData = new Uint8Array(data.length + this.degree); - paddedData.set(data); - const remainder = Polynomial.mod(paddedData, this.genPoly); - const start = this.degree - remainder.length; - if (start > 0) { - const buff = new Uint8Array(this.degree); - buff.set(remainder, start); - return buff; - } - return remainder; -}; -var reedSolomonEncoder = ReedSolomonEncoder$1; -var version$1 = {}; -var mode = {}; -var versionCheck = {}; -versionCheck.isValid = function isValid(version2) { - return !isNaN(version2) && version2 >= 1 && version2 <= 40; -}; -var regex = {}; -const numeric = "[0-9]+"; -const alphanumeric = "[A-Z $%*+\\-./:]+"; -let kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+"; -kanji = kanji.replace(/u/g, "\\u"); -const byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+"; -regex.KANJI = new RegExp(kanji, "g"); -regex.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"); -regex.BYTE = new RegExp(byte, "g"); -regex.NUMERIC = new RegExp(numeric, "g"); -regex.ALPHANUMERIC = new RegExp(alphanumeric, "g"); -const TEST_KANJI = new RegExp("^" + kanji + "$"); -const TEST_NUMERIC = new RegExp("^" + numeric + "$"); -const TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$"); -regex.testKanji = function testKanji(str) { - return TEST_KANJI.test(str); -}; -regex.testNumeric = function testNumeric(str) { - return TEST_NUMERIC.test(str); -}; -regex.testAlphanumeric = function testAlphanumeric(str) { - return TEST_ALPHANUMERIC.test(str); -}; -(function(exports) { - const VersionCheck = versionCheck; - const Regex = regex; - exports.NUMERIC = { - id: "Numeric", - bit: 1 << 0, - ccBits: [10, 12, 14] - }; - exports.ALPHANUMERIC = { - id: "Alphanumeric", - bit: 1 << 1, - ccBits: [9, 11, 13] - }; - exports.BYTE = { - id: "Byte", - bit: 1 << 2, - ccBits: [8, 16, 16] - }; - exports.KANJI = { - id: "Kanji", - bit: 1 << 3, - ccBits: [8, 10, 12] - }; - exports.MIXED = { - bit: -1 - }; - exports.getCharCountIndicator = function getCharCountIndicator(mode2, version2) { - if (!mode2.ccBits) - throw new Error("Invalid mode: " + mode2); - if (!VersionCheck.isValid(version2)) { - throw new Error("Invalid version: " + version2); - } - if (version2 >= 1 && version2 < 10) - return mode2.ccBits[0]; - else if (version2 < 27) - return mode2.ccBits[1]; - return mode2.ccBits[2]; - }; - exports.getBestModeForData = function getBestModeForData(dataStr) { - if (Regex.testNumeric(dataStr)) - return exports.NUMERIC; - else if (Regex.testAlphanumeric(dataStr)) - return exports.ALPHANUMERIC; - else if (Regex.testKanji(dataStr)) - return exports.KANJI; - else - return exports.BYTE; - }; - exports.toString = function toString3(mode2) { - if (mode2 && mode2.id) - return mode2.id; - throw new Error("Invalid mode"); - }; - exports.isValid = function isValid2(mode2) { - return mode2 && mode2.bit && mode2.ccBits; - }; - function fromString2(string2) { - if (typeof string2 !== "string") { - throw new Error("Param is not a string"); - } - const lcStr = string2.toLowerCase(); - switch (lcStr) { - case "numeric": - return exports.NUMERIC; - case "alphanumeric": - return exports.ALPHANUMERIC; - case "kanji": - return exports.KANJI; - case "byte": - return exports.BYTE; - default: - throw new Error("Unknown mode: " + string2); - } - } - exports.from = function from2(value, defaultValue) { - if (exports.isValid(value)) { - return value; - } - try { - return fromString2(value); - } catch (e18) { - return defaultValue; - } - }; -})(mode); -(function(exports) { - const Utils2 = utils$f; - const ECCode2 = errorCorrectionCode; - const ECLevel2 = errorCorrectionLevel; - const Mode2 = mode; - const VersionCheck = versionCheck; - const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0; - const G18_BCH = Utils2.getBCHDigit(G18); - function getBestVersionForDataLength(mode2, length, errorCorrectionLevel2) { - for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { - if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, mode2)) { - return currentVersion; - } - } - return void 0; - } - function getReservedBitsCount(mode2, version2) { - return Mode2.getCharCountIndicator(mode2, version2) + 4; - } - function getTotalBitsFromDataArray(segments2, version2) { - let totalBits = 0; - segments2.forEach(function(data) { - const reservedBits = getReservedBitsCount(data.mode, version2); - totalBits += reservedBits + data.getBitsLength(); - }); - return totalBits; - } - function getBestVersionForMixedData(segments2, errorCorrectionLevel2) { - for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { - const length = getTotalBitsFromDataArray(segments2, currentVersion); - if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, Mode2.MIXED)) { - return currentVersion; - } - } - return void 0; - } - exports.from = function from2(value, defaultValue) { - if (VersionCheck.isValid(value)) { - return parseInt(value, 10); - } - return defaultValue; - }; - exports.getCapacity = function getCapacity(version2, errorCorrectionLevel2, mode2) { - if (!VersionCheck.isValid(version2)) { - throw new Error("Invalid QR Code version"); - } - if (typeof mode2 === "undefined") - mode2 = Mode2.BYTE; - const totalCodewords = Utils2.getSymbolTotalCodewords(version2); - const ecTotalCodewords = ECCode2.getTotalCodewordsCount(version2, errorCorrectionLevel2); - const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; - if (mode2 === Mode2.MIXED) - return dataTotalCodewordsBits; - const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode2, version2); - switch (mode2) { - case Mode2.NUMERIC: - return Math.floor(usableBits / 10 * 3); - case Mode2.ALPHANUMERIC: - return Math.floor(usableBits / 11 * 2); - case Mode2.KANJI: - return Math.floor(usableBits / 13); - case Mode2.BYTE: - default: - return Math.floor(usableBits / 8); - } - }; - exports.getBestVersionForData = function getBestVersionForData(data, errorCorrectionLevel2) { - let seg; - const ecl = ECLevel2.from(errorCorrectionLevel2, ECLevel2.M); - if (Array.isArray(data)) { - if (data.length > 1) { - return getBestVersionForMixedData(data, ecl); - } - if (data.length === 0) { - return 1; - } - seg = data[0]; - } else { - seg = data; - } - return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl); - }; - exports.getEncodedBits = function getEncodedBits2(version2) { - if (!VersionCheck.isValid(version2) || version2 < 7) { - throw new Error("Invalid QR Code version"); - } - let d4 = version2 << 12; - while (Utils2.getBCHDigit(d4) - G18_BCH >= 0) { - d4 ^= G18 << Utils2.getBCHDigit(d4) - G18_BCH; - } - return version2 << 12 | d4; - }; -})(version$1); -var formatInfo = {}; -const Utils$3 = utils$f; -const G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0; -const G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1; -const G15_BCH = Utils$3.getBCHDigit(G15); -formatInfo.getEncodedBits = function getEncodedBits(errorCorrectionLevel2, mask2) { - const data = errorCorrectionLevel2.bit << 3 | mask2; - let d4 = data << 10; - while (Utils$3.getBCHDigit(d4) - G15_BCH >= 0) { - d4 ^= G15 << Utils$3.getBCHDigit(d4) - G15_BCH; - } - return (data << 10 | d4) ^ G15_MASK; -}; -var segments = {}; -const Mode$4 = mode; -function NumericData(data) { - this.mode = Mode$4.NUMERIC; - this.data = data.toString(); -} -NumericData.getBitsLength = function getBitsLength(length) { - return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0); -}; -NumericData.prototype.getLength = function getLength() { - return this.data.length; -}; -NumericData.prototype.getBitsLength = function getBitsLength2() { - return NumericData.getBitsLength(this.data.length); -}; -NumericData.prototype.write = function write(bitBuffer2) { - let i3, group, value; - for (i3 = 0; i3 + 3 <= this.data.length; i3 += 3) { - group = this.data.substr(i3, 3); - value = parseInt(group, 10); - bitBuffer2.put(value, 10); - } - const remainingNum = this.data.length - i3; - if (remainingNum > 0) { - group = this.data.substr(i3); - value = parseInt(group, 10); - bitBuffer2.put(value, remainingNum * 3 + 1); - } -}; -var numericData = NumericData; -const Mode$3 = mode; -const ALPHA_NUM_CHARS = [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - " ", - "$", - "%", - "*", - "+", - "-", - ".", - "/", - ":" -]; -function AlphanumericData(data) { - this.mode = Mode$3.ALPHANUMERIC; - this.data = data; -} -AlphanumericData.getBitsLength = function getBitsLength3(length) { - return 11 * Math.floor(length / 2) + 6 * (length % 2); -}; -AlphanumericData.prototype.getLength = function getLength2() { - return this.data.length; -}; -AlphanumericData.prototype.getBitsLength = function getBitsLength4() { - return AlphanumericData.getBitsLength(this.data.length); -}; -AlphanumericData.prototype.write = function write2(bitBuffer2) { - let i3; - for (i3 = 0; i3 + 2 <= this.data.length; i3 += 2) { - let value = ALPHA_NUM_CHARS.indexOf(this.data[i3]) * 45; - value += ALPHA_NUM_CHARS.indexOf(this.data[i3 + 1]); - bitBuffer2.put(value, 11); - } - if (this.data.length % 2) { - bitBuffer2.put(ALPHA_NUM_CHARS.indexOf(this.data[i3]), 6); - } -}; -var alphanumericData = AlphanumericData; -var encodeUtf8$1 = function encodeUtf8(input) { - var result = []; - var size2 = input.length; - for (var index2 = 0; index2 < size2; index2++) { - var point5 = input.charCodeAt(index2); - if (point5 >= 55296 && point5 <= 56319 && size2 > index2 + 1) { - var second = input.charCodeAt(index2 + 1); - if (second >= 56320 && second <= 57343) { - point5 = (point5 - 55296) * 1024 + second - 56320 + 65536; - index2 += 1; - } - } - if (point5 < 128) { - result.push(point5); - continue; - } - if (point5 < 2048) { - result.push(point5 >> 6 | 192); - result.push(point5 & 63 | 128); - continue; - } - if (point5 < 55296 || point5 >= 57344 && point5 < 65536) { - result.push(point5 >> 12 | 224); - result.push(point5 >> 6 & 63 | 128); - result.push(point5 & 63 | 128); - continue; - } - if (point5 >= 65536 && point5 <= 1114111) { - result.push(point5 >> 18 | 240); - result.push(point5 >> 12 & 63 | 128); - result.push(point5 >> 6 & 63 | 128); - result.push(point5 & 63 | 128); - continue; - } - result.push(239, 191, 189); - } - return new Uint8Array(result).buffer; -}; -const encodeUtf82 = encodeUtf8$1; -const Mode$2 = mode; -function ByteData(data) { - this.mode = Mode$2.BYTE; - if (typeof data === "string") { - data = encodeUtf82(data); - } - this.data = new Uint8Array(data); -} -ByteData.getBitsLength = function getBitsLength5(length) { - return length * 8; -}; -ByteData.prototype.getLength = function getLength3() { - return this.data.length; -}; -ByteData.prototype.getBitsLength = function getBitsLength6() { - return ByteData.getBitsLength(this.data.length); -}; -ByteData.prototype.write = function(bitBuffer2) { - for (let i3 = 0, l2 = this.data.length; i3 < l2; i3++) { - bitBuffer2.put(this.data[i3], 8); - } -}; -var byteData = ByteData; -const Mode$1 = mode; -const Utils$2 = utils$f; -function KanjiData(data) { - this.mode = Mode$1.KANJI; - this.data = data; -} -KanjiData.getBitsLength = function getBitsLength7(length) { - return length * 13; -}; -KanjiData.prototype.getLength = function getLength4() { - return this.data.length; -}; -KanjiData.prototype.getBitsLength = function getBitsLength8() { - return KanjiData.getBitsLength(this.data.length); -}; -KanjiData.prototype.write = function(bitBuffer2) { - let i3; - for (i3 = 0; i3 < this.data.length; i3++) { - let value = Utils$2.toSJIS(this.data[i3]); - if (value >= 33088 && value <= 40956) { - value -= 33088; - } else if (value >= 57408 && value <= 60351) { - value -= 49472; - } else { - throw new Error( - "Invalid SJIS character: " + this.data[i3] + "\nMake sure your charset is UTF-8" - ); - } - value = (value >>> 8 & 255) * 192 + (value & 255); - bitBuffer2.put(value, 13); - } -}; -var kanjiData = KanjiData; -var dijkstra = { exports: {} }; -(function(module) { - var dijkstra2 = { - single_source_shortest_paths: function(graph, s2, d4) { - var predecessors = {}; - var costs = {}; - costs[s2] = 0; - var open = dijkstra2.PriorityQueue.make(); - open.push(s2, 0); - var closest, u2, v6, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit; - while (!open.empty()) { - closest = open.pop(); - u2 = closest.value; - cost_of_s_to_u = closest.cost; - adjacent_nodes = graph[u2] || {}; - for (v6 in adjacent_nodes) { - if (adjacent_nodes.hasOwnProperty(v6)) { - cost_of_e = adjacent_nodes[v6]; - cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; - cost_of_s_to_v = costs[v6]; - first_visit = typeof costs[v6] === "undefined"; - if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { - costs[v6] = cost_of_s_to_u_plus_cost_of_e; - open.push(v6, cost_of_s_to_u_plus_cost_of_e); - predecessors[v6] = u2; - } - } - } - } - if (typeof d4 !== "undefined" && typeof costs[d4] === "undefined") { - var msg = ["Could not find a path from ", s2, " to ", d4, "."].join(""); - throw new Error(msg); - } - return predecessors; - }, - extract_shortest_path_from_predecessor_list: function(predecessors, d4) { - var nodes = []; - var u2 = d4; - while (u2) { - nodes.push(u2); - predecessors[u2]; - u2 = predecessors[u2]; - } - nodes.reverse(); - return nodes; - }, - find_path: function(graph, s2, d4) { - var predecessors = dijkstra2.single_source_shortest_paths(graph, s2, d4); - return dijkstra2.extract_shortest_path_from_predecessor_list( - predecessors, - d4 - ); - }, - /** - * A very naive priority queue implementation. - */ - PriorityQueue: { - make: function(opts) { - var T9 = dijkstra2.PriorityQueue, t2 = {}, key2; - opts = opts || {}; - for (key2 in T9) { - if (T9.hasOwnProperty(key2)) { - t2[key2] = T9[key2]; - } - } - t2.queue = []; - t2.sorter = opts.sorter || T9.default_sorter; - return t2; - }, - default_sorter: function(a3, b2) { - return a3.cost - b2.cost; - }, - /** - * Add a new item to the queue and ensure the highest priority element - * is at the front of the queue. - */ - push: function(value, cost) { - var item = { value, cost }; - this.queue.push(item); - this.queue.sort(this.sorter); - }, - /** - * Return the highest priority element in the queue. - */ - pop: function() { - return this.queue.shift(); - }, - empty: function() { - return this.queue.length === 0; - } - } - }; - { - module.exports = dijkstra2; - } -})(dijkstra); -var dijkstraExports = dijkstra.exports; -(function(exports) { - const Mode2 = mode; - const NumericData2 = numericData; - const AlphanumericData2 = alphanumericData; - const ByteData2 = byteData; - const KanjiData2 = kanjiData; - const Regex = regex; - const Utils2 = utils$f; - const dijkstra2 = dijkstraExports; - function getStringByteLength(str) { - return unescape(encodeURIComponent(str)).length; - } - function getSegments(regex2, mode2, str) { - const segments2 = []; - let result; - while ((result = regex2.exec(str)) !== null) { - segments2.push({ - data: result[0], - index: result.index, - mode: mode2, - length: result[0].length - }); - } - return segments2; - } - function getSegmentsFromString(dataStr) { - const numSegs = getSegments(Regex.NUMERIC, Mode2.NUMERIC, dataStr); - const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode2.ALPHANUMERIC, dataStr); - let byteSegs; - let kanjiSegs; - if (Utils2.isKanjiModeEnabled()) { - byteSegs = getSegments(Regex.BYTE, Mode2.BYTE, dataStr); - kanjiSegs = getSegments(Regex.KANJI, Mode2.KANJI, dataStr); - } else { - byteSegs = getSegments(Regex.BYTE_KANJI, Mode2.BYTE, dataStr); - kanjiSegs = []; - } - const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs); - return segs.sort(function(s1, s2) { - return s1.index - s2.index; - }).map(function(obj) { - return { - data: obj.data, - mode: obj.mode, - length: obj.length - }; - }); - } - function getSegmentBitsLength(length, mode2) { - switch (mode2) { - case Mode2.NUMERIC: - return NumericData2.getBitsLength(length); - case Mode2.ALPHANUMERIC: - return AlphanumericData2.getBitsLength(length); - case Mode2.KANJI: - return KanjiData2.getBitsLength(length); - case Mode2.BYTE: - return ByteData2.getBitsLength(length); - } - } - function mergeSegments(segs) { - return segs.reduce(function(acc, curr) { - const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null; - if (prevSeg && prevSeg.mode === curr.mode) { - acc[acc.length - 1].data += curr.data; - return acc; - } - acc.push(curr); - return acc; - }, []); - } - function buildNodes(segs) { - const nodes = []; - for (let i3 = 0; i3 < segs.length; i3++) { - const seg = segs[i3]; - switch (seg.mode) { - case Mode2.NUMERIC: - nodes.push([ - seg, - { data: seg.data, mode: Mode2.ALPHANUMERIC, length: seg.length }, - { data: seg.data, mode: Mode2.BYTE, length: seg.length } - ]); - break; - case Mode2.ALPHANUMERIC: - nodes.push([ - seg, - { data: seg.data, mode: Mode2.BYTE, length: seg.length } - ]); - break; - case Mode2.KANJI: - nodes.push([ - seg, - { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) } - ]); - break; - case Mode2.BYTE: - nodes.push([ - { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) } - ]); - } - } - return nodes; - } - function buildGraph(nodes, version2) { - const table = {}; - const graph = { start: {} }; - let prevNodeIds = ["start"]; - for (let i3 = 0; i3 < nodes.length; i3++) { - const nodeGroup = nodes[i3]; - const currentNodeIds = []; - for (let j2 = 0; j2 < nodeGroup.length; j2++) { - const node2 = nodeGroup[j2]; - const key2 = "" + i3 + j2; - currentNodeIds.push(key2); - table[key2] = { node: node2, lastCount: 0 }; - graph[key2] = {}; - for (let n4 = 0; n4 < prevNodeIds.length; n4++) { - const prevNodeId = prevNodeIds[n4]; - if (table[prevNodeId] && table[prevNodeId].node.mode === node2.mode) { - graph[prevNodeId][key2] = getSegmentBitsLength(table[prevNodeId].lastCount + node2.length, node2.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node2.mode); - table[prevNodeId].lastCount += node2.length; - } else { - if (table[prevNodeId]) - table[prevNodeId].lastCount = node2.length; - graph[prevNodeId][key2] = getSegmentBitsLength(node2.length, node2.mode) + 4 + Mode2.getCharCountIndicator(node2.mode, version2); - } - } - } - prevNodeIds = currentNodeIds; - } - for (let n4 = 0; n4 < prevNodeIds.length; n4++) { - graph[prevNodeIds[n4]].end = 0; - } - return { map: graph, table }; - } - function buildSingleSegment(data, modesHint) { - let mode2; - const bestMode = Mode2.getBestModeForData(data); - mode2 = Mode2.from(modesHint, bestMode); - if (mode2 !== Mode2.BYTE && mode2.bit < bestMode.bit) { - throw new Error('"' + data + '" cannot be encoded with mode ' + Mode2.toString(mode2) + ".\n Suggested mode is: " + Mode2.toString(bestMode)); - } - if (mode2 === Mode2.KANJI && !Utils2.isKanjiModeEnabled()) { - mode2 = Mode2.BYTE; - } - switch (mode2) { - case Mode2.NUMERIC: - return new NumericData2(data); - case Mode2.ALPHANUMERIC: - return new AlphanumericData2(data); - case Mode2.KANJI: - return new KanjiData2(data); - case Mode2.BYTE: - return new ByteData2(data); - } - } - exports.fromArray = function fromArray(array2) { - return array2.reduce(function(acc, seg) { - if (typeof seg === "string") { - acc.push(buildSingleSegment(seg, null)); - } else if (seg.data) { - acc.push(buildSingleSegment(seg.data, seg.mode)); - } - return acc; - }, []); - }; - exports.fromString = function fromString2(data, version2) { - const segs = getSegmentsFromString(data, Utils2.isKanjiModeEnabled()); - const nodes = buildNodes(segs); - const graph = buildGraph(nodes, version2); - const path = dijkstra2.find_path(graph.map, "start", "end"); - const optimizedSegs = []; - for (let i3 = 1; i3 < path.length - 1; i3++) { - optimizedSegs.push(graph.table[path[i3]].node); - } - return exports.fromArray(mergeSegments(optimizedSegs)); - }; - exports.rawSplit = function rawSplit(data) { - return exports.fromArray( - getSegmentsFromString(data, Utils2.isKanjiModeEnabled()) - ); - }; -})(segments); -const Utils$1 = utils$f; -const ECLevel = errorCorrectionLevel; -const BitBuffer = bitBuffer; -const BitMatrix = bitMatrix; -const AlignmentPattern = alignmentPattern; -const FinderPattern = finderPattern; -const MaskPattern = maskPattern; -const ECCode = errorCorrectionCode; -const ReedSolomonEncoder = reedSolomonEncoder; -const Version = version$1; -const FormatInfo = formatInfo; -const Mode = mode; -const Segments = segments; -function setupFinderPattern(matrix, version2) { - const size2 = matrix.size; - const pos = FinderPattern.getPositions(version2); - for (let i3 = 0; i3 < pos.length; i3++) { - const row = pos[i3][0]; - const col = pos[i3][1]; - for (let r2 = -1; r2 <= 7; r2++) { - if (row + r2 <= -1 || size2 <= row + r2) - continue; - for (let c2 = -1; c2 <= 7; c2++) { - if (col + c2 <= -1 || size2 <= col + c2) - continue; - if (r2 >= 0 && r2 <= 6 && (c2 === 0 || c2 === 6) || c2 >= 0 && c2 <= 6 && (r2 === 0 || r2 === 6) || r2 >= 2 && r2 <= 4 && c2 >= 2 && c2 <= 4) { - matrix.set(row + r2, col + c2, true, true); - } else { - matrix.set(row + r2, col + c2, false, true); - } - } - } - } -} -function setupTimingPattern(matrix) { - const size2 = matrix.size; - for (let r2 = 8; r2 < size2 - 8; r2++) { - const value = r2 % 2 === 0; - matrix.set(r2, 6, value, true); - matrix.set(6, r2, value, true); - } -} -function setupAlignmentPattern(matrix, version2) { - const pos = AlignmentPattern.getPositions(version2); - for (let i3 = 0; i3 < pos.length; i3++) { - const row = pos[i3][0]; - const col = pos[i3][1]; - for (let r2 = -2; r2 <= 2; r2++) { - for (let c2 = -2; c2 <= 2; c2++) { - if (r2 === -2 || r2 === 2 || c2 === -2 || c2 === 2 || r2 === 0 && c2 === 0) { - matrix.set(row + r2, col + c2, true, true); - } else { - matrix.set(row + r2, col + c2, false, true); - } - } - } - } -} -function setupVersionInfo(matrix, version2) { - const size2 = matrix.size; - const bits = Version.getEncodedBits(version2); - let row, col, mod2; - for (let i3 = 0; i3 < 18; i3++) { - row = Math.floor(i3 / 3); - col = i3 % 3 + size2 - 8 - 3; - mod2 = (bits >> i3 & 1) === 1; - matrix.set(row, col, mod2, true); - matrix.set(col, row, mod2, true); - } -} -function setupFormatInfo(matrix, errorCorrectionLevel2, maskPattern2) { - const size2 = matrix.size; - const bits = FormatInfo.getEncodedBits(errorCorrectionLevel2, maskPattern2); - let i3, mod2; - for (i3 = 0; i3 < 15; i3++) { - mod2 = (bits >> i3 & 1) === 1; - if (i3 < 6) { - matrix.set(i3, 8, mod2, true); - } else if (i3 < 8) { - matrix.set(i3 + 1, 8, mod2, true); - } else { - matrix.set(size2 - 15 + i3, 8, mod2, true); - } - if (i3 < 8) { - matrix.set(8, size2 - i3 - 1, mod2, true); - } else if (i3 < 9) { - matrix.set(8, 15 - i3 - 1 + 1, mod2, true); - } else { - matrix.set(8, 15 - i3 - 1, mod2, true); - } - } - matrix.set(size2 - 8, 8, 1, true); -} -function setupData(matrix, data) { - const size2 = matrix.size; - let inc = -1; - let row = size2 - 1; - let bitIndex = 7; - let byteIndex = 0; - for (let col = size2 - 1; col > 0; col -= 2) { - if (col === 6) - col--; - while (true) { - for (let c2 = 0; c2 < 2; c2++) { - if (!matrix.isReserved(row, col - c2)) { - let dark = false; - if (byteIndex < data.length) { - dark = (data[byteIndex] >>> bitIndex & 1) === 1; - } - matrix.set(row, col - c2, dark); - bitIndex--; - if (bitIndex === -1) { - byteIndex++; - bitIndex = 7; - } - } - } - row += inc; - if (row < 0 || size2 <= row) { - row -= inc; - inc = -inc; - break; - } - } - } -} -function createData(version2, errorCorrectionLevel2, segments2) { - const buffer2 = new BitBuffer(); - segments2.forEach(function(data) { - buffer2.put(data.mode.bit, 4); - buffer2.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version2)); - data.write(buffer2); - }); - const totalCodewords = Utils$1.getSymbolTotalCodewords(version2); - const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); - const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; - if (buffer2.getLengthInBits() + 4 <= dataTotalCodewordsBits) { - buffer2.put(0, 4); - } - while (buffer2.getLengthInBits() % 8 !== 0) { - buffer2.putBit(0); - } - const remainingByte = (dataTotalCodewordsBits - buffer2.getLengthInBits()) / 8; - for (let i3 = 0; i3 < remainingByte; i3++) { - buffer2.put(i3 % 2 ? 17 : 236, 8); - } - return createCodewords(buffer2, version2, errorCorrectionLevel2); -} -function createCodewords(bitBuffer2, version2, errorCorrectionLevel2) { - const totalCodewords = Utils$1.getSymbolTotalCodewords(version2); - const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); - const dataTotalCodewords = totalCodewords - ecTotalCodewords; - const ecTotalBlocks = ECCode.getBlocksCount(version2, errorCorrectionLevel2); - const blocksInGroup2 = totalCodewords % ecTotalBlocks; - const blocksInGroup1 = ecTotalBlocks - blocksInGroup2; - const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks); - const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks); - const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1; - const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1; - const rs2 = new ReedSolomonEncoder(ecCount); - let offset2 = 0; - const dcData = new Array(ecTotalBlocks); - const ecData = new Array(ecTotalBlocks); - let maxDataSize = 0; - const buffer2 = new Uint8Array(bitBuffer2.buffer); - for (let b2 = 0; b2 < ecTotalBlocks; b2++) { - const dataSize = b2 < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2; - dcData[b2] = buffer2.slice(offset2, offset2 + dataSize); - ecData[b2] = rs2.encode(dcData[b2]); - offset2 += dataSize; - maxDataSize = Math.max(maxDataSize, dataSize); - } - const data = new Uint8Array(totalCodewords); - let index2 = 0; - let i3, r2; - for (i3 = 0; i3 < maxDataSize; i3++) { - for (r2 = 0; r2 < ecTotalBlocks; r2++) { - if (i3 < dcData[r2].length) { - data[index2++] = dcData[r2][i3]; - } - } - } - for (i3 = 0; i3 < ecCount; i3++) { - for (r2 = 0; r2 < ecTotalBlocks; r2++) { - data[index2++] = ecData[r2][i3]; - } - } - return data; -} -function createSymbol(data, version2, errorCorrectionLevel2, maskPattern2) { - let segments2; - if (Array.isArray(data)) { - segments2 = Segments.fromArray(data); - } else if (typeof data === "string") { - let estimatedVersion = version2; - if (!estimatedVersion) { - const rawSegments = Segments.rawSplit(data); - estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel2); - } - segments2 = Segments.fromString(data, estimatedVersion || 40); - } else { - throw new Error("Invalid data"); - } - const bestVersion = Version.getBestVersionForData(segments2, errorCorrectionLevel2); - if (!bestVersion) { - throw new Error("The amount of data is too big to be stored in a QR Code"); - } - if (!version2) { - version2 = bestVersion; - } else if (version2 < bestVersion) { - throw new Error( - "\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n" - ); - } - const dataBits = createData(version2, errorCorrectionLevel2, segments2); - const moduleCount = Utils$1.getSymbolSize(version2); - const modules = new BitMatrix(moduleCount); - setupFinderPattern(modules, version2); - setupTimingPattern(modules); - setupAlignmentPattern(modules, version2); - setupFormatInfo(modules, errorCorrectionLevel2, 0); - if (version2 >= 7) { - setupVersionInfo(modules, version2); - } - setupData(modules, dataBits); - if (isNaN(maskPattern2)) { - maskPattern2 = MaskPattern.getBestMask( - modules, - setupFormatInfo.bind(null, modules, errorCorrectionLevel2) - ); - } - MaskPattern.applyMask(maskPattern2, modules); - setupFormatInfo(modules, errorCorrectionLevel2, maskPattern2); - return { - modules, - version: version2, - errorCorrectionLevel: errorCorrectionLevel2, - maskPattern: maskPattern2, - segments: segments2 - }; -} -qrcode.create = function create2(data, options) { - if (typeof data === "undefined" || data === "") { - throw new Error("No input text"); - } - let errorCorrectionLevel2 = ECLevel.M; - let version2; - let mask2; - if (typeof options !== "undefined") { - errorCorrectionLevel2 = ECLevel.from(options.errorCorrectionLevel, ECLevel.M); - version2 = Version.from(options.version); - mask2 = MaskPattern.from(options.maskPattern); - if (options.toSJISFunc) { - Utils$1.setToSJISFunction(options.toSJISFunc); - } - } - return createSymbol(data, version2, errorCorrectionLevel2, mask2); -}; -var canvas = {}; -var utils$e = {}; -(function(exports) { - function hex2rgba(hex) { - if (typeof hex === "number") { - hex = hex.toString(); - } - if (typeof hex !== "string") { - throw new Error("Color should be defined as hex string"); - } - let hexCode = hex.slice().replace("#", "").split(""); - if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) { - throw new Error("Invalid hex color: " + hex); - } - if (hexCode.length === 3 || hexCode.length === 4) { - hexCode = Array.prototype.concat.apply([], hexCode.map(function(c2) { - return [c2, c2]; - })); - } - if (hexCode.length === 6) - hexCode.push("F", "F"); - const hexValue = parseInt(hexCode.join(""), 16); - return { - r: hexValue >> 24 & 255, - g: hexValue >> 16 & 255, - b: hexValue >> 8 & 255, - a: hexValue & 255, - hex: "#" + hexCode.slice(0, 6).join("") - }; - } - exports.getOptions = function getOptions(options) { - if (!options) - options = {}; - if (!options.color) - options.color = {}; - const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin; - const width = options.width && options.width >= 21 ? options.width : void 0; - const scale = options.scale || 4; - return { - width, - scale: width ? 4 : scale, - margin, - color: { - dark: hex2rgba(options.color.dark || "#000000ff"), - light: hex2rgba(options.color.light || "#ffffffff") - }, - type: options.type, - rendererOpts: options.rendererOpts || {} - }; - }; - exports.getScale = function getScale(qrSize, opts) { - return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale; - }; - exports.getImageWidth = function getImageWidth(qrSize, opts) { - const scale = exports.getScale(qrSize, opts); - return Math.floor((qrSize + opts.margin * 2) * scale); - }; - exports.qrToImageData = function qrToImageData(imgData, qr2, opts) { - const size2 = qr2.modules.size; - const data = qr2.modules.data; - const scale = exports.getScale(size2, opts); - const symbolSize = Math.floor((size2 + opts.margin * 2) * scale); - const scaledMargin = opts.margin * scale; - const palette = [opts.color.light, opts.color.dark]; - for (let i3 = 0; i3 < symbolSize; i3++) { - for (let j2 = 0; j2 < symbolSize; j2++) { - let posDst = (i3 * symbolSize + j2) * 4; - let pxColor = opts.color.light; - if (i3 >= scaledMargin && j2 >= scaledMargin && i3 < symbolSize - scaledMargin && j2 < symbolSize - scaledMargin) { - const iSrc = Math.floor((i3 - scaledMargin) / scale); - const jSrc = Math.floor((j2 - scaledMargin) / scale); - pxColor = palette[data[iSrc * size2 + jSrc] ? 1 : 0]; - } - imgData[posDst++] = pxColor.r; - imgData[posDst++] = pxColor.g; - imgData[posDst++] = pxColor.b; - imgData[posDst] = pxColor.a; - } - } - }; -})(utils$e); -(function(exports) { - const Utils2 = utils$e; - function clearCanvas(ctx, canvas2, size2) { - ctx.clearRect(0, 0, canvas2.width, canvas2.height); - if (!canvas2.style) - canvas2.style = {}; - canvas2.height = size2; - canvas2.width = size2; - canvas2.style.height = size2 + "px"; - canvas2.style.width = size2 + "px"; - } - function getCanvasElement() { - try { - return document.createElement("canvas"); - } catch (e18) { - throw new Error("You need to specify a canvas element"); - } - } - exports.render = function render2(qrData, canvas2, options) { - let opts = options; - let canvasEl = canvas2; - if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { - opts = canvas2; - canvas2 = void 0; - } - if (!canvas2) { - canvasEl = getCanvasElement(); - } - opts = Utils2.getOptions(opts); - const size2 = Utils2.getImageWidth(qrData.modules.size, opts); - const ctx = canvasEl.getContext("2d"); - const image = ctx.createImageData(size2, size2); - Utils2.qrToImageData(image.data, qrData, opts); - clearCanvas(ctx, canvasEl, size2); - ctx.putImageData(image, 0, 0); - return canvasEl; - }; - exports.renderToDataURL = function renderToDataURL(qrData, canvas2, options) { - let opts = options; - if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { - opts = canvas2; - canvas2 = void 0; - } - if (!opts) - opts = {}; - const canvasEl = exports.render(qrData, canvas2, opts); - const type2 = opts.type || "image/png"; - const rendererOpts = opts.rendererOpts || {}; - return canvasEl.toDataURL(type2, rendererOpts.quality); - }; -})(canvas); -var svgTag = {}; -const Utils = utils$e; -function getColorAttrib(color, attrib) { - const alpha2 = color.a / 255; - const str = attrib + '="' + color.hex + '"'; - return alpha2 < 1 ? str + " " + attrib + '-opacity="' + alpha2.toFixed(2).slice(1) + '"' : str; -} -function svgCmd(cmd, x3, y3) { - let str = cmd + x3; - if (typeof y3 !== "undefined") - str += " " + y3; - return str; -} -function qrToPath(data, size2, margin) { - let path = ""; - let moveBy = 0; - let newRow = false; - let lineLength = 0; - for (let i3 = 0; i3 < data.length; i3++) { - const col = Math.floor(i3 % size2); - const row = Math.floor(i3 / size2); - if (!col && !newRow) - newRow = true; - if (data[i3]) { - lineLength++; - if (!(i3 > 0 && col > 0 && data[i3 - 1])) { - path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0); - moveBy = 0; - newRow = false; - } - if (!(col + 1 < size2 && data[i3 + 1])) { - path += svgCmd("h", lineLength); - lineLength = 0; - } - } else { - moveBy++; - } - } - return path; -} -svgTag.render = function render(qrData, options, cb2) { - const opts = Utils.getOptions(options); - const size2 = qrData.modules.size; - const data = qrData.modules.data; - const qrcodesize = size2 + opts.margin * 2; - const bg2 = !opts.color.light.a ? "" : "'; - const path = "'; - const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"'; - const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" '; - const svgTag2 = '' + bg2 + path + "\n"; - if (typeof cb2 === "function") { - cb2(null, svgTag2); - } - return svgTag2; -}; -const canPromise = canPromise$1; -const QRCode$1 = qrcode; -const CanvasRenderer = canvas; -const SvgRenderer = svgTag; -function renderCanvas(renderFunc, canvas2, text, opts, cb2) { - const args = [].slice.call(arguments, 1); - const argsNum = args.length; - const isLastArgCb = typeof args[argsNum - 1] === "function"; - if (!isLastArgCb && !canPromise()) { - throw new Error("Callback required as last argument"); - } - if (isLastArgCb) { - if (argsNum < 2) { - throw new Error("Too few arguments provided"); - } - if (argsNum === 2) { - cb2 = text; - text = canvas2; - canvas2 = opts = void 0; - } else if (argsNum === 3) { - if (canvas2.getContext && typeof cb2 === "undefined") { - cb2 = opts; - opts = void 0; - } else { - cb2 = opts; - opts = text; - text = canvas2; - canvas2 = void 0; - } - } - } else { - if (argsNum < 1) { - throw new Error("Too few arguments provided"); - } - if (argsNum === 1) { - text = canvas2; - canvas2 = opts = void 0; - } else if (argsNum === 2 && !canvas2.getContext) { - opts = text; - text = canvas2; - canvas2 = void 0; - } - return new Promise(function(resolve, reject) { - try { - const data = QRCode$1.create(text, opts); - resolve(renderFunc(data, canvas2, opts)); - } catch (e18) { - reject(e18); - } - }); - } - try { - const data = QRCode$1.create(text, opts); - cb2(null, renderFunc(data, canvas2, opts)); - } catch (e18) { - cb2(e18); - } -} -browser$2.create = QRCode$1.create; -browser$2.toCanvas = renderCanvas.bind(null, CanvasRenderer.render); -browser$2.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL); -browser$2.toString = renderCanvas.bind(null, function(data, _3, opts) { - return SvgRenderer.render(data, opts); -}); -(function() { - try { - if (typeof document != "undefined") { - var elementStyle = document.createElement("style"); - elementStyle.appendChild(document.createTextNode('.wk_t59jcv0 {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n transition-property: background,color,opacity;\n transition-duration: 0.2s;\n text-decoration: none;\n}\n.wk_t59jcv0::before {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n.wk_t59jcv0::after {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}.wk_14j9dar0 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n outline: none;\n border: none;\n cursor: pointer;\n height: 56px;\n padding: 0 16px;\n font-size: 16px;\n font-weight: 500;\n line-height: 19px;\n}.wk_vno40y0 {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 32px;\n text-align: center;\n overflow: auto;\n}.wk_1rmpmq20 {\n display: flex;\n justify-content: center;\n margin-top: 32px;\n}.wk_qhb85j0 {\n font-weight: 600;\n display: flex;\n font-size: 24px;\n line-height: 29px;\n justify-content: center;\n text-align: center;\n}\n@media screen and (max-width: 767px) {\n .wk_qhb85j0 {\n font-size: 18px;\n line-height: 22px;\n }\n}@keyframes wk_107z37f3 {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.wk_107z37f0 {\n position: relative;\n width: 100px;\n height: 100px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.wk_107z37f1 {\n border-radius: 50%;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.wk_107z37f1 > * {\n width: 80px;\n height: 80px;\n}\n.wk_107z37f2 {\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n position: absolute;\n border: 2px solid var(--wk-colors-error);\n margin-top: 2px;\n}\n.wk_107z37f4 {\n animation: wk_107z37f3 1200ms linear infinite;\n position: absolute;\n left: 50%;\n transform-origin: 1px 50%;\n margin-top: 2px;\n}.wk_1nr7e5q0 {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n text-align: center;\n gap: 8px;\n overflow: hidden;\n}.wk_1cxzn9q0 {\n display: flex;\n max-width: 340px;\n font-size: 18px;\n text-align: center;\n line-height: 22px;\n font-weight: 400;\n color: var(--wk-colors-textSecondary);\n}.wk_ebg9wh0 {\n display: flex;\n font-size: 18px;\n font-weight: 500;\n line-height: 22px;\n align-items: center;\n justify-content: center;\n color: var(--wk-colors-error);\n gap: 4px;\n}.wk_pb4clz0 {\n font-size: 18px;\n font-weight: 500;\n line-height: 22px;\n}.wk_qfvtl91 {\n margin-top: 32px;\n}\n.wk_qfvtl92 {\n height: 56px;\n width: 100%;\n border-radius: var(--wk-radii-button);\n background: var(--wk-colors-buttonBackground);\n color: var(--wk-colors-buttonText);\n}\n.wk_qfvtl93 {\n margin-top: 40px;\n margin-bottom: -8px;\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_qfvtl92:hover {\n background: var(--wk-colors-buttonBackgroundHover);\n color: var(--wk-colors-buttonTextHover);\n }\n}\n@media screen {\n .wk_qfvtl92:active {\n background: var(--wk-colors-buttonBackgroundHover);\n color: var(--wk-colors-buttonTextHover);\n }\n}\n@media screen and (max-width: 767px) {\n .wk_qfvtl93 {\n margin-top: 24px;\n margin-bottom: -16px;\n }\n}.wk_1a9rgw50 {\n text-decoration: none;\n}\n.wk_1a9rgw50:visited {\n color: unset;\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_1a9rgw50:hover {\n color: var(--wk-colors-primaryActive);\n }\n}\n@media screen {\n .wk_1a9rgw50:active {\n color: var(--wk-colors-primaryActive);\n }\n}@keyframes wk_y1x8do0 {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes wk_y1x8do1 {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n.wk_y1x8do2 {\n animation: wk_y1x8do0 0.2s forwards;\n}\n.wk_y1x8do3 {\n animation: wk_y1x8do1 0.2s forwards;\n}@keyframes wk_1jpwxhg0 {\n 0% {\n opacity: 0;\n transform: translateY(-24px) scale(0.85);\n max-height: 0;\n }\n 100% {\n opacity: 1;\n transform: translateY(0) scale(1);\n max-height: 200px;\n }\n}\n@keyframes wk_1jpwxhg1 {\n 0% {\n opacity: 1;\n transform: scale(1);\n max-height: 200px;\n }\n 50% {\n opacity: 0;\n transform: scale(0.85);\n max-height: 0;\n }\n 100% {\n opacity: 0;\n transform: scale(0.85);\n max-height: 0;\n }\n}\n.wk_1jpwxhg2 {\n animation: wk_1jpwxhg0 0.4s forwards;\n transform-origin: 50% 50% 0px;\n}\n.wk_1jpwxhg3 {\n animation: wk_1jpwxhg1 0.4s forwards;\n transform-origin: 50% 50% 0px;\n}@keyframes wk_3li8yi0 {\n 0% {\n transform: translateY(40%);\n }\n 100% {\n transform: translateY(0%);\n }\n}\n@keyframes wk_3li8yi1 {\n 0% {\n transform: translateY(0%);\n }\n 100% {\n transform: translateY(40%);\n }\n}\n.wk_3li8yi2 {\n animation: wk_3li8yi0 0.2s forwards ease-out;\n transform-origin: bottom center;\n}\n.wk_3li8yi3 {\n animation: wk_3li8yi1 0.2s forwards ease-out;\n transform-origin: bottom center;\n}@keyframes wk_92eoeu0 {\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -100% 0;\n }\n}\n.wk_92eoeu1 {\n width: 100%;\n height: 100%;\n opacity: 0.1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n pointer-events: none;\n}\n.wk_92eoeu1::before {\n content: "";\n z-index: 3;\n position: absolute;\n inset: 0;\n background-position: initial;\n background-repeat: repeat;\n background-attachment: initial;\n background-origin: initial;\n background-clip: initial;\n background-color: initial;\n background-size: 1.888% 1.888%;\n background-image: radial-gradient(var(--wk-colors-qrCodeDot) 41%,transparent 41%);\n}\n.wk_92eoeu1::after {\n content: "";\n z-index: 5;\n position: absolute;\n inset: 0;\n transform: scale(2) rotate(45deg);\n background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 50%, rgb(255, 255, 255), rgba(255, 255, 255, 0));\n background-size: 200% 100%;\n animation: 1000ms linear 0s infinite normal both running wk_92eoeu0;\n}\n.wk_92eoeu2 {\n z-index: 4;\n position: absolute;\n background: var(--wk-colors-qrCodeDot);\n border-radius: 8px;\n width: 13.2%;\n height: 13.2%;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 0 3px var(--wk-colors-modalBackground);\n}\n.wk_92eoeu2::before {\n content: "";\n width: 71.4%;\n height: 71.4%;\n border-radius: 4px;\n border: 4px solid var(--wk-colors-modalBackground);\n}\n.wk_92eoeu2:nth-child(1) {\n left: 0;\n top: 0;\n}\n.wk_92eoeu2:nth-child(2) {\n right: 0;\n top: 0;\n}\n.wk_92eoeu2:nth-child(3) {\n left: 0;\n bottom: 0;\n}.wk_10yx5n50 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 240px;\n height: 240px;\n overflow: hidden;\n font-size: 0;\n border: 1px solid;\n border-color: var(--wk-colors-qrCodeBorder);\n border-radius: var(--wk-radii-qrCode);\n}\n.wk_10yx5n51 {\n width: 212px;\n height: 212px;\n position: relative;\n}\n.wk_10yx5n52 {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: inline-flex;\n border-radius: 12px;\n overflow: hidden;\n}\n.wk_10yx5n52 > * {\n width: 100%;\n height: 100%;\n}.wk_1j0944g0 {\n align-items: center;\n}\n.wk_1j0944g1 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n gap: 4px;\n cursor: pointer;\n}.wk_1dbgl2y0 {\n display: flex;\n align-items: flex-start;\n justify-content: center;\n height: 111px;\n flex-shrink: 0;\n}\n.wk_1dbgl2y1 {\n display: flex;\n align-items: center;\n flex-direction: column;\n justify-content: flex-start;\n padding: 8px 0;\n border-radius: 16px;\n gap: 8px;\n width: 100%;\n height: auto;\n color: var(--wk-colors-textSecondary);\n background: transparent;\n}\n.wk_1dbgl2y2 {\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n}\n.wk_1dbgl2y3 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 68px;\n height: 68px;\n border-radius: 16px;\n overflow: hidden;\n flex-shrink: 0;\n}\n.wk_1dbgl2y3 > * {\n width: 100%;\n height: 100%;\n}\n.wk_1dbgl2y4 {\n cursor: not-allowed;\n opacity: 0.3;\n}\n@media screen and (max-width: 767px) {\n .wk_1dbgl2y0 {\n height: 99px;\n }\n .wk_1dbgl2y2 {\n font-size: 12px;\n line-height: 15px;\n }\n .wk_1dbgl2y3 {\n width: 60px;\n height: 60px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_1dbgl2y1:hover {\n background: var(--wk-colors-walletOptionBackgroundHover);\n }\n .wk_1dbgl2y4:hover {\n background: transparent;\n }\n}\n@media screen {\n .wk_1dbgl2y1:active {\n background: var(--wk-colors-walletOptionBackgroundHover);\n }\n .wk_1dbgl2y4:active {\n background: transparent;\n }\n}.wk_cvot8n0 {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n row-gap: 24px;\n column-gap: 15px;\n}\n.wk_cvot8n1 {\n height: 50px;\n width: 100%;\n gap: 10px;\n border: 1px solid;\n border-radius: var(--wk-radii-noWalletButton);\n background: var(--wk-colors-noWalletButtonBackground);\n border-color: var(--wk-colors-noWalletButtonBorder);\n color: var(--wk-colors-noWalletButtonText);\n}\n@media screen and (max-width: 767px) {\n .wk_cvot8n0 {\n row-gap: 16px;\n column-gap: 4.5px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_cvot8n1:hover {\n background: var(--wk-colors-noWalletButtonBackgroundHover);\n color: var(--wk-colors-noWalletButtonTextHover);\n border-color: var(--wk-colors-noWalletButtonBorderHover);\n }\n}\n@media screen {\n .wk_cvot8n1:active {\n background: var(--wk-colors-noWalletButtonBackgroundHover);\n color: var(--wk-colors-noWalletButtonTextHover);\n border-color: var(--wk-colors-noWalletButtonBorderHover);\n }\n}.wk_1lg2shr0 {\n gap: 16px;\n}\n.wk_1lg2shr1 {\n display: flex;\n align-items: center;\n gap: 10px;\n font-size: 14px;\n font-weight: 400;\n}.wk_713zwr0 {\n height: 68px;\n padding-left: 20px;\n padding-right: 20px;\n border-radius: var(--wk-radii-walletOption);\n color: var(--wk-colors-walletOptionText);\n background: var(--wk-colors-walletOptionBackground);\n width: 100%;\n flex-shrink: 0;\n}\n.wk_713zwr1 {\n flex: 1;\n font-size: 18px;\n font-weight: 600;\n text-align: left;\n}\n.wk_713zwr2 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: var(--wk-radii-walletOptionIcon);\n overflow: hidden;\n}\n.wk_713zwr3 {\n cursor: not-allowed;\n opacity: 0.3;\n}\n.wk_713zwr2 > * {\n width: 100%;\n height: 100%;\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_713zwr0:hover {\n color: var(--wk-colors-walletOptionTextHover);\n background: var(--wk-colors-walletOptionBackgroundHover);\n }\n .wk_713zwr3:hover {\n color: var(--wk-colors-walletOptionText);\n background: var(--wk-colors-walletOptionBackground);\n }\n}\n@media screen {\n .wk_713zwr0:active {\n color: var(--wk-colors-walletOptionTextHover);\n background: var(--wk-colors-walletOptionBackgroundHover);\n }\n .wk_713zwr3:active {\n color: var(--wk-colors-walletOptionText);\n background: var(--wk-colors-walletOptionBackground);\n }\n}.wk_zqrn660 {\n margin-top: 8px;\n font-weight: 400;\n font-size: 14px;\n line-height: 17px;\n color: var(--wk-colors-textSecondary);\n text-align: center;\n}.wk_1sntu030 {\n position: fixed;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n z-index: var(--wk-zIndices-toast);\n padding: 8px;\n display: flex;\n flex-direction: column;\n align-items: center;\n pointer-events: none;\n width: 100%;\n color: var(--wk-colors-text);\n max-width: 500px;\n}\n.wk_1sntu031 {\n display: inline-flex;\n align-items: center;\n padding: 16px;\n margin: 8px;\n background: var(--wk-colors-toastBackground);\n position: relative;\n box-shadow: var(--wk-shadows-toast);\n border-radius: var(--wk-radii-toast);\n word-wrap: break-word;\n pointer-events: all;\n}\n.wk_1sntu032 {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.wk_1sntu033 {\n margin-left: 8px;\n font-weight: 500;\n font-size: 14px;\n line-height: 1.4;\n}.wk_1kzf8pa0 {\n position: absolute;\n background: var(--wk-colors-modalBackground);\n padding: 48px 24px;\n width: calc(100% - 32px);\n max-height: 100%;\n max-width: 484px;\n border-radius: var(--wk-radii-modal);\n display: flex;\n flex-direction: column;\n}\n@media screen and (max-width: 767px) {\n .wk_1kzf8pa0 {\n width: 100%;\n max-width: 100vw;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding-bottom: 40px;\n left: 0;\n bottom: 0;\n }\n}.wk_3qg8ds0 {\n z-index: var(--wk-zIndices-modal);\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--wk-colors-text);\n margin: 0;\n padding: 0;\n transition: all 0.3s;\n box-sizing: border-box;\n}\n.wk_3qg8ds1 {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: var(--wk-colors-modalOverlay);\n}\n@media screen and (max-width: 767px) {\n .wk_3qg8ds0 {\n align-items: flex-end;\n }\n}.wk_1bjpejd0 {\n width: 24px;\n height: 24px;\n border-radius: var(--wk-radii-navButton);\n padding: 0;\n background: transparent;\n color: var(--wk-colors-navButtonText);\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_1bjpejd0:hover {\n background: var(--wk-colors-navButtonBackgroundHover);\n }\n}\n@media screen {\n .wk_1bjpejd0:active {\n background: var(--wk-colors-navButtonBackgroundHover);\n }\n}.wk_1nzgcmu0 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: absolute;\n top: 0;\n left: 0;\n padding: 24px 24px 0;\n width: 100%;\n}.wk_6fxksu0 {\n width: 100%;\n max-width: 484px;\n}\n.wk_6fxksu1 {\n position: relative;\n border: 1px solid;\n border-color: var(--wk-colors-border);\n box-shadow: var(--wk-shadows-normal);\n padding: 24px;\n width: 100%;\n max-width: unset;\n}')); - document.head.insertBefore(elementStyle, document.head.firstChild); - } - } catch (e18) { - console.error("vite-plugin-css-injected-by-js", e18); - } -})(); -function cx(...classNames) { - if (!classNames.length) - return; - return classNames.filter(Boolean).join(" "); -} -function cssVar(name2, type2 = "colors") { - return `var(--wk-${type2}-${name2.replace(/\./g, "-")})`; -} -function rgba(firstValue, secondValue, thirdValue, fourthValue = 1) { - var _a3; - if (typeof firstValue === "string") { - if (firstValue.startsWith("#")) { - const hexStr = firstValue.slice(1); - const formatStr = hexStr.length === 3 ? hexStr.replace(/[A-F\d]/gi, "$&$&") : hexStr; - const hexArr = (_a3 = formatStr.match(/.{2}/g)) == null ? void 0 : _a3.map((v6) => parseInt(v6, 16)); - if ((hexArr == null ? void 0 : hexArr.length) === 3) { - return rgba(hexArr[0], hexArr[1], hexArr[2], secondValue); - } - } - } - return `rgba(${firstValue}, ${secondValue}, ${thirdValue}, ${fourthValue})`; -} -const radii = { - common: "8px", - modal: "12px", - navButton: "4px", - button: "var(--wk-radii-common)", - connectButton: "var(--wk-radii-common)", - disconnectButton: "var(--wk-radii-common)", - noWalletButton: "var(--wk-radii-common)", - walletOption: "var(--wk-radii-common)", - walletOptionIcon: "var(--wk-radii-common)", - chainOption: "var(--wk-radii-common)", - toast: "var(--wk-radii-common)", - qrCode: "var(--wk-radii-common)" -}; -const zIndices = { - modal: 1300, - toast: 1500 -}; -const base$2 = { - light: { - colors: { - text: "#1E2026", - textSecondary: "#76808F", - primary: "#CC9D09", - primaryActive: "#F0B90B", - error: "#D9304E", - errorActive: "#B82942", - border: "#E6E8EA", - disabled: "#AEB4BC", - modalBackground: "#FFFFFF", - modalOverlay: "rgba(0, 0, 0, 0.5)", - buttonText: "var(--wk-colors-text)", - buttonTextHover: "var(--wk-colors-text)", - buttonBackground: "#f5f5f5", - buttonBackgroundHover: rgba("#F0B90B", 0.1), - connectButtonText: "var(--wk-colors-text)", - connectButtonTextHover: "var(--wk-colors-text)", - connectButtonBackground: "#f5f5f5", - connectButtonBackgroundHover: "#e6e8ea", - navButtonText: "var(--wk-colors-textSecondary)", - navButtonBackgroundHover: "var(--wk-colors-border)", - optionText: "var(--wk-colors-text)", - optionTextHover: "var(--wk-colors-text)", - optionBackground: "#f5f5f5", - optionBackgroundHover: rgba("#F0B90B", 0.1), - walletOptionText: "var(--wk-colors-optionText)", - walletOptionTextHover: "var(--wk-colors-optionTextHover)", - walletOptionBackground: "var(--wk-colors-optionBackground)", - walletOptionBackgroundHover: "var(--wk-colors-optionBackgroundHover)", - chainOptionText: "var(--wk-colors-optionText)", - chainOptionTextHover: "var(--wk-colors-optionTextHover)", - chainOptionBackground: "var(--wk-colors-optionBackground)", - chainOptionBackgroundHover: "var(--wk-colors-optionBackgroundHover)", - toastBackground: "var(--wk-colors-modalBackground)", - qrCodeDot: "var(--wk-colors-text)", - qrCodeBorder: "var(--wk-colors-border)", - noWalletButtonText: "var(--wk-colors-text)", - noWalletButtonTextHover: "var(--wk-colors-text)", - noWalletButtonBackground: "transparent", - noWalletButtonBackgroundHover: "var(--wk-colors-border)", - noWalletButtonBorder: "var(--wk-colors-border)", - noWalletButtonBorderHover: "var(--wk-colors-border)", - disconnectButtonBackgroundText: "var(--wk-colors-text)", - disconnectButtonBackgroundTextHover: "var(--wk-colors-text)", - disconnectButtonBackground: "transparent", - disconnectButtonBackgroundHover: "var(--wk-colors-border)", - disconnectButtonBorder: "var(--wk-colors-border)", - disconnectButtonBorderHover: "var(--wk-colors-border)" - }, - shadows: { - normal: "0px 4px 20px 0px rgba(0, 0, 0, 0.04)", - toast: "0px 4px 24px rgba(0, 0, 0, 0.08)" - }, - radii, - zIndices - }, - dark: { - colors: { - text: "#FFF", - textSecondary: "#76808F", - primary: "#CC9D09", - primaryActive: "#F0B90B", - error: "#D9304E", - errorActive: "#B82942", - border: "#2e323a", - disabled: "#5E6673", - modalBackground: "#1E2026", - modalOverlay: rgba("#000", 0.5), - buttonText: "var(--wk-colors-text)", - buttonTextHover: "var(--wk-colors-text)", - buttonBackground: "#14151a", - buttonBackgroundHover: rgba("#F0B90B", 0.1), - connectButtonText: "var(--wk-colors-text)", - connectButtonTextHover: "var(--wk-colors-text)", - connectButtonBackground: "#2b2f36", - connectButtonBackgroundHover: "#2e323a", - navButtonText: "var(--wk-colors-textSecondary)", - navButtonBackgroundHover: "var(--wk-colors-border)", - optionText: "var(--wk-colors-text)", - optionTextHover: "var(--wk-colors-text)", - optionBackground: "#14151a", - optionBackgroundHover: rgba("#F0B90B", 0.1), - walletOptionText: "var(--wk-colors-optionText)", - walletOptionTextHover: "var(--wk-colors-optionTextHover)", - walletOptionBackground: "var(--wk-colors-optionBackground)", - walletOptionBackgroundHover: "var(--wk-colors-optionBackgroundHover)", - chainOptionText: "var(--wk-colors-optionText)", - chainOptionTextHover: "var(--wk-colors-optionTextHover)", - chainOptionBackground: "var(--wk-colors-optionBackground)", - chainOptionBackgroundHover: "var(--wk-colors-optionBackgroundHover)", - toastBackground: "var(--wk-colors-modalBackground)", - qrCodeDot: "var(--wk-colors-text)", - qrCodeBorder: "var(--wk-colors-border)", - noWalletButtonText: "var(--wk-colors-text)", - noWalletButtonTextHover: "var(--wk-colors-text)", - noWalletButtonBackground: "transparent", - noWalletButtonBackgroundHover: "var(--wk-colors-border)", - noWalletButtonBorder: "var(--wk-colors-border)", - noWalletButtonBorderHover: "var(--wk-colors-border)", - disconnectButtonBackgroundText: "var(--wk-colors-text)", - disconnectButtonBackgroundTextHover: "var(--wk-colors-text)", - disconnectButtonBackground: "transparent", - disconnectButtonBackgroundHover: "var(--wk-colors-border)", - disconnectButtonBorder: "var(--wk-colors-border)", - disconnectButtonBorderHover: "var(--wk-colors-border)" - }, - shadows: { - normal: "0px 4px 20px 0px rgba(0, 0, 0, 0.04)", - toast: "0px 4px 24px rgba(0, 0, 0, 0.08)" - }, - radii, - zIndices - } -}; -function isObject(item) { - return item && typeof item === "object" && !Array.isArray(item) && item !== null; -} -function deepMerge(target, source) { - if (isObject(target) && isObject(source)) { - for (const key2 in source) { - if (isObject(source[key2])) { - if (!target[key2]) - Object.assign(target, { [key2]: {} }); - deepMerge(target[key2], source[key2]); - } else { - Object.assign(target, { [key2]: source[key2] }); - } - } - } - return target; -} -const ThemeContext = W$2.createContext({}); -function useTheme() { - return reactExports.useContext(ThemeContext); -} -const themeMap = { - base: base$2 -}; -function ThemeProvider(props) { - const { variant = "base", mode: mode2 = "auto", theme, children } = props; - const styleContent = reactExports.useMemo(() => { - const lightTheme = deepMerge(themeMap[variant].light ?? theme, (theme == null ? void 0 : theme.light) ?? theme); - const darkTheme = deepMerge(themeMap[variant].dark ?? theme, (theme == null ? void 0 : theme.dark) ?? theme); - const lightCssVars = createCssVars(lightTheme, "--wk-light"); - const darkCssVars = createCssVars(darkTheme, "--wk-dark"); - const lightPointer = createPointer(lightCssVars); - const darkPointer = createPointer(darkCssVars); - const lightCssVarsContent = createStyleContent(lightCssVars); - const darkCssVarsContent = createStyleContent(darkCssVars); - const lightPointerContent = createStyleContent(lightPointer); - const darkPointerContent = createStyleContent(darkPointer); - if (mode2 === "light") { - return `body { - ${lightPointerContent}; - ${lightCssVarsContent}; - }`; - } - if (mode2 === "dark") { - return `body { - ${darkPointerContent}; - ${darkCssVarsContent}; - }`; - } - if (mode2 === "auto") { - return `body { - ${lightCssVarsContent}; - ${darkCssVarsContent}; - #binanceW3W-wrapper .shadow-inner { - box-sizing: border-box; - } - @media (prefers-color-scheme: light) { - ${lightPointerContent}; - } - @media (prefers-color-scheme: dark) { - ${darkPointerContent}; - } - }`; - } - return ""; - }, [theme, mode2, variant]); - const [colorMode, setColorMode] = reactExports.useState("light"); - reactExports.useEffect(() => { - if (mode2 === "auto") { - const matchMedia = window.matchMedia("(prefers-color-scheme: dark)"); - const onChange = () => { - const cm = matchMedia.matches ? "dark" : "light"; - setColorMode(cm); - }; - onChange(); - matchMedia.addEventListener("change", onChange); - return () => { - matchMedia.removeEventListener("change", onChange); - }; - } else { - setColorMode(mode2); - } - }, [mode2]); - const value = reactExports.useMemo(() => { - return { - colorMode - }; - }, [colorMode]); - return /* @__PURE__ */ jsxRuntimeExports.jsxs(ThemeContext.Provider, { value, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("style", { children: styleContent }), - children - ] }); -} -function createCssVars(theme, prefix = "") { - const cssVars = {}; - const walk2 = (input, prefix2 = "") => { - Object.entries(input).forEach(([key2, value]) => { - const varName = `${prefix2}-${key2}`; - if (typeof value !== "object") { - cssVars[varName] = value; - } else { - walk2(value, varName); - } - }); - }; - walk2(theme, prefix); - return cssVars; -} -function createStyleContent(cssVars) { - return Object.entries(cssVars).map(([key2, value]) => { - return `${key2}: ${value}`; - }).join(";"); -} -function createPointer(cssVars) { - const pointers = {}; - Object.keys(cssVars).forEach((item) => { - const key2 = item.replace(/\-light|\-dark/g, ""); - const value = `var(${item})`; - pointers[key2] = value; - }); - return pointers; -} -const WalletKitContext = W$2.createContext({}); -function useWalletKit() { - return reactExports.useContext(WalletKitContext); -} -function EvmWalletProvider(props) { - const { children } = props; - const { evmConfig } = useWalletKit(); - if (!evmConfig) { - return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }); - } - return /* @__PURE__ */ jsxRuntimeExports.jsx(WagmiProvider, { config: evmConfig.wagmiConfig, reconnectOnMount: evmConfig.autoConnect, children }); -} -class CustomEventEmitter { - constructor() { - __publicField(this, "listenersMap"); - __publicField(this, "EVM_CONNECT_ERROR", "EVM_CONNECT_ERROR"); - __publicField(this, "EVM_CONNECT_SETTLE", "EVM_CONNECT_SETTLE"); - __publicField(this, "SOLANA_WALLET_ERROR", "SOLANA_WALLET_ERROR"); - __publicField(this, "TRON_WALLET_ERROR", "TRON_WALLET_ERROR"); - this.listenersMap = {}; - } - on(event, cb2) { - if (!this.listenersMap[event]) - this.listenersMap[event] = []; - this.listenersMap[event].push(cb2); - } - emit(event, ...params) { - const listener = this.listenersMap[event]; - if (listener) { - listener.forEach((cb2) => cb2(...params)); - } - } - off(event, cb2) { - const listeners3 = this.listenersMap[event]; - if (listeners3) { - const index2 = listeners3.findIndex((item) => item === cb2); - if (index2 > -1) { - listeners3.splice(index2); - } - } - } -} -const EventEmitter$1 = new CustomEventEmitter(); -function SolanaWalletProvider(props) { - const { children } = props; - const { solanaConfig } = useWalletKit(); - const onError = reactExports.useCallback((error) => { - EventEmitter$1.emit(EventEmitter$1.SOLANA_WALLET_ERROR, error); - }, []); - if (!solanaConfig) { - return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }); - } - return /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectionProvider, { endpoint: solanaConfig.rpcUrl, children: /* @__PURE__ */ jsxRuntimeExports.jsx( - WalletProvider$1, - { - wallets: solanaConfig.adapters, - onError, - autoConnect: solanaConfig.autoConnect, - children - } - ) }); -} -const ToastManager = { - listeners: [], - toastList: [], - autoIncreaseId: 0, - add(options) { - const toastId = this.autoIncreaseId++; - this.toastList.unshift({ - toastId, - ...options - }); - this.notify(); - return toastId; - }, - remove(toastId) { - const index2 = this.toastList.findIndex((item) => item.toastId === toastId); - if (index2 > -1) { - this.toastList.splice(index2, 1); - this.notify(); - } - }, - notify() { - this.listeners.forEach((fn2) => { - fn2([...this.toastList]); - }); - }, - subscribe(fn2) { - this.listeners.push(fn2); - }, - unsubscribe(fn2) { - const index2 = this.listeners.findIndex((item) => item === fn2); - if (index2 > -1) { - this.listeners.splice(index2, 1); - } - } -}; -const toast = (props) => { - const { variant = "info", duration = 3e3, ...restProps } = props; - return ToastManager.add({ - variant, - duration, - ...restProps - }); -}; -toast.info = (props) => { - return toast({ variant: "info", ...props }); -}; -toast.error = (props) => { - return toast({ variant: "error", ...props }); -}; -function getDefaultConfig(config2) { - const { options, evmConfig, solanaConfig, tronConfig } = config2; - return { - options: { - title: "Connect Wallet", - disclaimer: void 0, - gridLayoutThreshold: 6, - useGridLayoutOnMobile: true, - hideNoWalletCTA: false, - hideOfficialWalletConnectCTA: true, - walletDownloadUrl: `https://trustwallet.com/`, - closeModalAfterSwitchingNetwork: false, - closeModalAfterConnected: true, - closeModalOnEsc: true, - closeModalOnOverlayClick: true, - openModalOnWrongNetwork: false, - onError(_err, description2) { - if (description2) { - toast.error({ - description: description2 - }); - } - }, - ...options - }, - evmConfig, - solanaConfig, - tronConfig - }; -} -const RouteContext = W$2.createContext({}); -function useRouter() { - return reactExports.useContext(RouteContext); -} -var CONNECT_STATUS = /* @__PURE__ */ ((CONNECT_STATUS2) => { - CONNECT_STATUS2["CONNECTED"] = "connected"; - CONNECT_STATUS2["CONNECTING"] = "connecting"; - CONNECT_STATUS2["FAILED"] = "failed"; - CONNECT_STATUS2["REJECTED"] = "rejected"; - CONNECT_STATUS2["NOTCONNECTED"] = "notconnected"; - CONNECT_STATUS2["UNAVAILABLE"] = "unavailable"; - return CONNECT_STATUS2; -})(CONNECT_STATUS || {}); -var clsBox = "wk_t59jcv0"; -const Box = W$2.forwardRef((props, ref) => { - const { as: as2 = "div", className, ...restProps } = props; - return W$2.createElement(as2, { - ref, - className: cx(clsBox, className), - ...restProps - }); -}); -Box.displayName = "Box"; -var clsButton$1 = "wk_14j9dar0"; -const Button = W$2.forwardRef((props, ref) => { - const { className, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { ref, as: "button", className: cx("wk-button", clsButton$1, className), ...restProps }); -}); -Button.displayName = "Button"; -var clsModalBody = "wk_vno40y0"; -function ModalBody(props) { - const { className, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-modal-body", clsModalBody, className), ...restProps }); -} -var clsModalFooter = "wk_1rmpmq20"; -function ModalFooter(props) { - const { className, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-modal-footer", clsModalFooter, className), ...restProps }); -} -var clsModalHeader = "wk_qhb85j0"; -function ModalHeader(props) { - const { className, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-modal-header", clsModalHeader, className), ...restProps }); -} -function CircleLoadingIcon(props) { - const { thickness, endColor, ...restProps } = props; - const startStopColor = cssVar("modalBackground"); - const endStopColor = endColor ?? cssVar("primaryActive"); - return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "52", height: "102", viewBox: "0 0 52 102", fill: "none", ...restProps, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M1 101C28.6142 101 51 78.6142 51 51C51 23.3858 28.6142 1 1 1", - stroke: "url(#paint0_linear_1252_60553)", - strokeWidth: thickness, - strokeLinecap: "round" - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs( - "linearGradient", - { - id: "paint0_linear_1252_60553", - x1: "1", - y1: "1", - x2: "0.999999", - y2: "101", - gradientUnits: "userSpaceOnUse", - children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("stop", { stopColor: startStopColor }), - /* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "1", stopColor: endStopColor }) - ] - } - ) }) - ] }); -} -var clsContainer$3 = "wk_107z37f0"; -var clsErrorCircle = "wk_107z37f2"; -var clsLoading = "wk_107z37f4"; -var clsLogo = "wk_107z37f1"; -function ConnectSpinner(props) { - const { - className, - isLoading = false, - isError: isError2 = false, - thickness = 2, - loadingColor, - children, - ...restProps - } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: cx("wk-connect-spinner", clsContainer$3, className), ...restProps, children: [ - isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(CircleLoadingIcon, { className: clsLoading, thickness, endColor: loadingColor }), - isError2 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsErrorCircle }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsLogo, children }) - ] }); -} -var clsContent$2 = "wk_1nr7e5q0"; -function Content(props) { - const { className, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-content", clsContent$2, className), ...restProps }); -} -var clsDescription = "wk_1cxzn9q0"; -function Description(props) { - const { className, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-description", clsDescription, className), ...restProps }); -} -const AlertIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 15", fill: "none", ...props, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M1.63937 12.5331L7.6704 2.47023C8.04617 1.84325 8.95383 1.84326 9.3296 2.47023L15.3606 12.5331C15.7475 13.1787 15.283 14 14.531 14H2.46897C1.71695 14 1.25246 13.1787 1.63937 12.5331Z", - stroke: "currentColor", - strokeLinecap: "round", - strokeLinejoin: "round" - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M9.5 11.7231C9.5 12.2754 9.05228 12.7231 8.5 12.7231C7.94772 12.7231 7.5 12.2754 7.5 11.7231C7.5 11.1709 7.94772 10.7231 8.5 10.7231C9.05228 10.7231 9.5 11.1709 9.5 11.7231Z", - fill: "currentColor" - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M7.6684 5.65882C7.63842 5.15178 8.01942 4.72314 8.50008 4.72314C8.98075 4.72314 9.36174 5.15178 9.33176 5.65882L9.12831 9.09936C9.10757 9.44999 8.83247 9.72314 8.50008 9.72314C8.16769 9.72314 7.89259 9.44999 7.87186 9.09936L7.6684 5.65882Z", - fill: "currentColor" - } - ) - ] }); -}; -var clsErrorTitle = "wk_ebg9wh0"; -function ErrorTitle(props) { - const { className, children, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: cx("wk-error-title", clsErrorTitle, className), ...restProps, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(AlertIcon, {}), - children - ] }); -} -var clsInfoTitle = "wk_pb4clz0"; -function InfoTitle(props) { - const { className, children, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-info-title", clsInfoTitle, className), ...restProps, children }); -} -function useWalletDownloadUrl(urls) { - const { options } = useWalletKit(); - const url = reactExports.useMemo(() => { - const url2 = urls.default ?? options.walletDownloadUrl; - return url2; - }, [options.walletDownloadUrl, urls.default]); - return url; -} -function useWalletLogos(walletLogos) { - const { colorMode } = useTheme(); - const logos = reactExports.useMemo(() => { - const { default: defaultLogos, transparent: transparentLogos } = walletLogos ?? {}; - const defaultLogo = (defaultLogos == null ? void 0 : defaultLogos[colorMode]) ?? defaultLogos; - const transparentLogo = (transparentLogos == null ? void 0 : transparentLogos[colorMode]) ?? transparentLogos ?? defaultLogo; - return { - default: defaultLogo, - transparent: transparentLogo - }; - }, [colorMode, walletLogos]); - return logos; -} -var clsButton = "wk_qfvtl92"; -var clsContent$1 = "wk_qfvtl90"; -var clsFooter = "wk_qfvtl93"; -var clsGap = "wk_qfvtl91"; -const ConnectModalContext = W$2.createContext({}); -function useConnectModal() { - return reactExports.useContext(ConnectModalContext); -} -function useAutoCloseConnectModal(isConnected) { - const { options, selectedWallet } = useWalletKit(); - const router = useRouter(); - const { onClose } = useConnectModal(); - reactExports.useEffect(() => { - var _a3; - if (router.route !== ViewRoutes.HOME && isConnected) { - (_a3 = options.onConnected) == null ? void 0 : _a3.call(options, { - wallet: selectedWallet - }); - if (options.closeModalAfterConnected) { - onClose(); - } - } - }, [isConnected, router.route, options.closeModalAfterConnected]); -} -function TemplateConnectingView(props) { - const { status, runConnect, onTryAgain, wallet, isConnected } = props; - const { log: log2 } = useWalletKit(); - const logos = useWalletLogos(wallet.logos); - const downloadUrl = useWalletDownloadUrl(wallet.downloadUrls); - reactExports.useEffect(() => { - log2("[ConnectingView]", `name: ${wallet == null ? void 0 : wallet.name}, status: ${status}`); - if (status === CONNECT_STATUS.UNAVAILABLE) - return; - const connectTimeout = setTimeout(runConnect, 600); - return () => { - clearTimeout(connectTimeout); - }; - }, []); - const isError2 = [ - CONNECT_STATUS.FAILED, - CONNECT_STATUS.NOTCONNECTED, - CONNECT_STATUS.REJECTED - ].includes(status); - const isLoading = status === CONNECT_STATUS.CONNECTING; - useAutoCloseConnectModal(isConnected); - return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(ModalHeader, { children: wallet == null ? void 0 : wallet.name }), - /* @__PURE__ */ jsxRuntimeExports.jsxs(ModalBody, { className: clsContent$1, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectSpinner, { isLoading, isError: isError2, loadingColor: wallet.spinnerColor, children: logos.transparent }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsGap }), - status === CONNECT_STATUS.FAILED && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorTitle, { children: "Connection Failed" }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Description, { children: "Sorry, something went wrong. Please try connecting again." }) - ] }), - status === CONNECT_STATUS.REJECTED && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(InfoTitle, { children: "Request Cancelled" }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Description, { children: "You cancelled the request. Click above to try again." }) - ] }), - status === CONNECT_STATUS.CONNECTING && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(InfoTitle, { children: "Requesting Connection" }), - /* @__PURE__ */ jsxRuntimeExports.jsxs(Description, { children: [ - "Open the ", - wallet.name, - " ", - isMobile() ? "app" : "browser extension", - " to connect your wallet." - ] }) - ] }), - status === CONNECT_STATUS.CONNECTED && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(InfoTitle, { children: "Already Connected" }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Description, { children: "It is now okay to close this popup" }) - ] }), - status === CONNECT_STATUS.NOTCONNECTED && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs(ErrorTitle, { children: [ - "Login to ", - wallet.name - ] }), - /* @__PURE__ */ jsxRuntimeExports.jsxs(Description, { children: [ - "To continue, please login to your ", - wallet.name, - " extension." - ] }) - ] }), - status === CONNECT_STATUS.UNAVAILABLE && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs(InfoTitle, { children: [ - "Install ", - wallet.name - ] }), - /* @__PURE__ */ jsxRuntimeExports.jsxs(Description, { children: [ - "To connect your ", - wallet.name, - ", install the browser extension." - ] }) - ] }) - ] }), - (status === CONNECT_STATUS.FAILED || status === CONNECT_STATUS.REJECTED) && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { className: clsFooter, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { className: cx("wk-retry-button", clsButton), onClick: onTryAgain, children: "Try Again" }) }), - status === CONNECT_STATUS.UNAVAILABLE && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { className: clsFooter, children: /* @__PURE__ */ jsxRuntimeExports.jsx( - Button, - { - className: cx("wk-download-button", clsButton), - as: "a", - href: downloadUrl, - target: "_blank", - rel: "noopener", - children: "Install the Extension" - } - ) }) - ] }); -} -function useIsConnected() { - const { address: address2 } = useAccount(); - return !!address2; -} -function useWalletConnector(id2) { - const connectors = useConnectors(); - return connectors.find((item) => item.id === id2); -} -function evmCommonErrorHandler(props) { - var _a3; - const { log: log2, handler, error } = props; - let text = ""; - if (error) { - if (error.code) { - switch (error.code) { - case 4902: - if (isIOS() && trustWallet().isInstalled()) { - text = "Not supported chainId"; - } - break; - } - } - let description2 = text || ((_a3 = error.cause) == null ? void 0 : _a3.message) || error.message; - if (description2 == null ? void 0 : description2.includes("Connection request reset")) { - description2 = void 0; - } - if (description2 == null ? void 0 : description2.includes("[binance-w3w] User closed modal")) { - description2 = "Use rejected the request"; - } - if (isMobile() && binanceWeb3Wallet().isInstalled()) { - if ((description2 == null ? void 0 : description2.includes("Request failed: The JSON sent is not a valid Request object.")) || (description2 == null ? void 0 : description2.includes("Adaptor not found: eip155"))) { - description2 = "Please update to the latest version of the Binance app and try again later."; - } - } - log2("[WalletError]", error); - handler == null ? void 0 : handler(error, description2); - } -} -let timer; -function useEvmConnect(props) { - const { log: log2, options, evmConfig } = useWalletKit(); - const connectProps = { - chainId: evmConfig == null ? void 0 : evmConfig.initialChainId - }; - const { connect: connect2, connectAsync, connectors, ...restProps } = useConnect({ - ...props, - mutation: { - ...props == null ? void 0 : props.mutation, - onSettled(data, error, ...params) { - clearTimeout(timer); - timer = setTimeout(() => { - var _a3, _b2; - EventEmitter$1.emit(EventEmitter$1.EVM_CONNECT_SETTLE, data, error, ...params); - (_b2 = (_a3 = props == null ? void 0 : props.mutation) == null ? void 0 : _a3.onSettled) == null ? void 0 : _b2.call(_a3, data, error, ...params); - if (error) { - evmCommonErrorHandler({ - log: log2, - handler: options.onError, - error - }); - } - }, 100); - } - } - }); - return { - connect: ({ ...opts }) => { - return connect2({ - ...connectProps, - ...opts - }); - }, - connectAsync: async ({ ...opts }) => { - return await connectAsync({ - ...connectProps, - ...opts - }); - }, - connectors, - ...restProps - }; -} -function useConnectingStatus(props = {}) { - const { initialStatus } = props; - const { selectedWallet, evmConfig, options, action } = useWalletKit(); - const defaultStatus = selectedWallet.isInstalled() ? CONNECT_STATUS.CONNECTING : CONNECT_STATUS.UNAVAILABLE; - const [status, setStatus] = reactExports.useState(initialStatus ?? defaultStatus); - const { connect: connect2 } = useEvmConnect(); - reactExports.useEffect(() => { - const onSettled = (data, error) => { - var _a3; - if (error) { - if (error.code) { - switch (error.code) { - case -32002: - setStatus(CONNECT_STATUS.NOTCONNECTED); - break; - case 4001: - setStatus(CONNECT_STATUS.REJECTED); - break; - default: - setStatus(CONNECT_STATUS.FAILED); - break; - } - } else { - if (error.message) { - switch (error.message) { - case "User rejected request": - setStatus(CONNECT_STATUS.REJECTED); - break; - default: - setStatus(CONNECT_STATUS.FAILED); - break; - } - } - } - } else if (data) { - if ((evmConfig == null ? void 0 : evmConfig.initialChainId) && data.chainId === evmConfig.initialChainId && action === "add-network") { - (_a3 = options.onChainAlreadyAdded) == null ? void 0 : _a3.call(options, { - wallet: selectedWallet, - chainId: data.chainId - }); - } - } - }; - EventEmitter$1.on(EventEmitter$1.EVM_CONNECT_SETTLE, onSettled); - return () => { - EventEmitter$1.off(EventEmitter$1.EVM_CONNECT_SETTLE, onSettled); - }; - }, [action, evmConfig == null ? void 0 : evmConfig.initialChainId, options, selectedWallet]); - return { - status, - connect: connect2, - setStatus - }; -} -function EvmConnectingView() { - const { selectedWallet } = useWalletKit(); - const isConnected = useIsConnected(); - const selectedConnector = useWalletConnector(selectedWallet.id); - const { connect: connect2, status, setStatus } = useConnectingStatus(); - const runConnect = reactExports.useCallback(() => { - if (!selectedWallet.isInstalled()) - return; - if (selectedConnector) { - setStatus(CONNECT_STATUS.CONNECTING); - connect2({ connector: selectedConnector }); - } else { - setStatus(CONNECT_STATUS.UNAVAILABLE); - } - }, [connect2, selectedConnector, selectedWallet, setStatus]); - return /* @__PURE__ */ jsxRuntimeExports.jsx( - TemplateConnectingView, - { - status, - runConnect, - onTryAgain: runConnect, - wallet: selectedWallet, - isConnected - } - ); -} -var clsLink = "wk_1a9rgw50"; -const Link = (props) => { - const { className, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx( - Box, - { - as: "a", - className: cx("wk-link", clsLink, className), - target: "_blank", - rel: "noopener", - ...restProps - } - ); -}; -Link.displayName = "Link"; -const ForwardIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "21", height: "20", viewBox: "0 0 21 20", fill: "currentColor", ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M9.49408 3.57709C9.81951 3.25165 10.3472 3.25165 10.6726 3.57709L16.5059 9.41042C16.8314 9.73586 16.8314 10.2635 16.5059 10.5889L10.6726 16.4223C10.3472 16.7477 9.81951 16.7477 9.49408 16.4223C9.16864 16.0968 9.16864 15.5692 9.49408 15.2438L13.9048 10.833H5.08333C4.6231 10.833 4.25 10.4599 4.25 9.99967C4.25 9.53944 4.6231 9.16634 5.08333 9.16634H13.9048L9.49408 4.7556C9.16864 4.43016 9.16864 3.90252 9.49408 3.57709Z" - } - ) }); -}; -var clsFadeIn = "wk_y1x8do2"; -var clsFadeOut = "wk_y1x8do3"; -var clsToastSlideIn = "wk_1jpwxhg2"; -var clsToastSlideOut = "wk_1jpwxhg3"; -var clsModalSlideIn = "wk_3li8yi2"; -var clsModalSlideOut = "wk_3li8yi3"; -const animationMap = { - fade: [clsFadeOut, clsFadeIn], - "toast-slide": [clsToastSlideOut, clsToastSlideIn], - "modal-slide": [clsModalSlideOut, clsModalSlideIn] -}; -const Transition = (props) => { - const { in: show, children, variant = "fade", onExit } = props; - const { className, onAnimationEnd, ...restProps } = children.props; - const [isMounted, setIsMounted] = reactExports.useState(show); - reactExports.useEffect(() => { - if (show) { - setIsMounted(true); - } - }, [show]); - const onPlayEnd = (e18) => { - onAnimationEnd == null ? void 0 : onAnimationEnd(e18); - if (!show) { - onExit == null ? void 0 : onExit(); - setIsMounted(false); - } - }; - if (!isMounted) { - return null; - } - return W$2.cloneElement(children, { - className: cx(animationMap[variant][Number(show)], className), - onAnimationEnd: onPlayEnd, - ...restProps - }); -}; -function generateMatrix(value, errorCorrectionLevel2) { - const arr = Array.prototype.slice.call( - browser$2.create(value, { errorCorrectionLevel: errorCorrectionLevel2 }).modules.data, - 0 - ); - const sqrt = Math.sqrt(arr.length); - return arr.reduce( - (rows, key2, index2) => (index2 % sqrt === 0 ? rows.push([key2]) : rows[rows.length - 1].push(key2)) && rows, - [] - ); -} -function QRCode(props) { - const { className, ecl = "M", clearSize = 40, size: size2 = 212, uri } = props; - const dots = reactExports.useMemo(() => { - const dots2 = []; - const matrix = generateMatrix(uri, ecl); - const cellSize = size2 / matrix.length; - const qrList = [ - { x: 0, y: 0 }, - { x: 1, y: 0 }, - { x: 0, y: 1 } - ]; - qrList.forEach(({ x: x3, y: y3 }) => { - const x1 = (matrix.length - 7) * cellSize * x3; - const y1 = (matrix.length - 7) * cellSize * y3; - for (let i3 = 0; i3 < 3; i3++) { - const width = cellSize * (7 - i3 * 2); - const r2 = [8, 4, 0][i3]; - dots2.push( - /* @__PURE__ */ jsxRuntimeExports.jsx( - "rect", - { - fill: i3 % 2 === 0 ? "var(--wk-colors-qrCodeDot)" : "var(--wk-colors-modalBackground)", - height: width, - width, - rx: r2, - ry: r2, - x: x1 + cellSize * i3, - y: y1 + cellSize * i3 - }, - `${i3}-${x3}-${y3}` - ) - ); - } - }); - const clearArenaSize = Math.ceil(clearSize / cellSize) + 4; - const matrixMiddleStart = matrix.length / 2 - clearArenaSize / 2; - const matrixMiddleEnd = matrix.length / 2 + clearArenaSize / 2 - 1; - matrix.forEach((row, i3) => { - row.forEach((_3, j2) => { - if (matrix[i3][j2]) { - if (!(i3 < 7 && j2 < 7 || i3 > matrix.length - 8 && j2 < 7 || i3 < 7 && j2 > matrix.length - 8)) { - if (!(i3 > matrixMiddleStart && i3 < matrixMiddleEnd && j2 > matrixMiddleStart && j2 < matrixMiddleEnd)) { - dots2.push( - /* @__PURE__ */ jsxRuntimeExports.jsx( - "circle", - { - cx: i3 * cellSize + cellSize / 2, - cy: j2 * cellSize + cellSize / 2, - fill: "var(--wk-colors-qrCodeDot)", - r: cellSize / 3 - }, - `circle-${i3}-${j2}` - ) - ); - } - } - } - }); - }); - return dots2; - }, [ecl, clearSize, size2, uri]); - return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, height: "100%", width: "100%", viewBox: `0 0 ${size2} ${size2}`, children: dots }); -} -var clsContainer$2 = "wk_92eoeu1"; -var clsCorner = "wk_92eoeu2"; -function QRCodePlaceHolder() { - return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: clsContainer$2, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { as: "span", className: clsCorner }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { as: "span", className: clsCorner }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { as: "span", className: clsCorner }) - ] }); -} -var clsQrCodeContainer = "wk_10yx5n50"; -var clsQrCodeLogo = "wk_10yx5n52"; -var clsQrCodeWrapper = "wk_10yx5n51"; -function CustomQRCode(props) { - const { className, logo, logoSize = 44, value, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-qrcode", clsQrCodeContainer, className), ...restProps, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: clsQrCodeWrapper, children: [ - value ? /* @__PURE__ */ jsxRuntimeExports.jsx(Transition, { in: !!value, children: /* @__PURE__ */ jsxRuntimeExports.jsx(QRCode, { uri: value }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(QRCodePlaceHolder, {}), - /* @__PURE__ */ jsxRuntimeExports.jsx( - Box, - { - className: cx("wk-qrcode-logo", clsQrCodeLogo), - style: { - width: logoSize, - height: logoSize, - opacity: value ? 1 : 0.3 - }, - children: logo - } - ) - ] }) }); -} -var clsContainer$1 = "wk_1j0944g0"; -var clsOfficialButton = "wk_1j0944g1"; -function TemplateQRCodeView(props) { - const { wallet, qrCodeUri, onClickOpenWcModal, isConnected, isWalletConnect: isWalletConnect2 } = props; - const { options } = useWalletKit(); - const logos = useWalletLogos(wallet == null ? void 0 : wallet.logos); - useAutoCloseConnectModal(isConnected); - return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(ModalHeader, { children: "Scan with your phone" }), - /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: cx("wk-scan-qrcode", clsContainer$1), children: /* @__PURE__ */ jsxRuntimeExports.jsx(CustomQRCode, { value: qrCodeUri, logo: logos.default }) }), - isWalletConnect2 && !(options == null ? void 0 : options.hideOfficialWalletConnectCTA) && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs( - Link, - { - className: cx("wk-official-wc-button", clsOfficialButton), - onClick: onClickOpenWcModal, - children: [ - "Open the official WalletConnect modal", - /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardIcon, {}) - ] - } - ) }) - ] }); -} -function useWalletConnectConnector() { - const connectors = useConnectors(); - return connectors.find((item) => isWalletConnect(item.id)); -} -function useWalletConnectUri(props = {}) { - const { enabled = true, refreshUriOnError = true } = props; - const { connectAsync } = useEvmConnect(); - const { log: log2 } = useWalletKit(); - const connector = useWalletConnectConnector(); - const isConnected = useIsConnected(); - const [wcUri, setWcUri] = reactExports.useState(); - reactExports.useEffect(() => { - if (isConnected || !connector || !enabled) - return; - const onUpdateWcUri = ({ type: type2, data }) => { - if (type2 === "display_uri") { - setWcUri(data); - } - }; - const connectWallet = async () => { - try { - log2("[WcUri]", "connecting"); - const provider = await (connector == null ? void 0 : connector.getProvider()); - provider.rpc.showQrModal = false; - await connectAsync({ connector }); - } catch (error) { - if ((error == null ? void 0 : error.code) === 4001 && refreshUriOnError) { - connectWallet(); - } - } - }; - connectWallet(); - connector.emitter.on("message", onUpdateWcUri); - return () => { - connector == null ? void 0 : connector.emitter.off("message", onUpdateWcUri); - }; - }, [isConnected, enabled, refreshUriOnError]); - return { - wcUri - }; -} -function useWalletConnectModal() { - const { connectAsync } = useEvmConnect(); - const connectModal = useConnectModal(); - const { log: log2 } = useWalletKit(); - const [isOpen, setIsOpen] = reactExports.useState(false); - reactExports.useEffect(() => { - if (isOpen) { - const timer2 = setTimeout(() => { - connectModal.onClose(); - }, 800); - return () => { - clearTimeout(timer2); - }; - } - }, [connectModal, isOpen]); - const connector = useWalletConnectConnector(); - return { - isOpen, - onOpen: async () => { - document.body.style.setProperty("--wcm-z-index", "2147483647"); - const provider = await (connector == null ? void 0 : connector.getProvider()); - provider.rpc.showQrModal = true; - if (connector) { - setIsOpen(true); - try { - await connectAsync({ connector }); - } catch (err) { - log2("[OpenWcModal]", err); - } - setIsOpen(false); - } - } - }; -} -function EvmQRCodeView() { - var _a3; - const { selectedWallet } = useWalletKit(); - const { wcUri } = useWalletConnectUri(); - const wcModal = useWalletConnectModal(); - const qrCodeUri = wcUri && (((_a3 = selectedWallet.getUri) == null ? void 0 : _a3.call(selectedWallet, wcUri)) ?? wcUri); - const isConnected = useIsConnected(); - return /* @__PURE__ */ jsxRuntimeExports.jsx( - TemplateQRCodeView, - { - wallet: selectedWallet, - qrCodeUri, - onClickOpenWcModal: wcModal.onOpen, - isConnected, - isWalletConnect: isWalletConnect(selectedWallet.id) - } - ); -} -function EvmUriConnectingView() { - const { selectedWallet } = useWalletKit(); - const isConnected = useIsConnected(); - const { status, setStatus } = useConnectingStatus({ - initialStatus: CONNECT_STATUS.CONNECTING - }); - const { wcUri } = useWalletConnectUri({ - enabled: status !== CONNECT_STATUS.CONNECTING, - refreshUriOnError: false - }); - const onTryAgain = () => { - setStatus(CONNECT_STATUS.CONNECTING); - const walletUri = selectedWallet.getUri(wcUri); - openLink$1(walletUri); - }; - return /* @__PURE__ */ jsxRuntimeExports.jsx( - TemplateConnectingView, - { - isConnected, - status, - runConnect: () => void 0, - onTryAgain, - wallet: selectedWallet - } - ); -} -function useSolanaConnect() { - const { solanaConfig } = useWalletKit(); - const { select: select2, wallets: adapters2, connected } = useWallet$1(); - const connect2 = reactExports.useCallback( - async ({ adapterName }) => { - var _a3; - select2(adapterName); - if (!(solanaConfig == null ? void 0 : solanaConfig.autoConnect)) { - const adapter = (_a3 = adapters2.find((item) => item.adapter.name === adapterName)) == null ? void 0 : _a3.adapter; - if (adapter) { - await adapter.connect(); - } - } - }, - [adapters2, select2, solanaConfig == null ? void 0 : solanaConfig.autoConnect] - ); - return { - connect: connect2, - isConnected: connected - }; -} -function solanaCommonErrorHandler(props) { - const { log: log2, handler, error } = props; - if (error) { - const description2 = error.message || error.name; - log2("[WalletError]", error); - handler == null ? void 0 : handler(error, description2); - } -} -function SolanaConnectingView() { - const { log: log2, selectedWallet, options } = useWalletKit(); - const [status, setStatus] = reactExports.useState( - selectedWallet.isInstalled() ? CONNECT_STATUS.CONNECTING : CONNECT_STATUS.UNAVAILABLE - ); - const { isConnected, connect: connect2 } = useSolanaConnect(); - reactExports.useEffect(() => { - const onError = (error) => { - let message2 = ""; - if (error.message.includes("Error Calling Method: requestAccounts") || error.message.includes("rejected")) { - message2 = "User rejected the request"; - setStatus(CONNECT_STATUS.REJECTED); - } else { - setStatus(CONNECT_STATUS.FAILED); - } - solanaCommonErrorHandler({ - log: log2, - handler: options.onError, - error: { - message: message2 - } - }); - }; - EventEmitter$1.on(EventEmitter$1.SOLANA_WALLET_ERROR, onError); - return () => { - EventEmitter$1.off(EventEmitter$1.SOLANA_WALLET_ERROR, onError); - }; - }, [options.onError, log2]); - const runConnect = reactExports.useCallback(async () => { - if (!selectedWallet.isInstalled()) - return; - setStatus(CONNECT_STATUS.CONNECTING); - connect2({ - adapterName: selectedWallet.adapterName - }); - }, [connect2, selectedWallet]); - return /* @__PURE__ */ jsxRuntimeExports.jsx( - TemplateConnectingView, - { - status, - runConnect, - onTryAgain: runConnect, - wallet: selectedWallet, - isConnected - } - ); -} -function SolanaQRCodeView() { - return null; -} -const MOBILE_MEDIA = "screen and (max-width: 767px)"; -function useMediaQuery(query) { - const [isMatched, setIsMatched] = reactExports.useState(false); - reactExports.useEffect(() => { - const onChange = () => { - const isMatched2 = window.matchMedia(query).matches; - setIsMatched(isMatched2); - }; - onChange(); - const matchMedia = window.matchMedia(query); - matchMedia.addEventListener("change", onChange); - return () => { - matchMedia.removeEventListener("change", onChange); - }; - }, [query]); - return isMatched; -} -const useResponsive = () => { - const isMobileLayout = useMediaQuery(MOBILE_MEDIA); - return { - isMobileLayout - }; -}; -const WalletIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: 24, height: 24, viewBox: "0 0 40 40", fill: "currentColor", ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M4.16669 12.5C4.16669 9.73858 6.40526 7.5 9.16669 7.5H30.8334C33.5948 7.5 35.8334 9.73858 35.8334 12.5V27.5C35.8334 30.2614 33.5948 32.5 30.8334 32.5H9.16669C6.40526 32.5 4.16669 30.2614 4.16669 27.5V12.5ZM9.16669 10.8333C8.24621 10.8333 7.50002 11.5795 7.50002 12.5V27.5C7.50002 28.4205 8.24621 29.1667 9.16669 29.1667H30.8334C31.7538 29.1667 32.5 28.4205 32.5 27.5V26.4583H24.1667C20.5998 26.4583 17.7084 23.5668 17.7084 20C17.7084 16.4332 20.5998 13.5417 24.1667 13.5417H32.5V12.5C32.5 11.5795 31.7538 10.8333 30.8334 10.8333H9.16669ZM32.5 16.4583H24.1667C22.2107 16.4583 20.625 18.044 20.625 20C20.625 21.956 22.2107 23.5417 24.1667 23.5417H32.5V16.4583ZM26.6667 20C26.6667 21.1506 25.7339 22.0833 24.5834 22.0833C23.4328 22.0833 22.5 21.1506 22.5 20C22.5 18.8494 23.4328 17.9167 24.5834 17.9167C25.7339 17.9167 26.6667 18.8494 26.6667 20Z" - } - ) }); -}; -var clsWalletOption$1 = "wk_1dbgl2y1"; -var clsWalletOptionDisabled$1 = "wk_1dbgl2y4"; -var clsWalletOptionIcon$1 = "wk_1dbgl2y3"; -var clsWalletOptionName$1 = "wk_1dbgl2y2"; -var clsWalletOptionWrapper = "wk_1dbgl2y0"; -const Text = (props) => { - const { ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { as: "p", ...restProps }); -}; -Text.displayName = "Text"; -function useWalletRender(props) { - const { wallet, layout, clickRef, defaultRender } = props; - const { colorMode } = useTheme(); - const logos = useWalletLogos(wallet.logos); - const renderOptions = { - layout, - colorMode, - wallet: { - id: wallet.id, - walletType: wallet.walletType, - name: wallet.name, - logo: layout === "grid" ? logos.default : logos.transparent, - isDisabled: wallet.isDisabled, - isVisible: wallet.isVisible - }, - onClick(e18) { - var _a3; - (_a3 = clickRef.current) == null ? void 0 : _a3.call(clickRef, wallet.id, e18); - } - }; - const render2 = wallet.render ?? defaultRender; - return render2 == null ? void 0 : render2(renderOptions); -} -function SetEvmWalletClickRef(props) { - const { clickRef } = props; - const { log: log2, options, evmConfig, setSelectedWallet } = useWalletKit(); - const { disconnect: disconnect2 } = useDisconnect(); - const wcModal = useWalletConnectModal(); - const connectModal = useConnectModal(); - const router = useRouter(); - const { connect: connect2 } = useEvmConnect(); - const connectors = useConnectors(); - const timerRef = reactExports.useRef(); - clickRef.current = (walletId, e18) => { - var _a3; - const wallet = evmConfig.wallets.find((item) => item.id === walletId); - const connector = connectors.find((item) => item.id === walletId); - const pass = (_a3 = options.onClickWallet) == null ? void 0 : _a3.call(options, wallet, e18); - if (pass === false) - return; - log2("[ClickWallet]", `ethereum:`, typeof window.ethereum); - log2("[ClickWallet]", `installed:`, wallet.isInstalled()); - const jumpTo = (viewRoute) => { - setSelectedWallet(wallet); - if (connectModal.isOpen) { - router.push(viewRoute); - } else { - connectModal.onOpen({ - viewRoute - }); - } - }; - const jumpToQRCodeView = () => { - var _a4; - const qrCodeUri = wallet.getUri("xxx"); - if (qrCodeUri) { - jumpTo(ViewRoutes.EVM_QRCODE); - } else { - (_a4 = options.onError) == null ? void 0 : _a4.call( - options, - new Error(`The wallet does not support QR code`), - `The wallet does not support QR code` - ); - } - }; - const jumpToConnectingView = () => { - jumpTo(ViewRoutes.EVM_CONNECTING); - }; - const jumpToDeepLink = () => { - var _a4; - const deepLink = wallet.getDeepLink(); - if (deepLink) { - openLink$1(deepLink); - } else { - (_a4 = options.onError) == null ? void 0 : _a4.call( - options, - new Error(`The wallet does not support deeplink`), - `The wallet does not support deeplink` - ); - } - }; - const jumpToUriConnectingView = () => { - var _a4; - const wcUri = getEvmGlobalData().homeViewWalletConnectUri; - if (wcUri) { - const connectUri = wallet.getUri(wcUri); - if (connectUri) { - openLink$1(connectUri); - jumpTo(ViewRoutes.EVM_URI_CONNECTING); - } else { - (_a4 = options.onError) == null ? void 0 : _a4.call( - options, - new Error(`The wallet does not support URI connection`), - `The wallet does not support URI connection` - ); - } - } - }; - disconnect2(); - clearTimeout(timerRef.current); - const isBinanceWeb3Wallet = binanceWeb3Wallet().id === walletId; - const delay2 = isBinanceWeb3Wallet ? 0 : 300; - timerRef.current = setTimeout(() => { - if (isBinanceWeb3Wallet) { - connect2({ - connector - }); - setTimeout(() => { - connectModal.onClose(); - }, 500); - return; - } - if (isTMA()) { - if (isMobile()) { - if (isWalletConnect(walletId)) { - wcModal.onOpen(); - } else { - jumpToUriConnectingView(); - } - } else { - jumpToQRCodeView(); - } - } else if (isMobile()) { - if (wallet.isInstalled()) { - if (isWalletConnect(walletId)) { - wcModal.onOpen(); - } else { - jumpToConnectingView(); - } - } else { - jumpToDeepLink(); - } - } else { - if (wallet.showQRCode) { - jumpToQRCodeView(); - } else { - if (isWalletConnect(walletId)) { - wcModal.onOpen(); - } else { - jumpToConnectingView(); - } - } - } - }, delay2); - }; - return null; -} -function SetSolanaWalletClickRef(props) { - const { clickRef } = props; - const { log: log2, options, setSelectedWallet, solanaConfig } = useWalletKit(); - const { disconnect: disconnect2 } = useWallet$1(); - const { connect: connect2 } = useSolanaConnect(); - const connectModal = useConnectModal(); - const router = useRouter(); - const timerRef = reactExports.useRef(); - clickRef.current = (walletId, e18) => { - var _a3; - const wallet = solanaConfig.wallets.find((item) => item.id === walletId); - const pass = (_a3 = options.onClickWallet) == null ? void 0 : _a3.call(options, wallet, e18); - if (pass === false) - return; - log2("[ClickWallet]", `wallet:`, wallet); - log2("[ClickWallet]", `installed:`, wallet.isInstalled()); - const jumpTo = (viewRoute) => { - setSelectedWallet(wallet); - if (connectModal.isOpen) { - router.push(viewRoute); - } else { - connectModal.onOpen({ - viewRoute - }); - } - }; - const jumpToConnectingView = () => { - jumpTo(ViewRoutes.SOLANA_CONNECTING); - }; - disconnect2(); - clearTimeout(timerRef.current); - timerRef.current = setTimeout(() => { - if (isMobile()) { - const deeplink = wallet.getDeepLink(); - if (wallet.isInstalled()) { - jumpToConnectingView(); - } else if (deeplink) { - openLink$1(deeplink); - } else { - connect2({ - adapterName: wallet.adapterName - }); - } - } else { - jumpToConnectingView(); - } - }, 300); - }; - return null; -} -function useTronConnect() { - const { select: select2, wallets: adapters2, connected } = useWallet(); - const [isConnected, setIsConnected] = reactExports.useState(connected); - const connect2 = reactExports.useCallback( - async ({ adapterName, chainId }) => { - var _a3; - select2(adapterName); - const finalChainId = typeof chainId === "number" ? `0x${chainId.toString(16)}` : chainId; - const adapter = (_a3 = adapters2.find((item) => item.adapter.name === adapterName)) == null ? void 0 : _a3.adapter; - if (adapter) { - await adapter.connect(); - setIsConnected(true); - if (finalChainId && !isMobile()) { - await (adapter == null ? void 0 : adapter.switchChain(finalChainId)); - } - } - }, - [adapters2, select2] - ); - return { - connect: connect2, - isConnected - }; -} -function SetTronWalletClickRef(props) { - const { clickRef } = props; - const { log: log2, options, setSelectedWallet, tronConfig } = useWalletKit(); - const { disconnect: disconnect2 } = useWallet(); - const { connect: connect2 } = useTronConnect(); - const connectModal = useConnectModal(); - const router = useRouter(); - const timerRef = reactExports.useRef(); - clickRef.current = (walletId, e18) => { - var _a3; - const wallet = tronConfig.wallets.find((item) => item.id === walletId); - const pass = (_a3 = options.onClickWallet) == null ? void 0 : _a3.call(options, wallet, e18); - if (pass === false) - return; - log2("[ClickWallet]", `wallet:`, wallet); - log2("[ClickWallet]", `installed:`, wallet.isInstalled()); - const jumpTo = (viewRoute) => { - setSelectedWallet(wallet); - if (connectModal.isOpen) { - router.push(viewRoute); - } else { - connectModal.onOpen({ - viewRoute - }); - } - }; - const jumpToConnectingView = () => { - jumpTo(ViewRoutes.TRON_CONNECTING); - }; - disconnect2(); - clearTimeout(timerRef.current); - timerRef.current = setTimeout(() => { - if (isMobile()) { - if (wallet.isInstalled()) { - jumpToConnectingView(); - } else { - connect2({ - adapterName: wallet.adapterName - }); - } - } else { - jumpToConnectingView(); - } - }, 300); - }; - return null; -} -function SetWalletClickRef(props) { - const { wallet, clickRef } = props; - if (wallet.walletType === "evm") { - return /* @__PURE__ */ jsxRuntimeExports.jsx(SetEvmWalletClickRef, { clickRef }); - } - if (wallet.walletType === "solana") { - return /* @__PURE__ */ jsxRuntimeExports.jsx(SetSolanaWalletClickRef, { clickRef }); - } - if (wallet.walletType === "tron") { - return /* @__PURE__ */ jsxRuntimeExports.jsx(SetTronWalletClickRef, { clickRef }); - } -} -function WalletOption$1(props) { - const { wallet } = props; - const clickRef = reactExports.useRef(); - const component = useWalletRender({ - wallet, - layout: "grid", - clickRef, - defaultRender: ({ wallet: wallet2, onClick }) => { - const { isDisabled, name: name2, logo } = wallet2; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-wallet-option-wrapper", clsWalletOptionWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsxs( - Button, - { - className: cx( - "wk-wallet-option", - clsWalletOption$1, - isDisabled ? clsWalletOptionDisabled$1 : void 0 - ), - onClick: isDisabled ? void 0 : onClick, - children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-wallet-option-logo", clsWalletOptionIcon$1), children: logo }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: cx("wk-wallet-option-name", clsWalletOptionName$1), children: name2 }) - ] - } - ) }); - } - }); - return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(SetWalletClickRef, { wallet, clickRef }), - component - ] }); -} -var clsNoWalletButton = "wk_cvot8n1"; -var clsWallets$1 = "wk_cvot8n0"; -function GridLayout(props) { - const { visibleWallets } = props; - const { options } = useWalletKit(); - return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: cx("wk-wallets", clsWallets$1), "data-layout": "grid", children: visibleWallets == null ? void 0 : visibleWallets.map((w2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(WalletOption$1, { wallet: w2 }, index2)) }), - !options.hideNoWalletCTA && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs( - Button, - { - as: "a", - className: cx("wk-nowallet-button", clsNoWalletButton), - href: options.walletDownloadUrl, - target: "_blank", - rel: "noopener", - children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(WalletIcon, {}), - "I don’t have a wallet" - ] - } - ) }) - ] }); -} -var clsNoWalletLink = "wk_1lg2shr1"; -var clsWallets = "wk_1lg2shr0"; -var clsWalletOption = "wk_713zwr0"; -var clsWalletOptionDisabled = "wk_713zwr3"; -var clsWalletOptionIcon = "wk_713zwr2"; -var clsWalletOptionName = "wk_713zwr1"; -function WalletOption(props) { - const { wallet } = props; - const clickRef = reactExports.useRef(); - const component = useWalletRender({ - wallet, - layout: "list", - clickRef, - defaultRender: ({ wallet: wallet2, onClick }) => { - const { isDisabled, name: name2, logo } = wallet2; - return /* @__PURE__ */ jsxRuntimeExports.jsxs( - Button, - { - className: cx( - "wk-wallet-option", - clsWalletOption, - isDisabled ? clsWalletOptionDisabled : void 0 - ), - onClick: isDisabled ? void 0 : onClick, - children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: cx("wk-wallet-option-name", clsWalletOptionName), children: name2 }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-wallet-option-logo", clsWalletOptionIcon), children: logo }) - ] - } - ); - } - }); - return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(SetWalletClickRef, { wallet, clickRef }), - component - ] }); -} -function ListLayout(props) { - const { visibleWallets } = props; - const { options } = useWalletKit(); - return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: cx("wk-wallets", clsWallets), "data-layout": "list", children: visibleWallets == null ? void 0 : visibleWallets.map((w2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(WalletOption, { wallet: w2 }, index2)) }), - !options.hideNoWalletCTA && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs( - Link, - { - className: cx("wk-nowallet-link", clsNoWalletLink), - href: options.walletDownloadUrl, - children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(WalletIcon, {}), - "I don’t have a wallet" - ] - } - ) }) - ] }); -} -var clsDisclaimer = "wk_zqrn660"; -function EvmHomeViewWalletConnectUriProvider() { - const { wcUri } = useWalletConnectUri({ - refreshUriOnError: false - }); - setEvmGlobalData({ - homeViewWalletConnectUri: wcUri - }); - return null; -} -function HomeView() { - const { wallets: wallets2, options } = useWalletKit(); - const { isMobileLayout } = useResponsive(); - const visibleWallets = reactExports.useMemo(() => { - const visibleWallets2 = wallets2.filter((wallet) => { - const isVisible = wallet.isVisible !== false && (isBrowser$1() && isAndroid() && wallet.platforms.includes("browser-android") || isBrowser$1() && isIOS() && wallet.platforms.includes("browser-ios") || isBrowser$1() && isPC() && wallet.platforms.includes("browser-pc") || isTMA() && isAndroid() && wallet.platforms.includes("tg-android") || isTMA() && isIOS() && wallet.platforms.includes("tg-ios") || isTMA() && isPC() && wallet.platforms.includes("tg-pc")); - return isVisible; - }); - return visibleWallets2; - }, [wallets2]); - const useGridLayout = visibleWallets.length >= options.gridLayoutThreshold || isMobileLayout && options.useGridLayoutOnMobile; - const needPreCreateWcUri = isTMA() && isMobile(); - return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(ModalHeader, { children: options.title }), - options.disclaimer && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-disclaimer", clsDisclaimer), children: options.disclaimer }), - useGridLayout ? /* @__PURE__ */ jsxRuntimeExports.jsx(GridLayout, { visibleWallets }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ListLayout, { visibleWallets }), - needPreCreateWcUri && /* @__PURE__ */ jsxRuntimeExports.jsx(EvmHomeViewWalletConnectUriProvider, {}) - ] }); -} -function tronCommonErrorHandler(props) { - const { log: log2, handler, error } = props; - if (error) { - const description2 = error.message || error.name; - log2("[WalletError]", error); - handler == null ? void 0 : handler(error, description2); - } -} -function TronConnectingView() { - const { log: log2, selectedWallet, options, tronConfig } = useWalletKit(); - const [status, setStatus] = reactExports.useState( - selectedWallet.isInstalled() ? CONNECT_STATUS.CONNECTING : CONNECT_STATUS.UNAVAILABLE - ); - const { connect: connect2, isConnected } = useTronConnect(); - reactExports.useEffect(() => { - const onError = (error) => { - let message2 = ""; - if (error.message.includes("rejected")) { - message2 = "User rejected the request"; - setStatus(CONNECT_STATUS.REJECTED); - } else { - setStatus(CONNECT_STATUS.FAILED); - } - tronCommonErrorHandler({ - log: log2, - handler: options.onError, - error: { - message: message2 - } - }); - }; - EventEmitter$1.on(EventEmitter$1.TRON_WALLET_ERROR, onError); - return () => { - EventEmitter$1.off(EventEmitter$1.TRON_WALLET_ERROR, onError); - }; - }, [options.onError, log2]); - const runConnect = reactExports.useCallback(async () => { - if (!selectedWallet.isInstalled()) - return; - setStatus(CONNECT_STATUS.CONNECTING); - connect2({ - adapterName: selectedWallet.adapterName, - chainId: tronConfig == null ? void 0 : tronConfig.initialChainId - }); - }, [connect2, selectedWallet, tronConfig == null ? void 0 : tronConfig.initialChainId]); - return /* @__PURE__ */ jsxRuntimeExports.jsx( - TemplateConnectingView, - { - status, - runConnect, - onTryAgain: runConnect, - wallet: selectedWallet, - isConnected - } - ); -} -var ViewRoutes = /* @__PURE__ */ ((ViewRoutes2) => { - ViewRoutes2["HOME"] = "HOME"; - ViewRoutes2["EVM_CONNECTING"] = "EVM_CONNECTING"; - ViewRoutes2["EVM_QRCODE"] = "EVM_QRCODE"; - ViewRoutes2["EVM_URI_CONNECTING"] = "EVM_URI_CONNECTING"; - ViewRoutes2["SOLANA_CONNECTING"] = "SOLANA_CONNECTING"; - ViewRoutes2["SOLANA_QRCODE"] = "SOLANA_QRCODE"; - ViewRoutes2["TRON_CONNECTING"] = "TRON_CONNECTING"; - return ViewRoutes2; -})(ViewRoutes || {}); -function RouteProvider(props) { - const { children } = props; - const [route, setRoute] = reactExports.useState(""); - const { current: history } = reactExports.useRef([]); - const view = reactExports.useMemo(() => { - switch (route) { - case "HOME": - return /* @__PURE__ */ jsxRuntimeExports.jsx(HomeView, {}); - case "EVM_CONNECTING": - return /* @__PURE__ */ jsxRuntimeExports.jsx(EvmConnectingView, {}); - case "EVM_QRCODE": - return /* @__PURE__ */ jsxRuntimeExports.jsx(EvmQRCodeView, {}); - case "EVM_URI_CONNECTING": - return /* @__PURE__ */ jsxRuntimeExports.jsx(EvmUriConnectingView, {}); - case "SOLANA_CONNECTING": - return /* @__PURE__ */ jsxRuntimeExports.jsx(SolanaConnectingView, {}); - case "SOLANA_QRCODE": - return /* @__PURE__ */ jsxRuntimeExports.jsx(SolanaQRCodeView, {}); - case "TRON_CONNECTING": - return /* @__PURE__ */ jsxRuntimeExports.jsx(TronConnectingView, {}); - } - return null; - }, [route]); - const back = reactExports.useCallback(() => { - history.pop(); - const nextRoute = history[history.length - 1]; - if (nextRoute) { - setRoute(nextRoute); - } - }, [history]); - const push = reactExports.useCallback( - (nextRoute) => { - if (history[history.length - 1] !== nextRoute) { - history.push(nextRoute); - setRoute(nextRoute); - } - }, - [history] - ); - const replace = reactExports.useCallback( - (nextRoute) => { - if (history[history.length - 1] !== nextRoute) { - history[history.length - 1] = nextRoute; - setRoute(nextRoute); - } - }, - [history] - ); - const reset = reactExports.useCallback(() => { - history.length = 0; - }, [history]); - const value = reactExports.useMemo(() => { - return { - route, - view, - back, - push, - replace, - reset, - history - }; - }, [back, history, view, push, replace, reset, route]); - return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteContext.Provider, { value, children }); -} -function useDisclosure() { - const [isOpen, setIsOpen] = reactExports.useState(false); - const onOpen = reactExports.useCallback(() => { - setIsOpen(true); - }, []); - const onClose = reactExports.useCallback(() => { - setIsOpen(false); - }, []); - return { - isOpen, - onOpen, - onClose - }; -} -function ConnectModalProvider(props) { - const { children } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(WithRouter, { children }) }); -} -function WithRouter(props) { - const { children } = props; - const { setAction, evmConfig, tronConfig, options } = useWalletKit(); - const { isOpen, onClose, onOpen } = useDisclosure(); - const router = useRouter(); - const value = reactExports.useMemo(() => { - return { - isOpen, - onClose() { - onClose(); - setTimeout(() => { - router.reset(); - }, 300); - }, - onOpen(params = {}) { - var _a3, _b2; - router.push(params.viewRoute ?? ViewRoutes.HOME); - setAction(params.action); - if (evmConfig && params.initialChainId) { - evmConfig.initialChainId = params.initialChainId; - } - if (evmConfig && ((_a3 = params.evmConfig) == null ? void 0 : _a3.initialChainId)) { - evmConfig.initialChainId = params.evmConfig.initialChainId; - } - if (tronConfig && ((_b2 = params.tronConfig) == null ? void 0 : _b2.initialChainId)) { - tronConfig.initialChainId = params.tronConfig.initialChainId; - } - if (params.onConnected) { - options.onConnected = params.onConnected; - } - onOpen(); - } - }; - }, [evmConfig, isOpen, onClose, onOpen, options, router, setAction, tronConfig]); - return /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectModalContext.Provider, { value, children }); -} -const Portal = (props) => { - const { children } = props; - const portal = reactExports.useRef(); - const [, forceUpdate] = reactExports.useState({}); - reactExports.useEffect(() => { - const host = document.body; - portal.current = document.createElement("div"); - portal.current.setAttribute("class", "wk-portal"); - host.appendChild(portal.current); - forceUpdate({}); - const portalNode = portal.current; - return () => { - if (host.contains(portalNode)) { - host.removeChild(portalNode); - } - }; - }, []); - return portal.current ? reactDomExports.createPortal(children, portal.current) : null; -}; -Portal.displayName = "Portal"; -var clsContainer = "wk_1sntu031"; -var clsDescWrapper = "wk_1sntu033"; -var clsIconWrapper = "wk_1sntu032"; -var clsToastRoot = "wk_1sntu030"; -const ErrorIcon = (props) => { - const errorColor = cssVar("error"); - return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", ...props, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M18.3333 10.0001C18.3333 14.6025 14.6024 18.3334 9.99999 18.3334C5.39762 18.3334 1.66666 14.6025 1.66666 10.0001C1.66666 5.39771 5.39762 1.66675 9.99999 1.66675C14.6024 1.66675 18.3333 5.39771 18.3333 10.0001Z", - fill: errorColor - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M13.5503 7.41394C13.8166 7.14767 13.8166 6.71597 13.5503 6.4497C13.284 6.18343 12.8523 6.18343 12.5861 6.4497L10 8.90372L7.41394 6.4497C7.14767 6.18343 6.71597 6.18343 6.4497 6.4497C6.18343 6.71597 6.18343 7.14767 6.4497 7.41394L8.90372 10L6.4497 12.5861C6.18343 12.8523 6.18343 13.284 6.4497 13.5503C6.71597 13.8166 7.14767 13.8166 7.41394 13.5503L10 11.0963L12.5861 13.5503C12.8523 13.8166 13.284 13.8166 13.5503 13.5503C13.8166 13.284 13.8166 12.8523 13.5503 12.5861L11.0963 10L13.5503 7.41394Z", - fill: "white" - } - ) - ] }); -}; -const InfoIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", ...props, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M18.3333 10.0001C18.3333 14.6025 14.6024 18.3334 9.99999 18.3334C5.39762 18.3334 1.66666 14.6025 1.66666 10.0001C1.66666 5.39771 5.39762 1.66675 9.99999 1.66675C14.6024 1.66675 18.3333 5.39771 18.3333 10.0001Z", - fill: "#5F8BFF" - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "10", cy: "5.41675", r: "1.25", fill: "white" }), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M10.579 7.55143L7.87065 7.8755C7.65964 7.89895 7.5 8.07731 7.5 8.28962V8.75002C7.5 8.98014 7.68931 9.15814 7.91392 9.20817C8.47131 9.33231 8.95833 9.73515 8.95833 10.4167V12.9167C8.95833 13.5982 8.47131 14.0011 7.91392 14.1252C7.68931 14.1752 7.5 14.3532 7.5 14.5834V15C7.5 15.2301 7.68655 15.4167 7.91667 15.4167H12.0833C12.3135 15.4167 12.5 15.2301 12.5 15V14.5834C12.5 14.3532 12.3107 14.1752 12.0861 14.1252C11.5287 14.0011 11.0417 13.5982 11.0417 12.9167V7.96525C11.0417 7.71691 10.8258 7.52401 10.579 7.55143Z", - fill: "white" - } - ) - ] }); -}; -const iconMap = { - info: /* @__PURE__ */ jsxRuntimeExports.jsx(InfoIcon, {}), - error: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorIcon, {}) -}; -function ToastComponent(props) { - const { variant = "info", description: description2, duration, toastId } = props; - const [show, setShow] = reactExports.useState(true); - const [delay2, setDelay] = reactExports.useState(duration); - reactExports.useEffect(() => { - if (delay2) { - const timer2 = setTimeout(() => { - setShow(false); - }, delay2); - return () => { - clearTimeout(timer2); - }; - } - }, [delay2]); - const onExit = () => { - ToastManager.remove(toastId); - }; - const onMouseEnter = () => { - setDelay(void 0); - }; - const onMouseLeave = () => { - setDelay(duration); - }; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Transition, { in: show, variant: "toast-slide", onExit, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: "wk-toast", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: clsContainer, onMouseEnter, onMouseLeave, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsIconWrapper, children: iconMap[variant] }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsDescWrapper, children: description2 }) - ] }) }) }); -} -const ToastProvider = () => { - const [toastList, setToastList] = reactExports.useState([]); - reactExports.useEffect(() => { - const update5 = (newList) => { - setToastList(newList); - }; - ToastManager.subscribe(update5); - return () => { - ToastManager.unsubscribe(update5); - }; - }, []); - return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: toastList.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-toast-container", clsToastRoot), children: toastList.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(ToastComponent, { ...item }, item.toastId)) }) }) }); -}; -ToastProvider.displayName = "ToastProvider"; -const ProfileModalContext = W$2.createContext({}); -function ProfileModalProvider(props) { - const { children } = props; - const { isOpen, onClose, onOpen } = useDisclosure(); - const value = reactExports.useMemo(() => { - return { - isOpen, - onClose, - onOpen - }; - }, [isOpen, onClose, onOpen]); - return /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileModalContext.Provider, { value, children }); -} -function TronWalletProvider(props) { - const { children } = props; - const { tronConfig } = useWalletKit(); - reactExports.useMemo(() => { - try { - if (typeof window !== "undefined" && !(tronConfig == null ? void 0 : tronConfig.autoConnect)) { - window.localStorage.removeItem("tronAdapterName"); - } - } catch (err) { - console.log(err); - } - }, [tronConfig == null ? void 0 : tronConfig.autoConnect]); - const onError = reactExports.useCallback((error) => { - EventEmitter$1.emit(EventEmitter$1.TRON_WALLET_ERROR, error); - }, []); - if (!tronConfig) { - return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }); - } - return /* @__PURE__ */ jsxRuntimeExports.jsx( - WalletProvider, - { - adapters: tronConfig.adapters, - autoConnect: false, - onError, - children - } - ); -} -function WalletKitProvider(props) { - const { config: config2, children, theme, mode: mode2, debugMode = false } = props; - reactExports.useMemo(() => { - global.Buffer = global.Buffer || buffer.Buffer; - }, []); - const finalConfig = reactExports.useMemo(() => { - var _a3, _b2, _c2; - const finalConfig2 = getDefaultConfig(config2); - const wallets22 = []; - const evmWallets = (_a3 = finalConfig2.evmConfig) == null ? void 0 : _a3.wallets; - const solanaWallets = (_b2 = finalConfig2.solanaConfig) == null ? void 0 : _b2.wallets; - const tronWallets = (_c2 = finalConfig2.tronConfig) == null ? void 0 : _c2.wallets; - if (evmWallets) - wallets22.push(...evmWallets); - if (solanaWallets) - wallets22.push(...solanaWallets); - if (tronWallets) - wallets22.push(...tronWallets); - return { - ...finalConfig2, - wallets: wallets22 - }; - }, [config2]); - const [action, setAction] = reactExports.useState(); - const [selectedWallet, setSelectedWallet] = reactExports.useState({}); - const [wallets2, setWallets] = reactExports.useState(finalConfig.wallets); - const value = reactExports.useMemo(() => { - return { - ...finalConfig, - log: debugMode ? console.log : () => void 0, - action, - setAction, - selectedWallet, - setSelectedWallet, - wallets: wallets2, - setWallets - }; - }, [action, debugMode, finalConfig, selectedWallet, wallets2]); - return /* @__PURE__ */ jsxRuntimeExports.jsx(WalletKitContext.Provider, { value, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ThemeProvider, { mode: mode2, theme, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(ToastProvider, {}), - /* @__PURE__ */ jsxRuntimeExports.jsx(EvmWalletProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SolanaWalletProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TronWalletProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectModalProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileModalProvider, { children }) }) }) }) }) - ] }) }); -} -var clsModalContent = "wk_1kzf8pa0"; -function ModalContent(props) { - const { className, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-modal-content", clsModalContent, className), ...restProps }); -} -function useKeyDown(props = {}) { - const { key: key2 = "Enter", enabled = true, handler } = props; - reactExports.useEffect(() => { - if (!enabled) { - return; - } - const onKeyDown = (e18) => { - if (e18.code === key2) { - handler == null ? void 0 : handler(); - } - }; - window.addEventListener("keydown", onKeyDown); - return () => { - window.removeEventListener("keydown", onKeyDown); - }; - }, [enabled, handler, key2]); -} -function useScrollLock(isLocked = false) { - reactExports.useEffect(() => { - if (!isLocked) { - return; - } - const originalOverflow = document.documentElement.style.overflow; - document.documentElement.style.overflow = "hidden"; - return () => { - document.documentElement.style.overflow = originalOverflow; - }; - }, [isLocked]); -} -var clsModal$1 = "wk_3qg8ds0"; -var clsModalOverlay = "wk_3qg8ds1"; -function Modal(props) { - const { - className, - isOpen, - onClose, - children, - contentClassName, - closeOnEsc = true, - closeOnOverlayClick = true, - ...restProps - } = props; - useKeyDown({ - key: "Escape", - enabled: isOpen && closeOnEsc, - handler() { - onClose(); - } - }); - useScrollLock(isOpen); - const { isMobileLayout } = useResponsive(); - const { colorMode } = useTheme(); - return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Transition, { in: isOpen, variant: "fade", children: /* @__PURE__ */ jsxRuntimeExports.jsxs( - Box, - { - className: cx("wk-modal", clsModal$1, className), - style: { - colorScheme: colorMode - }, - ...restProps, - children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx( - Box, - { - className: cx("wk-modal-overlay", clsModalOverlay), - onClick: () => closeOnOverlayClick && onClose() - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx(Transition, { in: isOpen, variant: isMobileLayout ? "modal-slide" : void 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalContent, { className: contentClassName, children }) }) - ] - } - ) }) }); -} -var clsIconButton = "wk_1bjpejd0"; -const IconButton = (props) => { - const { className, icon, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { className: cx("wk-icon-button", clsIconButton, className), ...restProps, children: icon }); -}; -IconButton.displayName = "IconButton"; -const BackIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "20", height: "20", viewBox: "0 0 40 40", fill: "currentColor", ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M24.5118 8.82165C25.1627 9.47253 25.1627 10.5278 24.5118 11.1787L15.6904 20.0002L24.5118 28.8217C25.1627 29.4725 25.1627 30.5278 24.5118 31.1787C23.861 31.8295 22.8057 31.8295 22.1548 31.1787L12.1548 21.1787C11.5039 20.5278 11.5039 19.4725 12.1548 18.8217L22.1548 8.82165C22.8057 8.17078 23.861 8.17078 24.5118 8.82165Z" - } - ) }); -}; -const CloseIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "20", height: "20", viewBox: "0 0 40 40", fill: "currentColor", ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12.0119 9.51184C11.361 8.86097 10.3057 8.86097 9.65484 9.51184C9.00397 10.1627 9.00397 11.218 9.65484 11.8689L17.643 19.857L9.51187 27.9882C8.86099 28.639 8.86099 29.6943 9.51187 30.3452C10.1627 30.9961 11.218 30.9961 11.8689 30.3452L20 22.214L27.9218 30.1358C28.5726 30.7867 29.6279 30.7867 30.2788 30.1358C30.9297 29.4849 30.9297 28.4296 30.2788 27.7788L22.357 19.857L30.1358 12.0783C30.7867 11.4274 30.7867 10.3721 30.1358 9.72123C29.4849 9.07036 28.4297 9.07036 27.7788 9.72123L20 17.5L12.0119 9.51184Z" - } - ) }); -}; -var clsNavbar = "wk_1nzgcmu0"; -function Navbar(props) { - const { className, showBack, onBack, onClose, ...restProps } = props; - return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: cx("wk-navbar", clsNavbar, className), ...restProps, children: [ - showBack && /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { className: "wk-navbar-back-button", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(BackIcon, {}), onClick: onBack }), - /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { style: { flex: 1 } }), - /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { className: "wk-navbar-close-button", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseIcon, {}), onClick: onClose }) - ] }); -} -function ConnectModal() { - const { options } = useWalletKit(); - const { isOpen, onClose } = useConnectModal(); - const { view, history, back } = useRouter(); - const showBack = history.length > 1; - return /* @__PURE__ */ jsxRuntimeExports.jsxs( - Modal, - { - className: "wk-connect-modal", - isOpen, - onClose, - closeOnEsc: options == null ? void 0 : options.closeModalOnEsc, - closeOnOverlayClick: options == null ? void 0 : options.closeModalOnOverlayClick, - children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, { showBack, onBack: back, onClose }), - view - ] - } - ); -} -const mainnet = /* @__PURE__ */ defineChain({ - id: 1, - name: "Ethereum", - nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, - rpcUrls: { - default: { - http: ["https://cloudflare-eth.com"] - } - }, - blockExplorers: { - default: { - name: "Etherscan", - url: "https://etherscan.io", - apiUrl: "https://api.etherscan.io/api" - } - }, - contracts: { - ensRegistry: { - address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" - }, - ensUniversalResolver: { - address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67", - blockCreated: 19258213 - }, - multicall3: { - address: "0xca11bde05977b3631167028862be2a173976ca11", - blockCreated: 14353601 - } - } -}); -var events = { exports: {} }; -var R$1 = typeof Reflect === "object" ? Reflect : null; -var ReflectApply = R$1 && typeof R$1.apply === "function" ? R$1.apply : function ReflectApply2(target, receiver, args) { - return Function.prototype.apply.call(target, receiver, args); -}; -var ReflectOwnKeys; -if (R$1 && typeof R$1.ownKeys === "function") { - ReflectOwnKeys = R$1.ownKeys; -} else if (Object.getOwnPropertySymbols) { - ReflectOwnKeys = function ReflectOwnKeys2(target) { - return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target)); - }; -} else { - ReflectOwnKeys = function ReflectOwnKeys2(target) { - return Object.getOwnPropertyNames(target); - }; -} -function ProcessEmitWarning(warning) { - if (console && console.warn) - console.warn(warning); -} -var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) { - return value !== value; -}; -function EventEmitter() { - EventEmitter.init.call(this); -} -events.exports = EventEmitter; -events.exports.once = once2; -EventEmitter.EventEmitter = EventEmitter; -EventEmitter.prototype._events = void 0; -EventEmitter.prototype._eventsCount = 0; -EventEmitter.prototype._maxListeners = void 0; -var defaultMaxListeners = 10; -function checkListener(listener) { - if (typeof listener !== "function") { - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); - } -} -Object.defineProperty(EventEmitter, "defaultMaxListeners", { - enumerable: true, - get: function() { - return defaultMaxListeners; - }, - set: function(arg) { - if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) { - throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + "."); - } - defaultMaxListeners = arg; - } -}); -EventEmitter.init = function() { - if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) { - this._events = /* @__PURE__ */ Object.create(null); - this._eventsCount = 0; - } - this._maxListeners = this._maxListeners || void 0; -}; -EventEmitter.prototype.setMaxListeners = function setMaxListeners(n4) { - if (typeof n4 !== "number" || n4 < 0 || NumberIsNaN(n4)) { - throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n4 + "."); - } - this._maxListeners = n4; - return this; -}; -function _getMaxListeners(that) { - if (that._maxListeners === void 0) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; -} -EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return _getMaxListeners(this); -}; -EventEmitter.prototype.emit = function emit(type2) { - var args = []; - for (var i3 = 1; i3 < arguments.length; i3++) - args.push(arguments[i3]); - var doError = type2 === "error"; - var events2 = this._events; - if (events2 !== void 0) - doError = doError && events2.error === void 0; - else if (!doError) - return false; - if (doError) { - var er2; - if (args.length > 0) - er2 = args[0]; - if (er2 instanceof Error) { - throw er2; - } - var err = new Error("Unhandled error." + (er2 ? " (" + er2.message + ")" : "")); - err.context = er2; - throw err; - } - var handler = events2[type2]; - if (handler === void 0) - return false; - if (typeof handler === "function") { - ReflectApply(handler, this, args); - } else { - var len = handler.length; - var listeners3 = arrayClone(handler, len); - for (var i3 = 0; i3 < len; ++i3) - ReflectApply(listeners3[i3], this, args); - } - return true; -}; -function _addListener(target, type2, listener, prepend) { - var m3; - var events2; - var existing; - checkListener(listener); - events2 = target._events; - if (events2 === void 0) { - events2 = target._events = /* @__PURE__ */ Object.create(null); - target._eventsCount = 0; - } else { - if (events2.newListener !== void 0) { - target.emit( - "newListener", - type2, - listener.listener ? listener.listener : listener - ); - events2 = target._events; - } - existing = events2[type2]; - } - if (existing === void 0) { - existing = events2[type2] = listener; - ++target._eventsCount; - } else { - if (typeof existing === "function") { - existing = events2[type2] = prepend ? [listener, existing] : [existing, listener]; - } else if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - m3 = _getMaxListeners(target); - if (m3 > 0 && existing.length > m3 && !existing.warned) { - existing.warned = true; - var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type2) + " listeners added. Use emitter.setMaxListeners() to increase limit"); - w2.name = "MaxListenersExceededWarning"; - w2.emitter = target; - w2.type = type2; - w2.count = existing.length; - ProcessEmitWarning(w2); - } - } - return target; -} -EventEmitter.prototype.addListener = function addListener(type2, listener) { - return _addListener(this, type2, listener, false); -}; -EventEmitter.prototype.on = EventEmitter.prototype.addListener; -EventEmitter.prototype.prependListener = function prependListener(type2, listener) { - return _addListener(this, type2, listener, true); -}; -function onceWrapper() { - 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 _onceWrap(target, type2, listener) { - var state = { fired: false, wrapFn: void 0, target, type: type2, listener }; - var wrapped = onceWrapper.bind(state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; -} -EventEmitter.prototype.once = function once(type2, listener) { - checkListener(listener); - this.on(type2, _onceWrap(this, type2, listener)); - return this; -}; -EventEmitter.prototype.prependOnceListener = function prependOnceListener(type2, listener) { - checkListener(listener); - this.prependListener(type2, _onceWrap(this, type2, listener)); - return this; -}; -EventEmitter.prototype.removeListener = function removeListener(type2, listener) { - var list, events2, position, i3, originalListener; - checkListener(listener); - events2 = this._events; - if (events2 === void 0) - return this; - list = events2[type2]; - if (list === void 0) - return this; - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = /* @__PURE__ */ Object.create(null); - else { - delete events2[type2]; - if (events2.removeListener) - this.emit("removeListener", type2, list.listener || listener); - } - } else if (typeof list !== "function") { - position = -1; - for (i3 = list.length - 1; i3 >= 0; i3--) { - if (list[i3] === listener || list[i3].listener === listener) { - originalListener = list[i3].listener; - position = i3; - break; - } - } - if (position < 0) - return this; - if (position === 0) - list.shift(); - else { - spliceOne(list, position); - } - if (list.length === 1) - events2[type2] = list[0]; - if (events2.removeListener !== void 0) - this.emit("removeListener", type2, originalListener || listener); - } - return this; -}; -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.removeAllListeners = function removeAllListeners(type2) { - var listeners3, events2, i3; - events2 = this._events; - if (events2 === void 0) - return this; - if (events2.removeListener === void 0) { - if (arguments.length === 0) { - this._events = /* @__PURE__ */ Object.create(null); - this._eventsCount = 0; - } else if (events2[type2] !== void 0) { - if (--this._eventsCount === 0) - this._events = /* @__PURE__ */ Object.create(null); - else - delete events2[type2]; - } - return this; - } - if (arguments.length === 0) { - var keys2 = Object.keys(events2); - var key2; - for (i3 = 0; i3 < keys2.length; ++i3) { - key2 = keys2[i3]; - if (key2 === "removeListener") - continue; - this.removeAllListeners(key2); - } - this.removeAllListeners("removeListener"); - this._events = /* @__PURE__ */ Object.create(null); - this._eventsCount = 0; - return this; - } - listeners3 = events2[type2]; - if (typeof listeners3 === "function") { - this.removeListener(type2, listeners3); - } else if (listeners3 !== void 0) { - for (i3 = listeners3.length - 1; i3 >= 0; i3--) { - this.removeListener(type2, listeners3[i3]); - } - } - return this; -}; -function _listeners(target, type2, unwrap) { - var events2 = target._events; - if (events2 === void 0) - return []; - var evlistener = events2[type2]; - if (evlistener === void 0) - return []; - if (typeof evlistener === "function") - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); -} -EventEmitter.prototype.listeners = function listeners2(type2) { - return _listeners(this, type2, true); -}; -EventEmitter.prototype.rawListeners = function rawListeners(type2) { - return _listeners(this, type2, false); -}; -EventEmitter.listenerCount = function(emitter, type2) { - if (typeof emitter.listenerCount === "function") { - return emitter.listenerCount(type2); - } else { - return listenerCount.call(emitter, type2); - } -}; -EventEmitter.prototype.listenerCount = listenerCount; -function listenerCount(type2) { - var events2 = this._events; - if (events2 !== void 0) { - var evlistener = events2[type2]; - if (typeof evlistener === "function") { - return 1; - } else if (evlistener !== void 0) { - return evlistener.length; - } - } - return 0; -} -EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; -}; -function arrayClone(arr, n4) { - var copy = new Array(n4); - for (var i3 = 0; i3 < n4; ++i3) - copy[i3] = arr[i3]; - return copy; -} -function spliceOne(list, index2) { - for (; index2 + 1 < list.length; index2++) - list[index2] = list[index2 + 1]; - list.pop(); -} -function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i3 = 0; i3 < ret.length; ++i3) { - ret[i3] = arr[i3].listener || arr[i3]; - } - return ret; -} -function once2(emitter, name2) { - return new Promise(function(resolve, reject) { - function errorListener(err) { - emitter.removeListener(name2, resolver); - reject(err); - } - function resolver() { - if (typeof emitter.removeListener === "function") { - emitter.removeListener("error", errorListener); - } - resolve([].slice.call(arguments)); - } - eventTargetAgnosticAddListener(emitter, name2, resolver, { once: true }); - if (name2 !== "error") { - addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); - } - }); -} -function addErrorHandlerIfEventEmitter(emitter, handler, flags) { - if (typeof emitter.on === "function") { - eventTargetAgnosticAddListener(emitter, "error", handler, flags); - } -} -function eventTargetAgnosticAddListener(emitter, name2, listener, flags) { - if (typeof emitter.on === "function") { - if (flags.once) { - emitter.once(name2, listener); - } else { - emitter.on(name2, listener); - } - } else if (typeof emitter.addEventListener === "function") { - emitter.addEventListener(name2, function wrapListener(arg) { - if (flags.once) { - emitter.removeEventListener(name2, wrapListener); - } - listener(arg); - }); - } else { - throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); - } -} -var eventsExports = events.exports; -const Jg = /* @__PURE__ */ getDefaultExportFromCjs$1(eventsExports); -var __spreadArray = globalThis && globalThis.__spreadArray || function(to2, from2, pack2) { - if (pack2 || arguments.length === 2) - for (var i3 = 0, l2 = from2.length, ar2; i3 < l2; i3++) { - if (ar2 || !(i3 in from2)) { - if (!ar2) - ar2 = Array.prototype.slice.call(from2, 0, i3); - ar2[i3] = from2[i3]; - } - } - return to2.concat(ar2 || Array.prototype.slice.call(from2)); -}; -var BrowserInfo = ( - /** @class */ - function() { - function BrowserInfo2(name2, version2, os2) { - this.name = name2; - this.version = version2; - this.os = os2; - this.type = "browser"; - } - return BrowserInfo2; - }() -); -var NodeInfo = ( - /** @class */ - function() { - function NodeInfo2(version2) { - this.version = version2; - this.type = "node"; - this.name = "node"; - this.os = process.platform; - } - return NodeInfo2; - }() -); -var SearchBotDeviceInfo = ( - /** @class */ - function() { - function SearchBotDeviceInfo2(name2, version2, os2, bot) { - this.name = name2; - this.version = version2; - this.os = os2; - this.bot = bot; - this.type = "bot-device"; - } - return SearchBotDeviceInfo2; - }() -); -var BotInfo = ( - /** @class */ - function() { - function BotInfo2() { - this.type = "bot"; - this.bot = true; - this.name = "bot"; - this.version = null; - this.os = null; - } - return BotInfo2; - }() -); -var ReactNativeInfo = ( - /** @class */ - function() { - function ReactNativeInfo2() { - this.type = "react-native"; - this.name = "react-native"; - this.version = null; - this.os = null; - } - return ReactNativeInfo2; - }() -); -var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/; -var SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/; -var REQUIRED_VERSION_PARTS = 3; -var userAgentRules = [ - ["aol", /AOLShield\/([0-9\._]+)/], - ["edge", /Edge\/([0-9\._]+)/], - ["edge-ios", /EdgiOS\/([0-9\._]+)/], - ["yandexbrowser", /YaBrowser\/([0-9\._]+)/], - ["kakaotalk", /KAKAOTALK\s([0-9\.]+)/], - ["samsung", /SamsungBrowser\/([0-9\.]+)/], - ["silk", /\bSilk\/([0-9._-]+)\b/], - ["miui", /MiuiBrowser\/([0-9\.]+)$/], - ["beaker", /BeakerBrowser\/([0-9\.]+)/], - ["edge-chromium", /EdgA?\/([0-9\.]+)/], - [ - "chromium-webview", - /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/ - ], - ["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], - ["phantomjs", /PhantomJS\/([0-9\.]+)(:?\s|$)/], - ["crios", /CriOS\/([0-9\.]+)(:?\s|$)/], - ["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/], - ["fxios", /FxiOS\/([0-9\.]+)/], - ["opera-mini", /Opera Mini.*Version\/([0-9\.]+)/], - ["opera", /Opera\/([0-9\.]+)(?:\s|$)/], - ["opera", /OPR\/([0-9\.]+)(:?\s|$)/], - ["pie", /^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/], - ["pie", /^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/], - ["netfront", /^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/], - ["ie", /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], - ["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], - ["ie", /MSIE\s(7\.0)/], - ["bb10", /BB10;\sTouch.*Version\/([0-9\.]+)/], - ["android", /Android\s([0-9\.]+)/], - ["ios", /Version\/([0-9\._]+).*Mobile.*Safari.*/], - ["safari", /Version\/([0-9\._]+).*Safari/], - ["facebook", /FB[AS]V\/([0-9\.]+)/], - ["instagram", /Instagram\s([0-9\.]+)/], - ["ios-webview", /AppleWebKit\/([0-9\.]+).*Mobile/], - ["ios-webview", /AppleWebKit\/([0-9\.]+).*Gecko\)$/], - ["curl", /^curl\/([0-9\.]+)$/], - ["searchbot", SEARCHBOX_UA_REGEX] -]; -var operatingSystemRules = [ - ["iOS", /iP(hone|od|ad)/], - ["Android OS", /Android/], - ["BlackBerry OS", /BlackBerry|BB10/], - ["Windows Mobile", /IEMobile/], - ["Amazon OS", /Kindle/], - ["Windows 3.11", /Win16/], - ["Windows 95", /(Windows 95)|(Win95)|(Windows_95)/], - ["Windows 98", /(Windows 98)|(Win98)/], - ["Windows 2000", /(Windows NT 5.0)|(Windows 2000)/], - ["Windows XP", /(Windows NT 5.1)|(Windows XP)/], - ["Windows Server 2003", /(Windows NT 5.2)/], - ["Windows Vista", /(Windows NT 6.0)/], - ["Windows 7", /(Windows NT 6.1)/], - ["Windows 8", /(Windows NT 6.2)/], - ["Windows 8.1", /(Windows NT 6.3)/], - ["Windows 10", /(Windows NT 10.0)/], - ["Windows ME", /Windows ME/], - ["Windows CE", /Windows CE|WinCE|Microsoft Pocket Internet Explorer/], - ["Open BSD", /OpenBSD/], - ["Sun OS", /SunOS/], - ["Chrome OS", /CrOS/], - ["Linux", /(Linux)|(X11)/], - ["Mac OS", /(Mac_PowerPC)|(Macintosh)/], - ["QNX", /QNX/], - ["BeOS", /BeOS/], - ["OS/2", /OS\/2/] -]; -function detect(userAgent) { - if (!!userAgent) { - return parseUserAgent(userAgent); - } - if (typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative") { - return new ReactNativeInfo(); - } - if (typeof navigator !== "undefined") { - return parseUserAgent(navigator.userAgent); - } - return getNodeVersion(); -} -function matchUserAgent(ua2) { - return ua2 !== "" && userAgentRules.reduce(function(matched, _a3) { - var browser2 = _a3[0], regex2 = _a3[1]; - if (matched) { - return matched; - } - var uaMatch = regex2.exec(ua2); - return !!uaMatch && [browser2, uaMatch]; - }, false); -} -function parseUserAgent(ua2) { - var matchedRule = matchUserAgent(ua2); - if (!matchedRule) { - return null; - } - var name2 = matchedRule[0], match = matchedRule[1]; - if (name2 === "searchbot") { - return new BotInfo(); - } - var versionParts = match[1] && match[1].split(".").join("_").split("_").slice(0, 3); - if (versionParts) { - if (versionParts.length < REQUIRED_VERSION_PARTS) { - versionParts = __spreadArray(__spreadArray([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true); - } - } else { - versionParts = []; - } - var version2 = versionParts.join("."); - var os2 = detectOS(ua2); - var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua2); - if (searchBotMatch && searchBotMatch[1]) { - return new SearchBotDeviceInfo(name2, version2, os2, searchBotMatch[1]); - } - return new BrowserInfo(name2, version2, os2); -} -function detectOS(ua2) { - for (var ii2 = 0, count = operatingSystemRules.length; ii2 < count; ii2++) { - var _a3 = operatingSystemRules[ii2], os2 = _a3[0], regex2 = _a3[1]; - var match = regex2.exec(ua2); - if (match) { - return os2; - } - } - return null; -} -function getNodeVersion() { - var isNode = typeof process !== "undefined" && process.version; - return isNode ? new NodeInfo(process.version.slice(1)) : null; -} -function createVersionParts(count) { - var output2 = []; - for (var ii2 = 0; ii2 < count; ii2++) { - output2.push("0"); - } - return output2; -} -var cjs$3 = {}; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -var extendStatics = function(d4, b2) { - extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b3) { - d5.__proto__ = b3; - } || function(d5, b3) { - for (var p3 in b3) - if (b3.hasOwnProperty(p3)) - d5[p3] = b3[p3]; - }; - return extendStatics(d4, b2); -}; -function __extends(d4, b2) { - extendStatics(d4, b2); - function __() { - this.constructor = d4; - } - d4.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __()); -} -var __assign = function() { - __assign = Object.assign || function __assign2(t2) { - for (var s2, i3 = 1, n4 = arguments.length; i3 < n4; i3++) { - s2 = arguments[i3]; - for (var p3 in s2) - if (Object.prototype.hasOwnProperty.call(s2, p3)) - t2[p3] = s2[p3]; - } - return t2; - }; - return __assign.apply(this, arguments); -}; -function __rest(s2, e18) { - var t2 = {}; - for (var p3 in s2) - if (Object.prototype.hasOwnProperty.call(s2, p3) && e18.indexOf(p3) < 0) - t2[p3] = s2[p3]; - if (s2 != null && typeof Object.getOwnPropertySymbols === "function") - for (var i3 = 0, p3 = Object.getOwnPropertySymbols(s2); i3 < p3.length; i3++) { - if (e18.indexOf(p3[i3]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p3[i3])) - t2[p3[i3]] = s2[p3[i3]]; - } - return t2; -} -function __decorate(decorators, target, key2, desc) { - var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d4; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r2 = Reflect.decorate(decorators, target, key2, desc); - else - for (var i3 = decorators.length - 1; i3 >= 0; i3--) - if (d4 = decorators[i3]) - r2 = (c2 < 3 ? d4(r2) : c2 > 3 ? d4(target, key2, r2) : d4(target, key2)) || r2; - return c2 > 3 && r2 && Object.defineProperty(target, key2, r2), r2; -} -function __param(paramIndex, decorator) { - return function(target, key2) { - decorator(target, key2, paramIndex); - }; -} -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve) { - resolve(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e18) { - reject(e18); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e18) { - reject(e18); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _3 = { label: 0, sent: function() { - if (t2[0] & 1) - throw t2[1]; - return t2[1]; - }, trys: [], ops: [] }, f3, y3, t2, g3; - return g3 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g3[Symbol.iterator] = function() { - return this; - }), g3; - function verb(n4) { - return function(v6) { - return step([n4, v6]); - }; - } - function step(op) { - if (f3) - throw new TypeError("Generator is already executing."); - while (_3) - try { - if (f3 = 1, y3 && (t2 = op[0] & 2 ? y3["return"] : op[0] ? y3["throw"] || ((t2 = y3["return"]) && t2.call(y3), 0) : y3.next) && !(t2 = t2.call(y3, op[1])).done) - return t2; - if (y3 = 0, t2) - op = [op[0] & 2, t2.value]; - switch (op[0]) { - case 0: - case 1: - t2 = op; - break; - case 4: - _3.label++; - return { value: op[1], done: false }; - case 5: - _3.label++; - y3 = op[1]; - op = [0]; - continue; - case 7: - op = _3.ops.pop(); - _3.trys.pop(); - continue; - default: - if (!(t2 = _3.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _3 = 0; - continue; - } - if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) { - _3.label = op[1]; - break; - } - if (op[0] === 6 && _3.label < t2[1]) { - _3.label = t2[1]; - t2 = op; - break; - } - if (t2 && _3.label < t2[2]) { - _3.label = t2[2]; - _3.ops.push(op); - break; - } - if (t2[2]) - _3.ops.pop(); - _3.trys.pop(); - continue; - } - op = body.call(thisArg, _3); - } catch (e18) { - op = [6, e18]; - y3 = 0; - } finally { - f3 = t2 = 0; - } - if (op[0] & 5) - throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } -} -function __createBinding(o2, m3, k2, k22) { - if (k22 === void 0) - k22 = k2; - o2[k22] = m3[k2]; -} -function __exportStar(m3, exports) { - for (var p3 in m3) - if (p3 !== "default" && !exports.hasOwnProperty(p3)) - exports[p3] = m3[p3]; -} -function __values(o2) { - var s2 = typeof Symbol === "function" && Symbol.iterator, m3 = s2 && o2[s2], i3 = 0; - if (m3) - return m3.call(o2); - if (o2 && typeof o2.length === "number") - return { - next: function() { - if (o2 && i3 >= o2.length) - o2 = void 0; - return { value: o2 && o2[i3++], done: !o2 }; - } - }; - throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read(o2, n4) { - var m3 = typeof Symbol === "function" && o2[Symbol.iterator]; - if (!m3) - return o2; - var i3 = m3.call(o2), r2, ar2 = [], e18; - try { - while ((n4 === void 0 || n4-- > 0) && !(r2 = i3.next()).done) - ar2.push(r2.value); - } catch (error) { - e18 = { error }; - } finally { - try { - if (r2 && !r2.done && (m3 = i3["return"])) - m3.call(i3); - } finally { - if (e18) - throw e18.error; - } - } - return ar2; -} -function __spread() { - for (var ar2 = [], i3 = 0; i3 < arguments.length; i3++) - ar2 = ar2.concat(__read(arguments[i3])); - return ar2; -} -function __spreadArrays() { - for (var s2 = 0, i3 = 0, il2 = arguments.length; i3 < il2; i3++) - s2 += arguments[i3].length; - for (var r2 = Array(s2), k2 = 0, i3 = 0; i3 < il2; i3++) - for (var a3 = arguments[i3], j2 = 0, jl2 = a3.length; j2 < jl2; j2++, k2++) - r2[k2] = a3[j2]; - return r2; -} -function __await(v6) { - return this instanceof __await ? (this.v = v6, this) : new __await(v6); -} -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var g3 = generator.apply(thisArg, _arguments || []), i3, q2 = []; - return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() { - return this; - }, i3; - function verb(n4) { - if (g3[n4]) - i3[n4] = function(v6) { - return new Promise(function(a3, b2) { - q2.push([n4, v6, a3, b2]) > 1 || resume(n4, v6); - }); - }; - } - function resume(n4, v6) { - try { - step(g3[n4](v6)); - } catch (e18) { - settle2(q2[0][3], e18); - } - } - function step(r2) { - r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle2(q2[0][2], r2); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle2(f3, v6) { - if (f3(v6), q2.shift(), q2.length) - resume(q2[0][0], q2[0][1]); - } -} -function __asyncDelegator(o2) { - var i3, p3; - return i3 = {}, verb("next"), verb("throw", function(e18) { - throw e18; - }), verb("return"), i3[Symbol.iterator] = function() { - return this; - }, i3; - function verb(n4, f3) { - i3[n4] = o2[n4] ? function(v6) { - return (p3 = !p3) ? { value: __await(o2[n4](v6)), done: n4 === "return" } : f3 ? f3(v6) : v6; - } : f3; - } -} -function __asyncValues(o2) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m3 = o2[Symbol.asyncIterator], i3; - return m3 ? m3.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() { - return this; - }, i3); - function verb(n4) { - i3[n4] = o2[n4] && function(v6) { - return new Promise(function(resolve, reject) { - v6 = o2[n4](v6), settle2(resolve, reject, v6.done, v6.value); - }); - }; - } - function settle2(resolve, reject, d4, v6) { - Promise.resolve(v6).then(function(v7) { - resolve({ value: v7, done: d4 }); - }, reject); - } -} -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result = {}; - if (mod2 != null) { - for (var k2 in mod2) - if (Object.hasOwnProperty.call(mod2, k2)) - result[k2] = mod2[k2]; - } - result.default = mod2; - return result; -} -function __importDefault(mod2) { - return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; -} -function __classPrivateFieldGet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return privateMap.get(receiver); -} -function __classPrivateFieldSet(receiver, privateMap, value) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - privateMap.set(receiver, value); - return value; -} -const tslib_es6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - get __assign() { - return __assign; - }, - __asyncDelegator, - __asyncGenerator, - __asyncValues, - __await, - __awaiter, - __classPrivateFieldGet, - __classPrivateFieldSet, - __createBinding, - __decorate, - __exportStar, - __extends, - __generator, - __importDefault, - __importStar, - __makeTemplateObject, - __metadata, - __param, - __read, - __rest, - __spread, - __spreadArrays, - __values -}, Symbol.toStringTag, { value: "Module" })); -const require$$0$1 = /* @__PURE__ */ getAugmentedNamespace(tslib_es6); -var utils$d = {}; -var delay = {}; -var hasRequiredDelay; -function requireDelay() { - if (hasRequiredDelay) - return delay; - hasRequiredDelay = 1; - Object.defineProperty(delay, "__esModule", { value: true }); - delay.delay = void 0; - function delay$1(timeout) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(true); - }, timeout); - }); - } - delay.delay = delay$1; - return delay; -} -var convert = {}; -var constants = {}; -var misc = {}; -var hasRequiredMisc; -function requireMisc() { - if (hasRequiredMisc) - return misc; - hasRequiredMisc = 1; - Object.defineProperty(misc, "__esModule", { value: true }); - misc.ONE_THOUSAND = misc.ONE_HUNDRED = void 0; - misc.ONE_HUNDRED = 100; - misc.ONE_THOUSAND = 1e3; - return misc; -} -var time = {}; -var hasRequiredTime; -function requireTime() { - if (hasRequiredTime) - return time; - hasRequiredTime = 1; - (function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ONE_YEAR = exports.FOUR_WEEKS = exports.THREE_WEEKS = exports.TWO_WEEKS = exports.ONE_WEEK = exports.THIRTY_DAYS = exports.SEVEN_DAYS = exports.FIVE_DAYS = exports.THREE_DAYS = exports.ONE_DAY = exports.TWENTY_FOUR_HOURS = exports.TWELVE_HOURS = exports.SIX_HOURS = exports.THREE_HOURS = exports.ONE_HOUR = exports.SIXTY_MINUTES = exports.THIRTY_MINUTES = exports.TEN_MINUTES = exports.FIVE_MINUTES = exports.ONE_MINUTE = exports.SIXTY_SECONDS = exports.THIRTY_SECONDS = exports.TEN_SECONDS = exports.FIVE_SECONDS = exports.ONE_SECOND = void 0; - exports.ONE_SECOND = 1; - exports.FIVE_SECONDS = 5; - exports.TEN_SECONDS = 10; - exports.THIRTY_SECONDS = 30; - exports.SIXTY_SECONDS = 60; - exports.ONE_MINUTE = exports.SIXTY_SECONDS; - exports.FIVE_MINUTES = exports.ONE_MINUTE * 5; - exports.TEN_MINUTES = exports.ONE_MINUTE * 10; - exports.THIRTY_MINUTES = exports.ONE_MINUTE * 30; - exports.SIXTY_MINUTES = exports.ONE_MINUTE * 60; - exports.ONE_HOUR = exports.SIXTY_MINUTES; - exports.THREE_HOURS = exports.ONE_HOUR * 3; - exports.SIX_HOURS = exports.ONE_HOUR * 6; - exports.TWELVE_HOURS = exports.ONE_HOUR * 12; - exports.TWENTY_FOUR_HOURS = exports.ONE_HOUR * 24; - exports.ONE_DAY = exports.TWENTY_FOUR_HOURS; - exports.THREE_DAYS = exports.ONE_DAY * 3; - exports.FIVE_DAYS = exports.ONE_DAY * 5; - exports.SEVEN_DAYS = exports.ONE_DAY * 7; - exports.THIRTY_DAYS = exports.ONE_DAY * 30; - exports.ONE_WEEK = exports.SEVEN_DAYS; - exports.TWO_WEEKS = exports.ONE_WEEK * 2; - exports.THREE_WEEKS = exports.ONE_WEEK * 3; - exports.FOUR_WEEKS = exports.ONE_WEEK * 4; - exports.ONE_YEAR = exports.ONE_DAY * 365; - })(time); - return time; -} -var hasRequiredConstants; -function requireConstants() { - if (hasRequiredConstants) - return constants; - hasRequiredConstants = 1; - (function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - const tslib_1 = require$$0$1; - tslib_1.__exportStar(requireMisc(), exports); - tslib_1.__exportStar(requireTime(), exports); - })(constants); - return constants; -} -var hasRequiredConvert; -function requireConvert() { - if (hasRequiredConvert) - return convert; - hasRequiredConvert = 1; - Object.defineProperty(convert, "__esModule", { value: true }); - convert.fromMiliseconds = convert.toMiliseconds = void 0; - const constants_1 = requireConstants(); - function toMiliseconds(seconds) { - return seconds * constants_1.ONE_THOUSAND; - } - convert.toMiliseconds = toMiliseconds; - function fromMiliseconds(miliseconds) { - return Math.floor(miliseconds / constants_1.ONE_THOUSAND); - } - convert.fromMiliseconds = fromMiliseconds; - return convert; -} -var hasRequiredUtils; -function requireUtils() { - if (hasRequiredUtils) - return utils$d; - hasRequiredUtils = 1; - (function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - const tslib_1 = require$$0$1; - tslib_1.__exportStar(requireDelay(), exports); - tslib_1.__exportStar(requireConvert(), exports); - })(utils$d); - return utils$d; -} -var watch$2 = {}; -var hasRequiredWatch$1; -function requireWatch$1() { - if (hasRequiredWatch$1) - return watch$2; - hasRequiredWatch$1 = 1; - Object.defineProperty(watch$2, "__esModule", { value: true }); - watch$2.Watch = void 0; - class Watch { - constructor() { - this.timestamps = /* @__PURE__ */ new Map(); - } - start(label) { - if (this.timestamps.has(label)) { - throw new Error(`Watch already started for label: ${label}`); - } - this.timestamps.set(label, { started: Date.now() }); - } - stop(label) { - const timestamp = this.get(label); - if (typeof timestamp.elapsed !== "undefined") { - throw new Error(`Watch already stopped for label: ${label}`); - } - const elapsed = Date.now() - timestamp.started; - this.timestamps.set(label, { started: timestamp.started, elapsed }); - } - get(label) { - const timestamp = this.timestamps.get(label); - if (typeof timestamp === "undefined") { - throw new Error(`No timestamp found for label: ${label}`); - } - return timestamp; - } - elapsed(label) { - const timestamp = this.get(label); - const elapsed = timestamp.elapsed || Date.now() - timestamp.started; - return elapsed; - } - } - watch$2.Watch = Watch; - watch$2.default = Watch; - return watch$2; -} -var types = {}; -var watch$1 = {}; -var hasRequiredWatch; -function requireWatch() { - if (hasRequiredWatch) - return watch$1; - hasRequiredWatch = 1; - Object.defineProperty(watch$1, "__esModule", { value: true }); - watch$1.IWatch = void 0; - class IWatch { - } - watch$1.IWatch = IWatch; - return watch$1; -} -var hasRequiredTypes; -function requireTypes() { - if (hasRequiredTypes) - return types; - hasRequiredTypes = 1; - (function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - const tslib_1 = require$$0$1; - tslib_1.__exportStar(requireWatch(), exports); - })(types); - return types; -} -(function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - const tslib_1 = require$$0$1; - tslib_1.__exportStar(requireUtils(), exports); - tslib_1.__exportStar(requireWatch$1(), exports); - tslib_1.__exportStar(requireTypes(), exports); - tslib_1.__exportStar(requireConstants(), exports); -})(cjs$3); -var cjs$2 = {}; -Object.defineProperty(cjs$2, "__esModule", { value: true }); -cjs$2.getLocalStorage = cjs$2.getLocalStorageOrThrow = cjs$2.getCrypto = cjs$2.getCryptoOrThrow = getLocation_1 = cjs$2.getLocation = cjs$2.getLocationOrThrow = getNavigator_1 = cjs$2.getNavigator = cjs$2.getNavigatorOrThrow = getDocument_1 = cjs$2.getDocument = cjs$2.getDocumentOrThrow = cjs$2.getFromWindowOrThrow = cjs$2.getFromWindow = void 0; -function getFromWindow(name2) { - let res = void 0; - if (typeof window !== "undefined" && typeof window[name2] !== "undefined") { - res = window[name2]; - } - return res; -} -cjs$2.getFromWindow = getFromWindow; -function getFromWindowOrThrow(name2) { - const res = getFromWindow(name2); - if (!res) { - throw new Error(`${name2} is not defined in Window`); - } - return res; -} -cjs$2.getFromWindowOrThrow = getFromWindowOrThrow; -function getDocumentOrThrow() { - return getFromWindowOrThrow("document"); -} -cjs$2.getDocumentOrThrow = getDocumentOrThrow; -function getDocument() { - return getFromWindow("document"); -} -var getDocument_1 = cjs$2.getDocument = getDocument; -function getNavigatorOrThrow() { - return getFromWindowOrThrow("navigator"); -} -cjs$2.getNavigatorOrThrow = getNavigatorOrThrow; -function getNavigator() { - return getFromWindow("navigator"); -} -var getNavigator_1 = cjs$2.getNavigator = getNavigator; -function getLocationOrThrow() { - return getFromWindowOrThrow("location"); -} -cjs$2.getLocationOrThrow = getLocationOrThrow; -function getLocation() { - return getFromWindow("location"); -} -var getLocation_1 = cjs$2.getLocation = getLocation; -function getCryptoOrThrow() { - return getFromWindowOrThrow("crypto"); -} -cjs$2.getCryptoOrThrow = getCryptoOrThrow; -function getCrypto() { - return getFromWindow("crypto"); -} -cjs$2.getCrypto = getCrypto; -function getLocalStorageOrThrow() { - return getFromWindowOrThrow("localStorage"); -} -cjs$2.getLocalStorageOrThrow = getLocalStorageOrThrow; -function getLocalStorage() { - return getFromWindow("localStorage"); -} -cjs$2.getLocalStorage = getLocalStorage; -var cjs$1 = {}; -Object.defineProperty(cjs$1, "__esModule", { value: true }); -var getWindowMetadata_1 = cjs$1.getWindowMetadata = void 0; -const window_getters_1 = cjs$2; -function getWindowMetadata() { - let doc; - let loc; - try { - doc = window_getters_1.getDocumentOrThrow(); - loc = window_getters_1.getLocationOrThrow(); - } catch (e18) { - return null; - } - function getIcons() { - const links = doc.getElementsByTagName("link"); - const icons2 = []; - for (let i3 = 0; i3 < links.length; i3++) { - const link = links[i3]; - const rel = link.getAttribute("rel"); - if (rel) { - if (rel.toLowerCase().indexOf("icon") > -1) { - const href = link.getAttribute("href"); - if (href) { - if (href.toLowerCase().indexOf("https:") === -1 && href.toLowerCase().indexOf("http:") === -1 && href.indexOf("//") !== 0) { - let absoluteHref = loc.protocol + "//" + loc.host; - if (href.indexOf("/") === 0) { - absoluteHref += href; - } else { - const path = loc.pathname.split("/"); - path.pop(); - const finalPath = path.join("/"); - absoluteHref += finalPath + "/" + href; - } - icons2.push(absoluteHref); - } else if (href.indexOf("//") === 0) { - const absoluteUrl = loc.protocol + href; - icons2.push(absoluteUrl); - } else { - icons2.push(href); - } - } - } - } - } - return icons2; - } - function getWindowMetadataOfAny(...args) { - const metaTags = doc.getElementsByTagName("meta"); - for (let i3 = 0; i3 < metaTags.length; i3++) { - const tag = metaTags[i3]; - const attributes = ["itemprop", "property", "name"].map((target) => tag.getAttribute(target)).filter((attr) => { - if (attr) { - return args.includes(attr); - } - return false; - }); - if (attributes.length && attributes) { - const content = tag.getAttribute("content"); - if (content) { - return content; - } - } - } - return ""; - } - function getName() { - let name3 = getWindowMetadataOfAny("name", "og:site_name", "og:title", "twitter:title"); - if (!name3) { - name3 = doc.title; - } - return name3; - } - function getDescription() { - const description3 = getWindowMetadataOfAny("description", "og:description", "twitter:description", "keywords"); - return description3; - } - const name2 = getName(); - const description2 = getDescription(); - const url = loc.origin; - const icons = getIcons(); - const meta = { - description: description2, - url, - icons, - name: name2 - }; - return meta; -} -getWindowMetadata_1 = cjs$1.getWindowMetadata = getWindowMetadata; -var queryString = {}; -var strictUriEncode = (str) => encodeURIComponent(str).replace(/[!'()*]/g, (x3) => `%${x3.charCodeAt(0).toString(16).toUpperCase()}`); -var token = "%[a-f0-9]{2}"; -var singleMatcher = new RegExp("(" + token + ")|([^%]+?)", "gi"); -var multiMatcher = new RegExp("(" + token + ")+", "gi"); -function decodeComponents(components, split2) { - try { - return [decodeURIComponent(components.join(""))]; - } catch (err) { - } - if (components.length === 1) { - return components; - } - split2 = split2 || 1; - var left = components.slice(0, split2); - var right = components.slice(split2); - return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); -} -function decode$2(input) { - try { - return decodeURIComponent(input); - } catch (err) { - var tokens = input.match(singleMatcher) || []; - for (var i3 = 1; i3 < tokens.length; i3++) { - input = decodeComponents(tokens, i3).join(""); - tokens = input.match(singleMatcher) || []; - } - return input; - } -} -function customDecodeURIComponent(input) { - var replaceMap = { - "%FE%FF": "��", - "%FF%FE": "��" - }; - var match = multiMatcher.exec(input); - while (match) { - try { - replaceMap[match[0]] = decodeURIComponent(match[0]); - } catch (err) { - var result = decode$2(match[0]); - if (result !== match[0]) { - replaceMap[match[0]] = result; - } - } - match = multiMatcher.exec(input); - } - replaceMap["%C2"] = "�"; - var entries = Object.keys(replaceMap); - for (var i3 = 0; i3 < entries.length; i3++) { - var key2 = entries[i3]; - input = input.replace(new RegExp(key2, "g"), replaceMap[key2]); - } - return input; -} -var decodeUriComponent = function(encodedURI) { - if (typeof encodedURI !== "string") { - throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof encodedURI + "`"); - } - try { - encodedURI = encodedURI.replace(/\+/g, " "); - return decodeURIComponent(encodedURI); - } catch (err) { - return customDecodeURIComponent(encodedURI); - } -}; -var splitOnFirst = (string2, separator) => { - if (!(typeof string2 === "string" && typeof separator === "string")) { - throw new TypeError("Expected the arguments to be of type `string`"); - } - if (separator === "") { - return [string2]; - } - const separatorIndex = string2.indexOf(separator); - if (separatorIndex === -1) { - return [string2]; - } - return [ - string2.slice(0, separatorIndex), - string2.slice(separatorIndex + separator.length) - ]; -}; -var filterObj = function(obj, predicate) { - var ret = {}; - var keys2 = Object.keys(obj); - var isArr = Array.isArray(predicate); - for (var i3 = 0; i3 < keys2.length; i3++) { - var key2 = keys2[i3]; - var val = obj[key2]; - if (isArr ? predicate.indexOf(key2) !== -1 : predicate(key2, val, obj)) { - ret[key2] = val; - } - } - return ret; -}; -(function(exports) { - const strictUriEncode$1 = strictUriEncode; - const decodeComponent = decodeUriComponent; - const splitOnFirst$1 = splitOnFirst; - const filterObject = filterObj; - const isNullOrUndefined = (value) => value === null || value === void 0; - const encodeFragmentIdentifier = Symbol("encodeFragmentIdentifier"); - function encoderForArrayFormat(options) { - switch (options.arrayFormat) { - case "index": - return (key2) => (result, value) => { - const index2 = result.length; - if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { - return result; - } - if (value === null) { - return [...result, [encode5(key2, options), "[", index2, "]"].join("")]; - } - return [ - ...result, - [encode5(key2, options), "[", encode5(index2, options), "]=", encode5(value, options)].join("") - ]; - }; - case "bracket": - return (key2) => (result, value) => { - if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { - return result; - } - if (value === null) { - return [...result, [encode5(key2, options), "[]"].join("")]; - } - return [...result, [encode5(key2, options), "[]=", encode5(value, options)].join("")]; - }; - case "colon-list-separator": - return (key2) => (result, value) => { - if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { - return result; - } - if (value === null) { - return [...result, [encode5(key2, options), ":list="].join("")]; - } - return [...result, [encode5(key2, options), ":list=", encode5(value, options)].join("")]; - }; - case "comma": - case "separator": - case "bracket-separator": { - const keyValueSep = options.arrayFormat === "bracket-separator" ? "[]=" : "="; - return (key2) => (result, value) => { - if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { - return result; - } - value = value === null ? "" : value; - if (result.length === 0) { - return [[encode5(key2, options), keyValueSep, encode5(value, options)].join("")]; - } - return [[result, encode5(value, options)].join(options.arrayFormatSeparator)]; - }; - } - default: - return (key2) => (result, value) => { - if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { - return result; - } - if (value === null) { - return [...result, encode5(key2, options)]; - } - return [...result, [encode5(key2, options), "=", encode5(value, options)].join("")]; - }; - } - } - function parserForArrayFormat(options) { - let result; - switch (options.arrayFormat) { - case "index": - return (key2, value, accumulator) => { - result = /\[(\d*)\]$/.exec(key2); - key2 = key2.replace(/\[\d*\]$/, ""); - if (!result) { - accumulator[key2] = value; - return; - } - if (accumulator[key2] === void 0) { - accumulator[key2] = {}; - } - accumulator[key2][result[1]] = value; - }; - case "bracket": - return (key2, value, accumulator) => { - result = /(\[\])$/.exec(key2); - key2 = key2.replace(/\[\]$/, ""); - if (!result) { - accumulator[key2] = value; - return; - } - if (accumulator[key2] === void 0) { - accumulator[key2] = [value]; - return; - } - accumulator[key2] = [].concat(accumulator[key2], value); - }; - case "colon-list-separator": - return (key2, value, accumulator) => { - result = /(:list)$/.exec(key2); - key2 = key2.replace(/:list$/, ""); - if (!result) { - accumulator[key2] = value; - return; - } - if (accumulator[key2] === void 0) { - accumulator[key2] = [value]; - return; - } - accumulator[key2] = [].concat(accumulator[key2], value); - }; - case "comma": - case "separator": - return (key2, value, accumulator) => { - const isArray2 = typeof value === "string" && value.includes(options.arrayFormatSeparator); - const isEncodedArray = typeof value === "string" && !isArray2 && decode3(value, options).includes(options.arrayFormatSeparator); - value = isEncodedArray ? decode3(value, options) : value; - const newValue = isArray2 || isEncodedArray ? value.split(options.arrayFormatSeparator).map((item) => decode3(item, options)) : value === null ? value : decode3(value, options); - accumulator[key2] = newValue; - }; - case "bracket-separator": - return (key2, value, accumulator) => { - const isArray2 = /(\[\])$/.test(key2); - key2 = key2.replace(/\[\]$/, ""); - if (!isArray2) { - accumulator[key2] = value ? decode3(value, options) : value; - return; - } - const arrayValue = value === null ? [] : value.split(options.arrayFormatSeparator).map((item) => decode3(item, options)); - if (accumulator[key2] === void 0) { - accumulator[key2] = arrayValue; - return; - } - accumulator[key2] = [].concat(accumulator[key2], arrayValue); - }; - default: - return (key2, value, accumulator) => { - if (accumulator[key2] === void 0) { - accumulator[key2] = value; - return; - } - accumulator[key2] = [].concat(accumulator[key2], value); - }; - } - } - function validateArrayFormatSeparator(value) { - if (typeof value !== "string" || value.length !== 1) { - throw new TypeError("arrayFormatSeparator must be single character string"); - } - } - function encode5(value, options) { - if (options.encode) { - return options.strict ? strictUriEncode$1(value) : encodeURIComponent(value); - } - return value; - } - function decode3(value, options) { - if (options.decode) { - return decodeComponent(value); - } - return value; - } - function keysSorter(input) { - if (Array.isArray(input)) { - return input.sort(); - } - if (typeof input === "object") { - return keysSorter(Object.keys(input)).sort((a3, b2) => Number(a3) - Number(b2)).map((key2) => input[key2]); - } - return input; - } - function removeHash(input) { - const hashStart = input.indexOf("#"); - if (hashStart !== -1) { - input = input.slice(0, hashStart); - } - return input; - } - function getHash2(url) { - let hash3 = ""; - const hashStart = url.indexOf("#"); - if (hashStart !== -1) { - hash3 = url.slice(hashStart); - } - return hash3; - } - function extract(input) { - input = removeHash(input); - const queryStart = input.indexOf("?"); - if (queryStart === -1) { - return ""; - } - return input.slice(queryStart + 1); - } - function parseValue(value, options) { - if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === "string" && value.trim() !== "")) { - value = Number(value); - } else if (options.parseBooleans && value !== null && (value.toLowerCase() === "true" || value.toLowerCase() === "false")) { - value = value.toLowerCase() === "true"; - } - return value; - } - function parse2(query, options) { - options = Object.assign({ - decode: true, - sort: true, - arrayFormat: "none", - arrayFormatSeparator: ",", - parseNumbers: false, - parseBooleans: false - }, options); - validateArrayFormatSeparator(options.arrayFormatSeparator); - const formatter = parserForArrayFormat(options); - const ret = /* @__PURE__ */ Object.create(null); - if (typeof query !== "string") { - return ret; - } - query = query.trim().replace(/^[?#&]/, ""); - if (!query) { - return ret; - } - for (const param of query.split("&")) { - if (param === "") { - continue; - } - let [key2, value] = splitOnFirst$1(options.decode ? param.replace(/\+/g, " ") : param, "="); - value = value === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(options.arrayFormat) ? value : decode3(value, options); - formatter(decode3(key2, options), value, ret); - } - for (const key2 of Object.keys(ret)) { - const value = ret[key2]; - if (typeof value === "object" && value !== null) { - for (const k2 of Object.keys(value)) { - value[k2] = parseValue(value[k2], options); - } - } else { - ret[key2] = parseValue(value, options); - } - } - if (options.sort === false) { - return ret; - } - return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key2) => { - const value = ret[key2]; - if (Boolean(value) && typeof value === "object" && !Array.isArray(value)) { - result[key2] = keysSorter(value); - } else { - result[key2] = value; - } - return result; - }, /* @__PURE__ */ Object.create(null)); - } - exports.extract = extract; - exports.parse = parse2; - exports.stringify = (object, options) => { - if (!object) { - return ""; - } - options = Object.assign({ - encode: true, - strict: true, - arrayFormat: "none", - arrayFormatSeparator: "," - }, options); - validateArrayFormatSeparator(options.arrayFormatSeparator); - const shouldFilter = (key2) => options.skipNull && isNullOrUndefined(object[key2]) || options.skipEmptyString && object[key2] === ""; - const formatter = encoderForArrayFormat(options); - const objectCopy = {}; - for (const key2 of Object.keys(object)) { - if (!shouldFilter(key2)) { - objectCopy[key2] = object[key2]; - } - } - const keys2 = Object.keys(objectCopy); - if (options.sort !== false) { - keys2.sort(options.sort); - } - return keys2.map((key2) => { - const value = object[key2]; - if (value === void 0) { - return ""; - } - if (value === null) { - return encode5(key2, options); - } - if (Array.isArray(value)) { - if (value.length === 0 && options.arrayFormat === "bracket-separator") { - return encode5(key2, options) + "[]"; - } - return value.reduce(formatter(key2), []).join("&"); - } - return encode5(key2, options) + "=" + encode5(value, options); - }).filter((x3) => x3.length > 0).join("&"); - }; - exports.parseUrl = (url, options) => { - options = Object.assign({ - decode: true - }, options); - const [url_, hash3] = splitOnFirst$1(url, "#"); - return Object.assign( - { - url: url_.split("?")[0] || "", - query: parse2(extract(url), options) - }, - options && options.parseFragmentIdentifier && hash3 ? { fragmentIdentifier: decode3(hash3, options) } : {} - ); - }; - exports.stringifyUrl = (object, options) => { - options = Object.assign({ - encode: true, - strict: true, - [encodeFragmentIdentifier]: true - }, options); - const url = removeHash(object.url).split("?")[0] || ""; - const queryFromUrl = exports.extract(object.url); - const parsedQueryFromUrl = exports.parse(queryFromUrl, { sort: false }); - const query = Object.assign(parsedQueryFromUrl, object.query); - let queryString2 = exports.stringify(query, options); - if (queryString2) { - queryString2 = `?${queryString2}`; - } - let hash3 = getHash2(object.url); - if (object.fragmentIdentifier) { - hash3 = `#${options[encodeFragmentIdentifier] ? encode5(object.fragmentIdentifier, options) : object.fragmentIdentifier}`; - } - return `${url}${queryString2}${hash3}`; - }; - exports.pick = (input, filter2, options) => { - options = Object.assign({ - parseFragmentIdentifier: true, - [encodeFragmentIdentifier]: false - }, options); - const { url, query, fragmentIdentifier } = exports.parseUrl(input, options); - return exports.stringifyUrl({ - url, - query: filterObject(query, filter2), - fragmentIdentifier - }, options); - }; - exports.exclude = (input, filter2, options) => { - const exclusionFilter = Array.isArray(filter2) ? (key2) => !filter2.includes(key2) : (key2, value) => !filter2(key2, value); - return exports.pick(input, exclusionFilter, options); - }; -})(queryString); -var chacha20poly1305 = {}; -var chacha = {}; -var binary = {}; -var int = {}; -(function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - function imulShim(a3, b2) { - var ah2 = a3 >>> 16 & 65535, al2 = a3 & 65535; - var bh2 = b2 >>> 16 & 65535, bl2 = b2 & 65535; - return al2 * bl2 + (ah2 * bl2 + al2 * bh2 << 16 >>> 0) | 0; - } - exports.mul = Math.imul || imulShim; - function add6(a3, b2) { - return a3 + b2 | 0; - } - exports.add = add6; - function sub(a3, b2) { - return a3 - b2 | 0; - } - exports.sub = sub; - function rotl2(x3, n4) { - return x3 << n4 | x3 >>> 32 - n4; - } - exports.rotl = rotl2; - function rotr2(x3, n4) { - return x3 << 32 - n4 | x3 >>> n4; - } - exports.rotr = rotr2; - function isIntegerShim(n4) { - return typeof n4 === "number" && isFinite(n4) && Math.floor(n4) === n4; - } - exports.isInteger = Number.isInteger || isIntegerShim; - exports.MAX_SAFE_INTEGER = 9007199254740991; - exports.isSafeInteger = function(n4) { - return exports.isInteger(n4) && (n4 >= -exports.MAX_SAFE_INTEGER && n4 <= exports.MAX_SAFE_INTEGER); - }; -})(int); -Object.defineProperty(binary, "__esModule", { value: true }); -var int_1 = int; -function readInt16BE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - return (array2[offset2 + 0] << 8 | array2[offset2 + 1]) << 16 >> 16; -} -binary.readInt16BE = readInt16BE; -function readUint16BE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - return (array2[offset2 + 0] << 8 | array2[offset2 + 1]) >>> 0; -} -binary.readUint16BE = readUint16BE; -function readInt16LE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - return (array2[offset2 + 1] << 8 | array2[offset2]) << 16 >> 16; -} -binary.readInt16LE = readInt16LE; -function readUint16LE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - return (array2[offset2 + 1] << 8 | array2[offset2]) >>> 0; -} -binary.readUint16LE = readUint16LE; -function writeUint16BE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(2); - } - if (offset2 === void 0) { - offset2 = 0; - } - out[offset2 + 0] = value >>> 8; - out[offset2 + 1] = value >>> 0; - return out; -} -binary.writeUint16BE = writeUint16BE; -binary.writeInt16BE = writeUint16BE; -function writeUint16LE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(2); - } - if (offset2 === void 0) { - offset2 = 0; - } - out[offset2 + 0] = value >>> 0; - out[offset2 + 1] = value >>> 8; - return out; -} -binary.writeUint16LE = writeUint16LE; -binary.writeInt16LE = writeUint16LE; -function readInt32BE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - return array2[offset2] << 24 | array2[offset2 + 1] << 16 | array2[offset2 + 2] << 8 | array2[offset2 + 3]; -} -binary.readInt32BE = readInt32BE; -function readUint32BE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - return (array2[offset2] << 24 | array2[offset2 + 1] << 16 | array2[offset2 + 2] << 8 | array2[offset2 + 3]) >>> 0; -} -binary.readUint32BE = readUint32BE; -function readInt32LE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - return array2[offset2 + 3] << 24 | array2[offset2 + 2] << 16 | array2[offset2 + 1] << 8 | array2[offset2]; -} -binary.readInt32LE = readInt32LE; -function readUint32LE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - return (array2[offset2 + 3] << 24 | array2[offset2 + 2] << 16 | array2[offset2 + 1] << 8 | array2[offset2]) >>> 0; -} -binary.readUint32LE = readUint32LE; -function writeUint32BE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(4); - } - if (offset2 === void 0) { - offset2 = 0; - } - out[offset2 + 0] = value >>> 24; - out[offset2 + 1] = value >>> 16; - out[offset2 + 2] = value >>> 8; - out[offset2 + 3] = value >>> 0; - return out; -} -binary.writeUint32BE = writeUint32BE; -binary.writeInt32BE = writeUint32BE; -function writeUint32LE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(4); - } - if (offset2 === void 0) { - offset2 = 0; - } - out[offset2 + 0] = value >>> 0; - out[offset2 + 1] = value >>> 8; - out[offset2 + 2] = value >>> 16; - out[offset2 + 3] = value >>> 24; - return out; -} -binary.writeUint32LE = writeUint32LE; -binary.writeInt32LE = writeUint32LE; -function readInt64BE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - var hi2 = readInt32BE(array2, offset2); - var lo2 = readInt32BE(array2, offset2 + 4); - return hi2 * 4294967296 + lo2 - (lo2 >> 31) * 4294967296; -} -binary.readInt64BE = readInt64BE; -function readUint64BE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - var hi2 = readUint32BE(array2, offset2); - var lo2 = readUint32BE(array2, offset2 + 4); - return hi2 * 4294967296 + lo2; -} -binary.readUint64BE = readUint64BE; -function readInt64LE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - var lo2 = readInt32LE(array2, offset2); - var hi2 = readInt32LE(array2, offset2 + 4); - return hi2 * 4294967296 + lo2 - (lo2 >> 31) * 4294967296; -} -binary.readInt64LE = readInt64LE; -function readUint64LE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - var lo2 = readUint32LE(array2, offset2); - var hi2 = readUint32LE(array2, offset2 + 4); - return hi2 * 4294967296 + lo2; -} -binary.readUint64LE = readUint64LE; -function writeUint64BE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(8); - } - if (offset2 === void 0) { - offset2 = 0; - } - writeUint32BE(value / 4294967296 >>> 0, out, offset2); - writeUint32BE(value >>> 0, out, offset2 + 4); - return out; -} -binary.writeUint64BE = writeUint64BE; -binary.writeInt64BE = writeUint64BE; -function writeUint64LE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(8); - } - if (offset2 === void 0) { - offset2 = 0; - } - writeUint32LE(value >>> 0, out, offset2); - writeUint32LE(value / 4294967296 >>> 0, out, offset2 + 4); - return out; -} -binary.writeUint64LE = writeUint64LE; -binary.writeInt64LE = writeUint64LE; -function readUintBE(bitLength, array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - if (bitLength % 8 !== 0) { - throw new Error("readUintBE supports only bitLengths divisible by 8"); - } - if (bitLength / 8 > array2.length - offset2) { - throw new Error("readUintBE: array is too short for the given bitLength"); - } - var result = 0; - var mul6 = 1; - for (var i3 = bitLength / 8 + offset2 - 1; i3 >= offset2; i3--) { - result += array2[i3] * mul6; - mul6 *= 256; - } - return result; -} -binary.readUintBE = readUintBE; -function readUintLE(bitLength, array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - if (bitLength % 8 !== 0) { - throw new Error("readUintLE supports only bitLengths divisible by 8"); - } - if (bitLength / 8 > array2.length - offset2) { - throw new Error("readUintLE: array is too short for the given bitLength"); - } - var result = 0; - var mul6 = 1; - for (var i3 = offset2; i3 < offset2 + bitLength / 8; i3++) { - result += array2[i3] * mul6; - mul6 *= 256; - } - return result; -} -binary.readUintLE = readUintLE; -function writeUintBE(bitLength, value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(bitLength / 8); - } - if (offset2 === void 0) { - offset2 = 0; - } - if (bitLength % 8 !== 0) { - throw new Error("writeUintBE supports only bitLengths divisible by 8"); - } - if (!int_1.isSafeInteger(value)) { - throw new Error("writeUintBE value must be an integer"); - } - var div = 1; - for (var i3 = bitLength / 8 + offset2 - 1; i3 >= offset2; i3--) { - out[i3] = value / div & 255; - div *= 256; - } - return out; -} -binary.writeUintBE = writeUintBE; -function writeUintLE(bitLength, value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(bitLength / 8); - } - if (offset2 === void 0) { - offset2 = 0; - } - if (bitLength % 8 !== 0) { - throw new Error("writeUintLE supports only bitLengths divisible by 8"); - } - if (!int_1.isSafeInteger(value)) { - throw new Error("writeUintLE value must be an integer"); - } - var div = 1; - for (var i3 = offset2; i3 < offset2 + bitLength / 8; i3++) { - out[i3] = value / div & 255; - div *= 256; - } - return out; -} -binary.writeUintLE = writeUintLE; -function readFloat32BE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); - return view.getFloat32(offset2); -} -binary.readFloat32BE = readFloat32BE; -function readFloat32LE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); - return view.getFloat32(offset2, true); -} -binary.readFloat32LE = readFloat32LE; -function readFloat64BE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); - return view.getFloat64(offset2); -} -binary.readFloat64BE = readFloat64BE; -function readFloat64LE(array2, offset2) { - if (offset2 === void 0) { - offset2 = 0; - } - var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); - return view.getFloat64(offset2, true); -} -binary.readFloat64LE = readFloat64LE; -function writeFloat32BE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(4); - } - if (offset2 === void 0) { - offset2 = 0; - } - var view = new DataView(out.buffer, out.byteOffset, out.byteLength); - view.setFloat32(offset2, value); - return out; -} -binary.writeFloat32BE = writeFloat32BE; -function writeFloat32LE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(4); - } - if (offset2 === void 0) { - offset2 = 0; - } - var view = new DataView(out.buffer, out.byteOffset, out.byteLength); - view.setFloat32(offset2, value, true); - return out; -} -binary.writeFloat32LE = writeFloat32LE; -function writeFloat64BE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(8); - } - if (offset2 === void 0) { - offset2 = 0; - } - var view = new DataView(out.buffer, out.byteOffset, out.byteLength); - view.setFloat64(offset2, value); - return out; -} -binary.writeFloat64BE = writeFloat64BE; -function writeFloat64LE(value, out, offset2) { - if (out === void 0) { - out = new Uint8Array(8); - } - if (offset2 === void 0) { - offset2 = 0; - } - var view = new DataView(out.buffer, out.byteOffset, out.byteLength); - view.setFloat64(offset2, value, true); - return out; -} -binary.writeFloat64LE = writeFloat64LE; -var wipe$1 = {}; -Object.defineProperty(wipe$1, "__esModule", { value: true }); -function wipe(array2) { - for (var i3 = 0; i3 < array2.length; i3++) { - array2[i3] = 0; - } - return array2; -} -wipe$1.wipe = wipe; -Object.defineProperty(chacha, "__esModule", { value: true }); -var binary_1 = binary; -var wipe_1$3 = wipe$1; -var ROUNDS = 20; -function core(out, input, key2) { - var j02 = 1634760805; - var j1 = 857760878; - var j2 = 2036477234; - var j3 = 1797285236; - var j4 = key2[3] << 24 | key2[2] << 16 | key2[1] << 8 | key2[0]; - var j5 = key2[7] << 24 | key2[6] << 16 | key2[5] << 8 | key2[4]; - var j6 = key2[11] << 24 | key2[10] << 16 | key2[9] << 8 | key2[8]; - var j7 = key2[15] << 24 | key2[14] << 16 | key2[13] << 8 | key2[12]; - var j8 = key2[19] << 24 | key2[18] << 16 | key2[17] << 8 | key2[16]; - var j9 = key2[23] << 24 | key2[22] << 16 | key2[21] << 8 | key2[20]; - var j10 = key2[27] << 24 | key2[26] << 16 | key2[25] << 8 | key2[24]; - var j11 = key2[31] << 24 | key2[30] << 16 | key2[29] << 8 | key2[28]; - var j12 = input[3] << 24 | input[2] << 16 | input[1] << 8 | input[0]; - var j13 = input[7] << 24 | input[6] << 16 | input[5] << 8 | input[4]; - var j14 = input[11] << 24 | input[10] << 16 | input[9] << 8 | input[8]; - var j15 = input[15] << 24 | input[14] << 16 | input[13] << 8 | input[12]; - var x02 = j02; - var x1 = j1; - var x22 = j2; - var x3 = j3; - var x4 = j4; - var x5 = j5; - var x6 = j6; - var x7 = j7; - var x8 = j8; - var x9 = j9; - var x10 = j10; - var x11 = j11; - var x12 = j12; - var x13 = j13; - var x14 = j14; - var x15 = j15; - for (var i3 = 0; i3 < ROUNDS; i3 += 2) { - x02 = x02 + x4 | 0; - x12 ^= x02; - x12 = x12 >>> 32 - 16 | x12 << 16; - x8 = x8 + x12 | 0; - x4 ^= x8; - x4 = x4 >>> 32 - 12 | x4 << 12; - x1 = x1 + x5 | 0; - x13 ^= x1; - x13 = x13 >>> 32 - 16 | x13 << 16; - x9 = x9 + x13 | 0; - x5 ^= x9; - x5 = x5 >>> 32 - 12 | x5 << 12; - x22 = x22 + x6 | 0; - x14 ^= x22; - x14 = x14 >>> 32 - 16 | x14 << 16; - x10 = x10 + x14 | 0; - x6 ^= x10; - x6 = x6 >>> 32 - 12 | x6 << 12; - x3 = x3 + x7 | 0; - x15 ^= x3; - x15 = x15 >>> 32 - 16 | x15 << 16; - x11 = x11 + x15 | 0; - x7 ^= x11; - x7 = x7 >>> 32 - 12 | x7 << 12; - x22 = x22 + x6 | 0; - x14 ^= x22; - x14 = x14 >>> 32 - 8 | x14 << 8; - x10 = x10 + x14 | 0; - x6 ^= x10; - x6 = x6 >>> 32 - 7 | x6 << 7; - x3 = x3 + x7 | 0; - x15 ^= x3; - x15 = x15 >>> 32 - 8 | x15 << 8; - x11 = x11 + x15 | 0; - x7 ^= x11; - x7 = x7 >>> 32 - 7 | x7 << 7; - x1 = x1 + x5 | 0; - x13 ^= x1; - x13 = x13 >>> 32 - 8 | x13 << 8; - x9 = x9 + x13 | 0; - x5 ^= x9; - x5 = x5 >>> 32 - 7 | x5 << 7; - x02 = x02 + x4 | 0; - x12 ^= x02; - x12 = x12 >>> 32 - 8 | x12 << 8; - x8 = x8 + x12 | 0; - x4 ^= x8; - x4 = x4 >>> 32 - 7 | x4 << 7; - x02 = x02 + x5 | 0; - x15 ^= x02; - x15 = x15 >>> 32 - 16 | x15 << 16; - x10 = x10 + x15 | 0; - x5 ^= x10; - x5 = x5 >>> 32 - 12 | x5 << 12; - x1 = x1 + x6 | 0; - x12 ^= x1; - x12 = x12 >>> 32 - 16 | x12 << 16; - x11 = x11 + x12 | 0; - x6 ^= x11; - x6 = x6 >>> 32 - 12 | x6 << 12; - x22 = x22 + x7 | 0; - x13 ^= x22; - x13 = x13 >>> 32 - 16 | x13 << 16; - x8 = x8 + x13 | 0; - x7 ^= x8; - x7 = x7 >>> 32 - 12 | x7 << 12; - x3 = x3 + x4 | 0; - x14 ^= x3; - x14 = x14 >>> 32 - 16 | x14 << 16; - x9 = x9 + x14 | 0; - x4 ^= x9; - x4 = x4 >>> 32 - 12 | x4 << 12; - x22 = x22 + x7 | 0; - x13 ^= x22; - x13 = x13 >>> 32 - 8 | x13 << 8; - x8 = x8 + x13 | 0; - x7 ^= x8; - x7 = x7 >>> 32 - 7 | x7 << 7; - x3 = x3 + x4 | 0; - x14 ^= x3; - x14 = x14 >>> 32 - 8 | x14 << 8; - x9 = x9 + x14 | 0; - x4 ^= x9; - x4 = x4 >>> 32 - 7 | x4 << 7; - x1 = x1 + x6 | 0; - x12 ^= x1; - x12 = x12 >>> 32 - 8 | x12 << 8; - x11 = x11 + x12 | 0; - x6 ^= x11; - x6 = x6 >>> 32 - 7 | x6 << 7; - x02 = x02 + x5 | 0; - x15 ^= x02; - x15 = x15 >>> 32 - 8 | x15 << 8; - x10 = x10 + x15 | 0; - x5 ^= x10; - x5 = x5 >>> 32 - 7 | x5 << 7; - } - binary_1.writeUint32LE(x02 + j02 | 0, out, 0); - binary_1.writeUint32LE(x1 + j1 | 0, out, 4); - binary_1.writeUint32LE(x22 + j2 | 0, out, 8); - binary_1.writeUint32LE(x3 + j3 | 0, out, 12); - binary_1.writeUint32LE(x4 + j4 | 0, out, 16); - binary_1.writeUint32LE(x5 + j5 | 0, out, 20); - binary_1.writeUint32LE(x6 + j6 | 0, out, 24); - binary_1.writeUint32LE(x7 + j7 | 0, out, 28); - binary_1.writeUint32LE(x8 + j8 | 0, out, 32); - binary_1.writeUint32LE(x9 + j9 | 0, out, 36); - binary_1.writeUint32LE(x10 + j10 | 0, out, 40); - binary_1.writeUint32LE(x11 + j11 | 0, out, 44); - binary_1.writeUint32LE(x12 + j12 | 0, out, 48); - binary_1.writeUint32LE(x13 + j13 | 0, out, 52); - binary_1.writeUint32LE(x14 + j14 | 0, out, 56); - binary_1.writeUint32LE(x15 + j15 | 0, out, 60); -} -function streamXOR(key2, nonce, src2, dst, nonceInplaceCounterLength) { - if (nonceInplaceCounterLength === void 0) { - nonceInplaceCounterLength = 0; - } - if (key2.length !== 32) { - throw new Error("ChaCha: key size must be 32 bytes"); - } - if (dst.length < src2.length) { - throw new Error("ChaCha: destination is shorter than source"); - } - var nc2; - var counterLength; - if (nonceInplaceCounterLength === 0) { - if (nonce.length !== 8 && nonce.length !== 12) { - throw new Error("ChaCha nonce must be 8 or 12 bytes"); - } - nc2 = new Uint8Array(16); - counterLength = nc2.length - nonce.length; - nc2.set(nonce, counterLength); - } else { - if (nonce.length !== 16) { - throw new Error("ChaCha nonce with counter must be 16 bytes"); - } - nc2 = nonce; - counterLength = nonceInplaceCounterLength; - } - var block = new Uint8Array(64); - for (var i3 = 0; i3 < src2.length; i3 += 64) { - core(block, nc2, key2); - for (var j2 = i3; j2 < i3 + 64 && j2 < src2.length; j2++) { - dst[j2] = src2[j2] ^ block[j2 - i3]; - } - incrementCounter(nc2, 0, counterLength); - } - wipe_1$3.wipe(block); - if (nonceInplaceCounterLength === 0) { - wipe_1$3.wipe(nc2); - } - return dst; -} -chacha.streamXOR = streamXOR; -function stream(key2, nonce, dst, nonceInplaceCounterLength) { - if (nonceInplaceCounterLength === void 0) { - nonceInplaceCounterLength = 0; - } - wipe_1$3.wipe(dst); - return streamXOR(key2, nonce, dst, dst, nonceInplaceCounterLength); -} -chacha.stream = stream; -function incrementCounter(counter, pos, len) { - var carry = 1; - while (len--) { - carry = carry + (counter[pos] & 255) | 0; - counter[pos] = carry & 255; - carry >>>= 8; - pos++; - } - if (carry > 0) { - throw new Error("ChaCha: counter overflow"); - } -} -var poly1305 = {}; -var constantTime = {}; -Object.defineProperty(constantTime, "__esModule", { value: true }); -function select(subject, resultIfOne, resultIfZero) { - return ~(subject - 1) & resultIfOne | subject - 1 & resultIfZero; -} -constantTime.select = select; -function lessOrEqual(a3, b2) { - return (a3 | 0) - (b2 | 0) - 1 >>> 31 & 1; -} -constantTime.lessOrEqual = lessOrEqual; -function compare(a3, b2) { - if (a3.length !== b2.length) { - return 0; - } - var result = 0; - for (var i3 = 0; i3 < a3.length; i3++) { - result |= a3[i3] ^ b2[i3]; - } - return 1 & result - 1 >>> 8; -} -constantTime.compare = compare; -function equal(a3, b2) { - if (a3.length === 0 || b2.length === 0) { - return false; - } - return compare(a3, b2) !== 0; -} -constantTime.equal = equal; -(function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - var constant_time_12 = constantTime; - var wipe_12 = wipe$1; - exports.DIGEST_LENGTH = 16; - var Poly1305 = ( - /** @class */ - function() { - function Poly13052(key2) { - this.digestLength = exports.DIGEST_LENGTH; - this._buffer = new Uint8Array(16); - this._r = new Uint16Array(10); - this._h = new Uint16Array(10); - this._pad = new Uint16Array(8); - this._leftover = 0; - this._fin = 0; - this._finished = false; - var t02 = key2[0] | key2[1] << 8; - this._r[0] = t02 & 8191; - var t1 = key2[2] | key2[3] << 8; - this._r[1] = (t02 >>> 13 | t1 << 3) & 8191; - var t2 = key2[4] | key2[5] << 8; - this._r[2] = (t1 >>> 10 | t2 << 6) & 7939; - var t3 = key2[6] | key2[7] << 8; - this._r[3] = (t2 >>> 7 | t3 << 9) & 8191; - var t4 = key2[8] | key2[9] << 8; - this._r[4] = (t3 >>> 4 | t4 << 12) & 255; - this._r[5] = t4 >>> 1 & 8190; - var t5 = key2[10] | key2[11] << 8; - this._r[6] = (t4 >>> 14 | t5 << 2) & 8191; - var t6 = key2[12] | key2[13] << 8; - this._r[7] = (t5 >>> 11 | t6 << 5) & 8065; - var t7 = key2[14] | key2[15] << 8; - this._r[8] = (t6 >>> 8 | t7 << 8) & 8191; - this._r[9] = t7 >>> 5 & 127; - this._pad[0] = key2[16] | key2[17] << 8; - this._pad[1] = key2[18] | key2[19] << 8; - this._pad[2] = key2[20] | key2[21] << 8; - this._pad[3] = key2[22] | key2[23] << 8; - this._pad[4] = key2[24] | key2[25] << 8; - this._pad[5] = key2[26] | key2[27] << 8; - this._pad[6] = key2[28] | key2[29] << 8; - this._pad[7] = key2[30] | key2[31] << 8; - } - Poly13052.prototype._blocks = function(m3, mpos, bytes2) { - var hibit = this._fin ? 0 : 1 << 11; - var h0 = this._h[0], h1 = this._h[1], h22 = this._h[2], h32 = this._h[3], h4 = this._h[4], h5 = this._h[5], h6 = this._h[6], h7 = this._h[7], h8 = this._h[8], h9 = this._h[9]; - var r02 = this._r[0], r1 = this._r[1], r2 = this._r[2], r3 = this._r[3], r4 = this._r[4], r5 = this._r[5], r6 = this._r[6], r7 = this._r[7], r8 = this._r[8], r9 = this._r[9]; - while (bytes2 >= 16) { - var t02 = m3[mpos + 0] | m3[mpos + 1] << 8; - h0 += t02 & 8191; - var t1 = m3[mpos + 2] | m3[mpos + 3] << 8; - h1 += (t02 >>> 13 | t1 << 3) & 8191; - var t2 = m3[mpos + 4] | m3[mpos + 5] << 8; - h22 += (t1 >>> 10 | t2 << 6) & 8191; - var t3 = m3[mpos + 6] | m3[mpos + 7] << 8; - h32 += (t2 >>> 7 | t3 << 9) & 8191; - var t4 = m3[mpos + 8] | m3[mpos + 9] << 8; - h4 += (t3 >>> 4 | t4 << 12) & 8191; - h5 += t4 >>> 1 & 8191; - var t5 = m3[mpos + 10] | m3[mpos + 11] << 8; - h6 += (t4 >>> 14 | t5 << 2) & 8191; - var t6 = m3[mpos + 12] | m3[mpos + 13] << 8; - h7 += (t5 >>> 11 | t6 << 5) & 8191; - var t7 = m3[mpos + 14] | m3[mpos + 15] << 8; - h8 += (t6 >>> 8 | t7 << 8) & 8191; - h9 += t7 >>> 5 | hibit; - var c2 = 0; - var d02 = c2; - d02 += h0 * r02; - d02 += h1 * (5 * r9); - d02 += h22 * (5 * r8); - d02 += h32 * (5 * r7); - d02 += h4 * (5 * r6); - c2 = d02 >>> 13; - d02 &= 8191; - d02 += h5 * (5 * r5); - d02 += h6 * (5 * r4); - d02 += h7 * (5 * r3); - d02 += h8 * (5 * r2); - d02 += h9 * (5 * r1); - c2 += d02 >>> 13; - d02 &= 8191; - var d1 = c2; - d1 += h0 * r1; - d1 += h1 * r02; - d1 += h22 * (5 * r9); - d1 += h32 * (5 * r8); - d1 += h4 * (5 * r7); - c2 = d1 >>> 13; - d1 &= 8191; - d1 += h5 * (5 * r6); - d1 += h6 * (5 * r5); - d1 += h7 * (5 * r4); - d1 += h8 * (5 * r3); - d1 += h9 * (5 * r2); - c2 += d1 >>> 13; - d1 &= 8191; - var d22 = c2; - d22 += h0 * r2; - d22 += h1 * r1; - d22 += h22 * r02; - d22 += h32 * (5 * r9); - d22 += h4 * (5 * r8); - c2 = d22 >>> 13; - d22 &= 8191; - d22 += h5 * (5 * r7); - d22 += h6 * (5 * r6); - d22 += h7 * (5 * r5); - d22 += h8 * (5 * r4); - d22 += h9 * (5 * r3); - c2 += d22 >>> 13; - d22 &= 8191; - var d32 = c2; - d32 += h0 * r3; - d32 += h1 * r2; - d32 += h22 * r1; - d32 += h32 * r02; - d32 += h4 * (5 * r9); - c2 = d32 >>> 13; - d32 &= 8191; - d32 += h5 * (5 * r8); - d32 += h6 * (5 * r7); - d32 += h7 * (5 * r6); - d32 += h8 * (5 * r5); - d32 += h9 * (5 * r4); - c2 += d32 >>> 13; - d32 &= 8191; - var d4 = c2; - d4 += h0 * r4; - d4 += h1 * r3; - d4 += h22 * r2; - d4 += h32 * r1; - d4 += h4 * r02; - c2 = d4 >>> 13; - d4 &= 8191; - d4 += h5 * (5 * r9); - d4 += h6 * (5 * r8); - d4 += h7 * (5 * r7); - d4 += h8 * (5 * r6); - d4 += h9 * (5 * r5); - c2 += d4 >>> 13; - d4 &= 8191; - var d5 = c2; - d5 += h0 * r5; - d5 += h1 * r4; - d5 += h22 * r3; - d5 += h32 * r2; - d5 += h4 * r1; - c2 = d5 >>> 13; - d5 &= 8191; - d5 += h5 * r02; - d5 += h6 * (5 * r9); - d5 += h7 * (5 * r8); - d5 += h8 * (5 * r7); - d5 += h9 * (5 * r6); - c2 += d5 >>> 13; - d5 &= 8191; - var d6 = c2; - d6 += h0 * r6; - d6 += h1 * r5; - d6 += h22 * r4; - d6 += h32 * r3; - d6 += h4 * r2; - c2 = d6 >>> 13; - d6 &= 8191; - d6 += h5 * r1; - d6 += h6 * r02; - d6 += h7 * (5 * r9); - d6 += h8 * (5 * r8); - d6 += h9 * (5 * r7); - c2 += d6 >>> 13; - d6 &= 8191; - var d7 = c2; - d7 += h0 * r7; - d7 += h1 * r6; - d7 += h22 * r5; - d7 += h32 * r4; - d7 += h4 * r3; - c2 = d7 >>> 13; - d7 &= 8191; - d7 += h5 * r2; - d7 += h6 * r1; - d7 += h7 * r02; - d7 += h8 * (5 * r9); - d7 += h9 * (5 * r8); - c2 += d7 >>> 13; - d7 &= 8191; - var d8 = c2; - d8 += h0 * r8; - d8 += h1 * r7; - d8 += h22 * r6; - d8 += h32 * r5; - d8 += h4 * r4; - c2 = d8 >>> 13; - d8 &= 8191; - d8 += h5 * r3; - d8 += h6 * r2; - d8 += h7 * r1; - d8 += h8 * r02; - d8 += h9 * (5 * r9); - c2 += d8 >>> 13; - d8 &= 8191; - var d9 = c2; - d9 += h0 * r9; - d9 += h1 * r8; - d9 += h22 * r7; - d9 += h32 * r6; - d9 += h4 * r5; - c2 = d9 >>> 13; - d9 &= 8191; - d9 += h5 * r4; - d9 += h6 * r3; - d9 += h7 * r2; - d9 += h8 * r1; - d9 += h9 * r02; - c2 += d9 >>> 13; - d9 &= 8191; - c2 = (c2 << 2) + c2 | 0; - c2 = c2 + d02 | 0; - d02 = c2 & 8191; - c2 = c2 >>> 13; - d1 += c2; - h0 = d02; - h1 = d1; - h22 = d22; - h32 = d32; - h4 = d4; - h5 = d5; - h6 = d6; - h7 = d7; - h8 = d8; - h9 = d9; - mpos += 16; - bytes2 -= 16; - } - this._h[0] = h0; - this._h[1] = h1; - this._h[2] = h22; - this._h[3] = h32; - this._h[4] = h4; - this._h[5] = h5; - this._h[6] = h6; - this._h[7] = h7; - this._h[8] = h8; - this._h[9] = h9; - }; - Poly13052.prototype.finish = function(mac, macpos) { - if (macpos === void 0) { - macpos = 0; - } - var g3 = new Uint16Array(10); - var c2; - var mask2; - var f3; - var i3; - if (this._leftover) { - i3 = this._leftover; - this._buffer[i3++] = 1; - for (; i3 < 16; i3++) { - this._buffer[i3] = 0; - } - this._fin = 1; - this._blocks(this._buffer, 0, 16); - } - c2 = this._h[1] >>> 13; - this._h[1] &= 8191; - for (i3 = 2; i3 < 10; i3++) { - this._h[i3] += c2; - c2 = this._h[i3] >>> 13; - this._h[i3] &= 8191; - } - this._h[0] += c2 * 5; - c2 = this._h[0] >>> 13; - this._h[0] &= 8191; - this._h[1] += c2; - c2 = this._h[1] >>> 13; - this._h[1] &= 8191; - this._h[2] += c2; - g3[0] = this._h[0] + 5; - c2 = g3[0] >>> 13; - g3[0] &= 8191; - for (i3 = 1; i3 < 10; i3++) { - g3[i3] = this._h[i3] + c2; - c2 = g3[i3] >>> 13; - g3[i3] &= 8191; - } - g3[9] -= 1 << 13; - mask2 = (c2 ^ 1) - 1; - for (i3 = 0; i3 < 10; i3++) { - g3[i3] &= mask2; - } - mask2 = ~mask2; - for (i3 = 0; i3 < 10; i3++) { - this._h[i3] = this._h[i3] & mask2 | g3[i3]; - } - this._h[0] = (this._h[0] | this._h[1] << 13) & 65535; - this._h[1] = (this._h[1] >>> 3 | this._h[2] << 10) & 65535; - this._h[2] = (this._h[2] >>> 6 | this._h[3] << 7) & 65535; - this._h[3] = (this._h[3] >>> 9 | this._h[4] << 4) & 65535; - this._h[4] = (this._h[4] >>> 12 | this._h[5] << 1 | this._h[6] << 14) & 65535; - this._h[5] = (this._h[6] >>> 2 | this._h[7] << 11) & 65535; - this._h[6] = (this._h[7] >>> 5 | this._h[8] << 8) & 65535; - this._h[7] = (this._h[8] >>> 8 | this._h[9] << 5) & 65535; - f3 = this._h[0] + this._pad[0]; - this._h[0] = f3 & 65535; - for (i3 = 1; i3 < 8; i3++) { - f3 = (this._h[i3] + this._pad[i3] | 0) + (f3 >>> 16) | 0; - this._h[i3] = f3 & 65535; - } - mac[macpos + 0] = this._h[0] >>> 0; - mac[macpos + 1] = this._h[0] >>> 8; - mac[macpos + 2] = this._h[1] >>> 0; - mac[macpos + 3] = this._h[1] >>> 8; - mac[macpos + 4] = this._h[2] >>> 0; - mac[macpos + 5] = this._h[2] >>> 8; - mac[macpos + 6] = this._h[3] >>> 0; - mac[macpos + 7] = this._h[3] >>> 8; - mac[macpos + 8] = this._h[4] >>> 0; - mac[macpos + 9] = this._h[4] >>> 8; - mac[macpos + 10] = this._h[5] >>> 0; - mac[macpos + 11] = this._h[5] >>> 8; - mac[macpos + 12] = this._h[6] >>> 0; - mac[macpos + 13] = this._h[6] >>> 8; - mac[macpos + 14] = this._h[7] >>> 0; - mac[macpos + 15] = this._h[7] >>> 8; - this._finished = true; - return this; - }; - Poly13052.prototype.update = function(m3) { - var mpos = 0; - var bytes2 = m3.length; - var want; - if (this._leftover) { - want = 16 - this._leftover; - if (want > bytes2) { - want = bytes2; - } - for (var i3 = 0; i3 < want; i3++) { - this._buffer[this._leftover + i3] = m3[mpos + i3]; - } - bytes2 -= want; - mpos += want; - this._leftover += want; - if (this._leftover < 16) { - return this; - } - this._blocks(this._buffer, 0, 16); - this._leftover = 0; - } - if (bytes2 >= 16) { - want = bytes2 - bytes2 % 16; - this._blocks(m3, mpos, want); - mpos += want; - bytes2 -= want; - } - if (bytes2) { - for (var i3 = 0; i3 < bytes2; i3++) { - this._buffer[this._leftover + i3] = m3[mpos + i3]; - } - this._leftover += bytes2; - } - return this; - }; - Poly13052.prototype.digest = function() { - if (this._finished) { - throw new Error("Poly1305 was finished"); - } - var mac = new Uint8Array(16); - this.finish(mac); - return mac; - }; - Poly13052.prototype.clean = function() { - wipe_12.wipe(this._buffer); - wipe_12.wipe(this._r); - wipe_12.wipe(this._h); - wipe_12.wipe(this._pad); - this._leftover = 0; - this._fin = 0; - this._finished = true; - return this; - }; - return Poly13052; - }() - ); - exports.Poly1305 = Poly1305; - function oneTimeAuth(key2, data) { - var h4 = new Poly1305(key2); - h4.update(data); - var digest9 = h4.digest(); - h4.clean(); - return digest9; - } - exports.oneTimeAuth = oneTimeAuth; - function equal2(a3, b2) { - if (a3.length !== exports.DIGEST_LENGTH || b2.length !== exports.DIGEST_LENGTH) { - return false; - } - return constant_time_12.equal(a3, b2); - } - exports.equal = equal2; -})(poly1305); -(function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - var chacha_1 = chacha; - var poly1305_1 = poly1305; - var wipe_12 = wipe$1; - var binary_12 = binary; - var constant_time_12 = constantTime; - exports.KEY_LENGTH = 32; - exports.NONCE_LENGTH = 12; - exports.TAG_LENGTH = 16; - var ZEROS = new Uint8Array(16); - var ChaCha20Poly1305 = ( - /** @class */ - function() { - function ChaCha20Poly13052(key2) { - this.nonceLength = exports.NONCE_LENGTH; - this.tagLength = exports.TAG_LENGTH; - if (key2.length !== exports.KEY_LENGTH) { - throw new Error("ChaCha20Poly1305 needs 32-byte key"); - } - this._key = new Uint8Array(key2); - } - ChaCha20Poly13052.prototype.seal = function(nonce, plaintext, associatedData, dst) { - if (nonce.length > 16) { - throw new Error("ChaCha20Poly1305: incorrect nonce length"); - } - var counter = new Uint8Array(16); - counter.set(nonce, counter.length - nonce.length); - var authKey = new Uint8Array(32); - chacha_1.stream(this._key, counter, authKey, 4); - var resultLength = plaintext.length + this.tagLength; - var result; - if (dst) { - if (dst.length !== resultLength) { - throw new Error("ChaCha20Poly1305: incorrect destination length"); - } - result = dst; - } else { - result = new Uint8Array(resultLength); - } - chacha_1.streamXOR(this._key, counter, plaintext, result, 4); - this._authenticate(result.subarray(result.length - this.tagLength, result.length), authKey, result.subarray(0, result.length - this.tagLength), associatedData); - wipe_12.wipe(counter); - return result; - }; - ChaCha20Poly13052.prototype.open = function(nonce, sealed, associatedData, dst) { - if (nonce.length > 16) { - throw new Error("ChaCha20Poly1305: incorrect nonce length"); - } - if (sealed.length < this.tagLength) { - return null; - } - var counter = new Uint8Array(16); - counter.set(nonce, counter.length - nonce.length); - var authKey = new Uint8Array(32); - chacha_1.stream(this._key, counter, authKey, 4); - var calculatedTag = new Uint8Array(this.tagLength); - this._authenticate(calculatedTag, authKey, sealed.subarray(0, sealed.length - this.tagLength), associatedData); - if (!constant_time_12.equal(calculatedTag, sealed.subarray(sealed.length - this.tagLength, sealed.length))) { - return null; - } - var resultLength = sealed.length - this.tagLength; - var result; - if (dst) { - if (dst.length !== resultLength) { - throw new Error("ChaCha20Poly1305: incorrect destination length"); - } - result = dst; - } else { - result = new Uint8Array(resultLength); - } - chacha_1.streamXOR(this._key, counter, sealed.subarray(0, sealed.length - this.tagLength), result, 4); - wipe_12.wipe(counter); - return result; - }; - ChaCha20Poly13052.prototype.clean = function() { - wipe_12.wipe(this._key); - return this; - }; - ChaCha20Poly13052.prototype._authenticate = function(tagOut, authKey, ciphertext, associatedData) { - var h4 = new poly1305_1.Poly1305(authKey); - if (associatedData) { - h4.update(associatedData); - if (associatedData.length % 16 > 0) { - h4.update(ZEROS.subarray(associatedData.length % 16)); - } - } - h4.update(ciphertext); - if (ciphertext.length % 16 > 0) { - h4.update(ZEROS.subarray(ciphertext.length % 16)); - } - var length = new Uint8Array(8); - if (associatedData) { - binary_12.writeUint64LE(associatedData.length, length); - } - h4.update(length); - binary_12.writeUint64LE(ciphertext.length, length); - h4.update(length); - var tag = h4.digest(); - for (var i3 = 0; i3 < tag.length; i3++) { - tagOut[i3] = tag[i3]; - } - h4.clean(); - wipe_12.wipe(tag); - wipe_12.wipe(length); - }; - return ChaCha20Poly13052; - }() - ); - exports.ChaCha20Poly1305 = ChaCha20Poly1305; -})(chacha20poly1305); -var hkdf = {}; -var hmac$1 = {}; -var hash$2 = {}; -Object.defineProperty(hash$2, "__esModule", { value: true }); -function isSerializableHash(h4) { - return typeof h4.saveState !== "undefined" && typeof h4.restoreState !== "undefined" && typeof h4.cleanSavedState !== "undefined"; -} -hash$2.isSerializableHash = isSerializableHash; -Object.defineProperty(hmac$1, "__esModule", { value: true }); -var hash_1 = hash$2; -var constant_time_1 = constantTime; -var wipe_1$2 = wipe$1; -var HMAC3 = ( - /** @class */ - function() { - function HMAC4(hash3, key2) { - this._finished = false; - this._inner = new hash3(); - this._outer = new hash3(); - this.blockSize = this._outer.blockSize; - this.digestLength = this._outer.digestLength; - var pad3 = new Uint8Array(this.blockSize); - if (key2.length > this.blockSize) { - this._inner.update(key2).finish(pad3).clean(); - } else { - pad3.set(key2); - } - for (var i3 = 0; i3 < pad3.length; i3++) { - pad3[i3] ^= 54; - } - this._inner.update(pad3); - for (var i3 = 0; i3 < pad3.length; i3++) { - pad3[i3] ^= 54 ^ 92; - } - this._outer.update(pad3); - if (hash_1.isSerializableHash(this._inner) && hash_1.isSerializableHash(this._outer)) { - this._innerKeyedState = this._inner.saveState(); - this._outerKeyedState = this._outer.saveState(); - } - wipe_1$2.wipe(pad3); - } - HMAC4.prototype.reset = function() { - if (!hash_1.isSerializableHash(this._inner) || !hash_1.isSerializableHash(this._outer)) { - throw new Error("hmac: can't reset() because hash doesn't implement restoreState()"); - } - this._inner.restoreState(this._innerKeyedState); - this._outer.restoreState(this._outerKeyedState); - this._finished = false; - return this; - }; - HMAC4.prototype.clean = function() { - if (hash_1.isSerializableHash(this._inner)) { - this._inner.cleanSavedState(this._innerKeyedState); - } - if (hash_1.isSerializableHash(this._outer)) { - this._outer.cleanSavedState(this._outerKeyedState); - } - this._inner.clean(); - this._outer.clean(); - }; - HMAC4.prototype.update = function(data) { - this._inner.update(data); - return this; - }; - HMAC4.prototype.finish = function(out) { - if (this._finished) { - this._outer.finish(out); - return this; - } - this._inner.finish(out); - this._outer.update(out.subarray(0, this.digestLength)).finish(out); - this._finished = true; - return this; - }; - HMAC4.prototype.digest = function() { - var out = new Uint8Array(this.digestLength); - this.finish(out); - return out; - }; - HMAC4.prototype.saveState = function() { - if (!hash_1.isSerializableHash(this._inner)) { - throw new Error("hmac: can't saveState() because hash doesn't implement it"); - } - return this._inner.saveState(); - }; - HMAC4.prototype.restoreState = function(savedState) { - if (!hash_1.isSerializableHash(this._inner) || !hash_1.isSerializableHash(this._outer)) { - throw new Error("hmac: can't restoreState() because hash doesn't implement it"); - } - this._inner.restoreState(savedState); - this._outer.restoreState(this._outerKeyedState); - this._finished = false; - return this; - }; - HMAC4.prototype.cleanSavedState = function(savedState) { - if (!hash_1.isSerializableHash(this._inner)) { - throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it"); - } - this._inner.cleanSavedState(savedState); - }; - return HMAC4; - }() -); -hmac$1.HMAC = HMAC3; -function hmac(hash3, key2, data) { - var h4 = new HMAC3(hash3, key2); - h4.update(data); - var digest9 = h4.digest(); - h4.clean(); - return digest9; -} -hmac$1.hmac = hmac; -hmac$1.equal = constant_time_1.equal; -Object.defineProperty(hkdf, "__esModule", { value: true }); -var hmac_1 = hmac$1; -var wipe_1$1 = wipe$1; -var HKDF = ( - /** @class */ - function() { - function HKDF2(hash3, key2, salt, info) { - if (salt === void 0) { - salt = new Uint8Array(0); - } - this._counter = new Uint8Array(1); - this._hash = hash3; - this._info = info; - var okm = hmac_1.hmac(this._hash, salt, key2); - this._hmac = new hmac_1.HMAC(hash3, okm); - this._buffer = new Uint8Array(this._hmac.digestLength); - this._bufpos = this._buffer.length; - } - HKDF2.prototype._fillBuffer = function() { - this._counter[0]++; - var ctr = this._counter[0]; - if (ctr === 0) { - throw new Error("hkdf: cannot expand more"); - } - this._hmac.reset(); - if (ctr > 1) { - this._hmac.update(this._buffer); - } - if (this._info) { - this._hmac.update(this._info); - } - this._hmac.update(this._counter); - this._hmac.finish(this._buffer); - this._bufpos = 0; - }; - HKDF2.prototype.expand = function(length) { - var out = new Uint8Array(length); - for (var i3 = 0; i3 < out.length; i3++) { - if (this._bufpos === this._buffer.length) { - this._fillBuffer(); - } - out[i3] = this._buffer[this._bufpos++]; - } - return out; - }; - HKDF2.prototype.clean = function() { - this._hmac.clean(); - wipe_1$1.wipe(this._buffer); - wipe_1$1.wipe(this._counter); - this._bufpos = 0; - }; - return HKDF2; - }() -); -var HKDF_1 = hkdf.HKDF = HKDF; -var random = {}; -var system = {}; -var browser$1 = {}; -Object.defineProperty(browser$1, "__esModule", { value: true }); -browser$1.BrowserRandomSource = void 0; -const QUOTA = 65536; -class BrowserRandomSource { - constructor() { - this.isAvailable = false; - this.isInstantiated = false; - const browserCrypto = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; - if (browserCrypto && browserCrypto.getRandomValues !== void 0) { - this._crypto = browserCrypto; - this.isAvailable = true; - this.isInstantiated = true; - } - } - randomBytes(length) { - if (!this.isAvailable || !this._crypto) { - throw new Error("Browser random byte generator is not available."); - } - const out = new Uint8Array(length); - for (let i3 = 0; i3 < out.length; i3 += QUOTA) { - this._crypto.getRandomValues(out.subarray(i3, i3 + Math.min(out.length - i3, QUOTA))); - } - return out; - } -} -browser$1.BrowserRandomSource = BrowserRandomSource; -function commonjsRequire(path) { - throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); -} -var node = {}; -Object.defineProperty(node, "__esModule", { value: true }); -node.NodeRandomSource = void 0; -const wipe_1 = wipe$1; -class NodeRandomSource { - constructor() { - this.isAvailable = false; - this.isInstantiated = false; - if (typeof commonjsRequire !== "undefined") { - const nodeCrypto = require$$3; - if (nodeCrypto && nodeCrypto.randomBytes) { - this._crypto = nodeCrypto; - this.isAvailable = true; - this.isInstantiated = true; - } - } - } - randomBytes(length) { - if (!this.isAvailable || !this._crypto) { - throw new Error("Node.js random byte generator is not available."); - } - let buffer2 = this._crypto.randomBytes(length); - if (buffer2.length !== length) { - throw new Error("NodeRandomSource: got fewer bytes than requested"); - } - const out = new Uint8Array(length); - for (let i3 = 0; i3 < out.length; i3++) { - out[i3] = buffer2[i3]; - } - (0, wipe_1.wipe)(buffer2); - return out; - } -} -node.NodeRandomSource = NodeRandomSource; -Object.defineProperty(system, "__esModule", { value: true }); -system.SystemRandomSource = void 0; -const browser_1 = browser$1; -const node_1 = node; -class SystemRandomSource { - constructor() { - this.isAvailable = false; - this.name = ""; - this._source = new browser_1.BrowserRandomSource(); - if (this._source.isAvailable) { - this.isAvailable = true; - this.name = "Browser"; - return; - } - this._source = new node_1.NodeRandomSource(); - if (this._source.isAvailable) { - this.isAvailable = true; - this.name = "Node"; - return; - } - } - randomBytes(length) { - if (!this.isAvailable) { - throw new Error("System random byte generator is not available."); - } - return this._source.randomBytes(length); - } -} -system.SystemRandomSource = SystemRandomSource; -(function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.randomStringForEntropy = exports.randomString = exports.randomUint32 = exports.randomBytes = exports.defaultRandomSource = void 0; - const system_1 = system; - const binary_12 = binary; - const wipe_12 = wipe$1; - exports.defaultRandomSource = new system_1.SystemRandomSource(); - function randomBytes2(length, prng = exports.defaultRandomSource) { - return prng.randomBytes(length); - } - exports.randomBytes = randomBytes2; - function randomUint32(prng = exports.defaultRandomSource) { - const buf = randomBytes2(4, prng); - const result = (0, binary_12.readUint32LE)(buf); - (0, wipe_12.wipe)(buf); - return result; - } - exports.randomUint32 = randomUint32; - const ALPHANUMERIC = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - function randomString(length, charset = ALPHANUMERIC, prng = exports.defaultRandomSource) { - if (charset.length < 2) { - throw new Error("randomString charset is too short"); - } - if (charset.length > 256) { - throw new Error("randomString charset is too long"); - } - let out = ""; - const charsLen = charset.length; - const maxByte = 256 - 256 % charsLen; - while (length > 0) { - const buf = randomBytes2(Math.ceil(length * 256 / maxByte), prng); - for (let i3 = 0; i3 < buf.length && length > 0; i3++) { - const randomByte = buf[i3]; - if (randomByte < maxByte) { - out += charset.charAt(randomByte % charsLen); - length--; - } - } - (0, wipe_12.wipe)(buf); - } - return out; - } - exports.randomString = randomString; - function randomStringForEntropy(bits, charset = ALPHANUMERIC, prng = exports.defaultRandomSource) { - const length = Math.ceil(bits / (Math.log(charset.length) / Math.LN2)); - return randomString(length, charset, prng); - } - exports.randomStringForEntropy = randomStringForEntropy; -})(random); -var sha256 = {}; -(function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - var binary_12 = binary; - var wipe_12 = wipe$1; - exports.DIGEST_LENGTH = 32; - exports.BLOCK_SIZE = 64; - var SHA2564 = ( - /** @class */ - function() { - function SHA2565() { - this.digestLength = exports.DIGEST_LENGTH; - this.blockSize = exports.BLOCK_SIZE; - this._state = new Int32Array(8); - this._temp = new Int32Array(64); - this._buffer = new Uint8Array(128); - this._bufferLength = 0; - this._bytesHashed = 0; - this._finished = false; - this.reset(); - } - SHA2565.prototype._initState = function() { - this._state[0] = 1779033703; - this._state[1] = 3144134277; - this._state[2] = 1013904242; - this._state[3] = 2773480762; - this._state[4] = 1359893119; - this._state[5] = 2600822924; - this._state[6] = 528734635; - this._state[7] = 1541459225; - }; - SHA2565.prototype.reset = function() { - this._initState(); - this._bufferLength = 0; - this._bytesHashed = 0; - this._finished = false; - return this; - }; - SHA2565.prototype.clean = function() { - wipe_12.wipe(this._buffer); - wipe_12.wipe(this._temp); - this.reset(); - }; - SHA2565.prototype.update = function(data, dataLength2) { - if (dataLength2 === void 0) { - dataLength2 = data.length; - } - if (this._finished) { - throw new Error("SHA256: can't update because hash was finished."); - } - var dataPos = 0; - this._bytesHashed += dataLength2; - if (this._bufferLength > 0) { - while (this._bufferLength < this.blockSize && dataLength2 > 0) { - this._buffer[this._bufferLength++] = data[dataPos++]; - dataLength2--; - } - if (this._bufferLength === this.blockSize) { - hashBlocks(this._temp, this._state, this._buffer, 0, this.blockSize); - this._bufferLength = 0; - } - } - if (dataLength2 >= this.blockSize) { - dataPos = hashBlocks(this._temp, this._state, data, dataPos, dataLength2); - dataLength2 %= this.blockSize; - } - while (dataLength2 > 0) { - this._buffer[this._bufferLength++] = data[dataPos++]; - dataLength2--; - } - return this; - }; - SHA2565.prototype.finish = function(out) { - if (!this._finished) { - var bytesHashed = this._bytesHashed; - var left = this._bufferLength; - var bitLenHi = bytesHashed / 536870912 | 0; - var bitLenLo = bytesHashed << 3; - var padLength = bytesHashed % 64 < 56 ? 64 : 128; - this._buffer[left] = 128; - for (var i3 = left + 1; i3 < padLength - 8; i3++) { - this._buffer[i3] = 0; - } - binary_12.writeUint32BE(bitLenHi, this._buffer, padLength - 8); - binary_12.writeUint32BE(bitLenLo, this._buffer, padLength - 4); - hashBlocks(this._temp, this._state, this._buffer, 0, padLength); - this._finished = true; - } - for (var i3 = 0; i3 < this.digestLength / 4; i3++) { - binary_12.writeUint32BE(this._state[i3], out, i3 * 4); - } - return this; - }; - SHA2565.prototype.digest = function() { - var out = new Uint8Array(this.digestLength); - this.finish(out); - return out; - }; - SHA2565.prototype.saveState = function() { - if (this._finished) { - throw new Error("SHA256: cannot save finished state"); - } - return { - state: new Int32Array(this._state), - buffer: this._bufferLength > 0 ? new Uint8Array(this._buffer) : void 0, - bufferLength: this._bufferLength, - bytesHashed: this._bytesHashed - }; - }; - SHA2565.prototype.restoreState = function(savedState) { - this._state.set(savedState.state); - this._bufferLength = savedState.bufferLength; - if (savedState.buffer) { - this._buffer.set(savedState.buffer); - } - this._bytesHashed = savedState.bytesHashed; - this._finished = false; - return this; - }; - SHA2565.prototype.cleanSavedState = function(savedState) { - wipe_12.wipe(savedState.state); - if (savedState.buffer) { - wipe_12.wipe(savedState.buffer); - } - savedState.bufferLength = 0; - savedState.bytesHashed = 0; - }; - return SHA2565; - }() - ); - exports.SHA256 = SHA2564; - var K3 = new Int32Array([ - 1116352408, - 1899447441, - 3049323471, - 3921009573, - 961987163, - 1508970993, - 2453635748, - 2870763221, - 3624381080, - 310598401, - 607225278, - 1426881987, - 1925078388, - 2162078206, - 2614888103, - 3248222580, - 3835390401, - 4022224774, - 264347078, - 604807628, - 770255983, - 1249150122, - 1555081692, - 1996064986, - 2554220882, - 2821834349, - 2952996808, - 3210313671, - 3336571891, - 3584528711, - 113926993, - 338241895, - 666307205, - 773529912, - 1294757372, - 1396182291, - 1695183700, - 1986661051, - 2177026350, - 2456956037, - 2730485921, - 2820302411, - 3259730800, - 3345764771, - 3516065817, - 3600352804, - 4094571909, - 275423344, - 430227734, - 506948616, - 659060556, - 883997877, - 958139571, - 1322822218, - 1537002063, - 1747873779, - 1955562222, - 2024104815, - 2227730452, - 2361852424, - 2428436474, - 2756734187, - 3204031479, - 3329325298 - ]); - function hashBlocks(w2, v6, p3, pos, len) { - while (len >= 64) { - var a3 = v6[0]; - var b2 = v6[1]; - var c2 = v6[2]; - var d4 = v6[3]; - var e18 = v6[4]; - var f3 = v6[5]; - var g3 = v6[6]; - var h4 = v6[7]; - for (var i3 = 0; i3 < 16; i3++) { - var j2 = pos + i3 * 4; - w2[i3] = binary_12.readUint32BE(p3, j2); - } - for (var i3 = 16; i3 < 64; i3++) { - var u2 = w2[i3 - 2]; - var t1 = (u2 >>> 17 | u2 << 32 - 17) ^ (u2 >>> 19 | u2 << 32 - 19) ^ u2 >>> 10; - u2 = w2[i3 - 15]; - var t2 = (u2 >>> 7 | u2 << 32 - 7) ^ (u2 >>> 18 | u2 << 32 - 18) ^ u2 >>> 3; - w2[i3] = (t1 + w2[i3 - 7] | 0) + (t2 + w2[i3 - 16] | 0); - } - for (var i3 = 0; i3 < 64; i3++) { - var t1 = (((e18 >>> 6 | e18 << 32 - 6) ^ (e18 >>> 11 | e18 << 32 - 11) ^ (e18 >>> 25 | e18 << 32 - 25)) + (e18 & f3 ^ ~e18 & g3) | 0) + (h4 + (K3[i3] + w2[i3] | 0) | 0) | 0; - var t2 = ((a3 >>> 2 | a3 << 32 - 2) ^ (a3 >>> 13 | a3 << 32 - 13) ^ (a3 >>> 22 | a3 << 32 - 22)) + (a3 & b2 ^ a3 & c2 ^ b2 & c2) | 0; - h4 = g3; - g3 = f3; - f3 = e18; - e18 = d4 + t1 | 0; - d4 = c2; - c2 = b2; - b2 = a3; - a3 = t1 + t2 | 0; - } - v6[0] += a3; - v6[1] += b2; - v6[2] += c2; - v6[3] += d4; - v6[4] += e18; - v6[5] += f3; - v6[6] += g3; - v6[7] += h4; - pos += 64; - len -= 64; - } - return pos; - } - function hash3(data) { - var h4 = new SHA2564(); - h4.update(data); - var digest9 = h4.digest(); - h4.clean(); - return digest9; - } - exports.hash = hash3; -})(sha256); -var x25519 = {}; -(function(exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.sharedKey = exports.generateKeyPair = exports.generateKeyPairFromSeed = exports.scalarMultBase = exports.scalarMult = exports.SHARED_KEY_LENGTH = exports.SECRET_KEY_LENGTH = exports.PUBLIC_KEY_LENGTH = void 0; - const random_1 = random; - const wipe_12 = wipe$1; - exports.PUBLIC_KEY_LENGTH = 32; - exports.SECRET_KEY_LENGTH = 32; - exports.SHARED_KEY_LENGTH = 32; - function gf2(init3) { - const r2 = new Float64Array(16); - if (init3) { - for (let i3 = 0; i3 < init3.length; i3++) { - r2[i3] = init3[i3]; + v6[0] += a3; + v6[1] += b2; + v6[2] += c2; + v6[3] += d4; + v6[4] += e18; + v6[5] += f4; + v6[6] += g3; + v6[7] += h4; + pos += 64; + len -= 64; + } + return pos; + } + function hash3(data) { + var h4 = new SHA2564(); + h4.update(data); + var digest9 = h4.digest(); + h4.clean(); + return digest9; + } + exports.hash = hash3; +})(sha256$3); +var x25519 = {}; +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.sharedKey = exports.generateKeyPair = exports.generateKeyPairFromSeed = exports.scalarMultBase = exports.scalarMult = exports.SHARED_KEY_LENGTH = exports.SECRET_KEY_LENGTH = exports.PUBLIC_KEY_LENGTH = void 0; + const random_1 = random; + const wipe_12 = wipe$1; + exports.PUBLIC_KEY_LENGTH = 32; + exports.SECRET_KEY_LENGTH = 32; + exports.SHARED_KEY_LENGTH = 32; + function gf2(init3) { + const r2 = new Float64Array(16); + if (init3) { + for (let i2 = 0; i2 < init3.length; i2++) { + r2[i2] = init3[i2]; } } return r2; @@ -91006,60 +20312,60 @@ var x25519 = {}; const _121665 = gf2([56129, 1]); function car25519(o2) { let c2 = 1; - for (let i3 = 0; i3 < 16; i3++) { - let v6 = o2[i3] + c2 + 65535; + for (let i2 = 0; i2 < 16; i2++) { + let v6 = o2[i2] + c2 + 65535; c2 = Math.floor(v6 / 65536); - o2[i3] = v6 - c2 * 65536; + o2[i2] = v6 - c2 * 65536; } o2[0] += c2 - 1 + 37 * (c2 - 1); } function sel25519(p3, q2, b2) { const c2 = ~(b2 - 1); - for (let i3 = 0; i3 < 16; i3++) { - const t2 = c2 & (p3[i3] ^ q2[i3]); - p3[i3] ^= t2; - q2[i3] ^= t2; + for (let i2 = 0; i2 < 16; i2++) { + const t2 = c2 & (p3[i2] ^ q2[i2]); + p3[i2] ^= t2; + q2[i2] ^= t2; } } - function pack25519(o2, n4) { + function pack25519(o2, n5) { const m3 = gf2(); const t2 = gf2(); - for (let i3 = 0; i3 < 16; i3++) { - t2[i3] = n4[i3]; + for (let i2 = 0; i2 < 16; i2++) { + t2[i2] = n5[i2]; } car25519(t2); car25519(t2); car25519(t2); for (let j2 = 0; j2 < 2; j2++) { m3[0] = t2[0] - 65517; - for (let i3 = 1; i3 < 15; i3++) { - m3[i3] = t2[i3] - 65535 - (m3[i3 - 1] >> 16 & 1); - m3[i3 - 1] &= 65535; + for (let i2 = 1; i2 < 15; i2++) { + m3[i2] = t2[i2] - 65535 - (m3[i2 - 1] >> 16 & 1); + m3[i2 - 1] &= 65535; } m3[15] = t2[15] - 32767 - (m3[14] >> 16 & 1); const b2 = m3[15] >> 16 & 1; m3[14] &= 65535; sel25519(t2, m3, 1 - b2); } - for (let i3 = 0; i3 < 16; i3++) { - o2[2 * i3] = t2[i3] & 255; - o2[2 * i3 + 1] = t2[i3] >> 8; + for (let i2 = 0; i2 < 16; i2++) { + o2[2 * i2] = t2[i2] & 255; + o2[2 * i2 + 1] = t2[i2] >> 8; } } - function unpack25519(o2, n4) { - for (let i3 = 0; i3 < 16; i3++) { - o2[i3] = n4[2 * i3] + (n4[2 * i3 + 1] << 8); + function unpack25519(o2, n5) { + for (let i2 = 0; i2 < 16; i2++) { + o2[i2] = n5[2 * i2] + (n5[2 * i2 + 1] << 8); } o2[15] &= 32767; } function add6(o2, a3, b2) { - for (let i3 = 0; i3 < 16; i3++) { - o2[i3] = a3[i3] + b2[i3]; + for (let i2 = 0; i2 < 16; i2++) { + o2[i2] = a3[i2] + b2[i2]; } } function sub(o2, a3, b2) { - for (let i3 = 0; i3 < 16; i3++) { - o2[i3] = a3[i3] - b2[i3]; + for (let i2 = 0; i2 < 16; i2++) { + o2[i2] = a3[i2] - b2[i2]; } } function mul6(o2, a3, b2) { @@ -91473,35 +20779,35 @@ var x25519 = {}; } function inv25519(o2, inp) { const c2 = gf2(); - for (let i3 = 0; i3 < 16; i3++) { - c2[i3] = inp[i3]; + for (let i2 = 0; i2 < 16; i2++) { + c2[i2] = inp[i2]; } - for (let i3 = 253; i3 >= 0; i3--) { + for (let i2 = 253; i2 >= 0; i2--) { square(c2, c2); - if (i3 !== 2 && i3 !== 4) { + if (i2 !== 2 && i2 !== 4) { mul6(c2, c2, inp); } } - for (let i3 = 0; i3 < 16; i3++) { - o2[i3] = c2[i3]; + for (let i2 = 0; i2 < 16; i2++) { + o2[i2] = c2[i2]; } } - function scalarMult(n4, p3) { + function scalarMult(n5, p3) { const z3 = new Uint8Array(32); const x3 = new Float64Array(80); - const a3 = gf2(), b2 = gf2(), c2 = gf2(), d4 = gf2(), e18 = gf2(), f3 = gf2(); - for (let i3 = 0; i3 < 31; i3++) { - z3[i3] = n4[i3]; + const a3 = gf2(), b2 = gf2(), c2 = gf2(), d4 = gf2(), e18 = gf2(), f4 = gf2(); + for (let i2 = 0; i2 < 31; i2++) { + z3[i2] = n5[i2]; } - z3[31] = n4[31] & 127 | 64; + z3[31] = n5[31] & 127 | 64; z3[0] &= 248; unpack25519(x3, p3); - for (let i3 = 0; i3 < 16; i3++) { - b2[i3] = x3[i3]; + for (let i2 = 0; i2 < 16; i2++) { + b2[i2] = x3[i2]; } a3[0] = d4[0] = 1; - for (let i3 = 254; i3 >= 0; --i3) { - const r2 = z3[i3 >>> 3] >>> (i3 & 7) & 1; + for (let i2 = 254; i2 >= 0; --i2) { + const r2 = z3[i2 >>> 3] >>> (i2 & 7) & 1; sel25519(a3, b2, r2); sel25519(c2, d4, r2); add6(e18, a3, c2); @@ -91509,27 +20815,27 @@ var x25519 = {}; add6(c2, b2, d4); sub(b2, b2, d4); square(d4, e18); - square(f3, a3); + square(f4, a3); mul6(a3, c2, a3); mul6(c2, b2, e18); add6(e18, a3, c2); sub(a3, a3, c2); square(b2, a3); - sub(c2, d4, f3); + sub(c2, d4, f4); mul6(a3, c2, _121665); add6(a3, a3, d4); mul6(c2, c2, a3); - mul6(a3, d4, f3); + mul6(a3, d4, f4); mul6(d4, b2, x3); square(b2, e18); sel25519(a3, b2, r2); sel25519(c2, d4, r2); } - for (let i3 = 0; i3 < 16; i3++) { - x3[i3 + 16] = a3[i3]; - x3[i3 + 32] = c2[i3]; - x3[i3 + 48] = b2[i3]; - x3[i3 + 64] = d4[i3]; + for (let i2 = 0; i2 < 16; i2++) { + x3[i2 + 16] = a3[i2]; + x3[i2 + 32] = c2[i2]; + x3[i2 + 48] = b2[i2]; + x3[i2 + 64] = d4[i2]; } const x32 = x3.subarray(32); const x16 = x3.subarray(16); @@ -91540,8 +20846,8 @@ var x25519 = {}; return q2; } exports.scalarMult = scalarMult; - function scalarMultBase(n4) { - return scalarMult(n4, _9); + function scalarMultBase(n5) { + return scalarMult(n5, _9); } exports.scalarMultBase = scalarMultBase; function generateKeyPairFromSeed(seed) { @@ -91573,8 +20879,8 @@ var x25519 = {}; const result = scalarMult(mySecretKey, theirPublicKey); if (rejectZero) { let zeros = 0; - for (let i3 = 0; i3 < result.length; i3++) { - zeros |= result[i3]; + for (let i2 = 0; i2 < result.length; i2++) { + zeros |= result[i2]; } if (zeros === 0) { throw new Error("X25519: invalid shared key"); @@ -91590,7 +20896,7 @@ function allocUnsafe(size2 = 0) { } return new Uint8Array(size2); } -function concat(arrays, length) { +function concat$1(arrays, length) { if (!length) { length = arrays.reduce((acc, curr) => acc + curr.length, 0); } @@ -91602,7 +20908,7 @@ function concat(arrays, length) { } return output2; } -function base$1(ALPHABET2, name2) { +function base$4(ALPHABET2, name2) { if (ALPHABET2.length >= 255) { throw new TypeError("Alphabet too long"); } @@ -91610,13 +20916,13 @@ function base$1(ALPHABET2, name2) { for (var j2 = 0; j2 < BASE_MAP.length; j2++) { BASE_MAP[j2] = 255; } - for (var i3 = 0; i3 < ALPHABET2.length; i3++) { - var x3 = ALPHABET2.charAt(i3); + for (var i2 = 0; i2 < ALPHABET2.length; i2++) { + var x3 = ALPHABET2.charAt(i2); var xc2 = x3.charCodeAt(0); if (BASE_MAP[xc2] !== 255) { throw new TypeError(x3 + " is ambiguous"); } - BASE_MAP[xc2] = i3; + BASE_MAP[xc2] = i2; } var BASE2 = ALPHABET2.length; var LEADER = ALPHABET2.charAt(0); @@ -91648,8 +20954,8 @@ function base$1(ALPHABET2, name2) { var b58 = new Uint8Array(size2); while (pbegin !== pend) { var carry = source[pbegin]; - var i4 = 0; - for (var it1 = size2 - 1; (carry !== 0 || i4 < length) && it1 !== -1; it1--, i4++) { + var i3 = 0; + for (var it1 = size2 - 1; (carry !== 0 || i3 < length) && it1 !== -1; it1--, i3++) { carry += 256 * b58[it1] >>> 0; b58[it1] = carry % BASE2 >>> 0; carry = carry / BASE2 >>> 0; @@ -91657,7 +20963,7 @@ function base$1(ALPHABET2, name2) { if (carry !== 0) { throw new Error("Non-zero carry"); } - length = i4; + length = i3; pbegin++; } var it2 = size2 - length; @@ -91694,8 +21000,8 @@ function base$1(ALPHABET2, name2) { if (carry === 255) { return; } - var i4 = 0; - for (var it3 = size2 - 1; (carry !== 0 || i4 < length) && it3 !== -1; it3--, i4++) { + var i3 = 0; + for (var it3 = size2 - 1; (carry !== 0 || i3 < length) && it3 !== -1; it3--, i3++) { carry += BASE2 * b256[it3] >>> 0; b256[it3] = carry % 256 >>> 0; carry = carry / 256 >>> 0; @@ -91703,7 +21009,7 @@ function base$1(ALPHABET2, name2) { if (carry !== 0) { throw new Error("Non-zero carry"); } - length = i4; + length = i3; psz++; } if (source[psz] === " ") { @@ -91733,9 +21039,9 @@ function base$1(ALPHABET2, name2) { decode: decode3 }; } -var src = base$1; -var _brrp__multiformats_scope_baseX = src; -const coerce = (o2) => { +var src$2 = base$4; +var _brrp__multiformats_scope_baseX = src$2; +const coerce$1 = (o2) => { if (o2 instanceof Uint8Array && o2.constructor.name === "Uint8Array") return o2; if (o2 instanceof ArrayBuffer) @@ -91746,7 +21052,7 @@ const coerce = (o2) => { throw new Error("Unknown type, must be binary type"); }; const fromString$1 = (str) => new TextEncoder().encode(str); -const toString$2 = (b2) => new TextDecoder().decode(b2); +const toString$4 = (b2) => new TextDecoder().decode(b2); class Encoder { constructor(name2, prefix, baseEncode2) { this.name = name2; @@ -91829,13 +21135,13 @@ const baseX = ({ prefix, name: name2, alphabet: alphabet2 }) => { prefix, name: name2, encode: encode5, - decode: (text) => coerce(decode3(text)) + decode: (text) => coerce$1(decode3(text)) }); }; -const decode$1 = (string2, alphabet2, bitsPerChar, name2) => { +const decode$2 = (string2, alphabet2, bitsPerChar, name2) => { const codes = {}; - for (let i3 = 0; i3 < alphabet2.length; ++i3) { - codes[alphabet2[i3]] = i3; + for (let i2 = 0; i2 < alphabet2.length; ++i2) { + codes[alphabet2[i2]] = i2; } let end = string2.length; while (string2[end - 1] === "=") { @@ -91845,8 +21151,8 @@ const decode$1 = (string2, alphabet2, bitsPerChar, name2) => { let bits = 0; let buffer2 = 0; let written = 0; - for (let i3 = 0; i3 < end; ++i3) { - const value = codes[string2[i3]]; + for (let i2 = 0; i2 < end; ++i2) { + const value = codes[string2[i2]]; if (value === void 0) { throw new SyntaxError(`Non-${name2} character`); } @@ -91862,14 +21168,14 @@ const decode$1 = (string2, alphabet2, bitsPerChar, name2) => { } return out; }; -const encode$1 = (data, alphabet2, bitsPerChar) => { +const encode$4 = (data, alphabet2, bitsPerChar) => { const pad3 = alphabet2[alphabet2.length - 1] === "="; const mask2 = (1 << bitsPerChar) - 1; let out = ""; let bits = 0; let buffer2 = 0; - for (let i3 = 0; i3 < data.length; ++i3) { - buffer2 = buffer2 << 8 | data[i3]; + for (let i2 = 0; i2 < data.length; ++i2) { + buffer2 = buffer2 << 8 | data[i2]; bits += 8; while (bits > bitsPerChar) { bits -= bitsPerChar; @@ -91891,17 +21197,17 @@ const rfc4648 = ({ name: name2, prefix, bitsPerChar, alphabet: alphabet2 }) => { prefix, name: name2, encode(input) { - return encode$1(input, alphabet2, bitsPerChar); + return encode$4(input, alphabet2, bitsPerChar); }, decode(input) { - return decode$1(input, alphabet2, bitsPerChar, name2); + return decode$2(input, alphabet2, bitsPerChar, name2); } }); }; const identity = from({ prefix: "\0", name: "identity", - encode: (buf) => toString$2(buf), + encode: (buf) => toString$4(buf), decode: (str) => fromString$1(str) }); const identityBase = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ @@ -92045,7 +21351,7 @@ const base58flickr = baseX({ prefix: "Z", alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" }); -const base58 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +const base58$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base58btc, base58flickr @@ -92082,21 +21388,21 @@ const base64$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp base64urlpad }, Symbol.toStringTag, { value: "Module" })); const alphabet = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"); -const alphabetBytesToChars = alphabet.reduce((p3, c2, i3) => { - p3[i3] = c2; +const alphabetBytesToChars = alphabet.reduce((p3, c2, i2) => { + p3[i2] = c2; return p3; }, []); -const alphabetCharsToBytes = alphabet.reduce((p3, c2, i3) => { - p3[c2.codePointAt(0)] = i3; +const alphabetCharsToBytes = alphabet.reduce((p3, c2, i2) => { + p3[c2.codePointAt(0)] = i2; return p3; }, []); -function encode3(data) { +function encode$3(data) { return data.reduce((p3, c2) => { p3 += alphabetBytesToChars[c2]; return p3; }, ""); } -function decode2(str) { +function decode$1(str) { const byts = []; for (const char of str) { const byt = alphabetCharsToBytes[char.codePointAt(0)]; @@ -92110,8 +21416,8 @@ function decode2(str) { const base256emoji = from({ prefix: "🚀", name: "base256emoji", - encode: encode3, - decode: decode2 + encode: encode$3, + decode: decode$1 }); const base256emoji$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, @@ -92127,7 +21433,7 @@ const bases = { ...base16$1, ...base32$1, ...base36$1, - ...base58, + ...base58$1, ...base64$1, ...base256emoji$1 }; @@ -92143,7 +21449,7 @@ function createCodec(name2, prefix, encode5, decode3) { decoder: { decode: decode3 } }; } -const string = createCodec("utf8", "u", (buf) => { +const string$1 = createCodec("utf8", "u", (buf) => { const decoder = new TextDecoder("utf8"); return "u" + decoder.decode(buf); }, (str) => { @@ -92152,21 +21458,21 @@ const string = createCodec("utf8", "u", (buf) => { }); const ascii = createCodec("ascii", "a", (buf) => { let string2 = "a"; - for (let i3 = 0; i3 < buf.length; i3++) { - string2 += String.fromCharCode(buf[i3]); + for (let i2 = 0; i2 < buf.length; i2++) { + string2 += String.fromCharCode(buf[i2]); } return string2; }, (str) => { str = str.substring(1); const buf = allocUnsafe(str.length); - for (let i3 = 0; i3 < str.length; i3++) { - buf[i3] = str.charCodeAt(i3); + for (let i2 = 0; i2 < str.length; i2++) { + buf[i2] = str.charCodeAt(i2); } return buf; }); const BASES = { - utf8: string, - "utf-8": string, + utf8: string$1, + "utf-8": string$1, hex: bases.base16, latin1: ascii, ascii, @@ -92183,7 +21489,7 @@ function fromString(string2, encoding2 = "utf8") { } return base3.decoder.decode(`${base3.prefix}${string2}`); } -function toString$1(array2, encoding2 = "utf8") { +function toString$3(array2, encoding2 = "utf8") { const base3 = BASES[encoding2]; if (!base3) { throw new Error(`Unsupported encoding "${encoding2}"`); @@ -92195,11 +21501,11 @@ function toString$1(array2, encoding2 = "utf8") { } function zo(e18, t2 = []) { const r2 = []; - return Object.keys(e18).forEach((i3) => { - if (t2.length && !t2.includes(i3)) + return Object.keys(e18).forEach((i2) => { + if (t2.length && !t2.includes(i2)) return; - const n4 = e18[i3]; - r2.push(...n4.accounts); + const n5 = e18[i2]; + r2.push(...n5.accounts); }), r2; } var On$2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; @@ -92212,10 +21518,10 @@ function A0$1(e18) { r2.prototype = t2.prototype; } else r2 = {}; - return Object.defineProperty(r2, "__esModule", { value: true }), Object.keys(e18).forEach(function(i3) { - var n4 = Object.getOwnPropertyDescriptor(e18, i3); - Object.defineProperty(r2, i3, n4.get ? n4 : { enumerable: true, get: function() { - return e18[i3]; + return Object.defineProperty(r2, "__esModule", { value: true }), Object.keys(e18).forEach(function(i2) { + var n5 = Object.getOwnPropertyDescriptor(e18, i2); + Object.defineProperty(r2, i2, n5.get ? n5 : { enumerable: true, get: function() { + return e18[i2]; } }); }), r2; } @@ -92230,14 +21536,14 @@ var Pn$2 = { exports: {} }; */ (function(e18) { (function() { - var t2 = "input is invalid type", r2 = "finalize already called", i3 = typeof window == "object", n4 = i3 ? window : {}; - n4.JS_SHA3_NO_WINDOW && (i3 = false); - var o2 = !i3 && typeof self == "object", h4 = !n4.JS_SHA3_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node; - h4 ? n4 = On$2 : o2 && (n4 = self); - var p3 = !n4.JS_SHA3_NO_COMMON_JS && true && e18.exports, b2 = !n4.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", m3 = "0123456789abcdef".split(""), w2 = [31, 7936, 2031616, 520093696], y3 = [4, 1024, 262144, 67108864], S4 = [1, 256, 65536, 16777216], I2 = [6, 1536, 393216, 100663296], N2 = [0, 8, 16, 24], C3 = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648], F2 = [224, 256, 384, 512], U5 = [128, 256], J2 = ["hex", "buffer", "arrayBuffer", "array", "digest"], Bt2 = { 128: 168, 256: 136 }; - (n4.JS_SHA3_NO_NODE_JS || !Array.isArray) && (Array.isArray = function(u2) { + var t2 = "input is invalid type", r2 = "finalize already called", i2 = typeof window == "object", n5 = i2 ? window : {}; + n5.JS_SHA3_NO_WINDOW && (i2 = false); + var o2 = !i2 && typeof self == "object", h4 = !n5.JS_SHA3_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node; + h4 ? n5 = On$2 : o2 && (n5 = self); + var p3 = !n5.JS_SHA3_NO_COMMON_JS && true && e18.exports, b2 = !n5.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", m3 = "0123456789abcdef".split(""), w2 = [31, 7936, 2031616, 520093696], y3 = [4, 1024, 262144, 67108864], S4 = [1, 256, 65536, 16777216], I2 = [6, 1536, 393216, 100663296], N2 = [0, 8, 16, 24], C3 = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648], F2 = [224, 256, 384, 512], U5 = [128, 256], J2 = ["hex", "buffer", "arrayBuffer", "array", "digest"], Bt2 = { 128: 168, 256: 136 }; + (n5.JS_SHA3_NO_NODE_JS || !Array.isArray) && (Array.isArray = function(u2) { return Object.prototype.toString.call(u2) === "[object Array]"; - }), b2 && (n4.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) && (ArrayBuffer.isView = function(u2) { + }), b2 && (n5.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) && (ArrayBuffer.isView = function(u2) { return typeof u2 == "object" && u2.buffer && u2.buffer.constructor === ArrayBuffer; }); for (var G2 = function(u2, E2, _3) { @@ -92250,11 +21556,11 @@ var Pn$2 = { exports: {} }; }; }, z3 = function(u2, E2, _3) { return function(B2, R3, T9, P2) { - return f3["cshake" + u2].update(B2, R3, T9, P2)[_3](); + return f4["cshake" + u2].update(B2, R3, T9, P2)[_3](); }; }, Pt2 = function(u2, E2, _3) { return function(B2, R3, T9, P2) { - return f3["kmac" + u2].update(B2, R3, T9, P2)[_3](); + return f4["kmac" + u2].update(B2, R3, T9, P2)[_3](); }; }, W2 = function(u2, E2, _3, B2) { for (var R3 = 0; R3 < J2.length; ++R3) { @@ -92279,7 +21585,7 @@ var Pn$2 = { exports: {} }; }, Y2 = function(u2, E2) { var _3 = Bt2[u2], B2 = z3(u2, E2, "hex"); return B2.create = function(R3, T9, P2) { - return !T9 && !P2 ? f3["shake" + u2].create(R3) : new s2(u2, E2, R3).bytepad([T9, P2], _3); + return !T9 && !P2 ? f4["shake" + u2].create(R3) : new s2(u2, E2, R3).bytepad([T9, P2], _3); }, B2.update = function(R3, T9, P2, O3) { return B2.create(T9, P2, O3).update(R3); }, W2(B2, z3, u2, E2); @@ -92290,12 +21596,12 @@ var Pn$2 = { exports: {} }; }, B2.update = function(R3, T9, P2, O3) { return B2.create(R3, P2, O3).update(T9); }, W2(B2, Pt2, u2, E2); - }, A2 = [{ name: "keccak", padding: S4, bits: F2, createMethod: Rt2 }, { name: "sha3", padding: I2, bits: F2, createMethod: Rt2 }, { name: "shake", padding: w2, bits: U5, createMethod: Yt2 }, { name: "cshake", padding: y3, bits: U5, createMethod: Y2 }, { name: "kmac", padding: y3, bits: U5, createMethod: Vt2 }], f3 = {}, a3 = [], c2 = 0; c2 < A2.length; ++c2) + }, A2 = [{ name: "keccak", padding: S4, bits: F2, createMethod: Rt2 }, { name: "sha3", padding: I2, bits: F2, createMethod: Rt2 }, { name: "shake", padding: w2, bits: U5, createMethod: Yt2 }, { name: "cshake", padding: y3, bits: U5, createMethod: Y2 }, { name: "kmac", padding: y3, bits: U5, createMethod: Vt2 }], f4 = {}, a3 = [], c2 = 0; c2 < A2.length; ++c2) for (var d4 = A2[c2], g3 = d4.bits, x3 = 0; x3 < g3.length; ++x3) { var M3 = d4.name + "_" + g3[x3]; - if (a3.push(M3), f3[M3] = d4.createMethod(g3[x3], d4.padding), d4.name !== "sha3") { + if (a3.push(M3), f4[M3] = d4.createMethod(g3[x3], d4.padding), d4.name !== "sha3") { var l2 = d4.name + g3[x3]; - a3.push(l2), f3[l2] = f3[M3]; + a3.push(l2), f4[l2] = f4[M3]; } } function s2(u2, E2, _3) { @@ -92420,10 +21726,10 @@ var Pn$2 = { exports: {} }; R3 = u2[0] ^ u2[10] ^ u2[20] ^ u2[30] ^ u2[40], T9 = u2[1] ^ u2[11] ^ u2[21] ^ u2[31] ^ u2[41], P2 = u2[2] ^ u2[12] ^ u2[22] ^ u2[32] ^ u2[42], O3 = u2[3] ^ u2[13] ^ u2[23] ^ u2[33] ^ u2[43], Ct2 = u2[4] ^ u2[14] ^ u2[24] ^ u2[34] ^ u2[44], D2 = u2[5] ^ u2[15] ^ u2[25] ^ u2[35] ^ u2[45], q2 = u2[6] ^ u2[16] ^ u2[26] ^ u2[36] ^ u2[46], De2 = u2[7] ^ u2[17] ^ u2[27] ^ u2[37] ^ u2[47], X2 = u2[8] ^ u2[18] ^ u2[28] ^ u2[38] ^ u2[48], Z2 = u2[9] ^ u2[19] ^ u2[29] ^ u2[39] ^ u2[49], E2 = X2 ^ (P2 << 1 | O3 >>> 31), _3 = Z2 ^ (O3 << 1 | P2 >>> 31), u2[0] ^= E2, u2[1] ^= _3, u2[10] ^= E2, u2[11] ^= _3, u2[20] ^= E2, u2[21] ^= _3, u2[30] ^= E2, u2[31] ^= _3, u2[40] ^= E2, u2[41] ^= _3, E2 = R3 ^ (Ct2 << 1 | D2 >>> 31), _3 = T9 ^ (D2 << 1 | Ct2 >>> 31), u2[2] ^= E2, u2[3] ^= _3, u2[12] ^= E2, u2[13] ^= _3, u2[22] ^= E2, u2[23] ^= _3, u2[32] ^= E2, u2[33] ^= _3, u2[42] ^= E2, u2[43] ^= _3, E2 = P2 ^ (q2 << 1 | De2 >>> 31), _3 = O3 ^ (De2 << 1 | q2 >>> 31), u2[4] ^= E2, u2[5] ^= _3, u2[14] ^= E2, u2[15] ^= _3, u2[24] ^= E2, u2[25] ^= _3, u2[34] ^= E2, u2[35] ^= _3, u2[44] ^= E2, u2[45] ^= _3, E2 = Ct2 ^ (X2 << 1 | Z2 >>> 31), _3 = D2 ^ (Z2 << 1 | X2 >>> 31), u2[6] ^= E2, u2[7] ^= _3, u2[16] ^= E2, u2[17] ^= _3, u2[26] ^= E2, u2[27] ^= _3, u2[36] ^= E2, u2[37] ^= _3, u2[46] ^= E2, u2[47] ^= _3, E2 = q2 ^ (R3 << 1 | T9 >>> 31), _3 = De2 ^ (T9 << 1 | R3 >>> 31), u2[8] ^= E2, u2[9] ^= _3, u2[18] ^= E2, u2[19] ^= _3, u2[28] ^= E2, u2[29] ^= _3, u2[38] ^= E2, u2[39] ^= _3, u2[48] ^= E2, u2[49] ^= _3, Fe2 = u2[0], $ = u2[1], yt2 = u2[11] << 4 | u2[10] >>> 28, Je2 = u2[10] << 4 | u2[11] >>> 28, at2 = u2[20] << 3 | u2[21] >>> 29, Ke2 = u2[21] << 3 | u2[20] >>> 29, Ee2 = u2[31] << 9 | u2[30] >>> 23, Se2 = u2[30] << 9 | u2[31] >>> 23, gt2 = u2[40] << 18 | u2[41] >>> 14, At2 = u2[41] << 18 | u2[40] >>> 14, lt2 = u2[2] << 1 | u2[3] >>> 31, ze2 = u2[3] << 1 | u2[2] >>> 31, tt2 = u2[13] << 12 | u2[12] >>> 20, Te2 = u2[12] << 12 | u2[13] >>> 20, wt2 = u2[22] << 10 | u2[23] >>> 22, xt2 = u2[23] << 10 | u2[22] >>> 22, ut2 = u2[33] << 13 | u2[32] >>> 19, ht2 = u2[32] << 13 | u2[33] >>> 19, Ne2 = u2[42] << 2 | u2[43] >>> 30, Ie2 = u2[43] << 2 | u2[42] >>> 30, St2 = u2[5] << 30 | u2[4] >>> 2, Nt2 = u2[4] << 30 | u2[5] >>> 2, dt2 = u2[14] << 6 | u2[15] >>> 26, pt2 = u2[15] << 6 | u2[14] >>> 26, et2 = u2[25] << 11 | u2[24] >>> 21, rt2 = u2[24] << 11 | u2[25] >>> 21, Ge2 = u2[34] << 15 | u2[35] >>> 17, Mt2 = u2[35] << 15 | u2[34] >>> 17, He2 = u2[45] << 29 | u2[44] >>> 3, ct2 = u2[44] << 29 | u2[45] >>> 3, ft2 = u2[6] << 28 | u2[7] >>> 4, ot2 = u2[7] << 28 | u2[6] >>> 4, Ve2 = u2[17] << 23 | u2[16] >>> 9, It2 = u2[16] << 23 | u2[17] >>> 9, Le2 = u2[26] << 25 | u2[27] >>> 7, vt2 = u2[27] << 25 | u2[26] >>> 7, Ue2 = u2[36] << 21 | u2[37] >>> 11, it2 = u2[37] << 21 | u2[36] >>> 11, Et2 = u2[47] << 24 | u2[46] >>> 8, Ye2 = u2[46] << 24 | u2[47] >>> 8, Qe2 = u2[8] << 27 | u2[9] >>> 5, bt2 = u2[9] << 27 | u2[8] >>> 5, qe2 = u2[18] << 20 | u2[19] >>> 12, st2 = u2[19] << 20 | u2[18] >>> 12, _t2 = u2[29] << 7 | u2[28] >>> 25, Me2 = u2[28] << 7 | u2[29] >>> 25, mt2 = u2[38] << 8 | u2[39] >>> 24, je2 = u2[39] << 8 | u2[38] >>> 24, nt2 = u2[48] << 14 | u2[49] >>> 18, ke2 = u2[49] << 14 | u2[48] >>> 18, u2[0] = Fe2 ^ ~tt2 & et2, u2[1] = $ ^ ~Te2 & rt2, u2[10] = ft2 ^ ~qe2 & at2, u2[11] = ot2 ^ ~st2 & Ke2, u2[20] = lt2 ^ ~dt2 & Le2, u2[21] = ze2 ^ ~pt2 & vt2, u2[30] = Qe2 ^ ~yt2 & wt2, u2[31] = bt2 ^ ~Je2 & xt2, u2[40] = St2 ^ ~Ve2 & _t2, u2[41] = Nt2 ^ ~It2 & Me2, u2[2] = tt2 ^ ~et2 & Ue2, u2[3] = Te2 ^ ~rt2 & it2, u2[12] = qe2 ^ ~at2 & ut2, u2[13] = st2 ^ ~Ke2 & ht2, u2[22] = dt2 ^ ~Le2 & mt2, u2[23] = pt2 ^ ~vt2 & je2, u2[32] = yt2 ^ ~wt2 & Ge2, u2[33] = Je2 ^ ~xt2 & Mt2, u2[42] = Ve2 ^ ~_t2 & Ee2, u2[43] = It2 ^ ~Me2 & Se2, u2[4] = et2 ^ ~Ue2 & nt2, u2[5] = rt2 ^ ~it2 & ke2, u2[14] = at2 ^ ~ut2 & He2, u2[15] = Ke2 ^ ~ht2 & ct2, u2[24] = Le2 ^ ~mt2 & gt2, u2[25] = vt2 ^ ~je2 & At2, u2[34] = wt2 ^ ~Ge2 & Et2, u2[35] = xt2 ^ ~Mt2 & Ye2, u2[44] = _t2 ^ ~Ee2 & Ne2, u2[45] = Me2 ^ ~Se2 & Ie2, u2[6] = Ue2 ^ ~nt2 & Fe2, u2[7] = it2 ^ ~ke2 & $, u2[16] = ut2 ^ ~He2 & ft2, u2[17] = ht2 ^ ~ct2 & ot2, u2[26] = mt2 ^ ~gt2 & lt2, u2[27] = je2 ^ ~At2 & ze2, u2[36] = Ge2 ^ ~Et2 & Qe2, u2[37] = Mt2 ^ ~Ye2 & bt2, u2[46] = Ee2 ^ ~Ne2 & St2, u2[47] = Se2 ^ ~Ie2 & Nt2, u2[8] = nt2 ^ ~Fe2 & tt2, u2[9] = ke2 ^ ~$ & Te2, u2[18] = He2 ^ ~ft2 & qe2, u2[19] = ct2 ^ ~ot2 & st2, u2[28] = gt2 ^ ~lt2 & dt2, u2[29] = At2 ^ ~ze2 & pt2, u2[38] = Et2 ^ ~Qe2 & yt2, u2[39] = Ye2 ^ ~bt2 & Je2, u2[48] = Ne2 ^ ~St2 & Ve2, u2[49] = Ie2 ^ ~Nt2 & It2, u2[0] ^= C3[B2], u2[1] ^= C3[B2 + 1]; }; if (p3) - e18.exports = f3; + e18.exports = f4; else for (c2 = 0; c2 < a3.length; ++c2) - n4[a3[c2]] = f3[a3[c2]]; + n5[a3[c2]] = f4[a3[c2]]; })(); })(Pn$2); const y0$1 = "logger/5.7.0"; @@ -92464,8 +21770,8 @@ let L$2 = class L { Object.defineProperty(this, "version", { enumerable: true, value: t2, writable: false }); } _log(t2, r2) { - const i3 = t2.toLowerCase(); - Cr$1[i3] == null && this.throwArgumentError("invalid log level name", "logLevel", t2), !(Tn$1 > Cr$1[i3]) && console.log.apply(console, r2); + const i2 = t2.toLowerCase(); + Cr$1[i2] == null && this.throwArgumentError("invalid log level name", "logLevel", t2), !(Tn$1 > Cr$1[i2]) && console.log.apply(console, r2); } debug(...t2) { this._log(L.levels.DEBUG, t2); @@ -92476,25 +21782,25 @@ let L$2 = class L { warn(...t2) { this._log(L.levels.WARNING, t2); } - makeError(t2, r2, i3) { + makeError(t2, r2, i2) { if (Fn) return this.makeError("censored error", r2, {}); - r2 || (r2 = L.errors.UNKNOWN_ERROR), i3 || (i3 = {}); - const n4 = []; - Object.keys(i3).forEach((b2) => { - const m3 = i3[b2]; + r2 || (r2 = L.errors.UNKNOWN_ERROR), i2 || (i2 = {}); + const n5 = []; + Object.keys(i2).forEach((b2) => { + const m3 = i2[b2]; try { if (m3 instanceof Uint8Array) { let w2 = ""; for (let y3 = 0; y3 < m3.length; y3++) w2 += kn$1[m3[y3] >> 4], w2 += kn$1[m3[y3] & 15]; - n4.push(b2 + "=Uint8Array(0x" + w2 + ")"); + n5.push(b2 + "=Uint8Array(0x" + w2 + ")"); } else - n4.push(b2 + "=" + JSON.stringify(m3)); + n5.push(b2 + "=" + JSON.stringify(m3)); } catch { - n4.push(b2 + "=" + JSON.stringify(i3[b2].toString())); + n5.push(b2 + "=" + JSON.stringify(i2[b2].toString())); } - }), n4.push(`code=${r2}`), n4.push(`version=${this.version}`); + }), n5.push(`code=${r2}`), n5.push(`version=${this.version}`); const o2 = t2; let h4 = ""; switch (r2) { @@ -92527,23 +21833,23 @@ let L$2 = class L { h4 = r2; break; } - h4 && (t2 += " [ See: https://links.ethers.org/v5-errors-" + h4 + " ]"), n4.length && (t2 += " (" + n4.join(", ") + ")"); + h4 && (t2 += " [ See: https://links.ethers.org/v5-errors-" + h4 + " ]"), n5.length && (t2 += " (" + n5.join(", ") + ")"); const p3 = new Error(t2); - return p3.reason = o2, p3.code = r2, Object.keys(i3).forEach(function(b2) { - p3[b2] = i3[b2]; + return p3.reason = o2, p3.code = r2, Object.keys(i2).forEach(function(b2) { + p3[b2] = i2[b2]; }), p3; } - throwError(t2, r2, i3) { - throw this.makeError(t2, r2, i3); + throwError(t2, r2, i2) { + throw this.makeError(t2, r2, i2); } - throwArgumentError(t2, r2, i3) { - return this.throwError(t2, L.errors.INVALID_ARGUMENT, { argument: r2, value: i3 }); + throwArgumentError(t2, r2, i2) { + return this.throwError(t2, L.errors.INVALID_ARGUMENT, { argument: r2, value: i2 }); } - assert(t2, r2, i3, n4) { - t2 || this.throwError(r2, i3, n4); + assert(t2, r2, i2, n5) { + t2 || this.throwError(r2, i2, n5); } - assertArgument(t2, r2, i3, n4) { - t2 || this.throwArgumentError(r2, i3, n4); + assertArgument(t2, r2, i2, n5) { + t2 || this.throwArgumentError(r2, i2, n5); } checkNormalize(t2) { Un$1 && this.throwError("platform missing String.prototype.normalize", L.errors.UNSUPPORTED_OPERATION, { operation: "String.prototype.normalize", form: Un$1 }); @@ -92551,8 +21857,8 @@ let L$2 = class L { checkSafeUint53(t2, r2) { typeof t2 == "number" && (r2 == null && (r2 = "value not safe"), (t2 < 0 || t2 >= 9007199254740991) && this.throwError(r2, L.errors.NUMERIC_FAULT, { operation: "checkSafeInteger", fault: "out-of-safe-range", value: t2 }), t2 % 1 && this.throwError(r2, L.errors.NUMERIC_FAULT, { operation: "checkSafeInteger", fault: "non-integer", value: t2 })); } - checkArgumentCount(t2, r2, i3) { - i3 ? i3 = ": " + i3 : i3 = "", t2 < r2 && this.throwError("missing argument" + i3, L.errors.MISSING_ARGUMENT, { count: t2, expectedCount: r2 }), t2 > r2 && this.throwError("too many arguments" + i3, L.errors.UNEXPECTED_ARGUMENT, { count: t2, expectedCount: r2 }); + checkArgumentCount(t2, r2, i2) { + i2 ? i2 = ": " + i2 : i2 = "", t2 < r2 && this.throwError("missing argument" + i2, L.errors.MISSING_ARGUMENT, { count: t2, expectedCount: r2 }), t2 > r2 && this.throwError("too many arguments" + i2, L.errors.UNEXPECTED_ARGUMENT, { count: t2, expectedCount: r2 }); } checkNew(t2, r2) { (t2 === Object || t2 == null) && this.throwError("missing new", L.errors.MISSING_NEW, { name: r2.name }); @@ -92622,10 +21928,10 @@ function Ot$2(e18, t2) { if (t2.allowMissingPrefix && typeof e18 == "string" && e18.substring(0, 2) !== "0x" && (e18 = "0x" + e18), qn$1(e18) && (e18 = e18.toHexString()), Qt$1(e18)) { let r2 = e18.substring(2); r2.length % 2 && (t2.hexPad === "left" ? r2 = "0" + r2 : t2.hexPad === "right" ? r2 += "0" : Dt$2.throwArgumentError("hex data is odd-length", "value", e18)); - const i3 = []; - for (let n4 = 0; n4 < r2.length; n4 += 2) - i3.push(parseInt(r2.substring(n4, n4 + 2), 16)); - return rr$2(new Uint8Array(i3)); + const i2 = []; + for (let n5 = 0; n5 < r2.length; n5 += 2) + i2.push(parseInt(r2.substring(n5, n5 + 2), 16)); + return rr$2(new Uint8Array(i2)); } return ir$2(e18) ? rr$2(new Uint8Array(e18)) : Dt$2.throwArgumentError("invalid arrayify value", "value", e18); } @@ -92649,9 +21955,9 @@ function Kt$2(e18, t2) { return e18.length % 2 && (t2.hexPad === "left" ? e18 = "0x0" + e18.substring(2) : t2.hexPad === "right" ? e18 += "0" : Dt$2.throwArgumentError("hex data is odd-length", "value", e18)), e18.toLowerCase(); if (ir$2(e18)) { let r2 = "0x"; - for (let i3 = 0; i3 < e18.length; i3++) { - let n4 = e18[i3]; - r2 += bi$2[(n4 & 240) >> 4] + bi$2[n4 & 15]; + for (let i2 = 0; i2 < e18.length; i2++) { + let n5 = e18[i2]; + r2 += bi$2[(n5 & 240) >> 4] + bi$2[n5 & 15]; } return r2; } @@ -92665,20 +21971,20 @@ function oe$3(e18, t2) { var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, default: I0$1 }), B0$1 = A0$1(_0$1); (function(e18) { (function(t2, r2) { - function i3(A2, f3) { + function i2(A2, f4) { if (!A2) - throw new Error(f3 || "Assertion failed"); + throw new Error(f4 || "Assertion failed"); } - function n4(A2, f3) { - A2.super_ = f3; + function n5(A2, f4) { + A2.super_ = f4; var a3 = function() { }; - a3.prototype = f3.prototype, A2.prototype = new a3(), A2.prototype.constructor = A2; + a3.prototype = f4.prototype, A2.prototype = new a3(), A2.prototype.constructor = A2; } - function o2(A2, f3, a3) { + function o2(A2, f4, a3) { if (o2.isBN(A2)) return A2; - this.negative = 0, this.words = null, this.length = 0, this.red = null, A2 !== null && ((f3 === "le" || f3 === "be") && (a3 = f3, f3 = 10), this._init(A2 || 0, f3 || 10, a3 || "be")); + this.negative = 0, this.words = null, this.length = 0, this.red = null, A2 !== null && ((f4 === "le" || f4 === "be") && (a3 = f4, f4 = 10), this._init(A2 || 0, f4 || 10, a3 || "be")); } typeof t2 == "object" ? t2.exports = o2 : r2.BN = o2, o2.BN = o2, o2.wordSize = 26; var h4; @@ -92686,103 +21992,103 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d typeof window < "u" && typeof window.Buffer < "u" ? h4 = window.Buffer : h4 = B0$1.Buffer; } catch { } - o2.isBN = function(f3) { - return f3 instanceof o2 ? true : f3 !== null && typeof f3 == "object" && f3.constructor.wordSize === o2.wordSize && Array.isArray(f3.words); - }, o2.max = function(f3, a3) { - return f3.cmp(a3) > 0 ? f3 : a3; - }, o2.min = function(f3, a3) { - return f3.cmp(a3) < 0 ? f3 : a3; - }, o2.prototype._init = function(f3, a3, c2) { - if (typeof f3 == "number") - return this._initNumber(f3, a3, c2); - if (typeof f3 == "object") - return this._initArray(f3, a3, c2); - a3 === "hex" && (a3 = 16), i3(a3 === (a3 | 0) && a3 >= 2 && a3 <= 36), f3 = f3.toString().replace(/\s+/g, ""); + o2.isBN = function(f4) { + return f4 instanceof o2 ? true : f4 !== null && typeof f4 == "object" && f4.constructor.wordSize === o2.wordSize && Array.isArray(f4.words); + }, o2.max = function(f4, a3) { + return f4.cmp(a3) > 0 ? f4 : a3; + }, o2.min = function(f4, a3) { + return f4.cmp(a3) < 0 ? f4 : a3; + }, o2.prototype._init = function(f4, a3, c2) { + if (typeof f4 == "number") + return this._initNumber(f4, a3, c2); + if (typeof f4 == "object") + return this._initArray(f4, a3, c2); + a3 === "hex" && (a3 = 16), i2(a3 === (a3 | 0) && a3 >= 2 && a3 <= 36), f4 = f4.toString().replace(/\s+/g, ""); var d4 = 0; - f3[0] === "-" && (d4++, this.negative = 1), d4 < f3.length && (a3 === 16 ? this._parseHex(f3, d4, c2) : (this._parseBase(f3, a3, d4), c2 === "le" && this._initArray(this.toArray(), a3, c2))); - }, o2.prototype._initNumber = function(f3, a3, c2) { - f3 < 0 && (this.negative = 1, f3 = -f3), f3 < 67108864 ? (this.words = [f3 & 67108863], this.length = 1) : f3 < 4503599627370496 ? (this.words = [f3 & 67108863, f3 / 67108864 & 67108863], this.length = 2) : (i3(f3 < 9007199254740992), this.words = [f3 & 67108863, f3 / 67108864 & 67108863, 1], this.length = 3), c2 === "le" && this._initArray(this.toArray(), a3, c2); - }, o2.prototype._initArray = function(f3, a3, c2) { - if (i3(typeof f3.length == "number"), f3.length <= 0) + f4[0] === "-" && (d4++, this.negative = 1), d4 < f4.length && (a3 === 16 ? this._parseHex(f4, d4, c2) : (this._parseBase(f4, a3, d4), c2 === "le" && this._initArray(this.toArray(), a3, c2))); + }, o2.prototype._initNumber = function(f4, a3, c2) { + f4 < 0 && (this.negative = 1, f4 = -f4), f4 < 67108864 ? (this.words = [f4 & 67108863], this.length = 1) : f4 < 4503599627370496 ? (this.words = [f4 & 67108863, f4 / 67108864 & 67108863], this.length = 2) : (i2(f4 < 9007199254740992), this.words = [f4 & 67108863, f4 / 67108864 & 67108863, 1], this.length = 3), c2 === "le" && this._initArray(this.toArray(), a3, c2); + }, o2.prototype._initArray = function(f4, a3, c2) { + if (i2(typeof f4.length == "number"), f4.length <= 0) return this.words = [0], this.length = 1, this; - this.length = Math.ceil(f3.length / 3), this.words = new Array(this.length); + this.length = Math.ceil(f4.length / 3), this.words = new Array(this.length); for (var d4 = 0; d4 < this.length; d4++) this.words[d4] = 0; var g3, x3, M3 = 0; if (c2 === "be") - for (d4 = f3.length - 1, g3 = 0; d4 >= 0; d4 -= 3) - x3 = f3[d4] | f3[d4 - 1] << 8 | f3[d4 - 2] << 16, this.words[g3] |= x3 << M3 & 67108863, this.words[g3 + 1] = x3 >>> 26 - M3 & 67108863, M3 += 24, M3 >= 26 && (M3 -= 26, g3++); + for (d4 = f4.length - 1, g3 = 0; d4 >= 0; d4 -= 3) + x3 = f4[d4] | f4[d4 - 1] << 8 | f4[d4 - 2] << 16, this.words[g3] |= x3 << M3 & 67108863, this.words[g3 + 1] = x3 >>> 26 - M3 & 67108863, M3 += 24, M3 >= 26 && (M3 -= 26, g3++); else if (c2 === "le") - for (d4 = 0, g3 = 0; d4 < f3.length; d4 += 3) - x3 = f3[d4] | f3[d4 + 1] << 8 | f3[d4 + 2] << 16, this.words[g3] |= x3 << M3 & 67108863, this.words[g3 + 1] = x3 >>> 26 - M3 & 67108863, M3 += 24, M3 >= 26 && (M3 -= 26, g3++); + for (d4 = 0, g3 = 0; d4 < f4.length; d4 += 3) + x3 = f4[d4] | f4[d4 + 1] << 8 | f4[d4 + 2] << 16, this.words[g3] |= x3 << M3 & 67108863, this.words[g3 + 1] = x3 >>> 26 - M3 & 67108863, M3 += 24, M3 >= 26 && (M3 -= 26, g3++); return this._strip(); }; - function p3(A2, f3) { - var a3 = A2.charCodeAt(f3); + function p3(A2, f4) { + var a3 = A2.charCodeAt(f4); if (a3 >= 48 && a3 <= 57) return a3 - 48; if (a3 >= 65 && a3 <= 70) return a3 - 55; if (a3 >= 97 && a3 <= 102) return a3 - 87; - i3(false, "Invalid character in " + A2); + i2(false, "Invalid character in " + A2); } - function b2(A2, f3, a3) { + function b2(A2, f4, a3) { var c2 = p3(A2, a3); - return a3 - 1 >= f3 && (c2 |= p3(A2, a3 - 1) << 4), c2; + return a3 - 1 >= f4 && (c2 |= p3(A2, a3 - 1) << 4), c2; } - o2.prototype._parseHex = function(f3, a3, c2) { - this.length = Math.ceil((f3.length - a3) / 6), this.words = new Array(this.length); + o2.prototype._parseHex = function(f4, a3, c2) { + this.length = Math.ceil((f4.length - a3) / 6), this.words = new Array(this.length); for (var d4 = 0; d4 < this.length; d4++) this.words[d4] = 0; var g3 = 0, x3 = 0, M3; if (c2 === "be") - for (d4 = f3.length - 1; d4 >= a3; d4 -= 2) - M3 = b2(f3, a3, d4) << g3, this.words[x3] |= M3 & 67108863, g3 >= 18 ? (g3 -= 18, x3 += 1, this.words[x3] |= M3 >>> 26) : g3 += 8; + for (d4 = f4.length - 1; d4 >= a3; d4 -= 2) + M3 = b2(f4, a3, d4) << g3, this.words[x3] |= M3 & 67108863, g3 >= 18 ? (g3 -= 18, x3 += 1, this.words[x3] |= M3 >>> 26) : g3 += 8; else { - var l2 = f3.length - a3; - for (d4 = l2 % 2 === 0 ? a3 + 1 : a3; d4 < f3.length; d4 += 2) - M3 = b2(f3, a3, d4) << g3, this.words[x3] |= M3 & 67108863, g3 >= 18 ? (g3 -= 18, x3 += 1, this.words[x3] |= M3 >>> 26) : g3 += 8; + var l2 = f4.length - a3; + for (d4 = l2 % 2 === 0 ? a3 + 1 : a3; d4 < f4.length; d4 += 2) + M3 = b2(f4, a3, d4) << g3, this.words[x3] |= M3 & 67108863, g3 >= 18 ? (g3 -= 18, x3 += 1, this.words[x3] |= M3 >>> 26) : g3 += 8; } this._strip(); }; - function m3(A2, f3, a3, c2) { - for (var d4 = 0, g3 = 0, x3 = Math.min(A2.length, a3), M3 = f3; M3 < x3; M3++) { + function m3(A2, f4, a3, c2) { + for (var d4 = 0, g3 = 0, x3 = Math.min(A2.length, a3), M3 = f4; M3 < x3; M3++) { var l2 = A2.charCodeAt(M3) - 48; - d4 *= c2, l2 >= 49 ? g3 = l2 - 49 + 10 : l2 >= 17 ? g3 = l2 - 17 + 10 : g3 = l2, i3(l2 >= 0 && g3 < c2, "Invalid character"), d4 += g3; + d4 *= c2, l2 >= 49 ? g3 = l2 - 49 + 10 : l2 >= 17 ? g3 = l2 - 17 + 10 : g3 = l2, i2(l2 >= 0 && g3 < c2, "Invalid character"), d4 += g3; } return d4; } - o2.prototype._parseBase = function(f3, a3, c2) { + o2.prototype._parseBase = function(f4, a3, c2) { this.words = [0], this.length = 1; for (var d4 = 0, g3 = 1; g3 <= 67108863; g3 *= a3) d4++; d4--, g3 = g3 / a3 | 0; - for (var x3 = f3.length - c2, M3 = x3 % d4, l2 = Math.min(x3, x3 - M3) + c2, s2 = 0, v6 = c2; v6 < l2; v6 += d4) - s2 = m3(f3, v6, v6 + d4, a3), this.imuln(g3), this.words[0] + s2 < 67108864 ? this.words[0] += s2 : this._iaddn(s2); + for (var x3 = f4.length - c2, M3 = x3 % d4, l2 = Math.min(x3, x3 - M3) + c2, s2 = 0, v6 = c2; v6 < l2; v6 += d4) + s2 = m3(f4, v6, v6 + d4, a3), this.imuln(g3), this.words[0] + s2 < 67108864 ? this.words[0] += s2 : this._iaddn(s2); if (M3 !== 0) { var k2 = 1; - for (s2 = m3(f3, v6, f3.length, a3), v6 = 0; v6 < M3; v6++) + for (s2 = m3(f4, v6, f4.length, a3), v6 = 0; v6 < M3; v6++) k2 *= a3; this.imuln(k2), this.words[0] + s2 < 67108864 ? this.words[0] += s2 : this._iaddn(s2); } this._strip(); - }, o2.prototype.copy = function(f3) { - f3.words = new Array(this.length); + }, o2.prototype.copy = function(f4) { + f4.words = new Array(this.length); for (var a3 = 0; a3 < this.length; a3++) - f3.words[a3] = this.words[a3]; - f3.length = this.length, f3.negative = this.negative, f3.red = this.red; + f4.words[a3] = this.words[a3]; + f4.length = this.length, f4.negative = this.negative, f4.red = this.red; }; - function w2(A2, f3) { - A2.words = f3.words, A2.length = f3.length, A2.negative = f3.negative, A2.red = f3.red; + function w2(A2, f4) { + A2.words = f4.words, A2.length = f4.length, A2.negative = f4.negative, A2.red = f4.red; } - if (o2.prototype._move = function(f3) { - w2(f3, this); + if (o2.prototype._move = function(f4) { + w2(f4, this); }, o2.prototype.clone = function() { - var f3 = new o2(null); - return this.copy(f3), f3; - }, o2.prototype._expand = function(f3) { - for (; this.length < f3; ) + var f4 = new o2(null); + return this.copy(f4), f4; + }, o2.prototype._expand = function(f4) { + for (; this.length < f4; ) this.words[this.length++] = 0; return this; }, o2.prototype._strip = function() { @@ -92803,10 +22109,10 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d return (this.red ? ""; } var S4 = ["", "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"], I2 = [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], N2 = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; - o2.prototype.toString = function(f3, a3) { - f3 = f3 || 10, a3 = a3 | 0 || 1; + o2.prototype.toString = function(f4, a3) { + f4 = f4 || 10, a3 = a3 | 0 || 1; var c2; - if (f3 === 16 || f3 === "hex") { + if (f4 === 16 || f4 === "hex") { c2 = ""; for (var d4 = 0, g3 = 0, x3 = 0; x3 < this.length; x3++) { var M3 = this.words[x3], l2 = ((M3 << d4 | g3) & 16777215).toString(16); @@ -92816,156 +22122,156 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d c2 = "0" + c2; return this.negative !== 0 && (c2 = "-" + c2), c2; } - if (f3 === (f3 | 0) && f3 >= 2 && f3 <= 36) { - var s2 = I2[f3], v6 = N2[f3]; + if (f4 === (f4 | 0) && f4 >= 2 && f4 <= 36) { + var s2 = I2[f4], v6 = N2[f4]; c2 = ""; var k2 = this.clone(); for (k2.negative = 0; !k2.isZero(); ) { - var u2 = k2.modrn(v6).toString(f3); + var u2 = k2.modrn(v6).toString(f4); k2 = k2.idivn(v6), k2.isZero() ? c2 = u2 + c2 : c2 = S4[s2 - u2.length] + u2 + c2; } for (this.isZero() && (c2 = "0" + c2); c2.length % a3 !== 0; ) c2 = "0" + c2; return this.negative !== 0 && (c2 = "-" + c2), c2; } - i3(false, "Base should be between 2 and 36"); + i2(false, "Base should be between 2 and 36"); }, o2.prototype.toNumber = function() { - var f3 = this.words[0]; - return this.length === 2 ? f3 += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 ? f3 += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && i3(false, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -f3 : f3; + var f4 = this.words[0]; + return this.length === 2 ? f4 += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 ? f4 += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && i2(false, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -f4 : f4; }, o2.prototype.toJSON = function() { return this.toString(16, 2); - }, h4 && (o2.prototype.toBuffer = function(f3, a3) { - return this.toArrayLike(h4, f3, a3); - }), o2.prototype.toArray = function(f3, a3) { - return this.toArrayLike(Array, f3, a3); + }, h4 && (o2.prototype.toBuffer = function(f4, a3) { + return this.toArrayLike(h4, f4, a3); + }), o2.prototype.toArray = function(f4, a3) { + return this.toArrayLike(Array, f4, a3); }; - var C3 = function(f3, a3) { - return f3.allocUnsafe ? f3.allocUnsafe(a3) : new f3(a3); + var C3 = function(f4, a3) { + return f4.allocUnsafe ? f4.allocUnsafe(a3) : new f4(a3); }; - o2.prototype.toArrayLike = function(f3, a3, c2) { + o2.prototype.toArrayLike = function(f4, a3, c2) { this._strip(); var d4 = this.byteLength(), g3 = c2 || Math.max(1, d4); - i3(d4 <= g3, "byte array longer than desired length"), i3(g3 > 0, "Requested array length <= 0"); - var x3 = C3(f3, g3), M3 = a3 === "le" ? "LE" : "BE"; + i2(d4 <= g3, "byte array longer than desired length"), i2(g3 > 0, "Requested array length <= 0"); + var x3 = C3(f4, g3), M3 = a3 === "le" ? "LE" : "BE"; return this["_toArrayLike" + M3](x3, d4), x3; - }, o2.prototype._toArrayLikeLE = function(f3, a3) { + }, o2.prototype._toArrayLikeLE = function(f4, a3) { for (var c2 = 0, d4 = 0, g3 = 0, x3 = 0; g3 < this.length; g3++) { var M3 = this.words[g3] << x3 | d4; - f3[c2++] = M3 & 255, c2 < f3.length && (f3[c2++] = M3 >> 8 & 255), c2 < f3.length && (f3[c2++] = M3 >> 16 & 255), x3 === 6 ? (c2 < f3.length && (f3[c2++] = M3 >> 24 & 255), d4 = 0, x3 = 0) : (d4 = M3 >>> 24, x3 += 2); + f4[c2++] = M3 & 255, c2 < f4.length && (f4[c2++] = M3 >> 8 & 255), c2 < f4.length && (f4[c2++] = M3 >> 16 & 255), x3 === 6 ? (c2 < f4.length && (f4[c2++] = M3 >> 24 & 255), d4 = 0, x3 = 0) : (d4 = M3 >>> 24, x3 += 2); } - if (c2 < f3.length) - for (f3[c2++] = d4; c2 < f3.length; ) - f3[c2++] = 0; - }, o2.prototype._toArrayLikeBE = function(f3, a3) { - for (var c2 = f3.length - 1, d4 = 0, g3 = 0, x3 = 0; g3 < this.length; g3++) { + if (c2 < f4.length) + for (f4[c2++] = d4; c2 < f4.length; ) + f4[c2++] = 0; + }, o2.prototype._toArrayLikeBE = function(f4, a3) { + for (var c2 = f4.length - 1, d4 = 0, g3 = 0, x3 = 0; g3 < this.length; g3++) { var M3 = this.words[g3] << x3 | d4; - f3[c2--] = M3 & 255, c2 >= 0 && (f3[c2--] = M3 >> 8 & 255), c2 >= 0 && (f3[c2--] = M3 >> 16 & 255), x3 === 6 ? (c2 >= 0 && (f3[c2--] = M3 >> 24 & 255), d4 = 0, x3 = 0) : (d4 = M3 >>> 24, x3 += 2); + f4[c2--] = M3 & 255, c2 >= 0 && (f4[c2--] = M3 >> 8 & 255), c2 >= 0 && (f4[c2--] = M3 >> 16 & 255), x3 === 6 ? (c2 >= 0 && (f4[c2--] = M3 >> 24 & 255), d4 = 0, x3 = 0) : (d4 = M3 >>> 24, x3 += 2); } if (c2 >= 0) - for (f3[c2--] = d4; c2 >= 0; ) - f3[c2--] = 0; - }, Math.clz32 ? o2.prototype._countBits = function(f3) { - return 32 - Math.clz32(f3); - } : o2.prototype._countBits = function(f3) { - var a3 = f3, c2 = 0; + for (f4[c2--] = d4; c2 >= 0; ) + f4[c2--] = 0; + }, Math.clz32 ? o2.prototype._countBits = function(f4) { + return 32 - Math.clz32(f4); + } : o2.prototype._countBits = function(f4) { + var a3 = f4, c2 = 0; return a3 >= 4096 && (c2 += 13, a3 >>>= 13), a3 >= 64 && (c2 += 7, a3 >>>= 7), a3 >= 8 && (c2 += 4, a3 >>>= 4), a3 >= 2 && (c2 += 2, a3 >>>= 2), c2 + a3; - }, o2.prototype._zeroBits = function(f3) { - if (f3 === 0) + }, o2.prototype._zeroBits = function(f4) { + if (f4 === 0) return 26; - var a3 = f3, c2 = 0; + var a3 = f4, c2 = 0; return a3 & 8191 || (c2 += 13, a3 >>>= 13), a3 & 127 || (c2 += 7, a3 >>>= 7), a3 & 15 || (c2 += 4, a3 >>>= 4), a3 & 3 || (c2 += 2, a3 >>>= 2), a3 & 1 || c2++, c2; }, o2.prototype.bitLength = function() { - var f3 = this.words[this.length - 1], a3 = this._countBits(f3); + var f4 = this.words[this.length - 1], a3 = this._countBits(f4); return (this.length - 1) * 26 + a3; }; function F2(A2) { - for (var f3 = new Array(A2.bitLength()), a3 = 0; a3 < f3.length; a3++) { + for (var f4 = new Array(A2.bitLength()), a3 = 0; a3 < f4.length; a3++) { var c2 = a3 / 26 | 0, d4 = a3 % 26; - f3[a3] = A2.words[c2] >>> d4 & 1; + f4[a3] = A2.words[c2] >>> d4 & 1; } - return f3; + return f4; } o2.prototype.zeroBits = function() { if (this.isZero()) return 0; - for (var f3 = 0, a3 = 0; a3 < this.length; a3++) { + for (var f4 = 0, a3 = 0; a3 < this.length; a3++) { var c2 = this._zeroBits(this.words[a3]); - if (f3 += c2, c2 !== 26) + if (f4 += c2, c2 !== 26) break; } - return f3; + return f4; }, o2.prototype.byteLength = function() { return Math.ceil(this.bitLength() / 8); - }, o2.prototype.toTwos = function(f3) { - return this.negative !== 0 ? this.abs().inotn(f3).iaddn(1) : this.clone(); - }, o2.prototype.fromTwos = function(f3) { - return this.testn(f3 - 1) ? this.notn(f3).iaddn(1).ineg() : this.clone(); + }, o2.prototype.toTwos = function(f4) { + return this.negative !== 0 ? this.abs().inotn(f4).iaddn(1) : this.clone(); + }, o2.prototype.fromTwos = function(f4) { + return this.testn(f4 - 1) ? this.notn(f4).iaddn(1).ineg() : this.clone(); }, o2.prototype.isNeg = function() { return this.negative !== 0; }, o2.prototype.neg = function() { return this.clone().ineg(); }, o2.prototype.ineg = function() { return this.isZero() || (this.negative ^= 1), this; - }, o2.prototype.iuor = function(f3) { - for (; this.length < f3.length; ) + }, o2.prototype.iuor = function(f4) { + for (; this.length < f4.length; ) this.words[this.length++] = 0; - for (var a3 = 0; a3 < f3.length; a3++) - this.words[a3] = this.words[a3] | f3.words[a3]; + for (var a3 = 0; a3 < f4.length; a3++) + this.words[a3] = this.words[a3] | f4.words[a3]; return this._strip(); - }, o2.prototype.ior = function(f3) { - return i3((this.negative | f3.negative) === 0), this.iuor(f3); - }, o2.prototype.or = function(f3) { - return this.length > f3.length ? this.clone().ior(f3) : f3.clone().ior(this); - }, o2.prototype.uor = function(f3) { - return this.length > f3.length ? this.clone().iuor(f3) : f3.clone().iuor(this); - }, o2.prototype.iuand = function(f3) { + }, o2.prototype.ior = function(f4) { + return i2((this.negative | f4.negative) === 0), this.iuor(f4); + }, o2.prototype.or = function(f4) { + return this.length > f4.length ? this.clone().ior(f4) : f4.clone().ior(this); + }, o2.prototype.uor = function(f4) { + return this.length > f4.length ? this.clone().iuor(f4) : f4.clone().iuor(this); + }, o2.prototype.iuand = function(f4) { var a3; - this.length > f3.length ? a3 = f3 : a3 = this; + this.length > f4.length ? a3 = f4 : a3 = this; for (var c2 = 0; c2 < a3.length; c2++) - this.words[c2] = this.words[c2] & f3.words[c2]; + this.words[c2] = this.words[c2] & f4.words[c2]; return this.length = a3.length, this._strip(); - }, o2.prototype.iand = function(f3) { - return i3((this.negative | f3.negative) === 0), this.iuand(f3); - }, o2.prototype.and = function(f3) { - return this.length > f3.length ? this.clone().iand(f3) : f3.clone().iand(this); - }, o2.prototype.uand = function(f3) { - return this.length > f3.length ? this.clone().iuand(f3) : f3.clone().iuand(this); - }, o2.prototype.iuxor = function(f3) { + }, o2.prototype.iand = function(f4) { + return i2((this.negative | f4.negative) === 0), this.iuand(f4); + }, o2.prototype.and = function(f4) { + return this.length > f4.length ? this.clone().iand(f4) : f4.clone().iand(this); + }, o2.prototype.uand = function(f4) { + return this.length > f4.length ? this.clone().iuand(f4) : f4.clone().iuand(this); + }, o2.prototype.iuxor = function(f4) { var a3, c2; - this.length > f3.length ? (a3 = this, c2 = f3) : (a3 = f3, c2 = this); + this.length > f4.length ? (a3 = this, c2 = f4) : (a3 = f4, c2 = this); for (var d4 = 0; d4 < c2.length; d4++) this.words[d4] = a3.words[d4] ^ c2.words[d4]; if (this !== a3) for (; d4 < a3.length; d4++) this.words[d4] = a3.words[d4]; return this.length = a3.length, this._strip(); - }, o2.prototype.ixor = function(f3) { - return i3((this.negative | f3.negative) === 0), this.iuxor(f3); - }, o2.prototype.xor = function(f3) { - return this.length > f3.length ? this.clone().ixor(f3) : f3.clone().ixor(this); - }, o2.prototype.uxor = function(f3) { - return this.length > f3.length ? this.clone().iuxor(f3) : f3.clone().iuxor(this); - }, o2.prototype.inotn = function(f3) { - i3(typeof f3 == "number" && f3 >= 0); - var a3 = Math.ceil(f3 / 26) | 0, c2 = f3 % 26; + }, o2.prototype.ixor = function(f4) { + return i2((this.negative | f4.negative) === 0), this.iuxor(f4); + }, o2.prototype.xor = function(f4) { + return this.length > f4.length ? this.clone().ixor(f4) : f4.clone().ixor(this); + }, o2.prototype.uxor = function(f4) { + return this.length > f4.length ? this.clone().iuxor(f4) : f4.clone().iuxor(this); + }, o2.prototype.inotn = function(f4) { + i2(typeof f4 == "number" && f4 >= 0); + var a3 = Math.ceil(f4 / 26) | 0, c2 = f4 % 26; this._expand(a3), c2 > 0 && a3--; for (var d4 = 0; d4 < a3; d4++) this.words[d4] = ~this.words[d4] & 67108863; return c2 > 0 && (this.words[d4] = ~this.words[d4] & 67108863 >> 26 - c2), this._strip(); - }, o2.prototype.notn = function(f3) { - return this.clone().inotn(f3); - }, o2.prototype.setn = function(f3, a3) { - i3(typeof f3 == "number" && f3 >= 0); - var c2 = f3 / 26 | 0, d4 = f3 % 26; + }, o2.prototype.notn = function(f4) { + return this.clone().inotn(f4); + }, o2.prototype.setn = function(f4, a3) { + i2(typeof f4 == "number" && f4 >= 0); + var c2 = f4 / 26 | 0, d4 = f4 % 26; return this._expand(c2 + 1), a3 ? this.words[c2] = this.words[c2] | 1 << d4 : this.words[c2] = this.words[c2] & ~(1 << d4), this._strip(); - }, o2.prototype.iadd = function(f3) { + }, o2.prototype.iadd = function(f4) { var a3; - if (this.negative !== 0 && f3.negative === 0) - return this.negative = 0, a3 = this.isub(f3), this.negative ^= 1, this._normSign(); - if (this.negative === 0 && f3.negative !== 0) - return f3.negative = 0, a3 = this.isub(f3), f3.negative = 1, a3._normSign(); + if (this.negative !== 0 && f4.negative === 0) + return this.negative = 0, a3 = this.isub(f4), this.negative ^= 1, this._normSign(); + if (this.negative === 0 && f4.negative !== 0) + return f4.negative = 0, a3 = this.isub(f4), f4.negative = 1, a3._normSign(); var c2, d4; - this.length > f3.length ? (c2 = this, d4 = f3) : (c2 = f3, d4 = this); + this.length > f4.length ? (c2 = this, d4 = f4) : (c2 = f4, d4 = this); for (var g3 = 0, x3 = 0; x3 < d4.length; x3++) a3 = (c2.words[x3] | 0) + (d4.words[x3] | 0) + g3, this.words[x3] = a3 & 67108863, g3 = a3 >>> 26; for (; g3 !== 0 && x3 < c2.length; x3++) @@ -92976,21 +22282,21 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d for (; x3 < c2.length; x3++) this.words[x3] = c2.words[x3]; return this; - }, o2.prototype.add = function(f3) { + }, o2.prototype.add = function(f4) { var a3; - return f3.negative !== 0 && this.negative === 0 ? (f3.negative = 0, a3 = this.sub(f3), f3.negative ^= 1, a3) : f3.negative === 0 && this.negative !== 0 ? (this.negative = 0, a3 = f3.sub(this), this.negative = 1, a3) : this.length > f3.length ? this.clone().iadd(f3) : f3.clone().iadd(this); - }, o2.prototype.isub = function(f3) { - if (f3.negative !== 0) { - f3.negative = 0; - var a3 = this.iadd(f3); - return f3.negative = 1, a3._normSign(); + return f4.negative !== 0 && this.negative === 0 ? (f4.negative = 0, a3 = this.sub(f4), f4.negative ^= 1, a3) : f4.negative === 0 && this.negative !== 0 ? (this.negative = 0, a3 = f4.sub(this), this.negative = 1, a3) : this.length > f4.length ? this.clone().iadd(f4) : f4.clone().iadd(this); + }, o2.prototype.isub = function(f4) { + if (f4.negative !== 0) { + f4.negative = 0; + var a3 = this.iadd(f4); + return f4.negative = 1, a3._normSign(); } else if (this.negative !== 0) - return this.negative = 0, this.iadd(f3), this.negative = 1, this._normSign(); - var c2 = this.cmp(f3); + return this.negative = 0, this.iadd(f4), this.negative = 1, this._normSign(); + var c2 = this.cmp(f4); if (c2 === 0) return this.negative = 0, this.length = 1, this.words[0] = 0, this; var d4, g3; - c2 > 0 ? (d4 = this, g3 = f3) : (d4 = f3, g3 = this); + c2 > 0 ? (d4 = this, g3 = f4) : (d4 = f4, g3 = this); for (var x3 = 0, M3 = 0; M3 < g3.length; M3++) a3 = (d4.words[M3] | 0) - (g3.words[M3] | 0) + x3, x3 = a3 >> 26, this.words[M3] = a3 & 67108863; for (; x3 !== 0 && M3 < d4.length; M3++) @@ -92999,27 +22305,27 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d for (; M3 < d4.length; M3++) this.words[M3] = d4.words[M3]; return this.length = Math.max(this.length, M3), d4 !== this && (this.negative = 1), this._strip(); - }, o2.prototype.sub = function(f3) { - return this.clone().isub(f3); + }, o2.prototype.sub = function(f4) { + return this.clone().isub(f4); }; - function U5(A2, f3, a3) { - a3.negative = f3.negative ^ A2.negative; - var c2 = A2.length + f3.length | 0; + function U5(A2, f4, a3) { + a3.negative = f4.negative ^ A2.negative; + var c2 = A2.length + f4.length | 0; a3.length = c2, c2 = c2 - 1 | 0; - var d4 = A2.words[0] | 0, g3 = f3.words[0] | 0, x3 = d4 * g3, M3 = x3 & 67108863, l2 = x3 / 67108864 | 0; + var d4 = A2.words[0] | 0, g3 = f4.words[0] | 0, x3 = d4 * g3, M3 = x3 & 67108863, l2 = x3 / 67108864 | 0; a3.words[0] = M3; for (var s2 = 1; s2 < c2; s2++) { - for (var v6 = l2 >>> 26, k2 = l2 & 67108863, u2 = Math.min(s2, f3.length - 1), E2 = Math.max(0, s2 - A2.length + 1); E2 <= u2; E2++) { + for (var v6 = l2 >>> 26, k2 = l2 & 67108863, u2 = Math.min(s2, f4.length - 1), E2 = Math.max(0, s2 - A2.length + 1); E2 <= u2; E2++) { var _3 = s2 - E2 | 0; - d4 = A2.words[_3] | 0, g3 = f3.words[E2] | 0, x3 = d4 * g3 + k2, v6 += x3 / 67108864 | 0, k2 = x3 & 67108863; + d4 = A2.words[_3] | 0, g3 = f4.words[E2] | 0, x3 = d4 * g3 + k2, v6 += x3 / 67108864 | 0, k2 = x3 & 67108863; } a3.words[s2] = k2 | 0, l2 = v6 | 0; } return l2 !== 0 ? a3.words[s2] = l2 | 0 : a3.length--, a3._strip(); } - var J2 = function(f3, a3, c2) { - var d4 = f3.words, g3 = a3.words, x3 = c2.words, M3 = 0, l2, s2, v6, k2 = d4[0] | 0, u2 = k2 & 8191, E2 = k2 >>> 13, _3 = d4[1] | 0, B2 = _3 & 8191, R3 = _3 >>> 13, T9 = d4[2] | 0, P2 = T9 & 8191, O3 = T9 >>> 13, Ct2 = d4[3] | 0, D2 = Ct2 & 8191, q2 = Ct2 >>> 13, De2 = d4[4] | 0, X2 = De2 & 8191, Z2 = De2 >>> 13, Fe2 = d4[5] | 0, $ = Fe2 & 8191, tt2 = Fe2 >>> 13, Te2 = d4[6] | 0, et2 = Te2 & 8191, rt2 = Te2 >>> 13, Ue2 = d4[7] | 0, it2 = Ue2 & 8191, nt2 = Ue2 >>> 13, ke2 = d4[8] | 0, ft2 = ke2 & 8191, ot2 = ke2 >>> 13, qe2 = d4[9] | 0, st2 = qe2 & 8191, at2 = qe2 >>> 13, Ke2 = g3[0] | 0, ut2 = Ke2 & 8191, ht2 = Ke2 >>> 13, He2 = g3[1] | 0, ct2 = He2 & 8191, lt2 = He2 >>> 13, ze2 = g3[2] | 0, dt2 = ze2 & 8191, pt2 = ze2 >>> 13, Le2 = g3[3] | 0, vt2 = Le2 & 8191, mt2 = Le2 >>> 13, je2 = g3[4] | 0, gt2 = je2 & 8191, At2 = je2 >>> 13, Qe2 = g3[5] | 0, bt2 = Qe2 & 8191, yt2 = Qe2 >>> 13, Je2 = g3[6] | 0, wt2 = Je2 & 8191, xt2 = Je2 >>> 13, Ge2 = g3[7] | 0, Mt2 = Ge2 & 8191, Et2 = Ge2 >>> 13, Ye2 = g3[8] | 0, St2 = Ye2 & 8191, Nt2 = Ye2 >>> 13, Ve2 = g3[9] | 0, It2 = Ve2 & 8191, _t2 = Ve2 >>> 13; - c2.negative = f3.negative ^ a3.negative, c2.length = 19, l2 = Math.imul(u2, ut2), s2 = Math.imul(u2, ht2), s2 = s2 + Math.imul(E2, ut2) | 0, v6 = Math.imul(E2, ht2); + var J2 = function(f4, a3, c2) { + var d4 = f4.words, g3 = a3.words, x3 = c2.words, M3 = 0, l2, s2, v6, k2 = d4[0] | 0, u2 = k2 & 8191, E2 = k2 >>> 13, _3 = d4[1] | 0, B2 = _3 & 8191, R3 = _3 >>> 13, T9 = d4[2] | 0, P2 = T9 & 8191, O3 = T9 >>> 13, Ct2 = d4[3] | 0, D2 = Ct2 & 8191, q2 = Ct2 >>> 13, De2 = d4[4] | 0, X2 = De2 & 8191, Z2 = De2 >>> 13, Fe2 = d4[5] | 0, $ = Fe2 & 8191, tt2 = Fe2 >>> 13, Te2 = d4[6] | 0, et2 = Te2 & 8191, rt2 = Te2 >>> 13, Ue2 = d4[7] | 0, it2 = Ue2 & 8191, nt2 = Ue2 >>> 13, ke2 = d4[8] | 0, ft2 = ke2 & 8191, ot2 = ke2 >>> 13, qe2 = d4[9] | 0, st2 = qe2 & 8191, at2 = qe2 >>> 13, Ke2 = g3[0] | 0, ut2 = Ke2 & 8191, ht2 = Ke2 >>> 13, He2 = g3[1] | 0, ct2 = He2 & 8191, lt2 = He2 >>> 13, ze2 = g3[2] | 0, dt2 = ze2 & 8191, pt2 = ze2 >>> 13, Le2 = g3[3] | 0, vt2 = Le2 & 8191, mt2 = Le2 >>> 13, je2 = g3[4] | 0, gt2 = je2 & 8191, At2 = je2 >>> 13, Qe2 = g3[5] | 0, bt2 = Qe2 & 8191, yt2 = Qe2 >>> 13, Je2 = g3[6] | 0, wt2 = Je2 & 8191, xt2 = Je2 >>> 13, Ge2 = g3[7] | 0, Mt2 = Ge2 & 8191, Et2 = Ge2 >>> 13, Ye2 = g3[8] | 0, St2 = Ye2 & 8191, Nt2 = Ye2 >>> 13, Ve2 = g3[9] | 0, It2 = Ve2 & 8191, _t2 = Ve2 >>> 13; + c2.negative = f4.negative ^ a3.negative, c2.length = 19, l2 = Math.imul(u2, ut2), s2 = Math.imul(u2, ht2), s2 = s2 + Math.imul(E2, ut2) | 0, v6 = Math.imul(E2, ht2); var Me2 = (M3 + l2 | 0) + ((s2 & 8191) << 13) | 0; M3 = (v6 + (s2 >>> 13) | 0) + (Me2 >>> 26) | 0, Me2 &= 67108863, l2 = Math.imul(B2, ut2), s2 = Math.imul(B2, ht2), s2 = s2 + Math.imul(R3, ut2) | 0, v6 = Math.imul(R3, ht2), l2 = l2 + Math.imul(u2, ct2) | 0, s2 = s2 + Math.imul(u2, lt2) | 0, s2 = s2 + Math.imul(E2, ct2) | 0, v6 = v6 + Math.imul(E2, lt2) | 0; var Ee2 = (M3 + l2 | 0) + ((s2 & 8191) << 13) | 0; @@ -93060,49 +22366,49 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d return M3 = (v6 + (s2 >>> 13) | 0) + (ui2 >>> 26) | 0, ui2 &= 67108863, x3[0] = Me2, x3[1] = Ee2, x3[2] = Se2, x3[3] = Ne2, x3[4] = Ie2, x3[5] = Wr2, x3[6] = Xr2, x3[7] = Zr2, x3[8] = $r2, x3[9] = ti2, x3[10] = ei2, x3[11] = ri2, x3[12] = ii2, x3[13] = ni2, x3[14] = fi2, x3[15] = oi2, x3[16] = si2, x3[17] = ai2, x3[18] = ui2, M3 !== 0 && (x3[19] = M3, c2.length++), c2; }; Math.imul || (J2 = U5); - function Bt2(A2, f3, a3) { - a3.negative = f3.negative ^ A2.negative, a3.length = A2.length + f3.length; + function Bt2(A2, f4, a3) { + a3.negative = f4.negative ^ A2.negative, a3.length = A2.length + f4.length; for (var c2 = 0, d4 = 0, g3 = 0; g3 < a3.length - 1; g3++) { var x3 = d4; d4 = 0; - for (var M3 = c2 & 67108863, l2 = Math.min(g3, f3.length - 1), s2 = Math.max(0, g3 - A2.length + 1); s2 <= l2; s2++) { - var v6 = g3 - s2, k2 = A2.words[v6] | 0, u2 = f3.words[s2] | 0, E2 = k2 * u2, _3 = E2 & 67108863; + for (var M3 = c2 & 67108863, l2 = Math.min(g3, f4.length - 1), s2 = Math.max(0, g3 - A2.length + 1); s2 <= l2; s2++) { + var v6 = g3 - s2, k2 = A2.words[v6] | 0, u2 = f4.words[s2] | 0, E2 = k2 * u2, _3 = E2 & 67108863; x3 = x3 + (E2 / 67108864 | 0) | 0, _3 = _3 + M3 | 0, M3 = _3 & 67108863, x3 = x3 + (_3 >>> 26) | 0, d4 += x3 >>> 26, x3 &= 67108863; } a3.words[g3] = M3, c2 = x3, x3 = d4; } return c2 !== 0 ? a3.words[g3] = c2 : a3.length--, a3._strip(); } - function G2(A2, f3, a3) { - return Bt2(A2, f3, a3); + function G2(A2, f4, a3) { + return Bt2(A2, f4, a3); } - o2.prototype.mulTo = function(f3, a3) { - var c2, d4 = this.length + f3.length; - return this.length === 10 && f3.length === 10 ? c2 = J2(this, f3, a3) : d4 < 63 ? c2 = U5(this, f3, a3) : d4 < 1024 ? c2 = Bt2(this, f3, a3) : c2 = G2(this, f3, a3), c2; - }, o2.prototype.mul = function(f3) { + o2.prototype.mulTo = function(f4, a3) { + var c2, d4 = this.length + f4.length; + return this.length === 10 && f4.length === 10 ? c2 = J2(this, f4, a3) : d4 < 63 ? c2 = U5(this, f4, a3) : d4 < 1024 ? c2 = Bt2(this, f4, a3) : c2 = G2(this, f4, a3), c2; + }, o2.prototype.mul = function(f4) { var a3 = new o2(null); - return a3.words = new Array(this.length + f3.length), this.mulTo(f3, a3); - }, o2.prototype.mulf = function(f3) { + return a3.words = new Array(this.length + f4.length), this.mulTo(f4, a3); + }, o2.prototype.mulf = function(f4) { var a3 = new o2(null); - return a3.words = new Array(this.length + f3.length), G2(this, f3, a3); - }, o2.prototype.imul = function(f3) { - return this.clone().mulTo(f3, this); - }, o2.prototype.imuln = function(f3) { - var a3 = f3 < 0; - a3 && (f3 = -f3), i3(typeof f3 == "number"), i3(f3 < 67108864); + return a3.words = new Array(this.length + f4.length), G2(this, f4, a3); + }, o2.prototype.imul = function(f4) { + return this.clone().mulTo(f4, this); + }, o2.prototype.imuln = function(f4) { + var a3 = f4 < 0; + a3 && (f4 = -f4), i2(typeof f4 == "number"), i2(f4 < 67108864); for (var c2 = 0, d4 = 0; d4 < this.length; d4++) { - var g3 = (this.words[d4] | 0) * f3, x3 = (g3 & 67108863) + (c2 & 67108863); + var g3 = (this.words[d4] | 0) * f4, x3 = (g3 & 67108863) + (c2 & 67108863); c2 >>= 26, c2 += g3 / 67108864 | 0, c2 += x3 >>> 26, this.words[d4] = x3 & 67108863; } return c2 !== 0 && (this.words[d4] = c2, this.length++), a3 ? this.ineg() : this; - }, o2.prototype.muln = function(f3) { - return this.clone().imuln(f3); + }, o2.prototype.muln = function(f4) { + return this.clone().imuln(f4); }, o2.prototype.sqr = function() { return this.mul(this); }, o2.prototype.isqr = function() { return this.imul(this.clone()); - }, o2.prototype.pow = function(f3) { - var a3 = F2(f3); + }, o2.prototype.pow = function(f4) { + var a3 = F2(f4); if (a3.length === 0) return new o2(1); for (var c2 = this, d4 = 0; d4 < a3.length && a3[d4] === 0; d4++, c2 = c2.sqr()) @@ -93111,9 +22417,9 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d for (var g3 = c2.sqr(); d4 < a3.length; d4++, g3 = g3.sqr()) a3[d4] !== 0 && (c2 = c2.mul(g3)); return c2; - }, o2.prototype.iushln = function(f3) { - i3(typeof f3 == "number" && f3 >= 0); - var a3 = f3 % 26, c2 = (f3 - a3) / 26, d4 = 67108863 >>> 26 - a3 << 26 - a3, g3; + }, o2.prototype.iushln = function(f4) { + i2(typeof f4 == "number" && f4 >= 0); + var a3 = f4 % 26, c2 = (f4 - a3) / 26, d4 = 67108863 >>> 26 - a3 << 26 - a3, g3; if (a3 !== 0) { var x3 = 0; for (g3 = 0; g3 < this.length; g3++) { @@ -93130,13 +22436,13 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d this.length += c2; } return this._strip(); - }, o2.prototype.ishln = function(f3) { - return i3(this.negative === 0), this.iushln(f3); - }, o2.prototype.iushrn = function(f3, a3, c2) { - i3(typeof f3 == "number" && f3 >= 0); + }, o2.prototype.ishln = function(f4) { + return i2(this.negative === 0), this.iushln(f4); + }, o2.prototype.iushrn = function(f4, a3, c2) { + i2(typeof f4 == "number" && f4 >= 0); var d4; a3 ? d4 = (a3 - a3 % 26) / 26 : d4 = 0; - var g3 = f3 % 26, x3 = Math.min((f3 - g3) / 26, this.length), M3 = 67108863 ^ 67108863 >>> g3 << g3, l2 = c2; + var g3 = f4 % 26, x3 = Math.min((f4 - g3) / 26, this.length), M3 = 67108863 ^ 67108863 >>> g3 << g3, l2 = c2; if (d4 -= x3, d4 = Math.max(0, d4), l2) { for (var s2 = 0; s2 < x3; s2++) l2.words[s2] = this.words[s2]; @@ -93154,79 +22460,79 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d this.words[s2] = v6 << 26 - g3 | k2 >>> g3, v6 = k2 & M3; } return l2 && v6 !== 0 && (l2.words[l2.length++] = v6), this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip(); - }, o2.prototype.ishrn = function(f3, a3, c2) { - return i3(this.negative === 0), this.iushrn(f3, a3, c2); - }, o2.prototype.shln = function(f3) { - return this.clone().ishln(f3); - }, o2.prototype.ushln = function(f3) { - return this.clone().iushln(f3); - }, o2.prototype.shrn = function(f3) { - return this.clone().ishrn(f3); - }, o2.prototype.ushrn = function(f3) { - return this.clone().iushrn(f3); - }, o2.prototype.testn = function(f3) { - i3(typeof f3 == "number" && f3 >= 0); - var a3 = f3 % 26, c2 = (f3 - a3) / 26, d4 = 1 << a3; + }, o2.prototype.ishrn = function(f4, a3, c2) { + return i2(this.negative === 0), this.iushrn(f4, a3, c2); + }, o2.prototype.shln = function(f4) { + return this.clone().ishln(f4); + }, o2.prototype.ushln = function(f4) { + return this.clone().iushln(f4); + }, o2.prototype.shrn = function(f4) { + return this.clone().ishrn(f4); + }, o2.prototype.ushrn = function(f4) { + return this.clone().iushrn(f4); + }, o2.prototype.testn = function(f4) { + i2(typeof f4 == "number" && f4 >= 0); + var a3 = f4 % 26, c2 = (f4 - a3) / 26, d4 = 1 << a3; if (this.length <= c2) return false; var g3 = this.words[c2]; return !!(g3 & d4); - }, o2.prototype.imaskn = function(f3) { - i3(typeof f3 == "number" && f3 >= 0); - var a3 = f3 % 26, c2 = (f3 - a3) / 26; - if (i3(this.negative === 0, "imaskn works only with positive numbers"), this.length <= c2) + }, o2.prototype.imaskn = function(f4) { + i2(typeof f4 == "number" && f4 >= 0); + var a3 = f4 % 26, c2 = (f4 - a3) / 26; + if (i2(this.negative === 0, "imaskn works only with positive numbers"), this.length <= c2) return this; if (a3 !== 0 && c2++, this.length = Math.min(c2, this.length), a3 !== 0) { var d4 = 67108863 ^ 67108863 >>> a3 << a3; this.words[this.length - 1] &= d4; } return this._strip(); - }, o2.prototype.maskn = function(f3) { - return this.clone().imaskn(f3); - }, o2.prototype.iaddn = function(f3) { - return i3(typeof f3 == "number"), i3(f3 < 67108864), f3 < 0 ? this.isubn(-f3) : this.negative !== 0 ? this.length === 1 && (this.words[0] | 0) <= f3 ? (this.words[0] = f3 - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(f3), this.negative = 1, this) : this._iaddn(f3); - }, o2.prototype._iaddn = function(f3) { - this.words[0] += f3; + }, o2.prototype.maskn = function(f4) { + return this.clone().imaskn(f4); + }, o2.prototype.iaddn = function(f4) { + return i2(typeof f4 == "number"), i2(f4 < 67108864), f4 < 0 ? this.isubn(-f4) : this.negative !== 0 ? this.length === 1 && (this.words[0] | 0) <= f4 ? (this.words[0] = f4 - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(f4), this.negative = 1, this) : this._iaddn(f4); + }, o2.prototype._iaddn = function(f4) { + this.words[0] += f4; for (var a3 = 0; a3 < this.length && this.words[a3] >= 67108864; a3++) this.words[a3] -= 67108864, a3 === this.length - 1 ? this.words[a3 + 1] = 1 : this.words[a3 + 1]++; return this.length = Math.max(this.length, a3 + 1), this; - }, o2.prototype.isubn = function(f3) { - if (i3(typeof f3 == "number"), i3(f3 < 67108864), f3 < 0) - return this.iaddn(-f3); + }, o2.prototype.isubn = function(f4) { + if (i2(typeof f4 == "number"), i2(f4 < 67108864), f4 < 0) + return this.iaddn(-f4); if (this.negative !== 0) - return this.negative = 0, this.iaddn(f3), this.negative = 1, this; - if (this.words[0] -= f3, this.length === 1 && this.words[0] < 0) + return this.negative = 0, this.iaddn(f4), this.negative = 1, this; + if (this.words[0] -= f4, this.length === 1 && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1; else for (var a3 = 0; a3 < this.length && this.words[a3] < 0; a3++) this.words[a3] += 67108864, this.words[a3 + 1] -= 1; return this._strip(); - }, o2.prototype.addn = function(f3) { - return this.clone().iaddn(f3); - }, o2.prototype.subn = function(f3) { - return this.clone().isubn(f3); + }, o2.prototype.addn = function(f4) { + return this.clone().iaddn(f4); + }, o2.prototype.subn = function(f4) { + return this.clone().isubn(f4); }, o2.prototype.iabs = function() { return this.negative = 0, this; }, o2.prototype.abs = function() { return this.clone().iabs(); - }, o2.prototype._ishlnsubmul = function(f3, a3, c2) { - var d4 = f3.length + c2, g3; + }, o2.prototype._ishlnsubmul = function(f4, a3, c2) { + var d4 = f4.length + c2, g3; this._expand(d4); var x3, M3 = 0; - for (g3 = 0; g3 < f3.length; g3++) { + for (g3 = 0; g3 < f4.length; g3++) { x3 = (this.words[g3 + c2] | 0) + M3; - var l2 = (f3.words[g3] | 0) * a3; + var l2 = (f4.words[g3] | 0) * a3; x3 -= l2 & 67108863, M3 = (x3 >> 26) - (l2 / 67108864 | 0), this.words[g3 + c2] = x3 & 67108863; } for (; g3 < this.length - c2; g3++) x3 = (this.words[g3 + c2] | 0) + M3, M3 = x3 >> 26, this.words[g3 + c2] = x3 & 67108863; if (M3 === 0) return this._strip(); - for (i3(M3 === -1), M3 = 0, g3 = 0; g3 < this.length; g3++) + for (i2(M3 === -1), M3 = 0, g3 = 0; g3 < this.length; g3++) x3 = -(this.words[g3] | 0) + M3, M3 = x3 >> 26, this.words[g3] = x3 & 67108863; return this.negative = 1, this._strip(); - }, o2.prototype._wordDiv = function(f3, a3) { - var c2 = this.length - f3.length, d4 = this.clone(), g3 = f3, x3 = g3.words[g3.length - 1] | 0, M3 = this._countBits(x3); + }, o2.prototype._wordDiv = function(f4, a3) { + var c2 = this.length - f4.length, d4 = this.clone(), g3 = f4, x3 = g3.words[g3.length - 1] | 0, M3 = this._countBits(x3); c2 = 26 - M3, c2 !== 0 && (g3 = g3.ushln(c2), d4.iushln(c2), x3 = g3.words[g3.length - 1] | 0); var l2 = d4.length - g3.length, s2; if (a3 !== "mod") { @@ -93243,45 +22549,45 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d s2 && (s2.words[u2] = E2); } return s2 && s2._strip(), d4._strip(), a3 !== "div" && c2 !== 0 && d4.iushrn(c2), { div: s2 || null, mod: d4 }; - }, o2.prototype.divmod = function(f3, a3, c2) { - if (i3(!f3.isZero()), this.isZero()) + }, o2.prototype.divmod = function(f4, a3, c2) { + if (i2(!f4.isZero()), this.isZero()) return { div: new o2(0), mod: new o2(0) }; var d4, g3, x3; - return this.negative !== 0 && f3.negative === 0 ? (x3 = this.neg().divmod(f3, a3), a3 !== "mod" && (d4 = x3.div.neg()), a3 !== "div" && (g3 = x3.mod.neg(), c2 && g3.negative !== 0 && g3.iadd(f3)), { div: d4, mod: g3 }) : this.negative === 0 && f3.negative !== 0 ? (x3 = this.divmod(f3.neg(), a3), a3 !== "mod" && (d4 = x3.div.neg()), { div: d4, mod: x3.mod }) : this.negative & f3.negative ? (x3 = this.neg().divmod(f3.neg(), a3), a3 !== "div" && (g3 = x3.mod.neg(), c2 && g3.negative !== 0 && g3.isub(f3)), { div: x3.div, mod: g3 }) : f3.length > this.length || this.cmp(f3) < 0 ? { div: new o2(0), mod: this } : f3.length === 1 ? a3 === "div" ? { div: this.divn(f3.words[0]), mod: null } : a3 === "mod" ? { div: null, mod: new o2(this.modrn(f3.words[0])) } : { div: this.divn(f3.words[0]), mod: new o2(this.modrn(f3.words[0])) } : this._wordDiv(f3, a3); - }, o2.prototype.div = function(f3) { - return this.divmod(f3, "div", false).div; - }, o2.prototype.mod = function(f3) { - return this.divmod(f3, "mod", false).mod; - }, o2.prototype.umod = function(f3) { - return this.divmod(f3, "mod", true).mod; - }, o2.prototype.divRound = function(f3) { - var a3 = this.divmod(f3); + return this.negative !== 0 && f4.negative === 0 ? (x3 = this.neg().divmod(f4, a3), a3 !== "mod" && (d4 = x3.div.neg()), a3 !== "div" && (g3 = x3.mod.neg(), c2 && g3.negative !== 0 && g3.iadd(f4)), { div: d4, mod: g3 }) : this.negative === 0 && f4.negative !== 0 ? (x3 = this.divmod(f4.neg(), a3), a3 !== "mod" && (d4 = x3.div.neg()), { div: d4, mod: x3.mod }) : this.negative & f4.negative ? (x3 = this.neg().divmod(f4.neg(), a3), a3 !== "div" && (g3 = x3.mod.neg(), c2 && g3.negative !== 0 && g3.isub(f4)), { div: x3.div, mod: g3 }) : f4.length > this.length || this.cmp(f4) < 0 ? { div: new o2(0), mod: this } : f4.length === 1 ? a3 === "div" ? { div: this.divn(f4.words[0]), mod: null } : a3 === "mod" ? { div: null, mod: new o2(this.modrn(f4.words[0])) } : { div: this.divn(f4.words[0]), mod: new o2(this.modrn(f4.words[0])) } : this._wordDiv(f4, a3); + }, o2.prototype.div = function(f4) { + return this.divmod(f4, "div", false).div; + }, o2.prototype.mod = function(f4) { + return this.divmod(f4, "mod", false).mod; + }, o2.prototype.umod = function(f4) { + return this.divmod(f4, "mod", true).mod; + }, o2.prototype.divRound = function(f4) { + var a3 = this.divmod(f4); if (a3.mod.isZero()) return a3.div; - var c2 = a3.div.negative !== 0 ? a3.mod.isub(f3) : a3.mod, d4 = f3.ushrn(1), g3 = f3.andln(1), x3 = c2.cmp(d4); + var c2 = a3.div.negative !== 0 ? a3.mod.isub(f4) : a3.mod, d4 = f4.ushrn(1), g3 = f4.andln(1), x3 = c2.cmp(d4); return x3 < 0 || g3 === 1 && x3 === 0 ? a3.div : a3.div.negative !== 0 ? a3.div.isubn(1) : a3.div.iaddn(1); - }, o2.prototype.modrn = function(f3) { - var a3 = f3 < 0; - a3 && (f3 = -f3), i3(f3 <= 67108863); - for (var c2 = (1 << 26) % f3, d4 = 0, g3 = this.length - 1; g3 >= 0; g3--) - d4 = (c2 * d4 + (this.words[g3] | 0)) % f3; + }, o2.prototype.modrn = function(f4) { + var a3 = f4 < 0; + a3 && (f4 = -f4), i2(f4 <= 67108863); + for (var c2 = (1 << 26) % f4, d4 = 0, g3 = this.length - 1; g3 >= 0; g3--) + d4 = (c2 * d4 + (this.words[g3] | 0)) % f4; return a3 ? -d4 : d4; - }, o2.prototype.modn = function(f3) { - return this.modrn(f3); - }, o2.prototype.idivn = function(f3) { - var a3 = f3 < 0; - a3 && (f3 = -f3), i3(f3 <= 67108863); + }, o2.prototype.modn = function(f4) { + return this.modrn(f4); + }, o2.prototype.idivn = function(f4) { + var a3 = f4 < 0; + a3 && (f4 = -f4), i2(f4 <= 67108863); for (var c2 = 0, d4 = this.length - 1; d4 >= 0; d4--) { var g3 = (this.words[d4] | 0) + c2 * 67108864; - this.words[d4] = g3 / f3 | 0, c2 = g3 % f3; + this.words[d4] = g3 / f4 | 0, c2 = g3 % f4; } return this._strip(), a3 ? this.ineg() : this; - }, o2.prototype.divn = function(f3) { - return this.clone().idivn(f3); - }, o2.prototype.egcd = function(f3) { - i3(f3.negative === 0), i3(!f3.isZero()); - var a3 = this, c2 = f3.clone(); - a3.negative !== 0 ? a3 = a3.umod(f3) : a3 = a3.clone(); + }, o2.prototype.divn = function(f4) { + return this.clone().idivn(f4); + }, o2.prototype.egcd = function(f4) { + i2(f4.negative === 0), i2(!f4.isZero()); + var a3 = this, c2 = f4.clone(); + a3.negative !== 0 ? a3 = a3.umod(f4) : a3 = a3.clone(); for (var d4 = new o2(1), g3 = new o2(0), x3 = new o2(0), M3 = new o2(1), l2 = 0; a3.isEven() && c2.isEven(); ) a3.iushrn(1), c2.iushrn(1), ++l2; for (var s2 = c2.clone(), v6 = a3.clone(); !a3.isZero(); ) { @@ -93298,10 +22604,10 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d a3.cmp(c2) >= 0 ? (a3.isub(c2), d4.isub(x3), g3.isub(M3)) : (c2.isub(a3), x3.isub(d4), M3.isub(g3)); } return { a: x3, b: M3, gcd: c2.iushln(l2) }; - }, o2.prototype._invmp = function(f3) { - i3(f3.negative === 0), i3(!f3.isZero()); - var a3 = this, c2 = f3.clone(); - a3.negative !== 0 ? a3 = a3.umod(f3) : a3 = a3.clone(); + }, o2.prototype._invmp = function(f4) { + i2(f4.negative === 0), i2(!f4.isZero()); + var a3 = this, c2 = f4.clone(); + a3.negative !== 0 ? a3 = a3.umod(f4) : a3 = a3.clone(); for (var d4 = new o2(1), g3 = new o2(0), x3 = c2.clone(); a3.cmpn(1) > 0 && c2.cmpn(1) > 0; ) { for (var M3 = 0, l2 = 1; !(a3.words[0] & l2) && M3 < 26; ++M3, l2 <<= 1) ; @@ -93316,13 +22622,13 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d a3.cmp(c2) >= 0 ? (a3.isub(c2), d4.isub(g3)) : (c2.isub(a3), g3.isub(d4)); } var k2; - return a3.cmpn(1) === 0 ? k2 = d4 : k2 = g3, k2.cmpn(0) < 0 && k2.iadd(f3), k2; - }, o2.prototype.gcd = function(f3) { + return a3.cmpn(1) === 0 ? k2 = d4 : k2 = g3, k2.cmpn(0) < 0 && k2.iadd(f4), k2; + }, o2.prototype.gcd = function(f4) { if (this.isZero()) - return f3.abs(); - if (f3.isZero()) + return f4.abs(); + if (f4.isZero()) return this.abs(); - var a3 = this.clone(), c2 = f3.clone(); + var a3 = this.clone(), c2 = f4.clone(); a3.negative = 0, c2.negative = 0; for (var d4 = 0; a3.isEven() && c2.isEven(); d4++) a3.iushrn(1), c2.iushrn(1); @@ -93340,17 +22646,17 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d a3.isub(c2); } while (true); return c2.iushln(d4); - }, o2.prototype.invm = function(f3) { - return this.egcd(f3).a.umod(f3); + }, o2.prototype.invm = function(f4) { + return this.egcd(f4).a.umod(f4); }, o2.prototype.isEven = function() { return (this.words[0] & 1) === 0; }, o2.prototype.isOdd = function() { return (this.words[0] & 1) === 1; - }, o2.prototype.andln = function(f3) { - return this.words[0] & f3; - }, o2.prototype.bincn = function(f3) { - i3(typeof f3 == "number"); - var a3 = f3 % 26, c2 = (f3 - a3) / 26, d4 = 1 << a3; + }, o2.prototype.andln = function(f4) { + return this.words[0] & f4; + }, o2.prototype.bincn = function(f4) { + i2(typeof f4 == "number"); + var a3 = f4 % 26, c2 = (f4 - a3) / 26, d4 = 1 << a3; if (this.length <= c2) return this._expand(c2 + 1), this.words[c2] |= d4, this; for (var g3 = d4, x3 = c2; g3 !== 0 && x3 < this.length; x3++) { @@ -93360,8 +22666,8 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d return g3 !== 0 && (this.words[x3] = g3, this.length++), this; }, o2.prototype.isZero = function() { return this.length === 1 && this.words[0] === 0; - }, o2.prototype.cmpn = function(f3) { - var a3 = f3 < 0; + }, o2.prototype.cmpn = function(f4) { + var a3 = f4 < 0; if (this.negative !== 0 && !a3) return -1; if (this.negative === 0 && a3) @@ -93371,239 +22677,239 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d if (this.length > 1) c2 = 1; else { - a3 && (f3 = -f3), i3(f3 <= 67108863, "Number is too big"); + a3 && (f4 = -f4), i2(f4 <= 67108863, "Number is too big"); var d4 = this.words[0] | 0; - c2 = d4 === f3 ? 0 : d4 < f3 ? -1 : 1; + c2 = d4 === f4 ? 0 : d4 < f4 ? -1 : 1; } return this.negative !== 0 ? -c2 | 0 : c2; - }, o2.prototype.cmp = function(f3) { - if (this.negative !== 0 && f3.negative === 0) + }, o2.prototype.cmp = function(f4) { + if (this.negative !== 0 && f4.negative === 0) return -1; - if (this.negative === 0 && f3.negative !== 0) + if (this.negative === 0 && f4.negative !== 0) return 1; - var a3 = this.ucmp(f3); + var a3 = this.ucmp(f4); return this.negative !== 0 ? -a3 | 0 : a3; - }, o2.prototype.ucmp = function(f3) { - if (this.length > f3.length) + }, o2.prototype.ucmp = function(f4) { + if (this.length > f4.length) return 1; - if (this.length < f3.length) + if (this.length < f4.length) return -1; for (var a3 = 0, c2 = this.length - 1; c2 >= 0; c2--) { - var d4 = this.words[c2] | 0, g3 = f3.words[c2] | 0; + var d4 = this.words[c2] | 0, g3 = f4.words[c2] | 0; if (d4 !== g3) { d4 < g3 ? a3 = -1 : d4 > g3 && (a3 = 1); break; } } return a3; - }, o2.prototype.gtn = function(f3) { - return this.cmpn(f3) === 1; - }, o2.prototype.gt = function(f3) { - return this.cmp(f3) === 1; - }, o2.prototype.gten = function(f3) { - return this.cmpn(f3) >= 0; - }, o2.prototype.gte = function(f3) { - return this.cmp(f3) >= 0; - }, o2.prototype.ltn = function(f3) { - return this.cmpn(f3) === -1; - }, o2.prototype.lt = function(f3) { - return this.cmp(f3) === -1; - }, o2.prototype.lten = function(f3) { - return this.cmpn(f3) <= 0; - }, o2.prototype.lte = function(f3) { - return this.cmp(f3) <= 0; - }, o2.prototype.eqn = function(f3) { - return this.cmpn(f3) === 0; - }, o2.prototype.eq = function(f3) { - return this.cmp(f3) === 0; - }, o2.red = function(f3) { - return new Y2(f3); - }, o2.prototype.toRed = function(f3) { - return i3(!this.red, "Already a number in reduction context"), i3(this.negative === 0, "red works only with positives"), f3.convertTo(this)._forceRed(f3); + }, o2.prototype.gtn = function(f4) { + return this.cmpn(f4) === 1; + }, o2.prototype.gt = function(f4) { + return this.cmp(f4) === 1; + }, o2.prototype.gten = function(f4) { + return this.cmpn(f4) >= 0; + }, o2.prototype.gte = function(f4) { + return this.cmp(f4) >= 0; + }, o2.prototype.ltn = function(f4) { + return this.cmpn(f4) === -1; + }, o2.prototype.lt = function(f4) { + return this.cmp(f4) === -1; + }, o2.prototype.lten = function(f4) { + return this.cmpn(f4) <= 0; + }, o2.prototype.lte = function(f4) { + return this.cmp(f4) <= 0; + }, o2.prototype.eqn = function(f4) { + return this.cmpn(f4) === 0; + }, o2.prototype.eq = function(f4) { + return this.cmp(f4) === 0; + }, o2.red = function(f4) { + return new Y2(f4); + }, o2.prototype.toRed = function(f4) { + return i2(!this.red, "Already a number in reduction context"), i2(this.negative === 0, "red works only with positives"), f4.convertTo(this)._forceRed(f4); }, o2.prototype.fromRed = function() { - return i3(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); - }, o2.prototype._forceRed = function(f3) { - return this.red = f3, this; - }, o2.prototype.forceRed = function(f3) { - return i3(!this.red, "Already a number in reduction context"), this._forceRed(f3); - }, o2.prototype.redAdd = function(f3) { - return i3(this.red, "redAdd works only with red numbers"), this.red.add(this, f3); - }, o2.prototype.redIAdd = function(f3) { - return i3(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, f3); - }, o2.prototype.redSub = function(f3) { - return i3(this.red, "redSub works only with red numbers"), this.red.sub(this, f3); - }, o2.prototype.redISub = function(f3) { - return i3(this.red, "redISub works only with red numbers"), this.red.isub(this, f3); - }, o2.prototype.redShl = function(f3) { - return i3(this.red, "redShl works only with red numbers"), this.red.shl(this, f3); - }, o2.prototype.redMul = function(f3) { - return i3(this.red, "redMul works only with red numbers"), this.red._verify2(this, f3), this.red.mul(this, f3); - }, o2.prototype.redIMul = function(f3) { - return i3(this.red, "redMul works only with red numbers"), this.red._verify2(this, f3), this.red.imul(this, f3); + return i2(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); + }, o2.prototype._forceRed = function(f4) { + return this.red = f4, this; + }, o2.prototype.forceRed = function(f4) { + return i2(!this.red, "Already a number in reduction context"), this._forceRed(f4); + }, o2.prototype.redAdd = function(f4) { + return i2(this.red, "redAdd works only with red numbers"), this.red.add(this, f4); + }, o2.prototype.redIAdd = function(f4) { + return i2(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, f4); + }, o2.prototype.redSub = function(f4) { + return i2(this.red, "redSub works only with red numbers"), this.red.sub(this, f4); + }, o2.prototype.redISub = function(f4) { + return i2(this.red, "redISub works only with red numbers"), this.red.isub(this, f4); + }, o2.prototype.redShl = function(f4) { + return i2(this.red, "redShl works only with red numbers"), this.red.shl(this, f4); + }, o2.prototype.redMul = function(f4) { + return i2(this.red, "redMul works only with red numbers"), this.red._verify2(this, f4), this.red.mul(this, f4); + }, o2.prototype.redIMul = function(f4) { + return i2(this.red, "redMul works only with red numbers"), this.red._verify2(this, f4), this.red.imul(this, f4); }, o2.prototype.redSqr = function() { - return i3(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); + return i2(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); }, o2.prototype.redISqr = function() { - return i3(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); + return i2(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); }, o2.prototype.redSqrt = function() { - return i3(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); + return i2(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); }, o2.prototype.redInvm = function() { - return i3(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); + return i2(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); }, o2.prototype.redNeg = function() { - return i3(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); - }, o2.prototype.redPow = function(f3) { - return i3(this.red && !f3.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, f3); + return i2(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); + }, o2.prototype.redPow = function(f4) { + return i2(this.red && !f4.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, f4); }; var H2 = { k256: null, p224: null, p192: null, p25519: null }; - function z3(A2, f3) { - this.name = A2, this.p = new o2(f3, 16), this.n = this.p.bitLength(), this.k = new o2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); + function z3(A2, f4) { + this.name = A2, this.p = new o2(f4, 16), this.n = this.p.bitLength(), this.k = new o2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); } z3.prototype._tmp = function() { - var f3 = new o2(null); - return f3.words = new Array(Math.ceil(this.n / 13)), f3; - }, z3.prototype.ireduce = function(f3) { - var a3 = f3, c2; + var f4 = new o2(null); + return f4.words = new Array(Math.ceil(this.n / 13)), f4; + }, z3.prototype.ireduce = function(f4) { + var a3 = f4, c2; do this.split(a3, this.tmp), a3 = this.imulK(a3), a3 = a3.iadd(this.tmp), c2 = a3.bitLength(); while (c2 > this.n); var d4 = c2 < this.n ? -1 : a3.ucmp(this.p); return d4 === 0 ? (a3.words[0] = 0, a3.length = 1) : d4 > 0 ? a3.isub(this.p) : a3.strip !== void 0 ? a3.strip() : a3._strip(), a3; - }, z3.prototype.split = function(f3, a3) { - f3.iushrn(this.n, 0, a3); - }, z3.prototype.imulK = function(f3) { - return f3.imul(this.k); + }, z3.prototype.split = function(f4, a3) { + f4.iushrn(this.n, 0, a3); + }, z3.prototype.imulK = function(f4) { + return f4.imul(this.k); }; function Pt2() { z3.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); } - n4(Pt2, z3), Pt2.prototype.split = function(f3, a3) { - for (var c2 = 4194303, d4 = Math.min(f3.length, 9), g3 = 0; g3 < d4; g3++) - a3.words[g3] = f3.words[g3]; - if (a3.length = d4, f3.length <= 9) { - f3.words[0] = 0, f3.length = 1; + n5(Pt2, z3), Pt2.prototype.split = function(f4, a3) { + for (var c2 = 4194303, d4 = Math.min(f4.length, 9), g3 = 0; g3 < d4; g3++) + a3.words[g3] = f4.words[g3]; + if (a3.length = d4, f4.length <= 9) { + f4.words[0] = 0, f4.length = 1; return; } - var x3 = f3.words[9]; - for (a3.words[a3.length++] = x3 & c2, g3 = 10; g3 < f3.length; g3++) { - var M3 = f3.words[g3] | 0; - f3.words[g3 - 10] = (M3 & c2) << 4 | x3 >>> 22, x3 = M3; + var x3 = f4.words[9]; + for (a3.words[a3.length++] = x3 & c2, g3 = 10; g3 < f4.length; g3++) { + var M3 = f4.words[g3] | 0; + f4.words[g3 - 10] = (M3 & c2) << 4 | x3 >>> 22, x3 = M3; } - x3 >>>= 22, f3.words[g3 - 10] = x3, x3 === 0 && f3.length > 10 ? f3.length -= 10 : f3.length -= 9; - }, Pt2.prototype.imulK = function(f3) { - f3.words[f3.length] = 0, f3.words[f3.length + 1] = 0, f3.length += 2; - for (var a3 = 0, c2 = 0; c2 < f3.length; c2++) { - var d4 = f3.words[c2] | 0; - a3 += d4 * 977, f3.words[c2] = a3 & 67108863, a3 = d4 * 64 + (a3 / 67108864 | 0); + x3 >>>= 22, f4.words[g3 - 10] = x3, x3 === 0 && f4.length > 10 ? f4.length -= 10 : f4.length -= 9; + }, Pt2.prototype.imulK = function(f4) { + f4.words[f4.length] = 0, f4.words[f4.length + 1] = 0, f4.length += 2; + for (var a3 = 0, c2 = 0; c2 < f4.length; c2++) { + var d4 = f4.words[c2] | 0; + a3 += d4 * 977, f4.words[c2] = a3 & 67108863, a3 = d4 * 64 + (a3 / 67108864 | 0); } - return f3.words[f3.length - 1] === 0 && (f3.length--, f3.words[f3.length - 1] === 0 && f3.length--), f3; + return f4.words[f4.length - 1] === 0 && (f4.length--, f4.words[f4.length - 1] === 0 && f4.length--), f4; }; function W2() { z3.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); } - n4(W2, z3); + n5(W2, z3); function Rt2() { z3.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); } - n4(Rt2, z3); + n5(Rt2, z3); function Yt2() { z3.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); } - n4(Yt2, z3), Yt2.prototype.imulK = function(f3) { - for (var a3 = 0, c2 = 0; c2 < f3.length; c2++) { - var d4 = (f3.words[c2] | 0) * 19 + a3, g3 = d4 & 67108863; - d4 >>>= 26, f3.words[c2] = g3, a3 = d4; + n5(Yt2, z3), Yt2.prototype.imulK = function(f4) { + for (var a3 = 0, c2 = 0; c2 < f4.length; c2++) { + var d4 = (f4.words[c2] | 0) * 19 + a3, g3 = d4 & 67108863; + d4 >>>= 26, f4.words[c2] = g3, a3 = d4; } - return a3 !== 0 && (f3.words[f3.length++] = a3), f3; - }, o2._prime = function(f3) { - if (H2[f3]) - return H2[f3]; + return a3 !== 0 && (f4.words[f4.length++] = a3), f4; + }, o2._prime = function(f4) { + if (H2[f4]) + return H2[f4]; var a3; - if (f3 === "k256") + if (f4 === "k256") a3 = new Pt2(); - else if (f3 === "p224") + else if (f4 === "p224") a3 = new W2(); - else if (f3 === "p192") + else if (f4 === "p192") a3 = new Rt2(); - else if (f3 === "p25519") + else if (f4 === "p25519") a3 = new Yt2(); else - throw new Error("Unknown prime " + f3); - return H2[f3] = a3, a3; + throw new Error("Unknown prime " + f4); + return H2[f4] = a3, a3; }; function Y2(A2) { if (typeof A2 == "string") { - var f3 = o2._prime(A2); - this.m = f3.p, this.prime = f3; + var f4 = o2._prime(A2); + this.m = f4.p, this.prime = f4; } else - i3(A2.gtn(1), "modulus must be greater than 1"), this.m = A2, this.prime = null; - } - Y2.prototype._verify1 = function(f3) { - i3(f3.negative === 0, "red works only with positives"), i3(f3.red, "red works only with red numbers"); - }, Y2.prototype._verify2 = function(f3, a3) { - i3((f3.negative | a3.negative) === 0, "red works only with positives"), i3(f3.red && f3.red === a3.red, "red works only with red numbers"); - }, Y2.prototype.imod = function(f3) { - return this.prime ? this.prime.ireduce(f3)._forceRed(this) : (w2(f3, f3.umod(this.m)._forceRed(this)), f3); - }, Y2.prototype.neg = function(f3) { - return f3.isZero() ? f3.clone() : this.m.sub(f3)._forceRed(this); - }, Y2.prototype.add = function(f3, a3) { - this._verify2(f3, a3); - var c2 = f3.add(a3); + i2(A2.gtn(1), "modulus must be greater than 1"), this.m = A2, this.prime = null; + } + Y2.prototype._verify1 = function(f4) { + i2(f4.negative === 0, "red works only with positives"), i2(f4.red, "red works only with red numbers"); + }, Y2.prototype._verify2 = function(f4, a3) { + i2((f4.negative | a3.negative) === 0, "red works only with positives"), i2(f4.red && f4.red === a3.red, "red works only with red numbers"); + }, Y2.prototype.imod = function(f4) { + return this.prime ? this.prime.ireduce(f4)._forceRed(this) : (w2(f4, f4.umod(this.m)._forceRed(this)), f4); + }, Y2.prototype.neg = function(f4) { + return f4.isZero() ? f4.clone() : this.m.sub(f4)._forceRed(this); + }, Y2.prototype.add = function(f4, a3) { + this._verify2(f4, a3); + var c2 = f4.add(a3); return c2.cmp(this.m) >= 0 && c2.isub(this.m), c2._forceRed(this); - }, Y2.prototype.iadd = function(f3, a3) { - this._verify2(f3, a3); - var c2 = f3.iadd(a3); + }, Y2.prototype.iadd = function(f4, a3) { + this._verify2(f4, a3); + var c2 = f4.iadd(a3); return c2.cmp(this.m) >= 0 && c2.isub(this.m), c2; - }, Y2.prototype.sub = function(f3, a3) { - this._verify2(f3, a3); - var c2 = f3.sub(a3); + }, Y2.prototype.sub = function(f4, a3) { + this._verify2(f4, a3); + var c2 = f4.sub(a3); return c2.cmpn(0) < 0 && c2.iadd(this.m), c2._forceRed(this); - }, Y2.prototype.isub = function(f3, a3) { - this._verify2(f3, a3); - var c2 = f3.isub(a3); + }, Y2.prototype.isub = function(f4, a3) { + this._verify2(f4, a3); + var c2 = f4.isub(a3); return c2.cmpn(0) < 0 && c2.iadd(this.m), c2; - }, Y2.prototype.shl = function(f3, a3) { - return this._verify1(f3), this.imod(f3.ushln(a3)); - }, Y2.prototype.imul = function(f3, a3) { - return this._verify2(f3, a3), this.imod(f3.imul(a3)); - }, Y2.prototype.mul = function(f3, a3) { - return this._verify2(f3, a3), this.imod(f3.mul(a3)); - }, Y2.prototype.isqr = function(f3) { - return this.imul(f3, f3.clone()); - }, Y2.prototype.sqr = function(f3) { - return this.mul(f3, f3); - }, Y2.prototype.sqrt = function(f3) { - if (f3.isZero()) - return f3.clone(); + }, Y2.prototype.shl = function(f4, a3) { + return this._verify1(f4), this.imod(f4.ushln(a3)); + }, Y2.prototype.imul = function(f4, a3) { + return this._verify2(f4, a3), this.imod(f4.imul(a3)); + }, Y2.prototype.mul = function(f4, a3) { + return this._verify2(f4, a3), this.imod(f4.mul(a3)); + }, Y2.prototype.isqr = function(f4) { + return this.imul(f4, f4.clone()); + }, Y2.prototype.sqr = function(f4) { + return this.mul(f4, f4); + }, Y2.prototype.sqrt = function(f4) { + if (f4.isZero()) + return f4.clone(); var a3 = this.m.andln(3); - if (i3(a3 % 2 === 1), a3 === 3) { + if (i2(a3 % 2 === 1), a3 === 3) { var c2 = this.m.add(new o2(1)).iushrn(2); - return this.pow(f3, c2); + return this.pow(f4, c2); } for (var d4 = this.m.subn(1), g3 = 0; !d4.isZero() && d4.andln(1) === 0; ) g3++, d4.iushrn(1); - i3(!d4.isZero()); + i2(!d4.isZero()); var x3 = new o2(1).toRed(this), M3 = x3.redNeg(), l2 = this.m.subn(1).iushrn(1), s2 = this.m.bitLength(); for (s2 = new o2(2 * s2 * s2).toRed(this); this.pow(s2, l2).cmp(M3) !== 0; ) s2.redIAdd(M3); - for (var v6 = this.pow(s2, d4), k2 = this.pow(f3, d4.addn(1).iushrn(1)), u2 = this.pow(f3, d4), E2 = g3; u2.cmp(x3) !== 0; ) { + for (var v6 = this.pow(s2, d4), k2 = this.pow(f4, d4.addn(1).iushrn(1)), u2 = this.pow(f4, d4), E2 = g3; u2.cmp(x3) !== 0; ) { for (var _3 = u2, B2 = 0; _3.cmp(x3) !== 0; B2++) _3 = _3.redSqr(); - i3(B2 < E2); + i2(B2 < E2); var R3 = this.pow(v6, new o2(1).iushln(E2 - B2 - 1)); k2 = k2.redMul(R3), v6 = R3.redSqr(), u2 = u2.redMul(v6), E2 = B2; } return k2; - }, Y2.prototype.invm = function(f3) { - var a3 = f3._invmp(this.m); + }, Y2.prototype.invm = function(f4) { + var a3 = f4._invmp(this.m); return a3.negative !== 0 ? (a3.negative = 0, this.imod(a3).redNeg()) : this.imod(a3); - }, Y2.prototype.pow = function(f3, a3) { + }, Y2.prototype.pow = function(f4, a3) { if (a3.isZero()) return new o2(1).toRed(this); if (a3.cmpn(1) === 0) - return f3.clone(); + return f4.clone(); var c2 = 4, d4 = new Array(1 << c2); - d4[0] = new o2(1).toRed(this), d4[1] = f3; + d4[0] = new o2(1).toRed(this), d4[1] = f4; for (var g3 = 2; g3 < d4.length; g3++) - d4[g3] = this.mul(d4[g3 - 1], f3); + d4[g3] = this.mul(d4[g3 - 1], f4); var x3 = d4[0], M3 = 0, l2 = 0, s2 = a3.bitLength() % 26; for (s2 === 0 && (s2 = 26), g3 = a3.length - 1; g3 >= 0; g3--) { for (var v6 = a3.words[g3], k2 = s2 - 1; k2 >= 0; k2--) { @@ -93617,35 +22923,35 @@ var Ln$1 = { exports: {} }, I0$1 = {}, _0$1 = Object.freeze({ __proto__: null, d s2 = 26; } return x3; - }, Y2.prototype.convertTo = function(f3) { - var a3 = f3.umod(this.m); - return a3 === f3 ? a3.clone() : a3; - }, Y2.prototype.convertFrom = function(f3) { - var a3 = f3.clone(); + }, Y2.prototype.convertTo = function(f4) { + var a3 = f4.umod(this.m); + return a3 === f4 ? a3.clone() : a3; + }, Y2.prototype.convertFrom = function(f4) { + var a3 = f4.clone(); return a3.red = null, a3; - }, o2.mont = function(f3) { - return new Vt2(f3); + }, o2.mont = function(f4) { + return new Vt2(f4); }; function Vt2(A2) { Y2.call(this, A2), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new o2(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); } - n4(Vt2, Y2), Vt2.prototype.convertTo = function(f3) { - return this.imod(f3.ushln(this.shift)); - }, Vt2.prototype.convertFrom = function(f3) { - var a3 = this.imod(f3.mul(this.rinv)); + n5(Vt2, Y2), Vt2.prototype.convertTo = function(f4) { + return this.imod(f4.ushln(this.shift)); + }, Vt2.prototype.convertFrom = function(f4) { + var a3 = this.imod(f4.mul(this.rinv)); return a3.red = null, a3; - }, Vt2.prototype.imul = function(f3, a3) { - if (f3.isZero() || a3.isZero()) - return f3.words[0] = 0, f3.length = 1, f3; - var c2 = f3.imul(a3), d4 = c2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), g3 = c2.isub(d4).iushrn(this.shift), x3 = g3; + }, Vt2.prototype.imul = function(f4, a3) { + if (f4.isZero() || a3.isZero()) + return f4.words[0] = 0, f4.length = 1, f4; + var c2 = f4.imul(a3), d4 = c2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), g3 = c2.isub(d4).iushrn(this.shift), x3 = g3; return g3.cmp(this.m) >= 0 ? x3 = g3.isub(this.m) : g3.cmpn(0) < 0 && (x3 = g3.iadd(this.m)), x3._forceRed(this); - }, Vt2.prototype.mul = function(f3, a3) { - if (f3.isZero() || a3.isZero()) + }, Vt2.prototype.mul = function(f4, a3) { + if (f4.isZero() || a3.isZero()) return new o2(0)._forceRed(this); - var c2 = f3.mul(a3), d4 = c2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), g3 = c2.isub(d4).iushrn(this.shift), x3 = g3; + var c2 = f4.mul(a3), d4 = c2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), g3 = c2.isub(d4).iushrn(this.shift), x3 = g3; return g3.cmp(this.m) >= 0 ? x3 = g3.isub(this.m) : g3.cmpn(0) < 0 && (x3 = g3.iadd(this.m)), x3._forceRed(this); - }, Vt2.prototype.invm = function(f3) { - var a3 = this.imod(f3._invmp(this.m).mul(this.r2)); + }, Vt2.prototype.invm = function(f4) { + var a3 = this.imod(f4._invmp(this.m).mul(this.r2)); return a3._forceRed(this); }; })(e18, On$2); @@ -93771,13 +23077,13 @@ let V$1 = class V { return V.from(Kt$2(r2)); if (r2) if (r2.toHexString) { - const i3 = r2.toHexString(); - if (typeof i3 == "string") - return V.from(i3); + const i2 = r2.toHexString(); + if (typeof i2 == "string") + return V.from(i2); } else { - let i3 = r2._hex; - if (i3 == null && r2.type === "BigNumber" && (i3 = r2.hex), typeof i3 == "string" && (Qt$1(i3) || i3[0] === "-" && Qt$1(i3.substring(1)))) - return V.from(i3); + let i2 = r2._hex; + if (i2 == null && r2.type === "BigNumber" && (i2 = r2.hex), typeof i2 == "string" && (Qt$1(i2) || i2[0] === "-" && Qt$1(i2.substring(1)))) + return V.from(i2); } return Ae$2.throwArgumentError("invalid BigNumber value", "value", t2); } @@ -93804,13 +23110,13 @@ function j$4(e18) { return t2[0] === "-" ? new Rr$2("-" + t2.substring(3), 16) : new Rr$2(t2.substring(2), 16); } function Wt$1(e18, t2, r2) { - const i3 = { fault: e18, operation: t2 }; - return r2 != null && (i3.value = r2), Ae$2.throwError(e18, L$2.errors.NUMERIC_FAULT, i3); + const i2 = { fault: e18, operation: t2 }; + return r2 != null && (i2.value = r2), Ae$2.throwError(e18, L$2.errors.NUMERIC_FAULT, i2); } const Ht$2 = new L$2(jn$1), mr$2 = {}, Gn$1 = V$1.from(0), Yn$1 = V$1.from(-1); -function Vn$1(e18, t2, r2, i3) { - const n4 = { fault: t2, operation: r2 }; - return i3 !== void 0 && (n4.value = i3), Ht$2.throwError(e18, L$2.errors.NUMERIC_FAULT, n4); +function Vn$1(e18, t2, r2, i2) { + const n5 = { fault: t2, operation: r2 }; + return i2 !== void 0 && (n5.value = i2), Ht$2.throwError(e18, L$2.errors.NUMERIC_FAULT, n5); } let gr$2 = "0"; for (; gr$2.length < 256; ) @@ -93827,104 +23133,104 @@ function Mi$2(e18, t2) { t2 == null && (t2 = 0); const r2 = xi$1(t2); e18 = V$1.from(e18); - const i3 = e18.lt(Gn$1); - i3 && (e18 = e18.mul(Yn$1)); - let n4 = e18.mod(r2).toString(); - for (; n4.length < r2.length - 1; ) - n4 = "0" + n4; - n4 = n4.match(/^([0-9]*[1-9]|0)(0*)/)[1]; + const i2 = e18.lt(Gn$1); + i2 && (e18 = e18.mul(Yn$1)); + let n5 = e18.mod(r2).toString(); + for (; n5.length < r2.length - 1; ) + n5 = "0" + n5; + n5 = n5.match(/^([0-9]*[1-9]|0)(0*)/)[1]; const o2 = e18.div(r2).toString(); - return r2.length === 1 ? e18 = o2 : e18 = o2 + "." + n4, i3 && (e18 = "-" + e18), e18; + return r2.length === 1 ? e18 = o2 : e18 = o2 + "." + n5, i2 && (e18 = "-" + e18), e18; } function be$3(e18, t2) { t2 == null && (t2 = 0); const r2 = xi$1(t2); (typeof e18 != "string" || !e18.match(/^-?[0-9.]+$/)) && Ht$2.throwArgumentError("invalid decimal value", "value", e18); - const i3 = e18.substring(0, 1) === "-"; - i3 && (e18 = e18.substring(1)), e18 === "." && Ht$2.throwArgumentError("missing value", "value", e18); - const n4 = e18.split("."); - n4.length > 2 && Ht$2.throwArgumentError("too many decimal points", "value", e18); - let o2 = n4[0], h4 = n4[1]; + const i2 = e18.substring(0, 1) === "-"; + i2 && (e18 = e18.substring(1)), e18 === "." && Ht$2.throwArgumentError("missing value", "value", e18); + const n5 = e18.split("."); + n5.length > 2 && Ht$2.throwArgumentError("too many decimal points", "value", e18); + let o2 = n5[0], h4 = n5[1]; for (o2 || (o2 = "0"), h4 || (h4 = "0"); h4[h4.length - 1] === "0"; ) h4 = h4.substring(0, h4.length - 1); for (h4.length > r2.length - 1 && Vn$1("fractional component exceeds decimals", "underflow", "parseFixed"), h4 === "" && (h4 = "0"); h4.length < r2.length - 1; ) h4 += "0"; const p3 = V$1.from(o2), b2 = V$1.from(h4); let m3 = p3.mul(r2).add(b2); - return i3 && (m3 = m3.mul(Yn$1)), m3; + return i2 && (m3 = m3.mul(Yn$1)), m3; } let dr$3 = class dr { - constructor(t2, r2, i3, n4) { - t2 !== mr$2 && Ht$2.throwError("cannot use FixedFormat constructor; use FixedFormat.from", L$2.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.signed = r2, this.width = i3, this.decimals = n4, this.name = (r2 ? "" : "u") + "fixed" + String(i3) + "x" + String(n4), this._multiplier = xi$1(n4), Object.freeze(this); + constructor(t2, r2, i2, n5) { + t2 !== mr$2 && Ht$2.throwError("cannot use FixedFormat constructor; use FixedFormat.from", L$2.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.signed = r2, this.width = i2, this.decimals = n5, this.name = (r2 ? "" : "u") + "fixed" + String(i2) + "x" + String(n5), this._multiplier = xi$1(n5), Object.freeze(this); } static from(t2) { if (t2 instanceof dr) return t2; typeof t2 == "number" && (t2 = `fixed128x${t2}`); - let r2 = true, i3 = 128, n4 = 18; + let r2 = true, i2 = 128, n5 = 18; if (typeof t2 == "string") { if (t2 !== "fixed") if (t2 === "ufixed") r2 = false; else { const o2 = t2.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - o2 || Ht$2.throwArgumentError("invalid fixed format", "format", t2), r2 = o2[1] !== "u", i3 = parseInt(o2[2]), n4 = parseInt(o2[3]); + o2 || Ht$2.throwArgumentError("invalid fixed format", "format", t2), r2 = o2[1] !== "u", i2 = parseInt(o2[2]), n5 = parseInt(o2[3]); } } else if (t2) { const o2 = (h4, p3, b2) => t2[h4] == null ? b2 : (typeof t2[h4] !== p3 && Ht$2.throwArgumentError("invalid fixed format (" + h4 + " not " + p3 + ")", "format." + h4, t2[h4]), t2[h4]); - r2 = o2("signed", "boolean", r2), i3 = o2("width", "number", i3), n4 = o2("decimals", "number", n4); + r2 = o2("signed", "boolean", r2), i2 = o2("width", "number", i2), n5 = o2("decimals", "number", n5); } - return i3 % 8 && Ht$2.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", i3), n4 > 80 && Ht$2.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", n4), new dr(mr$2, r2, i3, n4); + return i2 % 8 && Ht$2.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", i2), n5 > 80 && Ht$2.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", n5), new dr(mr$2, r2, i2, n5); } }; let Ut$2 = class Ut { - constructor(t2, r2, i3, n4) { - t2 !== mr$2 && Ht$2.throwError("cannot use FixedNumber constructor; use FixedNumber.from", L$2.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.format = n4, this._hex = r2, this._value = i3, this._isFixedNumber = true, Object.freeze(this); + constructor(t2, r2, i2, n5) { + t2 !== mr$2 && Ht$2.throwError("cannot use FixedNumber constructor; use FixedNumber.from", L$2.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.format = n5, this._hex = r2, this._value = i2, this._isFixedNumber = true, Object.freeze(this); } _checkFormat(t2) { this.format.name !== t2.format.name && Ht$2.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", t2); } addUnsafe(t2) { this._checkFormat(t2); - const r2 = be$3(this._value, this.format.decimals), i3 = be$3(t2._value, t2.format.decimals); - return Ut.fromValue(r2.add(i3), this.format.decimals, this.format); + const r2 = be$3(this._value, this.format.decimals), i2 = be$3(t2._value, t2.format.decimals); + return Ut.fromValue(r2.add(i2), this.format.decimals, this.format); } subUnsafe(t2) { this._checkFormat(t2); - const r2 = be$3(this._value, this.format.decimals), i3 = be$3(t2._value, t2.format.decimals); - return Ut.fromValue(r2.sub(i3), this.format.decimals, this.format); + const r2 = be$3(this._value, this.format.decimals), i2 = be$3(t2._value, t2.format.decimals); + return Ut.fromValue(r2.sub(i2), this.format.decimals, this.format); } mulUnsafe(t2) { this._checkFormat(t2); - const r2 = be$3(this._value, this.format.decimals), i3 = be$3(t2._value, t2.format.decimals); - return Ut.fromValue(r2.mul(i3).div(this.format._multiplier), this.format.decimals, this.format); + const r2 = be$3(this._value, this.format.decimals), i2 = be$3(t2._value, t2.format.decimals); + return Ut.fromValue(r2.mul(i2).div(this.format._multiplier), this.format.decimals, this.format); } divUnsafe(t2) { this._checkFormat(t2); - const r2 = be$3(this._value, this.format.decimals), i3 = be$3(t2._value, t2.format.decimals); - return Ut.fromValue(r2.mul(this.format._multiplier).div(i3), this.format.decimals, this.format); + const r2 = be$3(this._value, this.format.decimals), i2 = be$3(t2._value, t2.format.decimals); + return Ut.fromValue(r2.mul(this.format._multiplier).div(i2), this.format.decimals, this.format); } floor() { const t2 = this.toString().split("."); t2.length === 1 && t2.push("0"); let r2 = Ut.from(t2[0], this.format); - const i3 = !t2[1].match(/^(0*)$/); - return this.isNegative() && i3 && (r2 = r2.subUnsafe(Wn$1.toFormat(r2.format))), r2; + const i2 = !t2[1].match(/^(0*)$/); + return this.isNegative() && i2 && (r2 = r2.subUnsafe(Wn$1.toFormat(r2.format))), r2; } ceiling() { const t2 = this.toString().split("."); t2.length === 1 && t2.push("0"); let r2 = Ut.from(t2[0], this.format); - const i3 = !t2[1].match(/^(0*)$/); - return !this.isNegative() && i3 && (r2 = r2.addUnsafe(Wn$1.toFormat(r2.format))), r2; + const i2 = !t2[1].match(/^(0*)$/); + return !this.isNegative() && i2 && (r2 = r2.addUnsafe(Wn$1.toFormat(r2.format))), r2; } round(t2) { t2 == null && (t2 = 0); const r2 = this.toString().split("."); if (r2.length === 1 && r2.push("0"), (t2 < 0 || t2 > 80 || t2 % 1) && Ht$2.throwArgumentError("invalid decimal count", "decimals", t2), r2[1].length <= t2) return this; - const i3 = Ut.from("1" + gr$2.substring(0, t2), this.format), n4 = O0$1.toFormat(this.format); - return this.mulUnsafe(i3).addUnsafe(n4).floor().divUnsafe(i3); + const i2 = Ut.from("1" + gr$2.substring(0, t2), this.format), n5 = O0$1.toFormat(this.format); + return this.mulUnsafe(i2).addUnsafe(n5).floor().divUnsafe(i2); } isZero() { return this._value === "0.0" || this._value === "0"; @@ -93948,27 +23254,27 @@ let Ut$2 = class Ut { toFormat(t2) { return Ut.fromString(this._value, t2); } - static fromValue(t2, r2, i3) { - return i3 == null && r2 != null && !C0$1(r2) && (i3 = r2, r2 = null), r2 == null && (r2 = 0), i3 == null && (i3 = "fixed"), Ut.fromString(Mi$2(t2, r2), dr$3.from(i3)); + static fromValue(t2, r2, i2) { + return i2 == null && r2 != null && !C0$1(r2) && (i2 = r2, r2 = null), r2 == null && (r2 = 0), i2 == null && (i2 = "fixed"), Ut.fromString(Mi$2(t2, r2), dr$3.from(i2)); } static fromString(t2, r2) { r2 == null && (r2 = "fixed"); - const i3 = dr$3.from(r2), n4 = be$3(t2, i3.decimals); - !i3.signed && n4.lt(Gn$1) && Vn$1("unsigned value cannot be negative", "overflow", "value", t2); + const i2 = dr$3.from(r2), n5 = be$3(t2, i2.decimals); + !i2.signed && n5.lt(Gn$1) && Vn$1("unsigned value cannot be negative", "overflow", "value", t2); let o2 = null; - i3.signed ? o2 = n4.toTwos(i3.width).toHexString() : (o2 = n4.toHexString(), o2 = oe$3(o2, i3.width / 8)); - const h4 = Mi$2(n4, i3.decimals); - return new Ut(mr$2, o2, h4, i3); + i2.signed ? o2 = n5.toTwos(i2.width).toHexString() : (o2 = n5.toHexString(), o2 = oe$3(o2, i2.width / 8)); + const h4 = Mi$2(n5, i2.decimals); + return new Ut(mr$2, o2, h4, i2); } static fromBytes(t2, r2) { r2 == null && (r2 = "fixed"); - const i3 = dr$3.from(r2); - if (Ot$2(t2).length > i3.width / 8) + const i2 = dr$3.from(r2); + if (Ot$2(t2).length > i2.width / 8) throw new Error("overflow"); - let n4 = V$1.from(t2); - i3.signed && (n4 = n4.fromTwos(i3.width)); - const o2 = n4.toTwos((i3.signed ? 0 : 1) + i3.width).toHexString(), h4 = Mi$2(n4, i3.decimals); - return new Ut(mr$2, o2, h4, i3); + let n5 = V$1.from(t2); + i2.signed && (n5 = n5.fromTwos(i2.width)); + const o2 = n5.toTwos((i2.signed ? 0 : 1) + i2.width).toHexString(), h4 = Mi$2(n5, i2.decimals); + return new Ut(mr$2, o2, h4, i2); } static from(t2, r2) { if (typeof t2 == "string") @@ -93977,9 +23283,9 @@ let Ut$2 = class Ut { return Ut.fromBytes(t2, r2); try { return Ut.fromValue(t2, 0, r2); - } catch (i3) { - if (i3.code !== L$2.errors.INVALID_ARGUMENT) - throw i3; + } catch (i2) { + if (i2.code !== L$2.errors.INVALID_ARGUMENT) + throw i2; } return Ht$2.throwArgumentError("invalid FixedNumber value", "value", t2); } @@ -94004,26 +23310,26 @@ function T0$1(e18) { t2.push(parseInt(e18.substring(r2, r2 + 4), 16)); return t2; } -function Si$1(e18, t2) { - t2 || (t2 = function(n4) { - return [parseInt(n4, 16)]; +function Si$2(e18, t2) { + t2 || (t2 = function(n5) { + return [parseInt(n5, 16)]; }); - let r2 = 0, i3 = {}; - return e18.split(",").forEach((n4) => { - let o2 = n4.split(":"); - r2 += parseInt(o2[0], 16), i3[r2] = t2(o2[1]); - }), i3; + let r2 = 0, i2 = {}; + return e18.split(",").forEach((n5) => { + let o2 = n5.split(":"); + r2 += parseInt(o2[0], 16), i2[r2] = t2(o2[1]); + }), i2; } function $n$1(e18) { let t2 = 0; return e18.split(",").map((r2) => { - let i3 = r2.split("-"); - i3.length === 1 ? i3[1] = "0" : i3[1] === "" && (i3[1] = "1"); - let n4 = t2 + parseInt(i3[0], 16); - return t2 = parseInt(i3[1], 16), { l: n4, h: t2 }; + let i2 = r2.split("-"); + i2.length === 1 ? i2[1] = "0" : i2[1] === "" && (i2[1] = "1"); + let n5 = t2 + parseInt(i2[0], 16); + return t2 = parseInt(i2[1], 16), { l: n5, h: t2 }; }); } -$n$1("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"), "ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e18) => parseInt(e18, 16)), Si$1("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"), Si$1("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"), Si$1("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D", T0$1), $n$1("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001"); +$n$1("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"), "ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e18) => parseInt(e18, 16)), Si$2("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"), Si$2("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"), Si$2("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D", T0$1), $n$1("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001"); function U0$1(e18) { e18 = atob(e18); const t2 = []; @@ -94033,18 +23339,18 @@ function U0$1(e18) { } function ef$1(e18, t2) { t2 == null && (t2 = 1); - const r2 = [], i3 = r2.forEach, n4 = function(o2, h4) { - i3.call(o2, function(p3) { - h4 > 0 && Array.isArray(p3) ? n4(p3, h4 - 1) : r2.push(p3); + const r2 = [], i2 = r2.forEach, n5 = function(o2, h4) { + i2.call(o2, function(p3) { + h4 > 0 && Array.isArray(p3) ? n5(p3, h4 - 1) : r2.push(p3); }); }; - return n4(e18, t2), r2; + return n5(e18, t2), r2; } function k0$1(e18) { const t2 = {}; for (let r2 = 0; r2 < e18.length; r2++) { - const i3 = e18[r2]; - t2[i3[0]] = i3[1]; + const i2 = e18[r2]; + t2[i2[0]] = i2[1]; } return t2; } @@ -94053,9 +23359,9 @@ function q0$1(e18) { function r2() { return e18[t2++] << 8 | e18[t2++]; } - let i3 = r2(), n4 = 1, o2 = [0, 1]; - for (let H2 = 1; H2 < i3; H2++) - o2.push(n4 += r2()); + let i2 = r2(), n5 = 1, o2 = [0, 1]; + for (let H2 = 1; H2 < i2; H2++) + o2.push(n5 += r2()); let h4 = r2(), p3 = t2; t2 += h4; let b2 = 0, m3 = 0; @@ -94068,7 +23374,7 @@ function q0$1(e18) { F2 = F2 << 1 | w2(); let U5 = [], J2 = 0, Bt2 = S4; for (; ; ) { - let H2 = Math.floor(((F2 - J2 + 1) * n4 - 1) / Bt2), z3 = 0, Pt2 = i3; + let H2 = Math.floor(((F2 - J2 + 1) * n5 - 1) / Bt2), z3 = 0, Pt2 = i2; for (; Pt2 - z3 > 1; ) { let Yt2 = z3 + Pt2 >>> 1; H2 < o2[Yt2] ? Pt2 = Yt2 : z3 = Yt2; @@ -94076,14 +23382,14 @@ function q0$1(e18) { if (z3 == 0) break; U5.push(z3); - let W2 = J2 + Math.floor(Bt2 * o2[z3] / n4), Rt2 = J2 + Math.floor(Bt2 * o2[z3 + 1] / n4) - 1; + let W2 = J2 + Math.floor(Bt2 * o2[z3] / n5), Rt2 = J2 + Math.floor(Bt2 * o2[z3 + 1] / n5) - 1; for (; !((W2 ^ Rt2) & I2); ) F2 = F2 << 1 & C3 | w2(), W2 = W2 << 1 & C3, Rt2 = Rt2 << 1 & C3 | 1; for (; W2 & ~Rt2 & N2; ) F2 = F2 & I2 | F2 << 1 & C3 >>> 1 | w2(), W2 = W2 << 1 ^ I2, Rt2 = (Rt2 ^ I2) << 1 | I2 | 1; J2 = W2, Bt2 = 1 + Rt2 - W2; } - let G2 = i3 - 4; + let G2 = i2 - 4; return U5.map((H2) => { switch (H2 - G2) { case 3: @@ -94109,27 +23415,27 @@ function z0$1(e18) { } function L0$1(e18, t2) { let r2 = Array(e18); - for (let i3 = 0; i3 < e18; i3++) - r2[i3] = 1 + t2(); + for (let i2 = 0; i2 < e18; i2++) + r2[i2] = 1 + t2(); return r2; } function rf$1(e18, t2) { let r2 = Array(e18); - for (let i3 = 0, n4 = -1; i3 < e18; i3++) - r2[i3] = n4 += 1 + t2(); + for (let i2 = 0, n5 = -1; i2 < e18; i2++) + r2[i2] = n5 += 1 + t2(); return r2; } function j0$1(e18, t2) { let r2 = Array(e18); - for (let i3 = 0, n4 = 0; i3 < e18; i3++) - r2[i3] = n4 += z0$1(t2()); + for (let i2 = 0, n5 = 0; i2 < e18; i2++) + r2[i2] = n5 += z0$1(t2()); return r2; } function Pr$1(e18, t2) { - let r2 = rf$1(e18(), e18), i3 = e18(), n4 = rf$1(i3, e18), o2 = L0$1(i3, e18); - for (let h4 = 0; h4 < i3; h4++) + let r2 = rf$1(e18(), e18), i2 = e18(), n5 = rf$1(i2, e18), o2 = L0$1(i2, e18); + for (let h4 = 0; h4 < i2; h4++) for (let p3 = 0; p3 < o2[h4]; p3++) - r2.push(n4[h4] + p3); + r2.push(n5[h4] + p3); return t2 ? r2.map((h4) => t2[h4]) : r2; } function Q0$1(e18) { @@ -94159,43 +23465,43 @@ function J0$1(e18) { return t2; } function nf$1(e18, t2, r2) { - let i3 = Array(e18).fill(void 0).map(() => []); - for (let n4 = 0; n4 < t2; n4++) - j0$1(e18, r2).forEach((o2, h4) => i3[h4].push(o2)); - return i3; + let i2 = Array(e18).fill(void 0).map(() => []); + for (let n5 = 0; n5 < t2; n5++) + j0$1(e18, r2).forEach((o2, h4) => i2[h4].push(o2)); + return i2; } function G0$1(e18, t2) { - let r2 = 1 + t2(), i3 = t2(), n4 = J0$1(t2), o2 = nf$1(n4.length, 1 + e18, t2); + let r2 = 1 + t2(), i2 = t2(), n5 = J0$1(t2), o2 = nf$1(n5.length, 1 + e18, t2); return ef$1(o2.map((h4, p3) => { const b2 = h4[0], m3 = h4.slice(1); - return Array(n4[p3]).fill(void 0).map((w2, y3) => { - let S4 = y3 * i3; + return Array(n5[p3]).fill(void 0).map((w2, y3) => { + let S4 = y3 * i2; return [b2 + y3 * r2, m3.map((I2) => I2 + S4)]; }); })); } function Y0$1(e18, t2) { let r2 = 1 + t2(); - return nf$1(r2, 1 + e18, t2).map((n4) => [n4[0], n4.slice(1)]); + return nf$1(r2, 1 + e18, t2).map((n5) => [n5[0], n5.slice(1)]); } function V0$1(e18) { - let t2 = Pr$1(e18).sort((i3, n4) => i3 - n4); + let t2 = Pr$1(e18).sort((i2, n5) => i2 - n5); return r2(); function r2() { - let i3 = []; + let i2 = []; for (; ; ) { let m3 = Pr$1(e18, t2); if (m3.length == 0) break; - i3.push({ set: new Set(m3), node: r2() }); + i2.push({ set: new Set(m3), node: r2() }); } - i3.sort((m3, w2) => w2.set.size - m3.set.size); - let n4 = e18(), o2 = n4 % 3; - n4 = n4 / 3 | 0; - let h4 = !!(n4 & 1); - n4 >>= 1; - let p3 = n4 == 1, b2 = n4 == 2; - return { branches: i3, valid: o2, fe0f: h4, save: p3, check: b2 }; + i2.sort((m3, w2) => w2.set.size - m3.set.size); + let n5 = e18(), o2 = n5 % 3; + n5 = n5 / 3 | 0; + let h4 = !!(n5 & 1); + n5 >>= 1; + let p3 = n5 == 1, b2 = n5 == 2; + return { branches: i2, valid: o2, fe0f: h4, save: p3, check: b2 }; } } function W0$1() { @@ -94214,9 +23520,9 @@ function af$1(e18, t2) { if (!e18) throw new Error(t2 || "Assertion failed"); } -af$1.equal = function(t2, r2, i3) { +af$1.equal = function(t2, r2, i2) { if (t2 != r2) - throw new Error(i3 || "Assertion failed: " + t2 + " != " + r2); + throw new Error(i2 || "Assertion failed: " + t2 + " != " + r2); }; var Ii$1 = { exports: {} }; typeof Object.create == "function" ? Ii$1.exports = function(t2, r2) { @@ -94224,9 +23530,9 @@ typeof Object.create == "function" ? Ii$1.exports = function(t2, r2) { } : Ii$1.exports = function(t2, r2) { if (r2) { t2.super_ = r2; - var i3 = function() { + var i2 = function() { }; - i3.prototype = r2.prototype, t2.prototype = new i3(), t2.prototype.constructor = t2; + i2.prototype = r2.prototype, t2.prototype = new i2(), t2.prototype.constructor = t2; } }; var us = yr$2, hs = Ii$1.exports; @@ -94243,16 +23549,16 @@ function ls$1(e18, t2) { if (typeof e18 == "string") if (t2) { if (t2 === "hex") - for (e18 = e18.replace(/[^a-z0-9]+/ig, ""), e18.length % 2 !== 0 && (e18 = "0" + e18), n4 = 0; n4 < e18.length; n4 += 2) - r2.push(parseInt(e18[n4] + e18[n4 + 1], 16)); + for (e18 = e18.replace(/[^a-z0-9]+/ig, ""), e18.length % 2 !== 0 && (e18 = "0" + e18), n5 = 0; n5 < e18.length; n5 += 2) + r2.push(parseInt(e18[n5] + e18[n5 + 1], 16)); } else - for (var i3 = 0, n4 = 0; n4 < e18.length; n4++) { - var o2 = e18.charCodeAt(n4); - o2 < 128 ? r2[i3++] = o2 : o2 < 2048 ? (r2[i3++] = o2 >> 6 | 192, r2[i3++] = o2 & 63 | 128) : cs$1(e18, n4) ? (o2 = 65536 + ((o2 & 1023) << 10) + (e18.charCodeAt(++n4) & 1023), r2[i3++] = o2 >> 18 | 240, r2[i3++] = o2 >> 12 & 63 | 128, r2[i3++] = o2 >> 6 & 63 | 128, r2[i3++] = o2 & 63 | 128) : (r2[i3++] = o2 >> 12 | 224, r2[i3++] = o2 >> 6 & 63 | 128, r2[i3++] = o2 & 63 | 128); + for (var i2 = 0, n5 = 0; n5 < e18.length; n5++) { + var o2 = e18.charCodeAt(n5); + o2 < 128 ? r2[i2++] = o2 : o2 < 2048 ? (r2[i2++] = o2 >> 6 | 192, r2[i2++] = o2 & 63 | 128) : cs$1(e18, n5) ? (o2 = 65536 + ((o2 & 1023) << 10) + (e18.charCodeAt(++n5) & 1023), r2[i2++] = o2 >> 18 | 240, r2[i2++] = o2 >> 12 & 63 | 128, r2[i2++] = o2 >> 6 & 63 | 128, r2[i2++] = o2 & 63 | 128) : (r2[i2++] = o2 >> 12 | 224, r2[i2++] = o2 >> 6 & 63 | 128, r2[i2++] = o2 & 63 | 128); } else - for (n4 = 0; n4 < e18.length; n4++) - r2[n4] = e18[n4] | 0; + for (n5 = 0; n5 < e18.length; n5++) + r2[n5] = e18[n5] | 0; return r2; } Q$2.toArray = ls$1; @@ -94268,9 +23574,9 @@ function uf(e18) { } Q$2.htonl = uf; function ps(e18, t2) { - for (var r2 = "", i3 = 0; i3 < e18.length; i3++) { - var n4 = e18[i3]; - t2 === "little" && (n4 = uf(n4)), r2 += cf$1(n4.toString(16)); + for (var r2 = "", i2 = 0; i2 < e18.length; i2++) { + var n5 = e18[i2]; + t2 === "little" && (n5 = uf(n5)), r2 += cf$1(n5.toString(16)); } return r2; } @@ -94283,20 +23589,20 @@ function cf$1(e18) { return e18.length === 7 ? "0" + e18 : e18.length === 6 ? "00" + e18 : e18.length === 5 ? "000" + e18 : e18.length === 4 ? "0000" + e18 : e18.length === 3 ? "00000" + e18 : e18.length === 2 ? "000000" + e18 : e18.length === 1 ? "0000000" + e18 : e18; } Q$2.zero8 = cf$1; -function vs$1(e18, t2, r2, i3) { - var n4 = r2 - t2; - us(n4 % 4 === 0); - for (var o2 = new Array(n4 / 4), h4 = 0, p3 = t2; h4 < o2.length; h4++, p3 += 4) { +function vs$1(e18, t2, r2, i2) { + var n5 = r2 - t2; + us(n5 % 4 === 0); + for (var o2 = new Array(n5 / 4), h4 = 0, p3 = t2; h4 < o2.length; h4++, p3 += 4) { var b2; - i3 === "big" ? b2 = e18[p3] << 24 | e18[p3 + 1] << 16 | e18[p3 + 2] << 8 | e18[p3 + 3] : b2 = e18[p3 + 3] << 24 | e18[p3 + 2] << 16 | e18[p3 + 1] << 8 | e18[p3], o2[h4] = b2 >>> 0; + i2 === "big" ? b2 = e18[p3] << 24 | e18[p3 + 1] << 16 | e18[p3 + 2] << 8 | e18[p3 + 3] : b2 = e18[p3 + 3] << 24 | e18[p3 + 2] << 16 | e18[p3 + 1] << 8 | e18[p3], o2[h4] = b2 >>> 0; } return o2; } Q$2.join32 = vs$1; function ms$2(e18, t2) { - for (var r2 = new Array(e18.length * 4), i3 = 0, n4 = 0; i3 < e18.length; i3++, n4 += 4) { - var o2 = e18[i3]; - t2 === "big" ? (r2[n4] = o2 >>> 24, r2[n4 + 1] = o2 >>> 16 & 255, r2[n4 + 2] = o2 >>> 8 & 255, r2[n4 + 3] = o2 & 255) : (r2[n4 + 3] = o2 >>> 24, r2[n4 + 2] = o2 >>> 16 & 255, r2[n4 + 1] = o2 >>> 8 & 255, r2[n4] = o2 & 255); + for (var r2 = new Array(e18.length * 4), i2 = 0, n5 = 0; i2 < e18.length; i2++, n5 += 4) { + var o2 = e18[i2]; + t2 === "big" ? (r2[n5] = o2 >>> 24, r2[n5 + 1] = o2 >>> 16 & 255, r2[n5 + 2] = o2 >>> 8 & 255, r2[n5 + 3] = o2 & 255) : (r2[n5 + 3] = o2 >>> 24, r2[n5 + 2] = o2 >>> 16 & 255, r2[n5 + 1] = o2 >>> 8 & 255, r2[n5] = o2 & 255); } return r2; } @@ -94317,61 +23623,61 @@ function ys$2(e18, t2, r2) { return e18 + t2 + r2 >>> 0; } Q$2.sum32_3 = ys$2; -function ws$2(e18, t2, r2, i3) { - return e18 + t2 + r2 + i3 >>> 0; +function ws$2(e18, t2, r2, i2) { + return e18 + t2 + r2 + i2 >>> 0; } Q$2.sum32_4 = ws$2; -function xs$2(e18, t2, r2, i3, n4) { - return e18 + t2 + r2 + i3 + n4 >>> 0; +function xs$2(e18, t2, r2, i2, n5) { + return e18 + t2 + r2 + i2 + n5 >>> 0; } Q$2.sum32_5 = xs$2; -function Ms$2(e18, t2, r2, i3) { - var n4 = e18[t2], o2 = e18[t2 + 1], h4 = i3 + o2 >>> 0, p3 = (h4 < i3 ? 1 : 0) + r2 + n4; +function Ms$2(e18, t2, r2, i2) { + var n5 = e18[t2], o2 = e18[t2 + 1], h4 = i2 + o2 >>> 0, p3 = (h4 < i2 ? 1 : 0) + r2 + n5; e18[t2] = p3 >>> 0, e18[t2 + 1] = h4; } Q$2.sum64 = Ms$2; -function Es$2(e18, t2, r2, i3) { - var n4 = t2 + i3 >>> 0, o2 = (n4 < t2 ? 1 : 0) + e18 + r2; +function Es$2(e18, t2, r2, i2) { + var n5 = t2 + i2 >>> 0, o2 = (n5 < t2 ? 1 : 0) + e18 + r2; return o2 >>> 0; } Q$2.sum64_hi = Es$2; -function Ss$3(e18, t2, r2, i3) { - var n4 = t2 + i3; - return n4 >>> 0; +function Ss$3(e18, t2, r2, i2) { + var n5 = t2 + i2; + return n5 >>> 0; } Q$2.sum64_lo = Ss$3; -function Ns$2(e18, t2, r2, i3, n4, o2, h4, p3) { +function Ns$2(e18, t2, r2, i2, n5, o2, h4, p3) { var b2 = 0, m3 = t2; - m3 = m3 + i3 >>> 0, b2 += m3 < t2 ? 1 : 0, m3 = m3 + o2 >>> 0, b2 += m3 < o2 ? 1 : 0, m3 = m3 + p3 >>> 0, b2 += m3 < p3 ? 1 : 0; - var w2 = e18 + r2 + n4 + h4 + b2; + m3 = m3 + i2 >>> 0, b2 += m3 < t2 ? 1 : 0, m3 = m3 + o2 >>> 0, b2 += m3 < o2 ? 1 : 0, m3 = m3 + p3 >>> 0, b2 += m3 < p3 ? 1 : 0; + var w2 = e18 + r2 + n5 + h4 + b2; return w2 >>> 0; } Q$2.sum64_4_hi = Ns$2; -function Is$3(e18, t2, r2, i3, n4, o2, h4, p3) { - var b2 = t2 + i3 + o2 + p3; +function Is$3(e18, t2, r2, i2, n5, o2, h4, p3) { + var b2 = t2 + i2 + o2 + p3; return b2 >>> 0; } Q$2.sum64_4_lo = Is$3; -function _s$2(e18, t2, r2, i3, n4, o2, h4, p3, b2, m3) { +function _s$2(e18, t2, r2, i2, n5, o2, h4, p3, b2, m3) { var w2 = 0, y3 = t2; - y3 = y3 + i3 >>> 0, w2 += y3 < t2 ? 1 : 0, y3 = y3 + o2 >>> 0, w2 += y3 < o2 ? 1 : 0, y3 = y3 + p3 >>> 0, w2 += y3 < p3 ? 1 : 0, y3 = y3 + m3 >>> 0, w2 += y3 < m3 ? 1 : 0; - var S4 = e18 + r2 + n4 + h4 + b2 + w2; + y3 = y3 + i2 >>> 0, w2 += y3 < t2 ? 1 : 0, y3 = y3 + o2 >>> 0, w2 += y3 < o2 ? 1 : 0, y3 = y3 + p3 >>> 0, w2 += y3 < p3 ? 1 : 0, y3 = y3 + m3 >>> 0, w2 += y3 < m3 ? 1 : 0; + var S4 = e18 + r2 + n5 + h4 + b2 + w2; return S4 >>> 0; } Q$2.sum64_5_hi = _s$2; -function Bs$2(e18, t2, r2, i3, n4, o2, h4, p3, b2, m3) { - var w2 = t2 + i3 + o2 + p3 + m3; +function Bs$2(e18, t2, r2, i2, n5, o2, h4, p3, b2, m3) { + var w2 = t2 + i2 + o2 + p3 + m3; return w2 >>> 0; } Q$2.sum64_5_lo = Bs$2; function Cs$2(e18, t2, r2) { - var i3 = t2 << 32 - r2 | e18 >>> r2; - return i3 >>> 0; + var i2 = t2 << 32 - r2 | e18 >>> r2; + return i2 >>> 0; } Q$2.rotr64_hi = Cs$2; function Rs$3(e18, t2, r2) { - var i3 = e18 << 32 - r2 | t2 >>> r2; - return i3 >>> 0; + var i2 = e18 << 32 - r2 | t2 >>> r2; + return i2 >>> 0; } Q$2.rotr64_lo = Rs$3; function Os$2(e18, t2, r2) { @@ -94379,8 +23685,8 @@ function Os$2(e18, t2, r2) { } Q$2.shr64_hi = Os$2; function Ps$2(e18, t2, r2) { - var i3 = e18 << 32 - r2 | t2 >>> r2; - return i3 >>> 0; + var i2 = e18 << 32 - r2 | t2 >>> r2; + return i2 >>> 0; } Q$2.shr64_lo = Ps$2; var fr$2 = {}, lf$1 = Q$2, Ds$1 = yr$2; @@ -94390,36 +23696,36 @@ function Fr$2() { fr$2.BlockHash = Fr$2, Fr$2.prototype.update = function(t2, r2) { if (t2 = lf$1.toArray(t2, r2), this.pending ? this.pending = this.pending.concat(t2) : this.pending = t2, this.pendingTotal += t2.length, this.pending.length >= this._delta8) { t2 = this.pending; - var i3 = t2.length % this._delta8; - this.pending = t2.slice(t2.length - i3, t2.length), this.pending.length === 0 && (this.pending = null), t2 = lf$1.join32(t2, 0, t2.length - i3, this.endian); - for (var n4 = 0; n4 < t2.length; n4 += this._delta32) - this._update(t2, n4, n4 + this._delta32); + var i2 = t2.length % this._delta8; + this.pending = t2.slice(t2.length - i2, t2.length), this.pending.length === 0 && (this.pending = null), t2 = lf$1.join32(t2, 0, t2.length - i2, this.endian); + for (var n5 = 0; n5 < t2.length; n5 += this._delta32) + this._update(t2, n5, n5 + this._delta32); } return this; }, Fr$2.prototype.digest = function(t2) { return this.update(this._pad()), Ds$1(this.pending === null), this._digest(t2); }, Fr$2.prototype._pad = function() { - var t2 = this.pendingTotal, r2 = this._delta8, i3 = r2 - (t2 + this.padLength) % r2, n4 = new Array(i3 + this.padLength); - n4[0] = 128; - for (var o2 = 1; o2 < i3; o2++) - n4[o2] = 0; + var t2 = this.pendingTotal, r2 = this._delta8, i2 = r2 - (t2 + this.padLength) % r2, n5 = new Array(i2 + this.padLength); + n5[0] = 128; + for (var o2 = 1; o2 < i2; o2++) + n5[o2] = 0; if (t2 <<= 3, this.endian === "big") { for (var h4 = 8; h4 < this.padLength; h4++) - n4[o2++] = 0; - n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = t2 >>> 24 & 255, n4[o2++] = t2 >>> 16 & 255, n4[o2++] = t2 >>> 8 & 255, n4[o2++] = t2 & 255; + n5[o2++] = 0; + n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = t2 >>> 24 & 255, n5[o2++] = t2 >>> 16 & 255, n5[o2++] = t2 >>> 8 & 255, n5[o2++] = t2 & 255; } else - for (n4[o2++] = t2 & 255, n4[o2++] = t2 >>> 8 & 255, n4[o2++] = t2 >>> 16 & 255, n4[o2++] = t2 >>> 24 & 255, n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = 0, h4 = 8; h4 < this.padLength; h4++) - n4[o2++] = 0; - return n4; + for (n5[o2++] = t2 & 255, n5[o2++] = t2 >>> 8 & 255, n5[o2++] = t2 >>> 16 & 255, n5[o2++] = t2 >>> 24 & 255, n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = 0, h4 = 8; h4 < this.padLength; h4++) + n5[o2++] = 0; + return n5; }; var or$2 = {}, ae$3 = {}, Fs$2 = Q$2, ue$1 = Fs$2.rotr32; -function Ts$2(e18, t2, r2, i3) { +function Ts$2(e18, t2, r2, i2) { if (e18 === 0) - return df$1(t2, r2, i3); + return df$1(t2, r2, i2); if (e18 === 1 || e18 === 3) - return vf$1(t2, r2, i3); + return vf$1(t2, r2, i2); if (e18 === 2) - return pf$1(t2, r2, i3); + return pf$1(t2, r2, i2); } ae$3.ft_1 = Ts$2; function df$1(e18, t2, r2) { @@ -94450,7 +23756,7 @@ function Ks$2(e18) { return ue$1(e18, 17) ^ ue$1(e18, 19) ^ e18 >>> 10; } ae$3.g1_256 = Ks$2; -var sr$2 = Q$2, Hs$2 = fr$2, zs$2 = ae$3, _i$1 = sr$2.rotl32, wr$2 = sr$2.sum32, Ls$2 = sr$2.sum32_5, js$2 = zs$2.ft_1, mf$1 = Hs$2.BlockHash, Qs$1 = [1518500249, 1859775393, 2400959708, 3395469782]; +var sr$2 = Q$2, Hs$2 = fr$2, zs$2 = ae$3, _i$2 = sr$2.rotl32, wr$2 = sr$2.sum32, Ls$2 = sr$2.sum32_5, js$2 = zs$2.ft_1, mf$1 = Hs$2.BlockHash, Qs$1 = [1518500249, 1859775393, 2400959708, 3395469782]; function he$1() { if (!(this instanceof he$1)) return new he$1(); @@ -94459,14 +23765,14 @@ function he$1() { sr$2.inherits(he$1, mf$1); var Js$1 = he$1; he$1.blockSize = 512, he$1.outSize = 160, he$1.hmacStrength = 80, he$1.padLength = 64, he$1.prototype._update = function(t2, r2) { - for (var i3 = this.W, n4 = 0; n4 < 16; n4++) - i3[n4] = t2[r2 + n4]; - for (; n4 < i3.length; n4++) - i3[n4] = _i$1(i3[n4 - 3] ^ i3[n4 - 8] ^ i3[n4 - 14] ^ i3[n4 - 16], 1); + for (var i2 = this.W, n5 = 0; n5 < 16; n5++) + i2[n5] = t2[r2 + n5]; + for (; n5 < i2.length; n5++) + i2[n5] = _i$2(i2[n5 - 3] ^ i2[n5 - 8] ^ i2[n5 - 14] ^ i2[n5 - 16], 1); var o2 = this.h[0], h4 = this.h[1], p3 = this.h[2], b2 = this.h[3], m3 = this.h[4]; - for (n4 = 0; n4 < i3.length; n4++) { - var w2 = ~~(n4 / 20), y3 = Ls$2(_i$1(o2, 5), js$2(w2, h4, p3, b2), m3, i3[n4], Qs$1[w2]); - m3 = b2, b2 = p3, p3 = _i$1(h4, 30), h4 = o2, o2 = y3; + for (n5 = 0; n5 < i2.length; n5++) { + var w2 = ~~(n5 / 20), y3 = Ls$2(_i$2(o2, 5), js$2(w2, h4, p3, b2), m3, i2[n5], Qs$1[w2]); + m3 = b2, b2 = p3, p3 = _i$2(h4, 30), h4 = o2, o2 = y3; } this.h[0] = wr$2(this.h[0], o2), this.h[1] = wr$2(this.h[1], h4), this.h[2] = wr$2(this.h[2], p3), this.h[3] = wr$2(this.h[3], b2), this.h[4] = wr$2(this.h[4], m3); }, he$1.prototype._digest = function(t2) { @@ -94481,13 +23787,13 @@ function ce$2() { ar$2.inherits(ce$2, gf$1); var Af$1 = ce$2; ce$2.blockSize = 512, ce$2.outSize = 256, ce$2.hmacStrength = 192, ce$2.padLength = 64, ce$2.prototype._update = function(t2, r2) { - for (var i3 = this.W, n4 = 0; n4 < 16; n4++) - i3[n4] = t2[r2 + n4]; - for (; n4 < i3.length; n4++) - i3[n4] = Vs$2(ra$1(i3[n4 - 2]), i3[n4 - 7], ea$1(i3[n4 - 15]), i3[n4 - 16]); + for (var i2 = this.W, n5 = 0; n5 < 16; n5++) + i2[n5] = t2[r2 + n5]; + for (; n5 < i2.length; n5++) + i2[n5] = Vs$2(ra$1(i2[n5 - 2]), i2[n5 - 7], ea$1(i2[n5 - 15]), i2[n5 - 16]); var o2 = this.h[0], h4 = this.h[1], p3 = this.h[2], b2 = this.h[3], m3 = this.h[4], w2 = this.h[5], y3 = this.h[6], S4 = this.h[7]; - for (Ys$2(this.k.length === i3.length), n4 = 0; n4 < i3.length; n4++) { - var I2 = Ws$2(S4, ta$1(m3), Xs$2(m3, w2, y3), this.k[n4], i3[n4]), N2 = ie$1($s$2(o2), Zs$2(o2, h4, p3)); + for (Ys$2(this.k.length === i2.length), n5 = 0; n5 < i2.length; n5++) { + var I2 = Ws$2(S4, ta$1(m3), Xs$2(m3, w2, y3), this.k[n5], i2[n5]), N2 = ie$1($s$2(o2), Zs$2(o2, h4, p3)); S4 = y3, y3 = w2, w2 = m3, m3 = ie$1(b2, I2), b2 = p3, p3 = h4, h4 = o2, o2 = ie$1(I2, N2); } this.h[0] = ie$1(this.h[0], o2), this.h[1] = ie$1(this.h[1], h4), this.h[2] = ie$1(this.h[2], p3), this.h[3] = ie$1(this.h[3], b2), this.h[4] = ie$1(this.h[4], m3), this.h[5] = ie$1(this.h[5], w2), this.h[6] = ie$1(this.h[6], y3), this.h[7] = ie$1(this.h[7], S4); @@ -94514,72 +23820,72 @@ function ne$2() { jt$2.inherits(ne$2, xf$1); var Mf$1 = ne$2; ne$2.blockSize = 1024, ne$2.outSize = 512, ne$2.hmacStrength = 192, ne$2.padLength = 128, ne$2.prototype._prepareBlock = function(t2, r2) { - for (var i3 = this.W, n4 = 0; n4 < 32; n4++) - i3[n4] = t2[r2 + n4]; - for (; n4 < i3.length; n4 += 2) { - var o2 = xa$1(i3[n4 - 4], i3[n4 - 3]), h4 = Ma$1(i3[n4 - 4], i3[n4 - 3]), p3 = i3[n4 - 14], b2 = i3[n4 - 13], m3 = ya$2(i3[n4 - 30], i3[n4 - 29]), w2 = wa$1(i3[n4 - 30], i3[n4 - 29]), y3 = i3[n4 - 32], S4 = i3[n4 - 31]; - i3[n4] = sa$1(o2, h4, p3, b2, m3, w2, y3, S4), i3[n4 + 1] = aa$1(o2, h4, p3, b2, m3, w2, y3, S4); + for (var i2 = this.W, n5 = 0; n5 < 32; n5++) + i2[n5] = t2[r2 + n5]; + for (; n5 < i2.length; n5 += 2) { + var o2 = xa$1(i2[n5 - 4], i2[n5 - 3]), h4 = Ma$1(i2[n5 - 4], i2[n5 - 3]), p3 = i2[n5 - 14], b2 = i2[n5 - 13], m3 = ya$2(i2[n5 - 30], i2[n5 - 29]), w2 = wa$1(i2[n5 - 30], i2[n5 - 29]), y3 = i2[n5 - 32], S4 = i2[n5 - 31]; + i2[n5] = sa$1(o2, h4, p3, b2, m3, w2, y3, S4), i2[n5 + 1] = aa$1(o2, h4, p3, b2, m3, w2, y3, S4); } }, ne$2.prototype._update = function(t2, r2) { this._prepareBlock(t2, r2); - var i3 = this.W, n4 = this.h[0], o2 = this.h[1], h4 = this.h[2], p3 = this.h[3], b2 = this.h[4], m3 = this.h[5], w2 = this.h[6], y3 = this.h[7], S4 = this.h[8], I2 = this.h[9], N2 = this.h[10], C3 = this.h[11], F2 = this.h[12], U5 = this.h[13], J2 = this.h[14], Bt2 = this.h[15]; - oa$1(this.k.length === i3.length); - for (var G2 = 0; G2 < i3.length; G2 += 2) { - var H2 = J2, z3 = Bt2, Pt2 = Aa$1(S4, I2), W2 = ba$2(S4, I2), Rt2 = la$1(S4, I2, N2, C3, F2), Yt2 = da$1(S4, I2, N2, C3, F2, U5), Y2 = this.k[G2], Vt2 = this.k[G2 + 1], A2 = i3[G2], f3 = i3[G2 + 1], a3 = ua$1(H2, z3, Pt2, W2, Rt2, Yt2, Y2, Vt2, A2, f3), c2 = ha$1(H2, z3, Pt2, W2, Rt2, Yt2, Y2, Vt2, A2, f3); - H2 = ma$1(n4, o2), z3 = ga$1(n4, o2), Pt2 = pa$1(n4, o2, h4, p3, b2), W2 = va$1(n4, o2, h4, p3, b2, m3); + var i2 = this.W, n5 = this.h[0], o2 = this.h[1], h4 = this.h[2], p3 = this.h[3], b2 = this.h[4], m3 = this.h[5], w2 = this.h[6], y3 = this.h[7], S4 = this.h[8], I2 = this.h[9], N2 = this.h[10], C3 = this.h[11], F2 = this.h[12], U5 = this.h[13], J2 = this.h[14], Bt2 = this.h[15]; + oa$1(this.k.length === i2.length); + for (var G2 = 0; G2 < i2.length; G2 += 2) { + var H2 = J2, z3 = Bt2, Pt2 = Aa$1(S4, I2), W2 = ba$2(S4, I2), Rt2 = la$1(S4, I2, N2, C3, F2), Yt2 = da$1(S4, I2, N2, C3, F2, U5), Y2 = this.k[G2], Vt2 = this.k[G2 + 1], A2 = i2[G2], f4 = i2[G2 + 1], a3 = ua$1(H2, z3, Pt2, W2, Rt2, Yt2, Y2, Vt2, A2, f4), c2 = ha$1(H2, z3, Pt2, W2, Rt2, Yt2, Y2, Vt2, A2, f4); + H2 = ma$1(n5, o2), z3 = ga$1(n5, o2), Pt2 = pa$1(n5, o2, h4, p3, b2), W2 = va$1(n5, o2, h4, p3, b2, m3); var d4 = Ci$1(H2, z3, Pt2, W2), g3 = Ri$1(H2, z3, Pt2, W2); - J2 = F2, Bt2 = U5, F2 = N2, U5 = C3, N2 = S4, C3 = I2, S4 = Ci$1(w2, y3, a3, c2), I2 = Ri$1(y3, y3, a3, c2), w2 = b2, y3 = m3, b2 = h4, m3 = p3, h4 = n4, p3 = o2, n4 = Ci$1(a3, c2, d4, g3), o2 = Ri$1(a3, c2, d4, g3); + J2 = F2, Bt2 = U5, F2 = N2, U5 = C3, N2 = S4, C3 = I2, S4 = Ci$1(w2, y3, a3, c2), I2 = Ri$1(y3, y3, a3, c2), w2 = b2, y3 = m3, b2 = h4, m3 = p3, h4 = n5, p3 = o2, n5 = Ci$1(a3, c2, d4, g3), o2 = Ri$1(a3, c2, d4, g3); } - Be$1(this.h, 0, n4, o2), Be$1(this.h, 2, h4, p3), Be$1(this.h, 4, b2, m3), Be$1(this.h, 6, w2, y3), Be$1(this.h, 8, S4, I2), Be$1(this.h, 10, N2, C3), Be$1(this.h, 12, F2, U5), Be$1(this.h, 14, J2, Bt2); + Be$1(this.h, 0, n5, o2), Be$1(this.h, 2, h4, p3), Be$1(this.h, 4, b2, m3), Be$1(this.h, 6, w2, y3), Be$1(this.h, 8, S4, I2), Be$1(this.h, 10, N2, C3), Be$1(this.h, 12, F2, U5), Be$1(this.h, 14, J2, Bt2); }, ne$2.prototype._digest = function(t2) { return t2 === "hex" ? jt$2.toHex32(this.h, "big") : jt$2.split32(this.h, "big"); }; -function la$1(e18, t2, r2, i3, n4) { - var o2 = e18 & r2 ^ ~e18 & n4; +function la$1(e18, t2, r2, i2, n5) { + var o2 = e18 & r2 ^ ~e18 & n5; return o2 < 0 && (o2 += 4294967296), o2; } -function da$1(e18, t2, r2, i3, n4, o2) { - var h4 = t2 & i3 ^ ~t2 & o2; +function da$1(e18, t2, r2, i2, n5, o2) { + var h4 = t2 & i2 ^ ~t2 & o2; return h4 < 0 && (h4 += 4294967296), h4; } -function pa$1(e18, t2, r2, i3, n4) { - var o2 = e18 & r2 ^ e18 & n4 ^ r2 & n4; +function pa$1(e18, t2, r2, i2, n5) { + var o2 = e18 & r2 ^ e18 & n5 ^ r2 & n5; return o2 < 0 && (o2 += 4294967296), o2; } -function va$1(e18, t2, r2, i3, n4, o2) { - var h4 = t2 & i3 ^ t2 & o2 ^ i3 & o2; +function va$1(e18, t2, r2, i2, n5, o2) { + var h4 = t2 & i2 ^ t2 & o2 ^ i2 & o2; return h4 < 0 && (h4 += 4294967296), h4; } function ma$1(e18, t2) { - var r2 = le$1(e18, t2, 28), i3 = le$1(t2, e18, 2), n4 = le$1(t2, e18, 7), o2 = r2 ^ i3 ^ n4; + var r2 = le$1(e18, t2, 28), i2 = le$1(t2, e18, 2), n5 = le$1(t2, e18, 7), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function ga$1(e18, t2) { - var r2 = de$1(e18, t2, 28), i3 = de$1(t2, e18, 2), n4 = de$1(t2, e18, 7), o2 = r2 ^ i3 ^ n4; + var r2 = de$1(e18, t2, 28), i2 = de$1(t2, e18, 2), n5 = de$1(t2, e18, 7), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function Aa$1(e18, t2) { - var r2 = le$1(e18, t2, 14), i3 = le$1(e18, t2, 18), n4 = le$1(t2, e18, 9), o2 = r2 ^ i3 ^ n4; + var r2 = le$1(e18, t2, 14), i2 = le$1(e18, t2, 18), n5 = le$1(t2, e18, 9), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function ba$2(e18, t2) { - var r2 = de$1(e18, t2, 14), i3 = de$1(e18, t2, 18), n4 = de$1(t2, e18, 9), o2 = r2 ^ i3 ^ n4; + var r2 = de$1(e18, t2, 14), i2 = de$1(e18, t2, 18), n5 = de$1(t2, e18, 9), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function ya$2(e18, t2) { - var r2 = le$1(e18, t2, 1), i3 = le$1(e18, t2, 8), n4 = yf$1(e18, t2, 7), o2 = r2 ^ i3 ^ n4; + var r2 = le$1(e18, t2, 1), i2 = le$1(e18, t2, 8), n5 = yf$1(e18, t2, 7), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function wa$1(e18, t2) { - var r2 = de$1(e18, t2, 1), i3 = de$1(e18, t2, 8), n4 = wf$1(e18, t2, 7), o2 = r2 ^ i3 ^ n4; + var r2 = de$1(e18, t2, 1), i2 = de$1(e18, t2, 8), n5 = wf$1(e18, t2, 7), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function xa$1(e18, t2) { - var r2 = le$1(e18, t2, 19), i3 = le$1(t2, e18, 29), n4 = yf$1(e18, t2, 6), o2 = r2 ^ i3 ^ n4; + var r2 = le$1(e18, t2, 19), i2 = le$1(t2, e18, 29), n5 = yf$1(e18, t2, 6), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function Ma$1(e18, t2) { - var r2 = de$1(e18, t2, 19), i3 = de$1(t2, e18, 29), n4 = wf$1(e18, t2, 6), o2 = r2 ^ i3 ^ n4; + var r2 = de$1(e18, t2, 19), i2 = de$1(t2, e18, 29), n5 = wf$1(e18, t2, 6), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } var Oi$1 = Q$2, Ef$1 = Mf$1; @@ -94600,16 +23906,16 @@ function pe$1() { _f$1.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = "little"; } Xe$2.inherits(pe$1, _f$1), Sf$1.ripemd160 = pe$1, pe$1.blockSize = 512, pe$1.outSize = 160, pe$1.hmacStrength = 192, pe$1.padLength = 64, pe$1.prototype._update = function(t2, r2) { - for (var i3 = this.h[0], n4 = this.h[1], o2 = this.h[2], h4 = this.h[3], p3 = this.h[4], b2 = i3, m3 = n4, w2 = o2, y3 = h4, S4 = p3, I2 = 0; I2 < 80; I2++) { - var N2 = Nf$1(Tr$2(If$1(i3, Bf$1(I2, n4, o2, h4), t2[_a$1[I2] + r2], Na$2(I2)), Ca$1[I2]), p3); - i3 = p3, p3 = h4, h4 = Tr$2(o2, 10), o2 = n4, n4 = N2, N2 = Nf$1(Tr$2(If$1(b2, Bf$1(79 - I2, m3, w2, y3), t2[Ba$1[I2] + r2], Ia$1(I2)), Ra$2[I2]), S4), b2 = S4, S4 = y3, y3 = Tr$2(w2, 10), w2 = m3, m3 = N2; + for (var i2 = this.h[0], n5 = this.h[1], o2 = this.h[2], h4 = this.h[3], p3 = this.h[4], b2 = i2, m3 = n5, w2 = o2, y3 = h4, S4 = p3, I2 = 0; I2 < 80; I2++) { + var N2 = Nf$1(Tr$2(If$1(i2, Bf$1(I2, n5, o2, h4), t2[_a$2[I2] + r2], Na$2(I2)), Ca$1[I2]), p3); + i2 = p3, p3 = h4, h4 = Tr$2(o2, 10), o2 = n5, n5 = N2, N2 = Nf$1(Tr$2(If$1(b2, Bf$1(79 - I2, m3, w2, y3), t2[Ba$1[I2] + r2], Ia$1(I2)), Ra$2[I2]), S4), b2 = S4, S4 = y3, y3 = Tr$2(w2, 10), w2 = m3, m3 = N2; } - N2 = xr$2(this.h[1], o2, y3), this.h[1] = xr$2(this.h[2], h4, S4), this.h[2] = xr$2(this.h[3], p3, b2), this.h[3] = xr$2(this.h[4], i3, m3), this.h[4] = xr$2(this.h[0], n4, w2), this.h[0] = N2; + N2 = xr$2(this.h[1], o2, y3), this.h[1] = xr$2(this.h[2], h4, S4), this.h[2] = xr$2(this.h[3], p3, b2), this.h[3] = xr$2(this.h[4], i2, m3), this.h[4] = xr$2(this.h[0], n5, w2), this.h[0] = N2; }, pe$1.prototype._digest = function(t2) { return t2 === "hex" ? Xe$2.toHex32(this.h, "little") : Xe$2.split32(this.h, "little"); }; -function Bf$1(e18, t2, r2, i3) { - return e18 <= 15 ? t2 ^ r2 ^ i3 : e18 <= 31 ? t2 & r2 | ~t2 & i3 : e18 <= 47 ? (t2 | ~r2) ^ i3 : e18 <= 63 ? t2 & i3 | r2 & ~i3 : t2 ^ (r2 | ~i3); +function Bf$1(e18, t2, r2, i2) { + return e18 <= 15 ? t2 ^ r2 ^ i2 : e18 <= 31 ? t2 & r2 | ~t2 & i2 : e18 <= 47 ? (t2 | ~r2) ^ i2 : e18 <= 63 ? t2 & i2 | r2 & ~i2 : t2 ^ (r2 | ~i2); } function Na$2(e18) { return e18 <= 15 ? 0 : e18 <= 31 ? 1518500249 : e18 <= 47 ? 1859775393 : e18 <= 63 ? 2400959708 : 2840853838; @@ -94617,7 +23923,7 @@ function Na$2(e18) { function Ia$1(e18) { return e18 <= 15 ? 1352829926 : e18 <= 31 ? 1548603684 : e18 <= 47 ? 1836072691 : e18 <= 63 ? 2053994217 : 0; } -var _a$1 = [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], Ba$1 = [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], Ca$1 = [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], Ra$2 = [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], Oa$2 = Q$2, Pa$1 = yr$2; +var _a$2 = [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], Ba$1 = [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], Ca$1 = [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], Ra$2 = [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], Oa$2 = Q$2, Pa$1 = yr$2; function hr$2(e18, t2, r2) { if (!(this instanceof hr$2)) return new hr$2(e18, t2, r2); @@ -94642,25 +23948,25 @@ hr$2.prototype._init = function(t2) { t2.utils = Q$2, t2.common = fr$2, t2.sha = or$2, t2.ripemd = Sf$1, t2.hmac = Da$2, t2.sha1 = t2.sha.sha1, t2.sha256 = t2.sha.sha256, t2.sha224 = t2.sha.sha224, t2.sha384 = t2.sha.sha384, t2.sha512 = t2.sha.sha512, t2.ripemd160 = t2.ripemd.ripemd160; }(se$1); function cr$2(e18, t2, r2) { - return r2 = { path: t2, exports: {}, require: function(i3, n4) { - return Fa$2(i3, n4 ?? r2.path); + return r2 = { path: t2, exports: {}, require: function(i2, n5) { + return Fa$2(i2, n5 ?? r2.path); } }, e18(r2, r2.exports), r2.exports; } function Fa$2() { throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs"); } -var Pi$1 = Cf$1; +var Pi$2 = Cf$1; function Cf$1(e18, t2) { if (!e18) throw new Error(t2 || "Assertion failed"); } -Cf$1.equal = function(t2, r2, i3) { +Cf$1.equal = function(t2, r2, i2) { if (t2 != r2) - throw new Error(i3 || "Assertion failed: " + t2 + " != " + r2); + throw new Error(i2 || "Assertion failed: " + t2 + " != " + r2); }; var fe$2 = cr$2(function(e18, t2) { var r2 = t2; - function i3(h4, p3) { + function i2(h4, p3) { if (Array.isArray(h4)) return h4.slice(); if (!h4) @@ -94682,14 +23988,14 @@ var fe$2 = cr$2(function(e18, t2) { } return b2; } - r2.toArray = i3; - function n4(h4) { + r2.toArray = i2; + function n5(h4) { return h4.length === 1 ? "0" + h4 : h4; } - r2.zero2 = n4; + r2.zero2 = n5; function o2(h4) { for (var p3 = "", b2 = 0; b2 < h4.length; b2++) - p3 += n4(h4[b2].toString(16)); + p3 += n5(h4[b2].toString(16)); return p3; } r2.toHex = o2, r2.encode = function(p3, b2) { @@ -94697,8 +24003,8 @@ var fe$2 = cr$2(function(e18, t2) { }; }), Jt$2 = cr$2(function(e18, t2) { var r2 = t2; - r2.assert = Pi$1, r2.toArray = fe$2.toArray, r2.zero2 = fe$2.zero2, r2.toHex = fe$2.toHex, r2.encode = fe$2.encode; - function i3(b2, m3, w2) { + r2.assert = Pi$2, r2.toArray = fe$2.toArray, r2.zero2 = fe$2.zero2, r2.toHex = fe$2.toHex, r2.encode = fe$2.encode; + function i2(b2, m3, w2) { var y3 = new Array(Math.max(b2.bitLength(), w2) + 1); y3.fill(0); for (var S4 = 1 << m3 + 1, I2 = b2.clone(), N2 = 0; N2 < y3.length; N2++) { @@ -94707,8 +24013,8 @@ var fe$2 = cr$2(function(e18, t2) { } return y3; } - r2.getNAF = i3; - function n4(b2, m3) { + r2.getNAF = i2; + function n5(b2, m3) { var w2 = [[], []]; b2 = b2.clone(), m3 = m3.clone(); for (var y3 = 0, S4 = 0, I2; b2.cmpn(-y3) > 0 || m3.cmpn(-S4) > 0; ) { @@ -94721,7 +24027,7 @@ var fe$2 = cr$2(function(e18, t2) { } return w2; } - r2.getJSF = n4; + r2.getJSF = n5; function o2(b2, m3, w2) { var y3 = "_" + m3; b2.prototype[m3] = function() { @@ -94750,25 +24056,25 @@ Ce$3.prototype.point = function() { throw new Error("Not implemented"); }, Ce$3.prototype._fixedNafMul = function(t2, r2) { kr$2(t2.precomputed); - var i3 = t2._getDoubles(), n4 = Ur$2(r2, 1, this._bitLength), o2 = (1 << i3.step + 1) - (i3.step % 2 === 0 ? 2 : 1); + var i2 = t2._getDoubles(), n5 = Ur$2(r2, 1, this._bitLength), o2 = (1 << i2.step + 1) - (i2.step % 2 === 0 ? 2 : 1); o2 /= 3; var h4 = [], p3, b2; - for (p3 = 0; p3 < n4.length; p3 += i3.step) { + for (p3 = 0; p3 < n5.length; p3 += i2.step) { b2 = 0; - for (var m3 = p3 + i3.step - 1; m3 >= p3; m3--) - b2 = (b2 << 1) + n4[m3]; + for (var m3 = p3 + i2.step - 1; m3 >= p3; m3--) + b2 = (b2 << 1) + n5[m3]; h4.push(b2); } for (var w2 = this.jpoint(null, null, null), y3 = this.jpoint(null, null, null), S4 = o2; S4 > 0; S4--) { for (p3 = 0; p3 < h4.length; p3++) - b2 = h4[p3], b2 === S4 ? y3 = y3.mixedAdd(i3.points[p3]) : b2 === -S4 && (y3 = y3.mixedAdd(i3.points[p3].neg())); + b2 = h4[p3], b2 === S4 ? y3 = y3.mixedAdd(i2.points[p3]) : b2 === -S4 && (y3 = y3.mixedAdd(i2.points[p3].neg())); w2 = w2.add(y3); } return w2.toP(); }, Ce$3.prototype._wnafMul = function(t2, r2) { - var i3 = 4, n4 = t2._getNAFPoints(i3); - i3 = n4.wnd; - for (var o2 = n4.points, h4 = Ur$2(r2, i3, this._bitLength), p3 = this.jpoint(null, null, null), b2 = h4.length - 1; b2 >= 0; b2--) { + var i2 = 4, n5 = t2._getNAFPoints(i2); + i2 = n5.wnd; + for (var o2 = n5.points, h4 = Ur$2(r2, i2, this._bitLength), p3 = this.jpoint(null, null, null), b2 = h4.length - 1; b2 >= 0; b2--) { for (var m3 = 0; b2 >= 0 && h4[b2] === 0; b2--) m3++; if (b2 >= 0 && m3++, p3 = p3.dblp(m3), b2 < 0) @@ -94777,22 +24083,22 @@ Ce$3.prototype.point = function() { kr$2(w2 !== 0), t2.type === "affine" ? w2 > 0 ? p3 = p3.mixedAdd(o2[w2 - 1 >> 1]) : p3 = p3.mixedAdd(o2[-w2 - 1 >> 1].neg()) : w2 > 0 ? p3 = p3.add(o2[w2 - 1 >> 1]) : p3 = p3.add(o2[-w2 - 1 >> 1].neg()); } return t2.type === "affine" ? p3.toP() : p3; -}, Ce$3.prototype._wnafMulAdd = function(t2, r2, i3, n4, o2) { +}, Ce$3.prototype._wnafMulAdd = function(t2, r2, i2, n5, o2) { var h4 = this._wnafT1, p3 = this._wnafT2, b2 = this._wnafT3, m3 = 0, w2, y3, S4; - for (w2 = 0; w2 < n4; w2++) { + for (w2 = 0; w2 < n5; w2++) { S4 = r2[w2]; var I2 = S4._getNAFPoints(t2); h4[w2] = I2.wnd, p3[w2] = I2.points; } - for (w2 = n4 - 1; w2 >= 1; w2 -= 2) { + for (w2 = n5 - 1; w2 >= 1; w2 -= 2) { var N2 = w2 - 1, C3 = w2; if (h4[N2] !== 1 || h4[C3] !== 1) { - b2[N2] = Ur$2(i3[N2], h4[N2], this._bitLength), b2[C3] = Ur$2(i3[C3], h4[C3], this._bitLength), m3 = Math.max(b2[N2].length, m3), m3 = Math.max(b2[C3].length, m3); + b2[N2] = Ur$2(i2[N2], h4[N2], this._bitLength), b2[C3] = Ur$2(i2[C3], h4[C3], this._bitLength), m3 = Math.max(b2[N2].length, m3), m3 = Math.max(b2[C3].length, m3); continue; } var F2 = [r2[N2], null, null, r2[C3]]; r2[N2].y.cmp(r2[C3].y) === 0 ? (F2[1] = r2[N2].add(r2[C3]), F2[2] = r2[N2].toJ().mixedAdd(r2[C3].neg())) : r2[N2].y.cmp(r2[C3].y.redNeg()) === 0 ? (F2[1] = r2[N2].toJ().mixedAdd(r2[C3]), F2[2] = r2[N2].add(r2[C3].neg())) : (F2[1] = r2[N2].toJ().mixedAdd(r2[C3]), F2[2] = r2[N2].toJ().mixedAdd(r2[C3].neg())); - var U5 = [-3, -1, -5, -7, 0, 7, 5, 1, 3], J2 = Ta$2(i3[N2], i3[C3]); + var U5 = [-3, -1, -5, -7, 0, 7, 5, 1, 3], J2 = Ta$2(i2[N2], i2[C3]); for (m3 = Math.max(J2[0].length, m3), b2[N2] = new Array(m3), b2[C3] = new Array(m3), y3 = 0; y3 < m3; y3++) { var Bt2 = J2[0][y3] | 0, G2 = J2[1][y3] | 0; b2[N2][y3] = U5[(Bt2 + 1) * 3 + (G2 + 1)], b2[C3][y3] = 0, p3[N2] = F2; @@ -94802,7 +24108,7 @@ Ce$3.prototype.point = function() { for (w2 = m3; w2 >= 0; w2--) { for (var Pt2 = 0; w2 >= 0; ) { var W2 = true; - for (y3 = 0; y3 < n4; y3++) + for (y3 = 0; y3 < n5; y3++) z3[y3] = b2[y3][w2] | 0, z3[y3] !== 0 && (W2 = false); if (!W2) break; @@ -94810,12 +24116,12 @@ Ce$3.prototype.point = function() { } if (w2 >= 0 && Pt2++, H2 = H2.dblp(Pt2), w2 < 0) break; - for (y3 = 0; y3 < n4; y3++) { + for (y3 = 0; y3 < n5; y3++) { var Rt2 = z3[y3]; Rt2 !== 0 && (Rt2 > 0 ? S4 = p3[y3][Rt2 - 1 >> 1] : Rt2 < 0 && (S4 = p3[y3][-Rt2 - 1 >> 1].neg()), S4.type === "affine" ? H2 = H2.mixedAdd(S4) : H2 = H2.add(S4)); } } - for (w2 = 0; w2 < n4; w2++) + for (w2 = 0; w2 < n5; w2++) p3[w2] = null; return o2 ? H2 : H2.toP(); }; @@ -94828,19 +24134,19 @@ Ce$3.BasePoint = Xt$1, Xt$1.prototype.eq = function() { return this.curve.validate(this); }, Ce$3.prototype.decodePoint = function(t2, r2) { t2 = Jt$2.toArray(t2, r2); - var i3 = this.p.byteLength(); - if ((t2[0] === 4 || t2[0] === 6 || t2[0] === 7) && t2.length - 1 === 2 * i3) { + var i2 = this.p.byteLength(); + if ((t2[0] === 4 || t2[0] === 6 || t2[0] === 7) && t2.length - 1 === 2 * i2) { t2[0] === 6 ? kr$2(t2[t2.length - 1] % 2 === 0) : t2[0] === 7 && kr$2(t2[t2.length - 1] % 2 === 1); - var n4 = this.point(t2.slice(1, 1 + i3), t2.slice(1 + i3, 1 + 2 * i3)); - return n4; - } else if ((t2[0] === 2 || t2[0] === 3) && t2.length - 1 === i3) - return this.pointFromX(t2.slice(1, 1 + i3), t2[0] === 3); + var n5 = this.point(t2.slice(1, 1 + i2), t2.slice(1 + i2, 1 + 2 * i2)); + return n5; + } else if ((t2[0] === 2 || t2[0] === 3) && t2.length - 1 === i2) + return this.pointFromX(t2.slice(1, 1 + i2), t2[0] === 3); throw new Error("Unknown point format"); }, Xt$1.prototype.encodeCompressed = function(t2) { return this.encode(t2, true); }, Xt$1.prototype._encode = function(t2) { - var r2 = this.curve.p.byteLength(), i3 = this.getX().toArray("be", r2); - return t2 ? [this.getY().isEven() ? 2 : 3].concat(i3) : [4].concat(i3, this.getY().toArray("be", r2)); + var r2 = this.curve.p.byteLength(), i2 = this.getX().toArray("be", r2); + return t2 ? [this.getY().isEven() ? 2 : 3].concat(i2) : [4].concat(i2, this.getY().toArray("be", r2)); }, Xt$1.prototype.encode = function(t2, r2) { return Jt$2.encode(this._encode(r2), t2); }, Xt$1.prototype.precompute = function(t2) { @@ -94856,34 +24162,34 @@ Ce$3.BasePoint = Xt$1, Xt$1.prototype.eq = function() { }, Xt$1.prototype._getDoubles = function(t2, r2) { if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles; - for (var i3 = [this], n4 = this, o2 = 0; o2 < r2; o2 += t2) { + for (var i2 = [this], n5 = this, o2 = 0; o2 < r2; o2 += t2) { for (var h4 = 0; h4 < t2; h4++) - n4 = n4.dbl(); - i3.push(n4); + n5 = n5.dbl(); + i2.push(n5); } - return { step: t2, points: i3 }; + return { step: t2, points: i2 }; }, Xt$1.prototype._getNAFPoints = function(t2) { if (this.precomputed && this.precomputed.naf) return this.precomputed.naf; - for (var r2 = [this], i3 = (1 << t2) - 1, n4 = i3 === 1 ? null : this.dbl(), o2 = 1; o2 < i3; o2++) - r2[o2] = r2[o2 - 1].add(n4); + for (var r2 = [this], i2 = (1 << t2) - 1, n5 = i2 === 1 ? null : this.dbl(), o2 = 1; o2 < i2; o2++) + r2[o2] = r2[o2 - 1].add(n5); return { wnd: t2, points: r2 }; }, Xt$1.prototype._getBeta = function() { return null; }, Xt$1.prototype.dblp = function(t2) { - for (var r2 = this, i3 = 0; i3 < t2; i3++) + for (var r2 = this, i2 = 0; i2 < t2; i2++) r2 = r2.dbl(); return r2; }; var Di$2 = cr$2(function(e18) { - typeof Object.create == "function" ? e18.exports = function(r2, i3) { - i3 && (r2.super_ = i3, r2.prototype = Object.create(i3.prototype, { constructor: { value: r2, enumerable: false, writable: true, configurable: true } })); - } : e18.exports = function(r2, i3) { - if (i3) { - r2.super_ = i3; - var n4 = function() { + typeof Object.create == "function" ? e18.exports = function(r2, i2) { + i2 && (r2.super_ = i2, r2.prototype = Object.create(i2.prototype, { constructor: { value: r2, enumerable: false, writable: true, configurable: true } })); + } : e18.exports = function(r2, i2) { + if (i2) { + r2.super_ = i2; + var n5 = function() { }; - n4.prototype = i3.prototype, r2.prototype = new n4(), r2.prototype.constructor = r2; + n5.prototype = i2.prototype, r2.prototype = new n5(), r2.prototype.constructor = r2; } }; }), Ua$2 = Jt$2.assert; @@ -94894,70 +24200,70 @@ Di$2(Zt$2, Ze$2); var ka$1 = Zt$2; Zt$2.prototype._getEndomorphism = function(t2) { if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) { - var r2, i3; + var r2, i2; if (t2.beta) r2 = new K$2(t2.beta, 16).toRed(this.red); else { - var n4 = this._getEndoRoots(this.p); - r2 = n4[0].cmp(n4[1]) < 0 ? n4[0] : n4[1], r2 = r2.toRed(this.red); + var n5 = this._getEndoRoots(this.p); + r2 = n5[0].cmp(n5[1]) < 0 ? n5[0] : n5[1], r2 = r2.toRed(this.red); } if (t2.lambda) - i3 = new K$2(t2.lambda, 16); + i2 = new K$2(t2.lambda, 16); else { var o2 = this._getEndoRoots(this.n); - this.g.mul(o2[0]).x.cmp(this.g.x.redMul(r2)) === 0 ? i3 = o2[0] : (i3 = o2[1], Ua$2(this.g.mul(i3).x.cmp(this.g.x.redMul(r2)) === 0)); + this.g.mul(o2[0]).x.cmp(this.g.x.redMul(r2)) === 0 ? i2 = o2[0] : (i2 = o2[1], Ua$2(this.g.mul(i2).x.cmp(this.g.x.redMul(r2)) === 0)); } var h4; return t2.basis ? h4 = t2.basis.map(function(p3) { return { a: new K$2(p3.a, 16), b: new K$2(p3.b, 16) }; - }) : h4 = this._getEndoBasis(i3), { beta: r2, lambda: i3, basis: h4 }; + }) : h4 = this._getEndoBasis(i2), { beta: r2, lambda: i2, basis: h4 }; } }, Zt$2.prototype._getEndoRoots = function(t2) { - var r2 = t2 === this.p ? this.red : K$2.mont(t2), i3 = new K$2(2).toRed(r2).redInvm(), n4 = i3.redNeg(), o2 = new K$2(3).toRed(r2).redNeg().redSqrt().redMul(i3), h4 = n4.redAdd(o2).fromRed(), p3 = n4.redSub(o2).fromRed(); + var r2 = t2 === this.p ? this.red : K$2.mont(t2), i2 = new K$2(2).toRed(r2).redInvm(), n5 = i2.redNeg(), o2 = new K$2(3).toRed(r2).redNeg().redSqrt().redMul(i2), h4 = n5.redAdd(o2).fromRed(), p3 = n5.redSub(o2).fromRed(); return [h4, p3]; }, Zt$2.prototype._getEndoBasis = function(t2) { - for (var r2 = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), i3 = t2, n4 = this.n.clone(), o2 = new K$2(1), h4 = new K$2(0), p3 = new K$2(0), b2 = new K$2(1), m3, w2, y3, S4, I2, N2, C3, F2 = 0, U5, J2; i3.cmpn(0) !== 0; ) { - var Bt2 = n4.div(i3); - U5 = n4.sub(Bt2.mul(i3)), J2 = p3.sub(Bt2.mul(o2)); + for (var r2 = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), i2 = t2, n5 = this.n.clone(), o2 = new K$2(1), h4 = new K$2(0), p3 = new K$2(0), b2 = new K$2(1), m3, w2, y3, S4, I2, N2, C3, F2 = 0, U5, J2; i2.cmpn(0) !== 0; ) { + var Bt2 = n5.div(i2); + U5 = n5.sub(Bt2.mul(i2)), J2 = p3.sub(Bt2.mul(o2)); var G2 = b2.sub(Bt2.mul(h4)); if (!y3 && U5.cmp(r2) < 0) m3 = C3.neg(), w2 = o2, y3 = U5.neg(), S4 = J2; else if (y3 && ++F2 === 2) break; - C3 = U5, n4 = i3, i3 = U5, p3 = o2, o2 = J2, b2 = h4, h4 = G2; + C3 = U5, n5 = i2, i2 = U5, p3 = o2, o2 = J2, b2 = h4, h4 = G2; } I2 = U5.neg(), N2 = J2; var H2 = y3.sqr().add(S4.sqr()), z3 = I2.sqr().add(N2.sqr()); return z3.cmp(H2) >= 0 && (I2 = m3, N2 = w2), y3.negative && (y3 = y3.neg(), S4 = S4.neg()), I2.negative && (I2 = I2.neg(), N2 = N2.neg()), [{ a: y3, b: S4 }, { a: I2, b: N2 }]; }, Zt$2.prototype._endoSplit = function(t2) { - var r2 = this.endo.basis, i3 = r2[0], n4 = r2[1], o2 = n4.b.mul(t2).divRound(this.n), h4 = i3.b.neg().mul(t2).divRound(this.n), p3 = o2.mul(i3.a), b2 = h4.mul(n4.a), m3 = o2.mul(i3.b), w2 = h4.mul(n4.b), y3 = t2.sub(p3).sub(b2), S4 = m3.add(w2).neg(); + var r2 = this.endo.basis, i2 = r2[0], n5 = r2[1], o2 = n5.b.mul(t2).divRound(this.n), h4 = i2.b.neg().mul(t2).divRound(this.n), p3 = o2.mul(i2.a), b2 = h4.mul(n5.a), m3 = o2.mul(i2.b), w2 = h4.mul(n5.b), y3 = t2.sub(p3).sub(b2), S4 = m3.add(w2).neg(); return { k1: y3, k2: S4 }; }, Zt$2.prototype.pointFromX = function(t2, r2) { t2 = new K$2(t2, 16), t2.red || (t2 = t2.toRed(this.red)); - var i3 = t2.redSqr().redMul(t2).redIAdd(t2.redMul(this.a)).redIAdd(this.b), n4 = i3.redSqrt(); - if (n4.redSqr().redSub(i3).cmp(this.zero) !== 0) + var i2 = t2.redSqr().redMul(t2).redIAdd(t2.redMul(this.a)).redIAdd(this.b), n5 = i2.redSqrt(); + if (n5.redSqr().redSub(i2).cmp(this.zero) !== 0) throw new Error("invalid point"); - var o2 = n4.fromRed().isOdd(); - return (r2 && !o2 || !r2 && o2) && (n4 = n4.redNeg()), this.point(t2, n4); + var o2 = n5.fromRed().isOdd(); + return (r2 && !o2 || !r2 && o2) && (n5 = n5.redNeg()), this.point(t2, n5); }, Zt$2.prototype.validate = function(t2) { if (t2.inf) return true; - var r2 = t2.x, i3 = t2.y, n4 = this.a.redMul(r2), o2 = r2.redSqr().redMul(r2).redIAdd(n4).redIAdd(this.b); - return i3.redSqr().redISub(o2).cmpn(0) === 0; -}, Zt$2.prototype._endoWnafMulAdd = function(t2, r2, i3) { - for (var n4 = this._endoWnafT1, o2 = this._endoWnafT2, h4 = 0; h4 < t2.length; h4++) { + var r2 = t2.x, i2 = t2.y, n5 = this.a.redMul(r2), o2 = r2.redSqr().redMul(r2).redIAdd(n5).redIAdd(this.b); + return i2.redSqr().redISub(o2).cmpn(0) === 0; +}, Zt$2.prototype._endoWnafMulAdd = function(t2, r2, i2) { + for (var n5 = this._endoWnafT1, o2 = this._endoWnafT2, h4 = 0; h4 < t2.length; h4++) { var p3 = this._endoSplit(r2[h4]), b2 = t2[h4], m3 = b2._getBeta(); - p3.k1.negative && (p3.k1.ineg(), b2 = b2.neg(true)), p3.k2.negative && (p3.k2.ineg(), m3 = m3.neg(true)), n4[h4 * 2] = b2, n4[h4 * 2 + 1] = m3, o2[h4 * 2] = p3.k1, o2[h4 * 2 + 1] = p3.k2; + p3.k1.negative && (p3.k1.ineg(), b2 = b2.neg(true)), p3.k2.negative && (p3.k2.ineg(), m3 = m3.neg(true)), n5[h4 * 2] = b2, n5[h4 * 2 + 1] = m3, o2[h4 * 2] = p3.k1, o2[h4 * 2 + 1] = p3.k2; } - for (var w2 = this._wnafMulAdd(1, n4, o2, h4 * 2, i3), y3 = 0; y3 < h4 * 2; y3++) - n4[y3] = null, o2[y3] = null; + for (var w2 = this._wnafMulAdd(1, n5, o2, h4 * 2, i2), y3 = 0; y3 < h4 * 2; y3++) + n5[y3] = null, o2[y3] = null; return w2; }; -function Ft$2(e18, t2, r2, i3) { - Ze$2.BasePoint.call(this, e18, "affine"), t2 === null && r2 === null ? (this.x = null, this.y = null, this.inf = true) : (this.x = new K$2(t2, 16), this.y = new K$2(r2, 16), i3 && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = false); +function Ft$2(e18, t2, r2, i2) { + Ze$2.BasePoint.call(this, e18, "affine"), t2 === null && r2 === null ? (this.x = null, this.y = null, this.inf = true) : (this.x = new K$2(t2, 16), this.y = new K$2(r2, 16), i2 && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = false); } -Di$2(Ft$2, Ze$2.BasePoint), Zt$2.prototype.point = function(t2, r2, i3) { - return new Ft$2(this, t2, r2, i3); +Di$2(Ft$2, Ze$2.BasePoint), Zt$2.prototype.point = function(t2, r2, i2) { + return new Ft$2(this, t2, r2, i2); }, Zt$2.prototype.pointFromJSON = function(t2, r2) { return Ft$2.fromJSON(this, t2, r2); }, Ft$2.prototype._getBeta = function() { @@ -94967,25 +24273,25 @@ Di$2(Ft$2, Ze$2.BasePoint), Zt$2.prototype.point = function(t2, r2, i3) { return t2.beta; var r2 = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); if (t2) { - var i3 = this.curve, n4 = function(o2) { - return i3.point(o2.x.redMul(i3.endo.beta), o2.y); + var i2 = this.curve, n5 = function(o2) { + return i2.point(o2.x.redMul(i2.endo.beta), o2.y); }; - t2.beta = r2, r2.precomputed = { beta: null, naf: t2.naf && { wnd: t2.naf.wnd, points: t2.naf.points.map(n4) }, doubles: t2.doubles && { step: t2.doubles.step, points: t2.doubles.points.map(n4) } }; + t2.beta = r2, r2.precomputed = { beta: null, naf: t2.naf && { wnd: t2.naf.wnd, points: t2.naf.points.map(n5) }, doubles: t2.doubles && { step: t2.doubles.step, points: t2.doubles.points.map(n5) } }; } return r2; } }, Ft$2.prototype.toJSON = function() { return this.precomputed ? [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) } }] : [this.x, this.y]; -}, Ft$2.fromJSON = function(t2, r2, i3) { +}, Ft$2.fromJSON = function(t2, r2, i2) { typeof r2 == "string" && (r2 = JSON.parse(r2)); - var n4 = t2.point(r2[0], r2[1], i3); + var n5 = t2.point(r2[0], r2[1], i2); if (!r2[2]) - return n4; + return n5; function o2(p3) { - return t2.point(p3[0], p3[1], i3); + return t2.point(p3[0], p3[1], i2); } var h4 = r2[2]; - return n4.precomputed = { beta: null, doubles: h4.doubles && { step: h4.doubles.step, points: [n4].concat(h4.doubles.points.map(o2)) }, naf: h4.naf && { wnd: h4.naf.wnd, points: [n4].concat(h4.naf.points.map(o2)) } }, n4; + return n5.precomputed = { beta: null, doubles: h4.doubles && { step: h4.doubles.step, points: [n5].concat(h4.doubles.points.map(o2)) }, naf: h4.naf && { wnd: h4.naf.wnd, points: [n5].concat(h4.naf.points.map(o2)) } }, n5; }, Ft$2.prototype.inspect = function() { return this.isInfinity() ? "" : ""; }, Ft$2.prototype.isInfinity = function() { @@ -95003,15 +24309,15 @@ Di$2(Ft$2, Ze$2.BasePoint), Zt$2.prototype.point = function(t2, r2, i3) { return this.curve.point(null, null); var r2 = this.y.redSub(t2.y); r2.cmpn(0) !== 0 && (r2 = r2.redMul(this.x.redSub(t2.x).redInvm())); - var i3 = r2.redSqr().redISub(this.x).redISub(t2.x), n4 = r2.redMul(this.x.redSub(i3)).redISub(this.y); - return this.curve.point(i3, n4); + var i2 = r2.redSqr().redISub(this.x).redISub(t2.x), n5 = r2.redMul(this.x.redSub(i2)).redISub(this.y); + return this.curve.point(i2, n5); }, Ft$2.prototype.dbl = function() { if (this.inf) return this; var t2 = this.y.redAdd(this.y); if (t2.cmpn(0) === 0) return this.curve.point(null, null); - var r2 = this.curve.a, i3 = this.x.redSqr(), n4 = t2.redInvm(), o2 = i3.redAdd(i3).redIAdd(i3).redIAdd(r2).redMul(n4), h4 = o2.redSqr().redISub(this.x.redAdd(this.x)), p3 = o2.redMul(this.x.redSub(h4)).redISub(this.y); + var r2 = this.curve.a, i2 = this.x.redSqr(), n5 = t2.redInvm(), o2 = i2.redAdd(i2).redIAdd(i2).redIAdd(r2).redMul(n5), h4 = o2.redSqr().redISub(this.x.redAdd(this.x)), p3 = o2.redMul(this.x.redSub(h4)).redISub(this.y); return this.curve.point(h4, p3); }, Ft$2.prototype.getX = function() { return this.x.fromRed(); @@ -95019,12 +24325,12 @@ Di$2(Ft$2, Ze$2.BasePoint), Zt$2.prototype.point = function(t2, r2, i3) { return this.y.fromRed(); }, Ft$2.prototype.mul = function(t2) { return t2 = new K$2(t2, 16), this.isInfinity() ? this : this._hasDoubles(t2) ? this.curve._fixedNafMul(this, t2) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [t2]) : this.curve._wnafMul(this, t2); -}, Ft$2.prototype.mulAdd = function(t2, r2, i3) { - var n4 = [this, r2], o2 = [t2, i3]; - return this.curve.endo ? this.curve._endoWnafMulAdd(n4, o2) : this.curve._wnafMulAdd(1, n4, o2, 2); -}, Ft$2.prototype.jmulAdd = function(t2, r2, i3) { - var n4 = [this, r2], o2 = [t2, i3]; - return this.curve.endo ? this.curve._endoWnafMulAdd(n4, o2, true) : this.curve._wnafMulAdd(1, n4, o2, 2, true); +}, Ft$2.prototype.mulAdd = function(t2, r2, i2) { + var n5 = [this, r2], o2 = [t2, i2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(n5, o2) : this.curve._wnafMulAdd(1, n5, o2, 2); +}, Ft$2.prototype.jmulAdd = function(t2, r2, i2) { + var n5 = [this, r2], o2 = [t2, i2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(n5, o2, true) : this.curve._wnafMulAdd(1, n5, o2, 2, true); }, Ft$2.prototype.eq = function(t2) { return this === t2 || this.inf === t2.inf && (this.inf || this.x.cmp(t2.x) === 0 && this.y.cmp(t2.y) === 0); }, Ft$2.prototype.neg = function(t2) { @@ -95032,10 +24338,10 @@ Di$2(Ft$2, Ze$2.BasePoint), Zt$2.prototype.point = function(t2, r2, i3) { return this; var r2 = this.curve.point(this.x, this.y.redNeg()); if (t2 && this.precomputed) { - var i3 = this.precomputed, n4 = function(o2) { + var i2 = this.precomputed, n5 = function(o2) { return o2.neg(); }; - r2.precomputed = { naf: i3.naf && { wnd: i3.naf.wnd, points: i3.naf.points.map(n4) }, doubles: i3.doubles && { step: i3.doubles.step, points: i3.doubles.points.map(n4) } }; + r2.precomputed = { naf: i2.naf && { wnd: i2.naf.wnd, points: i2.naf.points.map(n5) }, doubles: i2.doubles && { step: i2.doubles.step, points: i2.doubles.points.map(n5) } }; } return r2; }, Ft$2.prototype.toJ = function() { @@ -95044,16 +24350,16 @@ Di$2(Ft$2, Ze$2.BasePoint), Zt$2.prototype.point = function(t2, r2, i3) { var t2 = this.curve.jpoint(this.x, this.y, this.curve.one); return t2; }; -function Tt$3(e18, t2, r2, i3) { - Ze$2.BasePoint.call(this, e18, "jacobian"), t2 === null && r2 === null && i3 === null ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new K$2(0)) : (this.x = new K$2(t2, 16), this.y = new K$2(r2, 16), this.z = new K$2(i3, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one; +function Tt$3(e18, t2, r2, i2) { + Ze$2.BasePoint.call(this, e18, "jacobian"), t2 === null && r2 === null && i2 === null ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new K$2(0)) : (this.x = new K$2(t2, 16), this.y = new K$2(r2, 16), this.z = new K$2(i2, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one; } -Di$2(Tt$3, Ze$2.BasePoint), Zt$2.prototype.jpoint = function(t2, r2, i3) { - return new Tt$3(this, t2, r2, i3); +Di$2(Tt$3, Ze$2.BasePoint), Zt$2.prototype.jpoint = function(t2, r2, i2) { + return new Tt$3(this, t2, r2, i2); }, Tt$3.prototype.toP = function() { if (this.isInfinity()) return this.curve.point(null, null); - var t2 = this.z.redInvm(), r2 = t2.redSqr(), i3 = this.x.redMul(r2), n4 = this.y.redMul(r2).redMul(t2); - return this.curve.point(i3, n4); + var t2 = this.z.redInvm(), r2 = t2.redSqr(), i2 = this.x.redMul(r2), n5 = this.y.redMul(r2).redMul(t2); + return this.curve.point(i2, n5); }, Tt$3.prototype.neg = function() { return this.curve.jpoint(this.x, this.y.redNeg(), this.z); }, Tt$3.prototype.add = function(t2) { @@ -95061,20 +24367,20 @@ Di$2(Tt$3, Ze$2.BasePoint), Zt$2.prototype.jpoint = function(t2, r2, i3) { return t2; if (t2.isInfinity()) return this; - var r2 = t2.z.redSqr(), i3 = this.z.redSqr(), n4 = this.x.redMul(r2), o2 = t2.x.redMul(i3), h4 = this.y.redMul(r2.redMul(t2.z)), p3 = t2.y.redMul(i3.redMul(this.z)), b2 = n4.redSub(o2), m3 = h4.redSub(p3); + var r2 = t2.z.redSqr(), i2 = this.z.redSqr(), n5 = this.x.redMul(r2), o2 = t2.x.redMul(i2), h4 = this.y.redMul(r2.redMul(t2.z)), p3 = t2.y.redMul(i2.redMul(this.z)), b2 = n5.redSub(o2), m3 = h4.redSub(p3); if (b2.cmpn(0) === 0) return m3.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl(); - var w2 = b2.redSqr(), y3 = w2.redMul(b2), S4 = n4.redMul(w2), I2 = m3.redSqr().redIAdd(y3).redISub(S4).redISub(S4), N2 = m3.redMul(S4.redISub(I2)).redISub(h4.redMul(y3)), C3 = this.z.redMul(t2.z).redMul(b2); + var w2 = b2.redSqr(), y3 = w2.redMul(b2), S4 = n5.redMul(w2), I2 = m3.redSqr().redIAdd(y3).redISub(S4).redISub(S4), N2 = m3.redMul(S4.redISub(I2)).redISub(h4.redMul(y3)), C3 = this.z.redMul(t2.z).redMul(b2); return this.curve.jpoint(I2, N2, C3); }, Tt$3.prototype.mixedAdd = function(t2) { if (this.isInfinity()) return t2.toJ(); if (t2.isInfinity()) return this; - var r2 = this.z.redSqr(), i3 = this.x, n4 = t2.x.redMul(r2), o2 = this.y, h4 = t2.y.redMul(r2).redMul(this.z), p3 = i3.redSub(n4), b2 = o2.redSub(h4); + var r2 = this.z.redSqr(), i2 = this.x, n5 = t2.x.redMul(r2), o2 = this.y, h4 = t2.y.redMul(r2).redMul(this.z), p3 = i2.redSub(n5), b2 = o2.redSub(h4); if (p3.cmpn(0) === 0) return b2.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl(); - var m3 = p3.redSqr(), w2 = m3.redMul(p3), y3 = i3.redMul(m3), S4 = b2.redSqr().redIAdd(w2).redISub(y3).redISub(y3), I2 = b2.redMul(y3.redISub(S4)).redISub(o2.redMul(w2)), N2 = this.z.redMul(p3); + var m3 = p3.redSqr(), w2 = m3.redMul(p3), y3 = i2.redMul(m3), S4 = b2.redSqr().redIAdd(w2).redISub(y3).redISub(y3), I2 = b2.redMul(y3.redISub(S4)).redISub(o2.redMul(w2)), N2 = this.z.redMul(p3); return this.curve.jpoint(S4, I2, N2); }, Tt$3.prototype.dblp = function(t2) { if (t2 === 0) @@ -95085,14 +24391,14 @@ Di$2(Tt$3, Ze$2.BasePoint), Zt$2.prototype.jpoint = function(t2, r2, i3) { return this.dbl(); var r2; if (this.curve.zeroA || this.curve.threeA) { - var i3 = this; + var i2 = this; for (r2 = 0; r2 < t2; r2++) - i3 = i3.dbl(); - return i3; + i2 = i2.dbl(); + return i2; } - var n4 = this.curve.a, o2 = this.curve.tinv, h4 = this.x, p3 = this.y, b2 = this.z, m3 = b2.redSqr().redSqr(), w2 = p3.redAdd(p3); + var n5 = this.curve.a, o2 = this.curve.tinv, h4 = this.x, p3 = this.y, b2 = this.z, m3 = b2.redSqr().redSqr(), w2 = p3.redAdd(p3); for (r2 = 0; r2 < t2; r2++) { - var y3 = h4.redSqr(), S4 = w2.redSqr(), I2 = S4.redSqr(), N2 = y3.redAdd(y3).redIAdd(y3).redIAdd(n4.redMul(m3)), C3 = h4.redMul(S4), F2 = N2.redSqr().redISub(C3.redAdd(C3)), U5 = C3.redISub(F2), J2 = N2.redMul(U5); + var y3 = h4.redSqr(), S4 = w2.redSqr(), I2 = S4.redSqr(), N2 = y3.redAdd(y3).redIAdd(y3).redIAdd(n5.redMul(m3)), C3 = h4.redMul(S4), F2 = N2.redSqr().redISub(C3.redAdd(C3)), U5 = C3.redISub(F2), J2 = N2.redMul(U5); J2 = J2.redIAdd(J2).redISub(I2); var Bt2 = w2.redMul(b2); r2 + 1 < t2 && (m3 = m3.redMul(I2)), h4 = F2, b2 = Bt2, w2 = J2; @@ -95101,52 +24407,52 @@ Di$2(Tt$3, Ze$2.BasePoint), Zt$2.prototype.jpoint = function(t2, r2, i3) { }, Tt$3.prototype.dbl = function() { return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl(); }, Tt$3.prototype._zeroDbl = function() { - var t2, r2, i3; + var t2, r2, i2; if (this.zOne) { - var n4 = this.x.redSqr(), o2 = this.y.redSqr(), h4 = o2.redSqr(), p3 = this.x.redAdd(o2).redSqr().redISub(n4).redISub(h4); + var n5 = this.x.redSqr(), o2 = this.y.redSqr(), h4 = o2.redSqr(), p3 = this.x.redAdd(o2).redSqr().redISub(n5).redISub(h4); p3 = p3.redIAdd(p3); - var b2 = n4.redAdd(n4).redIAdd(n4), m3 = b2.redSqr().redISub(p3).redISub(p3), w2 = h4.redIAdd(h4); - w2 = w2.redIAdd(w2), w2 = w2.redIAdd(w2), t2 = m3, r2 = b2.redMul(p3.redISub(m3)).redISub(w2), i3 = this.y.redAdd(this.y); + var b2 = n5.redAdd(n5).redIAdd(n5), m3 = b2.redSqr().redISub(p3).redISub(p3), w2 = h4.redIAdd(h4); + w2 = w2.redIAdd(w2), w2 = w2.redIAdd(w2), t2 = m3, r2 = b2.redMul(p3.redISub(m3)).redISub(w2), i2 = this.y.redAdd(this.y); } else { var y3 = this.x.redSqr(), S4 = this.y.redSqr(), I2 = S4.redSqr(), N2 = this.x.redAdd(S4).redSqr().redISub(y3).redISub(I2); N2 = N2.redIAdd(N2); var C3 = y3.redAdd(y3).redIAdd(y3), F2 = C3.redSqr(), U5 = I2.redIAdd(I2); - U5 = U5.redIAdd(U5), U5 = U5.redIAdd(U5), t2 = F2.redISub(N2).redISub(N2), r2 = C3.redMul(N2.redISub(t2)).redISub(U5), i3 = this.y.redMul(this.z), i3 = i3.redIAdd(i3); + U5 = U5.redIAdd(U5), U5 = U5.redIAdd(U5), t2 = F2.redISub(N2).redISub(N2), r2 = C3.redMul(N2.redISub(t2)).redISub(U5), i2 = this.y.redMul(this.z), i2 = i2.redIAdd(i2); } - return this.curve.jpoint(t2, r2, i3); + return this.curve.jpoint(t2, r2, i2); }, Tt$3.prototype._threeDbl = function() { - var t2, r2, i3; + var t2, r2, i2; if (this.zOne) { - var n4 = this.x.redSqr(), o2 = this.y.redSqr(), h4 = o2.redSqr(), p3 = this.x.redAdd(o2).redSqr().redISub(n4).redISub(h4); + var n5 = this.x.redSqr(), o2 = this.y.redSqr(), h4 = o2.redSqr(), p3 = this.x.redAdd(o2).redSqr().redISub(n5).redISub(h4); p3 = p3.redIAdd(p3); - var b2 = n4.redAdd(n4).redIAdd(n4).redIAdd(this.curve.a), m3 = b2.redSqr().redISub(p3).redISub(p3); + var b2 = n5.redAdd(n5).redIAdd(n5).redIAdd(this.curve.a), m3 = b2.redSqr().redISub(p3).redISub(p3); t2 = m3; var w2 = h4.redIAdd(h4); - w2 = w2.redIAdd(w2), w2 = w2.redIAdd(w2), r2 = b2.redMul(p3.redISub(m3)).redISub(w2), i3 = this.y.redAdd(this.y); + w2 = w2.redIAdd(w2), w2 = w2.redIAdd(w2), r2 = b2.redMul(p3.redISub(m3)).redISub(w2), i2 = this.y.redAdd(this.y); } else { var y3 = this.z.redSqr(), S4 = this.y.redSqr(), I2 = this.x.redMul(S4), N2 = this.x.redSub(y3).redMul(this.x.redAdd(y3)); N2 = N2.redAdd(N2).redIAdd(N2); var C3 = I2.redIAdd(I2); C3 = C3.redIAdd(C3); var F2 = C3.redAdd(C3); - t2 = N2.redSqr().redISub(F2), i3 = this.y.redAdd(this.z).redSqr().redISub(S4).redISub(y3); + t2 = N2.redSqr().redISub(F2), i2 = this.y.redAdd(this.z).redSqr().redISub(S4).redISub(y3); var U5 = S4.redSqr(); U5 = U5.redIAdd(U5), U5 = U5.redIAdd(U5), U5 = U5.redIAdd(U5), r2 = N2.redMul(C3.redISub(t2)).redISub(U5); } - return this.curve.jpoint(t2, r2, i3); + return this.curve.jpoint(t2, r2, i2); }, Tt$3.prototype._dbl = function() { - var t2 = this.curve.a, r2 = this.x, i3 = this.y, n4 = this.z, o2 = n4.redSqr().redSqr(), h4 = r2.redSqr(), p3 = i3.redSqr(), b2 = h4.redAdd(h4).redIAdd(h4).redIAdd(t2.redMul(o2)), m3 = r2.redAdd(r2); + var t2 = this.curve.a, r2 = this.x, i2 = this.y, n5 = this.z, o2 = n5.redSqr().redSqr(), h4 = r2.redSqr(), p3 = i2.redSqr(), b2 = h4.redAdd(h4).redIAdd(h4).redIAdd(t2.redMul(o2)), m3 = r2.redAdd(r2); m3 = m3.redIAdd(m3); var w2 = m3.redMul(p3), y3 = b2.redSqr().redISub(w2.redAdd(w2)), S4 = w2.redISub(y3), I2 = p3.redSqr(); I2 = I2.redIAdd(I2), I2 = I2.redIAdd(I2), I2 = I2.redIAdd(I2); - var N2 = b2.redMul(S4).redISub(I2), C3 = i3.redAdd(i3).redMul(n4); + var N2 = b2.redMul(S4).redISub(I2), C3 = i2.redAdd(i2).redMul(n5); return this.curve.jpoint(y3, N2, C3); }, Tt$3.prototype.trpl = function() { if (!this.curve.zeroA) return this.dbl().add(this); - var t2 = this.x.redSqr(), r2 = this.y.redSqr(), i3 = this.z.redSqr(), n4 = r2.redSqr(), o2 = t2.redAdd(t2).redIAdd(t2), h4 = o2.redSqr(), p3 = this.x.redAdd(r2).redSqr().redISub(t2).redISub(n4); + var t2 = this.x.redSqr(), r2 = this.y.redSqr(), i2 = this.z.redSqr(), n5 = r2.redSqr(), o2 = t2.redAdd(t2).redIAdd(t2), h4 = o2.redSqr(), p3 = this.x.redAdd(r2).redSqr().redISub(t2).redISub(n5); p3 = p3.redIAdd(p3), p3 = p3.redAdd(p3).redIAdd(p3), p3 = p3.redISub(h4); - var b2 = p3.redSqr(), m3 = n4.redIAdd(n4); + var b2 = p3.redSqr(), m3 = n5.redIAdd(n5); m3 = m3.redIAdd(m3), m3 = m3.redIAdd(m3), m3 = m3.redIAdd(m3); var w2 = o2.redIAdd(p3).redSqr().redISub(h4).redISub(b2).redISub(m3), y3 = r2.redMul(w2); y3 = y3.redIAdd(y3), y3 = y3.redIAdd(y3); @@ -95154,7 +24460,7 @@ Di$2(Tt$3, Ze$2.BasePoint), Zt$2.prototype.jpoint = function(t2, r2, i3) { S4 = S4.redIAdd(S4), S4 = S4.redIAdd(S4); var I2 = this.y.redMul(w2.redMul(m3.redISub(w2)).redISub(p3.redMul(b2))); I2 = I2.redIAdd(I2), I2 = I2.redIAdd(I2), I2 = I2.redIAdd(I2); - var N2 = this.z.redAdd(p3).redSqr().redISub(i3).redISub(b2); + var N2 = this.z.redAdd(p3).redSqr().redISub(i2).redISub(b2); return this.curve.jpoint(S4, I2, N2); }, Tt$3.prototype.mul = function(t2, r2) { return t2 = new K$2(t2, r2), this.curve._wnafMul(this, t2); @@ -95163,19 +24469,19 @@ Di$2(Tt$3, Ze$2.BasePoint), Zt$2.prototype.jpoint = function(t2, r2, i3) { return this.eq(t2.toJ()); if (this === t2) return true; - var r2 = this.z.redSqr(), i3 = t2.z.redSqr(); - if (this.x.redMul(i3).redISub(t2.x.redMul(r2)).cmpn(0) !== 0) + var r2 = this.z.redSqr(), i2 = t2.z.redSqr(); + if (this.x.redMul(i2).redISub(t2.x.redMul(r2)).cmpn(0) !== 0) return false; - var n4 = r2.redMul(this.z), o2 = i3.redMul(t2.z); - return this.y.redMul(o2).redISub(t2.y.redMul(n4)).cmpn(0) === 0; + var n5 = r2.redMul(this.z), o2 = i2.redMul(t2.z); + return this.y.redMul(o2).redISub(t2.y.redMul(n5)).cmpn(0) === 0; }, Tt$3.prototype.eqXToP = function(t2) { - var r2 = this.z.redSqr(), i3 = t2.toRed(this.curve.red).redMul(r2); - if (this.x.cmp(i3) === 0) + var r2 = this.z.redSqr(), i2 = t2.toRed(this.curve.red).redMul(r2); + if (this.x.cmp(i2) === 0) return true; - for (var n4 = t2.clone(), o2 = this.curve.redN.redMul(r2); ; ) { - if (n4.iadd(this.curve.n), n4.cmp(this.curve.p) >= 0) + for (var n5 = t2.clone(), o2 = this.curve.redN.redMul(r2); ; ) { + if (n5.iadd(this.curve.n), n5.cmp(this.curve.p) >= 0) return false; - if (i3.redIAdd(o2), this.x.cmp(i3) === 0) + if (i2.redIAdd(o2), this.x.cmp(i2) === 0) return true; } }, Tt$3.prototype.inspect = function() { @@ -95186,15 +24492,15 @@ Di$2(Tt$3, Ze$2.BasePoint), Zt$2.prototype.jpoint = function(t2, r2, i3) { var qr$2 = cr$2(function(e18, t2) { var r2 = t2; r2.base = Ze$2, r2.short = ka$1, r2.mont = null, r2.edwards = null; -}), Kr$2 = cr$2(function(e18, t2) { - var r2 = t2, i3 = Jt$2.assert; - function n4(p3) { - p3.type === "short" ? this.curve = new qr$2.short(p3) : p3.type === "edwards" ? this.curve = new qr$2.edwards(p3) : this.curve = new qr$2.mont(p3), this.g = this.curve.g, this.n = this.curve.n, this.hash = p3.hash, i3(this.g.validate(), "Invalid curve"), i3(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); +}), Kr$3 = cr$2(function(e18, t2) { + var r2 = t2, i2 = Jt$2.assert; + function n5(p3) { + p3.type === "short" ? this.curve = new qr$2.short(p3) : p3.type === "edwards" ? this.curve = new qr$2.edwards(p3) : this.curve = new qr$2.mont(p3), this.g = this.curve.g, this.n = this.curve.n, this.hash = p3.hash, i2(this.g.validate(), "Invalid curve"), i2(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); } - r2.PresetCurve = n4; + r2.PresetCurve = n5; function o2(p3, b2) { Object.defineProperty(r2, p3, { configurable: true, enumerable: true, get: function() { - var m3 = new n4(b2); + var m3 = new n5(b2); return Object.defineProperty(r2, p3, { configurable: true, enumerable: true, value: m3 }), m3; } }); } @@ -95211,41 +24517,41 @@ function Re$1(e18) { if (!(this instanceof Re$1)) return new Re$1(e18); this.hash = e18.hash, this.predResist = !!e18.predResist, this.outLen = this.hash.outSize, this.minEntropy = e18.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null; - var t2 = fe$2.toArray(e18.entropy, e18.entropyEnc || "hex"), r2 = fe$2.toArray(e18.nonce, e18.nonceEnc || "hex"), i3 = fe$2.toArray(e18.pers, e18.persEnc || "hex"); - Pi$1(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(t2, r2, i3); + var t2 = fe$2.toArray(e18.entropy, e18.entropyEnc || "hex"), r2 = fe$2.toArray(e18.nonce, e18.nonceEnc || "hex"), i2 = fe$2.toArray(e18.pers, e18.persEnc || "hex"); + Pi$2(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(t2, r2, i2); } var Rf$1 = Re$1; -Re$1.prototype._init = function(t2, r2, i3) { - var n4 = t2.concat(r2).concat(i3); +Re$1.prototype._init = function(t2, r2, i2) { + var n5 = t2.concat(r2).concat(i2); this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8); for (var o2 = 0; o2 < this.V.length; o2++) this.K[o2] = 0, this.V[o2] = 1; - this._update(n4), this._reseed = 1, this.reseedInterval = 281474976710656; + this._update(n5), this._reseed = 1, this.reseedInterval = 281474976710656; }, Re$1.prototype._hmac = function() { return new se$1.hmac(this.hash, this.K); }, Re$1.prototype._update = function(t2) { var r2 = this._hmac().update(this.V).update([0]); t2 && (r2 = r2.update(t2)), this.K = r2.digest(), this.V = this._hmac().update(this.V).digest(), t2 && (this.K = this._hmac().update(this.V).update([1]).update(t2).digest(), this.V = this._hmac().update(this.V).digest()); -}, Re$1.prototype.reseed = function(t2, r2, i3, n4) { - typeof r2 != "string" && (n4 = i3, i3 = r2, r2 = null), t2 = fe$2.toArray(t2, r2), i3 = fe$2.toArray(i3, n4), Pi$1(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(t2.concat(i3 || [])), this._reseed = 1; -}, Re$1.prototype.generate = function(t2, r2, i3, n4) { +}, Re$1.prototype.reseed = function(t2, r2, i2, n5) { + typeof r2 != "string" && (n5 = i2, i2 = r2, r2 = null), t2 = fe$2.toArray(t2, r2), i2 = fe$2.toArray(i2, n5), Pi$2(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(t2.concat(i2 || [])), this._reseed = 1; +}, Re$1.prototype.generate = function(t2, r2, i2, n5) { if (this._reseed > this.reseedInterval) throw new Error("Reseed is required"); - typeof r2 != "string" && (n4 = i3, i3 = r2, r2 = null), i3 && (i3 = fe$2.toArray(i3, n4 || "hex"), this._update(i3)); + typeof r2 != "string" && (n5 = i2, i2 = r2, r2 = null), i2 && (i2 = fe$2.toArray(i2, n5 || "hex"), this._update(i2)); for (var o2 = []; o2.length < t2; ) this.V = this._hmac().update(this.V).digest(), o2 = o2.concat(this.V); var h4 = o2.slice(0, t2); - return this._update(i3), this._reseed++, fe$2.encode(h4, r2); + return this._update(i2), this._reseed++, fe$2.encode(h4, r2); }; var Fi$2 = Jt$2.assert; function kt$2(e18, t2) { this.ec = e18, this.priv = null, this.pub = null, t2.priv && this._importPrivate(t2.priv, t2.privEnc), t2.pub && this._importPublic(t2.pub, t2.pubEnc); } var Ti$1 = kt$2; -kt$2.fromPublic = function(t2, r2, i3) { - return r2 instanceof kt$2 ? r2 : new kt$2(t2, { pub: r2, pubEnc: i3 }); -}, kt$2.fromPrivate = function(t2, r2, i3) { - return r2 instanceof kt$2 ? r2 : new kt$2(t2, { priv: r2, privEnc: i3 }); +kt$2.fromPublic = function(t2, r2, i2) { + return r2 instanceof kt$2 ? r2 : new kt$2(t2, { pub: r2, pubEnc: i2 }); +}, kt$2.fromPrivate = function(t2, r2, i2) { + return r2 instanceof kt$2 ? r2 : new kt$2(t2, { priv: r2, privEnc: i2 }); }, kt$2.prototype.validate = function() { var t2 = this.getPublic(); return t2.isInfinity() ? { result: false, reason: "Invalid public key" } : t2.validate() ? t2.mul(this.ec.curve.n).isInfinity() ? { result: true, reason: null } : { result: false, reason: "Public key * N != O" } : { result: false, reason: "Public key is not a point" }; @@ -95263,8 +24569,8 @@ kt$2.fromPublic = function(t2, r2, i3) { this.pub = this.ec.curve.decodePoint(t2, r2); }, kt$2.prototype.derive = function(t2) { return t2.validate() || Fi$2(t2.validate(), "public point not validated"), t2.mul(this.priv).getX(); -}, kt$2.prototype.sign = function(t2, r2, i3) { - return this.ec.sign(t2, this, r2, i3); +}, kt$2.prototype.sign = function(t2, r2, i2) { + return this.ec.sign(t2, this, r2, i2); }, kt$2.prototype.verify = function(t2, r2) { return this.ec.verify(t2, r2, this); }, kt$2.prototype.inspect = function() { @@ -95284,12 +24590,12 @@ function Ui$1(e18, t2) { var r2 = e18[t2.place++]; if (!(r2 & 128)) return r2; - var i3 = r2 & 15; - if (i3 === 0 || i3 > 4) + var i2 = r2 & 15; + if (i2 === 0 || i2 > 4) return false; - for (var n4 = 0, o2 = 0, h4 = t2.place; o2 < i3; o2++, h4++) - n4 <<= 8, n4 |= e18[h4], n4 >>>= 0; - return n4 <= 127 ? false : (t2.place = h4, n4); + for (var n5 = 0, o2 = 0, h4 = t2.place; o2 < i2; o2++, h4++) + n5 <<= 8, n5 |= e18[h4], n5 >>>= 0; + return n5 <= 127 ? false : (t2.place = h4, n5); } function Of$1(e18) { for (var t2 = 0, r2 = e18.length - 1; !e18[t2] && !(e18[t2 + 1] & 128) && t2 < r2; ) @@ -95298,22 +24604,22 @@ function Of$1(e18) { } Hr$2.prototype._importDER = function(t2, r2) { t2 = Jt$2.toArray(t2, r2); - var i3 = new Ka$1(); - if (t2[i3.place++] !== 48) + var i2 = new Ka$1(); + if (t2[i2.place++] !== 48) return false; - var n4 = Ui$1(t2, i3); - if (n4 === false || n4 + i3.place !== t2.length || t2[i3.place++] !== 2) + var n5 = Ui$1(t2, i2); + if (n5 === false || n5 + i2.place !== t2.length || t2[i2.place++] !== 2) return false; - var o2 = Ui$1(t2, i3); + var o2 = Ui$1(t2, i2); if (o2 === false) return false; - var h4 = t2.slice(i3.place, o2 + i3.place); - if (i3.place += o2, t2[i3.place++] !== 2) + var h4 = t2.slice(i2.place, o2 + i2.place); + if (i2.place += o2, t2[i2.place++] !== 2) return false; - var p3 = Ui$1(t2, i3); - if (p3 === false || t2.length !== p3 + i3.place) + var p3 = Ui$1(t2, i2); + if (p3 === false || t2.length !== p3 + i2.place) return false; - var b2 = t2.slice(i3.place, p3 + i3.place); + var b2 = t2.slice(i2.place, p3 + i2.place); if (h4[0] === 0) if (h4[1] & 128) h4 = h4.slice(1); @@ -95337,12 +24643,12 @@ function ki$1(e18, t2) { e18.push(t2); } Hr$2.prototype.toDER = function(t2) { - var r2 = this.r.toArray(), i3 = this.s.toArray(); - for (r2[0] & 128 && (r2 = [0].concat(r2)), i3[0] & 128 && (i3 = [0].concat(i3)), r2 = Of$1(r2), i3 = Of$1(i3); !i3[0] && !(i3[1] & 128); ) - i3 = i3.slice(1); - var n4 = [2]; - ki$1(n4, r2.length), n4 = n4.concat(r2), n4.push(2), ki$1(n4, i3.length); - var o2 = n4.concat(i3), h4 = [48]; + var r2 = this.r.toArray(), i2 = this.s.toArray(); + for (r2[0] & 128 && (r2 = [0].concat(r2)), i2[0] & 128 && (i2 = [0].concat(i2)), r2 = Of$1(r2), i2 = Of$1(i2); !i2[0] && !(i2[1] & 128); ) + i2 = i2.slice(1); + var n5 = [2]; + ki$1(n5, r2.length), n5 = n5.concat(r2), n5.push(2), ki$1(n5, i2.length); + var o2 = n5.concat(i2), h4 = [48]; return ki$1(h4, o2.length), h4 = h4.concat(o2), Jt$2.encode(h4, t2); }; var Ha$2 = function() { @@ -95351,7 +24657,7 @@ var Ha$2 = function() { function $t$2(e18) { if (!(this instanceof $t$2)) return new $t$2(e18); - typeof e18 == "string" && (Pf$1(Object.prototype.hasOwnProperty.call(Kr$2, e18), "Unknown curve " + e18), e18 = Kr$2[e18]), e18 instanceof Kr$2.PresetCurve && (e18 = { curve: e18 }), this.curve = e18.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = e18.curve.g, this.g.precompute(e18.curve.n.bitLength() + 1), this.hash = e18.hash || e18.curve.hash; + typeof e18 == "string" && (Pf$1(Object.prototype.hasOwnProperty.call(Kr$3, e18), "Unknown curve " + e18), e18 = Kr$3[e18]), e18 instanceof Kr$3.PresetCurve && (e18 = { curve: e18 }), this.curve = e18.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = e18.curve.g, this.g.precompute(e18.curve.n.bitLength() + 1), this.hash = e18.hash || e18.curve.hash; } var za$1 = $t$2; $t$2.prototype.keyPair = function(t2) { @@ -95362,18 +24668,18 @@ $t$2.prototype.keyPair = function(t2) { return Ti$1.fromPublic(this, t2, r2); }, $t$2.prototype.genKeyPair = function(t2) { t2 || (t2 = {}); - for (var r2 = new Rf$1({ hash: this.hash, pers: t2.pers, persEnc: t2.persEnc || "utf8", entropy: t2.entropy || Ha$2(this.hash.hmacStrength), entropyEnc: t2.entropy && t2.entropyEnc || "utf8", nonce: this.n.toArray() }), i3 = this.n.byteLength(), n4 = this.n.sub(new K$2(2)); ; ) { - var o2 = new K$2(r2.generate(i3)); - if (!(o2.cmp(n4) > 0)) + for (var r2 = new Rf$1({ hash: this.hash, pers: t2.pers, persEnc: t2.persEnc || "utf8", entropy: t2.entropy || Ha$2(this.hash.hmacStrength), entropyEnc: t2.entropy && t2.entropyEnc || "utf8", nonce: this.n.toArray() }), i2 = this.n.byteLength(), n5 = this.n.sub(new K$2(2)); ; ) { + var o2 = new K$2(r2.generate(i2)); + if (!(o2.cmp(n5) > 0)) return o2.iaddn(1), this.keyFromPrivate(o2); } }, $t$2.prototype._truncateToN = function(t2, r2) { - var i3 = t2.byteLength() * 8 - this.n.bitLength(); - return i3 > 0 && (t2 = t2.ushrn(i3)), !r2 && t2.cmp(this.n) >= 0 ? t2.sub(this.n) : t2; -}, $t$2.prototype.sign = function(t2, r2, i3, n4) { - typeof i3 == "object" && (n4 = i3, i3 = null), n4 || (n4 = {}), r2 = this.keyFromPrivate(r2, i3), t2 = this._truncateToN(new K$2(t2, 16)); - for (var o2 = this.n.byteLength(), h4 = r2.getPrivate().toArray("be", o2), p3 = t2.toArray("be", o2), b2 = new Rf$1({ hash: this.hash, entropy: h4, nonce: p3, pers: n4.pers, persEnc: n4.persEnc || "utf8" }), m3 = this.n.sub(new K$2(1)), w2 = 0; ; w2++) { - var y3 = n4.k ? n4.k(w2) : new K$2(b2.generate(this.n.byteLength())); + var i2 = t2.byteLength() * 8 - this.n.bitLength(); + return i2 > 0 && (t2 = t2.ushrn(i2)), !r2 && t2.cmp(this.n) >= 0 ? t2.sub(this.n) : t2; +}, $t$2.prototype.sign = function(t2, r2, i2, n5) { + typeof i2 == "object" && (n5 = i2, i2 = null), n5 || (n5 = {}), r2 = this.keyFromPrivate(r2, i2), t2 = this._truncateToN(new K$2(t2, 16)); + for (var o2 = this.n.byteLength(), h4 = r2.getPrivate().toArray("be", o2), p3 = t2.toArray("be", o2), b2 = new Rf$1({ hash: this.hash, entropy: h4, nonce: p3, pers: n5.pers, persEnc: n5.persEnc || "utf8" }), m3 = this.n.sub(new K$2(1)), w2 = 0; ; w2++) { + var y3 = n5.k ? n5.k(w2) : new K$2(b2.generate(this.n.byteLength())); if (y3 = this._truncateToN(y3, true), !(y3.cmpn(1) <= 0 || y3.cmp(m3) >= 0)) { var S4 = this.g.mul(y3); if (!S4.isInfinity()) { @@ -95382,39 +24688,39 @@ $t$2.prototype.keyPair = function(t2) { var C3 = y3.invm(this.n).mul(N2.mul(r2.getPrivate()).iadd(t2)); if (C3 = C3.umod(this.n), C3.cmpn(0) !== 0) { var F2 = (S4.getY().isOdd() ? 1 : 0) | (I2.cmp(N2) !== 0 ? 2 : 0); - return n4.canonical && C3.cmp(this.nh) > 0 && (C3 = this.n.sub(C3), F2 ^= 1), new zr$2({ r: N2, s: C3, recoveryParam: F2 }); + return n5.canonical && C3.cmp(this.nh) > 0 && (C3 = this.n.sub(C3), F2 ^= 1), new zr$2({ r: N2, s: C3, recoveryParam: F2 }); } } } } } -}, $t$2.prototype.verify = function(t2, r2, i3, n4) { - t2 = this._truncateToN(new K$2(t2, 16)), i3 = this.keyFromPublic(i3, n4), r2 = new zr$2(r2, "hex"); +}, $t$2.prototype.verify = function(t2, r2, i2, n5) { + t2 = this._truncateToN(new K$2(t2, 16)), i2 = this.keyFromPublic(i2, n5), r2 = new zr$2(r2, "hex"); var o2 = r2.r, h4 = r2.s; if (o2.cmpn(1) < 0 || o2.cmp(this.n) >= 0 || h4.cmpn(1) < 0 || h4.cmp(this.n) >= 0) return false; var p3 = h4.invm(this.n), b2 = p3.mul(t2).umod(this.n), m3 = p3.mul(o2).umod(this.n), w2; - return this.curve._maxwellTrick ? (w2 = this.g.jmulAdd(b2, i3.getPublic(), m3), w2.isInfinity() ? false : w2.eqXToP(o2)) : (w2 = this.g.mulAdd(b2, i3.getPublic(), m3), w2.isInfinity() ? false : w2.getX().umod(this.n).cmp(o2) === 0); -}, $t$2.prototype.recoverPubKey = function(e18, t2, r2, i3) { - Pf$1((3 & r2) === r2, "The recovery param is more than two bits"), t2 = new zr$2(t2, i3); - var n4 = this.n, o2 = new K$2(e18), h4 = t2.r, p3 = t2.s, b2 = r2 & 1, m3 = r2 >> 1; + return this.curve._maxwellTrick ? (w2 = this.g.jmulAdd(b2, i2.getPublic(), m3), w2.isInfinity() ? false : w2.eqXToP(o2)) : (w2 = this.g.mulAdd(b2, i2.getPublic(), m3), w2.isInfinity() ? false : w2.getX().umod(this.n).cmp(o2) === 0); +}, $t$2.prototype.recoverPubKey = function(e18, t2, r2, i2) { + Pf$1((3 & r2) === r2, "The recovery param is more than two bits"), t2 = new zr$2(t2, i2); + var n5 = this.n, o2 = new K$2(e18), h4 = t2.r, p3 = t2.s, b2 = r2 & 1, m3 = r2 >> 1; if (h4.cmp(this.curve.p.umod(this.curve.n)) >= 0 && m3) throw new Error("Unable to find sencond key candinate"); m3 ? h4 = this.curve.pointFromX(h4.add(this.curve.n), b2) : h4 = this.curve.pointFromX(h4, b2); - var w2 = t2.r.invm(n4), y3 = n4.sub(o2).mul(w2).umod(n4), S4 = p3.mul(w2).umod(n4); + var w2 = t2.r.invm(n5), y3 = n5.sub(o2).mul(w2).umod(n5), S4 = p3.mul(w2).umod(n5); return this.g.mulAdd(y3, h4, S4); -}, $t$2.prototype.getKeyRecoveryParam = function(e18, t2, r2, i3) { - if (t2 = new zr$2(t2, i3), t2.recoveryParam !== null) +}, $t$2.prototype.getKeyRecoveryParam = function(e18, t2, r2, i2) { + if (t2 = new zr$2(t2, i2), t2.recoveryParam !== null) return t2.recoveryParam; - for (var n4 = 0; n4 < 4; n4++) { + for (var n5 = 0; n5 < 4; n5++) { var o2; try { - o2 = this.recoverPubKey(e18, t2, n4); + o2 = this.recoverPubKey(e18, t2, n5); } catch { continue; } if (o2.eq(r2)) - return n4; + return n5; } throw new Error("Unable to find valid recovery factor"); }; @@ -95422,7 +24728,7 @@ var La$2 = cr$2(function(e18, t2) { var r2 = t2; r2.version = "6.5.4", r2.utils = Jt$2, r2.rand = function() { throw new Error("unsupported"); - }, r2.curve = qr$2, r2.curves = Kr$2, r2.ec = za$1, r2.eddsa = null; + }, r2.curve = qr$2, r2.curves = Kr$3, r2.ec = za$1, r2.eddsa = null; }); La$2.ec; var Ff$1; @@ -95431,21 +24737,21 @@ var Ff$1; })(Ff$1 || (Ff$1 = {})); const go$1 = { INVALID_METHOD: { message: "Invalid method.", code: 1001 }, INVALID_EVENT: { message: "Invalid event.", code: 1002 }, INVALID_UPDATE_REQUEST: { message: "Invalid update request.", code: 1003 }, INVALID_EXTEND_REQUEST: { message: "Invalid extend request.", code: 1004 }, INVALID_SESSION_SETTLE_REQUEST: { message: "Invalid session settle request.", code: 1005 }, UNAUTHORIZED_METHOD: { message: "Unauthorized method.", code: 3001 }, UNAUTHORIZED_EVENT: { message: "Unauthorized event.", code: 3002 }, UNAUTHORIZED_UPDATE_REQUEST: { message: "Unauthorized update request.", code: 3003 }, UNAUTHORIZED_EXTEND_REQUEST: { message: "Unauthorized extend request.", code: 3004 }, USER_REJECTED: { message: "User rejected.", code: 5e3 }, USER_REJECTED_CHAINS: { message: "User rejected chains.", code: 5001 }, USER_REJECTED_METHODS: { message: "User rejected methods.", code: 5002 }, USER_REJECTED_EVENTS: { message: "User rejected events.", code: 5003 }, UNSUPPORTED_CHAINS: { message: "Unsupported chains.", code: 5100 }, UNSUPPORTED_METHODS: { message: "Unsupported methods.", code: 5101 }, UNSUPPORTED_EVENTS: { message: "Unsupported events.", code: 5102 }, UNSUPPORTED_ACCOUNTS: { message: "Unsupported accounts.", code: 5103 }, UNSUPPORTED_NAMESPACE_KEY: { message: "Unsupported namespace key.", code: 5104 }, USER_DISCONNECTED: { message: "User disconnected.", code: 6e3 }, SESSION_SETTLEMENT_FAILED: { message: "Session settlement failed.", code: 7e3 }, WC_METHOD_UNSUPPORTED: { message: "Unsupported wc_ method.", code: 10001 } }; function tr$2(e18, t2) { - const { message: r2, code: i3 } = go$1[e18]; - return { message: t2 ? `${r2} ${t2}` : r2, code: i3 }; + const { message: r2, code: i2 } = go$1[e18]; + return { message: t2 ? `${r2} ${t2}` : r2, code: i2 }; } function Er$2(e18, t2) { return Array.isArray(e18) ? typeof t2 < "u" && e18.length ? e18.every(t2) : true : false; } class IEvents { } -let n$3 = class n extends IEvents { +let n$4 = class n extends IEvents { constructor(e18) { super(); } }; const s = cjs$3.FIVE_SECONDS, r$2 = { pulse: "heartbeat_pulse" }; -let i$1 = class i extends n$3 { +let i$4 = class i extends n$4 { constructor(e18) { super(e18), this.events = new eventsExports.EventEmitter(), this.interval = s, this.interval = (e18 == null ? void 0 : e18.interval) || s; } @@ -95568,7 +24874,7 @@ function isPureObject(value) { const proto2 = Object.getPrototypeOf(value); return !proto2 || proto2.isPrototypeOf(Object); } -function stringify(value) { +function stringify$2(value) { if (isPrimitive(value)) { return String(value); } @@ -95576,7 +24882,7 @@ function stringify(value) { return JSON.stringify(value); } if (typeof value.toJSON === "function") { - return stringify(value.toJSON()); + return stringify$2(value.toJSON()); } throw new Error("[unstorage] Cannot stringify value!"); } @@ -95815,7 +25121,7 @@ function createStorage(options = {}) { if (!driver.setItem) { return; } - await asyncCall(driver.setItem, relativeKey, stringify(value), opts); + await asyncCall(driver.setItem, relativeKey, stringify$2(value), opts); if (!driver.watch) { onChange("update", key2); } @@ -95827,7 +25133,7 @@ function createStorage(options = {}) { batch.driver.setItems, batch.items.map((item) => ({ key: item.relativeKey, - value: stringify(item.value), + value: stringify$2(item.value), options: item.options })), commonOptions @@ -95841,7 +25147,7 @@ function createStorage(options = {}) { return asyncCall( batch.driver.setItem, item.relativeKey, - stringify(item.value), + stringify$2(item.value), item.options ); }) @@ -96056,7 +25362,7 @@ function defaultGetStore() { } return defaultGetStoreFunc; } -function get(key2, customStore = defaultGetStore()) { +function get$1(key2, customStore = defaultGetStore()) { return customStore("readonly", (store) => promisifyRequest(store.get(key2))); } function set$1(key2, value, customStore = defaultGetStore()) { @@ -96120,21 +25426,21 @@ function safeJsonStringify(value) { return typeof value === "string" ? value : JSONStringify(value) || ""; } const x$3 = "idb-keyval"; -var z$4 = (i3 = {}) => { - const t2 = i3.base && i3.base.length > 0 ? `${i3.base}:` : "", e18 = (s2) => t2 + s2; - let n4; - return i3.dbName && i3.storeName && (n4 = createStore(i3.dbName, i3.storeName)), { name: x$3, options: i3, async hasItem(s2) { - return !(typeof await get(e18(s2), n4) > "u"); +var z$4 = (i2 = {}) => { + const t2 = i2.base && i2.base.length > 0 ? `${i2.base}:` : "", e18 = (s2) => t2 + s2; + let n5; + return i2.dbName && i2.storeName && (n5 = createStore(i2.dbName, i2.storeName)), { name: x$3, options: i2, async hasItem(s2) { + return !(typeof await get$1(e18(s2), n5) > "u"); }, async getItem(s2) { - return await get(e18(s2), n4) ?? null; + return await get$1(e18(s2), n5) ?? null; }, setItem(s2, a3) { - return set$1(e18(s2), a3, n4); + return set$1(e18(s2), a3, n5); }, removeItem(s2) { - return del(e18(s2), n4); + return del(e18(s2), n5); }, getKeys() { - return keys(n4); + return keys(n5); }, clear() { - return clear(n4); + return clear(n5); } }; }; const D$1 = "WALLET_CONNECT_V2_INDEXED_DB", E$2 = "keyvaluestorage"; @@ -96162,29 +25468,29 @@ let _$2 = class _ { }; var l$2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, c$2 = { exports: {} }; (function() { - let i3; + let i2; function t2() { } - i3 = t2, i3.prototype.getItem = function(e18) { + i2 = t2, i2.prototype.getItem = function(e18) { return this.hasOwnProperty(e18) ? String(this[e18]) : null; - }, i3.prototype.setItem = function(e18, n4) { - this[e18] = String(n4); - }, i3.prototype.removeItem = function(e18) { + }, i2.prototype.setItem = function(e18, n5) { + this[e18] = String(n5); + }, i2.prototype.removeItem = function(e18) { delete this[e18]; - }, i3.prototype.clear = function() { + }, i2.prototype.clear = function() { const e18 = this; - Object.keys(e18).forEach(function(n4) { - e18[n4] = void 0, delete e18[n4]; + Object.keys(e18).forEach(function(n5) { + e18[n5] = void 0, delete e18[n5]; }); - }, i3.prototype.key = function(e18) { + }, i2.prototype.key = function(e18) { return e18 = e18 || 0, Object.keys(this)[e18]; - }, i3.prototype.__defineGetter__("length", function() { + }, i2.prototype.__defineGetter__("length", function() { return Object.keys(this).length; }), typeof l$2 < "u" && l$2.localStorage ? c$2.exports = l$2.localStorage : typeof window < "u" && window.localStorage ? c$2.exports = window.localStorage : c$2.exports = new t2(); })(); -function k$1(i3) { +function k$1(i2) { var t2; - return [i3[0], safeJsonParse((t2 = i3[1]) != null ? t2 : "")]; + return [i2[0], safeJsonParse((t2 = i2[1]) != null ? t2 : "")]; } let K$1 = class K { constructor() { @@ -96208,13 +25514,13 @@ let K$1 = class K { this.localStorage.removeItem(t2); } }; -const N = "wc_storage_version", y$3 = 1, O$3 = async (i3, t2, e18) => { - const n4 = N, s2 = await t2.getItem(n4); +const N$1 = "wc_storage_version", y$3 = 1, O$3 = async (i2, t2, e18) => { + const n5 = N$1, s2 = await t2.getItem(n5); if (s2 && s2 >= y$3) { e18(t2); return; } - const a3 = await i3.getKeys(); + const a3 = await i2.getKeys(); if (!a3.length) { e18(t2); return; @@ -96226,14 +25532,14 @@ const N = "wc_storage_version", y$3 = 1, O$3 = async (i3, t2, e18) => { continue; const o2 = r2.toLowerCase(); if (o2.includes("wc@") || o2.includes("walletconnect") || o2.includes("wc_") || o2.includes("wallet_connect")) { - const f3 = await i3.getItem(r2); - await t2.setItem(r2, f3), m3.push(r2); + const f4 = await i2.getItem(r2); + await t2.setItem(r2, f4), m3.push(r2); } } - await t2.setItem(n4, y$3), e18(t2), j$3(i3, m3); -}, j$3 = async (i3, t2) => { + await t2.setItem(n5, y$3), e18(t2), j$3(i2, m3); +}, j$3 = async (i2, t2) => { t2.length && t2.forEach(async (e18) => { - await i3.removeItem(e18); + await i2.removeItem(e18); }); }; let h$2 = class h { @@ -96281,56 +25587,56 @@ function tryStringify(o2) { } } var quickFormatUnescaped = format$1; -function format$1(f3, args, opts) { +function format$1(f4, args, opts) { var ss2 = opts && opts.stringify || tryStringify; var offset2 = 1; - if (typeof f3 === "object" && f3 !== null) { + if (typeof f4 === "object" && f4 !== null) { var len = args.length + offset2; if (len === 1) - return f3; + return f4; var objects = new Array(len); - objects[0] = ss2(f3); + objects[0] = ss2(f4); for (var index2 = 1; index2 < len; index2++) { objects[index2] = ss2(args[index2]); } return objects.join(" "); } - if (typeof f3 !== "string") { - return f3; + if (typeof f4 !== "string") { + return f4; } var argLen = args.length; if (argLen === 0) - return f3; + return f4; var str = ""; var a3 = 1 - offset2; var lastPos = -1; - var flen = f3 && f3.length || 0; - for (var i3 = 0; i3 < flen; ) { - if (f3.charCodeAt(i3) === 37 && i3 + 1 < flen) { + var flen = f4 && f4.length || 0; + for (var i2 = 0; i2 < flen; ) { + if (f4.charCodeAt(i2) === 37 && i2 + 1 < flen) { lastPos = lastPos > -1 ? lastPos : 0; - switch (f3.charCodeAt(i3 + 1)) { + switch (f4.charCodeAt(i2 + 1)) { case 100: case 102: if (a3 >= argLen) break; if (args[a3] == null) break; - if (lastPos < i3) - str += f3.slice(lastPos, i3); + if (lastPos < i2) + str += f4.slice(lastPos, i2); str += Number(args[a3]); - lastPos = i3 + 2; - i3++; + lastPos = i2 + 2; + i2++; break; case 105: if (a3 >= argLen) break; if (args[a3] == null) break; - if (lastPos < i3) - str += f3.slice(lastPos, i3); + if (lastPos < i2) + str += f4.slice(lastPos, i2); str += Math.floor(Number(args[a3])); - lastPos = i3 + 2; - i3++; + lastPos = i2 + 2; + i2++; break; case 79: case 111: @@ -96339,56 +25645,56 @@ function format$1(f3, args, opts) { break; if (args[a3] === void 0) break; - if (lastPos < i3) - str += f3.slice(lastPos, i3); + if (lastPos < i2) + str += f4.slice(lastPos, i2); var type2 = typeof args[a3]; if (type2 === "string") { str += "'" + args[a3] + "'"; - lastPos = i3 + 2; - i3++; + lastPos = i2 + 2; + i2++; break; } if (type2 === "function") { str += args[a3].name || ""; - lastPos = i3 + 2; - i3++; + lastPos = i2 + 2; + i2++; break; } str += ss2(args[a3]); - lastPos = i3 + 2; - i3++; + lastPos = i2 + 2; + i2++; break; case 115: if (a3 >= argLen) break; - if (lastPos < i3) - str += f3.slice(lastPos, i3); + if (lastPos < i2) + str += f4.slice(lastPos, i2); str += String(args[a3]); - lastPos = i3 + 2; - i3++; + lastPos = i2 + 2; + i2++; break; case 37: - if (lastPos < i3) - str += f3.slice(lastPos, i3); + if (lastPos < i2) + str += f4.slice(lastPos, i2); str += "%"; - lastPos = i3 + 2; - i3++; + lastPos = i2 + 2; + i2++; a3--; break; } ++a3; } - ++i3; + ++i2; } if (lastPos === -1) - return f3; + return f4; else if (lastPos < flen) { - str += f3.slice(lastPos); + str += f4.slice(lastPos); } return str; } const format = quickFormatUnescaped; -var browser = pino; +var browser$3 = pino; const _console = pfGlobalThisOrFallback().console || {}; const stdSerializers = { mapHttpRequest: mock, @@ -96435,7 +25741,7 @@ function pino(opts) { const level = opts.level || "info"; const logger = Object.create(proto2); if (!logger.log) - logger.log = noop; + logger.log = noop$1; Object.defineProperty(logger, "levelVal", { get: getLevelVal }); @@ -96452,7 +25758,7 @@ function pino(opts) { }; logger.levels = pino.levels; logger.level = level; - logger.setMaxListeners = logger.getMaxListeners = logger.emit = logger.addListener = logger.on = logger.prependListener = logger.once = logger.prependOnceListener = logger.removeListener = logger.removeAllListeners = logger.listeners = logger.listenerCount = logger.eventNames = logger.write = logger.flush = noop; + logger.setMaxListeners = logger.getMaxListeners = logger.emit = logger.addListener = logger.on = logger.prependListener = logger.once = logger.prependOnceListener = logger.removeListener = logger.removeAllListeners = logger.listeners = logger.listenerCount = logger.eventNames = logger.write = logger.flush = noop$1; logger.serializers = serializers; logger._serialize = serialize2; logger._stdErrSerialize = stdErrSerialize; @@ -96494,12 +25800,12 @@ function pino(opts) { } function Child(parent) { this._childLevel = (parent._childLevel | 0) + 1; - this.error = bind(parent, bindings, "error"); - this.fatal = bind(parent, bindings, "fatal"); - this.warn = bind(parent, bindings, "warn"); - this.info = bind(parent, bindings, "info"); - this.debug = bind(parent, bindings, "debug"); - this.trace = bind(parent, bindings, "trace"); + this.error = bind$1(parent, bindings, "error"); + this.fatal = bind$1(parent, bindings, "fatal"); + this.warn = bind$1(parent, bindings, "warn"); + this.info = bind$1(parent, bindings, "info"); + this.debug = bind$1(parent, bindings, "debug"); + this.trace = bind$1(parent, bindings, "trace"); if (childSerializers) { this.serializers = childSerializers; this._serialize = childSerialize; @@ -96537,19 +25843,19 @@ pino.stdSerializers = stdSerializers; pino.stdTimeFunctions = Object.assign({}, { nullTime, epochTime, unixTime, isoTime }); function set(opts, logger, level, fallback) { const proto2 = Object.getPrototypeOf(logger); - logger[level] = logger.levelVal > logger.levels.values[level] ? noop : proto2[level] ? proto2[level] : _console[level] || _console[fallback] || noop; + logger[level] = logger.levelVal > logger.levels.values[level] ? noop$1 : proto2[level] ? proto2[level] : _console[level] || _console[fallback] || noop$1; wrap(opts, logger, level); } function wrap(opts, logger, level) { - if (!opts.transmit && logger[level] === noop) + if (!opts.transmit && logger[level] === noop$1) return; logger[level] = function(write3) { return function LOG() { const ts2 = opts.timestamp(); const args = new Array(arguments.length); const proto2 = Object.getPrototypeOf && Object.getPrototypeOf(this) === _console ? _console : this; - for (var i3 = 0; i3 < args.length; i3++) - args[i3] = arguments[i3]; + for (var i2 = 0; i2 < args.length; i2++) + args[i2] = arguments[i2]; if (opts.serialize && !opts.asObject) { applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize); } @@ -96601,24 +25907,24 @@ function asObject(logger, level, args, ts2) { return o2; } function applySerializers(args, serialize2, serializers, stdErrSerialize) { - for (const i3 in args) { - if (stdErrSerialize && args[i3] instanceof Error) { - args[i3] = pino.stdSerializers.err(args[i3]); - } else if (typeof args[i3] === "object" && !Array.isArray(args[i3])) { - for (const k2 in args[i3]) { + for (const i2 in args) { + if (stdErrSerialize && args[i2] instanceof Error) { + args[i2] = pino.stdSerializers.err(args[i2]); + } else if (typeof args[i2] === "object" && !Array.isArray(args[i2])) { + for (const k2 in args[i2]) { if (serialize2 && serialize2.indexOf(k2) > -1 && k2 in serializers) { - args[i3][k2] = serializers[k2](args[i3][k2]); + args[i2][k2] = serializers[k2](args[i2][k2]); } } } } } -function bind(parent, bindings, level) { +function bind$1(parent, bindings, level) { return function() { const args = new Array(1 + arguments.length); args[0] = bindings; - for (var i3 = 1; i3 < args.length; i3++) { - args[i3] = arguments[i3 - 1]; + for (var i2 = 1; i2 < args.length; i2++) { + args[i2] = arguments[i2 - 1]; } return parent[level].apply(this, args); }; @@ -96681,7 +25987,7 @@ function mock() { function passthrough(a3) { return a3; } -function noop() { +function noop$1() { } function nullTime() { return false; @@ -96714,8 +26020,8 @@ function pfGlobalThisOrFallback() { return defd(self) || defd(window) || defd(this) || {}; } } -const Mg = /* @__PURE__ */ getDefaultExportFromCjs$1(browser); -const c$1 = { level: "info" }, n$2 = "custom_context", l$1 = 1e3 * 1024; +const Mg = /* @__PURE__ */ getDefaultExportFromCjs$1(browser$3); +const c$1 = { level: "info" }, n$3 = "custom_context", l$1 = 1e3 * 1024; let O$2 = class O { constructor(e18) { this.nodeValue = e18, this.sizeInBytes = new TextEncoder().encode(this.nodeValue).length, this.next = null; @@ -96773,10 +26079,10 @@ let d$2 = class d { }; let L$1 = class L2 { constructor(e18, t2 = l$1) { - this.level = e18 ?? "error", this.levelValue = browser.levels.values[this.level], this.MAX_LOG_SIZE_IN_BYTES = t2, this.logs = new d$2(this.MAX_LOG_SIZE_IN_BYTES); + this.level = e18 ?? "error", this.levelValue = browser$3.levels.values[this.level], this.MAX_LOG_SIZE_IN_BYTES = t2, this.logs = new d$2(this.MAX_LOG_SIZE_IN_BYTES); } forwardToConsole(e18, t2) { - t2 === browser.levels.values.error ? console.error(e18) : t2 === browser.levels.values.warn ? console.warn(e18) : t2 === browser.levels.values.debug ? console.debug(e18) : t2 === browser.levels.values.trace ? console.trace(e18) : console.log(e18); + t2 === browser$3.levels.values.error ? console.error(e18) : t2 === browser$3.levels.values.warn ? console.warn(e18) : t2 === browser$3.levels.values.debug ? console.debug(e18) : t2 === browser$3.levels.values.trace ? console.trace(e18) : console.log(e18); } appendToLogs(e18) { this.logs.append(safeJsonStringify({ timestamp: (/* @__PURE__ */ new Date()).toISOString(), log: e18 })); @@ -96841,49 +26147,49 @@ class B { return this.baseChunkLogger.logsToBlob(e18); } } -var x$2 = Object.defineProperty, S$2 = Object.defineProperties, _$1 = Object.getOwnPropertyDescriptors, p$2 = Object.getOwnPropertySymbols, T$2 = Object.prototype.hasOwnProperty, z$3 = Object.prototype.propertyIsEnumerable, f$2 = (r2, e18, t2) => e18 in r2 ? x$2(r2, e18, { enumerable: true, configurable: true, writable: true, value: t2 }) : r2[e18] = t2, i2 = (r2, e18) => { +var x$2 = Object.defineProperty, S$3 = Object.defineProperties, _$1 = Object.getOwnPropertyDescriptors, p$2 = Object.getOwnPropertySymbols, T$2 = Object.prototype.hasOwnProperty, z$3 = Object.prototype.propertyIsEnumerable, f$4 = (r2, e18, t2) => e18 in r2 ? x$2(r2, e18, { enumerable: true, configurable: true, writable: true, value: t2 }) : r2[e18] = t2, i$3 = (r2, e18) => { for (var t2 in e18 || (e18 = {})) - T$2.call(e18, t2) && f$2(r2, t2, e18[t2]); + T$2.call(e18, t2) && f$4(r2, t2, e18[t2]); if (p$2) for (var t2 of p$2(e18)) - z$3.call(e18, t2) && f$2(r2, t2, e18[t2]); + z$3.call(e18, t2) && f$4(r2, t2, e18[t2]); return r2; -}, g$2 = (r2, e18) => S$2(r2, _$1(e18)); +}, g$2 = (r2, e18) => S$3(r2, _$1(e18)); function k(r2) { - return g$2(i2({}, r2), { level: (r2 == null ? void 0 : r2.level) || c$1.level }); + return g$2(i$3({}, r2), { level: (r2 == null ? void 0 : r2.level) || c$1.level }); } -function v$3(r2, e18 = n$2) { +function v$3(r2, e18 = n$3) { return r2[e18] || ""; } -function b$1(r2, e18, t2 = n$2) { +function b$2(r2, e18, t2 = n$3) { return r2[t2] = e18, r2; } -function y$2(r2, e18 = n$2) { +function y$2(r2, e18 = n$3) { let t2 = ""; return typeof r2.bindings > "u" ? t2 = v$3(r2, e18) : t2 = r2.bindings().context || "", t2; } -function w$3(r2, e18, t2 = n$2) { +function w$3(r2, e18, t2 = n$3) { const o2 = y$2(r2, t2); return o2.trim() ? `${o2}/${e18}` : e18; } -function E$1(r2, e18, t2 = n$2) { +function E$1(r2, e18, t2 = n$3) { const o2 = w$3(r2, e18, t2), a3 = r2.child({ context: o2 }); - return b$1(a3, o2, t2); + return b$2(a3, o2, t2); } function C$2(r2) { var e18, t2; const o2 = new m$1((e18 = r2.opts) == null ? void 0 : e18.level, r2.maxSizeInBytes); - return { logger: Mg(g$2(i2({}, r2.opts), { level: "trace", browser: g$2(i2({}, (t2 = r2.opts) == null ? void 0 : t2.browser), { write: (a3) => o2.write(a3) }) })), chunkLoggerController: o2 }; + return { logger: Mg(g$2(i$3({}, r2.opts), { level: "trace", browser: g$2(i$3({}, (t2 = r2.opts) == null ? void 0 : t2.browser), { write: (a3) => o2.write(a3) }) })), chunkLoggerController: o2 }; } function I$1(r2) { var e18; const t2 = new B((e18 = r2.opts) == null ? void 0 : e18.level, r2.maxSizeInBytes); - return { logger: Mg(g$2(i2({}, r2.opts), { level: "trace" }), t2), chunkLoggerController: t2 }; + return { logger: Mg(g$2(i$3({}, r2.opts), { level: "trace" }), t2), chunkLoggerController: t2 }; } function A$1(r2) { return typeof r2.loggerOverride < "u" && typeof r2.loggerOverride != "string" ? { logger: r2.loggerOverride, chunkLoggerController: null } : typeof window < "u" ? C$2(r2) : I$1(r2); } -let n$1 = class n2 extends IEvents { +let n$2 = class n2 extends IEvents { constructor(s2) { super(), this.opts = s2, this.protocol = "wc", this.version = 2; } @@ -96909,7 +26215,7 @@ class u extends IEvents { } } let p$1 = class p { - constructor(s2, t2, e18, f3) { + constructor(s2, t2, e18, f4) { this.core = s2, this.logger = t2, this.name = e18; } }; @@ -96938,7 +26244,7 @@ let C$1 = class C { this.core = s2, this.logger = t2, this.telemetryEnabled = e18; } }; -let S$1 = class S { +let S$2 = class S { constructor(s2) { this.opts = s2, this.protocol = "wc", this.version = 2; } @@ -96948,8 +26254,8 @@ let M$1 = class M { this.client = s2; } }; -var ed25519 = {}; -var sha512 = {}; +var ed25519$1 = {}; +var sha512$2 = {}; (function(exports) { Object.defineProperty(exports, "__esModule", { value: true }); var binary_12 = binary; @@ -97040,17 +26346,17 @@ var sha512 = {}; var bitLenLo = bytesHashed << 3; var padLength = bytesHashed % 128 < 112 ? 128 : 256; this._buffer[left] = 128; - for (var i3 = left + 1; i3 < padLength - 8; i3++) { - this._buffer[i3] = 0; + for (var i2 = left + 1; i2 < padLength - 8; i2++) { + this._buffer[i2] = 0; } binary_12.writeUint32BE(bitLenHi, this._buffer, padLength - 8); binary_12.writeUint32BE(bitLenLo, this._buffer, padLength - 4); hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, this._buffer, 0, padLength); this._finished = true; } - for (var i3 = 0; i3 < this.digestLength / 8; i3++) { - binary_12.writeUint32BE(this._stateHi[i3], out, i3 * 8); - binary_12.writeUint32BE(this._stateLo[i3], out, i3 * 8 + 4); + for (var i2 = 0; i2 < this.digestLength / 8; i2++) { + binary_12.writeUint32BE(this._stateHi[i2], out, i2 * 8); + binary_12.writeUint32BE(this._stateLo[i2], out, i2 * 8 + 4); } return this; }; @@ -97263,12 +26569,12 @@ var sha512 = {}; var th2, tl2; var a3, b2, c2, d4; while (len >= 128) { - for (var i3 = 0; i3 < 16; i3++) { - var j2 = 8 * i3 + pos; - wh2[i3] = binary_12.readUint32BE(m3, j2); - wl[i3] = binary_12.readUint32BE(m3, j2 + 4); + for (var i2 = 0; i2 < 16; i2++) { + var j2 = 8 * i2 + pos; + wh2[i2] = binary_12.readUint32BE(m3, j2); + wl[i2] = binary_12.readUint32BE(m3, j2 + 4); } - for (var i3 = 0; i3 < 80; i3++) { + for (var i2 = 0; i2 < 80; i2++) { var bh0 = ah0; var bh1 = ah1; var bh2 = ah2; @@ -97303,14 +26609,14 @@ var sha512 = {}; b2 += l2 >>> 16; c2 += h4 & 65535; d4 += h4 >>> 16; - h4 = K3[i3 * 2]; - l2 = K3[i3 * 2 + 1]; + h4 = K3[i2 * 2]; + l2 = K3[i2 * 2 + 1]; a3 += l2 & 65535; b2 += l2 >>> 16; c2 += h4 & 65535; d4 += h4 >>> 16; - h4 = wh2[i3 % 16]; - l2 = wl[i3 % 16]; + h4 = wh2[i2 % 16]; + l2 = wl[i2 % 16]; a3 += l2 & 65535; b2 += l2 >>> 16; c2 += h4 & 65535; @@ -97376,7 +26682,7 @@ var sha512 = {}; al6 = bl5; al7 = bl6; al0 = bl7; - if (i3 % 16 === 15) { + if (i2 % 16 === 15) { for (var j2 = 0; j2 < 16; j2++) { h4 = wh2[j2]; l2 = wl[j2]; @@ -97563,12 +26869,12 @@ var sha512 = {}; return digest9; } exports.hash = hash3; -})(sha512); +})(sha512$2); (function(exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.convertSecretKeyToX25519 = exports.convertPublicKeyToX25519 = exports.verify = exports.sign = exports.extractPublicKeyFromSecretKey = exports.generateKeyPair = exports.generateKeyPairFromSeed = exports.SEED_LENGTH = exports.SECRET_KEY_LENGTH = exports.PUBLIC_KEY_LENGTH = exports.SIGNATURE_LENGTH = void 0; const random_1 = random; - const sha512_1 = sha512; + const sha512_1 = sha512$2; const wipe_12 = wipe$1; exports.SIGNATURE_LENGTH = 64; exports.PUBLIC_KEY_LENGTH = 32; @@ -97577,8 +26883,8 @@ var sha512 = {}; function gf2(init3) { const r2 = new Float64Array(16); if (init3) { - for (let i3 = 0; i3 < init3.length; i3++) { - r2[i3] = init3[i3]; + for (let i2 = 0; i2 < init3.length; i2++) { + r2[i2] = init3[i2]; } } return r2; @@ -97678,56 +26984,56 @@ var sha512 = {}; 11139 ]); function set25519(r2, a3) { - for (let i3 = 0; i3 < 16; i3++) { - r2[i3] = a3[i3] | 0; + for (let i2 = 0; i2 < 16; i2++) { + r2[i2] = a3[i2] | 0; } } function car25519(o2) { let c2 = 1; - for (let i3 = 0; i3 < 16; i3++) { - let v6 = o2[i3] + c2 + 65535; + for (let i2 = 0; i2 < 16; i2++) { + let v6 = o2[i2] + c2 + 65535; c2 = Math.floor(v6 / 65536); - o2[i3] = v6 - c2 * 65536; + o2[i2] = v6 - c2 * 65536; } o2[0] += c2 - 1 + 37 * (c2 - 1); } function sel25519(p3, q2, b2) { const c2 = ~(b2 - 1); - for (let i3 = 0; i3 < 16; i3++) { - const t2 = c2 & (p3[i3] ^ q2[i3]); - p3[i3] ^= t2; - q2[i3] ^= t2; + for (let i2 = 0; i2 < 16; i2++) { + const t2 = c2 & (p3[i2] ^ q2[i2]); + p3[i2] ^= t2; + q2[i2] ^= t2; } } - function pack25519(o2, n4) { + function pack25519(o2, n5) { const m3 = gf2(); const t2 = gf2(); - for (let i3 = 0; i3 < 16; i3++) { - t2[i3] = n4[i3]; + for (let i2 = 0; i2 < 16; i2++) { + t2[i2] = n5[i2]; } car25519(t2); car25519(t2); car25519(t2); for (let j2 = 0; j2 < 2; j2++) { m3[0] = t2[0] - 65517; - for (let i3 = 1; i3 < 15; i3++) { - m3[i3] = t2[i3] - 65535 - (m3[i3 - 1] >> 16 & 1); - m3[i3 - 1] &= 65535; + for (let i2 = 1; i2 < 15; i2++) { + m3[i2] = t2[i2] - 65535 - (m3[i2 - 1] >> 16 & 1); + m3[i2 - 1] &= 65535; } m3[15] = t2[15] - 32767 - (m3[14] >> 16 & 1); const b2 = m3[15] >> 16 & 1; m3[14] &= 65535; sel25519(t2, m3, 1 - b2); } - for (let i3 = 0; i3 < 16; i3++) { - o2[2 * i3] = t2[i3] & 255; - o2[2 * i3 + 1] = t2[i3] >> 8; + for (let i2 = 0; i2 < 16; i2++) { + o2[2 * i2] = t2[i2] & 255; + o2[2 * i2 + 1] = t2[i2] >> 8; } } function verify32(x3, y3) { let d4 = 0; - for (let i3 = 0; i3 < 32; i3++) { - d4 |= x3[i3] ^ y3[i3]; + for (let i2 = 0; i2 < 32; i2++) { + d4 |= x3[i2] ^ y3[i2]; } return (1 & d4 - 1 >>> 8) - 1; } @@ -97743,20 +27049,20 @@ var sha512 = {}; pack25519(d4, a3); return d4[0] & 1; } - function unpack25519(o2, n4) { - for (let i3 = 0; i3 < 16; i3++) { - o2[i3] = n4[2 * i3] + (n4[2 * i3 + 1] << 8); + function unpack25519(o2, n5) { + for (let i2 = 0; i2 < 16; i2++) { + o2[i2] = n5[2 * i2] + (n5[2 * i2 + 1] << 8); } o2[15] &= 32767; } function add6(o2, a3, b2) { - for (let i3 = 0; i3 < 16; i3++) { - o2[i3] = a3[i3] + b2[i3]; + for (let i2 = 0; i2 < 16; i2++) { + o2[i2] = a3[i2] + b2[i2]; } } function sub(o2, a3, b2) { - for (let i3 = 0; i3 < 16; i3++) { - o2[i3] = a3[i3] - b2[i3]; + for (let i2 = 0; i2 < 16; i2++) { + o2[i2] = a3[i2] - b2[i2]; } } function mul6(o2, a3, b2) { @@ -98168,32 +27474,32 @@ var sha512 = {}; function square(o2, a3) { mul6(o2, a3, a3); } - function inv25519(o2, i3) { + function inv25519(o2, i2) { const c2 = gf2(); let a3; for (a3 = 0; a3 < 16; a3++) { - c2[a3] = i3[a3]; + c2[a3] = i2[a3]; } for (a3 = 253; a3 >= 0; a3--) { square(c2, c2); if (a3 !== 2 && a3 !== 4) { - mul6(c2, c2, i3); + mul6(c2, c2, i2); } } for (a3 = 0; a3 < 16; a3++) { o2[a3] = c2[a3]; } } - function pow2523(o2, i3) { + function pow2523(o2, i2) { const c2 = gf2(); let a3; for (a3 = 0; a3 < 16; a3++) { - c2[a3] = i3[a3]; + c2[a3] = i2[a3]; } for (a3 = 250; a3 >= 0; a3--) { square(c2, c2); if (a3 !== 1) { - mul6(c2, c2, i3); + mul6(c2, c2, i2); } } for (a3 = 0; a3 < 16; a3++) { @@ -98201,7 +27507,7 @@ var sha512 = {}; } } function edadd(p3, q2) { - const a3 = gf2(), b2 = gf2(), c2 = gf2(), d4 = gf2(), e18 = gf2(), f3 = gf2(), g3 = gf2(), h4 = gf2(), t2 = gf2(); + const a3 = gf2(), b2 = gf2(), c2 = gf2(), d4 = gf2(), e18 = gf2(), f4 = gf2(), g3 = gf2(), h4 = gf2(), t2 = gf2(); sub(a3, p3[1], p3[0]); sub(t2, q2[1], q2[0]); mul6(a3, a3, t2); @@ -98213,17 +27519,17 @@ var sha512 = {}; mul6(d4, p3[2], q2[2]); add6(d4, d4, d4); sub(e18, b2, a3); - sub(f3, d4, c2); + sub(f4, d4, c2); add6(g3, d4, c2); add6(h4, b2, a3); - mul6(p3[0], e18, f3); + mul6(p3[0], e18, f4); mul6(p3[1], h4, g3); - mul6(p3[2], g3, f3); + mul6(p3[2], g3, f4); mul6(p3[3], e18, h4); } function cswap(p3, q2, b2) { - for (let i3 = 0; i3 < 4; i3++) { - sel25519(p3[i3], q2[i3], b2); + for (let i2 = 0; i2 < 4; i2++) { + sel25519(p3[i2], q2[i2], b2); } } function pack2(r2, p3) { @@ -98239,8 +27545,8 @@ var sha512 = {}; set25519(p3[1], gf1); set25519(p3[2], gf1); set25519(p3[3], gf0); - for (let i3 = 255; i3 >= 0; --i3) { - const b2 = s2[i3 / 8 | 0] >> (i3 & 7) & 1; + for (let i2 = 255; i2 >= 0; --i2) { + const b2 = s2[i2 / 8 | 0] >> (i2 & 7) & 1; cswap(p3, q2, b2); edadd(q2, p3); edadd(p3, p3); @@ -98326,18 +27632,18 @@ var sha512 = {}; ]); function modL(r2, x3) { let carry; - let i3; + let i2; let j2; let k2; - for (i3 = 63; i3 >= 32; --i3) { + for (i2 = 63; i2 >= 32; --i2) { carry = 0; - for (j2 = i3 - 32, k2 = i3 - 12; j2 < k2; ++j2) { - x3[j2] += carry - 16 * x3[i3] * L4[j2 - (i3 - 32)]; + for (j2 = i2 - 32, k2 = i2 - 12; j2 < k2; ++j2) { + x3[j2] += carry - 16 * x3[i2] * L4[j2 - (i2 - 32)]; carry = Math.floor((x3[j2] + 128) / 256); x3[j2] -= carry * 256; } x3[j2] += carry; - x3[i3] = 0; + x3[i2] = 0; } carry = 0; for (j2 = 0; j2 < 32; j2++) { @@ -98348,18 +27654,18 @@ var sha512 = {}; for (j2 = 0; j2 < 32; j2++) { x3[j2] -= carry * L4[j2]; } - for (i3 = 0; i3 < 32; i3++) { - x3[i3 + 1] += x3[i3] >> 8; - r2[i3] = x3[i3] & 255; + for (i2 = 0; i2 < 32; i2++) { + x3[i2 + 1] += x3[i2] >> 8; + r2[i2] = x3[i2] & 255; } } function reduce(r2) { const x3 = new Float64Array(64); - for (let i3 = 0; i3 < 64; i3++) { - x3[i3] = r2[i3]; + for (let i2 = 0; i2 < 64; i2++) { + x3[i2] = r2[i2]; } - for (let i3 = 0; i3 < 64; i3++) { - r2[i3] = 0; + for (let i2 = 0; i2 < 64; i2++) { + r2[i2] = 0; } modL(r2, x3); } @@ -98386,12 +27692,12 @@ var sha512 = {}; hs2.update(message2); const h4 = hs2.digest(); reduce(h4); - for (let i3 = 0; i3 < 32; i3++) { - x3[i3] = r2[i3]; + for (let i2 = 0; i2 < 32; i2++) { + x3[i2] = r2[i2]; } - for (let i3 = 0; i3 < 32; i3++) { + for (let i2 = 0; i2 < 32; i2++) { for (let j2 = 0; j2 < 32; j2++) { - x3[i3 + j2] += h4[i3] * d4[j2]; + x3[i2 + j2] += h4[i2] * d4[j2]; } } modL(signature2.subarray(32), x3); @@ -98485,7 +27791,7 @@ var sha512 = {}; return o2; } exports.convertSecretKeyToX25519 = convertSecretKeyToX25519; -})(ed25519); +})(ed25519$1); const JWT_IRIDIUM_ALG = "EdDSA"; const JWT_IRIDIUM_TYP = "JWT"; const JWT_DELIMITER = "."; @@ -98500,18 +27806,18 @@ const MULTICODEC_ED25519_BASE = "z"; const MULTICODEC_ED25519_HEADER = "K36"; const KEY_PAIR_SEED_LENGTH = 32; function decodeJSON(str) { - return safeJsonParse(toString$1(fromString(str, JWT_ENCODING), JSON_ENCODING)); + return safeJsonParse(toString$3(fromString(str, JWT_ENCODING), JSON_ENCODING)); } function encodeJSON(val) { - return toString$1(fromString(safeJsonStringify(val), JSON_ENCODING), JWT_ENCODING); + return toString$3(fromString(safeJsonStringify(val), JSON_ENCODING), JWT_ENCODING); } function encodeIss(publicKey2) { const header = fromString(MULTICODEC_ED25519_HEADER, MULTICODEC_ED25519_ENCODING); - const multicodec = MULTICODEC_ED25519_BASE + toString$1(concat([header, publicKey2]), MULTICODEC_ED25519_ENCODING); + const multicodec = MULTICODEC_ED25519_BASE + toString$3(concat$1([header, publicKey2]), MULTICODEC_ED25519_ENCODING); return [DID_PREFIX, DID_METHOD, multicodec].join(DID_DELIMITER); } function encodeSig(bytes2) { - return toString$1(bytes2, JWT_ENCODING); + return toString$3(bytes2, JWT_ENCODING); } function decodeSig(encoded) { return fromString(encoded, JWT_ENCODING); @@ -98535,7 +27841,7 @@ function decodeJWT(jwt) { return { header, payload, signature: signature2, data }; } function generateKeyPair(seed = random.randomBytes(KEY_PAIR_SEED_LENGTH)) { - return ed25519.generateKeyPairFromSeed(seed); + return ed25519$1.generateKeyPairFromSeed(seed); } async function signJWT(sub, aud, ttl, keyPair2, iat = cjs$3.fromMiliseconds(Date.now())) { const header = { alg: JWT_IRIDIUM_ALG, typ: JWT_IRIDIUM_TYP }; @@ -98543,12 +27849,12 @@ async function signJWT(sub, aud, ttl, keyPair2, iat = cjs$3.fromMiliseconds(Date const exp2 = iat + ttl; const payload = { iss, sub, aud, iat, exp: exp2 }; const data = encodeData({ header, payload }); - const signature2 = ed25519.sign(keyPair2.secretKey, data); + const signature2 = ed25519$1.sign(keyPair2.secretKey, data); return encodeJWT({ header, payload, signature: signature2 }); } var elliptic = {}; const name = "elliptic"; -const version = "6.6.1"; +const version$4 = "6.6.1"; const description = "EC cryptography"; const main = "lib/elliptic.js"; const files = [ @@ -98601,9 +27907,9 @@ const dependencies = { "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" }; -const require$$0 = { +const require$$0$1 = { name, - version, + version: version$4, description, main, files, @@ -98617,9 +27923,9 @@ const require$$0 = { devDependencies, dependencies }; -var utils$c = {}; -var bn$1 = { exports: {} }; -bn$1.exports; +var utils$i = {}; +var bn$2 = { exports: {} }; +bn$2.exports; (function(module) { (function(module2, exports) { function assert2(val, msg) { @@ -98746,14 +28052,14 @@ bn$1.exports; } this.length = Math.ceil(number2.length / 3); this.words = new Array(this.length); - for (var i3 = 0; i3 < this.length; i3++) { - this.words[i3] = 0; + for (var i2 = 0; i2 < this.length; i2++) { + this.words[i2] = 0; } var j2, w2; var off = 0; if (endian === "be") { - for (i3 = number2.length - 1, j2 = 0; i3 >= 0; i3 -= 3) { - w2 = number2[i3] | number2[i3 - 1] << 8 | number2[i3 - 2] << 16; + for (i2 = number2.length - 1, j2 = 0; i2 >= 0; i2 -= 3) { + w2 = number2[i2] | number2[i2 - 1] << 8 | number2[i2 - 2] << 16; this.words[j2] |= w2 << off & 67108863; this.words[j2 + 1] = w2 >>> 26 - off & 67108863; off += 24; @@ -98763,8 +28069,8 @@ bn$1.exports; } } } else if (endian === "le") { - for (i3 = 0, j2 = 0; i3 < number2.length; i3 += 3) { - w2 = number2[i3] | number2[i3 + 1] << 8 | number2[i3 + 2] << 16; + for (i2 = 0, j2 = 0; i2 < number2.length; i2 += 3) { + w2 = number2[i2] | number2[i2 + 1] << 8 | number2[i2 + 2] << 16; this.words[j2] |= w2 << off & 67108863; this.words[j2 + 1] = w2 >>> 26 - off & 67108863; off += 24; @@ -98796,15 +28102,15 @@ bn$1.exports; BN2.prototype._parseHex = function _parseHex(number2, start, endian) { this.length = Math.ceil((number2.length - start) / 6); this.words = new Array(this.length); - for (var i3 = 0; i3 < this.length; i3++) { - this.words[i3] = 0; + for (var i2 = 0; i2 < this.length; i2++) { + this.words[i2] = 0; } var off = 0; var j2 = 0; var w2; if (endian === "be") { - for (i3 = number2.length - 1; i3 >= start; i3 -= 2) { - w2 = parseHexByte(number2, start, i3) << off; + for (i2 = number2.length - 1; i2 >= start; i2 -= 2) { + w2 = parseHexByte(number2, start, i2) << off; this.words[j2] |= w2 & 67108863; if (off >= 18) { off -= 18; @@ -98816,8 +28122,8 @@ bn$1.exports; } } else { var parseLength = number2.length - start; - for (i3 = parseLength % 2 === 0 ? start + 1 : start; i3 < number2.length; i3 += 2) { - w2 = parseHexByte(number2, start, i3) << off; + for (i2 = parseLength % 2 === 0 ? start + 1 : start; i2 < number2.length; i2 += 2) { + w2 = parseHexByte(number2, start, i2) << off; this.words[j2] |= w2 & 67108863; if (off >= 18) { off -= 18; @@ -98833,8 +28139,8 @@ bn$1.exports; function parseBase(str, start, end, mul6) { var r2 = 0; var len = Math.min(str.length, end); - for (var i3 = start; i3 < len; i3++) { - var c2 = str.charCodeAt(i3) - 48; + for (var i2 = start; i2 < len; i2++) { + var c2 = str.charCodeAt(i2) - 48; r2 *= mul6; if (c2 >= 49) { r2 += c2 - 49 + 10; @@ -98858,8 +28164,8 @@ bn$1.exports; var mod2 = total % limbLen; var end = Math.min(total, total - mod2) + start; var word = 0; - for (var i3 = start; i3 < end; i3 += limbLen) { - word = parseBase(number2, i3, i3 + limbLen, base3); + for (var i2 = start; i2 < end; i2 += limbLen) { + word = parseBase(number2, i2, i2 + limbLen, base3); this.imuln(limbPow); if (this.words[0] + word < 67108864) { this.words[0] += word; @@ -98869,8 +28175,8 @@ bn$1.exports; } if (mod2 !== 0) { var pow3 = 1; - word = parseBase(number2, i3, number2.length, base3); - for (i3 = 0; i3 < mod2; i3++) { + word = parseBase(number2, i2, number2.length, base3); + for (i2 = 0; i2 < mod2; i2++) { pow3 *= base3; } this.imuln(pow3); @@ -98884,8 +28190,8 @@ bn$1.exports; }; BN2.prototype.copy = function copy(dest) { dest.words = new Array(this.length); - for (var i3 = 0; i3 < this.length; i3++) { - dest.words[i3] = this.words[i3]; + for (var i2 = 0; i2 < this.length; i2++) { + dest.words[i2] = this.words[i2]; } dest.length = this.length; dest.negative = this.negative; @@ -99031,16 +28337,16 @@ bn$1.exports; out = ""; var off = 0; var carry = 0; - for (var i3 = 0; i3 < this.length; i3++) { - var w2 = this.words[i3]; + for (var i2 = 0; i2 < this.length; i2++) { + var w2 = this.words[i2]; var word = ((w2 << off | carry) & 16777215).toString(16); carry = w2 >>> 24 - off & 16777215; off += 2; if (off >= 26) { off -= 26; - i3--; + i2--; } - if (carry !== 0 || i3 !== this.length - 1) { + if (carry !== 0 || i2 !== this.length - 1) { out = zeros[6 - word.length] + word + out; } else { out = word + out; @@ -99114,25 +28420,25 @@ bn$1.exports; this.strip(); var littleEndian = endian === "le"; var res = new ArrayType(reqLength); - var b2, i3; + var b2, i2; var q2 = this.clone(); if (!littleEndian) { - for (i3 = 0; i3 < reqLength - byteLength2; i3++) { - res[i3] = 0; + for (i2 = 0; i2 < reqLength - byteLength2; i2++) { + res[i2] = 0; } - for (i3 = 0; !q2.isZero(); i3++) { + for (i2 = 0; !q2.isZero(); i2++) { b2 = q2.andln(255); q2.iushrn(8); - res[reqLength - i3 - 1] = b2; + res[reqLength - i2 - 1] = b2; } } else { - for (i3 = 0; !q2.isZero(); i3++) { + for (i2 = 0; !q2.isZero(); i2++) { b2 = q2.andln(255); q2.iushrn(8); - res[i3] = b2; + res[i2] = b2; } - for (; i3 < reqLength; i3++) { - res[i3] = 0; + for (; i2 < reqLength; i2++) { + res[i2] = 0; } } return res; @@ -99208,8 +28514,8 @@ bn$1.exports; if (this.isZero()) return 0; var r2 = 0; - for (var i3 = 0; i3 < this.length; i3++) { - var b2 = this._zeroBits(this.words[i3]); + for (var i2 = 0; i2 < this.length; i2++) { + var b2 = this._zeroBits(this.words[i2]); r2 += b2; if (b2 !== 26) break; @@ -99247,8 +28553,8 @@ bn$1.exports; while (this.length < num.length) { this.words[this.length++] = 0; } - for (var i3 = 0; i3 < num.length; i3++) { - this.words[i3] = this.words[i3] | num.words[i3]; + for (var i2 = 0; i2 < num.length; i2++) { + this.words[i2] = this.words[i2] | num.words[i2]; } return this.strip(); }; @@ -99273,8 +28579,8 @@ bn$1.exports; } else { b2 = this; } - for (var i3 = 0; i3 < b2.length; i3++) { - this.words[i3] = this.words[i3] & num.words[i3]; + for (var i2 = 0; i2 < b2.length; i2++) { + this.words[i2] = this.words[i2] & num.words[i2]; } this.length = b2.length; return this.strip(); @@ -99303,12 +28609,12 @@ bn$1.exports; a3 = num; b2 = this; } - for (var i3 = 0; i3 < b2.length; i3++) { - this.words[i3] = a3.words[i3] ^ b2.words[i3]; + for (var i2 = 0; i2 < b2.length; i2++) { + this.words[i2] = a3.words[i2] ^ b2.words[i2]; } if (this !== a3) { - for (; i3 < a3.length; i3++) { - this.words[i3] = a3.words[i3]; + for (; i2 < a3.length; i2++) { + this.words[i2] = a3.words[i2]; } } this.length = a3.length; @@ -99336,11 +28642,11 @@ bn$1.exports; if (bitsLeft > 0) { bytesNeeded--; } - for (var i3 = 0; i3 < bytesNeeded; i3++) { - this.words[i3] = ~this.words[i3] & 67108863; + for (var i2 = 0; i2 < bytesNeeded; i2++) { + this.words[i2] = ~this.words[i2] & 67108863; } if (bitsLeft > 0) { - this.words[i3] = ~this.words[i3] & 67108863 >> 26 - bitsLeft; + this.words[i2] = ~this.words[i2] & 67108863 >> 26 - bitsLeft; } return this.strip(); }; @@ -99381,14 +28687,14 @@ bn$1.exports; b2 = this; } var carry = 0; - for (var i3 = 0; i3 < b2.length; i3++) { - r2 = (a3.words[i3] | 0) + (b2.words[i3] | 0) + carry; - this.words[i3] = r2 & 67108863; + for (var i2 = 0; i2 < b2.length; i2++) { + r2 = (a3.words[i2] | 0) + (b2.words[i2] | 0) + carry; + this.words[i2] = r2 & 67108863; carry = r2 >>> 26; } - for (; carry !== 0 && i3 < a3.length; i3++) { - r2 = (a3.words[i3] | 0) + carry; - this.words[i3] = r2 & 67108863; + for (; carry !== 0 && i2 < a3.length; i2++) { + r2 = (a3.words[i2] | 0) + carry; + this.words[i2] = r2 & 67108863; carry = r2 >>> 26; } this.length = a3.length; @@ -99396,8 +28702,8 @@ bn$1.exports; this.words[this.length] = carry; this.length++; } else if (a3 !== this) { - for (; i3 < a3.length; i3++) { - this.words[i3] = a3.words[i3]; + for (; i2 < a3.length; i2++) { + this.words[i2] = a3.words[i2]; } } return this; @@ -99447,22 +28753,22 @@ bn$1.exports; b2 = this; } var carry = 0; - for (var i3 = 0; i3 < b2.length; i3++) { - r2 = (a3.words[i3] | 0) - (b2.words[i3] | 0) + carry; + for (var i2 = 0; i2 < b2.length; i2++) { + r2 = (a3.words[i2] | 0) - (b2.words[i2] | 0) + carry; carry = r2 >> 26; - this.words[i3] = r2 & 67108863; + this.words[i2] = r2 & 67108863; } - for (; carry !== 0 && i3 < a3.length; i3++) { - r2 = (a3.words[i3] | 0) + carry; + for (; carry !== 0 && i2 < a3.length; i2++) { + r2 = (a3.words[i2] | 0) + carry; carry = r2 >> 26; - this.words[i3] = r2 & 67108863; + this.words[i2] = r2 & 67108863; } - if (carry === 0 && i3 < a3.length && a3 !== this) { - for (; i3 < a3.length; i3++) { - this.words[i3] = a3.words[i3]; + if (carry === 0 && i2 < a3.length && a3 !== this) { + for (; i2 < a3.length; i2++) { + this.words[i2] = a3.words[i2]; } } - this.length = Math.max(this.length, i3); + this.length = Math.max(this.length, i2); if (a3 !== this) { this.negative = 1; } @@ -99487,8 +28793,8 @@ bn$1.exports; var rword = carry & 67108863; var maxJ = Math.min(k2, num.length - 1); for (var j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { - var i3 = k2 - j2 | 0; - a3 = self2.words[i3] | 0; + var i2 = k2 - j2 | 0; + a3 = self2.words[i2] | 0; b2 = num.words[j2] | 0; r2 = a3 * b2 + rword; ncarry += r2 / 67108864 | 0; @@ -100070,8 +29376,8 @@ bn$1.exports; var rword = carry & 67108863; var maxJ = Math.min(k2, num.length - 1); for (var j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { - var i3 = k2 - j2; - var a3 = self2.words[i3] | 0; + var i2 = k2 - j2; + var a3 = self2.words[i2] | 0; var b2 = num.words[j2] | 0; var r2 = a3 * b2; var lo2 = r2 & 67108863; @@ -100118,8 +29424,8 @@ bn$1.exports; FFTM.prototype.makeRBT = function makeRBT(N2) { var t2 = new Array(N2); var l2 = BN2.prototype._countBits(N2) - 1; - for (var i3 = 0; i3 < N2; i3++) { - t2[i3] = this.revBin(i3, l2, N2); + for (var i2 = 0; i2 < N2; i2++) { + t2[i2] = this.revBin(i2, l2, N2); } return t2; }; @@ -100127,16 +29433,16 @@ bn$1.exports; if (x3 === 0 || x3 === N2 - 1) return x3; var rb2 = 0; - for (var i3 = 0; i3 < l2; i3++) { - rb2 |= (x3 & 1) << l2 - i3 - 1; + for (var i2 = 0; i2 < l2; i2++) { + rb2 |= (x3 & 1) << l2 - i2 - 1; x3 >>= 1; } return rb2; }; FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N2) { - for (var i3 = 0; i3 < N2; i3++) { - rtws[i3] = rws[rbt[i3]]; - itws[i3] = iws[rbt[i3]]; + for (var i2 = 0; i2 < N2; i2++) { + rtws[i2] = rws[rbt[i2]]; + itws[i2] = iws[rbt[i2]]; } }; FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N2, rbt) { @@ -100169,32 +29475,32 @@ bn$1.exports; } } }; - FFTM.prototype.guessLen13b = function guessLen13b(n4, m3) { - var N2 = Math.max(m3, n4) | 1; + FFTM.prototype.guessLen13b = function guessLen13b(n5, m3) { + var N2 = Math.max(m3, n5) | 1; var odd = N2 & 1; - var i3 = 0; + var i2 = 0; for (N2 = N2 / 2 | 0; N2; N2 = N2 >>> 1) { - i3++; + i2++; } - return 1 << i3 + 1 + odd; + return 1 << i2 + 1 + odd; }; FFTM.prototype.conjugate = function conjugate(rws, iws, N2) { if (N2 <= 1) return; - for (var i3 = 0; i3 < N2 / 2; i3++) { - var t2 = rws[i3]; - rws[i3] = rws[N2 - i3 - 1]; - rws[N2 - i3 - 1] = t2; - t2 = iws[i3]; - iws[i3] = -iws[N2 - i3 - 1]; - iws[N2 - i3 - 1] = -t2; + for (var i2 = 0; i2 < N2 / 2; i2++) { + var t2 = rws[i2]; + rws[i2] = rws[N2 - i2 - 1]; + rws[N2 - i2 - 1] = t2; + t2 = iws[i2]; + iws[i2] = -iws[N2 - i2 - 1]; + iws[N2 - i2 - 1] = -t2; } }; FFTM.prototype.normalize13b = function normalize13b(ws2, N2) { var carry = 0; - for (var i3 = 0; i3 < N2 / 2; i3++) { - var w2 = Math.round(ws2[2 * i3 + 1] / N2) * 8192 + Math.round(ws2[2 * i3] / N2) + carry; - ws2[i3] = w2 & 67108863; + for (var i2 = 0; i2 < N2 / 2; i2++) { + var w2 = Math.round(ws2[2 * i2 + 1] / N2) * 8192 + Math.round(ws2[2 * i2] / N2) + carry; + ws2[i2] = w2 & 67108863; if (w2 < 67108864) { carry = 0; } else { @@ -100205,23 +29511,23 @@ bn$1.exports; }; FFTM.prototype.convert13b = function convert13b(ws2, len, rws, N2) { var carry = 0; - for (var i3 = 0; i3 < len; i3++) { - carry = carry + (ws2[i3] | 0); - rws[2 * i3] = carry & 8191; + for (var i2 = 0; i2 < len; i2++) { + carry = carry + (ws2[i2] | 0); + rws[2 * i2] = carry & 8191; carry = carry >>> 13; - rws[2 * i3 + 1] = carry & 8191; + rws[2 * i2 + 1] = carry & 8191; carry = carry >>> 13; } - for (i3 = 2 * len; i3 < N2; ++i3) { - rws[i3] = 0; + for (i2 = 2 * len; i2 < N2; ++i2) { + rws[i2] = 0; } assert2(carry === 0); assert2((carry & ~8191) === 0); }; FFTM.prototype.stub = function stub(N2) { var ph2 = new Array(N2); - for (var i3 = 0; i3 < N2; i3++) { - ph2[i3] = 0; + for (var i2 = 0; i2 < N2; i2++) { + ph2[i2] = 0; } return ph2; }; @@ -100241,10 +29547,10 @@ bn$1.exports; this.convert13b(y3.words, y3.length, nrws, N2); this.transform(rws, _3, rwst, iwst, N2, rbt); this.transform(nrws, _3, nrwst, niwst, N2, rbt); - for (var i3 = 0; i3 < N2; i3++) { - var rx2 = rwst[i3] * nrwst[i3] - iwst[i3] * niwst[i3]; - iwst[i3] = rwst[i3] * niwst[i3] + iwst[i3] * nrwst[i3]; - rwst[i3] = rx2; + for (var i2 = 0; i2 < N2; i2++) { + var rx2 = rwst[i2] * nrwst[i2] - iwst[i2] * niwst[i2]; + iwst[i2] = rwst[i2] * niwst[i2] + iwst[i2] * nrwst[i2]; + rwst[i2] = rx2; } this.conjugate(rwst, iwst, N2); this.transform(rwst, iwst, rmws, _3, N2, rbt); @@ -100271,16 +29577,16 @@ bn$1.exports; assert2(typeof num === "number"); assert2(num < 67108864); var carry = 0; - for (var i3 = 0; i3 < this.length; i3++) { - var w2 = (this.words[i3] | 0) * num; + for (var i2 = 0; i2 < this.length; i2++) { + var w2 = (this.words[i2] | 0) * num; var lo2 = (w2 & 67108863) + (carry & 67108863); carry >>= 26; carry += w2 / 67108864 | 0; carry += lo2 >>> 26; - this.words[i3] = lo2 & 67108863; + this.words[i2] = lo2 & 67108863; } if (carry !== 0) { - this.words[i3] = carry; + this.words[i2] = carry; this.length++; } return this; @@ -100299,13 +29605,13 @@ bn$1.exports; if (w2.length === 0) return new BN2(1); var res = this; - for (var i3 = 0; i3 < w2.length; i3++, res = res.sqr()) { - if (w2[i3] !== 0) + for (var i2 = 0; i2 < w2.length; i2++, res = res.sqr()) { + if (w2[i2] !== 0) break; } - if (++i3 < w2.length) { - for (var q2 = res.sqr(); i3 < w2.length; i3++, q2 = q2.sqr()) { - if (w2[i3] === 0) + if (++i2 < w2.length) { + for (var q2 = res.sqr(); i2 < w2.length; i2++, q2 = q2.sqr()) { + if (w2[i2] === 0) continue; res = res.mul(q2); } @@ -100317,26 +29623,26 @@ bn$1.exports; var r2 = bits % 26; var s2 = (bits - r2) / 26; var carryMask = 67108863 >>> 26 - r2 << 26 - r2; - var i3; + var i2; if (r2 !== 0) { var carry = 0; - for (i3 = 0; i3 < this.length; i3++) { - var newCarry = this.words[i3] & carryMask; - var c2 = (this.words[i3] | 0) - newCarry << r2; - this.words[i3] = c2 | carry; + for (i2 = 0; i2 < this.length; i2++) { + var newCarry = this.words[i2] & carryMask; + var c2 = (this.words[i2] | 0) - newCarry << r2; + this.words[i2] = c2 | carry; carry = newCarry >>> 26 - r2; } if (carry) { - this.words[i3] = carry; + this.words[i2] = carry; this.length++; } } if (s2 !== 0) { - for (i3 = this.length - 1; i3 >= 0; i3--) { - this.words[i3 + s2] = this.words[i3]; + for (i2 = this.length - 1; i2 >= 0; i2--) { + this.words[i2 + s2] = this.words[i2]; } - for (i3 = 0; i3 < s2; i3++) { - this.words[i3] = 0; + for (i2 = 0; i2 < s2; i2++) { + this.words[i2] = 0; } this.length += s2; } @@ -100361,8 +29667,8 @@ bn$1.exports; h4 -= s2; h4 = Math.max(0, h4); if (maskedWords) { - for (var i3 = 0; i3 < s2; i3++) { - maskedWords.words[i3] = this.words[i3]; + for (var i2 = 0; i2 < s2; i2++) { + maskedWords.words[i2] = this.words[i2]; } maskedWords.length = s2; } @@ -100370,17 +29676,17 @@ bn$1.exports; ; else if (this.length > s2) { this.length -= s2; - for (i3 = 0; i3 < this.length; i3++) { - this.words[i3] = this.words[i3 + s2]; + for (i2 = 0; i2 < this.length; i2++) { + this.words[i2] = this.words[i2 + s2]; } } else { this.words[0] = 0; this.length = 1; } var carry = 0; - for (i3 = this.length - 1; i3 >= 0 && (carry !== 0 || i3 >= h4); i3--) { - var word = this.words[i3] | 0; - this.words[i3] = carry << 26 - r2 | word >>> r2; + for (i2 = this.length - 1; i2 >= 0 && (carry !== 0 || i2 >= h4); i2--) { + var word = this.words[i2] | 0; + this.words[i2] = carry << 26 - r2 | word >>> r2; carry = word & mask2; } if (maskedWords && carry !== 0) { @@ -100459,15 +29765,15 @@ bn$1.exports; }; BN2.prototype._iaddn = function _iaddn(num) { this.words[0] += num; - for (var i3 = 0; i3 < this.length && this.words[i3] >= 67108864; i3++) { - this.words[i3] -= 67108864; - if (i3 === this.length - 1) { - this.words[i3 + 1] = 1; + for (var i2 = 0; i2 < this.length && this.words[i2] >= 67108864; i2++) { + this.words[i2] -= 67108864; + if (i2 === this.length - 1) { + this.words[i2 + 1] = 1; } else { - this.words[i3 + 1]++; + this.words[i2 + 1]++; } } - this.length = Math.max(this.length, i3 + 1); + this.length = Math.max(this.length, i2 + 1); return this; }; BN2.prototype.isubn = function isubn(num) { @@ -100486,9 +29792,9 @@ bn$1.exports; this.words[0] = -this.words[0]; this.negative = 1; } else { - for (var i3 = 0; i3 < this.length && this.words[i3] < 0; i3++) { - this.words[i3] += 67108864; - this.words[i3 + 1] -= 1; + for (var i2 = 0; i2 < this.length && this.words[i2] < 0; i2++) { + this.words[i2] += 67108864; + this.words[i2 + 1] -= 1; } } return this.strip(); @@ -100508,30 +29814,30 @@ bn$1.exports; }; BN2.prototype._ishlnsubmul = function _ishlnsubmul(num, mul6, shift) { var len = num.length + shift; - var i3; + var i2; this._expand(len); var w2; var carry = 0; - for (i3 = 0; i3 < num.length; i3++) { - w2 = (this.words[i3 + shift] | 0) + carry; - var right = (num.words[i3] | 0) * mul6; + for (i2 = 0; i2 < num.length; i2++) { + w2 = (this.words[i2 + shift] | 0) + carry; + var right = (num.words[i2] | 0) * mul6; w2 -= right & 67108863; carry = (w2 >> 26) - (right / 67108864 | 0); - this.words[i3 + shift] = w2 & 67108863; + this.words[i2 + shift] = w2 & 67108863; } - for (; i3 < this.length - shift; i3++) { - w2 = (this.words[i3 + shift] | 0) + carry; + for (; i2 < this.length - shift; i2++) { + w2 = (this.words[i2 + shift] | 0) + carry; carry = w2 >> 26; - this.words[i3 + shift] = w2 & 67108863; + this.words[i2 + shift] = w2 & 67108863; } if (carry === 0) return this.strip(); assert2(carry === -1); carry = 0; - for (i3 = 0; i3 < this.length; i3++) { - w2 = -(this.words[i3] | 0) + carry; + for (i2 = 0; i2 < this.length; i2++) { + w2 = -(this.words[i2] | 0) + carry; carry = w2 >> 26; - this.words[i3] = w2 & 67108863; + this.words[i2] = w2 & 67108863; } this.negative = 1; return this.strip(); @@ -100554,8 +29860,8 @@ bn$1.exports; q2 = new BN2(null); q2.length = m3 + 1; q2.words = new Array(q2.length); - for (var i3 = 0; i3 < q2.length; i3++) { - q2.words[i3] = 0; + for (var i2 = 0; i2 < q2.length; i2++) { + q2.words[i2] = 0; } } var diff = a3.clone()._ishlnsubmul(b2, 1, m3); @@ -100692,17 +29998,17 @@ bn$1.exports; assert2(num <= 67108863); var p3 = (1 << 26) % num; var acc = 0; - for (var i3 = this.length - 1; i3 >= 0; i3--) { - acc = (p3 * acc + (this.words[i3] | 0)) % num; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + acc = (p3 * acc + (this.words[i2] | 0)) % num; } return acc; }; BN2.prototype.idivn = function idivn(num) { assert2(num <= 67108863); var carry = 0; - for (var i3 = this.length - 1; i3 >= 0; i3--) { - var w2 = (this.words[i3] | 0) + carry * 67108864; - this.words[i3] = w2 / num | 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + var w2 = (this.words[i2] | 0) + carry * 67108864; + this.words[i2] = w2 / num | 0; carry = w2 % num; } return this.strip(); @@ -100733,11 +30039,11 @@ bn$1.exports; var yp = y3.clone(); var xp = x3.clone(); while (!x3.isZero()) { - for (var i3 = 0, im = 1; (x3.words[0] & im) === 0 && i3 < 26; ++i3, im <<= 1) + for (var i2 = 0, im = 1; (x3.words[0] & im) === 0 && i2 < 26; ++i2, im <<= 1) ; - if (i3 > 0) { - x3.iushrn(i3); - while (i3-- > 0) { + if (i2 > 0) { + x3.iushrn(i2); + while (i2-- > 0) { if (A2.isOdd() || B2.isOdd()) { A2.iadd(yp); B2.isub(xp); @@ -100789,11 +30095,11 @@ bn$1.exports; var x22 = new BN2(0); var delta = b2.clone(); while (a3.cmpn(1) > 0 && b2.cmpn(1) > 0) { - for (var i3 = 0, im = 1; (a3.words[0] & im) === 0 && i3 < 26; ++i3, im <<= 1) + for (var i2 = 0, im = 1; (a3.words[0] & im) === 0 && i2 < 26; ++i2, im <<= 1) ; - if (i3 > 0) { - a3.iushrn(i3); - while (i3-- > 0) { + if (i2 > 0) { + a3.iushrn(i2); + while (i2-- > 0) { if (x1.isOdd()) { x1.iadd(delta); } @@ -100885,15 +30191,15 @@ bn$1.exports; return this; } var carry = q2; - for (var i3 = s2; carry !== 0 && i3 < this.length; i3++) { - var w2 = this.words[i3] | 0; + for (var i2 = s2; carry !== 0 && i2 < this.length; i2++) { + var w2 = this.words[i2] | 0; w2 += carry; carry = w2 >>> 26; w2 &= 67108863; - this.words[i3] = w2; + this.words[i2] = w2; } if (carry !== 0) { - this.words[i3] = carry; + this.words[i2] = carry; this.length++; } return this; @@ -100939,9 +30245,9 @@ bn$1.exports; if (this.length < num.length) return -1; var res = 0; - for (var i3 = this.length - 1; i3 >= 0; i3--) { - var a3 = this.words[i3] | 0; - var b2 = num.words[i3] | 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + var a3 = this.words[i2] | 0; + var b2 = num.words[i2] | 0; if (a3 === b2) continue; if (a3 < b2) { @@ -101122,8 +30428,8 @@ bn$1.exports; K256.prototype.split = function split2(input, output2) { var mask2 = 4194303; var outLen = Math.min(input.length, 9); - for (var i3 = 0; i3 < outLen; i3++) { - output2.words[i3] = input.words[i3]; + for (var i2 = 0; i2 < outLen; i2++) { + output2.words[i2] = input.words[i2]; } output2.length = outLen; if (input.length <= 9) { @@ -101133,13 +30439,13 @@ bn$1.exports; } var prev = input.words[9]; output2.words[output2.length++] = prev & mask2; - for (i3 = 10; i3 < input.length; i3++) { - var next = input.words[i3] | 0; - input.words[i3 - 10] = (next & mask2) << 4 | prev >>> 22; + for (i2 = 10; i2 < input.length; i2++) { + var next = input.words[i2] | 0; + input.words[i2 - 10] = (next & mask2) << 4 | prev >>> 22; prev = next; } prev >>>= 22; - input.words[i3 - 10] = prev; + input.words[i2 - 10] = prev; if (prev === 0 && input.length > 10) { input.length -= 10; } else { @@ -101151,10 +30457,10 @@ bn$1.exports; num.words[num.length + 1] = 0; num.length += 2; var lo2 = 0; - for (var i3 = 0; i3 < num.length; i3++) { - var w2 = num.words[i3] | 0; + for (var i2 = 0; i2 < num.length; i2++) { + var w2 = num.words[i2] | 0; lo2 += w2 * 977; - num.words[i3] = lo2 & 67108863; + num.words[i2] = lo2 & 67108863; lo2 = w2 * 64 + (lo2 / 67108864 | 0); } if (num.words[num.length - 1] === 0) { @@ -101191,11 +30497,11 @@ bn$1.exports; inherits2(P25519, MPrime); P25519.prototype.imulK = function imulK(num) { var carry = 0; - for (var i3 = 0; i3 < num.length; i3++) { - var hi2 = (num.words[i3] | 0) * 19 + carry; + for (var i2 = 0; i2 < num.length; i2++) { + var hi2 = (num.words[i2] | 0) * 19 + carry; var lo2 = hi2 & 67108863; hi2 >>>= 26; - num.words[i3] = lo2; + num.words[i2] = lo2; carry = hi2; } if (carry !== 0) { @@ -101334,15 +30640,15 @@ bn$1.exports; var m3 = s2; while (t2.cmp(one) !== 0) { var tmp = t2; - for (var i3 = 0; tmp.cmp(one) !== 0; i3++) { + for (var i2 = 0; tmp.cmp(one) !== 0; i2++) { tmp = tmp.redSqr(); } - assert2(i3 < m3); - var b2 = this.pow(c2, new BN2(1).iushln(m3 - i3 - 1)); + assert2(i2 < m3); + var b2 = this.pow(c2, new BN2(1).iushln(m3 - i2 - 1)); r2 = r2.redMul(b2); c2 = b2.redSqr(); t2 = t2.redMul(c2); - m3 = i3; + m3 = i2; } return r2; }; @@ -101364,8 +30670,8 @@ bn$1.exports; var wnd = new Array(1 << windowSize); wnd[0] = new BN2(1).toRed(this); wnd[1] = a3; - for (var i3 = 2; i3 < wnd.length; i3++) { - wnd[i3] = this.mul(wnd[i3 - 1], a3); + for (var i2 = 2; i2 < wnd.length; i2++) { + wnd[i2] = this.mul(wnd[i2 - 1], a3); } var res = wnd[0]; var current = 0; @@ -101374,8 +30680,8 @@ bn$1.exports; if (start === 0) { start = 26; } - for (i3 = num.length - 1; i3 >= 0; i3--) { - var word = num.words[i3]; + for (i2 = num.length - 1; i2 >= 0; i2--) { + var word = num.words[i2]; for (var j2 = start - 1; j2 >= 0; j2--) { var bit = word >> j2 & 1; if (res !== wnd[0]) { @@ -101388,7 +30694,7 @@ bn$1.exports; current <<= 1; current |= bit; currentLen++; - if (currentLen !== windowSize && (i3 !== 0 || j2 !== 0)) + if (currentLen !== windowSize && (i2 !== 0 || j2 !== 0)) continue; res = this.mul(res, wnd[current]); currentLen = 0; @@ -101468,9 +30774,9 @@ bn$1.exports; return res._forceRed(this); }; })(module, commonjsGlobal); -})(bn$1); -var bnExports = bn$1.exports; -var utils$b = {}; +})(bn$2); +var bnExports$1 = bn$2.exports; +var utils$h = {}; (function(exports) { var utils2 = exports; function toArray2(msg, enc) { @@ -101480,19 +30786,19 @@ var utils$b = {}; return []; var res = []; if (typeof msg !== "string") { - for (var i3 = 0; i3 < msg.length; i3++) - res[i3] = msg[i3] | 0; + for (var i2 = 0; i2 < msg.length; i2++) + res[i2] = msg[i2] | 0; return res; } if (enc === "hex") { msg = msg.replace(/[^a-z0-9]+/ig, ""); if (msg.length % 2 !== 0) msg = "0" + msg; - for (var i3 = 0; i3 < msg.length; i3 += 2) - res.push(parseInt(msg[i3] + msg[i3 + 1], 16)); + for (var i2 = 0; i2 < msg.length; i2 += 2) + res.push(parseInt(msg[i2] + msg[i2 + 1], 16)); } else { - for (var i3 = 0; i3 < msg.length; i3++) { - var c2 = msg.charCodeAt(i3); + for (var i2 = 0; i2 < msg.length; i2++) { + var c2 = msg.charCodeAt(i2); var hi2 = c2 >> 8; var lo2 = c2 & 255; if (hi2) @@ -101513,8 +30819,8 @@ var utils$b = {}; utils2.zero2 = zero22; function toHex3(msg) { var res = ""; - for (var i3 = 0; i3 < msg.length; i3++) - res += zero22(msg[i3].toString(16)); + for (var i2 = 0; i2 < msg.length; i2++) + res += zero22(msg[i2].toString(16)); return res; } utils2.toHex = toHex3; @@ -101524,12 +30830,12 @@ var utils$b = {}; else return arr; }; -})(utils$b); +})(utils$h); (function(exports) { var utils2 = exports; - var BN2 = bnExports; + var BN2 = bnExports$1; var minAssert = minimalisticAssert; - var minUtils = utils$b; + var minUtils = utils$h; utils2.assert = minAssert; utils2.toArray = minUtils.toArray; utils2.zero2 = minUtils.zero2; @@ -101537,13 +30843,13 @@ var utils$b = {}; utils2.encode = minUtils.encode; function getNAF2(num, w2, bits) { var naf = new Array(Math.max(num.bitLength(), bits) + 1); - var i3; - for (i3 = 0; i3 < naf.length; i3 += 1) { - naf[i3] = 0; + var i2; + for (i2 = 0; i2 < naf.length; i2 += 1) { + naf[i2] = 0; } var ws2 = 1 << w2 + 1; var k2 = num.clone(); - for (i3 = 0; i3 < naf.length; i3++) { + for (i2 = 0; i2 < naf.length; i2++) { var z3; var mod2 = k2.andln(ws2 - 1); if (k2.isOdd()) { @@ -101555,7 +30861,7 @@ var utils$b = {}; } else { z3 = 0; } - naf[i3] = z3; + naf[i2] = z3; k2.iushrn(1); } return naf; @@ -101625,7 +30931,7 @@ var utils$b = {}; return new BN2(bytes2, "hex", "le"); } utils2.intFromLE = intFromLE; -})(utils$c); +})(utils$i); var brorand = { exports: {} }; var r$1; brorand.exports = function rand(len) { @@ -101640,24 +30946,24 @@ brorand.exports.Rand = Rand; Rand.prototype.generate = function generate(len) { return this._rand(len); }; -Rand.prototype._rand = function _rand(n4) { +Rand.prototype._rand = function _rand(n5) { if (this.rand.getBytes) - return this.rand.getBytes(n4); - var res = new Uint8Array(n4); - for (var i3 = 0; i3 < res.length; i3++) - res[i3] = this.rand.getByte(); + return this.rand.getBytes(n5); + var res = new Uint8Array(n5); + for (var i2 = 0; i2 < res.length; i2++) + res[i2] = this.rand.getByte(); return res; }; if (typeof self === "object") { if (self.crypto && self.crypto.getRandomValues) { - Rand.prototype._rand = function _rand2(n4) { - var arr = new Uint8Array(n4); + Rand.prototype._rand = function _rand2(n5) { + var arr = new Uint8Array(n5); self.crypto.getRandomValues(arr); return arr; }; } else if (self.msCrypto && self.msCrypto.getRandomValues) { - Rand.prototype._rand = function _rand2(n4) { - var arr = new Uint8Array(n4); + Rand.prototype._rand = function _rand2(n5) { + var arr = new Uint8Array(n5); self.msCrypto.getRandomValues(arr); return arr; }; @@ -101668,22 +30974,22 @@ if (typeof self === "object") { } } else { try { - var crypto$2 = require$$3; - if (typeof crypto$2.randomBytes !== "function") + var crypto$6 = require$$3; + if (typeof crypto$6.randomBytes !== "function") throw new Error("Not supported"); - Rand.prototype._rand = function _rand2(n4) { - return crypto$2.randomBytes(n4); + Rand.prototype._rand = function _rand2(n5) { + return crypto$6.randomBytes(n5); }; } catch (e18) { } } var brorandExports = brorand.exports; var curve = {}; -var BN$7 = bnExports; -var utils$a = utils$c; -var getNAF = utils$a.getNAF; -var getJSF = utils$a.getJSF; -var assert$9 = utils$a.assert; +var BN$7 = bnExports$1; +var utils$g = utils$i; +var getNAF = utils$g.getNAF; +var getJSF = utils$g.getJSF; +var assert$c = utils$g.assert; function BaseCurve(type2, conf) { this.type = type2; this.p = new BN$7(conf.p, 16); @@ -101706,15 +31012,15 @@ function BaseCurve(type2, conf) { this.redN = this.n.toRed(this.red); } } -var base = BaseCurve; +var base$3 = BaseCurve; BaseCurve.prototype.point = function point() { throw new Error("Not implemented"); }; -BaseCurve.prototype.validate = function validate2() { +BaseCurve.prototype.validate = function validate() { throw new Error("Not implemented"); }; BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p3, k2) { - assert$9(p3.precomputed); + assert$c(p3.precomputed); var doubles = p3._getDoubles(); var naf = getNAF(k2, 1, this._bitLength); var I2 = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1); @@ -101730,12 +31036,12 @@ BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p3, k2) { } var a3 = this.jpoint(null, null, null); var b2 = this.jpoint(null, null, null); - for (var i3 = I2; i3 > 0; i3--) { + for (var i2 = I2; i2 > 0; i2--) { for (j2 = 0; j2 < repr.length; j2++) { nafW = repr[j2]; - if (nafW === i3) + if (nafW === i2) b2 = b2.mixedAdd(doubles.points[j2]); - else if (nafW === -i3) + else if (nafW === -i2) b2 = b2.mixedAdd(doubles.points[j2].neg()); } a3 = a3.add(b2); @@ -101749,16 +31055,16 @@ BaseCurve.prototype._wnafMul = function _wnafMul(p3, k2) { var wnd = nafPoints.points; var naf = getNAF(k2, w2, this._bitLength); var acc = this.jpoint(null, null, null); - for (var i3 = naf.length - 1; i3 >= 0; i3--) { - for (var l2 = 0; i3 >= 0 && naf[i3] === 0; i3--) + for (var i2 = naf.length - 1; i2 >= 0; i2--) { + for (var l2 = 0; i2 >= 0 && naf[i2] === 0; i2--) l2++; - if (i3 >= 0) + if (i2 >= 0) l2++; acc = acc.dblp(l2); - if (i3 < 0) + if (i2 < 0) break; - var z3 = naf[i3]; - assert$9(z3 !== 0); + var z3 = naf[i2]; + assert$c(z3 !== 0); if (p3.type === "affine") { if (z3 > 0) acc = acc.mixedAdd(wnd[z3 - 1 >> 1]); @@ -101778,18 +31084,18 @@ BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len var wnd = this._wnafT2; var naf = this._wnafT3; var max = 0; - var i3; + var i2; var j2; var p3; - for (i3 = 0; i3 < len; i3++) { - p3 = points[i3]; + for (i2 = 0; i2 < len; i2++) { + p3 = points[i2]; var nafPoints = p3._getNAFPoints(defW); - wndWidth[i3] = nafPoints.wnd; - wnd[i3] = nafPoints.points; + wndWidth[i2] = nafPoints.wnd; + wnd[i2] = nafPoints.points; } - for (i3 = len - 1; i3 >= 1; i3 -= 2) { - var a3 = i3 - 1; - var b2 = i3; + for (i2 = len - 1; i2 >= 1; i2 -= 2) { + var a3 = i2 - 1; + var b2 = i2; if (wndWidth[a3] !== 1 || wndWidth[b2] !== 1) { naf[a3] = getNAF(coeffs[a3], wndWidth[a3], this._bitLength); naf[b2] = getNAF(coeffs[b2], wndWidth[b2], this._bitLength); @@ -101851,24 +31157,24 @@ BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len } var acc = this.jpoint(null, null, null); var tmp = this._wnafT4; - for (i3 = max; i3 >= 0; i3--) { + for (i2 = max; i2 >= 0; i2--) { var k2 = 0; - while (i3 >= 0) { + while (i2 >= 0) { var zero = true; for (j2 = 0; j2 < len; j2++) { - tmp[j2] = naf[j2][i3] | 0; + tmp[j2] = naf[j2][i2] | 0; if (tmp[j2] !== 0) zero = false; } if (!zero) break; k2++; - i3--; + i2--; } - if (i3 >= 0) + if (i2 >= 0) k2++; acc = acc.dblp(k2); - if (i3 < 0) + if (i2 < 0) break; for (j2 = 0; j2 < len; j2++) { var z3 = tmp[j2]; @@ -101884,8 +31190,8 @@ BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len acc = acc.add(p3); } } - for (i3 = 0; i3 < len; i3++) - wnd[i3] = null; + for (i2 = 0; i2 < len; i2++) + wnd[i2] = null; if (jacobianResult) return acc; else @@ -101900,17 +31206,17 @@ BaseCurve.BasePoint = BasePoint; BasePoint.prototype.eq = function eq2() { throw new Error("Not implemented"); }; -BasePoint.prototype.validate = function validate3() { +BasePoint.prototype.validate = function validate2() { return this.curve.validate(this); }; BaseCurve.prototype.decodePoint = function decodePoint(bytes2, enc) { - bytes2 = utils$a.toArray(bytes2, enc); + bytes2 = utils$g.toArray(bytes2, enc); var len = this.p.byteLength(); if ((bytes2[0] === 4 || bytes2[0] === 6 || bytes2[0] === 7) && bytes2.length - 1 === 2 * len) { if (bytes2[0] === 6) - assert$9(bytes2[bytes2.length - 1] % 2 === 0); + assert$c(bytes2[bytes2.length - 1] % 2 === 0); else if (bytes2[0] === 7) - assert$9(bytes2[bytes2.length - 1] % 2 === 1); + assert$c(bytes2[bytes2.length - 1] % 2 === 1); var res = this.point( bytes2.slice(1, 1 + len), bytes2.slice(1 + len, 1 + 2 * len) @@ -101924,15 +31230,15 @@ BaseCurve.prototype.decodePoint = function decodePoint(bytes2, enc) { BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { return this.encode(enc, true); }; -BasePoint.prototype._encode = function _encode2(compact) { +BasePoint.prototype._encode = function _encode(compact) { var len = this.curve.p.byteLength(); var x3 = this.getX().toArray("be", len); if (compact) return [this.getY().isEven() ? 2 : 3].concat(x3); return [4].concat(x3, this.getY().toArray("be", len)); }; -BasePoint.prototype.encode = function encode4(enc, compact) { - return utils$a.encode(this._encode(compact), enc); +BasePoint.prototype.encode = function encode(enc, compact) { + return utils$g.encode(this._encode(compact), enc); }; BasePoint.prototype.precompute = function precompute(power) { if (this.precomputed) @@ -101961,7 +31267,7 @@ BasePoint.prototype._getDoubles = function _getDoubles(step, power) { return this.precomputed.doubles; var doubles = [this]; var acc = this; - for (var i3 = 0; i3 < power; i3 += step) { + for (var i2 = 0; i2 < power; i2 += step) { for (var j2 = 0; j2 < step; j2++) acc = acc.dbl(); doubles.push(acc); @@ -101977,8 +31283,8 @@ BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { var res = [this]; var max = (1 << wnd) - 1; var dbl5 = max === 1 ? null : this.dbl(); - for (var i3 = 1; i3 < max; i3++) - res[i3] = res[i3 - 1].add(dbl5); + for (var i2 = 1; i2 < max; i2++) + res[i2] = res[i2 - 1].add(dbl5); return { wnd, points: res @@ -101989,15 +31295,15 @@ BasePoint.prototype._getBeta = function _getBeta() { }; BasePoint.prototype.dblp = function dblp(k2) { var r2 = this; - for (var i3 = 0; i3 < k2; i3++) + for (var i2 = 0; i2 < k2; i2++) r2 = r2.dbl(); return r2; }; -var utils$9 = utils$c; -var BN$6 = bnExports; -var inherits$2 = inherits_browserExports; -var Base$2 = base; -var assert$8 = utils$9.assert; +var utils$f = utils$i; +var BN$6 = bnExports$1; +var inherits$3 = inherits_browserExports; +var Base$2 = base$3; +var assert$b = utils$f.assert; function ShortCurve(conf) { Base$2.call(this, "short", conf); this.a = new BN$6(conf.a, 16).toRed(this.red); @@ -102009,7 +31315,7 @@ function ShortCurve(conf) { this._endoWnafT1 = new Array(4); this._endoWnafT2 = new Array(4); } -inherits$2(ShortCurve, Base$2); +inherits$3(ShortCurve, Base$2); var short = ShortCurve; ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) @@ -102031,7 +31337,7 @@ ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { lambda = lambdas[0]; } else { lambda = lambdas[1]; - assert$8(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); + assert$b(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); } } var basis; @@ -102075,7 +31381,7 @@ ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { var a22; var b2; var prevR; - var i3 = 0; + var i2 = 0; var r2; var x3; while (u2.cmpn(0) !== 0) { @@ -102088,7 +31394,7 @@ ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { b02 = x1; a1 = r2.neg(); b1 = x3; - } else if (a1 && ++i3 === 2) { + } else if (a1 && ++i2 === 2) { break; } prevR = r2; @@ -102147,7 +31453,7 @@ ShortCurve.prototype.pointFromX = function pointFromX(x3, odd) { y3 = y3.redNeg(); return this.point(x3, y3); }; -ShortCurve.prototype.validate = function validate4(point5) { +ShortCurve.prototype.validate = function validate3(point5) { if (point5.inf) return true; var x3 = point5.x; @@ -102159,9 +31465,9 @@ ShortCurve.prototype.validate = function validate4(point5) { ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) { var npoints = this._endoWnafT1; var ncoeffs = this._endoWnafT2; - for (var i3 = 0; i3 < points.length; i3++) { - var split2 = this._endoSplit(coeffs[i3]); - var p3 = points[i3]; + for (var i2 = 0; i2 < points.length; i2++) { + var split2 = this._endoSplit(coeffs[i2]); + var p3 = points[i2]; var beta = p3._getBeta(); if (split2.k1.negative) { split2.k1.ineg(); @@ -102171,13 +31477,13 @@ ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, split2.k2.ineg(); beta = beta.neg(true); } - npoints[i3 * 2] = p3; - npoints[i3 * 2 + 1] = beta; - ncoeffs[i3 * 2] = split2.k1; - ncoeffs[i3 * 2 + 1] = split2.k2; + npoints[i2 * 2] = p3; + npoints[i2 * 2 + 1] = beta; + ncoeffs[i2 * 2] = split2.k1; + ncoeffs[i2 * 2 + 1] = split2.k2; } - var res = this._wnafMulAdd(1, npoints, ncoeffs, i3 * 2, jacobianResult); - for (var j2 = 0; j2 < i3 * 2; j2++) { + var res = this._wnafMulAdd(1, npoints, ncoeffs, i2 * 2, jacobianResult); + for (var j2 = 0; j2 < i2 * 2; j2++) { npoints[j2] = null; ncoeffs[j2] = null; } @@ -102203,7 +31509,7 @@ function Point$2(curve2, x3, y3, isRed) { this.inf = false; } } -inherits$2(Point$2, Base$2.BasePoint); +inherits$3(Point$2, Base$2.BasePoint); ShortCurve.prototype.point = function point2(x3, y3, isRed) { return new Point$2(this, x3, y3, isRed); }; @@ -102237,7 +31543,7 @@ Point$2.prototype._getBeta = function _getBeta2() { } return beta; }; -Point$2.prototype.toJSON = function toJSON2() { +Point$2.prototype.toJSON = function toJSON() { if (!this.precomputed) return [this.x, this.y]; return [this.x, this.y, this.precomputed && { @@ -102282,7 +31588,7 @@ Point$2.prototype.inspect = function inspect() { Point$2.prototype.isInfinity = function isInfinity() { return this.inf; }; -Point$2.prototype.add = function add2(p3) { +Point$2.prototype.add = function add(p3) { if (this.inf) return p3; if (p3.inf) @@ -102320,7 +31626,7 @@ Point$2.prototype.getX = function getX() { Point$2.prototype.getY = function getY() { return this.y.fromRed(); }; -Point$2.prototype.mul = function mul2(k2) { +Point$2.prototype.mul = function mul(k2) { k2 = new BN$6(k2, 16); if (this.isInfinity()) return this; @@ -102397,7 +31703,7 @@ function JPoint(curve2, x3, y3, z3) { this.z = this.z.toRed(this.curve.red); this.zOne = this.z === this.curve.one; } -inherits$2(JPoint, Base$2.BasePoint); +inherits$3(JPoint, Base$2.BasePoint); ShortCurve.prototype.jpoint = function jpoint(x3, y3, z3) { return new JPoint(this, x3, y3, z3); }; @@ -102413,7 +31719,7 @@ JPoint.prototype.toP = function toP() { JPoint.prototype.neg = function neg2() { return this.curve.jpoint(this.x, this.y.redNeg(), this.z); }; -JPoint.prototype.add = function add3(p3) { +JPoint.prototype.add = function add2(p3) { if (this.isInfinity()) return p3; if (p3.isInfinity()) @@ -102473,10 +31779,10 @@ JPoint.prototype.dblp = function dblp2(pow3) { return this; if (!pow3) return this.dbl(); - var i3; + var i2; if (this.curve.zeroA || this.curve.threeA) { var r2 = this; - for (i3 = 0; i3 < pow3; i3++) + for (i2 = 0; i2 < pow3; i2++) r2 = r2.dbl(); return r2; } @@ -102487,7 +31793,7 @@ JPoint.prototype.dblp = function dblp2(pow3) { var jz = this.z; var jz4 = jz.redSqr().redSqr(); var jyd = jy.redAdd(jy); - for (i3 = 0; i3 < pow3; i3++) { + for (i2 = 0; i2 < pow3; i2++) { var jx2 = jx.redSqr(); var jyd2 = jyd.redSqr(); var jyd4 = jyd2.redSqr(); @@ -102498,7 +31804,7 @@ JPoint.prototype.dblp = function dblp2(pow3) { var dny = c2.redMul(t2); dny = dny.redIAdd(dny).redISub(jyd4); var nz = jyd.redMul(jz); - if (i3 + 1 < pow3) + if (i2 + 1 < pow3) jz4 = jz4.redMul(jyd4); jx = nx; jz = nz; @@ -102541,11 +31847,11 @@ JPoint.prototype._zeroDbl = function _zeroDbl() { var d4 = this.x.redAdd(b2).redSqr().redISub(a3).redISub(c2); d4 = d4.redIAdd(d4); var e18 = a3.redAdd(a3).redIAdd(a3); - var f3 = e18.redSqr(); + var f4 = e18.redSqr(); var c8 = c2.redIAdd(c2); c8 = c8.redIAdd(c8); c8 = c8.redIAdd(c8); - nx = f3.redISub(d4).redISub(d4); + nx = f4.redISub(d4).redISub(d4); ny = e18.redMul(d4.redISub(nx)).redISub(c8); nz = this.y.redMul(this.z); nz = nz.redIAdd(nz); @@ -102643,7 +31949,7 @@ JPoint.prototype.trpl = function trpl() { var nz = this.z.redAdd(e18).redSqr().redISub(zz).redISub(ee2); return this.curve.jpoint(nx, ny, nz); }; -JPoint.prototype.mul = function mul3(k2, kbase) { +JPoint.prototype.mul = function mul2(k2, kbase) { k2 = new BN$6(k2, kbase); return this.curve._wnafMul(this, k2); }; @@ -102684,10 +31990,10 @@ JPoint.prototype.inspect = function inspect2() { JPoint.prototype.isInfinity = function isInfinity2() { return this.z.cmpn(0) === 0; }; -var BN$5 = bnExports; -var inherits$1 = inherits_browserExports; -var Base$1 = base; -var utils$8 = utils$c; +var BN$5 = bnExports$1; +var inherits$2 = inherits_browserExports; +var Base$1 = base$3; +var utils$e = utils$i; function MontCurve(conf) { Base$1.call(this, "mont", conf); this.a = new BN$5(conf.a, 16).toRed(this.red); @@ -102696,9 +32002,9 @@ function MontCurve(conf) { this.two = new BN$5(2).toRed(this.red); this.a24 = this.i4.redMul(this.a.redAdd(this.two)); } -inherits$1(MontCurve, Base$1); +inherits$2(MontCurve, Base$1); var mont = MontCurve; -MontCurve.prototype.validate = function validate5(point5) { +MontCurve.prototype.validate = function validate4(point5) { var x3 = point5.normalize().x; var x22 = x3.redSqr(); var rhs = x22.redMul(x3).redAdd(x22.redMul(this.a)).redAdd(x3); @@ -102719,9 +32025,9 @@ function Point$1(curve2, x3, z3) { this.z = this.z.toRed(this.curve.red); } } -inherits$1(Point$1, Base$1.BasePoint); +inherits$2(Point$1, Base$1.BasePoint); MontCurve.prototype.decodePoint = function decodePoint2(bytes2, enc) { - return this.point(utils$8.toArray(bytes2, enc), 1); + return this.point(utils$e.toArray(bytes2, enc), 1); }; MontCurve.prototype.point = function point3(x3, z3) { return new Point$1(this, x3, z3); @@ -102731,7 +32037,7 @@ MontCurve.prototype.pointFromJSON = function pointFromJSON2(obj) { }; Point$1.prototype.precompute = function precompute2() { }; -Point$1.prototype._encode = function _encode3() { +Point$1.prototype._encode = function _encode2() { return this.getX().toArray("be", this.curve.p.byteLength()); }; Point$1.fromJSON = function fromJSON2(curve2, obj) { @@ -102755,7 +32061,7 @@ Point$1.prototype.dbl = function dbl3() { var nz = c2.redMul(bb2.redAdd(this.curve.a24.redMul(c2))); return this.curve.point(nx, nz); }; -Point$1.prototype.add = function add4() { +Point$1.prototype.add = function add3() { throw new Error("Not supported on Montgomery curve"); }; Point$1.prototype.diffAdd = function diffAdd(p3, diff) { @@ -102769,15 +32075,15 @@ Point$1.prototype.diffAdd = function diffAdd(p3, diff) { var nz = diff.x.redMul(da2.redISub(cb2).redSqr()); return this.curve.point(nx, nz); }; -Point$1.prototype.mul = function mul4(k2) { +Point$1.prototype.mul = function mul3(k2) { var t2 = k2.clone(); var a3 = this; var b2 = this.curve.point(null, null); var c2 = this; for (var bits = []; t2.cmpn(0) !== 0; t2.iushrn(1)) bits.push(t2.andln(1)); - for (var i3 = bits.length - 1; i3 >= 0; i3--) { - if (bits[i3] === 0) { + for (var i2 = bits.length - 1; i2 >= 0; i2--) { + if (bits[i2] === 0) { a3 = a3.diffAdd(b2, c2); b2 = b2.dbl(); } else { @@ -102805,11 +32111,11 @@ Point$1.prototype.getX = function getX2() { this.normalize(); return this.x.fromRed(); }; -var utils$7 = utils$c; -var BN$4 = bnExports; -var inherits = inherits_browserExports; -var Base = base; -var assert$7 = utils$7.assert; +var utils$d = utils$i; +var BN$4 = bnExports$1; +var inherits$1 = inherits_browserExports; +var Base = base$3; +var assert$a = utils$d.assert; function EdwardsCurve(conf) { this.twisted = (conf.a | 0) !== 1; this.mOneA = this.twisted && (conf.a | 0) === -1; @@ -102821,10 +32127,10 @@ function EdwardsCurve(conf) { this.c2 = this.c.redSqr(); this.d = new BN$4(conf.d, 16).toRed(this.red); this.dd = this.d.redAdd(this.d); - assert$7(!this.twisted || this.c.fromRed().cmpn(1) === 0); + assert$a(!this.twisted || this.c.fromRed().cmpn(1) === 0); this.oneC = (conf.c | 0) === 1; } -inherits(EdwardsCurve, Base); +inherits$1(EdwardsCurve, Base); var edwards = EdwardsCurve; EdwardsCurve.prototype._mulA = function _mulA(num) { if (this.mOneA) @@ -102878,7 +32184,7 @@ EdwardsCurve.prototype.pointFromY = function pointFromY(y3, odd) { x3 = x3.redNeg(); return this.point(x3, y3); }; -EdwardsCurve.prototype.validate = function validate6(point5) { +EdwardsCurve.prototype.validate = function validate5(point5) { if (point5.isInfinity()) return true; point5.normalize(); @@ -102917,7 +32223,7 @@ function Point(curve2, x3, y3, z3, t2) { } } } -inherits(Point, Base.BasePoint); +inherits$1(Point, Base.BasePoint); EdwardsCurve.prototype.pointFromJSON = function pointFromJSON3(obj) { return Point.fromJSON(this, obj); }; @@ -102943,12 +32249,12 @@ Point.prototype._extDbl = function _extDbl() { var d4 = this.curve._mulA(a3); var e18 = this.x.redAdd(this.y).redSqr().redISub(a3).redISub(b2); var g3 = d4.redAdd(b2); - var f3 = g3.redSub(c2); + var f4 = g3.redSub(c2); var h4 = d4.redSub(b2); - var nx = e18.redMul(f3); + var nx = e18.redMul(f4); var ny = g3.redMul(h4); var nt2 = e18.redMul(h4); - var nz = f3.redMul(g3); + var nz = f4.redMul(g3); return this.curve.point(nx, ny, nz, nt2); }; Point.prototype._projDbl = function _projDbl() { @@ -102963,17 +32269,17 @@ Point.prototype._projDbl = function _projDbl() { var j2; if (this.curve.twisted) { e18 = this.curve._mulA(c2); - var f3 = e18.redAdd(d4); + var f4 = e18.redAdd(d4); if (this.zOne) { - nx = b2.redSub(c2).redSub(d4).redMul(f3.redSub(this.curve.two)); - ny = f3.redMul(e18.redSub(d4)); - nz = f3.redSqr().redSub(f3).redSub(f3); + nx = b2.redSub(c2).redSub(d4).redMul(f4.redSub(this.curve.two)); + ny = f4.redMul(e18.redSub(d4)); + nz = f4.redSqr().redSub(f4).redSub(f4); } else { h4 = this.z.redSqr(); - j2 = f3.redSub(h4).redISub(h4); + j2 = f4.redSub(h4).redISub(h4); nx = b2.redSub(c2).redISub(d4).redMul(j2); - ny = f3.redMul(e18.redSub(d4)); - nz = f3.redMul(j2); + ny = f4.redMul(e18.redSub(d4)); + nz = f4.redMul(j2); } } else { e18 = c2.redAdd(d4); @@ -102999,13 +32305,13 @@ Point.prototype._extAdd = function _extAdd(p3) { var c2 = this.t.redMul(this.curve.dd).redMul(p3.t); var d4 = this.z.redMul(p3.z.redAdd(p3.z)); var e18 = b2.redSub(a3); - var f3 = d4.redSub(c2); + var f4 = d4.redSub(c2); var g3 = d4.redAdd(c2); var h4 = b2.redAdd(a3); - var nx = e18.redMul(f3); + var nx = e18.redMul(f4); var ny = g3.redMul(h4); var nt2 = e18.redMul(h4); - var nz = f3.redMul(g3); + var nz = f4.redMul(g3); return this.curve.point(nx, ny, nz, nt2); }; Point.prototype._projAdd = function _projAdd(p3) { @@ -103014,22 +32320,22 @@ Point.prototype._projAdd = function _projAdd(p3) { var c2 = this.x.redMul(p3.x); var d4 = this.y.redMul(p3.y); var e18 = this.curve.d.redMul(c2).redMul(d4); - var f3 = b2.redSub(e18); + var f4 = b2.redSub(e18); var g3 = b2.redAdd(e18); var tmp = this.x.redAdd(this.y).redMul(p3.x.redAdd(p3.y)).redISub(c2).redISub(d4); - var nx = a3.redMul(f3).redMul(tmp); + var nx = a3.redMul(f4).redMul(tmp); var ny; var nz; if (this.curve.twisted) { ny = a3.redMul(g3).redMul(d4.redSub(this.curve._mulA(c2))); - nz = f3.redMul(g3); + nz = f4.redMul(g3); } else { ny = a3.redMul(g3).redMul(d4.redSub(c2)); - nz = this.curve._mulC(f3).redMul(g3); + nz = this.curve._mulC(f4).redMul(g3); } return this.curve.point(nx, ny, nz); }; -Point.prototype.add = function add5(p3) { +Point.prototype.add = function add4(p3) { if (this.isInfinity()) return p3; if (p3.isInfinity()) @@ -103039,7 +32345,7 @@ Point.prototype.add = function add5(p3) { else return this._projAdd(p3); }; -Point.prototype.mul = function mul5(k2) { +Point.prototype.mul = function mul4(k2) { if (this._hasDoubles(k2)) return this.curve._fixedNafMul(this, k2); else @@ -103101,19 +32407,19 @@ Point.prototype.toP = Point.prototype.normalize; Point.prototype.mixedAdd = Point.prototype.add; (function(exports) { var curve2 = exports; - curve2.base = base; + curve2.base = base$3; curve2.short = short; curve2.mont = mont; curve2.edwards = edwards; })(curve); var curves$2 = {}; -var secp256k1; +var secp256k1$2; var hasRequiredSecp256k1; function requireSecp256k1() { if (hasRequiredSecp256k1) - return secp256k1; + return secp256k1$2; hasRequiredSecp256k1 = 1; - secp256k1 = { + secp256k1$2 = { doubles: { step: 4, points: [ @@ -103893,13 +33199,13 @@ function requireSecp256k1() { ] } }; - return secp256k1; + return secp256k1$2; } (function(exports) { var curves2 = exports; var hash3 = hash$6; var curve$1 = curve; - var utils2 = utils$c; + var utils2 = utils$i; var assert2 = utils2.assert; function PresetCurve(options) { if (options.type === "short") @@ -104066,9 +33372,9 @@ function requireSecp256k1() { ] }); })(curves$2); -var hash$1 = hash$6; -var utils$6 = utils$b; -var assert$6 = minimalisticAssert; +var hash$3 = hash$6; +var utils$c = utils$h; +var assert$9 = minimalisticAssert; function HmacDRBG$1(options) { if (!(this instanceof HmacDRBG$1)) return new HmacDRBG$1(options); @@ -104080,10 +33386,10 @@ function HmacDRBG$1(options) { this.reseedInterval = null; this.K = null; this.V = null; - var entropy = utils$6.toArray(options.entropy, options.entropyEnc || "hex"); - var nonce = utils$6.toArray(options.nonce, options.nonceEnc || "hex"); - var pers = utils$6.toArray(options.pers, options.persEnc || "hex"); - assert$6( + var entropy = utils$c.toArray(options.entropy, options.entropyEnc || "hex"); + var nonce = utils$c.toArray(options.nonce, options.nonceEnc || "hex"); + var pers = utils$c.toArray(options.pers, options.persEnc || "hex"); + assert$9( entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits" ); @@ -104094,16 +33400,16 @@ HmacDRBG$1.prototype._init = function init2(entropy, nonce, pers) { var seed = entropy.concat(nonce).concat(pers); this.K = new Array(this.outLen / 8); this.V = new Array(this.outLen / 8); - for (var i3 = 0; i3 < this.V.length; i3++) { - this.K[i3] = 0; - this.V[i3] = 1; + for (var i2 = 0; i2 < this.V.length; i2++) { + this.K[i2] = 0; + this.V[i2] = 1; } this._update(seed); this._reseed = 1; this.reseedInterval = 281474976710656; }; -HmacDRBG$1.prototype._hmac = function hmac2() { - return new hash$1.hmac(this.hash, this.K); +HmacDRBG$1.prototype._hmac = function hmac() { + return new hash$3.hmac(this.hash, this.K); }; HmacDRBG$1.prototype._update = function update4(seed) { var kmac = this._hmac().update(this.V).update([0]); @@ -104122,9 +33428,9 @@ HmacDRBG$1.prototype.reseed = function reseed(entropy, entropyEnc, add6, addEnc) add6 = entropyEnc; entropyEnc = null; } - entropy = utils$6.toArray(entropy, entropyEnc); - add6 = utils$6.toArray(add6, addEnc); - assert$6( + entropy = utils$c.toArray(entropy, entropyEnc); + add6 = utils$c.toArray(add6, addEnc); + assert$9( entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits" ); @@ -104140,7 +33446,7 @@ HmacDRBG$1.prototype.generate = function generate2(len, enc, add6, addEnc) { enc = null; } if (add6) { - add6 = utils$6.toArray(add6, addEnc || "hex"); + add6 = utils$c.toArray(add6, addEnc || "hex"); this._update(add6); } var temp = []; @@ -104151,11 +33457,11 @@ HmacDRBG$1.prototype.generate = function generate2(len, enc, add6, addEnc) { var res = temp.slice(0, len); this._update(add6); this._reseed++; - return utils$6.encode(res, enc); + return utils$c.encode(res, enc); }; -var BN$3 = bnExports; -var utils$5 = utils$c; -var assert$5 = utils$5.assert; +var BN$3 = bnExports$1; +var utils$b = utils$i; +var assert$8 = utils$b.assert; function KeyPair$3(ec2, options) { this.ec = ec2; this.priv = null; @@ -104182,7 +33488,7 @@ KeyPair$3.fromPrivate = function fromPrivate(ec2, priv2, enc) { privEnc: enc }); }; -KeyPair$3.prototype.validate = function validate7() { +KeyPair$3.prototype.validate = function validate6() { var pub2 = this.getPublic(); if (pub2.isInfinity()) return { result: false, reason: "Invalid public key" }; @@ -104216,9 +33522,9 @@ KeyPair$3.prototype._importPrivate = function _importPrivate(key2, enc) { KeyPair$3.prototype._importPublic = function _importPublic(key2, enc) { if (key2.x || key2.y) { if (this.ec.curve.type === "mont") { - assert$5(key2.x, "Need x coordinate"); + assert$8(key2.x, "Need x coordinate"); } else if (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") { - assert$5(key2.x && key2.y, "Need both x and y coordinate"); + assert$8(key2.x && key2.y, "Need both x and y coordinate"); } this.pub = this.ec.curve.point(key2.x, key2.y); return; @@ -104227,28 +33533,28 @@ KeyPair$3.prototype._importPublic = function _importPublic(key2, enc) { }; KeyPair$3.prototype.derive = function derive(pub2) { if (!pub2.validate()) { - assert$5(pub2.validate(), "public point not validated"); + assert$8(pub2.validate(), "public point not validated"); } return pub2.mul(this.priv).getX(); }; -KeyPair$3.prototype.sign = function sign2(msg, enc, options) { +KeyPair$3.prototype.sign = function sign(msg, enc, options) { return this.ec.sign(msg, this, enc, options); }; -KeyPair$3.prototype.verify = function verify2(msg, signature2, options) { +KeyPair$3.prototype.verify = function verify(msg, signature2, options) { return this.ec.verify(msg, signature2, this, void 0, options); }; KeyPair$3.prototype.inspect = function inspect5() { return ""; }; -var BN$2 = bnExports; -var utils$4 = utils$c; -var assert$4 = utils$4.assert; -function Signature$3(options, enc) { - if (options instanceof Signature$3) +var BN$2 = bnExports$1; +var utils$a = utils$i; +var assert$7 = utils$a.assert; +function Signature$4(options, enc) { + if (options instanceof Signature$4) return options; if (this._importDER(options, enc)) return; - assert$4(options.r && options.s, "Signature without r or s"); + assert$7(options.r && options.s, "Signature without r or s"); this.r = new BN$2(options.r, 16); this.s = new BN$2(options.s, 16); if (options.recoveryParam === void 0) @@ -104256,11 +33562,11 @@ function Signature$3(options, enc) { else this.recoveryParam = options.recoveryParam; } -var signature$1 = Signature$3; +var signature$2 = Signature$4; function Position() { this.place = 0; } -function getLength5(buf, p3) { +function getLength(buf, p3) { var initial = buf[p3.place++]; if (!(initial & 128)) { return initial; @@ -104273,7 +33579,7 @@ function getLength5(buf, p3) { return false; } var val = 0; - for (var i3 = 0, off = p3.place; i3 < octetLen; i3++, off++) { + for (var i2 = 0, off = p3.place; i2 < octetLen; i2++, off++) { val <<= 8; val |= buf[off]; val >>>= 0; @@ -104285,23 +33591,23 @@ function getLength5(buf, p3) { return val; } function rmPadding(buf) { - var i3 = 0; + var i2 = 0; var len = buf.length - 1; - while (!buf[i3] && !(buf[i3 + 1] & 128) && i3 < len) { - i3++; + while (!buf[i2] && !(buf[i2 + 1] & 128) && i2 < len) { + i2++; } - if (i3 === 0) { + if (i2 === 0) { return buf; } - return buf.slice(i3); + return buf.slice(i2); } -Signature$3.prototype._importDER = function _importDER(data, enc) { - data = utils$4.toArray(data, enc); +Signature$4.prototype._importDER = function _importDER(data, enc) { + data = utils$a.toArray(data, enc); var p3 = new Position(); if (data[p3.place++] !== 48) { return false; } - var len = getLength5(data, p3); + var len = getLength(data, p3); if (len === false) { return false; } @@ -104311,7 +33617,7 @@ Signature$3.prototype._importDER = function _importDER(data, enc) { if (data[p3.place++] !== 2) { return false; } - var rlen = getLength5(data, p3); + var rlen = getLength(data, p3); if (rlen === false) { return false; } @@ -104323,7 +33629,7 @@ Signature$3.prototype._importDER = function _importDER(data, enc) { if (data[p3.place++] !== 2) { return false; } - var slen = getLength5(data, p3); + var slen = getLength(data, p3); if (slen === false) { return false; } @@ -104365,7 +33671,7 @@ function constructLength(arr, len) { } arr.push(len); } -Signature$3.prototype.toDER = function toDER(enc) { +Signature$4.prototype.toDER = function toDER(enc) { var r2 = this.r.toArray(); var s2 = this.s.toArray(); if (r2[0] & 128) @@ -104386,21 +33692,21 @@ Signature$3.prototype.toDER = function toDER(enc) { var res = [48]; constructLength(res, backHalf.length); res = res.concat(backHalf); - return utils$4.encode(res, enc); + return utils$a.encode(res, enc); }; -var BN$1 = bnExports; +var BN$1 = bnExports$1; var HmacDRBG = hmacDrbg; -var utils$3 = utils$c; +var utils$9 = utils$i; var curves$1 = curves$2; var rand2 = brorandExports; -var assert$3 = utils$3.assert; +var assert$6 = utils$9.assert; var KeyPair$2 = key$1; -var Signature$2 = signature$1; -function EC2(options) { - if (!(this instanceof EC2)) - return new EC2(options); +var Signature$3 = signature$2; +function EC(options) { + if (!(this instanceof EC)) + return new EC(options); if (typeof options === "string") { - assert$3( + assert$6( Object.prototype.hasOwnProperty.call(curves$1, options), "Unknown curve " + options ); @@ -104416,17 +33722,17 @@ function EC2(options) { this.g.precompute(options.curve.n.bitLength() + 1); this.hash = options.hash || options.curve.hash; } -var ec = EC2; -EC2.prototype.keyPair = function keyPair(options) { +var ec = EC; +EC.prototype.keyPair = function keyPair(options) { return new KeyPair$2(this, options); }; -EC2.prototype.keyFromPrivate = function keyFromPrivate(priv2, enc) { +EC.prototype.keyFromPrivate = function keyFromPrivate(priv2, enc) { return KeyPair$2.fromPrivate(this, priv2, enc); }; -EC2.prototype.keyFromPublic = function keyFromPublic(pub2, enc) { +EC.prototype.keyFromPublic = function keyFromPublic(pub2, enc) { return KeyPair$2.fromPublic(this, pub2, enc); }; -EC2.prototype.genKeyPair = function genKeyPair(options) { +EC.prototype.genKeyPair = function genKeyPair(options) { if (!options) options = {}; var drbg = new HmacDRBG({ @@ -104447,7 +33753,7 @@ EC2.prototype.genKeyPair = function genKeyPair(options) { return this.keyFromPrivate(priv2); } }; -EC2.prototype._truncateToN = function _truncateToN(msg, truncOnly, bitLength) { +EC.prototype._truncateToN = function _truncateToN(msg, truncOnly, bitLength) { var byteLength2; if (BN$1.isBN(msg) || typeof msg === "number") { msg = new BN$1(msg, 16); @@ -104471,7 +33777,7 @@ EC2.prototype._truncateToN = function _truncateToN(msg, truncOnly, bitLength) { else return msg; }; -EC2.prototype.sign = function sign3(msg, key2, enc, options) { +EC.prototype.sign = function sign2(msg, key2, enc, options) { if (typeof enc === "object") { options = enc; enc = null; @@ -104479,21 +33785,21 @@ EC2.prototype.sign = function sign3(msg, key2, enc, options) { if (!options) options = {}; if (typeof msg !== "string" && typeof msg !== "number" && !BN$1.isBN(msg)) { - assert$3( + assert$6( typeof msg === "object" && msg && typeof msg.length === "number", "Expected message to be an array-like, a hex string, or a BN instance" ); - assert$3(msg.length >>> 0 === msg.length); - for (var i3 = 0; i3 < msg.length; i3++) - assert$3((msg[i3] & 255) === msg[i3]); + assert$6(msg.length >>> 0 === msg.length); + for (var i2 = 0; i2 < msg.length; i2++) + assert$6((msg[i2] & 255) === msg[i2]); } key2 = this.keyFromPrivate(key2, enc); msg = this._truncateToN(msg, false, options.msgBitLength); - assert$3(!msg.isNeg(), "Can not sign a negative message"); + assert$6(!msg.isNeg(), "Can not sign a negative message"); var bytes2 = this.n.byteLength(); var bkey = key2.getPrivate().toArray("be", bytes2); var nonce = msg.toArray("be", bytes2); - assert$3(new BN$1(nonce).eq(msg), "Can not sign message"); + assert$6(new BN$1(nonce).eq(msg), "Can not sign message"); var drbg = new HmacDRBG({ hash: this.hash, entropy: bkey, @@ -104523,15 +33829,15 @@ EC2.prototype.sign = function sign3(msg, key2, enc, options) { s2 = this.n.sub(s2); recoveryParam ^= 1; } - return new Signature$2({ r: r2, s: s2, recoveryParam }); + return new Signature$3({ r: r2, s: s2, recoveryParam }); } }; -EC2.prototype.verify = function verify3(msg, signature2, key2, enc, options) { +EC.prototype.verify = function verify2(msg, signature2, key2, enc, options) { if (!options) options = {}; msg = this._truncateToN(msg, false, options.msgBitLength); key2 = this.keyFromPublic(key2, enc); - signature2 = new Signature$2(signature2, "hex"); + signature2 = new Signature$3(signature2, "hex"); var r2 = signature2.r; var s2 = signature2.s; if (r2.cmpn(1) < 0 || r2.cmp(this.n) >= 0) @@ -104553,10 +33859,10 @@ EC2.prototype.verify = function verify3(msg, signature2, key2, enc, options) { return false; return p3.eqXToP(r2); }; -EC2.prototype.recoverPubKey = function(msg, signature2, j2, enc) { - assert$3((3 & j2) === j2, "The recovery param is more than two bits"); - signature2 = new Signature$2(signature2, enc); - var n4 = this.n; +EC.prototype.recoverPubKey = function(msg, signature2, j2, enc) { + assert$6((3 & j2) === j2, "The recovery param is more than two bits"); + signature2 = new Signature$3(signature2, enc); + var n5 = this.n; var e18 = new BN$1(msg); var r2 = signature2.r; var s2 = signature2.s; @@ -104568,31 +33874,31 @@ EC2.prototype.recoverPubKey = function(msg, signature2, j2, enc) { r2 = this.curve.pointFromX(r2.add(this.curve.n), isYOdd); else r2 = this.curve.pointFromX(r2, isYOdd); - var rInv = signature2.r.invm(n4); - var s1 = n4.sub(e18).mul(rInv).umod(n4); - var s22 = s2.mul(rInv).umod(n4); + var rInv = signature2.r.invm(n5); + var s1 = n5.sub(e18).mul(rInv).umod(n5); + var s22 = s2.mul(rInv).umod(n5); return this.g.mulAdd(s1, r2, s22); }; -EC2.prototype.getKeyRecoveryParam = function(e18, signature2, Q2, enc) { - signature2 = new Signature$2(signature2, enc); +EC.prototype.getKeyRecoveryParam = function(e18, signature2, Q2, enc) { + signature2 = new Signature$3(signature2, enc); if (signature2.recoveryParam !== null) return signature2.recoveryParam; - for (var i3 = 0; i3 < 4; i3++) { + for (var i2 = 0; i2 < 4; i2++) { var Qprime; try { - Qprime = this.recoverPubKey(e18, signature2, i3); + Qprime = this.recoverPubKey(e18, signature2, i2); } catch (e19) { continue; } if (Qprime.eq(Q2)) - return i3; + return i2; } throw new Error("Unable to find valid recovery factor"); }; -var utils$2 = utils$c; -var assert$2 = utils$2.assert; -var parseBytes$2 = utils$2.parseBytes; -var cachedProperty$1 = utils$2.cachedProperty; +var utils$8 = utils$i; +var assert$5 = utils$8.assert; +var parseBytes$2 = utils$8.parseBytes; +var cachedProperty$1 = utils$8.cachedProperty; function KeyPair$1(eddsa2, params) { this.eddsa = eddsa2; this._secret = parseBytes$2(params.secret); @@ -104641,38 +33947,38 @@ cachedProperty$1(KeyPair$1, "hash", function hash() { cachedProperty$1(KeyPair$1, "messagePrefix", function messagePrefix() { return this.hash().slice(this.eddsa.encodingLength); }); -KeyPair$1.prototype.sign = function sign4(message2) { - assert$2(this._secret, "KeyPair can only verify"); +KeyPair$1.prototype.sign = function sign3(message2) { + assert$5(this._secret, "KeyPair can only verify"); return this.eddsa.sign(message2, this); }; -KeyPair$1.prototype.verify = function verify4(message2, sig) { +KeyPair$1.prototype.verify = function verify3(message2, sig) { return this.eddsa.verify(message2, sig, this); }; KeyPair$1.prototype.getSecret = function getSecret(enc) { - assert$2(this._secret, "KeyPair is public only"); - return utils$2.encode(this.secret(), enc); + assert$5(this._secret, "KeyPair is public only"); + return utils$8.encode(this.secret(), enc); }; KeyPair$1.prototype.getPublic = function getPublic2(enc) { - return utils$2.encode(this.pubBytes(), enc); + return utils$8.encode(this.pubBytes(), enc); }; var key = KeyPair$1; -var BN = bnExports; -var utils$1 = utils$c; -var assert$1 = utils$1.assert; -var cachedProperty = utils$1.cachedProperty; -var parseBytes$1 = utils$1.parseBytes; -function Signature$1(eddsa2, sig) { +var BN = bnExports$1; +var utils$7 = utils$i; +var assert$4 = utils$7.assert; +var cachedProperty = utils$7.cachedProperty; +var parseBytes$1 = utils$7.parseBytes; +function Signature$2(eddsa2, sig) { this.eddsa = eddsa2; if (typeof sig !== "object") sig = parseBytes$1(sig); if (Array.isArray(sig)) { - assert$1(sig.length === eddsa2.encodingLength * 2, "Signature has invalid size"); + assert$4(sig.length === eddsa2.encodingLength * 2, "Signature has invalid size"); sig = { R: sig.slice(0, eddsa2.encodingLength), S: sig.slice(eddsa2.encodingLength) }; } - assert$1(sig.R && sig.S, "Signature without R or S"); + assert$4(sig.R && sig.S, "Signature without R or S"); if (eddsa2.isPoint(sig.R)) this._R = sig.R; if (sig.S instanceof BN) @@ -104680,34 +33986,34 @@ function Signature$1(eddsa2, sig) { this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; } -cachedProperty(Signature$1, "S", function S2() { +cachedProperty(Signature$2, "S", function S2() { return this.eddsa.decodeInt(this.Sencoded()); }); -cachedProperty(Signature$1, "R", function R() { +cachedProperty(Signature$2, "R", function R() { return this.eddsa.decodePoint(this.Rencoded()); }); -cachedProperty(Signature$1, "Rencoded", function Rencoded() { +cachedProperty(Signature$2, "Rencoded", function Rencoded() { return this.eddsa.encodePoint(this.R()); }); -cachedProperty(Signature$1, "Sencoded", function Sencoded() { +cachedProperty(Signature$2, "Sencoded", function Sencoded() { return this.eddsa.encodeInt(this.S()); }); -Signature$1.prototype.toBytes = function toBytes2() { +Signature$2.prototype.toBytes = function toBytes() { return this.Rencoded().concat(this.Sencoded()); }; -Signature$1.prototype.toHex = function toHex2() { - return utils$1.encode(this.toBytes(), "hex").toUpperCase(); +Signature$2.prototype.toHex = function toHex() { + return utils$7.encode(this.toBytes(), "hex").toUpperCase(); }; -var signature = Signature$1; -var hash2 = hash$6; +var signature$1 = Signature$2; +var hash$2 = hash$6; var curves = curves$2; -var utils = utils$c; -var assert = utils.assert; -var parseBytes = utils.parseBytes; +var utils$6 = utils$i; +var assert$3 = utils$6.assert; +var parseBytes = utils$6.parseBytes; var KeyPair = key; -var Signature = signature; +var Signature$1 = signature$1; function EDDSA(curve2) { - assert(curve2 === "ed25519", "only tested with ed25519 so far"); + assert$3(curve2 === "ed25519", "only tested with ed25519 so far"); if (!(this instanceof EDDSA)) return new EDDSA(curve2); curve2 = curves[curve2].curve; @@ -104716,10 +34022,10 @@ function EDDSA(curve2) { this.g.precompute(curve2.n.bitLength() + 1); this.pointClass = curve2.point().constructor; this.encodingLength = Math.ceil(curve2.n.bitLength() / 8); - this.hash = hash2.sha512; + this.hash = hash$2.sha512; } var eddsa = EDDSA; -EDDSA.prototype.sign = function sign5(message2, secret2) { +EDDSA.prototype.sign = function sign4(message2, secret2) { message2 = parseBytes(message2); var key2 = this.keyFromSecret(secret2); var r2 = this.hashInt(key2.messagePrefix(), message2); @@ -104729,7 +34035,7 @@ EDDSA.prototype.sign = function sign5(message2, secret2) { var S4 = r2.add(s_).umod(this.curve.n); return this.makeSignature({ R: R3, S: S4, Rencoded: Rencoded2 }); }; -EDDSA.prototype.verify = function verify5(message2, sig, pub2) { +EDDSA.prototype.verify = function verify4(message2, sig, pub2) { message2 = parseBytes(message2); sig = this.makeSignature(sig); if (sig.S().gte(sig.eddsa.curve.n) || sig.S().isNeg()) { @@ -104743,9 +34049,9 @@ EDDSA.prototype.verify = function verify5(message2, sig, pub2) { }; EDDSA.prototype.hashInt = function hashInt() { var hash3 = this.hash(); - for (var i3 = 0; i3 < arguments.length; i3++) - hash3.update(arguments[i3]); - return utils.intFromLE(hash3.digest()).umod(this.curve.n); + for (var i2 = 0; i2 < arguments.length; i2++) + hash3.update(arguments[i2]); + return utils$6.intFromLE(hash3.digest()).umod(this.curve.n); }; EDDSA.prototype.keyFromPublic = function keyFromPublic2(pub2) { return KeyPair.fromPublic(this, pub2); @@ -104754,9 +34060,9 @@ EDDSA.prototype.keyFromSecret = function keyFromSecret(secret2) { return KeyPair.fromSecret(this, secret2); }; EDDSA.prototype.makeSignature = function makeSignature(sig) { - if (sig instanceof Signature) + if (sig instanceof Signature$1) return sig; - return new Signature(this, sig); + return new Signature$1(this, sig); }; EDDSA.prototype.encodePoint = function encodePoint(point5) { var enc = point5.getY().toArray("le", this.encodingLength); @@ -104764,26 +34070,26 @@ EDDSA.prototype.encodePoint = function encodePoint(point5) { return enc; }; EDDSA.prototype.decodePoint = function decodePoint3(bytes2) { - bytes2 = utils.parseBytes(bytes2); + bytes2 = utils$6.parseBytes(bytes2); var lastIx = bytes2.length - 1; var normed = bytes2.slice(0, lastIx).concat(bytes2[lastIx] & ~128); var xIsOdd = (bytes2[lastIx] & 128) !== 0; - var y3 = utils.intFromLE(normed); + var y3 = utils$6.intFromLE(normed); return this.curve.pointFromY(y3, xIsOdd); }; EDDSA.prototype.encodeInt = function encodeInt(num) { return num.toArray("le", this.encodingLength); }; EDDSA.prototype.decodeInt = function decodeInt(bytes2) { - return utils.intFromLE(bytes2); + return utils$6.intFromLE(bytes2); }; EDDSA.prototype.isPoint = function isPoint(val) { return val instanceof this.pointClass; }; (function(exports) { var elliptic2 = exports; - elliptic2.version = require$$0.version; - elliptic2.utils = utils$c; + elliptic2.version = require$$0$1.version; + elliptic2.utils = utils$i; elliptic2.rand = brorandExports; elliptic2.curve = curve; elliptic2.curves = curves$2; @@ -104798,11 +34104,11 @@ function An(e18) { } function Wo(e18, t2 = []) { const r2 = []; - return Object.keys(e18).forEach((i3) => { - if (t2.length && !t2.includes(i3)) + return Object.keys(e18).forEach((i2) => { + if (t2.length && !t2.includes(i2)) return; - const n4 = e18[i3]; - r2.push(...n4.accounts); + const n5 = e18[i2]; + r2.push(...n5.accounts); }), r2; } function Or$1(e18, t2) { @@ -104846,8 +34152,8 @@ function fs$1() { } function Rn$1() { if (We() === qt$1.reactNative && typeof global < "u" && typeof (global == null ? void 0 : global.Platform) < "u") { - const { OS: r2, Version: i3 } = global.Platform; - return [r2, i3].join("-"); + const { OS: r2, Version: i2 } = global.Platform; + return [r2, i2].join("-"); } const e18 = detect(); if (e18 === null) @@ -104861,11 +34167,11 @@ function On$1() { return t2 === qt$1.browser ? [t2, ((e18 = getLocation_1()) == null ? void 0 : e18.host) || "unknown"].join(":") : t2; } function Pn$1(e18, t2, r2) { - const i3 = Rn$1(), n4 = On$1(); - return [[e18, t2].join("-"), [Bn, r2].join("-"), i3, n4].join("/"); + const i2 = Rn$1(), n5 = On$1(); + return [[e18, t2].join("-"), [Bn, r2].join("-"), i2, n5].join("/"); } -function ss({ protocol: e18, version: t2, relayUrl: r2, sdkVersion: i3, auth: n4, projectId: o2, useOnCloseEvent: h4, bundleId: p3 }) { - const A2 = r2.split("?"), v6 = Pn$1(e18, t2, i3), w2 = { auth: n4, ua: v6, projectId: o2, useOnCloseEvent: h4 || void 0, origin: p3 || void 0 }, y3 = Cn$1(A2[1] || "", w2); +function ss({ protocol: e18, version: t2, relayUrl: r2, sdkVersion: i2, auth: n5, projectId: o2, useOnCloseEvent: h4, bundleId: p3 }) { + const A2 = r2.split("?"), v6 = Pn$1(e18, t2, i2), w2 = { auth: n5, ua: v6, projectId: o2, useOnCloseEvent: h4 || void 0, origin: p3 || void 0 }, y3 = Cn$1(A2[1] || "", w2); return A2[0] + "?" + y3; } function _e$2(e18, t2) { @@ -104879,25 +34185,25 @@ function ls(e18) { } function gs(e18 = cjs$3.FIVE_MINUTES, t2) { const r2 = cjs$3.toMiliseconds(e18 || cjs$3.FIVE_MINUTES); - let i3, n4, o2; + let i2, n5, o2; return { resolve: (h4) => { - o2 && i3 && (clearTimeout(o2), i3(h4)); + o2 && i2 && (clearTimeout(o2), i2(h4)); }, reject: (h4) => { - o2 && n4 && (clearTimeout(o2), n4(h4)); + o2 && n5 && (clearTimeout(o2), n5(h4)); }, done: () => new Promise((h4, p3) => { o2 = setTimeout(() => { p3(new Error(t2)); - }, r2), i3 = h4, n4 = p3; + }, r2), i2 = h4, n5 = p3; }) }; } function ms$1(e18, t2, r2) { - return new Promise(async (i3, n4) => { - const o2 = setTimeout(() => n4(new Error(r2)), t2); + return new Promise(async (i2, n5) => { + const o2 = setTimeout(() => n5(new Error(r2)), t2); try { const h4 = await e18; - i3(h4); + i2(h4); } catch (h4) { - n4(h4); + n5(h4); } clearTimeout(o2); }); @@ -104923,14 +34229,14 @@ function bs$1(e18) { return yi$1("id", e18); } function ys$1(e18) { - const [t2, r2] = e18.split(":"), i3 = { id: void 0, topic: void 0 }; + const [t2, r2] = e18.split(":"), i2 = { id: void 0, topic: void 0 }; if (t2 === "topic" && typeof r2 == "string") - i3.topic = r2; + i2.topic = r2; else if (t2 === "id" && Number.isInteger(Number(r2))) - i3.id = Number(r2); + i2.id = Number(r2); else throw new Error(`Invalid target, expected id:number or topic:string, got ${t2}:${r2}`); - return i3; + return i2; } function ws$1(e18, t2) { return cjs$3.fromMiliseconds((t2 || Date.now()) + cjs$3.toMiliseconds(e18)); @@ -104945,36 +34251,36 @@ function me$1(e18 = [], t2 = []) { return [.../* @__PURE__ */ new Set([...e18, ...t2])]; } async function Es$1({ id: e18, topic: t2, wcDeepLink: r2 }) { - var i3; + var i2; try { if (!r2) return; - const n4 = typeof r2 == "string" ? JSON.parse(r2) : r2, o2 = n4 == null ? void 0 : n4.href; + const n5 = typeof r2 == "string" ? JSON.parse(r2) : r2, o2 = n5 == null ? void 0 : n5.href; if (typeof o2 != "string") return; const h4 = Un(o2, e18, t2), p3 = We(); if (p3 === qt$1.browser) { - if (!((i3 = getDocument_1()) != null && i3.hasFocus())) { + if (!((i2 = getDocument_1()) != null && i2.hasFocus())) { console.warn("Document does not have focus, skipping deeplink."); return; } h4.startsWith("https://") || h4.startsWith("http://") ? window.open(h4, "_blank", "noreferrer noopener") : window.open(h4, kn() ? "_blank" : "_self", "noreferrer noopener"); } else p3 === qt$1.reactNative && typeof (global == null ? void 0 : global.Linking) < "u" && await global.Linking.openURL(h4); - } catch (n4) { - console.error(n4); + } catch (n5) { + console.error(n5); } } function Un(e18, t2, r2) { - const i3 = `requestId=${t2}&sessionTopic=${r2}`; + const i2 = `requestId=${t2}&sessionTopic=${r2}`; e18.endsWith("/") && (e18 = e18.slice(0, -1)); - let n4 = `${e18}`; + let n5 = `${e18}`; if (e18.startsWith("https://t.me")) { const o2 = e18.includes("?") ? "&startapp=" : "?startapp="; - n4 = `${n4}${o2}${qn(i3, true)}`; + n5 = `${n5}${o2}${qn(i2, true)}`; } else - n4 = `${n4}/wc?${i3}`; - return n4; + n5 = `${n5}/wc?${i2}`; + return n5; } async function Ss$2(e18, t2) { let r2 = ""; @@ -104982,16 +34288,16 @@ async function Ss$2(e18, t2) { if (gr$1() && (r2 = localStorage.getItem(t2), r2)) return r2; r2 = await e18.getItem(t2); - } catch (i3) { - console.error(i3); + } catch (i2) { + console.error(i2); } return r2; } function Is$2(e18, t2) { if (!e18.includes(t2)) return null; - const r2 = e18.split(/([&,?,=])/), i3 = r2.indexOf(t2); - return r2[i3 + 2]; + const r2 = e18.split(/([&,?,=])/), i2 = r2.indexOf(t2); + return r2[i2 + 2]; } function Ns$1() { return typeof crypto < "u" && crypto != null && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu, (e18) => { @@ -105022,10 +34328,10 @@ function Bs$1(e18) { r2.prototype = t2.prototype; } else r2 = {}; - return Object.defineProperty(r2, "__esModule", { value: true }), Object.keys(e18).forEach(function(i3) { - var n4 = Object.getOwnPropertyDescriptor(e18, i3); - Object.defineProperty(r2, i3, n4.get ? n4 : { enumerable: true, get: function() { - return e18[i3]; + return Object.defineProperty(r2, "__esModule", { value: true }), Object.keys(e18).forEach(function(i2) { + var n5 = Object.getOwnPropertyDescriptor(e18, i2); + Object.defineProperty(r2, i2, n5.get ? n5 : { enumerable: true, get: function() { + return e18[i2]; } }); }), r2; } @@ -105040,14 +34346,14 @@ var Hn = { exports: {} }; */ (function(e18) { (function() { - var t2 = "input is invalid type", r2 = "finalize already called", i3 = typeof window == "object", n4 = i3 ? window : {}; - n4.JS_SHA3_NO_WINDOW && (i3 = false); - var o2 = !i3 && typeof self == "object", h4 = !n4.JS_SHA3_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node; - h4 ? n4 = Kn : o2 && (n4 = self); - var p3 = !n4.JS_SHA3_NO_COMMON_JS && true && e18.exports, A2 = !n4.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", v6 = "0123456789abcdef".split(""), w2 = [31, 7936, 2031616, 520093696], y3 = [4, 1024, 262144, 67108864], S4 = [1, 256, 65536, 16777216], N2 = [6, 1536, 393216, 100663296], I2 = [0, 8, 16, 24], C3 = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648], D2 = [224, 256, 384, 512], U5 = [128, 256], J2 = ["hex", "buffer", "arrayBuffer", "array", "digest"], Bt2 = { 128: 168, 256: 136 }; - (n4.JS_SHA3_NO_NODE_JS || !Array.isArray) && (Array.isArray = function(u2) { + var t2 = "input is invalid type", r2 = "finalize already called", i2 = typeof window == "object", n5 = i2 ? window : {}; + n5.JS_SHA3_NO_WINDOW && (i2 = false); + var o2 = !i2 && typeof self == "object", h4 = !n5.JS_SHA3_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node; + h4 ? n5 = Kn : o2 && (n5 = self); + var p3 = !n5.JS_SHA3_NO_COMMON_JS && true && e18.exports, A2 = !n5.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", v6 = "0123456789abcdef".split(""), w2 = [31, 7936, 2031616, 520093696], y3 = [4, 1024, 262144, 67108864], S4 = [1, 256, 65536, 16777216], N2 = [6, 1536, 393216, 100663296], I2 = [0, 8, 16, 24], C3 = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648], D2 = [224, 256, 384, 512], U5 = [128, 256], J2 = ["hex", "buffer", "arrayBuffer", "array", "digest"], Bt2 = { 128: 168, 256: 136 }; + (n5.JS_SHA3_NO_NODE_JS || !Array.isArray) && (Array.isArray = function(u2) { return Object.prototype.toString.call(u2) === "[object Array]"; - }), A2 && (n4.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) && (ArrayBuffer.isView = function(u2) { + }), A2 && (n5.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) && (ArrayBuffer.isView = function(u2) { return typeof u2 == "object" && u2.buffer && u2.buffer.constructor === ArrayBuffer; }); for (var G2 = function(u2, E2, _3) { @@ -105060,11 +34366,11 @@ var Hn = { exports: {} }; }; }, L4 = function(u2, E2, _3) { return function(B2, R3, F2, P2) { - return f3["cshake" + u2].update(B2, R3, F2, P2)[_3](); + return f4["cshake" + u2].update(B2, R3, F2, P2)[_3](); }; }, Pt2 = function(u2, E2, _3) { return function(B2, R3, F2, P2) { - return f3["kmac" + u2].update(B2, R3, F2, P2)[_3](); + return f4["kmac" + u2].update(B2, R3, F2, P2)[_3](); }; }, W2 = function(u2, E2, _3, B2) { for (var R3 = 0; R3 < J2.length; ++R3) { @@ -105089,7 +34395,7 @@ var Hn = { exports: {} }; }, Y2 = function(u2, E2) { var _3 = Bt2[u2], B2 = L4(u2, E2, "hex"); return B2.create = function(R3, F2, P2) { - return !F2 && !P2 ? f3["shake" + u2].create(R3) : new s2(u2, E2, R3).bytepad([F2, P2], _3); + return !F2 && !P2 ? f4["shake" + u2].create(R3) : new s2(u2, E2, R3).bytepad([F2, P2], _3); }, B2.update = function(R3, F2, P2, O3) { return B2.create(F2, P2, O3).update(R3); }, W2(B2, L4, u2, E2); @@ -105100,12 +34406,12 @@ var Hn = { exports: {} }; }, B2.update = function(R3, F2, P2, O3) { return B2.create(R3, P2, O3).update(F2); }, W2(B2, Pt2, u2, E2); - }, b2 = [{ name: "keccak", padding: S4, bits: D2, createMethod: Rt2 }, { name: "sha3", padding: N2, bits: D2, createMethod: Rt2 }, { name: "shake", padding: w2, bits: U5, createMethod: Vt2 }, { name: "cshake", padding: y3, bits: U5, createMethod: Y2 }, { name: "kmac", padding: y3, bits: U5, createMethod: Wt2 }], f3 = {}, a3 = [], c2 = 0; c2 < b2.length; ++c2) + }, b2 = [{ name: "keccak", padding: S4, bits: D2, createMethod: Rt2 }, { name: "sha3", padding: N2, bits: D2, createMethod: Rt2 }, { name: "shake", padding: w2, bits: U5, createMethod: Vt2 }, { name: "cshake", padding: y3, bits: U5, createMethod: Y2 }, { name: "kmac", padding: y3, bits: U5, createMethod: Wt2 }], f4 = {}, a3 = [], c2 = 0; c2 < b2.length; ++c2) for (var d4 = b2[c2], m3 = d4.bits, x3 = 0; x3 < m3.length; ++x3) { var M3 = d4.name + "_" + m3[x3]; - if (a3.push(M3), f3[M3] = d4.createMethod(m3[x3], d4.padding), d4.name !== "sha3") { + if (a3.push(M3), f4[M3] = d4.createMethod(m3[x3], d4.padding), d4.name !== "sha3") { var l2 = d4.name + m3[x3]; - a3.push(l2), f3[l2] = f3[M3]; + a3.push(l2), f4[l2] = f4[M3]; } } function s2(u2, E2, _3) { @@ -105230,10 +34536,10 @@ var Hn = { exports: {} }; R3 = u2[0] ^ u2[10] ^ u2[20] ^ u2[30] ^ u2[40], F2 = u2[1] ^ u2[11] ^ u2[21] ^ u2[31] ^ u2[41], P2 = u2[2] ^ u2[12] ^ u2[22] ^ u2[32] ^ u2[42], O3 = u2[3] ^ u2[13] ^ u2[23] ^ u2[33] ^ u2[43], Ct2 = u2[4] ^ u2[14] ^ u2[24] ^ u2[34] ^ u2[44], T9 = u2[5] ^ u2[15] ^ u2[25] ^ u2[35] ^ u2[45], q2 = u2[6] ^ u2[16] ^ u2[26] ^ u2[36] ^ u2[46], Te2 = u2[7] ^ u2[17] ^ u2[27] ^ u2[37] ^ u2[47], X2 = u2[8] ^ u2[18] ^ u2[28] ^ u2[38] ^ u2[48], $ = u2[9] ^ u2[19] ^ u2[29] ^ u2[39] ^ u2[49], E2 = X2 ^ (P2 << 1 | O3 >>> 31), _3 = $ ^ (O3 << 1 | P2 >>> 31), u2[0] ^= E2, u2[1] ^= _3, u2[10] ^= E2, u2[11] ^= _3, u2[20] ^= E2, u2[21] ^= _3, u2[30] ^= E2, u2[31] ^= _3, u2[40] ^= E2, u2[41] ^= _3, E2 = R3 ^ (Ct2 << 1 | T9 >>> 31), _3 = F2 ^ (T9 << 1 | Ct2 >>> 31), u2[2] ^= E2, u2[3] ^= _3, u2[12] ^= E2, u2[13] ^= _3, u2[22] ^= E2, u2[23] ^= _3, u2[32] ^= E2, u2[33] ^= _3, u2[42] ^= E2, u2[43] ^= _3, E2 = P2 ^ (q2 << 1 | Te2 >>> 31), _3 = O3 ^ (Te2 << 1 | q2 >>> 31), u2[4] ^= E2, u2[5] ^= _3, u2[14] ^= E2, u2[15] ^= _3, u2[24] ^= E2, u2[25] ^= _3, u2[34] ^= E2, u2[35] ^= _3, u2[44] ^= E2, u2[45] ^= _3, E2 = Ct2 ^ (X2 << 1 | $ >>> 31), _3 = T9 ^ ($ << 1 | X2 >>> 31), u2[6] ^= E2, u2[7] ^= _3, u2[16] ^= E2, u2[17] ^= _3, u2[26] ^= E2, u2[27] ^= _3, u2[36] ^= E2, u2[37] ^= _3, u2[46] ^= E2, u2[47] ^= _3, E2 = q2 ^ (R3 << 1 | F2 >>> 31), _3 = Te2 ^ (F2 << 1 | R3 >>> 31), u2[8] ^= E2, u2[9] ^= _3, u2[18] ^= E2, u2[19] ^= _3, u2[28] ^= E2, u2[29] ^= _3, u2[38] ^= E2, u2[39] ^= _3, u2[48] ^= E2, u2[49] ^= _3, De2 = u2[0], Z2 = u2[1], yt2 = u2[11] << 4 | u2[10] >>> 28, Je2 = u2[10] << 4 | u2[11] >>> 28, at2 = u2[20] << 3 | u2[21] >>> 29, Ke2 = u2[21] << 3 | u2[20] >>> 29, Ee2 = u2[31] << 9 | u2[30] >>> 23, Se2 = u2[30] << 9 | u2[31] >>> 23, mt2 = u2[40] << 18 | u2[41] >>> 14, At2 = u2[41] << 18 | u2[40] >>> 14, lt2 = u2[2] << 1 | u2[3] >>> 31, Le2 = u2[3] << 1 | u2[2] >>> 31, tt2 = u2[13] << 12 | u2[12] >>> 20, Fe2 = u2[12] << 12 | u2[13] >>> 20, wt2 = u2[22] << 10 | u2[23] >>> 22, xt2 = u2[23] << 10 | u2[22] >>> 22, ut2 = u2[33] << 13 | u2[32] >>> 19, ht2 = u2[32] << 13 | u2[33] >>> 19, Ie2 = u2[42] << 2 | u2[43] >>> 30, Ne2 = u2[43] << 2 | u2[42] >>> 30, St2 = u2[5] << 30 | u2[4] >>> 2, It2 = u2[4] << 30 | u2[5] >>> 2, dt2 = u2[14] << 6 | u2[15] >>> 26, pt2 = u2[15] << 6 | u2[14] >>> 26, et2 = u2[25] << 11 | u2[24] >>> 21, rt2 = u2[24] << 11 | u2[25] >>> 21, Ge2 = u2[34] << 15 | u2[35] >>> 17, Mt2 = u2[35] << 15 | u2[34] >>> 17, He2 = u2[45] << 29 | u2[44] >>> 3, ct2 = u2[44] << 29 | u2[45] >>> 3, ft2 = u2[6] << 28 | u2[7] >>> 4, ot2 = u2[7] << 28 | u2[6] >>> 4, Ve2 = u2[17] << 23 | u2[16] >>> 9, Nt2 = u2[16] << 23 | u2[17] >>> 9, ze2 = u2[26] << 25 | u2[27] >>> 7, vt2 = u2[27] << 25 | u2[26] >>> 7, Ue2 = u2[36] << 21 | u2[37] >>> 11, it2 = u2[37] << 21 | u2[36] >>> 11, Et2 = u2[47] << 24 | u2[46] >>> 8, Ye2 = u2[46] << 24 | u2[47] >>> 8, Qe2 = u2[8] << 27 | u2[9] >>> 5, bt2 = u2[9] << 27 | u2[8] >>> 5, qe2 = u2[18] << 20 | u2[19] >>> 12, st2 = u2[19] << 20 | u2[18] >>> 12, _t2 = u2[29] << 7 | u2[28] >>> 25, Me2 = u2[28] << 7 | u2[29] >>> 25, gt2 = u2[38] << 8 | u2[39] >>> 24, je2 = u2[39] << 8 | u2[38] >>> 24, nt2 = u2[48] << 14 | u2[49] >>> 18, ke2 = u2[49] << 14 | u2[48] >>> 18, u2[0] = De2 ^ ~tt2 & et2, u2[1] = Z2 ^ ~Fe2 & rt2, u2[10] = ft2 ^ ~qe2 & at2, u2[11] = ot2 ^ ~st2 & Ke2, u2[20] = lt2 ^ ~dt2 & ze2, u2[21] = Le2 ^ ~pt2 & vt2, u2[30] = Qe2 ^ ~yt2 & wt2, u2[31] = bt2 ^ ~Je2 & xt2, u2[40] = St2 ^ ~Ve2 & _t2, u2[41] = It2 ^ ~Nt2 & Me2, u2[2] = tt2 ^ ~et2 & Ue2, u2[3] = Fe2 ^ ~rt2 & it2, u2[12] = qe2 ^ ~at2 & ut2, u2[13] = st2 ^ ~Ke2 & ht2, u2[22] = dt2 ^ ~ze2 & gt2, u2[23] = pt2 ^ ~vt2 & je2, u2[32] = yt2 ^ ~wt2 & Ge2, u2[33] = Je2 ^ ~xt2 & Mt2, u2[42] = Ve2 ^ ~_t2 & Ee2, u2[43] = Nt2 ^ ~Me2 & Se2, u2[4] = et2 ^ ~Ue2 & nt2, u2[5] = rt2 ^ ~it2 & ke2, u2[14] = at2 ^ ~ut2 & He2, u2[15] = Ke2 ^ ~ht2 & ct2, u2[24] = ze2 ^ ~gt2 & mt2, u2[25] = vt2 ^ ~je2 & At2, u2[34] = wt2 ^ ~Ge2 & Et2, u2[35] = xt2 ^ ~Mt2 & Ye2, u2[44] = _t2 ^ ~Ee2 & Ie2, u2[45] = Me2 ^ ~Se2 & Ne2, u2[6] = Ue2 ^ ~nt2 & De2, u2[7] = it2 ^ ~ke2 & Z2, u2[16] = ut2 ^ ~He2 & ft2, u2[17] = ht2 ^ ~ct2 & ot2, u2[26] = gt2 ^ ~mt2 & lt2, u2[27] = je2 ^ ~At2 & Le2, u2[36] = Ge2 ^ ~Et2 & Qe2, u2[37] = Mt2 ^ ~Ye2 & bt2, u2[46] = Ee2 ^ ~Ie2 & St2, u2[47] = Se2 ^ ~Ne2 & It2, u2[8] = nt2 ^ ~De2 & tt2, u2[9] = ke2 ^ ~Z2 & Fe2, u2[18] = He2 ^ ~ft2 & qe2, u2[19] = ct2 ^ ~ot2 & st2, u2[28] = mt2 ^ ~lt2 & dt2, u2[29] = At2 ^ ~Le2 & pt2, u2[38] = Et2 ^ ~Qe2 & yt2, u2[39] = Ye2 ^ ~bt2 & Je2, u2[48] = Ie2 ^ ~St2 & Ve2, u2[49] = Ne2 ^ ~It2 & Nt2, u2[0] ^= C3[B2], u2[1] ^= C3[B2 + 1]; }; if (p3) - e18.exports = f3; + e18.exports = f4; else for (c2 = 0; c2 < a3.length; ++c2) - n4[a3[c2]] = f3[a3[c2]]; + n5[a3[c2]] = f4[a3[c2]]; })(); })(Hn); var Cs$1 = Hn.exports; @@ -105275,8 +34581,8 @@ let z$2 = class z { Object.defineProperty(this, "version", { enumerable: true, value: t2, writable: false }); } _log(t2, r2) { - const i3 = t2.toLowerCase(); - Tr$1[i3] == null && this.throwArgumentError("invalid log level name", "logLevel", t2), !(jn > Tr$1[i3]) && console.log.apply(console, r2); + const i2 = t2.toLowerCase(); + Tr$1[i2] == null && this.throwArgumentError("invalid log level name", "logLevel", t2), !(jn > Tr$1[i2]) && console.log.apply(console, r2); } debug(...t2) { this._log(z.levels.DEBUG, t2); @@ -105287,25 +34593,25 @@ let z$2 = class z { warn(...t2) { this._log(z.levels.WARNING, t2); } - makeError(t2, r2, i3) { + makeError(t2, r2, i2) { if (zn) return this.makeError("censored error", r2, {}); - r2 || (r2 = z.errors.UNKNOWN_ERROR), i3 || (i3 = {}); - const n4 = []; - Object.keys(i3).forEach((A2) => { - const v6 = i3[A2]; + r2 || (r2 = z.errors.UNKNOWN_ERROR), i2 || (i2 = {}); + const n5 = []; + Object.keys(i2).forEach((A2) => { + const v6 = i2[A2]; try { if (v6 instanceof Uint8Array) { let w2 = ""; for (let y3 = 0; y3 < v6.length; y3++) w2 += Jn[v6[y3] >> 4], w2 += Jn[v6[y3] & 15]; - n4.push(A2 + "=Uint8Array(0x" + w2 + ")"); + n5.push(A2 + "=Uint8Array(0x" + w2 + ")"); } else - n4.push(A2 + "=" + JSON.stringify(v6)); + n5.push(A2 + "=" + JSON.stringify(v6)); } catch { - n4.push(A2 + "=" + JSON.stringify(i3[A2].toString())); + n5.push(A2 + "=" + JSON.stringify(i2[A2].toString())); } - }), n4.push(`code=${r2}`), n4.push(`version=${this.version}`); + }), n5.push(`code=${r2}`), n5.push(`version=${this.version}`); const o2 = t2; let h4 = ""; switch (r2) { @@ -105338,23 +34644,23 @@ let z$2 = class z { h4 = r2; break; } - h4 && (t2 += " [ See: https://links.ethers.org/v5-errors-" + h4 + " ]"), n4.length && (t2 += " (" + n4.join(", ") + ")"); + h4 && (t2 += " [ See: https://links.ethers.org/v5-errors-" + h4 + " ]"), n5.length && (t2 += " (" + n5.join(", ") + ")"); const p3 = new Error(t2); - return p3.reason = o2, p3.code = r2, Object.keys(i3).forEach(function(A2) { - p3[A2] = i3[A2]; + return p3.reason = o2, p3.code = r2, Object.keys(i2).forEach(function(A2) { + p3[A2] = i2[A2]; }), p3; } - throwError(t2, r2, i3) { - throw this.makeError(t2, r2, i3); + throwError(t2, r2, i2) { + throw this.makeError(t2, r2, i2); } - throwArgumentError(t2, r2, i3) { - return this.throwError(t2, z.errors.INVALID_ARGUMENT, { argument: r2, value: i3 }); + throwArgumentError(t2, r2, i2) { + return this.throwError(t2, z.errors.INVALID_ARGUMENT, { argument: r2, value: i2 }); } - assert(t2, r2, i3, n4) { - t2 || this.throwError(r2, i3, n4); + assert(t2, r2, i2, n5) { + t2 || this.throwError(r2, i2, n5); } - assertArgument(t2, r2, i3, n4) { - t2 || this.throwArgumentError(r2, i3, n4); + assertArgument(t2, r2, i2, n5) { + t2 || this.throwArgumentError(r2, i2, n5); } checkNormalize(t2) { Qn && this.throwError("platform missing String.prototype.normalize", z.errors.UNSUPPORTED_OPERATION, { operation: "String.prototype.normalize", form: Qn }); @@ -105362,8 +34668,8 @@ let z$2 = class z { checkSafeUint53(t2, r2) { typeof t2 == "number" && (r2 == null && (r2 = "value not safe"), (t2 < 0 || t2 >= 9007199254740991) && this.throwError(r2, z.errors.NUMERIC_FAULT, { operation: "checkSafeInteger", fault: "out-of-safe-range", value: t2 }), t2 % 1 && this.throwError(r2, z.errors.NUMERIC_FAULT, { operation: "checkSafeInteger", fault: "non-integer", value: t2 })); } - checkArgumentCount(t2, r2, i3) { - i3 ? i3 = ": " + i3 : i3 = "", t2 < r2 && this.throwError("missing argument" + i3, z.errors.MISSING_ARGUMENT, { count: t2, expectedCount: r2 }), t2 > r2 && this.throwError("too many arguments" + i3, z.errors.UNEXPECTED_ARGUMENT, { count: t2, expectedCount: r2 }); + checkArgumentCount(t2, r2, i2) { + i2 ? i2 = ": " + i2 : i2 = "", t2 < r2 && this.throwError("missing argument" + i2, z.errors.MISSING_ARGUMENT, { count: t2, expectedCount: r2 }), t2 > r2 && this.throwError("too many arguments" + i2, z.errors.UNEXPECTED_ARGUMENT, { count: t2, expectedCount: r2 }); } checkNew(t2, r2) { (t2 === Object || t2 == null) && this.throwError("missing new", z.errors.MISSING_NEW, { name: r2.name }); @@ -105436,16 +34742,16 @@ function Ot$1(e18, t2) { if (t2.allowMissingPrefix && typeof e18 == "string" && e18.substring(0, 2) !== "0x" && (e18 = "0x" + e18), Gn(e18) && (e18 = e18.toHexString()), Jt$1(e18)) { let r2 = e18.substring(2); r2.length % 2 && (t2.hexPad === "left" ? r2 = "0" + r2 : t2.hexPad === "right" ? r2 += "0" : Tt$2.throwArgumentError("hex data is odd-length", "value", e18)); - const i3 = []; - for (let n4 = 0; n4 < r2.length; n4 += 2) - i3.push(parseInt(r2.substring(n4, n4 + 2), 16)); - return ir$1(new Uint8Array(i3)); + const i2 = []; + for (let n5 = 0; n5 < r2.length; n5 += 2) + i2.push(parseInt(r2.substring(n5, n5 + 2), 16)); + return ir$1(new Uint8Array(i2)); } return nr$1(e18) ? ir$1(new Uint8Array(e18)) : Tt$2.throwArgumentError("invalid arrayify value", "value", e18); } function Ds(e18) { - const t2 = e18.map((n4) => Ot$1(n4)), r2 = t2.reduce((n4, o2) => n4 + o2.length, 0), i3 = new Uint8Array(r2); - return t2.reduce((n4, o2) => (i3.set(o2, n4), n4 + o2.length), 0), ir$1(i3); + const t2 = e18.map((n5) => Ot$1(n5)), r2 = t2.reduce((n5, o2) => n5 + o2.length, 0), i2 = new Uint8Array(r2); + return t2.reduce((n5, o2) => (i2.set(o2, n5), n5 + o2.length), 0), ir$1(i2); } function Fs$1(e18, t2) { e18 = Ot$1(e18), e18.length > t2 && Tt$2.throwArgumentError("value out of range", "value", arguments[0]); @@ -105455,13 +34761,13 @@ function Fs$1(e18, t2) { function Jt$1(e18, t2) { return !(typeof e18 != "string" || !e18.match(/^0x[0-9A-Fa-f]*$/) || t2 && e18.length !== 2 + 2 * t2); } -const Si = "0123456789abcdef"; +const Si$1 = "0123456789abcdef"; function Kt$1(e18, t2) { if (t2 || (t2 = {}), typeof e18 == "number") { Tt$2.checkSafeUint53(e18, "invalid hexlify value"); let r2 = ""; for (; e18; ) - r2 = Si[e18 & 15] + r2, e18 = Math.floor(e18 / 16); + r2 = Si$1[e18 & 15] + r2, e18 = Math.floor(e18 / 16); return r2.length ? (r2.length % 2 && (r2 = "0" + r2), "0x" + r2) : "0x00"; } if (typeof e18 == "bigint") @@ -105472,9 +34778,9 @@ function Kt$1(e18, t2) { return e18.length % 2 && (t2.hexPad === "left" ? e18 = "0x0" + e18.substring(2) : t2.hexPad === "right" ? e18 += "0" : Tt$2.throwArgumentError("hex data is odd-length", "value", e18)), e18.toLowerCase(); if (nr$1(e18)) { let r2 = "0x"; - for (let i3 = 0; i3 < e18.length; i3++) { - let n4 = e18[i3]; - r2 += Si[(n4 & 240) >> 4] + Si[n4 & 15]; + for (let i2 = 0; i2 < e18.length; i2++) { + let n5 = e18[i2]; + r2 += Si$1[(n5 & 240) >> 4] + Si$1[n5 & 15]; } return r2; } @@ -105502,11 +34808,11 @@ function Wn(e18) { r2.length === 64 ? (t2.v = 27 + (r2[32] >> 7), r2[32] &= 127, t2.r = Kt$1(r2.slice(0, 32)), t2.s = Kt$1(r2.slice(32, 64))) : r2.length === 65 ? (t2.r = Kt$1(r2.slice(0, 32)), t2.s = Kt$1(r2.slice(32, 64)), t2.v = r2[64]) : Tt$2.throwArgumentError("invalid signature string", "signature", e18), t2.v < 27 && (t2.v === 0 || t2.v === 1 ? t2.v += 27 : Tt$2.throwArgumentError("signature invalid v byte", "signature", e18)), t2.recoveryParam = 1 - t2.v % 2, t2.recoveryParam && (r2[32] |= 128), t2._vs = Kt$1(r2.slice(32, 64)); } else { if (t2.r = e18.r, t2.s = e18.s, t2.v = e18.v, t2.recoveryParam = e18.recoveryParam, t2._vs = e18._vs, t2._vs != null) { - const n4 = Fs$1(Ot$1(t2._vs), 32); - t2._vs = Kt$1(n4); - const o2 = n4[0] >= 128 ? 1 : 0; - t2.recoveryParam == null ? t2.recoveryParam = o2 : t2.recoveryParam !== o2 && Tt$2.throwArgumentError("signature recoveryParam mismatch _vs", "signature", e18), n4[0] &= 127; - const h4 = Kt$1(n4); + const n5 = Fs$1(Ot$1(t2._vs), 32); + t2._vs = Kt$1(n5); + const o2 = n5[0] >= 128 ? 1 : 0; + t2.recoveryParam == null ? t2.recoveryParam = o2 : t2.recoveryParam !== o2 && Tt$2.throwArgumentError("signature recoveryParam mismatch _vs", "signature", e18), n5[0] &= 127; + const h4 = Kt$1(n5); t2.s == null ? t2.s = h4 : t2.s !== h4 && Tt$2.throwArgumentError("signature v mismatch _vs", "signature", e18); } if (t2.recoveryParam == null) @@ -105514,14 +34820,14 @@ function Wn(e18) { else if (t2.v == null) t2.v = 27 + t2.recoveryParam; else { - const n4 = t2.v === 0 || t2.v === 1 ? t2.v : 1 - t2.v % 2; - t2.recoveryParam !== n4 && Tt$2.throwArgumentError("signature recoveryParam mismatch v", "signature", e18); + const n5 = t2.v === 0 || t2.v === 1 ? t2.v : 1 - t2.v % 2; + t2.recoveryParam !== n5 && Tt$2.throwArgumentError("signature recoveryParam mismatch v", "signature", e18); } t2.r == null || !Jt$1(t2.r) ? Tt$2.throwArgumentError("signature missing or invalid r", "signature", e18) : t2.r = oe$2(t2.r, 32), t2.s == null || !Jt$1(t2.s) ? Tt$2.throwArgumentError("signature missing or invalid s", "signature", e18) : t2.s = oe$2(t2.s, 32); const r2 = Ot$1(t2.s); r2[0] >= 128 && Tt$2.throwArgumentError("signature s out of range", "signature", e18), t2.recoveryParam && (r2[0] |= 128); - const i3 = Kt$1(r2); - t2._vs && (Jt$1(t2._vs) || Tt$2.throwArgumentError("signature invalid _vs", "signature", e18), t2._vs = oe$2(t2._vs, 32)), t2._vs == null ? t2._vs = i3 : t2._vs !== i3 && Tt$2.throwArgumentError("signature _vs mismatch v and s", "signature", e18); + const i2 = Kt$1(r2); + t2._vs && (Jt$1(t2._vs) || Tt$2.throwArgumentError("signature invalid _vs", "signature", e18), t2._vs = oe$2(t2._vs, 32)), t2._vs == null ? t2._vs = i2 : t2._vs !== i2 && Tt$2.throwArgumentError("signature _vs mismatch v and s", "signature", e18); } return t2.yParityAndS = t2._vs, t2.compact = t2.r + t2.yParityAndS.substring(2), t2; } @@ -105531,20 +34837,20 @@ function Ii(e18) { var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, default: ks$1 }), Ks$1 = Bs$1(qs$2); (function(e18) { (function(t2, r2) { - function i3(b2, f3) { + function i2(b2, f4) { if (!b2) - throw new Error(f3 || "Assertion failed"); + throw new Error(f4 || "Assertion failed"); } - function n4(b2, f3) { - b2.super_ = f3; + function n5(b2, f4) { + b2.super_ = f4; var a3 = function() { }; - a3.prototype = f3.prototype, b2.prototype = new a3(), b2.prototype.constructor = b2; + a3.prototype = f4.prototype, b2.prototype = new a3(), b2.prototype.constructor = b2; } - function o2(b2, f3, a3) { + function o2(b2, f4, a3) { if (o2.isBN(b2)) return b2; - this.negative = 0, this.words = null, this.length = 0, this.red = null, b2 !== null && ((f3 === "le" || f3 === "be") && (a3 = f3, f3 = 10), this._init(b2 || 0, f3 || 10, a3 || "be")); + this.negative = 0, this.words = null, this.length = 0, this.red = null, b2 !== null && ((f4 === "le" || f4 === "be") && (a3 = f4, f4 = 10), this._init(b2 || 0, f4 || 10, a3 || "be")); } typeof t2 == "object" ? t2.exports = o2 : r2.BN = o2, o2.BN = o2, o2.wordSize = 26; var h4; @@ -105552,103 +34858,103 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def typeof window < "u" && typeof window.Buffer < "u" ? h4 = window.Buffer : h4 = Ks$1.Buffer; } catch { } - o2.isBN = function(f3) { - return f3 instanceof o2 ? true : f3 !== null && typeof f3 == "object" && f3.constructor.wordSize === o2.wordSize && Array.isArray(f3.words); - }, o2.max = function(f3, a3) { - return f3.cmp(a3) > 0 ? f3 : a3; - }, o2.min = function(f3, a3) { - return f3.cmp(a3) < 0 ? f3 : a3; - }, o2.prototype._init = function(f3, a3, c2) { - if (typeof f3 == "number") - return this._initNumber(f3, a3, c2); - if (typeof f3 == "object") - return this._initArray(f3, a3, c2); - a3 === "hex" && (a3 = 16), i3(a3 === (a3 | 0) && a3 >= 2 && a3 <= 36), f3 = f3.toString().replace(/\s+/g, ""); + o2.isBN = function(f4) { + return f4 instanceof o2 ? true : f4 !== null && typeof f4 == "object" && f4.constructor.wordSize === o2.wordSize && Array.isArray(f4.words); + }, o2.max = function(f4, a3) { + return f4.cmp(a3) > 0 ? f4 : a3; + }, o2.min = function(f4, a3) { + return f4.cmp(a3) < 0 ? f4 : a3; + }, o2.prototype._init = function(f4, a3, c2) { + if (typeof f4 == "number") + return this._initNumber(f4, a3, c2); + if (typeof f4 == "object") + return this._initArray(f4, a3, c2); + a3 === "hex" && (a3 = 16), i2(a3 === (a3 | 0) && a3 >= 2 && a3 <= 36), f4 = f4.toString().replace(/\s+/g, ""); var d4 = 0; - f3[0] === "-" && (d4++, this.negative = 1), d4 < f3.length && (a3 === 16 ? this._parseHex(f3, d4, c2) : (this._parseBase(f3, a3, d4), c2 === "le" && this._initArray(this.toArray(), a3, c2))); - }, o2.prototype._initNumber = function(f3, a3, c2) { - f3 < 0 && (this.negative = 1, f3 = -f3), f3 < 67108864 ? (this.words = [f3 & 67108863], this.length = 1) : f3 < 4503599627370496 ? (this.words = [f3 & 67108863, f3 / 67108864 & 67108863], this.length = 2) : (i3(f3 < 9007199254740992), this.words = [f3 & 67108863, f3 / 67108864 & 67108863, 1], this.length = 3), c2 === "le" && this._initArray(this.toArray(), a3, c2); - }, o2.prototype._initArray = function(f3, a3, c2) { - if (i3(typeof f3.length == "number"), f3.length <= 0) + f4[0] === "-" && (d4++, this.negative = 1), d4 < f4.length && (a3 === 16 ? this._parseHex(f4, d4, c2) : (this._parseBase(f4, a3, d4), c2 === "le" && this._initArray(this.toArray(), a3, c2))); + }, o2.prototype._initNumber = function(f4, a3, c2) { + f4 < 0 && (this.negative = 1, f4 = -f4), f4 < 67108864 ? (this.words = [f4 & 67108863], this.length = 1) : f4 < 4503599627370496 ? (this.words = [f4 & 67108863, f4 / 67108864 & 67108863], this.length = 2) : (i2(f4 < 9007199254740992), this.words = [f4 & 67108863, f4 / 67108864 & 67108863, 1], this.length = 3), c2 === "le" && this._initArray(this.toArray(), a3, c2); + }, o2.prototype._initArray = function(f4, a3, c2) { + if (i2(typeof f4.length == "number"), f4.length <= 0) return this.words = [0], this.length = 1, this; - this.length = Math.ceil(f3.length / 3), this.words = new Array(this.length); + this.length = Math.ceil(f4.length / 3), this.words = new Array(this.length); for (var d4 = 0; d4 < this.length; d4++) this.words[d4] = 0; var m3, x3, M3 = 0; if (c2 === "be") - for (d4 = f3.length - 1, m3 = 0; d4 >= 0; d4 -= 3) - x3 = f3[d4] | f3[d4 - 1] << 8 | f3[d4 - 2] << 16, this.words[m3] |= x3 << M3 & 67108863, this.words[m3 + 1] = x3 >>> 26 - M3 & 67108863, M3 += 24, M3 >= 26 && (M3 -= 26, m3++); + for (d4 = f4.length - 1, m3 = 0; d4 >= 0; d4 -= 3) + x3 = f4[d4] | f4[d4 - 1] << 8 | f4[d4 - 2] << 16, this.words[m3] |= x3 << M3 & 67108863, this.words[m3 + 1] = x3 >>> 26 - M3 & 67108863, M3 += 24, M3 >= 26 && (M3 -= 26, m3++); else if (c2 === "le") - for (d4 = 0, m3 = 0; d4 < f3.length; d4 += 3) - x3 = f3[d4] | f3[d4 + 1] << 8 | f3[d4 + 2] << 16, this.words[m3] |= x3 << M3 & 67108863, this.words[m3 + 1] = x3 >>> 26 - M3 & 67108863, M3 += 24, M3 >= 26 && (M3 -= 26, m3++); + for (d4 = 0, m3 = 0; d4 < f4.length; d4 += 3) + x3 = f4[d4] | f4[d4 + 1] << 8 | f4[d4 + 2] << 16, this.words[m3] |= x3 << M3 & 67108863, this.words[m3 + 1] = x3 >>> 26 - M3 & 67108863, M3 += 24, M3 >= 26 && (M3 -= 26, m3++); return this._strip(); }; - function p3(b2, f3) { - var a3 = b2.charCodeAt(f3); + function p3(b2, f4) { + var a3 = b2.charCodeAt(f4); if (a3 >= 48 && a3 <= 57) return a3 - 48; if (a3 >= 65 && a3 <= 70) return a3 - 55; if (a3 >= 97 && a3 <= 102) return a3 - 87; - i3(false, "Invalid character in " + b2); + i2(false, "Invalid character in " + b2); } - function A2(b2, f3, a3) { + function A2(b2, f4, a3) { var c2 = p3(b2, a3); - return a3 - 1 >= f3 && (c2 |= p3(b2, a3 - 1) << 4), c2; + return a3 - 1 >= f4 && (c2 |= p3(b2, a3 - 1) << 4), c2; } - o2.prototype._parseHex = function(f3, a3, c2) { - this.length = Math.ceil((f3.length - a3) / 6), this.words = new Array(this.length); + o2.prototype._parseHex = function(f4, a3, c2) { + this.length = Math.ceil((f4.length - a3) / 6), this.words = new Array(this.length); for (var d4 = 0; d4 < this.length; d4++) this.words[d4] = 0; var m3 = 0, x3 = 0, M3; if (c2 === "be") - for (d4 = f3.length - 1; d4 >= a3; d4 -= 2) - M3 = A2(f3, a3, d4) << m3, this.words[x3] |= M3 & 67108863, m3 >= 18 ? (m3 -= 18, x3 += 1, this.words[x3] |= M3 >>> 26) : m3 += 8; + for (d4 = f4.length - 1; d4 >= a3; d4 -= 2) + M3 = A2(f4, a3, d4) << m3, this.words[x3] |= M3 & 67108863, m3 >= 18 ? (m3 -= 18, x3 += 1, this.words[x3] |= M3 >>> 26) : m3 += 8; else { - var l2 = f3.length - a3; - for (d4 = l2 % 2 === 0 ? a3 + 1 : a3; d4 < f3.length; d4 += 2) - M3 = A2(f3, a3, d4) << m3, this.words[x3] |= M3 & 67108863, m3 >= 18 ? (m3 -= 18, x3 += 1, this.words[x3] |= M3 >>> 26) : m3 += 8; + var l2 = f4.length - a3; + for (d4 = l2 % 2 === 0 ? a3 + 1 : a3; d4 < f4.length; d4 += 2) + M3 = A2(f4, a3, d4) << m3, this.words[x3] |= M3 & 67108863, m3 >= 18 ? (m3 -= 18, x3 += 1, this.words[x3] |= M3 >>> 26) : m3 += 8; } this._strip(); }; - function v6(b2, f3, a3, c2) { - for (var d4 = 0, m3 = 0, x3 = Math.min(b2.length, a3), M3 = f3; M3 < x3; M3++) { + function v6(b2, f4, a3, c2) { + for (var d4 = 0, m3 = 0, x3 = Math.min(b2.length, a3), M3 = f4; M3 < x3; M3++) { var l2 = b2.charCodeAt(M3) - 48; - d4 *= c2, l2 >= 49 ? m3 = l2 - 49 + 10 : l2 >= 17 ? m3 = l2 - 17 + 10 : m3 = l2, i3(l2 >= 0 && m3 < c2, "Invalid character"), d4 += m3; + d4 *= c2, l2 >= 49 ? m3 = l2 - 49 + 10 : l2 >= 17 ? m3 = l2 - 17 + 10 : m3 = l2, i2(l2 >= 0 && m3 < c2, "Invalid character"), d4 += m3; } return d4; } - o2.prototype._parseBase = function(f3, a3, c2) { + o2.prototype._parseBase = function(f4, a3, c2) { this.words = [0], this.length = 1; for (var d4 = 0, m3 = 1; m3 <= 67108863; m3 *= a3) d4++; d4--, m3 = m3 / a3 | 0; - for (var x3 = f3.length - c2, M3 = x3 % d4, l2 = Math.min(x3, x3 - M3) + c2, s2 = 0, g3 = c2; g3 < l2; g3 += d4) - s2 = v6(f3, g3, g3 + d4, a3), this.imuln(m3), this.words[0] + s2 < 67108864 ? this.words[0] += s2 : this._iaddn(s2); + for (var x3 = f4.length - c2, M3 = x3 % d4, l2 = Math.min(x3, x3 - M3) + c2, s2 = 0, g3 = c2; g3 < l2; g3 += d4) + s2 = v6(f4, g3, g3 + d4, a3), this.imuln(m3), this.words[0] + s2 < 67108864 ? this.words[0] += s2 : this._iaddn(s2); if (M3 !== 0) { var k2 = 1; - for (s2 = v6(f3, g3, f3.length, a3), g3 = 0; g3 < M3; g3++) + for (s2 = v6(f4, g3, f4.length, a3), g3 = 0; g3 < M3; g3++) k2 *= a3; this.imuln(k2), this.words[0] + s2 < 67108864 ? this.words[0] += s2 : this._iaddn(s2); } this._strip(); - }, o2.prototype.copy = function(f3) { - f3.words = new Array(this.length); + }, o2.prototype.copy = function(f4) { + f4.words = new Array(this.length); for (var a3 = 0; a3 < this.length; a3++) - f3.words[a3] = this.words[a3]; - f3.length = this.length, f3.negative = this.negative, f3.red = this.red; + f4.words[a3] = this.words[a3]; + f4.length = this.length, f4.negative = this.negative, f4.red = this.red; }; - function w2(b2, f3) { - b2.words = f3.words, b2.length = f3.length, b2.negative = f3.negative, b2.red = f3.red; + function w2(b2, f4) { + b2.words = f4.words, b2.length = f4.length, b2.negative = f4.negative, b2.red = f4.red; } - if (o2.prototype._move = function(f3) { - w2(f3, this); + if (o2.prototype._move = function(f4) { + w2(f4, this); }, o2.prototype.clone = function() { - var f3 = new o2(null); - return this.copy(f3), f3; - }, o2.prototype._expand = function(f3) { - for (; this.length < f3; ) + var f4 = new o2(null); + return this.copy(f4), f4; + }, o2.prototype._expand = function(f4) { + for (; this.length < f4; ) this.words[this.length++] = 0; return this; }, o2.prototype._strip = function() { @@ -105669,10 +34975,10 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def return (this.red ? ""; } var S4 = ["", "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"], N2 = [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], I2 = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; - o2.prototype.toString = function(f3, a3) { - f3 = f3 || 10, a3 = a3 | 0 || 1; + o2.prototype.toString = function(f4, a3) { + f4 = f4 || 10, a3 = a3 | 0 || 1; var c2; - if (f3 === 16 || f3 === "hex") { + if (f4 === 16 || f4 === "hex") { c2 = ""; for (var d4 = 0, m3 = 0, x3 = 0; x3 < this.length; x3++) { var M3 = this.words[x3], l2 = ((M3 << d4 | m3) & 16777215).toString(16); @@ -105682,156 +34988,156 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def c2 = "0" + c2; return this.negative !== 0 && (c2 = "-" + c2), c2; } - if (f3 === (f3 | 0) && f3 >= 2 && f3 <= 36) { - var s2 = N2[f3], g3 = I2[f3]; + if (f4 === (f4 | 0) && f4 >= 2 && f4 <= 36) { + var s2 = N2[f4], g3 = I2[f4]; c2 = ""; var k2 = this.clone(); for (k2.negative = 0; !k2.isZero(); ) { - var u2 = k2.modrn(g3).toString(f3); + var u2 = k2.modrn(g3).toString(f4); k2 = k2.idivn(g3), k2.isZero() ? c2 = u2 + c2 : c2 = S4[s2 - u2.length] + u2 + c2; } for (this.isZero() && (c2 = "0" + c2); c2.length % a3 !== 0; ) c2 = "0" + c2; return this.negative !== 0 && (c2 = "-" + c2), c2; } - i3(false, "Base should be between 2 and 36"); + i2(false, "Base should be between 2 and 36"); }, o2.prototype.toNumber = function() { - var f3 = this.words[0]; - return this.length === 2 ? f3 += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 ? f3 += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && i3(false, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -f3 : f3; + var f4 = this.words[0]; + return this.length === 2 ? f4 += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 ? f4 += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && i2(false, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -f4 : f4; }, o2.prototype.toJSON = function() { return this.toString(16, 2); - }, h4 && (o2.prototype.toBuffer = function(f3, a3) { - return this.toArrayLike(h4, f3, a3); - }), o2.prototype.toArray = function(f3, a3) { - return this.toArrayLike(Array, f3, a3); + }, h4 && (o2.prototype.toBuffer = function(f4, a3) { + return this.toArrayLike(h4, f4, a3); + }), o2.prototype.toArray = function(f4, a3) { + return this.toArrayLike(Array, f4, a3); }; - var C3 = function(f3, a3) { - return f3.allocUnsafe ? f3.allocUnsafe(a3) : new f3(a3); + var C3 = function(f4, a3) { + return f4.allocUnsafe ? f4.allocUnsafe(a3) : new f4(a3); }; - o2.prototype.toArrayLike = function(f3, a3, c2) { + o2.prototype.toArrayLike = function(f4, a3, c2) { this._strip(); var d4 = this.byteLength(), m3 = c2 || Math.max(1, d4); - i3(d4 <= m3, "byte array longer than desired length"), i3(m3 > 0, "Requested array length <= 0"); - var x3 = C3(f3, m3), M3 = a3 === "le" ? "LE" : "BE"; + i2(d4 <= m3, "byte array longer than desired length"), i2(m3 > 0, "Requested array length <= 0"); + var x3 = C3(f4, m3), M3 = a3 === "le" ? "LE" : "BE"; return this["_toArrayLike" + M3](x3, d4), x3; - }, o2.prototype._toArrayLikeLE = function(f3, a3) { + }, o2.prototype._toArrayLikeLE = function(f4, a3) { for (var c2 = 0, d4 = 0, m3 = 0, x3 = 0; m3 < this.length; m3++) { var M3 = this.words[m3] << x3 | d4; - f3[c2++] = M3 & 255, c2 < f3.length && (f3[c2++] = M3 >> 8 & 255), c2 < f3.length && (f3[c2++] = M3 >> 16 & 255), x3 === 6 ? (c2 < f3.length && (f3[c2++] = M3 >> 24 & 255), d4 = 0, x3 = 0) : (d4 = M3 >>> 24, x3 += 2); + f4[c2++] = M3 & 255, c2 < f4.length && (f4[c2++] = M3 >> 8 & 255), c2 < f4.length && (f4[c2++] = M3 >> 16 & 255), x3 === 6 ? (c2 < f4.length && (f4[c2++] = M3 >> 24 & 255), d4 = 0, x3 = 0) : (d4 = M3 >>> 24, x3 += 2); } - if (c2 < f3.length) - for (f3[c2++] = d4; c2 < f3.length; ) - f3[c2++] = 0; - }, o2.prototype._toArrayLikeBE = function(f3, a3) { - for (var c2 = f3.length - 1, d4 = 0, m3 = 0, x3 = 0; m3 < this.length; m3++) { + if (c2 < f4.length) + for (f4[c2++] = d4; c2 < f4.length; ) + f4[c2++] = 0; + }, o2.prototype._toArrayLikeBE = function(f4, a3) { + for (var c2 = f4.length - 1, d4 = 0, m3 = 0, x3 = 0; m3 < this.length; m3++) { var M3 = this.words[m3] << x3 | d4; - f3[c2--] = M3 & 255, c2 >= 0 && (f3[c2--] = M3 >> 8 & 255), c2 >= 0 && (f3[c2--] = M3 >> 16 & 255), x3 === 6 ? (c2 >= 0 && (f3[c2--] = M3 >> 24 & 255), d4 = 0, x3 = 0) : (d4 = M3 >>> 24, x3 += 2); + f4[c2--] = M3 & 255, c2 >= 0 && (f4[c2--] = M3 >> 8 & 255), c2 >= 0 && (f4[c2--] = M3 >> 16 & 255), x3 === 6 ? (c2 >= 0 && (f4[c2--] = M3 >> 24 & 255), d4 = 0, x3 = 0) : (d4 = M3 >>> 24, x3 += 2); } if (c2 >= 0) - for (f3[c2--] = d4; c2 >= 0; ) - f3[c2--] = 0; - }, Math.clz32 ? o2.prototype._countBits = function(f3) { - return 32 - Math.clz32(f3); - } : o2.prototype._countBits = function(f3) { - var a3 = f3, c2 = 0; + for (f4[c2--] = d4; c2 >= 0; ) + f4[c2--] = 0; + }, Math.clz32 ? o2.prototype._countBits = function(f4) { + return 32 - Math.clz32(f4); + } : o2.prototype._countBits = function(f4) { + var a3 = f4, c2 = 0; return a3 >= 4096 && (c2 += 13, a3 >>>= 13), a3 >= 64 && (c2 += 7, a3 >>>= 7), a3 >= 8 && (c2 += 4, a3 >>>= 4), a3 >= 2 && (c2 += 2, a3 >>>= 2), c2 + a3; - }, o2.prototype._zeroBits = function(f3) { - if (f3 === 0) + }, o2.prototype._zeroBits = function(f4) { + if (f4 === 0) return 26; - var a3 = f3, c2 = 0; + var a3 = f4, c2 = 0; return a3 & 8191 || (c2 += 13, a3 >>>= 13), a3 & 127 || (c2 += 7, a3 >>>= 7), a3 & 15 || (c2 += 4, a3 >>>= 4), a3 & 3 || (c2 += 2, a3 >>>= 2), a3 & 1 || c2++, c2; }, o2.prototype.bitLength = function() { - var f3 = this.words[this.length - 1], a3 = this._countBits(f3); + var f4 = this.words[this.length - 1], a3 = this._countBits(f4); return (this.length - 1) * 26 + a3; }; function D2(b2) { - for (var f3 = new Array(b2.bitLength()), a3 = 0; a3 < f3.length; a3++) { + for (var f4 = new Array(b2.bitLength()), a3 = 0; a3 < f4.length; a3++) { var c2 = a3 / 26 | 0, d4 = a3 % 26; - f3[a3] = b2.words[c2] >>> d4 & 1; + f4[a3] = b2.words[c2] >>> d4 & 1; } - return f3; + return f4; } o2.prototype.zeroBits = function() { if (this.isZero()) return 0; - for (var f3 = 0, a3 = 0; a3 < this.length; a3++) { + for (var f4 = 0, a3 = 0; a3 < this.length; a3++) { var c2 = this._zeroBits(this.words[a3]); - if (f3 += c2, c2 !== 26) + if (f4 += c2, c2 !== 26) break; } - return f3; + return f4; }, o2.prototype.byteLength = function() { return Math.ceil(this.bitLength() / 8); - }, o2.prototype.toTwos = function(f3) { - return this.negative !== 0 ? this.abs().inotn(f3).iaddn(1) : this.clone(); - }, o2.prototype.fromTwos = function(f3) { - return this.testn(f3 - 1) ? this.notn(f3).iaddn(1).ineg() : this.clone(); + }, o2.prototype.toTwos = function(f4) { + return this.negative !== 0 ? this.abs().inotn(f4).iaddn(1) : this.clone(); + }, o2.prototype.fromTwos = function(f4) { + return this.testn(f4 - 1) ? this.notn(f4).iaddn(1).ineg() : this.clone(); }, o2.prototype.isNeg = function() { return this.negative !== 0; }, o2.prototype.neg = function() { return this.clone().ineg(); }, o2.prototype.ineg = function() { return this.isZero() || (this.negative ^= 1), this; - }, o2.prototype.iuor = function(f3) { - for (; this.length < f3.length; ) + }, o2.prototype.iuor = function(f4) { + for (; this.length < f4.length; ) this.words[this.length++] = 0; - for (var a3 = 0; a3 < f3.length; a3++) - this.words[a3] = this.words[a3] | f3.words[a3]; + for (var a3 = 0; a3 < f4.length; a3++) + this.words[a3] = this.words[a3] | f4.words[a3]; return this._strip(); - }, o2.prototype.ior = function(f3) { - return i3((this.negative | f3.negative) === 0), this.iuor(f3); - }, o2.prototype.or = function(f3) { - return this.length > f3.length ? this.clone().ior(f3) : f3.clone().ior(this); - }, o2.prototype.uor = function(f3) { - return this.length > f3.length ? this.clone().iuor(f3) : f3.clone().iuor(this); - }, o2.prototype.iuand = function(f3) { + }, o2.prototype.ior = function(f4) { + return i2((this.negative | f4.negative) === 0), this.iuor(f4); + }, o2.prototype.or = function(f4) { + return this.length > f4.length ? this.clone().ior(f4) : f4.clone().ior(this); + }, o2.prototype.uor = function(f4) { + return this.length > f4.length ? this.clone().iuor(f4) : f4.clone().iuor(this); + }, o2.prototype.iuand = function(f4) { var a3; - this.length > f3.length ? a3 = f3 : a3 = this; + this.length > f4.length ? a3 = f4 : a3 = this; for (var c2 = 0; c2 < a3.length; c2++) - this.words[c2] = this.words[c2] & f3.words[c2]; + this.words[c2] = this.words[c2] & f4.words[c2]; return this.length = a3.length, this._strip(); - }, o2.prototype.iand = function(f3) { - return i3((this.negative | f3.negative) === 0), this.iuand(f3); - }, o2.prototype.and = function(f3) { - return this.length > f3.length ? this.clone().iand(f3) : f3.clone().iand(this); - }, o2.prototype.uand = function(f3) { - return this.length > f3.length ? this.clone().iuand(f3) : f3.clone().iuand(this); - }, o2.prototype.iuxor = function(f3) { + }, o2.prototype.iand = function(f4) { + return i2((this.negative | f4.negative) === 0), this.iuand(f4); + }, o2.prototype.and = function(f4) { + return this.length > f4.length ? this.clone().iand(f4) : f4.clone().iand(this); + }, o2.prototype.uand = function(f4) { + return this.length > f4.length ? this.clone().iuand(f4) : f4.clone().iuand(this); + }, o2.prototype.iuxor = function(f4) { var a3, c2; - this.length > f3.length ? (a3 = this, c2 = f3) : (a3 = f3, c2 = this); + this.length > f4.length ? (a3 = this, c2 = f4) : (a3 = f4, c2 = this); for (var d4 = 0; d4 < c2.length; d4++) this.words[d4] = a3.words[d4] ^ c2.words[d4]; if (this !== a3) for (; d4 < a3.length; d4++) this.words[d4] = a3.words[d4]; return this.length = a3.length, this._strip(); - }, o2.prototype.ixor = function(f3) { - return i3((this.negative | f3.negative) === 0), this.iuxor(f3); - }, o2.prototype.xor = function(f3) { - return this.length > f3.length ? this.clone().ixor(f3) : f3.clone().ixor(this); - }, o2.prototype.uxor = function(f3) { - return this.length > f3.length ? this.clone().iuxor(f3) : f3.clone().iuxor(this); - }, o2.prototype.inotn = function(f3) { - i3(typeof f3 == "number" && f3 >= 0); - var a3 = Math.ceil(f3 / 26) | 0, c2 = f3 % 26; + }, o2.prototype.ixor = function(f4) { + return i2((this.negative | f4.negative) === 0), this.iuxor(f4); + }, o2.prototype.xor = function(f4) { + return this.length > f4.length ? this.clone().ixor(f4) : f4.clone().ixor(this); + }, o2.prototype.uxor = function(f4) { + return this.length > f4.length ? this.clone().iuxor(f4) : f4.clone().iuxor(this); + }, o2.prototype.inotn = function(f4) { + i2(typeof f4 == "number" && f4 >= 0); + var a3 = Math.ceil(f4 / 26) | 0, c2 = f4 % 26; this._expand(a3), c2 > 0 && a3--; for (var d4 = 0; d4 < a3; d4++) this.words[d4] = ~this.words[d4] & 67108863; return c2 > 0 && (this.words[d4] = ~this.words[d4] & 67108863 >> 26 - c2), this._strip(); - }, o2.prototype.notn = function(f3) { - return this.clone().inotn(f3); - }, o2.prototype.setn = function(f3, a3) { - i3(typeof f3 == "number" && f3 >= 0); - var c2 = f3 / 26 | 0, d4 = f3 % 26; + }, o2.prototype.notn = function(f4) { + return this.clone().inotn(f4); + }, o2.prototype.setn = function(f4, a3) { + i2(typeof f4 == "number" && f4 >= 0); + var c2 = f4 / 26 | 0, d4 = f4 % 26; return this._expand(c2 + 1), a3 ? this.words[c2] = this.words[c2] | 1 << d4 : this.words[c2] = this.words[c2] & ~(1 << d4), this._strip(); - }, o2.prototype.iadd = function(f3) { + }, o2.prototype.iadd = function(f4) { var a3; - if (this.negative !== 0 && f3.negative === 0) - return this.negative = 0, a3 = this.isub(f3), this.negative ^= 1, this._normSign(); - if (this.negative === 0 && f3.negative !== 0) - return f3.negative = 0, a3 = this.isub(f3), f3.negative = 1, a3._normSign(); + if (this.negative !== 0 && f4.negative === 0) + return this.negative = 0, a3 = this.isub(f4), this.negative ^= 1, this._normSign(); + if (this.negative === 0 && f4.negative !== 0) + return f4.negative = 0, a3 = this.isub(f4), f4.negative = 1, a3._normSign(); var c2, d4; - this.length > f3.length ? (c2 = this, d4 = f3) : (c2 = f3, d4 = this); + this.length > f4.length ? (c2 = this, d4 = f4) : (c2 = f4, d4 = this); for (var m3 = 0, x3 = 0; x3 < d4.length; x3++) a3 = (c2.words[x3] | 0) + (d4.words[x3] | 0) + m3, this.words[x3] = a3 & 67108863, m3 = a3 >>> 26; for (; m3 !== 0 && x3 < c2.length; x3++) @@ -105842,21 +35148,21 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def for (; x3 < c2.length; x3++) this.words[x3] = c2.words[x3]; return this; - }, o2.prototype.add = function(f3) { + }, o2.prototype.add = function(f4) { var a3; - return f3.negative !== 0 && this.negative === 0 ? (f3.negative = 0, a3 = this.sub(f3), f3.negative ^= 1, a3) : f3.negative === 0 && this.negative !== 0 ? (this.negative = 0, a3 = f3.sub(this), this.negative = 1, a3) : this.length > f3.length ? this.clone().iadd(f3) : f3.clone().iadd(this); - }, o2.prototype.isub = function(f3) { - if (f3.negative !== 0) { - f3.negative = 0; - var a3 = this.iadd(f3); - return f3.negative = 1, a3._normSign(); + return f4.negative !== 0 && this.negative === 0 ? (f4.negative = 0, a3 = this.sub(f4), f4.negative ^= 1, a3) : f4.negative === 0 && this.negative !== 0 ? (this.negative = 0, a3 = f4.sub(this), this.negative = 1, a3) : this.length > f4.length ? this.clone().iadd(f4) : f4.clone().iadd(this); + }, o2.prototype.isub = function(f4) { + if (f4.negative !== 0) { + f4.negative = 0; + var a3 = this.iadd(f4); + return f4.negative = 1, a3._normSign(); } else if (this.negative !== 0) - return this.negative = 0, this.iadd(f3), this.negative = 1, this._normSign(); - var c2 = this.cmp(f3); + return this.negative = 0, this.iadd(f4), this.negative = 1, this._normSign(); + var c2 = this.cmp(f4); if (c2 === 0) return this.negative = 0, this.length = 1, this.words[0] = 0, this; var d4, m3; - c2 > 0 ? (d4 = this, m3 = f3) : (d4 = f3, m3 = this); + c2 > 0 ? (d4 = this, m3 = f4) : (d4 = f4, m3 = this); for (var x3 = 0, M3 = 0; M3 < m3.length; M3++) a3 = (d4.words[M3] | 0) - (m3.words[M3] | 0) + x3, x3 = a3 >> 26, this.words[M3] = a3 & 67108863; for (; x3 !== 0 && M3 < d4.length; M3++) @@ -105865,27 +35171,27 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def for (; M3 < d4.length; M3++) this.words[M3] = d4.words[M3]; return this.length = Math.max(this.length, M3), d4 !== this && (this.negative = 1), this._strip(); - }, o2.prototype.sub = function(f3) { - return this.clone().isub(f3); + }, o2.prototype.sub = function(f4) { + return this.clone().isub(f4); }; - function U5(b2, f3, a3) { - a3.negative = f3.negative ^ b2.negative; - var c2 = b2.length + f3.length | 0; + function U5(b2, f4, a3) { + a3.negative = f4.negative ^ b2.negative; + var c2 = b2.length + f4.length | 0; a3.length = c2, c2 = c2 - 1 | 0; - var d4 = b2.words[0] | 0, m3 = f3.words[0] | 0, x3 = d4 * m3, M3 = x3 & 67108863, l2 = x3 / 67108864 | 0; + var d4 = b2.words[0] | 0, m3 = f4.words[0] | 0, x3 = d4 * m3, M3 = x3 & 67108863, l2 = x3 / 67108864 | 0; a3.words[0] = M3; for (var s2 = 1; s2 < c2; s2++) { - for (var g3 = l2 >>> 26, k2 = l2 & 67108863, u2 = Math.min(s2, f3.length - 1), E2 = Math.max(0, s2 - b2.length + 1); E2 <= u2; E2++) { + for (var g3 = l2 >>> 26, k2 = l2 & 67108863, u2 = Math.min(s2, f4.length - 1), E2 = Math.max(0, s2 - b2.length + 1); E2 <= u2; E2++) { var _3 = s2 - E2 | 0; - d4 = b2.words[_3] | 0, m3 = f3.words[E2] | 0, x3 = d4 * m3 + k2, g3 += x3 / 67108864 | 0, k2 = x3 & 67108863; + d4 = b2.words[_3] | 0, m3 = f4.words[E2] | 0, x3 = d4 * m3 + k2, g3 += x3 / 67108864 | 0, k2 = x3 & 67108863; } a3.words[s2] = k2 | 0, l2 = g3 | 0; } return l2 !== 0 ? a3.words[s2] = l2 | 0 : a3.length--, a3._strip(); } - var J2 = function(f3, a3, c2) { - var d4 = f3.words, m3 = a3.words, x3 = c2.words, M3 = 0, l2, s2, g3, k2 = d4[0] | 0, u2 = k2 & 8191, E2 = k2 >>> 13, _3 = d4[1] | 0, B2 = _3 & 8191, R3 = _3 >>> 13, F2 = d4[2] | 0, P2 = F2 & 8191, O3 = F2 >>> 13, Ct2 = d4[3] | 0, T9 = Ct2 & 8191, q2 = Ct2 >>> 13, Te2 = d4[4] | 0, X2 = Te2 & 8191, $ = Te2 >>> 13, De2 = d4[5] | 0, Z2 = De2 & 8191, tt2 = De2 >>> 13, Fe2 = d4[6] | 0, et2 = Fe2 & 8191, rt2 = Fe2 >>> 13, Ue2 = d4[7] | 0, it2 = Ue2 & 8191, nt2 = Ue2 >>> 13, ke2 = d4[8] | 0, ft2 = ke2 & 8191, ot2 = ke2 >>> 13, qe2 = d4[9] | 0, st2 = qe2 & 8191, at2 = qe2 >>> 13, Ke2 = m3[0] | 0, ut2 = Ke2 & 8191, ht2 = Ke2 >>> 13, He2 = m3[1] | 0, ct2 = He2 & 8191, lt2 = He2 >>> 13, Le2 = m3[2] | 0, dt2 = Le2 & 8191, pt2 = Le2 >>> 13, ze2 = m3[3] | 0, vt2 = ze2 & 8191, gt2 = ze2 >>> 13, je2 = m3[4] | 0, mt2 = je2 & 8191, At2 = je2 >>> 13, Qe2 = m3[5] | 0, bt2 = Qe2 & 8191, yt2 = Qe2 >>> 13, Je2 = m3[6] | 0, wt2 = Je2 & 8191, xt2 = Je2 >>> 13, Ge2 = m3[7] | 0, Mt2 = Ge2 & 8191, Et2 = Ge2 >>> 13, Ye2 = m3[8] | 0, St2 = Ye2 & 8191, It2 = Ye2 >>> 13, Ve2 = m3[9] | 0, Nt2 = Ve2 & 8191, _t2 = Ve2 >>> 13; - c2.negative = f3.negative ^ a3.negative, c2.length = 19, l2 = Math.imul(u2, ut2), s2 = Math.imul(u2, ht2), s2 = s2 + Math.imul(E2, ut2) | 0, g3 = Math.imul(E2, ht2); + var J2 = function(f4, a3, c2) { + var d4 = f4.words, m3 = a3.words, x3 = c2.words, M3 = 0, l2, s2, g3, k2 = d4[0] | 0, u2 = k2 & 8191, E2 = k2 >>> 13, _3 = d4[1] | 0, B2 = _3 & 8191, R3 = _3 >>> 13, F2 = d4[2] | 0, P2 = F2 & 8191, O3 = F2 >>> 13, Ct2 = d4[3] | 0, T9 = Ct2 & 8191, q2 = Ct2 >>> 13, Te2 = d4[4] | 0, X2 = Te2 & 8191, $ = Te2 >>> 13, De2 = d4[5] | 0, Z2 = De2 & 8191, tt2 = De2 >>> 13, Fe2 = d4[6] | 0, et2 = Fe2 & 8191, rt2 = Fe2 >>> 13, Ue2 = d4[7] | 0, it2 = Ue2 & 8191, nt2 = Ue2 >>> 13, ke2 = d4[8] | 0, ft2 = ke2 & 8191, ot2 = ke2 >>> 13, qe2 = d4[9] | 0, st2 = qe2 & 8191, at2 = qe2 >>> 13, Ke2 = m3[0] | 0, ut2 = Ke2 & 8191, ht2 = Ke2 >>> 13, He2 = m3[1] | 0, ct2 = He2 & 8191, lt2 = He2 >>> 13, Le2 = m3[2] | 0, dt2 = Le2 & 8191, pt2 = Le2 >>> 13, ze2 = m3[3] | 0, vt2 = ze2 & 8191, gt2 = ze2 >>> 13, je2 = m3[4] | 0, mt2 = je2 & 8191, At2 = je2 >>> 13, Qe2 = m3[5] | 0, bt2 = Qe2 & 8191, yt2 = Qe2 >>> 13, Je2 = m3[6] | 0, wt2 = Je2 & 8191, xt2 = Je2 >>> 13, Ge2 = m3[7] | 0, Mt2 = Ge2 & 8191, Et2 = Ge2 >>> 13, Ye2 = m3[8] | 0, St2 = Ye2 & 8191, It2 = Ye2 >>> 13, Ve2 = m3[9] | 0, Nt2 = Ve2 & 8191, _t2 = Ve2 >>> 13; + c2.negative = f4.negative ^ a3.negative, c2.length = 19, l2 = Math.imul(u2, ut2), s2 = Math.imul(u2, ht2), s2 = s2 + Math.imul(E2, ut2) | 0, g3 = Math.imul(E2, ht2); var Me2 = (M3 + l2 | 0) + ((s2 & 8191) << 13) | 0; M3 = (g3 + (s2 >>> 13) | 0) + (Me2 >>> 26) | 0, Me2 &= 67108863, l2 = Math.imul(B2, ut2), s2 = Math.imul(B2, ht2), s2 = s2 + Math.imul(R3, ut2) | 0, g3 = Math.imul(R3, ht2), l2 = l2 + Math.imul(u2, ct2) | 0, s2 = s2 + Math.imul(u2, lt2) | 0, s2 = s2 + Math.imul(E2, ct2) | 0, g3 = g3 + Math.imul(E2, lt2) | 0; var Ee2 = (M3 + l2 | 0) + ((s2 & 8191) << 13) | 0; @@ -105926,49 +35232,49 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def return M3 = (g3 + (s2 >>> 13) | 0) + (li2 >>> 26) | 0, li2 &= 67108863, x3[0] = Me2, x3[1] = Ee2, x3[2] = Se2, x3[3] = Ie2, x3[4] = Ne2, x3[5] = Zr2, x3[6] = ti2, x3[7] = ei2, x3[8] = ri2, x3[9] = ii2, x3[10] = ni2, x3[11] = fi2, x3[12] = oi2, x3[13] = si2, x3[14] = ai2, x3[15] = ui2, x3[16] = hi2, x3[17] = ci2, x3[18] = li2, M3 !== 0 && (x3[19] = M3, c2.length++), c2; }; Math.imul || (J2 = U5); - function Bt2(b2, f3, a3) { - a3.negative = f3.negative ^ b2.negative, a3.length = b2.length + f3.length; + function Bt2(b2, f4, a3) { + a3.negative = f4.negative ^ b2.negative, a3.length = b2.length + f4.length; for (var c2 = 0, d4 = 0, m3 = 0; m3 < a3.length - 1; m3++) { var x3 = d4; d4 = 0; - for (var M3 = c2 & 67108863, l2 = Math.min(m3, f3.length - 1), s2 = Math.max(0, m3 - b2.length + 1); s2 <= l2; s2++) { - var g3 = m3 - s2, k2 = b2.words[g3] | 0, u2 = f3.words[s2] | 0, E2 = k2 * u2, _3 = E2 & 67108863; + for (var M3 = c2 & 67108863, l2 = Math.min(m3, f4.length - 1), s2 = Math.max(0, m3 - b2.length + 1); s2 <= l2; s2++) { + var g3 = m3 - s2, k2 = b2.words[g3] | 0, u2 = f4.words[s2] | 0, E2 = k2 * u2, _3 = E2 & 67108863; x3 = x3 + (E2 / 67108864 | 0) | 0, _3 = _3 + M3 | 0, M3 = _3 & 67108863, x3 = x3 + (_3 >>> 26) | 0, d4 += x3 >>> 26, x3 &= 67108863; } a3.words[m3] = M3, c2 = x3, x3 = d4; } return c2 !== 0 ? a3.words[m3] = c2 : a3.length--, a3._strip(); } - function G2(b2, f3, a3) { - return Bt2(b2, f3, a3); + function G2(b2, f4, a3) { + return Bt2(b2, f4, a3); } - o2.prototype.mulTo = function(f3, a3) { - var c2, d4 = this.length + f3.length; - return this.length === 10 && f3.length === 10 ? c2 = J2(this, f3, a3) : d4 < 63 ? c2 = U5(this, f3, a3) : d4 < 1024 ? c2 = Bt2(this, f3, a3) : c2 = G2(this, f3, a3), c2; - }, o2.prototype.mul = function(f3) { + o2.prototype.mulTo = function(f4, a3) { + var c2, d4 = this.length + f4.length; + return this.length === 10 && f4.length === 10 ? c2 = J2(this, f4, a3) : d4 < 63 ? c2 = U5(this, f4, a3) : d4 < 1024 ? c2 = Bt2(this, f4, a3) : c2 = G2(this, f4, a3), c2; + }, o2.prototype.mul = function(f4) { var a3 = new o2(null); - return a3.words = new Array(this.length + f3.length), this.mulTo(f3, a3); - }, o2.prototype.mulf = function(f3) { + return a3.words = new Array(this.length + f4.length), this.mulTo(f4, a3); + }, o2.prototype.mulf = function(f4) { var a3 = new o2(null); - return a3.words = new Array(this.length + f3.length), G2(this, f3, a3); - }, o2.prototype.imul = function(f3) { - return this.clone().mulTo(f3, this); - }, o2.prototype.imuln = function(f3) { - var a3 = f3 < 0; - a3 && (f3 = -f3), i3(typeof f3 == "number"), i3(f3 < 67108864); + return a3.words = new Array(this.length + f4.length), G2(this, f4, a3); + }, o2.prototype.imul = function(f4) { + return this.clone().mulTo(f4, this); + }, o2.prototype.imuln = function(f4) { + var a3 = f4 < 0; + a3 && (f4 = -f4), i2(typeof f4 == "number"), i2(f4 < 67108864); for (var c2 = 0, d4 = 0; d4 < this.length; d4++) { - var m3 = (this.words[d4] | 0) * f3, x3 = (m3 & 67108863) + (c2 & 67108863); + var m3 = (this.words[d4] | 0) * f4, x3 = (m3 & 67108863) + (c2 & 67108863); c2 >>= 26, c2 += m3 / 67108864 | 0, c2 += x3 >>> 26, this.words[d4] = x3 & 67108863; } return c2 !== 0 && (this.words[d4] = c2, this.length++), a3 ? this.ineg() : this; - }, o2.prototype.muln = function(f3) { - return this.clone().imuln(f3); + }, o2.prototype.muln = function(f4) { + return this.clone().imuln(f4); }, o2.prototype.sqr = function() { return this.mul(this); }, o2.prototype.isqr = function() { return this.imul(this.clone()); - }, o2.prototype.pow = function(f3) { - var a3 = D2(f3); + }, o2.prototype.pow = function(f4) { + var a3 = D2(f4); if (a3.length === 0) return new o2(1); for (var c2 = this, d4 = 0; d4 < a3.length && a3[d4] === 0; d4++, c2 = c2.sqr()) @@ -105977,9 +35283,9 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def for (var m3 = c2.sqr(); d4 < a3.length; d4++, m3 = m3.sqr()) a3[d4] !== 0 && (c2 = c2.mul(m3)); return c2; - }, o2.prototype.iushln = function(f3) { - i3(typeof f3 == "number" && f3 >= 0); - var a3 = f3 % 26, c2 = (f3 - a3) / 26, d4 = 67108863 >>> 26 - a3 << 26 - a3, m3; + }, o2.prototype.iushln = function(f4) { + i2(typeof f4 == "number" && f4 >= 0); + var a3 = f4 % 26, c2 = (f4 - a3) / 26, d4 = 67108863 >>> 26 - a3 << 26 - a3, m3; if (a3 !== 0) { var x3 = 0; for (m3 = 0; m3 < this.length; m3++) { @@ -105996,13 +35302,13 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def this.length += c2; } return this._strip(); - }, o2.prototype.ishln = function(f3) { - return i3(this.negative === 0), this.iushln(f3); - }, o2.prototype.iushrn = function(f3, a3, c2) { - i3(typeof f3 == "number" && f3 >= 0); + }, o2.prototype.ishln = function(f4) { + return i2(this.negative === 0), this.iushln(f4); + }, o2.prototype.iushrn = function(f4, a3, c2) { + i2(typeof f4 == "number" && f4 >= 0); var d4; a3 ? d4 = (a3 - a3 % 26) / 26 : d4 = 0; - var m3 = f3 % 26, x3 = Math.min((f3 - m3) / 26, this.length), M3 = 67108863 ^ 67108863 >>> m3 << m3, l2 = c2; + var m3 = f4 % 26, x3 = Math.min((f4 - m3) / 26, this.length), M3 = 67108863 ^ 67108863 >>> m3 << m3, l2 = c2; if (d4 -= x3, d4 = Math.max(0, d4), l2) { for (var s2 = 0; s2 < x3; s2++) l2.words[s2] = this.words[s2]; @@ -106020,79 +35326,79 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def this.words[s2] = g3 << 26 - m3 | k2 >>> m3, g3 = k2 & M3; } return l2 && g3 !== 0 && (l2.words[l2.length++] = g3), this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip(); - }, o2.prototype.ishrn = function(f3, a3, c2) { - return i3(this.negative === 0), this.iushrn(f3, a3, c2); - }, o2.prototype.shln = function(f3) { - return this.clone().ishln(f3); - }, o2.prototype.ushln = function(f3) { - return this.clone().iushln(f3); - }, o2.prototype.shrn = function(f3) { - return this.clone().ishrn(f3); - }, o2.prototype.ushrn = function(f3) { - return this.clone().iushrn(f3); - }, o2.prototype.testn = function(f3) { - i3(typeof f3 == "number" && f3 >= 0); - var a3 = f3 % 26, c2 = (f3 - a3) / 26, d4 = 1 << a3; + }, o2.prototype.ishrn = function(f4, a3, c2) { + return i2(this.negative === 0), this.iushrn(f4, a3, c2); + }, o2.prototype.shln = function(f4) { + return this.clone().ishln(f4); + }, o2.prototype.ushln = function(f4) { + return this.clone().iushln(f4); + }, o2.prototype.shrn = function(f4) { + return this.clone().ishrn(f4); + }, o2.prototype.ushrn = function(f4) { + return this.clone().iushrn(f4); + }, o2.prototype.testn = function(f4) { + i2(typeof f4 == "number" && f4 >= 0); + var a3 = f4 % 26, c2 = (f4 - a3) / 26, d4 = 1 << a3; if (this.length <= c2) return false; var m3 = this.words[c2]; return !!(m3 & d4); - }, o2.prototype.imaskn = function(f3) { - i3(typeof f3 == "number" && f3 >= 0); - var a3 = f3 % 26, c2 = (f3 - a3) / 26; - if (i3(this.negative === 0, "imaskn works only with positive numbers"), this.length <= c2) + }, o2.prototype.imaskn = function(f4) { + i2(typeof f4 == "number" && f4 >= 0); + var a3 = f4 % 26, c2 = (f4 - a3) / 26; + if (i2(this.negative === 0, "imaskn works only with positive numbers"), this.length <= c2) return this; if (a3 !== 0 && c2++, this.length = Math.min(c2, this.length), a3 !== 0) { var d4 = 67108863 ^ 67108863 >>> a3 << a3; this.words[this.length - 1] &= d4; } return this._strip(); - }, o2.prototype.maskn = function(f3) { - return this.clone().imaskn(f3); - }, o2.prototype.iaddn = function(f3) { - return i3(typeof f3 == "number"), i3(f3 < 67108864), f3 < 0 ? this.isubn(-f3) : this.negative !== 0 ? this.length === 1 && (this.words[0] | 0) <= f3 ? (this.words[0] = f3 - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(f3), this.negative = 1, this) : this._iaddn(f3); - }, o2.prototype._iaddn = function(f3) { - this.words[0] += f3; + }, o2.prototype.maskn = function(f4) { + return this.clone().imaskn(f4); + }, o2.prototype.iaddn = function(f4) { + return i2(typeof f4 == "number"), i2(f4 < 67108864), f4 < 0 ? this.isubn(-f4) : this.negative !== 0 ? this.length === 1 && (this.words[0] | 0) <= f4 ? (this.words[0] = f4 - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(f4), this.negative = 1, this) : this._iaddn(f4); + }, o2.prototype._iaddn = function(f4) { + this.words[0] += f4; for (var a3 = 0; a3 < this.length && this.words[a3] >= 67108864; a3++) this.words[a3] -= 67108864, a3 === this.length - 1 ? this.words[a3 + 1] = 1 : this.words[a3 + 1]++; return this.length = Math.max(this.length, a3 + 1), this; - }, o2.prototype.isubn = function(f3) { - if (i3(typeof f3 == "number"), i3(f3 < 67108864), f3 < 0) - return this.iaddn(-f3); + }, o2.prototype.isubn = function(f4) { + if (i2(typeof f4 == "number"), i2(f4 < 67108864), f4 < 0) + return this.iaddn(-f4); if (this.negative !== 0) - return this.negative = 0, this.iaddn(f3), this.negative = 1, this; - if (this.words[0] -= f3, this.length === 1 && this.words[0] < 0) + return this.negative = 0, this.iaddn(f4), this.negative = 1, this; + if (this.words[0] -= f4, this.length === 1 && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1; else for (var a3 = 0; a3 < this.length && this.words[a3] < 0; a3++) this.words[a3] += 67108864, this.words[a3 + 1] -= 1; return this._strip(); - }, o2.prototype.addn = function(f3) { - return this.clone().iaddn(f3); - }, o2.prototype.subn = function(f3) { - return this.clone().isubn(f3); + }, o2.prototype.addn = function(f4) { + return this.clone().iaddn(f4); + }, o2.prototype.subn = function(f4) { + return this.clone().isubn(f4); }, o2.prototype.iabs = function() { return this.negative = 0, this; }, o2.prototype.abs = function() { return this.clone().iabs(); - }, o2.prototype._ishlnsubmul = function(f3, a3, c2) { - var d4 = f3.length + c2, m3; + }, o2.prototype._ishlnsubmul = function(f4, a3, c2) { + var d4 = f4.length + c2, m3; this._expand(d4); var x3, M3 = 0; - for (m3 = 0; m3 < f3.length; m3++) { + for (m3 = 0; m3 < f4.length; m3++) { x3 = (this.words[m3 + c2] | 0) + M3; - var l2 = (f3.words[m3] | 0) * a3; + var l2 = (f4.words[m3] | 0) * a3; x3 -= l2 & 67108863, M3 = (x3 >> 26) - (l2 / 67108864 | 0), this.words[m3 + c2] = x3 & 67108863; } for (; m3 < this.length - c2; m3++) x3 = (this.words[m3 + c2] | 0) + M3, M3 = x3 >> 26, this.words[m3 + c2] = x3 & 67108863; if (M3 === 0) return this._strip(); - for (i3(M3 === -1), M3 = 0, m3 = 0; m3 < this.length; m3++) + for (i2(M3 === -1), M3 = 0, m3 = 0; m3 < this.length; m3++) x3 = -(this.words[m3] | 0) + M3, M3 = x3 >> 26, this.words[m3] = x3 & 67108863; return this.negative = 1, this._strip(); - }, o2.prototype._wordDiv = function(f3, a3) { - var c2 = this.length - f3.length, d4 = this.clone(), m3 = f3, x3 = m3.words[m3.length - 1] | 0, M3 = this._countBits(x3); + }, o2.prototype._wordDiv = function(f4, a3) { + var c2 = this.length - f4.length, d4 = this.clone(), m3 = f4, x3 = m3.words[m3.length - 1] | 0, M3 = this._countBits(x3); c2 = 26 - M3, c2 !== 0 && (m3 = m3.ushln(c2), d4.iushln(c2), x3 = m3.words[m3.length - 1] | 0); var l2 = d4.length - m3.length, s2; if (a3 !== "mod") { @@ -106109,45 +35415,45 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def s2 && (s2.words[u2] = E2); } return s2 && s2._strip(), d4._strip(), a3 !== "div" && c2 !== 0 && d4.iushrn(c2), { div: s2 || null, mod: d4 }; - }, o2.prototype.divmod = function(f3, a3, c2) { - if (i3(!f3.isZero()), this.isZero()) + }, o2.prototype.divmod = function(f4, a3, c2) { + if (i2(!f4.isZero()), this.isZero()) return { div: new o2(0), mod: new o2(0) }; var d4, m3, x3; - return this.negative !== 0 && f3.negative === 0 ? (x3 = this.neg().divmod(f3, a3), a3 !== "mod" && (d4 = x3.div.neg()), a3 !== "div" && (m3 = x3.mod.neg(), c2 && m3.negative !== 0 && m3.iadd(f3)), { div: d4, mod: m3 }) : this.negative === 0 && f3.negative !== 0 ? (x3 = this.divmod(f3.neg(), a3), a3 !== "mod" && (d4 = x3.div.neg()), { div: d4, mod: x3.mod }) : this.negative & f3.negative ? (x3 = this.neg().divmod(f3.neg(), a3), a3 !== "div" && (m3 = x3.mod.neg(), c2 && m3.negative !== 0 && m3.isub(f3)), { div: x3.div, mod: m3 }) : f3.length > this.length || this.cmp(f3) < 0 ? { div: new o2(0), mod: this } : f3.length === 1 ? a3 === "div" ? { div: this.divn(f3.words[0]), mod: null } : a3 === "mod" ? { div: null, mod: new o2(this.modrn(f3.words[0])) } : { div: this.divn(f3.words[0]), mod: new o2(this.modrn(f3.words[0])) } : this._wordDiv(f3, a3); - }, o2.prototype.div = function(f3) { - return this.divmod(f3, "div", false).div; - }, o2.prototype.mod = function(f3) { - return this.divmod(f3, "mod", false).mod; - }, o2.prototype.umod = function(f3) { - return this.divmod(f3, "mod", true).mod; - }, o2.prototype.divRound = function(f3) { - var a3 = this.divmod(f3); + return this.negative !== 0 && f4.negative === 0 ? (x3 = this.neg().divmod(f4, a3), a3 !== "mod" && (d4 = x3.div.neg()), a3 !== "div" && (m3 = x3.mod.neg(), c2 && m3.negative !== 0 && m3.iadd(f4)), { div: d4, mod: m3 }) : this.negative === 0 && f4.negative !== 0 ? (x3 = this.divmod(f4.neg(), a3), a3 !== "mod" && (d4 = x3.div.neg()), { div: d4, mod: x3.mod }) : this.negative & f4.negative ? (x3 = this.neg().divmod(f4.neg(), a3), a3 !== "div" && (m3 = x3.mod.neg(), c2 && m3.negative !== 0 && m3.isub(f4)), { div: x3.div, mod: m3 }) : f4.length > this.length || this.cmp(f4) < 0 ? { div: new o2(0), mod: this } : f4.length === 1 ? a3 === "div" ? { div: this.divn(f4.words[0]), mod: null } : a3 === "mod" ? { div: null, mod: new o2(this.modrn(f4.words[0])) } : { div: this.divn(f4.words[0]), mod: new o2(this.modrn(f4.words[0])) } : this._wordDiv(f4, a3); + }, o2.prototype.div = function(f4) { + return this.divmod(f4, "div", false).div; + }, o2.prototype.mod = function(f4) { + return this.divmod(f4, "mod", false).mod; + }, o2.prototype.umod = function(f4) { + return this.divmod(f4, "mod", true).mod; + }, o2.prototype.divRound = function(f4) { + var a3 = this.divmod(f4); if (a3.mod.isZero()) return a3.div; - var c2 = a3.div.negative !== 0 ? a3.mod.isub(f3) : a3.mod, d4 = f3.ushrn(1), m3 = f3.andln(1), x3 = c2.cmp(d4); + var c2 = a3.div.negative !== 0 ? a3.mod.isub(f4) : a3.mod, d4 = f4.ushrn(1), m3 = f4.andln(1), x3 = c2.cmp(d4); return x3 < 0 || m3 === 1 && x3 === 0 ? a3.div : a3.div.negative !== 0 ? a3.div.isubn(1) : a3.div.iaddn(1); - }, o2.prototype.modrn = function(f3) { - var a3 = f3 < 0; - a3 && (f3 = -f3), i3(f3 <= 67108863); - for (var c2 = (1 << 26) % f3, d4 = 0, m3 = this.length - 1; m3 >= 0; m3--) - d4 = (c2 * d4 + (this.words[m3] | 0)) % f3; + }, o2.prototype.modrn = function(f4) { + var a3 = f4 < 0; + a3 && (f4 = -f4), i2(f4 <= 67108863); + for (var c2 = (1 << 26) % f4, d4 = 0, m3 = this.length - 1; m3 >= 0; m3--) + d4 = (c2 * d4 + (this.words[m3] | 0)) % f4; return a3 ? -d4 : d4; - }, o2.prototype.modn = function(f3) { - return this.modrn(f3); - }, o2.prototype.idivn = function(f3) { - var a3 = f3 < 0; - a3 && (f3 = -f3), i3(f3 <= 67108863); + }, o2.prototype.modn = function(f4) { + return this.modrn(f4); + }, o2.prototype.idivn = function(f4) { + var a3 = f4 < 0; + a3 && (f4 = -f4), i2(f4 <= 67108863); for (var c2 = 0, d4 = this.length - 1; d4 >= 0; d4--) { var m3 = (this.words[d4] | 0) + c2 * 67108864; - this.words[d4] = m3 / f3 | 0, c2 = m3 % f3; + this.words[d4] = m3 / f4 | 0, c2 = m3 % f4; } return this._strip(), a3 ? this.ineg() : this; - }, o2.prototype.divn = function(f3) { - return this.clone().idivn(f3); - }, o2.prototype.egcd = function(f3) { - i3(f3.negative === 0), i3(!f3.isZero()); - var a3 = this, c2 = f3.clone(); - a3.negative !== 0 ? a3 = a3.umod(f3) : a3 = a3.clone(); + }, o2.prototype.divn = function(f4) { + return this.clone().idivn(f4); + }, o2.prototype.egcd = function(f4) { + i2(f4.negative === 0), i2(!f4.isZero()); + var a3 = this, c2 = f4.clone(); + a3.negative !== 0 ? a3 = a3.umod(f4) : a3 = a3.clone(); for (var d4 = new o2(1), m3 = new o2(0), x3 = new o2(0), M3 = new o2(1), l2 = 0; a3.isEven() && c2.isEven(); ) a3.iushrn(1), c2.iushrn(1), ++l2; for (var s2 = c2.clone(), g3 = a3.clone(); !a3.isZero(); ) { @@ -106164,10 +35470,10 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def a3.cmp(c2) >= 0 ? (a3.isub(c2), d4.isub(x3), m3.isub(M3)) : (c2.isub(a3), x3.isub(d4), M3.isub(m3)); } return { a: x3, b: M3, gcd: c2.iushln(l2) }; - }, o2.prototype._invmp = function(f3) { - i3(f3.negative === 0), i3(!f3.isZero()); - var a3 = this, c2 = f3.clone(); - a3.negative !== 0 ? a3 = a3.umod(f3) : a3 = a3.clone(); + }, o2.prototype._invmp = function(f4) { + i2(f4.negative === 0), i2(!f4.isZero()); + var a3 = this, c2 = f4.clone(); + a3.negative !== 0 ? a3 = a3.umod(f4) : a3 = a3.clone(); for (var d4 = new o2(1), m3 = new o2(0), x3 = c2.clone(); a3.cmpn(1) > 0 && c2.cmpn(1) > 0; ) { for (var M3 = 0, l2 = 1; !(a3.words[0] & l2) && M3 < 26; ++M3, l2 <<= 1) ; @@ -106182,13 +35488,13 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def a3.cmp(c2) >= 0 ? (a3.isub(c2), d4.isub(m3)) : (c2.isub(a3), m3.isub(d4)); } var k2; - return a3.cmpn(1) === 0 ? k2 = d4 : k2 = m3, k2.cmpn(0) < 0 && k2.iadd(f3), k2; - }, o2.prototype.gcd = function(f3) { + return a3.cmpn(1) === 0 ? k2 = d4 : k2 = m3, k2.cmpn(0) < 0 && k2.iadd(f4), k2; + }, o2.prototype.gcd = function(f4) { if (this.isZero()) - return f3.abs(); - if (f3.isZero()) + return f4.abs(); + if (f4.isZero()) return this.abs(); - var a3 = this.clone(), c2 = f3.clone(); + var a3 = this.clone(), c2 = f4.clone(); a3.negative = 0, c2.negative = 0; for (var d4 = 0; a3.isEven() && c2.isEven(); d4++) a3.iushrn(1), c2.iushrn(1); @@ -106206,17 +35512,17 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def a3.isub(c2); } while (true); return c2.iushln(d4); - }, o2.prototype.invm = function(f3) { - return this.egcd(f3).a.umod(f3); + }, o2.prototype.invm = function(f4) { + return this.egcd(f4).a.umod(f4); }, o2.prototype.isEven = function() { return (this.words[0] & 1) === 0; }, o2.prototype.isOdd = function() { return (this.words[0] & 1) === 1; - }, o2.prototype.andln = function(f3) { - return this.words[0] & f3; - }, o2.prototype.bincn = function(f3) { - i3(typeof f3 == "number"); - var a3 = f3 % 26, c2 = (f3 - a3) / 26, d4 = 1 << a3; + }, o2.prototype.andln = function(f4) { + return this.words[0] & f4; + }, o2.prototype.bincn = function(f4) { + i2(typeof f4 == "number"); + var a3 = f4 % 26, c2 = (f4 - a3) / 26, d4 = 1 << a3; if (this.length <= c2) return this._expand(c2 + 1), this.words[c2] |= d4, this; for (var m3 = d4, x3 = c2; m3 !== 0 && x3 < this.length; x3++) { @@ -106226,8 +35532,8 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def return m3 !== 0 && (this.words[x3] = m3, this.length++), this; }, o2.prototype.isZero = function() { return this.length === 1 && this.words[0] === 0; - }, o2.prototype.cmpn = function(f3) { - var a3 = f3 < 0; + }, o2.prototype.cmpn = function(f4) { + var a3 = f4 < 0; if (this.negative !== 0 && !a3) return -1; if (this.negative === 0 && a3) @@ -106237,239 +35543,239 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def if (this.length > 1) c2 = 1; else { - a3 && (f3 = -f3), i3(f3 <= 67108863, "Number is too big"); + a3 && (f4 = -f4), i2(f4 <= 67108863, "Number is too big"); var d4 = this.words[0] | 0; - c2 = d4 === f3 ? 0 : d4 < f3 ? -1 : 1; + c2 = d4 === f4 ? 0 : d4 < f4 ? -1 : 1; } return this.negative !== 0 ? -c2 | 0 : c2; - }, o2.prototype.cmp = function(f3) { - if (this.negative !== 0 && f3.negative === 0) + }, o2.prototype.cmp = function(f4) { + if (this.negative !== 0 && f4.negative === 0) return -1; - if (this.negative === 0 && f3.negative !== 0) + if (this.negative === 0 && f4.negative !== 0) return 1; - var a3 = this.ucmp(f3); + var a3 = this.ucmp(f4); return this.negative !== 0 ? -a3 | 0 : a3; - }, o2.prototype.ucmp = function(f3) { - if (this.length > f3.length) + }, o2.prototype.ucmp = function(f4) { + if (this.length > f4.length) return 1; - if (this.length < f3.length) + if (this.length < f4.length) return -1; for (var a3 = 0, c2 = this.length - 1; c2 >= 0; c2--) { - var d4 = this.words[c2] | 0, m3 = f3.words[c2] | 0; + var d4 = this.words[c2] | 0, m3 = f4.words[c2] | 0; if (d4 !== m3) { d4 < m3 ? a3 = -1 : d4 > m3 && (a3 = 1); break; } } return a3; - }, o2.prototype.gtn = function(f3) { - return this.cmpn(f3) === 1; - }, o2.prototype.gt = function(f3) { - return this.cmp(f3) === 1; - }, o2.prototype.gten = function(f3) { - return this.cmpn(f3) >= 0; - }, o2.prototype.gte = function(f3) { - return this.cmp(f3) >= 0; - }, o2.prototype.ltn = function(f3) { - return this.cmpn(f3) === -1; - }, o2.prototype.lt = function(f3) { - return this.cmp(f3) === -1; - }, o2.prototype.lten = function(f3) { - return this.cmpn(f3) <= 0; - }, o2.prototype.lte = function(f3) { - return this.cmp(f3) <= 0; - }, o2.prototype.eqn = function(f3) { - return this.cmpn(f3) === 0; - }, o2.prototype.eq = function(f3) { - return this.cmp(f3) === 0; - }, o2.red = function(f3) { - return new Y2(f3); - }, o2.prototype.toRed = function(f3) { - return i3(!this.red, "Already a number in reduction context"), i3(this.negative === 0, "red works only with positives"), f3.convertTo(this)._forceRed(f3); + }, o2.prototype.gtn = function(f4) { + return this.cmpn(f4) === 1; + }, o2.prototype.gt = function(f4) { + return this.cmp(f4) === 1; + }, o2.prototype.gten = function(f4) { + return this.cmpn(f4) >= 0; + }, o2.prototype.gte = function(f4) { + return this.cmp(f4) >= 0; + }, o2.prototype.ltn = function(f4) { + return this.cmpn(f4) === -1; + }, o2.prototype.lt = function(f4) { + return this.cmp(f4) === -1; + }, o2.prototype.lten = function(f4) { + return this.cmpn(f4) <= 0; + }, o2.prototype.lte = function(f4) { + return this.cmp(f4) <= 0; + }, o2.prototype.eqn = function(f4) { + return this.cmpn(f4) === 0; + }, o2.prototype.eq = function(f4) { + return this.cmp(f4) === 0; + }, o2.red = function(f4) { + return new Y2(f4); + }, o2.prototype.toRed = function(f4) { + return i2(!this.red, "Already a number in reduction context"), i2(this.negative === 0, "red works only with positives"), f4.convertTo(this)._forceRed(f4); }, o2.prototype.fromRed = function() { - return i3(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); - }, o2.prototype._forceRed = function(f3) { - return this.red = f3, this; - }, o2.prototype.forceRed = function(f3) { - return i3(!this.red, "Already a number in reduction context"), this._forceRed(f3); - }, o2.prototype.redAdd = function(f3) { - return i3(this.red, "redAdd works only with red numbers"), this.red.add(this, f3); - }, o2.prototype.redIAdd = function(f3) { - return i3(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, f3); - }, o2.prototype.redSub = function(f3) { - return i3(this.red, "redSub works only with red numbers"), this.red.sub(this, f3); - }, o2.prototype.redISub = function(f3) { - return i3(this.red, "redISub works only with red numbers"), this.red.isub(this, f3); - }, o2.prototype.redShl = function(f3) { - return i3(this.red, "redShl works only with red numbers"), this.red.shl(this, f3); - }, o2.prototype.redMul = function(f3) { - return i3(this.red, "redMul works only with red numbers"), this.red._verify2(this, f3), this.red.mul(this, f3); - }, o2.prototype.redIMul = function(f3) { - return i3(this.red, "redMul works only with red numbers"), this.red._verify2(this, f3), this.red.imul(this, f3); + return i2(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); + }, o2.prototype._forceRed = function(f4) { + return this.red = f4, this; + }, o2.prototype.forceRed = function(f4) { + return i2(!this.red, "Already a number in reduction context"), this._forceRed(f4); + }, o2.prototype.redAdd = function(f4) { + return i2(this.red, "redAdd works only with red numbers"), this.red.add(this, f4); + }, o2.prototype.redIAdd = function(f4) { + return i2(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, f4); + }, o2.prototype.redSub = function(f4) { + return i2(this.red, "redSub works only with red numbers"), this.red.sub(this, f4); + }, o2.prototype.redISub = function(f4) { + return i2(this.red, "redISub works only with red numbers"), this.red.isub(this, f4); + }, o2.prototype.redShl = function(f4) { + return i2(this.red, "redShl works only with red numbers"), this.red.shl(this, f4); + }, o2.prototype.redMul = function(f4) { + return i2(this.red, "redMul works only with red numbers"), this.red._verify2(this, f4), this.red.mul(this, f4); + }, o2.prototype.redIMul = function(f4) { + return i2(this.red, "redMul works only with red numbers"), this.red._verify2(this, f4), this.red.imul(this, f4); }, o2.prototype.redSqr = function() { - return i3(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); + return i2(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); }, o2.prototype.redISqr = function() { - return i3(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); + return i2(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); }, o2.prototype.redSqrt = function() { - return i3(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); + return i2(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); }, o2.prototype.redInvm = function() { - return i3(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); + return i2(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); }, o2.prototype.redNeg = function() { - return i3(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); - }, o2.prototype.redPow = function(f3) { - return i3(this.red && !f3.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, f3); + return i2(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); + }, o2.prototype.redPow = function(f4) { + return i2(this.red && !f4.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, f4); }; var H2 = { k256: null, p224: null, p192: null, p25519: null }; - function L4(b2, f3) { - this.name = b2, this.p = new o2(f3, 16), this.n = this.p.bitLength(), this.k = new o2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); + function L4(b2, f4) { + this.name = b2, this.p = new o2(f4, 16), this.n = this.p.bitLength(), this.k = new o2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); } L4.prototype._tmp = function() { - var f3 = new o2(null); - return f3.words = new Array(Math.ceil(this.n / 13)), f3; - }, L4.prototype.ireduce = function(f3) { - var a3 = f3, c2; + var f4 = new o2(null); + return f4.words = new Array(Math.ceil(this.n / 13)), f4; + }, L4.prototype.ireduce = function(f4) { + var a3 = f4, c2; do this.split(a3, this.tmp), a3 = this.imulK(a3), a3 = a3.iadd(this.tmp), c2 = a3.bitLength(); while (c2 > this.n); var d4 = c2 < this.n ? -1 : a3.ucmp(this.p); return d4 === 0 ? (a3.words[0] = 0, a3.length = 1) : d4 > 0 ? a3.isub(this.p) : a3.strip !== void 0 ? a3.strip() : a3._strip(), a3; - }, L4.prototype.split = function(f3, a3) { - f3.iushrn(this.n, 0, a3); - }, L4.prototype.imulK = function(f3) { - return f3.imul(this.k); + }, L4.prototype.split = function(f4, a3) { + f4.iushrn(this.n, 0, a3); + }, L4.prototype.imulK = function(f4) { + return f4.imul(this.k); }; function Pt2() { L4.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); } - n4(Pt2, L4), Pt2.prototype.split = function(f3, a3) { - for (var c2 = 4194303, d4 = Math.min(f3.length, 9), m3 = 0; m3 < d4; m3++) - a3.words[m3] = f3.words[m3]; - if (a3.length = d4, f3.length <= 9) { - f3.words[0] = 0, f3.length = 1; + n5(Pt2, L4), Pt2.prototype.split = function(f4, a3) { + for (var c2 = 4194303, d4 = Math.min(f4.length, 9), m3 = 0; m3 < d4; m3++) + a3.words[m3] = f4.words[m3]; + if (a3.length = d4, f4.length <= 9) { + f4.words[0] = 0, f4.length = 1; return; } - var x3 = f3.words[9]; - for (a3.words[a3.length++] = x3 & c2, m3 = 10; m3 < f3.length; m3++) { - var M3 = f3.words[m3] | 0; - f3.words[m3 - 10] = (M3 & c2) << 4 | x3 >>> 22, x3 = M3; + var x3 = f4.words[9]; + for (a3.words[a3.length++] = x3 & c2, m3 = 10; m3 < f4.length; m3++) { + var M3 = f4.words[m3] | 0; + f4.words[m3 - 10] = (M3 & c2) << 4 | x3 >>> 22, x3 = M3; } - x3 >>>= 22, f3.words[m3 - 10] = x3, x3 === 0 && f3.length > 10 ? f3.length -= 10 : f3.length -= 9; - }, Pt2.prototype.imulK = function(f3) { - f3.words[f3.length] = 0, f3.words[f3.length + 1] = 0, f3.length += 2; - for (var a3 = 0, c2 = 0; c2 < f3.length; c2++) { - var d4 = f3.words[c2] | 0; - a3 += d4 * 977, f3.words[c2] = a3 & 67108863, a3 = d4 * 64 + (a3 / 67108864 | 0); + x3 >>>= 22, f4.words[m3 - 10] = x3, x3 === 0 && f4.length > 10 ? f4.length -= 10 : f4.length -= 9; + }, Pt2.prototype.imulK = function(f4) { + f4.words[f4.length] = 0, f4.words[f4.length + 1] = 0, f4.length += 2; + for (var a3 = 0, c2 = 0; c2 < f4.length; c2++) { + var d4 = f4.words[c2] | 0; + a3 += d4 * 977, f4.words[c2] = a3 & 67108863, a3 = d4 * 64 + (a3 / 67108864 | 0); } - return f3.words[f3.length - 1] === 0 && (f3.length--, f3.words[f3.length - 1] === 0 && f3.length--), f3; + return f4.words[f4.length - 1] === 0 && (f4.length--, f4.words[f4.length - 1] === 0 && f4.length--), f4; }; function W2() { L4.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); } - n4(W2, L4); + n5(W2, L4); function Rt2() { L4.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); } - n4(Rt2, L4); + n5(Rt2, L4); function Vt2() { L4.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); } - n4(Vt2, L4), Vt2.prototype.imulK = function(f3) { - for (var a3 = 0, c2 = 0; c2 < f3.length; c2++) { - var d4 = (f3.words[c2] | 0) * 19 + a3, m3 = d4 & 67108863; - d4 >>>= 26, f3.words[c2] = m3, a3 = d4; + n5(Vt2, L4), Vt2.prototype.imulK = function(f4) { + for (var a3 = 0, c2 = 0; c2 < f4.length; c2++) { + var d4 = (f4.words[c2] | 0) * 19 + a3, m3 = d4 & 67108863; + d4 >>>= 26, f4.words[c2] = m3, a3 = d4; } - return a3 !== 0 && (f3.words[f3.length++] = a3), f3; - }, o2._prime = function(f3) { - if (H2[f3]) - return H2[f3]; + return a3 !== 0 && (f4.words[f4.length++] = a3), f4; + }, o2._prime = function(f4) { + if (H2[f4]) + return H2[f4]; var a3; - if (f3 === "k256") + if (f4 === "k256") a3 = new Pt2(); - else if (f3 === "p224") + else if (f4 === "p224") a3 = new W2(); - else if (f3 === "p192") + else if (f4 === "p192") a3 = new Rt2(); - else if (f3 === "p25519") + else if (f4 === "p25519") a3 = new Vt2(); else - throw new Error("Unknown prime " + f3); - return H2[f3] = a3, a3; + throw new Error("Unknown prime " + f4); + return H2[f4] = a3, a3; }; function Y2(b2) { if (typeof b2 == "string") { - var f3 = o2._prime(b2); - this.m = f3.p, this.prime = f3; + var f4 = o2._prime(b2); + this.m = f4.p, this.prime = f4; } else - i3(b2.gtn(1), "modulus must be greater than 1"), this.m = b2, this.prime = null; - } - Y2.prototype._verify1 = function(f3) { - i3(f3.negative === 0, "red works only with positives"), i3(f3.red, "red works only with red numbers"); - }, Y2.prototype._verify2 = function(f3, a3) { - i3((f3.negative | a3.negative) === 0, "red works only with positives"), i3(f3.red && f3.red === a3.red, "red works only with red numbers"); - }, Y2.prototype.imod = function(f3) { - return this.prime ? this.prime.ireduce(f3)._forceRed(this) : (w2(f3, f3.umod(this.m)._forceRed(this)), f3); - }, Y2.prototype.neg = function(f3) { - return f3.isZero() ? f3.clone() : this.m.sub(f3)._forceRed(this); - }, Y2.prototype.add = function(f3, a3) { - this._verify2(f3, a3); - var c2 = f3.add(a3); + i2(b2.gtn(1), "modulus must be greater than 1"), this.m = b2, this.prime = null; + } + Y2.prototype._verify1 = function(f4) { + i2(f4.negative === 0, "red works only with positives"), i2(f4.red, "red works only with red numbers"); + }, Y2.prototype._verify2 = function(f4, a3) { + i2((f4.negative | a3.negative) === 0, "red works only with positives"), i2(f4.red && f4.red === a3.red, "red works only with red numbers"); + }, Y2.prototype.imod = function(f4) { + return this.prime ? this.prime.ireduce(f4)._forceRed(this) : (w2(f4, f4.umod(this.m)._forceRed(this)), f4); + }, Y2.prototype.neg = function(f4) { + return f4.isZero() ? f4.clone() : this.m.sub(f4)._forceRed(this); + }, Y2.prototype.add = function(f4, a3) { + this._verify2(f4, a3); + var c2 = f4.add(a3); return c2.cmp(this.m) >= 0 && c2.isub(this.m), c2._forceRed(this); - }, Y2.prototype.iadd = function(f3, a3) { - this._verify2(f3, a3); - var c2 = f3.iadd(a3); + }, Y2.prototype.iadd = function(f4, a3) { + this._verify2(f4, a3); + var c2 = f4.iadd(a3); return c2.cmp(this.m) >= 0 && c2.isub(this.m), c2; - }, Y2.prototype.sub = function(f3, a3) { - this._verify2(f3, a3); - var c2 = f3.sub(a3); + }, Y2.prototype.sub = function(f4, a3) { + this._verify2(f4, a3); + var c2 = f4.sub(a3); return c2.cmpn(0) < 0 && c2.iadd(this.m), c2._forceRed(this); - }, Y2.prototype.isub = function(f3, a3) { - this._verify2(f3, a3); - var c2 = f3.isub(a3); + }, Y2.prototype.isub = function(f4, a3) { + this._verify2(f4, a3); + var c2 = f4.isub(a3); return c2.cmpn(0) < 0 && c2.iadd(this.m), c2; - }, Y2.prototype.shl = function(f3, a3) { - return this._verify1(f3), this.imod(f3.ushln(a3)); - }, Y2.prototype.imul = function(f3, a3) { - return this._verify2(f3, a3), this.imod(f3.imul(a3)); - }, Y2.prototype.mul = function(f3, a3) { - return this._verify2(f3, a3), this.imod(f3.mul(a3)); - }, Y2.prototype.isqr = function(f3) { - return this.imul(f3, f3.clone()); - }, Y2.prototype.sqr = function(f3) { - return this.mul(f3, f3); - }, Y2.prototype.sqrt = function(f3) { - if (f3.isZero()) - return f3.clone(); + }, Y2.prototype.shl = function(f4, a3) { + return this._verify1(f4), this.imod(f4.ushln(a3)); + }, Y2.prototype.imul = function(f4, a3) { + return this._verify2(f4, a3), this.imod(f4.imul(a3)); + }, Y2.prototype.mul = function(f4, a3) { + return this._verify2(f4, a3), this.imod(f4.mul(a3)); + }, Y2.prototype.isqr = function(f4) { + return this.imul(f4, f4.clone()); + }, Y2.prototype.sqr = function(f4) { + return this.mul(f4, f4); + }, Y2.prototype.sqrt = function(f4) { + if (f4.isZero()) + return f4.clone(); var a3 = this.m.andln(3); - if (i3(a3 % 2 === 1), a3 === 3) { + if (i2(a3 % 2 === 1), a3 === 3) { var c2 = this.m.add(new o2(1)).iushrn(2); - return this.pow(f3, c2); + return this.pow(f4, c2); } for (var d4 = this.m.subn(1), m3 = 0; !d4.isZero() && d4.andln(1) === 0; ) m3++, d4.iushrn(1); - i3(!d4.isZero()); + i2(!d4.isZero()); var x3 = new o2(1).toRed(this), M3 = x3.redNeg(), l2 = this.m.subn(1).iushrn(1), s2 = this.m.bitLength(); for (s2 = new o2(2 * s2 * s2).toRed(this); this.pow(s2, l2).cmp(M3) !== 0; ) s2.redIAdd(M3); - for (var g3 = this.pow(s2, d4), k2 = this.pow(f3, d4.addn(1).iushrn(1)), u2 = this.pow(f3, d4), E2 = m3; u2.cmp(x3) !== 0; ) { + for (var g3 = this.pow(s2, d4), k2 = this.pow(f4, d4.addn(1).iushrn(1)), u2 = this.pow(f4, d4), E2 = m3; u2.cmp(x3) !== 0; ) { for (var _3 = u2, B2 = 0; _3.cmp(x3) !== 0; B2++) _3 = _3.redSqr(); - i3(B2 < E2); + i2(B2 < E2); var R3 = this.pow(g3, new o2(1).iushln(E2 - B2 - 1)); k2 = k2.redMul(R3), g3 = R3.redSqr(), u2 = u2.redMul(g3), E2 = B2; } return k2; - }, Y2.prototype.invm = function(f3) { - var a3 = f3._invmp(this.m); + }, Y2.prototype.invm = function(f4) { + var a3 = f4._invmp(this.m); return a3.negative !== 0 ? (a3.negative = 0, this.imod(a3).redNeg()) : this.imod(a3); - }, Y2.prototype.pow = function(f3, a3) { + }, Y2.prototype.pow = function(f4, a3) { if (a3.isZero()) return new o2(1).toRed(this); if (a3.cmpn(1) === 0) - return f3.clone(); + return f4.clone(); var c2 = 4, d4 = new Array(1 << c2); - d4[0] = new o2(1).toRed(this), d4[1] = f3; + d4[0] = new o2(1).toRed(this), d4[1] = f4; for (var m3 = 2; m3 < d4.length; m3++) - d4[m3] = this.mul(d4[m3 - 1], f3); + d4[m3] = this.mul(d4[m3 - 1], f4); var x3 = d4[0], M3 = 0, l2 = 0, s2 = a3.bitLength() % 26; for (s2 === 0 && (s2 = 26), m3 = a3.length - 1; m3 >= 0; m3--) { for (var g3 = a3.words[m3], k2 = s2 - 1; k2 >= 0; k2--) { @@ -106483,35 +35789,35 @@ var Xn = { exports: {} }, ks$1 = {}, qs$2 = Object.freeze({ __proto__: null, def s2 = 26; } return x3; - }, Y2.prototype.convertTo = function(f3) { - var a3 = f3.umod(this.m); - return a3 === f3 ? a3.clone() : a3; - }, Y2.prototype.convertFrom = function(f3) { - var a3 = f3.clone(); + }, Y2.prototype.convertTo = function(f4) { + var a3 = f4.umod(this.m); + return a3 === f4 ? a3.clone() : a3; + }, Y2.prototype.convertFrom = function(f4) { + var a3 = f4.clone(); return a3.red = null, a3; - }, o2.mont = function(f3) { - return new Wt2(f3); + }, o2.mont = function(f4) { + return new Wt2(f4); }; function Wt2(b2) { Y2.call(this, b2), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new o2(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); } - n4(Wt2, Y2), Wt2.prototype.convertTo = function(f3) { - return this.imod(f3.ushln(this.shift)); - }, Wt2.prototype.convertFrom = function(f3) { - var a3 = this.imod(f3.mul(this.rinv)); + n5(Wt2, Y2), Wt2.prototype.convertTo = function(f4) { + return this.imod(f4.ushln(this.shift)); + }, Wt2.prototype.convertFrom = function(f4) { + var a3 = this.imod(f4.mul(this.rinv)); return a3.red = null, a3; - }, Wt2.prototype.imul = function(f3, a3) { - if (f3.isZero() || a3.isZero()) - return f3.words[0] = 0, f3.length = 1, f3; - var c2 = f3.imul(a3), d4 = c2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), m3 = c2.isub(d4).iushrn(this.shift), x3 = m3; + }, Wt2.prototype.imul = function(f4, a3) { + if (f4.isZero() || a3.isZero()) + return f4.words[0] = 0, f4.length = 1, f4; + var c2 = f4.imul(a3), d4 = c2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), m3 = c2.isub(d4).iushrn(this.shift), x3 = m3; return m3.cmp(this.m) >= 0 ? x3 = m3.isub(this.m) : m3.cmpn(0) < 0 && (x3 = m3.iadd(this.m)), x3._forceRed(this); - }, Wt2.prototype.mul = function(f3, a3) { - if (f3.isZero() || a3.isZero()) + }, Wt2.prototype.mul = function(f4, a3) { + if (f4.isZero() || a3.isZero()) return new o2(0)._forceRed(this); - var c2 = f3.mul(a3), d4 = c2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), m3 = c2.isub(d4).iushrn(this.shift), x3 = m3; + var c2 = f4.mul(a3), d4 = c2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), m3 = c2.isub(d4).iushrn(this.shift), x3 = m3; return m3.cmp(this.m) >= 0 ? x3 = m3.isub(this.m) : m3.cmpn(0) < 0 && (x3 = m3.iadd(this.m)), x3._forceRed(this); - }, Wt2.prototype.invm = function(f3) { - var a3 = this.imod(f3._invmp(this.m).mul(this.r2)); + }, Wt2.prototype.invm = function(f4) { + var a3 = this.imod(f4._invmp(this.m).mul(this.r2)); return a3._forceRed(this); }; })(e18, Kn); @@ -106637,13 +35943,13 @@ class V2 { return V2.from(Kt$1(r2)); if (r2) if (r2.toHexString) { - const i3 = r2.toHexString(); - if (typeof i3 == "string") - return V2.from(i3); + const i2 = r2.toHexString(); + if (typeof i2 == "string") + return V2.from(i2); } else { - let i3 = r2._hex; - if (i3 == null && r2.type === "BigNumber" && (i3 = r2.hex), typeof i3 == "string" && (Jt$1(i3) || i3[0] === "-" && Jt$1(i3.substring(1)))) - return V2.from(i3); + let i2 = r2._hex; + if (i2 == null && r2.type === "BigNumber" && (i2 = r2.hex), typeof i2 == "string" && (Jt$1(i2) || i2[0] === "-" && Jt$1(i2.substring(1)))) + return V2.from(i2); } return Ae$1.throwArgumentError("invalid BigNumber value", "value", t2); } @@ -106670,21 +35976,21 @@ function j$2(e18) { return t2[0] === "-" ? new Dr$1("-" + t2.substring(3), 16) : new Dr$1(t2.substring(2), 16); } function $t$1(e18, t2, r2) { - const i3 = { fault: e18, operation: t2 }; - return r2 != null && (i3.value = r2), Ae$1.throwError(e18, z$2.errors.NUMERIC_FAULT, i3); + const i2 = { fault: e18, operation: t2 }; + return r2 != null && (i2.value = r2), Ae$1.throwError(e18, z$2.errors.NUMERIC_FAULT, i2); } function Ls$1(e18) { return new Dr$1(e18, 36).toString(16); } const Ht$1 = new z$2($n), Ar$1 = {}, ef = V2.from(0), rf = V2.from(-1); -function nf(e18, t2, r2, i3) { - const n4 = { fault: t2, operation: r2 }; - return i3 !== void 0 && (n4.value = i3), Ht$1.throwError(e18, z$2.errors.NUMERIC_FAULT, n4); +function nf(e18, t2, r2, i2) { + const n5 = { fault: t2, operation: r2 }; + return i2 !== void 0 && (n5.value = i2), Ht$1.throwError(e18, z$2.errors.NUMERIC_FAULT, n5); } let br$1 = "0"; for (; br$1.length < 256; ) br$1 += br$1; -function _i2(e18) { +function _i$1(e18) { if (typeof e18 != "number") try { e18 = V2.from(e18).toNumber(); @@ -106694,106 +36000,106 @@ function _i2(e18) { } function Bi$1(e18, t2) { t2 == null && (t2 = 0); - const r2 = _i2(t2); + const r2 = _i$1(t2); e18 = V2.from(e18); - const i3 = e18.lt(ef); - i3 && (e18 = e18.mul(rf)); - let n4 = e18.mod(r2).toString(); - for (; n4.length < r2.length - 1; ) - n4 = "0" + n4; - n4 = n4.match(/^([0-9]*[1-9]|0)(0*)/)[1]; + const i2 = e18.lt(ef); + i2 && (e18 = e18.mul(rf)); + let n5 = e18.mod(r2).toString(); + for (; n5.length < r2.length - 1; ) + n5 = "0" + n5; + n5 = n5.match(/^([0-9]*[1-9]|0)(0*)/)[1]; const o2 = e18.div(r2).toString(); - return r2.length === 1 ? e18 = o2 : e18 = o2 + "." + n4, i3 && (e18 = "-" + e18), e18; + return r2.length === 1 ? e18 = o2 : e18 = o2 + "." + n5, i2 && (e18 = "-" + e18), e18; } function be$2(e18, t2) { t2 == null && (t2 = 0); - const r2 = _i2(t2); + const r2 = _i$1(t2); (typeof e18 != "string" || !e18.match(/^-?[0-9.]+$/)) && Ht$1.throwArgumentError("invalid decimal value", "value", e18); - const i3 = e18.substring(0, 1) === "-"; - i3 && (e18 = e18.substring(1)), e18 === "." && Ht$1.throwArgumentError("missing value", "value", e18); - const n4 = e18.split("."); - n4.length > 2 && Ht$1.throwArgumentError("too many decimal points", "value", e18); - let o2 = n4[0], h4 = n4[1]; + const i2 = e18.substring(0, 1) === "-"; + i2 && (e18 = e18.substring(1)), e18 === "." && Ht$1.throwArgumentError("missing value", "value", e18); + const n5 = e18.split("."); + n5.length > 2 && Ht$1.throwArgumentError("too many decimal points", "value", e18); + let o2 = n5[0], h4 = n5[1]; for (o2 || (o2 = "0"), h4 || (h4 = "0"); h4[h4.length - 1] === "0"; ) h4 = h4.substring(0, h4.length - 1); for (h4.length > r2.length - 1 && nf("fractional component exceeds decimals", "underflow", "parseFixed"), h4 === "" && (h4 = "0"); h4.length < r2.length - 1; ) h4 += "0"; const p3 = V2.from(o2), A2 = V2.from(h4); let v6 = p3.mul(r2).add(A2); - return i3 && (v6 = v6.mul(rf)), v6; + return i2 && (v6 = v6.mul(rf)), v6; } let vr$1 = class vr { - constructor(t2, r2, i3, n4) { - t2 !== Ar$1 && Ht$1.throwError("cannot use FixedFormat constructor; use FixedFormat.from", z$2.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.signed = r2, this.width = i3, this.decimals = n4, this.name = (r2 ? "" : "u") + "fixed" + String(i3) + "x" + String(n4), this._multiplier = _i2(n4), Object.freeze(this); + constructor(t2, r2, i2, n5) { + t2 !== Ar$1 && Ht$1.throwError("cannot use FixedFormat constructor; use FixedFormat.from", z$2.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.signed = r2, this.width = i2, this.decimals = n5, this.name = (r2 ? "" : "u") + "fixed" + String(i2) + "x" + String(n5), this._multiplier = _i$1(n5), Object.freeze(this); } static from(t2) { if (t2 instanceof vr) return t2; typeof t2 == "number" && (t2 = `fixed128x${t2}`); - let r2 = true, i3 = 128, n4 = 18; + let r2 = true, i2 = 128, n5 = 18; if (typeof t2 == "string") { if (t2 !== "fixed") if (t2 === "ufixed") r2 = false; else { const o2 = t2.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - o2 || Ht$1.throwArgumentError("invalid fixed format", "format", t2), r2 = o2[1] !== "u", i3 = parseInt(o2[2]), n4 = parseInt(o2[3]); + o2 || Ht$1.throwArgumentError("invalid fixed format", "format", t2), r2 = o2[1] !== "u", i2 = parseInt(o2[2]), n5 = parseInt(o2[3]); } } else if (t2) { const o2 = (h4, p3, A2) => t2[h4] == null ? A2 : (typeof t2[h4] !== p3 && Ht$1.throwArgumentError("invalid fixed format (" + h4 + " not " + p3 + ")", "format." + h4, t2[h4]), t2[h4]); - r2 = o2("signed", "boolean", r2), i3 = o2("width", "number", i3), n4 = o2("decimals", "number", n4); + r2 = o2("signed", "boolean", r2), i2 = o2("width", "number", i2), n5 = o2("decimals", "number", n5); } - return i3 % 8 && Ht$1.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", i3), n4 > 80 && Ht$1.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", n4), new vr(Ar$1, r2, i3, n4); + return i2 % 8 && Ht$1.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", i2), n5 > 80 && Ht$1.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", n5), new vr(Ar$1, r2, i2, n5); } }; let Ut$1 = class Ut2 { - constructor(t2, r2, i3, n4) { - t2 !== Ar$1 && Ht$1.throwError("cannot use FixedNumber constructor; use FixedNumber.from", z$2.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.format = n4, this._hex = r2, this._value = i3, this._isFixedNumber = true, Object.freeze(this); + constructor(t2, r2, i2, n5) { + t2 !== Ar$1 && Ht$1.throwError("cannot use FixedNumber constructor; use FixedNumber.from", z$2.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.format = n5, this._hex = r2, this._value = i2, this._isFixedNumber = true, Object.freeze(this); } _checkFormat(t2) { this.format.name !== t2.format.name && Ht$1.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", t2); } addUnsafe(t2) { this._checkFormat(t2); - const r2 = be$2(this._value, this.format.decimals), i3 = be$2(t2._value, t2.format.decimals); - return Ut2.fromValue(r2.add(i3), this.format.decimals, this.format); + const r2 = be$2(this._value, this.format.decimals), i2 = be$2(t2._value, t2.format.decimals); + return Ut2.fromValue(r2.add(i2), this.format.decimals, this.format); } subUnsafe(t2) { this._checkFormat(t2); - const r2 = be$2(this._value, this.format.decimals), i3 = be$2(t2._value, t2.format.decimals); - return Ut2.fromValue(r2.sub(i3), this.format.decimals, this.format); + const r2 = be$2(this._value, this.format.decimals), i2 = be$2(t2._value, t2.format.decimals); + return Ut2.fromValue(r2.sub(i2), this.format.decimals, this.format); } mulUnsafe(t2) { this._checkFormat(t2); - const r2 = be$2(this._value, this.format.decimals), i3 = be$2(t2._value, t2.format.decimals); - return Ut2.fromValue(r2.mul(i3).div(this.format._multiplier), this.format.decimals, this.format); + const r2 = be$2(this._value, this.format.decimals), i2 = be$2(t2._value, t2.format.decimals); + return Ut2.fromValue(r2.mul(i2).div(this.format._multiplier), this.format.decimals, this.format); } divUnsafe(t2) { this._checkFormat(t2); - const r2 = be$2(this._value, this.format.decimals), i3 = be$2(t2._value, t2.format.decimals); - return Ut2.fromValue(r2.mul(this.format._multiplier).div(i3), this.format.decimals, this.format); + const r2 = be$2(this._value, this.format.decimals), i2 = be$2(t2._value, t2.format.decimals); + return Ut2.fromValue(r2.mul(this.format._multiplier).div(i2), this.format.decimals, this.format); } floor() { const t2 = this.toString().split("."); t2.length === 1 && t2.push("0"); let r2 = Ut2.from(t2[0], this.format); - const i3 = !t2[1].match(/^(0*)$/); - return this.isNegative() && i3 && (r2 = r2.subUnsafe(ff.toFormat(r2.format))), r2; + const i2 = !t2[1].match(/^(0*)$/); + return this.isNegative() && i2 && (r2 = r2.subUnsafe(ff.toFormat(r2.format))), r2; } ceiling() { const t2 = this.toString().split("."); t2.length === 1 && t2.push("0"); let r2 = Ut2.from(t2[0], this.format); - const i3 = !t2[1].match(/^(0*)$/); - return !this.isNegative() && i3 && (r2 = r2.addUnsafe(ff.toFormat(r2.format))), r2; + const i2 = !t2[1].match(/^(0*)$/); + return !this.isNegative() && i2 && (r2 = r2.addUnsafe(ff.toFormat(r2.format))), r2; } round(t2) { t2 == null && (t2 = 0); const r2 = this.toString().split("."); if (r2.length === 1 && r2.push("0"), (t2 < 0 || t2 > 80 || t2 % 1) && Ht$1.throwArgumentError("invalid decimal count", "decimals", t2), r2[1].length <= t2) return this; - const i3 = Ut2.from("1" + br$1.substring(0, t2), this.format), n4 = zs$1.toFormat(this.format); - return this.mulUnsafe(i3).addUnsafe(n4).floor().divUnsafe(i3); + const i2 = Ut2.from("1" + br$1.substring(0, t2), this.format), n5 = zs$1.toFormat(this.format); + return this.mulUnsafe(i2).addUnsafe(n5).floor().divUnsafe(i2); } isZero() { return this._value === "0.0" || this._value === "0"; @@ -106817,27 +36123,27 @@ let Ut$1 = class Ut2 { toFormat(t2) { return Ut2.fromString(this._value, t2); } - static fromValue(t2, r2, i3) { - return i3 == null && r2 != null && !Hs$1(r2) && (i3 = r2, r2 = null), r2 == null && (r2 = 0), i3 == null && (i3 = "fixed"), Ut2.fromString(Bi$1(t2, r2), vr$1.from(i3)); + static fromValue(t2, r2, i2) { + return i2 == null && r2 != null && !Hs$1(r2) && (i2 = r2, r2 = null), r2 == null && (r2 = 0), i2 == null && (i2 = "fixed"), Ut2.fromString(Bi$1(t2, r2), vr$1.from(i2)); } static fromString(t2, r2) { r2 == null && (r2 = "fixed"); - const i3 = vr$1.from(r2), n4 = be$2(t2, i3.decimals); - !i3.signed && n4.lt(ef) && nf("unsigned value cannot be negative", "overflow", "value", t2); + const i2 = vr$1.from(r2), n5 = be$2(t2, i2.decimals); + !i2.signed && n5.lt(ef) && nf("unsigned value cannot be negative", "overflow", "value", t2); let o2 = null; - i3.signed ? o2 = n4.toTwos(i3.width).toHexString() : (o2 = n4.toHexString(), o2 = oe$2(o2, i3.width / 8)); - const h4 = Bi$1(n4, i3.decimals); - return new Ut2(Ar$1, o2, h4, i3); + i2.signed ? o2 = n5.toTwos(i2.width).toHexString() : (o2 = n5.toHexString(), o2 = oe$2(o2, i2.width / 8)); + const h4 = Bi$1(n5, i2.decimals); + return new Ut2(Ar$1, o2, h4, i2); } static fromBytes(t2, r2) { r2 == null && (r2 = "fixed"); - const i3 = vr$1.from(r2); - if (Ot$1(t2).length > i3.width / 8) + const i2 = vr$1.from(r2); + if (Ot$1(t2).length > i2.width / 8) throw new Error("overflow"); - let n4 = V2.from(t2); - i3.signed && (n4 = n4.fromTwos(i3.width)); - const o2 = n4.toTwos((i3.signed ? 0 : 1) + i3.width).toHexString(), h4 = Bi$1(n4, i3.decimals); - return new Ut2(Ar$1, o2, h4, i3); + let n5 = V2.from(t2); + i2.signed && (n5 = n5.fromTwos(i2.width)); + const o2 = n5.toTwos((i2.signed ? 0 : 1) + i2.width).toHexString(), h4 = Bi$1(n5, i2.decimals); + return new Ut2(Ar$1, o2, h4, i2); } static from(t2, r2) { if (typeof t2 == "string") @@ -106846,9 +36152,9 @@ let Ut$1 = class Ut2 { return Ut2.fromBytes(t2, r2); try { return Ut2.fromValue(t2, 0, r2); - } catch (i3) { - if (i3.code !== z$2.errors.INVALID_ARGUMENT) - throw i3; + } catch (i2) { + if (i2.code !== z$2.errors.INVALID_ARGUMENT) + throw i2; } return Ht$1.throwArgumentError("invalid FixedNumber value", "value", t2); } @@ -106868,21 +36174,21 @@ var fr$1; function Ci(e18, t2 = Fr$1.current) { t2 != Fr$1.current && (of.checkNormalize(), e18 = e18.normalize(t2)); let r2 = []; - for (let i3 = 0; i3 < e18.length; i3++) { - const n4 = e18.charCodeAt(i3); - if (n4 < 128) - r2.push(n4); - else if (n4 < 2048) - r2.push(n4 >> 6 | 192), r2.push(n4 & 63 | 128); - else if ((n4 & 64512) == 55296) { - i3++; - const o2 = e18.charCodeAt(i3); - if (i3 >= e18.length || (o2 & 64512) !== 56320) + for (let i2 = 0; i2 < e18.length; i2++) { + const n5 = e18.charCodeAt(i2); + if (n5 < 128) + r2.push(n5); + else if (n5 < 2048) + r2.push(n5 >> 6 | 192), r2.push(n5 & 63 | 128); + else if ((n5 & 64512) == 55296) { + i2++; + const o2 = e18.charCodeAt(i2); + if (i2 >= e18.length || (o2 & 64512) !== 56320) throw new Error("invalid utf-8 string"); - const h4 = 65536 + ((n4 & 1023) << 10) + (o2 & 1023); + const h4 = 65536 + ((n5 & 1023) << 10) + (o2 & 1023); r2.push(h4 >> 18 | 240), r2.push(h4 >> 12 & 63 | 128), r2.push(h4 >> 6 & 63 | 128), r2.push(h4 & 63 | 128); } else - r2.push(n4 >> 12 | 224), r2.push(n4 >> 6 & 63 | 128), r2.push(n4 & 63 | 128); + r2.push(n5 >> 12 | 224), r2.push(n5 >> 6 & 63 | 128), r2.push(n5 & 63 | 128); } return Ot$1(r2); } @@ -106895,22 +36201,22 @@ function Gs$1(e18) { return t2; } function Ri(e18, t2) { - t2 || (t2 = function(n4) { - return [parseInt(n4, 16)]; + t2 || (t2 = function(n5) { + return [parseInt(n5, 16)]; }); - let r2 = 0, i3 = {}; - return e18.split(",").forEach((n4) => { - let o2 = n4.split(":"); - r2 += parseInt(o2[0], 16), i3[r2] = t2(o2[1]); - }), i3; + let r2 = 0, i2 = {}; + return e18.split(",").forEach((n5) => { + let o2 = n5.split(":"); + r2 += parseInt(o2[0], 16), i2[r2] = t2(o2[1]); + }), i2; } function af(e18) { let t2 = 0; return e18.split(",").map((r2) => { - let i3 = r2.split("-"); - i3.length === 1 ? i3[1] = "0" : i3[1] === "" && (i3[1] = "1"); - let n4 = t2 + parseInt(i3[0], 16); - return t2 = parseInt(i3[1], 16), { l: n4, h: t2 }; + let i2 = r2.split("-"); + i2.length === 1 ? i2[1] = "0" : i2[1] === "" && (i2[1] = "1"); + let n5 = t2 + parseInt(i2[0], 16); + return t2 = parseInt(i2[1], 16), { l: n5, h: t2 }; }); } af("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"), "ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e18) => parseInt(e18, 16)), Ri("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"), Ri("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"), Ri("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D", Gs$1), af("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001"); @@ -106923,18 +36229,18 @@ function Ys$1(e18) { } function hf(e18, t2) { t2 == null && (t2 = 1); - const r2 = [], i3 = r2.forEach, n4 = function(o2, h4) { - i3.call(o2, function(p3) { - h4 > 0 && Array.isArray(p3) ? n4(p3, h4 - 1) : r2.push(p3); + const r2 = [], i2 = r2.forEach, n5 = function(o2, h4) { + i2.call(o2, function(p3) { + h4 > 0 && Array.isArray(p3) ? n5(p3, h4 - 1) : r2.push(p3); }); }; - return n4(e18, t2), r2; + return n5(e18, t2), r2; } function Vs$1(e18) { const t2 = {}; for (let r2 = 0; r2 < e18.length; r2++) { - const i3 = e18[r2]; - t2[i3[0]] = i3[1]; + const i2 = e18[r2]; + t2[i2[0]] = i2[1]; } return t2; } @@ -106943,9 +36249,9 @@ function Ws$1(e18) { function r2() { return e18[t2++] << 8 | e18[t2++]; } - let i3 = r2(), n4 = 1, o2 = [0, 1]; - for (let H2 = 1; H2 < i3; H2++) - o2.push(n4 += r2()); + let i2 = r2(), n5 = 1, o2 = [0, 1]; + for (let H2 = 1; H2 < i2; H2++) + o2.push(n5 += r2()); let h4 = r2(), p3 = t2; t2 += h4; let A2 = 0, v6 = 0; @@ -106958,7 +36264,7 @@ function Ws$1(e18) { D2 = D2 << 1 | w2(); let U5 = [], J2 = 0, Bt2 = S4; for (; ; ) { - let H2 = Math.floor(((D2 - J2 + 1) * n4 - 1) / Bt2), L4 = 0, Pt2 = i3; + let H2 = Math.floor(((D2 - J2 + 1) * n5 - 1) / Bt2), L4 = 0, Pt2 = i2; for (; Pt2 - L4 > 1; ) { let Vt2 = L4 + Pt2 >>> 1; H2 < o2[Vt2] ? Pt2 = Vt2 : L4 = Vt2; @@ -106966,14 +36272,14 @@ function Ws$1(e18) { if (L4 == 0) break; U5.push(L4); - let W2 = J2 + Math.floor(Bt2 * o2[L4] / n4), Rt2 = J2 + Math.floor(Bt2 * o2[L4 + 1] / n4) - 1; + let W2 = J2 + Math.floor(Bt2 * o2[L4] / n5), Rt2 = J2 + Math.floor(Bt2 * o2[L4 + 1] / n5) - 1; for (; !((W2 ^ Rt2) & N2); ) D2 = D2 << 1 & C3 | w2(), W2 = W2 << 1 & C3, Rt2 = Rt2 << 1 & C3 | 1; for (; W2 & ~Rt2 & I2; ) D2 = D2 & N2 | D2 << 1 & C3 >>> 1 | w2(), W2 = W2 << 1 ^ N2, Rt2 = (Rt2 ^ N2) << 1 | N2 | 1; J2 = W2, Bt2 = 1 + Rt2 - W2; } - let G2 = i3 - 4; + let G2 = i2 - 4; return U5.map((H2) => { switch (H2 - G2) { case 3: @@ -106999,27 +36305,27 @@ function Zs$1(e18) { } function t0(e18, t2) { let r2 = Array(e18); - for (let i3 = 0; i3 < e18; i3++) - r2[i3] = 1 + t2(); + for (let i2 = 0; i2 < e18; i2++) + r2[i2] = 1 + t2(); return r2; } function cf(e18, t2) { let r2 = Array(e18); - for (let i3 = 0, n4 = -1; i3 < e18; i3++) - r2[i3] = n4 += 1 + t2(); + for (let i2 = 0, n5 = -1; i2 < e18; i2++) + r2[i2] = n5 += 1 + t2(); return r2; } function e0(e18, t2) { let r2 = Array(e18); - for (let i3 = 0, n4 = 0; i3 < e18; i3++) - r2[i3] = n4 += Zs$1(t2()); + for (let i2 = 0, n5 = 0; i2 < e18; i2++) + r2[i2] = n5 += Zs$1(t2()); return r2; } function Ur$1(e18, t2) { - let r2 = cf(e18(), e18), i3 = e18(), n4 = cf(i3, e18), o2 = t0(i3, e18); - for (let h4 = 0; h4 < i3; h4++) + let r2 = cf(e18(), e18), i2 = e18(), n5 = cf(i2, e18), o2 = t0(i2, e18); + for (let h4 = 0; h4 < i2; h4++) for (let p3 = 0; p3 < o2[h4]; p3++) - r2.push(n4[h4] + p3); + r2.push(n5[h4] + p3); return t2 ? r2.map((h4) => t2[h4]) : r2; } function r0(e18) { @@ -107049,43 +36355,43 @@ function i0(e18) { return t2; } function lf(e18, t2, r2) { - let i3 = Array(e18).fill(void 0).map(() => []); - for (let n4 = 0; n4 < t2; n4++) - e0(e18, r2).forEach((o2, h4) => i3[h4].push(o2)); - return i3; + let i2 = Array(e18).fill(void 0).map(() => []); + for (let n5 = 0; n5 < t2; n5++) + e0(e18, r2).forEach((o2, h4) => i2[h4].push(o2)); + return i2; } function n0(e18, t2) { - let r2 = 1 + t2(), i3 = t2(), n4 = i0(t2), o2 = lf(n4.length, 1 + e18, t2); + let r2 = 1 + t2(), i2 = t2(), n5 = i0(t2), o2 = lf(n5.length, 1 + e18, t2); return hf(o2.map((h4, p3) => { const A2 = h4[0], v6 = h4.slice(1); - return Array(n4[p3]).fill(void 0).map((w2, y3) => { - let S4 = y3 * i3; + return Array(n5[p3]).fill(void 0).map((w2, y3) => { + let S4 = y3 * i2; return [A2 + y3 * r2, v6.map((N2) => N2 + S4)]; }); })); } function f0(e18, t2) { let r2 = 1 + t2(); - return lf(r2, 1 + e18, t2).map((n4) => [n4[0], n4.slice(1)]); + return lf(r2, 1 + e18, t2).map((n5) => [n5[0], n5.slice(1)]); } function o0(e18) { - let t2 = Ur$1(e18).sort((i3, n4) => i3 - n4); + let t2 = Ur$1(e18).sort((i2, n5) => i2 - n5); return r2(); function r2() { - let i3 = []; + let i2 = []; for (; ; ) { let v6 = Ur$1(e18, t2); if (v6.length == 0) break; - i3.push({ set: new Set(v6), node: r2() }); + i2.push({ set: new Set(v6), node: r2() }); } - i3.sort((v6, w2) => w2.set.size - v6.set.size); - let n4 = e18(), o2 = n4 % 3; - n4 = n4 / 3 | 0; - let h4 = !!(n4 & 1); - n4 >>= 1; - let p3 = n4 == 1, A2 = n4 == 2; - return { branches: i3, valid: o2, fe0f: h4, save: p3, check: A2 }; + i2.sort((v6, w2) => w2.set.size - v6.set.size); + let n5 = e18(), o2 = n5 % 3; + n5 = n5 / 3 | 0; + let h4 = !!(n5 & 1); + n5 >>= 1; + let p3 = n5 == 1, A2 = n5 == 2; + return { branches: i2, valid: o2, fe0f: h4, save: p3, check: A2 }; } } function s0() { @@ -107104,11 +36410,11 @@ const c0 = "address/5.7.0", yr$1 = new z$2(c0); function pf(e18) { Jt$1(e18, 20) || yr$1.throwArgumentError("invalid address", "address", e18), e18 = e18.toLowerCase(); const t2 = e18.substring(2).split(""), r2 = new Uint8Array(40); - for (let n4 = 0; n4 < 40; n4++) - r2[n4] = t2[n4].charCodeAt(0); - const i3 = Ot$1(Ii(r2)); - for (let n4 = 0; n4 < 40; n4 += 2) - i3[n4 >> 1] >> 4 >= 8 && (t2[n4] = t2[n4].toUpperCase()), (i3[n4 >> 1] & 15) >= 8 && (t2[n4 + 1] = t2[n4 + 1].toUpperCase()); + for (let n5 = 0; n5 < 40; n5++) + r2[n5] = t2[n5].charCodeAt(0); + const i2 = Ot$1(Ii(r2)); + for (let n5 = 0; n5 < 40; n5 += 2) + i2[n5 >> 1] >> 4 >= 8 && (t2[n5] = t2[n5].toUpperCase()), (i2[n5 >> 1] & 15) >= 8 && (t2[n5 + 1] = t2[n5 + 1].toUpperCase()); return "0x" + t2.join(""); } const l0 = 9007199254740991; @@ -107123,10 +36429,10 @@ for (let e18 = 0; e18 < 26; e18++) const vf = Math.floor(d0(l0)); function p0(e18) { e18 = e18.toUpperCase(), e18 = e18.substring(4) + e18.substring(0, 2) + "00"; - let t2 = e18.split("").map((i3) => Oi[i3]).join(""); + let t2 = e18.split("").map((i2) => Oi[i2]).join(""); for (; t2.length >= vf; ) { - let i3 = t2.substring(0, vf); - t2 = parseInt(i3, 10) % 97 + t2.substring(i3.length); + let i2 = t2.substring(0, vf); + t2 = parseInt(i2, 10) % 97 + t2.substring(i2.length); } let r2 = String(98 - parseInt(t2, 10) % 97); for (; r2.length < 2; ) @@ -107157,22 +36463,22 @@ function gf(e18, t2) { if (!e18) throw new Error(t2 || "Assertion failed"); } -gf.equal = function(t2, r2, i3) { +gf.equal = function(t2, r2, i2) { if (t2 != r2) - throw new Error(i3 || "Assertion failed: " + t2 + " != " + r2); + throw new Error(i2 || "Assertion failed: " + t2 + " != " + r2); }; -var Pi = { exports: {} }; -typeof Object.create == "function" ? Pi.exports = function(t2, r2) { +var Pi$1 = { exports: {} }; +typeof Object.create == "function" ? Pi$1.exports = function(t2, r2) { r2 && (t2.super_ = r2, t2.prototype = Object.create(r2.prototype, { constructor: { value: t2, enumerable: false, writable: true, configurable: true } })); -} : Pi.exports = function(t2, r2) { +} : Pi$1.exports = function(t2, r2) { if (r2) { t2.super_ = r2; - var i3 = function() { + var i2 = function() { }; - i3.prototype = r2.prototype, t2.prototype = new i3(), t2.prototype.constructor = t2; + i2.prototype = r2.prototype, t2.prototype = new i2(), t2.prototype.constructor = t2; } }; -var y0 = xr$1, w0 = Pi.exports; +var y0 = xr$1, w0 = Pi$1.exports; Q$1.inherits = w0; function x0(e18, t2) { return (e18.charCodeAt(t2) & 64512) !== 55296 || t2 < 0 || t2 + 1 >= e18.length ? false : (e18.charCodeAt(t2 + 1) & 64512) === 56320; @@ -107186,16 +36492,16 @@ function M0(e18, t2) { if (typeof e18 == "string") if (t2) { if (t2 === "hex") - for (e18 = e18.replace(/[^a-z0-9]+/ig, ""), e18.length % 2 !== 0 && (e18 = "0" + e18), n4 = 0; n4 < e18.length; n4 += 2) - r2.push(parseInt(e18[n4] + e18[n4 + 1], 16)); + for (e18 = e18.replace(/[^a-z0-9]+/ig, ""), e18.length % 2 !== 0 && (e18 = "0" + e18), n5 = 0; n5 < e18.length; n5 += 2) + r2.push(parseInt(e18[n5] + e18[n5 + 1], 16)); } else - for (var i3 = 0, n4 = 0; n4 < e18.length; n4++) { - var o2 = e18.charCodeAt(n4); - o2 < 128 ? r2[i3++] = o2 : o2 < 2048 ? (r2[i3++] = o2 >> 6 | 192, r2[i3++] = o2 & 63 | 128) : x0(e18, n4) ? (o2 = 65536 + ((o2 & 1023) << 10) + (e18.charCodeAt(++n4) & 1023), r2[i3++] = o2 >> 18 | 240, r2[i3++] = o2 >> 12 & 63 | 128, r2[i3++] = o2 >> 6 & 63 | 128, r2[i3++] = o2 & 63 | 128) : (r2[i3++] = o2 >> 12 | 224, r2[i3++] = o2 >> 6 & 63 | 128, r2[i3++] = o2 & 63 | 128); + for (var i2 = 0, n5 = 0; n5 < e18.length; n5++) { + var o2 = e18.charCodeAt(n5); + o2 < 128 ? r2[i2++] = o2 : o2 < 2048 ? (r2[i2++] = o2 >> 6 | 192, r2[i2++] = o2 & 63 | 128) : x0(e18, n5) ? (o2 = 65536 + ((o2 & 1023) << 10) + (e18.charCodeAt(++n5) & 1023), r2[i2++] = o2 >> 18 | 240, r2[i2++] = o2 >> 12 & 63 | 128, r2[i2++] = o2 >> 6 & 63 | 128, r2[i2++] = o2 & 63 | 128) : (r2[i2++] = o2 >> 12 | 224, r2[i2++] = o2 >> 6 & 63 | 128, r2[i2++] = o2 & 63 | 128); } else - for (n4 = 0; n4 < e18.length; n4++) - r2[n4] = e18[n4] | 0; + for (n5 = 0; n5 < e18.length; n5++) + r2[n5] = e18[n5] | 0; return r2; } Q$1.toArray = M0; @@ -107211,9 +36517,9 @@ function mf(e18) { } Q$1.htonl = mf; function S0(e18, t2) { - for (var r2 = "", i3 = 0; i3 < e18.length; i3++) { - var n4 = e18[i3]; - t2 === "little" && (n4 = mf(n4)), r2 += bf(n4.toString(16)); + for (var r2 = "", i2 = 0; i2 < e18.length; i2++) { + var n5 = e18[i2]; + t2 === "little" && (n5 = mf(n5)), r2 += bf(n5.toString(16)); } return r2; } @@ -107226,20 +36532,20 @@ function bf(e18) { return e18.length === 7 ? "0" + e18 : e18.length === 6 ? "00" + e18 : e18.length === 5 ? "000" + e18 : e18.length === 4 ? "0000" + e18 : e18.length === 3 ? "00000" + e18 : e18.length === 2 ? "000000" + e18 : e18.length === 1 ? "0000000" + e18 : e18; } Q$1.zero8 = bf; -function I0(e18, t2, r2, i3) { - var n4 = r2 - t2; - y0(n4 % 4 === 0); - for (var o2 = new Array(n4 / 4), h4 = 0, p3 = t2; h4 < o2.length; h4++, p3 += 4) { +function I0(e18, t2, r2, i2) { + var n5 = r2 - t2; + y0(n5 % 4 === 0); + for (var o2 = new Array(n5 / 4), h4 = 0, p3 = t2; h4 < o2.length; h4++, p3 += 4) { var A2; - i3 === "big" ? A2 = e18[p3] << 24 | e18[p3 + 1] << 16 | e18[p3 + 2] << 8 | e18[p3 + 3] : A2 = e18[p3 + 3] << 24 | e18[p3 + 2] << 16 | e18[p3 + 1] << 8 | e18[p3], o2[h4] = A2 >>> 0; + i2 === "big" ? A2 = e18[p3] << 24 | e18[p3 + 1] << 16 | e18[p3 + 2] << 8 | e18[p3 + 3] : A2 = e18[p3 + 3] << 24 | e18[p3 + 2] << 16 | e18[p3 + 1] << 8 | e18[p3], o2[h4] = A2 >>> 0; } return o2; } Q$1.join32 = I0; function N0(e18, t2) { - for (var r2 = new Array(e18.length * 4), i3 = 0, n4 = 0; i3 < e18.length; i3++, n4 += 4) { - var o2 = e18[i3]; - t2 === "big" ? (r2[n4] = o2 >>> 24, r2[n4 + 1] = o2 >>> 16 & 255, r2[n4 + 2] = o2 >>> 8 & 255, r2[n4 + 3] = o2 & 255) : (r2[n4 + 3] = o2 >>> 24, r2[n4 + 2] = o2 >>> 16 & 255, r2[n4 + 1] = o2 >>> 8 & 255, r2[n4] = o2 & 255); + for (var r2 = new Array(e18.length * 4), i2 = 0, n5 = 0; i2 < e18.length; i2++, n5 += 4) { + var o2 = e18[i2]; + t2 === "big" ? (r2[n5] = o2 >>> 24, r2[n5 + 1] = o2 >>> 16 & 255, r2[n5 + 2] = o2 >>> 8 & 255, r2[n5 + 3] = o2 & 255) : (r2[n5 + 3] = o2 >>> 24, r2[n5 + 2] = o2 >>> 16 & 255, r2[n5 + 1] = o2 >>> 8 & 255, r2[n5] = o2 & 255); } return r2; } @@ -107260,61 +36566,61 @@ function R0(e18, t2, r2) { return e18 + t2 + r2 >>> 0; } Q$1.sum32_3 = R0; -function O0(e18, t2, r2, i3) { - return e18 + t2 + r2 + i3 >>> 0; +function O0(e18, t2, r2, i2) { + return e18 + t2 + r2 + i2 >>> 0; } Q$1.sum32_4 = O0; -function P0(e18, t2, r2, i3, n4) { - return e18 + t2 + r2 + i3 + n4 >>> 0; +function P0(e18, t2, r2, i2, n5) { + return e18 + t2 + r2 + i2 + n5 >>> 0; } Q$1.sum32_5 = P0; -function T0(e18, t2, r2, i3) { - var n4 = e18[t2], o2 = e18[t2 + 1], h4 = i3 + o2 >>> 0, p3 = (h4 < i3 ? 1 : 0) + r2 + n4; +function T0(e18, t2, r2, i2) { + var n5 = e18[t2], o2 = e18[t2 + 1], h4 = i2 + o2 >>> 0, p3 = (h4 < i2 ? 1 : 0) + r2 + n5; e18[t2] = p3 >>> 0, e18[t2 + 1] = h4; } Q$1.sum64 = T0; -function D0(e18, t2, r2, i3) { - var n4 = t2 + i3 >>> 0, o2 = (n4 < t2 ? 1 : 0) + e18 + r2; +function D0(e18, t2, r2, i2) { + var n5 = t2 + i2 >>> 0, o2 = (n5 < t2 ? 1 : 0) + e18 + r2; return o2 >>> 0; } Q$1.sum64_hi = D0; -function F0(e18, t2, r2, i3) { - var n4 = t2 + i3; - return n4 >>> 0; +function F0(e18, t2, r2, i2) { + var n5 = t2 + i2; + return n5 >>> 0; } Q$1.sum64_lo = F0; -function U0(e18, t2, r2, i3, n4, o2, h4, p3) { +function U0(e18, t2, r2, i2, n5, o2, h4, p3) { var A2 = 0, v6 = t2; - v6 = v6 + i3 >>> 0, A2 += v6 < t2 ? 1 : 0, v6 = v6 + o2 >>> 0, A2 += v6 < o2 ? 1 : 0, v6 = v6 + p3 >>> 0, A2 += v6 < p3 ? 1 : 0; - var w2 = e18 + r2 + n4 + h4 + A2; + v6 = v6 + i2 >>> 0, A2 += v6 < t2 ? 1 : 0, v6 = v6 + o2 >>> 0, A2 += v6 < o2 ? 1 : 0, v6 = v6 + p3 >>> 0, A2 += v6 < p3 ? 1 : 0; + var w2 = e18 + r2 + n5 + h4 + A2; return w2 >>> 0; } Q$1.sum64_4_hi = U0; -function k0(e18, t2, r2, i3, n4, o2, h4, p3) { - var A2 = t2 + i3 + o2 + p3; +function k0(e18, t2, r2, i2, n5, o2, h4, p3) { + var A2 = t2 + i2 + o2 + p3; return A2 >>> 0; } Q$1.sum64_4_lo = k0; -function q0(e18, t2, r2, i3, n4, o2, h4, p3, A2, v6) { +function q0(e18, t2, r2, i2, n5, o2, h4, p3, A2, v6) { var w2 = 0, y3 = t2; - y3 = y3 + i3 >>> 0, w2 += y3 < t2 ? 1 : 0, y3 = y3 + o2 >>> 0, w2 += y3 < o2 ? 1 : 0, y3 = y3 + p3 >>> 0, w2 += y3 < p3 ? 1 : 0, y3 = y3 + v6 >>> 0, w2 += y3 < v6 ? 1 : 0; - var S4 = e18 + r2 + n4 + h4 + A2 + w2; + y3 = y3 + i2 >>> 0, w2 += y3 < t2 ? 1 : 0, y3 = y3 + o2 >>> 0, w2 += y3 < o2 ? 1 : 0, y3 = y3 + p3 >>> 0, w2 += y3 < p3 ? 1 : 0, y3 = y3 + v6 >>> 0, w2 += y3 < v6 ? 1 : 0; + var S4 = e18 + r2 + n5 + h4 + A2 + w2; return S4 >>> 0; } Q$1.sum64_5_hi = q0; -function K0(e18, t2, r2, i3, n4, o2, h4, p3, A2, v6) { - var w2 = t2 + i3 + o2 + p3 + v6; +function K0(e18, t2, r2, i2, n5, o2, h4, p3, A2, v6) { + var w2 = t2 + i2 + o2 + p3 + v6; return w2 >>> 0; } Q$1.sum64_5_lo = K0; function H0(e18, t2, r2) { - var i3 = t2 << 32 - r2 | e18 >>> r2; - return i3 >>> 0; + var i2 = t2 << 32 - r2 | e18 >>> r2; + return i2 >>> 0; } Q$1.rotr64_hi = H0; function L0(e18, t2, r2) { - var i3 = e18 << 32 - r2 | t2 >>> r2; - return i3 >>> 0; + var i2 = e18 << 32 - r2 | t2 >>> r2; + return i2 >>> 0; } Q$1.rotr64_lo = L0; function z0(e18, t2, r2) { @@ -107322,8 +36628,8 @@ function z0(e18, t2, r2) { } Q$1.shr64_hi = z0; function j0(e18, t2, r2) { - var i3 = e18 << 32 - r2 | t2 >>> r2; - return i3 >>> 0; + var i2 = e18 << 32 - r2 | t2 >>> r2; + return i2 >>> 0; } Q$1.shr64_lo = j0; var or$1 = {}, yf = Q$1, Q0 = xr$1; @@ -107333,36 +36639,36 @@ function qr$1() { or$1.BlockHash = qr$1, qr$1.prototype.update = function(t2, r2) { if (t2 = yf.toArray(t2, r2), this.pending ? this.pending = this.pending.concat(t2) : this.pending = t2, this.pendingTotal += t2.length, this.pending.length >= this._delta8) { t2 = this.pending; - var i3 = t2.length % this._delta8; - this.pending = t2.slice(t2.length - i3, t2.length), this.pending.length === 0 && (this.pending = null), t2 = yf.join32(t2, 0, t2.length - i3, this.endian); - for (var n4 = 0; n4 < t2.length; n4 += this._delta32) - this._update(t2, n4, n4 + this._delta32); + var i2 = t2.length % this._delta8; + this.pending = t2.slice(t2.length - i2, t2.length), this.pending.length === 0 && (this.pending = null), t2 = yf.join32(t2, 0, t2.length - i2, this.endian); + for (var n5 = 0; n5 < t2.length; n5 += this._delta32) + this._update(t2, n5, n5 + this._delta32); } return this; }, qr$1.prototype.digest = function(t2) { return this.update(this._pad()), Q0(this.pending === null), this._digest(t2); }, qr$1.prototype._pad = function() { - var t2 = this.pendingTotal, r2 = this._delta8, i3 = r2 - (t2 + this.padLength) % r2, n4 = new Array(i3 + this.padLength); - n4[0] = 128; - for (var o2 = 1; o2 < i3; o2++) - n4[o2] = 0; + var t2 = this.pendingTotal, r2 = this._delta8, i2 = r2 - (t2 + this.padLength) % r2, n5 = new Array(i2 + this.padLength); + n5[0] = 128; + for (var o2 = 1; o2 < i2; o2++) + n5[o2] = 0; if (t2 <<= 3, this.endian === "big") { for (var h4 = 8; h4 < this.padLength; h4++) - n4[o2++] = 0; - n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = t2 >>> 24 & 255, n4[o2++] = t2 >>> 16 & 255, n4[o2++] = t2 >>> 8 & 255, n4[o2++] = t2 & 255; + n5[o2++] = 0; + n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = t2 >>> 24 & 255, n5[o2++] = t2 >>> 16 & 255, n5[o2++] = t2 >>> 8 & 255, n5[o2++] = t2 & 255; } else - for (n4[o2++] = t2 & 255, n4[o2++] = t2 >>> 8 & 255, n4[o2++] = t2 >>> 16 & 255, n4[o2++] = t2 >>> 24 & 255, n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = 0, n4[o2++] = 0, h4 = 8; h4 < this.padLength; h4++) - n4[o2++] = 0; - return n4; + for (n5[o2++] = t2 & 255, n5[o2++] = t2 >>> 8 & 255, n5[o2++] = t2 >>> 16 & 255, n5[o2++] = t2 >>> 24 & 255, n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = 0, n5[o2++] = 0, h4 = 8; h4 < this.padLength; h4++) + n5[o2++] = 0; + return n5; }; var sr$1 = {}, ae$2 = {}, J0 = Q$1, ue = J0.rotr32; -function G0(e18, t2, r2, i3) { +function G0(e18, t2, r2, i2) { if (e18 === 0) - return wf(t2, r2, i3); + return wf(t2, r2, i2); if (e18 === 1 || e18 === 3) - return Mf(t2, r2, i3); + return Mf(t2, r2, i2); if (e18 === 2) - return xf(t2, r2, i3); + return xf(t2, r2, i2); } ae$2.ft_1 = G0; function wf(e18, t2, r2) { @@ -107402,13 +36708,13 @@ function he() { ar$1.inherits(he, Ef); var ia = he; he.blockSize = 512, he.outSize = 160, he.hmacStrength = 80, he.padLength = 64, he.prototype._update = function(t2, r2) { - for (var i3 = this.W, n4 = 0; n4 < 16; n4++) - i3[n4] = t2[r2 + n4]; - for (; n4 < i3.length; n4++) - i3[n4] = Ti(i3[n4 - 3] ^ i3[n4 - 8] ^ i3[n4 - 14] ^ i3[n4 - 16], 1); + for (var i2 = this.W, n5 = 0; n5 < 16; n5++) + i2[n5] = t2[r2 + n5]; + for (; n5 < i2.length; n5++) + i2[n5] = Ti(i2[n5 - 3] ^ i2[n5 - 8] ^ i2[n5 - 14] ^ i2[n5 - 16], 1); var o2 = this.h[0], h4 = this.h[1], p3 = this.h[2], A2 = this.h[3], v6 = this.h[4]; - for (n4 = 0; n4 < i3.length; n4++) { - var w2 = ~~(n4 / 20), y3 = ta(Ti(o2, 5), ea(w2, h4, p3, A2), v6, i3[n4], ra[w2]); + for (n5 = 0; n5 < i2.length; n5++) { + var w2 = ~~(n5 / 20), y3 = ta(Ti(o2, 5), ea(w2, h4, p3, A2), v6, i2[n5], ra[w2]); v6 = A2, A2 = p3, p3 = Ti(h4, 30), h4 = o2, o2 = y3; } this.h[0] = Mr$1(this.h[0], o2), this.h[1] = Mr$1(this.h[1], h4), this.h[2] = Mr$1(this.h[2], p3), this.h[3] = Mr$1(this.h[3], A2), this.h[4] = Mr$1(this.h[4], v6); @@ -107424,13 +36730,13 @@ function ce$1() { ur$1.inherits(ce$1, Sf); var If = ce$1; ce$1.blockSize = 512, ce$1.outSize = 256, ce$1.hmacStrength = 192, ce$1.padLength = 64, ce$1.prototype._update = function(t2, r2) { - for (var i3 = this.W, n4 = 0; n4 < 16; n4++) - i3[n4] = t2[r2 + n4]; - for (; n4 < i3.length; n4++) - i3[n4] = oa(da(i3[n4 - 2]), i3[n4 - 7], la(i3[n4 - 15]), i3[n4 - 16]); + for (var i2 = this.W, n5 = 0; n5 < 16; n5++) + i2[n5] = t2[r2 + n5]; + for (; n5 < i2.length; n5++) + i2[n5] = oa(da(i2[n5 - 2]), i2[n5 - 7], la(i2[n5 - 15]), i2[n5 - 16]); var o2 = this.h[0], h4 = this.h[1], p3 = this.h[2], A2 = this.h[3], v6 = this.h[4], w2 = this.h[5], y3 = this.h[6], S4 = this.h[7]; - for (fa(this.k.length === i3.length), n4 = 0; n4 < i3.length; n4++) { - var N2 = sa(S4, ca(v6), aa(v6, w2, y3), this.k[n4], i3[n4]), I2 = ie(ha(o2), ua(o2, h4, p3)); + for (fa(this.k.length === i2.length), n5 = 0; n5 < i2.length; n5++) { + var N2 = sa(S4, ca(v6), aa(v6, w2, y3), this.k[n5], i2[n5]), I2 = ie(ha(o2), ua(o2, h4, p3)); S4 = y3, y3 = w2, w2 = v6, v6 = ie(A2, N2), A2 = p3, p3 = h4, h4 = o2, o2 = ie(N2, I2); } this.h[0] = ie(this.h[0], o2), this.h[1] = ie(this.h[1], h4), this.h[2] = ie(this.h[2], p3), this.h[3] = ie(this.h[3], A2), this.h[4] = ie(this.h[4], v6), this.h[5] = ie(this.h[5], w2), this.h[6] = ie(this.h[6], y3), this.h[7] = ie(this.h[7], S4); @@ -107457,72 +36763,72 @@ function ne$1() { jt$1.inherits(ne$1, Cf); var Rf = ne$1; ne$1.blockSize = 1024, ne$1.outSize = 512, ne$1.hmacStrength = 192, ne$1.padLength = 128, ne$1.prototype._prepareBlock = function(t2, r2) { - for (var i3 = this.W, n4 = 0; n4 < 32; n4++) - i3[n4] = t2[r2 + n4]; - for (; n4 < i3.length; n4 += 2) { - var o2 = Pa(i3[n4 - 4], i3[n4 - 3]), h4 = Ta$1(i3[n4 - 4], i3[n4 - 3]), p3 = i3[n4 - 14], A2 = i3[n4 - 13], v6 = Ra$1(i3[n4 - 30], i3[n4 - 29]), w2 = Oa$1(i3[n4 - 30], i3[n4 - 29]), y3 = i3[n4 - 32], S4 = i3[n4 - 31]; - i3[n4] = Aa(o2, h4, p3, A2, v6, w2, y3, S4), i3[n4 + 1] = ba$1(o2, h4, p3, A2, v6, w2, y3, S4); + for (var i2 = this.W, n5 = 0; n5 < 32; n5++) + i2[n5] = t2[r2 + n5]; + for (; n5 < i2.length; n5 += 2) { + var o2 = Pa(i2[n5 - 4], i2[n5 - 3]), h4 = Ta$1(i2[n5 - 4], i2[n5 - 3]), p3 = i2[n5 - 14], A2 = i2[n5 - 13], v6 = Ra$1(i2[n5 - 30], i2[n5 - 29]), w2 = Oa$1(i2[n5 - 30], i2[n5 - 29]), y3 = i2[n5 - 32], S4 = i2[n5 - 31]; + i2[n5] = Aa(o2, h4, p3, A2, v6, w2, y3, S4), i2[n5 + 1] = ba$1(o2, h4, p3, A2, v6, w2, y3, S4); } }, ne$1.prototype._update = function(t2, r2) { this._prepareBlock(t2, r2); - var i3 = this.W, n4 = this.h[0], o2 = this.h[1], h4 = this.h[2], p3 = this.h[3], A2 = this.h[4], v6 = this.h[5], w2 = this.h[6], y3 = this.h[7], S4 = this.h[8], N2 = this.h[9], I2 = this.h[10], C3 = this.h[11], D2 = this.h[12], U5 = this.h[13], J2 = this.h[14], Bt2 = this.h[15]; - ma(this.k.length === i3.length); - for (var G2 = 0; G2 < i3.length; G2 += 2) { - var H2 = J2, L4 = Bt2, Pt2 = Ba(S4, N2), W2 = Ca(S4, N2), Rt2 = Ma(S4, N2, I2, C3, D2), Vt2 = Ea(S4, N2, I2, C3, D2, U5), Y2 = this.k[G2], Wt2 = this.k[G2 + 1], b2 = i3[G2], f3 = i3[G2 + 1], a3 = ya$1(H2, L4, Pt2, W2, Rt2, Vt2, Y2, Wt2, b2, f3), c2 = wa(H2, L4, Pt2, W2, Rt2, Vt2, Y2, Wt2, b2, f3); - H2 = Na$1(n4, o2), L4 = _a(n4, o2), Pt2 = Sa$1(n4, o2, h4, p3, A2), W2 = Ia(n4, o2, h4, p3, A2, v6); + var i2 = this.W, n5 = this.h[0], o2 = this.h[1], h4 = this.h[2], p3 = this.h[3], A2 = this.h[4], v6 = this.h[5], w2 = this.h[6], y3 = this.h[7], S4 = this.h[8], N2 = this.h[9], I2 = this.h[10], C3 = this.h[11], D2 = this.h[12], U5 = this.h[13], J2 = this.h[14], Bt2 = this.h[15]; + ma(this.k.length === i2.length); + for (var G2 = 0; G2 < i2.length; G2 += 2) { + var H2 = J2, L4 = Bt2, Pt2 = Ba(S4, N2), W2 = Ca(S4, N2), Rt2 = Ma(S4, N2, I2, C3, D2), Vt2 = Ea(S4, N2, I2, C3, D2, U5), Y2 = this.k[G2], Wt2 = this.k[G2 + 1], b2 = i2[G2], f4 = i2[G2 + 1], a3 = ya$1(H2, L4, Pt2, W2, Rt2, Vt2, Y2, Wt2, b2, f4), c2 = wa(H2, L4, Pt2, W2, Rt2, Vt2, Y2, Wt2, b2, f4); + H2 = Na$1(n5, o2), L4 = _a$1(n5, o2), Pt2 = Sa$1(n5, o2, h4, p3, A2), W2 = Ia(n5, o2, h4, p3, A2, v6); var d4 = Fi$1(H2, L4, Pt2, W2), m3 = Ui(H2, L4, Pt2, W2); - J2 = D2, Bt2 = U5, D2 = I2, U5 = C3, I2 = S4, C3 = N2, S4 = Fi$1(w2, y3, a3, c2), N2 = Ui(y3, y3, a3, c2), w2 = A2, y3 = v6, A2 = h4, v6 = p3, h4 = n4, p3 = o2, n4 = Fi$1(a3, c2, d4, m3), o2 = Ui(a3, c2, d4, m3); + J2 = D2, Bt2 = U5, D2 = I2, U5 = C3, I2 = S4, C3 = N2, S4 = Fi$1(w2, y3, a3, c2), N2 = Ui(y3, y3, a3, c2), w2 = A2, y3 = v6, A2 = h4, v6 = p3, h4 = n5, p3 = o2, n5 = Fi$1(a3, c2, d4, m3), o2 = Ui(a3, c2, d4, m3); } - Be(this.h, 0, n4, o2), Be(this.h, 2, h4, p3), Be(this.h, 4, A2, v6), Be(this.h, 6, w2, y3), Be(this.h, 8, S4, N2), Be(this.h, 10, I2, C3), Be(this.h, 12, D2, U5), Be(this.h, 14, J2, Bt2); + Be(this.h, 0, n5, o2), Be(this.h, 2, h4, p3), Be(this.h, 4, A2, v6), Be(this.h, 6, w2, y3), Be(this.h, 8, S4, N2), Be(this.h, 10, I2, C3), Be(this.h, 12, D2, U5), Be(this.h, 14, J2, Bt2); }, ne$1.prototype._digest = function(t2) { return t2 === "hex" ? jt$1.toHex32(this.h, "big") : jt$1.split32(this.h, "big"); }; -function Ma(e18, t2, r2, i3, n4) { - var o2 = e18 & r2 ^ ~e18 & n4; +function Ma(e18, t2, r2, i2, n5) { + var o2 = e18 & r2 ^ ~e18 & n5; return o2 < 0 && (o2 += 4294967296), o2; } -function Ea(e18, t2, r2, i3, n4, o2) { - var h4 = t2 & i3 ^ ~t2 & o2; +function Ea(e18, t2, r2, i2, n5, o2) { + var h4 = t2 & i2 ^ ~t2 & o2; return h4 < 0 && (h4 += 4294967296), h4; } -function Sa$1(e18, t2, r2, i3, n4) { - var o2 = e18 & r2 ^ e18 & n4 ^ r2 & n4; +function Sa$1(e18, t2, r2, i2, n5) { + var o2 = e18 & r2 ^ e18 & n5 ^ r2 & n5; return o2 < 0 && (o2 += 4294967296), o2; } -function Ia(e18, t2, r2, i3, n4, o2) { - var h4 = t2 & i3 ^ t2 & o2 ^ i3 & o2; +function Ia(e18, t2, r2, i2, n5, o2) { + var h4 = t2 & i2 ^ t2 & o2 ^ i2 & o2; return h4 < 0 && (h4 += 4294967296), h4; } function Na$1(e18, t2) { - var r2 = le(e18, t2, 28), i3 = le(t2, e18, 2), n4 = le(t2, e18, 7), o2 = r2 ^ i3 ^ n4; + var r2 = le(e18, t2, 28), i2 = le(t2, e18, 2), n5 = le(t2, e18, 7), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } -function _a(e18, t2) { - var r2 = de(e18, t2, 28), i3 = de(t2, e18, 2), n4 = de(t2, e18, 7), o2 = r2 ^ i3 ^ n4; +function _a$1(e18, t2) { + var r2 = de(e18, t2, 28), i2 = de(t2, e18, 2), n5 = de(t2, e18, 7), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function Ba(e18, t2) { - var r2 = le(e18, t2, 14), i3 = le(e18, t2, 18), n4 = le(t2, e18, 9), o2 = r2 ^ i3 ^ n4; + var r2 = le(e18, t2, 14), i2 = le(e18, t2, 18), n5 = le(t2, e18, 9), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function Ca(e18, t2) { - var r2 = de(e18, t2, 14), i3 = de(e18, t2, 18), n4 = de(t2, e18, 9), o2 = r2 ^ i3 ^ n4; + var r2 = de(e18, t2, 14), i2 = de(e18, t2, 18), n5 = de(t2, e18, 9), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function Ra$1(e18, t2) { - var r2 = le(e18, t2, 1), i3 = le(e18, t2, 8), n4 = _f(e18, t2, 7), o2 = r2 ^ i3 ^ n4; + var r2 = le(e18, t2, 1), i2 = le(e18, t2, 8), n5 = _f(e18, t2, 7), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function Oa$1(e18, t2) { - var r2 = de(e18, t2, 1), i3 = de(e18, t2, 8), n4 = Bf(e18, t2, 7), o2 = r2 ^ i3 ^ n4; + var r2 = de(e18, t2, 1), i2 = de(e18, t2, 8), n5 = Bf(e18, t2, 7), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function Pa(e18, t2) { - var r2 = le(e18, t2, 19), i3 = le(t2, e18, 29), n4 = _f(e18, t2, 6), o2 = r2 ^ i3 ^ n4; + var r2 = le(e18, t2, 19), i2 = le(t2, e18, 29), n5 = _f(e18, t2, 6), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } function Ta$1(e18, t2) { - var r2 = de(e18, t2, 19), i3 = de(t2, e18, 29), n4 = Bf(e18, t2, 6), o2 = r2 ^ i3 ^ n4; + var r2 = de(e18, t2, 19), i2 = de(t2, e18, 29), n5 = Bf(e18, t2, 6), o2 = r2 ^ i2 ^ n5; return o2 < 0 && (o2 += 4294967296), o2; } var ki = Q$1, Of = Rf; @@ -107536,23 +36842,23 @@ var Da$1 = we$2; we$2.blockSize = 1024, we$2.outSize = 384, we$2.hmacStrength = 192, we$2.padLength = 128, we$2.prototype._digest = function(t2) { return t2 === "hex" ? ki.toHex32(this.h.slice(0, 12), "big") : ki.split32(this.h.slice(0, 12), "big"); }, sr$1.sha1 = ia, sr$1.sha224 = va, sr$1.sha256 = If, sr$1.sha384 = Da$1, sr$1.sha512 = Rf; -var Pf = {}, Xe$1 = Q$1, Fa$1 = or$1, Kr$1 = Xe$1.rotl32, Tf = Xe$1.sum32, Er$1 = Xe$1.sum32_3, Df = Xe$1.sum32_4, Ff = Fa$1.BlockHash; +var Pf = {}, Xe$1 = Q$1, Fa$1 = or$1, Kr$2 = Xe$1.rotl32, Tf = Xe$1.sum32, Er$1 = Xe$1.sum32_3, Df = Xe$1.sum32_4, Ff = Fa$1.BlockHash; function pe() { if (!(this instanceof pe)) return new pe(); Ff.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = "little"; } Xe$1.inherits(pe, Ff), Pf.ripemd160 = pe, pe.blockSize = 512, pe.outSize = 160, pe.hmacStrength = 192, pe.padLength = 64, pe.prototype._update = function(t2, r2) { - for (var i3 = this.h[0], n4 = this.h[1], o2 = this.h[2], h4 = this.h[3], p3 = this.h[4], A2 = i3, v6 = n4, w2 = o2, y3 = h4, S4 = p3, N2 = 0; N2 < 80; N2++) { - var I2 = Tf(Kr$1(Df(i3, Uf(N2, n4, o2, h4), t2[qa$1[N2] + r2], Ua$1(N2)), Ha$1[N2]), p3); - i3 = p3, p3 = h4, h4 = Kr$1(o2, 10), o2 = n4, n4 = I2, I2 = Tf(Kr$1(Df(A2, Uf(79 - N2, v6, w2, y3), t2[Ka[N2] + r2], ka(N2)), La$1[N2]), S4), A2 = S4, S4 = y3, y3 = Kr$1(w2, 10), w2 = v6, v6 = I2; + for (var i2 = this.h[0], n5 = this.h[1], o2 = this.h[2], h4 = this.h[3], p3 = this.h[4], A2 = i2, v6 = n5, w2 = o2, y3 = h4, S4 = p3, N2 = 0; N2 < 80; N2++) { + var I2 = Tf(Kr$2(Df(i2, Uf(N2, n5, o2, h4), t2[qa$1[N2] + r2], Ua$1(N2)), Ha$1[N2]), p3); + i2 = p3, p3 = h4, h4 = Kr$2(o2, 10), o2 = n5, n5 = I2, I2 = Tf(Kr$2(Df(A2, Uf(79 - N2, v6, w2, y3), t2[Ka[N2] + r2], ka(N2)), La$1[N2]), S4), A2 = S4, S4 = y3, y3 = Kr$2(w2, 10), w2 = v6, v6 = I2; } - I2 = Er$1(this.h[1], o2, y3), this.h[1] = Er$1(this.h[2], h4, S4), this.h[2] = Er$1(this.h[3], p3, A2), this.h[3] = Er$1(this.h[4], i3, v6), this.h[4] = Er$1(this.h[0], n4, w2), this.h[0] = I2; + I2 = Er$1(this.h[1], o2, y3), this.h[1] = Er$1(this.h[2], h4, S4), this.h[2] = Er$1(this.h[3], p3, A2), this.h[3] = Er$1(this.h[4], i2, v6), this.h[4] = Er$1(this.h[0], n5, w2), this.h[0] = I2; }, pe.prototype._digest = function(t2) { return t2 === "hex" ? Xe$1.toHex32(this.h, "little") : Xe$1.split32(this.h, "little"); }; -function Uf(e18, t2, r2, i3) { - return e18 <= 15 ? t2 ^ r2 ^ i3 : e18 <= 31 ? t2 & r2 | ~t2 & i3 : e18 <= 47 ? (t2 | ~r2) ^ i3 : e18 <= 63 ? t2 & i3 | r2 & ~i3 : t2 ^ (r2 | ~i3); +function Uf(e18, t2, r2, i2) { + return e18 <= 15 ? t2 ^ r2 ^ i2 : e18 <= 31 ? t2 & r2 | ~t2 & i2 : e18 <= 47 ? (t2 | ~r2) ^ i2 : e18 <= 63 ? t2 & i2 | r2 & ~i2 : t2 ^ (r2 | ~i2); } function Ua$1(e18) { return e18 <= 15 ? 0 : e18 <= 31 ? 1518500249 : e18 <= 47 ? 1859775393 : e18 <= 63 ? 2400959708 : 2840853838; @@ -107585,8 +36891,8 @@ cr$1.prototype._init = function(t2) { t2.utils = Q$1, t2.common = or$1, t2.sha = sr$1, t2.ripemd = Pf, t2.hmac = Qa, t2.sha1 = t2.sha.sha1, t2.sha256 = t2.sha.sha256, t2.sha224 = t2.sha.sha224, t2.sha384 = t2.sha.sha384, t2.sha512 = t2.sha.sha512, t2.ripemd160 = t2.ripemd.ripemd160; }(se); function lr$2(e18, t2, r2) { - return r2 = { path: t2, exports: {}, require: function(i3, n4) { - return Ja(i3, n4 ?? r2.path); + return r2 = { path: t2, exports: {}, require: function(i2, n5) { + return Ja(i2, n5 ?? r2.path); } }, e18(r2, r2.exports), r2.exports; } function Ja() { @@ -107597,13 +36903,13 @@ function kf(e18, t2) { if (!e18) throw new Error(t2 || "Assertion failed"); } -kf.equal = function(t2, r2, i3) { +kf.equal = function(t2, r2, i2) { if (t2 != r2) - throw new Error(i3 || "Assertion failed: " + t2 + " != " + r2); + throw new Error(i2 || "Assertion failed: " + t2 + " != " + r2); }; var fe$1 = lr$2(function(e18, t2) { var r2 = t2; - function i3(h4, p3) { + function i2(h4, p3) { if (Array.isArray(h4)) return h4.slice(); if (!h4) @@ -107625,14 +36931,14 @@ var fe$1 = lr$2(function(e18, t2) { } return A2; } - r2.toArray = i3; - function n4(h4) { + r2.toArray = i2; + function n5(h4) { return h4.length === 1 ? "0" + h4 : h4; } - r2.zero2 = n4; + r2.zero2 = n5; function o2(h4) { for (var p3 = "", A2 = 0; A2 < h4.length; A2++) - p3 += n4(h4[A2].toString(16)); + p3 += n5(h4[A2].toString(16)); return p3; } r2.toHex = o2, r2.encode = function(p3, A2) { @@ -107641,7 +36947,7 @@ var fe$1 = lr$2(function(e18, t2) { }), Gt$1 = lr$2(function(e18, t2) { var r2 = t2; r2.assert = qi$1, r2.toArray = fe$1.toArray, r2.zero2 = fe$1.zero2, r2.toHex = fe$1.toHex, r2.encode = fe$1.encode; - function i3(A2, v6, w2) { + function i2(A2, v6, w2) { var y3 = new Array(Math.max(A2.bitLength(), w2) + 1); y3.fill(0); for (var S4 = 1 << v6 + 1, N2 = A2.clone(), I2 = 0; I2 < y3.length; I2++) { @@ -107650,8 +36956,8 @@ var fe$1 = lr$2(function(e18, t2) { } return y3; } - r2.getNAF = i3; - function n4(A2, v6) { + r2.getNAF = i2; + function n5(A2, v6) { var w2 = [[], []]; A2 = A2.clone(), v6 = v6.clone(); for (var y3 = 0, S4 = 0, N2; A2.cmpn(-y3) > 0 || v6.cmpn(-S4) > 0; ) { @@ -107664,7 +36970,7 @@ var fe$1 = lr$2(function(e18, t2) { } return w2; } - r2.getJSF = n4; + r2.getJSF = n5; function o2(A2, v6, w2) { var y3 = "_" + v6; A2.prototype[v6] = function() { @@ -107693,25 +36999,25 @@ Ce$2.prototype.point = function() { throw new Error("Not implemented"); }, Ce$2.prototype._fixedNafMul = function(t2, r2) { Lr$1(t2.precomputed); - var i3 = t2._getDoubles(), n4 = Hr$1(r2, 1, this._bitLength), o2 = (1 << i3.step + 1) - (i3.step % 2 === 0 ? 2 : 1); + var i2 = t2._getDoubles(), n5 = Hr$1(r2, 1, this._bitLength), o2 = (1 << i2.step + 1) - (i2.step % 2 === 0 ? 2 : 1); o2 /= 3; var h4 = [], p3, A2; - for (p3 = 0; p3 < n4.length; p3 += i3.step) { + for (p3 = 0; p3 < n5.length; p3 += i2.step) { A2 = 0; - for (var v6 = p3 + i3.step - 1; v6 >= p3; v6--) - A2 = (A2 << 1) + n4[v6]; + for (var v6 = p3 + i2.step - 1; v6 >= p3; v6--) + A2 = (A2 << 1) + n5[v6]; h4.push(A2); } for (var w2 = this.jpoint(null, null, null), y3 = this.jpoint(null, null, null), S4 = o2; S4 > 0; S4--) { for (p3 = 0; p3 < h4.length; p3++) - A2 = h4[p3], A2 === S4 ? y3 = y3.mixedAdd(i3.points[p3]) : A2 === -S4 && (y3 = y3.mixedAdd(i3.points[p3].neg())); + A2 = h4[p3], A2 === S4 ? y3 = y3.mixedAdd(i2.points[p3]) : A2 === -S4 && (y3 = y3.mixedAdd(i2.points[p3].neg())); w2 = w2.add(y3); } return w2.toP(); }, Ce$2.prototype._wnafMul = function(t2, r2) { - var i3 = 4, n4 = t2._getNAFPoints(i3); - i3 = n4.wnd; - for (var o2 = n4.points, h4 = Hr$1(r2, i3, this._bitLength), p3 = this.jpoint(null, null, null), A2 = h4.length - 1; A2 >= 0; A2--) { + var i2 = 4, n5 = t2._getNAFPoints(i2); + i2 = n5.wnd; + for (var o2 = n5.points, h4 = Hr$1(r2, i2, this._bitLength), p3 = this.jpoint(null, null, null), A2 = h4.length - 1; A2 >= 0; A2--) { for (var v6 = 0; A2 >= 0 && h4[A2] === 0; A2--) v6++; if (A2 >= 0 && v6++, p3 = p3.dblp(v6), A2 < 0) @@ -107720,22 +37026,22 @@ Ce$2.prototype.point = function() { Lr$1(w2 !== 0), t2.type === "affine" ? w2 > 0 ? p3 = p3.mixedAdd(o2[w2 - 1 >> 1]) : p3 = p3.mixedAdd(o2[-w2 - 1 >> 1].neg()) : w2 > 0 ? p3 = p3.add(o2[w2 - 1 >> 1]) : p3 = p3.add(o2[-w2 - 1 >> 1].neg()); } return t2.type === "affine" ? p3.toP() : p3; -}, Ce$2.prototype._wnafMulAdd = function(t2, r2, i3, n4, o2) { +}, Ce$2.prototype._wnafMulAdd = function(t2, r2, i2, n5, o2) { var h4 = this._wnafT1, p3 = this._wnafT2, A2 = this._wnafT3, v6 = 0, w2, y3, S4; - for (w2 = 0; w2 < n4; w2++) { + for (w2 = 0; w2 < n5; w2++) { S4 = r2[w2]; var N2 = S4._getNAFPoints(t2); h4[w2] = N2.wnd, p3[w2] = N2.points; } - for (w2 = n4 - 1; w2 >= 1; w2 -= 2) { + for (w2 = n5 - 1; w2 >= 1; w2 -= 2) { var I2 = w2 - 1, C3 = w2; if (h4[I2] !== 1 || h4[C3] !== 1) { - A2[I2] = Hr$1(i3[I2], h4[I2], this._bitLength), A2[C3] = Hr$1(i3[C3], h4[C3], this._bitLength), v6 = Math.max(A2[I2].length, v6), v6 = Math.max(A2[C3].length, v6); + A2[I2] = Hr$1(i2[I2], h4[I2], this._bitLength), A2[C3] = Hr$1(i2[C3], h4[C3], this._bitLength), v6 = Math.max(A2[I2].length, v6), v6 = Math.max(A2[C3].length, v6); continue; } var D2 = [r2[I2], null, null, r2[C3]]; r2[I2].y.cmp(r2[C3].y) === 0 ? (D2[1] = r2[I2].add(r2[C3]), D2[2] = r2[I2].toJ().mixedAdd(r2[C3].neg())) : r2[I2].y.cmp(r2[C3].y.redNeg()) === 0 ? (D2[1] = r2[I2].toJ().mixedAdd(r2[C3]), D2[2] = r2[I2].add(r2[C3].neg())) : (D2[1] = r2[I2].toJ().mixedAdd(r2[C3]), D2[2] = r2[I2].toJ().mixedAdd(r2[C3].neg())); - var U5 = [-3, -1, -5, -7, 0, 7, 5, 1, 3], J2 = Ga(i3[I2], i3[C3]); + var U5 = [-3, -1, -5, -7, 0, 7, 5, 1, 3], J2 = Ga(i2[I2], i2[C3]); for (v6 = Math.max(J2[0].length, v6), A2[I2] = new Array(v6), A2[C3] = new Array(v6), y3 = 0; y3 < v6; y3++) { var Bt2 = J2[0][y3] | 0, G2 = J2[1][y3] | 0; A2[I2][y3] = U5[(Bt2 + 1) * 3 + (G2 + 1)], A2[C3][y3] = 0, p3[I2] = D2; @@ -107745,7 +37051,7 @@ Ce$2.prototype.point = function() { for (w2 = v6; w2 >= 0; w2--) { for (var Pt2 = 0; w2 >= 0; ) { var W2 = true; - for (y3 = 0; y3 < n4; y3++) + for (y3 = 0; y3 < n5; y3++) L4[y3] = A2[y3][w2] | 0, L4[y3] !== 0 && (W2 = false); if (!W2) break; @@ -107753,12 +37059,12 @@ Ce$2.prototype.point = function() { } if (w2 >= 0 && Pt2++, H2 = H2.dblp(Pt2), w2 < 0) break; - for (y3 = 0; y3 < n4; y3++) { + for (y3 = 0; y3 < n5; y3++) { var Rt2 = L4[y3]; Rt2 !== 0 && (Rt2 > 0 ? S4 = p3[y3][Rt2 - 1 >> 1] : Rt2 < 0 && (S4 = p3[y3][-Rt2 - 1 >> 1].neg()), S4.type === "affine" ? H2 = H2.mixedAdd(S4) : H2 = H2.add(S4)); } } - for (w2 = 0; w2 < n4; w2++) + for (w2 = 0; w2 < n5; w2++) p3[w2] = null; return o2 ? H2 : H2.toP(); }; @@ -107771,19 +37077,19 @@ Ce$2.BasePoint = Zt$1, Zt$1.prototype.eq = function() { return this.curve.validate(this); }, Ce$2.prototype.decodePoint = function(t2, r2) { t2 = Gt$1.toArray(t2, r2); - var i3 = this.p.byteLength(); - if ((t2[0] === 4 || t2[0] === 6 || t2[0] === 7) && t2.length - 1 === 2 * i3) { + var i2 = this.p.byteLength(); + if ((t2[0] === 4 || t2[0] === 6 || t2[0] === 7) && t2.length - 1 === 2 * i2) { t2[0] === 6 ? Lr$1(t2[t2.length - 1] % 2 === 0) : t2[0] === 7 && Lr$1(t2[t2.length - 1] % 2 === 1); - var n4 = this.point(t2.slice(1, 1 + i3), t2.slice(1 + i3, 1 + 2 * i3)); - return n4; - } else if ((t2[0] === 2 || t2[0] === 3) && t2.length - 1 === i3) - return this.pointFromX(t2.slice(1, 1 + i3), t2[0] === 3); + var n5 = this.point(t2.slice(1, 1 + i2), t2.slice(1 + i2, 1 + 2 * i2)); + return n5; + } else if ((t2[0] === 2 || t2[0] === 3) && t2.length - 1 === i2) + return this.pointFromX(t2.slice(1, 1 + i2), t2[0] === 3); throw new Error("Unknown point format"); }, Zt$1.prototype.encodeCompressed = function(t2) { return this.encode(t2, true); }, Zt$1.prototype._encode = function(t2) { - var r2 = this.curve.p.byteLength(), i3 = this.getX().toArray("be", r2); - return t2 ? [this.getY().isEven() ? 2 : 3].concat(i3) : [4].concat(i3, this.getY().toArray("be", r2)); + var r2 = this.curve.p.byteLength(), i2 = this.getX().toArray("be", r2); + return t2 ? [this.getY().isEven() ? 2 : 3].concat(i2) : [4].concat(i2, this.getY().toArray("be", r2)); }, Zt$1.prototype.encode = function(t2, r2) { return Gt$1.encode(this._encode(r2), t2); }, Zt$1.prototype.precompute = function(t2) { @@ -107799,34 +37105,34 @@ Ce$2.BasePoint = Zt$1, Zt$1.prototype.eq = function() { }, Zt$1.prototype._getDoubles = function(t2, r2) { if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles; - for (var i3 = [this], n4 = this, o2 = 0; o2 < r2; o2 += t2) { + for (var i2 = [this], n5 = this, o2 = 0; o2 < r2; o2 += t2) { for (var h4 = 0; h4 < t2; h4++) - n4 = n4.dbl(); - i3.push(n4); + n5 = n5.dbl(); + i2.push(n5); } - return { step: t2, points: i3 }; + return { step: t2, points: i2 }; }, Zt$1.prototype._getNAFPoints = function(t2) { if (this.precomputed && this.precomputed.naf) return this.precomputed.naf; - for (var r2 = [this], i3 = (1 << t2) - 1, n4 = i3 === 1 ? null : this.dbl(), o2 = 1; o2 < i3; o2++) - r2[o2] = r2[o2 - 1].add(n4); + for (var r2 = [this], i2 = (1 << t2) - 1, n5 = i2 === 1 ? null : this.dbl(), o2 = 1; o2 < i2; o2++) + r2[o2] = r2[o2 - 1].add(n5); return { wnd: t2, points: r2 }; }, Zt$1.prototype._getBeta = function() { return null; }, Zt$1.prototype.dblp = function(t2) { - for (var r2 = this, i3 = 0; i3 < t2; i3++) + for (var r2 = this, i2 = 0; i2 < t2; i2++) r2 = r2.dbl(); return r2; }; var Ki = lr$2(function(e18) { - typeof Object.create == "function" ? e18.exports = function(r2, i3) { - i3 && (r2.super_ = i3, r2.prototype = Object.create(i3.prototype, { constructor: { value: r2, enumerable: false, writable: true, configurable: true } })); - } : e18.exports = function(r2, i3) { - if (i3) { - r2.super_ = i3; - var n4 = function() { + typeof Object.create == "function" ? e18.exports = function(r2, i2) { + i2 && (r2.super_ = i2, r2.prototype = Object.create(i2.prototype, { constructor: { value: r2, enumerable: false, writable: true, configurable: true } })); + } : e18.exports = function(r2, i2) { + if (i2) { + r2.super_ = i2; + var n5 = function() { }; - n4.prototype = i3.prototype, r2.prototype = new n4(), r2.prototype.constructor = r2; + n5.prototype = i2.prototype, r2.prototype = new n5(), r2.prototype.constructor = r2; } }; }), Ya = Gt$1.assert; @@ -107837,70 +37143,70 @@ Ki(te$1, $e); var Va = te$1; te$1.prototype._getEndomorphism = function(t2) { if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) { - var r2, i3; + var r2, i2; if (t2.beta) r2 = new K2(t2.beta, 16).toRed(this.red); else { - var n4 = this._getEndoRoots(this.p); - r2 = n4[0].cmp(n4[1]) < 0 ? n4[0] : n4[1], r2 = r2.toRed(this.red); + var n5 = this._getEndoRoots(this.p); + r2 = n5[0].cmp(n5[1]) < 0 ? n5[0] : n5[1], r2 = r2.toRed(this.red); } if (t2.lambda) - i3 = new K2(t2.lambda, 16); + i2 = new K2(t2.lambda, 16); else { var o2 = this._getEndoRoots(this.n); - this.g.mul(o2[0]).x.cmp(this.g.x.redMul(r2)) === 0 ? i3 = o2[0] : (i3 = o2[1], Ya(this.g.mul(i3).x.cmp(this.g.x.redMul(r2)) === 0)); + this.g.mul(o2[0]).x.cmp(this.g.x.redMul(r2)) === 0 ? i2 = o2[0] : (i2 = o2[1], Ya(this.g.mul(i2).x.cmp(this.g.x.redMul(r2)) === 0)); } var h4; return t2.basis ? h4 = t2.basis.map(function(p3) { return { a: new K2(p3.a, 16), b: new K2(p3.b, 16) }; - }) : h4 = this._getEndoBasis(i3), { beta: r2, lambda: i3, basis: h4 }; + }) : h4 = this._getEndoBasis(i2), { beta: r2, lambda: i2, basis: h4 }; } }, te$1.prototype._getEndoRoots = function(t2) { - var r2 = t2 === this.p ? this.red : K2.mont(t2), i3 = new K2(2).toRed(r2).redInvm(), n4 = i3.redNeg(), o2 = new K2(3).toRed(r2).redNeg().redSqrt().redMul(i3), h4 = n4.redAdd(o2).fromRed(), p3 = n4.redSub(o2).fromRed(); + var r2 = t2 === this.p ? this.red : K2.mont(t2), i2 = new K2(2).toRed(r2).redInvm(), n5 = i2.redNeg(), o2 = new K2(3).toRed(r2).redNeg().redSqrt().redMul(i2), h4 = n5.redAdd(o2).fromRed(), p3 = n5.redSub(o2).fromRed(); return [h4, p3]; }, te$1.prototype._getEndoBasis = function(t2) { - for (var r2 = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), i3 = t2, n4 = this.n.clone(), o2 = new K2(1), h4 = new K2(0), p3 = new K2(0), A2 = new K2(1), v6, w2, y3, S4, N2, I2, C3, D2 = 0, U5, J2; i3.cmpn(0) !== 0; ) { - var Bt2 = n4.div(i3); - U5 = n4.sub(Bt2.mul(i3)), J2 = p3.sub(Bt2.mul(o2)); + for (var r2 = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), i2 = t2, n5 = this.n.clone(), o2 = new K2(1), h4 = new K2(0), p3 = new K2(0), A2 = new K2(1), v6, w2, y3, S4, N2, I2, C3, D2 = 0, U5, J2; i2.cmpn(0) !== 0; ) { + var Bt2 = n5.div(i2); + U5 = n5.sub(Bt2.mul(i2)), J2 = p3.sub(Bt2.mul(o2)); var G2 = A2.sub(Bt2.mul(h4)); if (!y3 && U5.cmp(r2) < 0) v6 = C3.neg(), w2 = o2, y3 = U5.neg(), S4 = J2; else if (y3 && ++D2 === 2) break; - C3 = U5, n4 = i3, i3 = U5, p3 = o2, o2 = J2, A2 = h4, h4 = G2; + C3 = U5, n5 = i2, i2 = U5, p3 = o2, o2 = J2, A2 = h4, h4 = G2; } N2 = U5.neg(), I2 = J2; var H2 = y3.sqr().add(S4.sqr()), L4 = N2.sqr().add(I2.sqr()); return L4.cmp(H2) >= 0 && (N2 = v6, I2 = w2), y3.negative && (y3 = y3.neg(), S4 = S4.neg()), N2.negative && (N2 = N2.neg(), I2 = I2.neg()), [{ a: y3, b: S4 }, { a: N2, b: I2 }]; }, te$1.prototype._endoSplit = function(t2) { - var r2 = this.endo.basis, i3 = r2[0], n4 = r2[1], o2 = n4.b.mul(t2).divRound(this.n), h4 = i3.b.neg().mul(t2).divRound(this.n), p3 = o2.mul(i3.a), A2 = h4.mul(n4.a), v6 = o2.mul(i3.b), w2 = h4.mul(n4.b), y3 = t2.sub(p3).sub(A2), S4 = v6.add(w2).neg(); + var r2 = this.endo.basis, i2 = r2[0], n5 = r2[1], o2 = n5.b.mul(t2).divRound(this.n), h4 = i2.b.neg().mul(t2).divRound(this.n), p3 = o2.mul(i2.a), A2 = h4.mul(n5.a), v6 = o2.mul(i2.b), w2 = h4.mul(n5.b), y3 = t2.sub(p3).sub(A2), S4 = v6.add(w2).neg(); return { k1: y3, k2: S4 }; }, te$1.prototype.pointFromX = function(t2, r2) { t2 = new K2(t2, 16), t2.red || (t2 = t2.toRed(this.red)); - var i3 = t2.redSqr().redMul(t2).redIAdd(t2.redMul(this.a)).redIAdd(this.b), n4 = i3.redSqrt(); - if (n4.redSqr().redSub(i3).cmp(this.zero) !== 0) + var i2 = t2.redSqr().redMul(t2).redIAdd(t2.redMul(this.a)).redIAdd(this.b), n5 = i2.redSqrt(); + if (n5.redSqr().redSub(i2).cmp(this.zero) !== 0) throw new Error("invalid point"); - var o2 = n4.fromRed().isOdd(); - return (r2 && !o2 || !r2 && o2) && (n4 = n4.redNeg()), this.point(t2, n4); + var o2 = n5.fromRed().isOdd(); + return (r2 && !o2 || !r2 && o2) && (n5 = n5.redNeg()), this.point(t2, n5); }, te$1.prototype.validate = function(t2) { if (t2.inf) return true; - var r2 = t2.x, i3 = t2.y, n4 = this.a.redMul(r2), o2 = r2.redSqr().redMul(r2).redIAdd(n4).redIAdd(this.b); - return i3.redSqr().redISub(o2).cmpn(0) === 0; -}, te$1.prototype._endoWnafMulAdd = function(t2, r2, i3) { - for (var n4 = this._endoWnafT1, o2 = this._endoWnafT2, h4 = 0; h4 < t2.length; h4++) { + var r2 = t2.x, i2 = t2.y, n5 = this.a.redMul(r2), o2 = r2.redSqr().redMul(r2).redIAdd(n5).redIAdd(this.b); + return i2.redSqr().redISub(o2).cmpn(0) === 0; +}, te$1.prototype._endoWnafMulAdd = function(t2, r2, i2) { + for (var n5 = this._endoWnafT1, o2 = this._endoWnafT2, h4 = 0; h4 < t2.length; h4++) { var p3 = this._endoSplit(r2[h4]), A2 = t2[h4], v6 = A2._getBeta(); - p3.k1.negative && (p3.k1.ineg(), A2 = A2.neg(true)), p3.k2.negative && (p3.k2.ineg(), v6 = v6.neg(true)), n4[h4 * 2] = A2, n4[h4 * 2 + 1] = v6, o2[h4 * 2] = p3.k1, o2[h4 * 2 + 1] = p3.k2; + p3.k1.negative && (p3.k1.ineg(), A2 = A2.neg(true)), p3.k2.negative && (p3.k2.ineg(), v6 = v6.neg(true)), n5[h4 * 2] = A2, n5[h4 * 2 + 1] = v6, o2[h4 * 2] = p3.k1, o2[h4 * 2 + 1] = p3.k2; } - for (var w2 = this._wnafMulAdd(1, n4, o2, h4 * 2, i3), y3 = 0; y3 < h4 * 2; y3++) - n4[y3] = null, o2[y3] = null; + for (var w2 = this._wnafMulAdd(1, n5, o2, h4 * 2, i2), y3 = 0; y3 < h4 * 2; y3++) + n5[y3] = null, o2[y3] = null; return w2; }; -function Dt$1(e18, t2, r2, i3) { - $e.BasePoint.call(this, e18, "affine"), t2 === null && r2 === null ? (this.x = null, this.y = null, this.inf = true) : (this.x = new K2(t2, 16), this.y = new K2(r2, 16), i3 && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = false); +function Dt$1(e18, t2, r2, i2) { + $e.BasePoint.call(this, e18, "affine"), t2 === null && r2 === null ? (this.x = null, this.y = null, this.inf = true) : (this.x = new K2(t2, 16), this.y = new K2(r2, 16), i2 && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = false); } -Ki(Dt$1, $e.BasePoint), te$1.prototype.point = function(t2, r2, i3) { - return new Dt$1(this, t2, r2, i3); +Ki(Dt$1, $e.BasePoint), te$1.prototype.point = function(t2, r2, i2) { + return new Dt$1(this, t2, r2, i2); }, te$1.prototype.pointFromJSON = function(t2, r2) { return Dt$1.fromJSON(this, t2, r2); }, Dt$1.prototype._getBeta = function() { @@ -107910,25 +37216,25 @@ Ki(Dt$1, $e.BasePoint), te$1.prototype.point = function(t2, r2, i3) { return t2.beta; var r2 = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); if (t2) { - var i3 = this.curve, n4 = function(o2) { - return i3.point(o2.x.redMul(i3.endo.beta), o2.y); + var i2 = this.curve, n5 = function(o2) { + return i2.point(o2.x.redMul(i2.endo.beta), o2.y); }; - t2.beta = r2, r2.precomputed = { beta: null, naf: t2.naf && { wnd: t2.naf.wnd, points: t2.naf.points.map(n4) }, doubles: t2.doubles && { step: t2.doubles.step, points: t2.doubles.points.map(n4) } }; + t2.beta = r2, r2.precomputed = { beta: null, naf: t2.naf && { wnd: t2.naf.wnd, points: t2.naf.points.map(n5) }, doubles: t2.doubles && { step: t2.doubles.step, points: t2.doubles.points.map(n5) } }; } return r2; } }, Dt$1.prototype.toJSON = function() { return this.precomputed ? [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) } }] : [this.x, this.y]; -}, Dt$1.fromJSON = function(t2, r2, i3) { +}, Dt$1.fromJSON = function(t2, r2, i2) { typeof r2 == "string" && (r2 = JSON.parse(r2)); - var n4 = t2.point(r2[0], r2[1], i3); + var n5 = t2.point(r2[0], r2[1], i2); if (!r2[2]) - return n4; + return n5; function o2(p3) { - return t2.point(p3[0], p3[1], i3); + return t2.point(p3[0], p3[1], i2); } var h4 = r2[2]; - return n4.precomputed = { beta: null, doubles: h4.doubles && { step: h4.doubles.step, points: [n4].concat(h4.doubles.points.map(o2)) }, naf: h4.naf && { wnd: h4.naf.wnd, points: [n4].concat(h4.naf.points.map(o2)) } }, n4; + return n5.precomputed = { beta: null, doubles: h4.doubles && { step: h4.doubles.step, points: [n5].concat(h4.doubles.points.map(o2)) }, naf: h4.naf && { wnd: h4.naf.wnd, points: [n5].concat(h4.naf.points.map(o2)) } }, n5; }, Dt$1.prototype.inspect = function() { return this.isInfinity() ? "" : ""; }, Dt$1.prototype.isInfinity = function() { @@ -107946,15 +37252,15 @@ Ki(Dt$1, $e.BasePoint), te$1.prototype.point = function(t2, r2, i3) { return this.curve.point(null, null); var r2 = this.y.redSub(t2.y); r2.cmpn(0) !== 0 && (r2 = r2.redMul(this.x.redSub(t2.x).redInvm())); - var i3 = r2.redSqr().redISub(this.x).redISub(t2.x), n4 = r2.redMul(this.x.redSub(i3)).redISub(this.y); - return this.curve.point(i3, n4); + var i2 = r2.redSqr().redISub(this.x).redISub(t2.x), n5 = r2.redMul(this.x.redSub(i2)).redISub(this.y); + return this.curve.point(i2, n5); }, Dt$1.prototype.dbl = function() { if (this.inf) return this; var t2 = this.y.redAdd(this.y); if (t2.cmpn(0) === 0) return this.curve.point(null, null); - var r2 = this.curve.a, i3 = this.x.redSqr(), n4 = t2.redInvm(), o2 = i3.redAdd(i3).redIAdd(i3).redIAdd(r2).redMul(n4), h4 = o2.redSqr().redISub(this.x.redAdd(this.x)), p3 = o2.redMul(this.x.redSub(h4)).redISub(this.y); + var r2 = this.curve.a, i2 = this.x.redSqr(), n5 = t2.redInvm(), o2 = i2.redAdd(i2).redIAdd(i2).redIAdd(r2).redMul(n5), h4 = o2.redSqr().redISub(this.x.redAdd(this.x)), p3 = o2.redMul(this.x.redSub(h4)).redISub(this.y); return this.curve.point(h4, p3); }, Dt$1.prototype.getX = function() { return this.x.fromRed(); @@ -107962,12 +37268,12 @@ Ki(Dt$1, $e.BasePoint), te$1.prototype.point = function(t2, r2, i3) { return this.y.fromRed(); }, Dt$1.prototype.mul = function(t2) { return t2 = new K2(t2, 16), this.isInfinity() ? this : this._hasDoubles(t2) ? this.curve._fixedNafMul(this, t2) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [t2]) : this.curve._wnafMul(this, t2); -}, Dt$1.prototype.mulAdd = function(t2, r2, i3) { - var n4 = [this, r2], o2 = [t2, i3]; - return this.curve.endo ? this.curve._endoWnafMulAdd(n4, o2) : this.curve._wnafMulAdd(1, n4, o2, 2); -}, Dt$1.prototype.jmulAdd = function(t2, r2, i3) { - var n4 = [this, r2], o2 = [t2, i3]; - return this.curve.endo ? this.curve._endoWnafMulAdd(n4, o2, true) : this.curve._wnafMulAdd(1, n4, o2, 2, true); +}, Dt$1.prototype.mulAdd = function(t2, r2, i2) { + var n5 = [this, r2], o2 = [t2, i2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(n5, o2) : this.curve._wnafMulAdd(1, n5, o2, 2); +}, Dt$1.prototype.jmulAdd = function(t2, r2, i2) { + var n5 = [this, r2], o2 = [t2, i2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(n5, o2, true) : this.curve._wnafMulAdd(1, n5, o2, 2, true); }, Dt$1.prototype.eq = function(t2) { return this === t2 || this.inf === t2.inf && (this.inf || this.x.cmp(t2.x) === 0 && this.y.cmp(t2.y) === 0); }, Dt$1.prototype.neg = function(t2) { @@ -107975,10 +37281,10 @@ Ki(Dt$1, $e.BasePoint), te$1.prototype.point = function(t2, r2, i3) { return this; var r2 = this.curve.point(this.x, this.y.redNeg()); if (t2 && this.precomputed) { - var i3 = this.precomputed, n4 = function(o2) { + var i2 = this.precomputed, n5 = function(o2) { return o2.neg(); }; - r2.precomputed = { naf: i3.naf && { wnd: i3.naf.wnd, points: i3.naf.points.map(n4) }, doubles: i3.doubles && { step: i3.doubles.step, points: i3.doubles.points.map(n4) } }; + r2.precomputed = { naf: i2.naf && { wnd: i2.naf.wnd, points: i2.naf.points.map(n5) }, doubles: i2.doubles && { step: i2.doubles.step, points: i2.doubles.points.map(n5) } }; } return r2; }, Dt$1.prototype.toJ = function() { @@ -107987,16 +37293,16 @@ Ki(Dt$1, $e.BasePoint), te$1.prototype.point = function(t2, r2, i3) { var t2 = this.curve.jpoint(this.x, this.y, this.curve.one); return t2; }; -function Ft$1(e18, t2, r2, i3) { - $e.BasePoint.call(this, e18, "jacobian"), t2 === null && r2 === null && i3 === null ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new K2(0)) : (this.x = new K2(t2, 16), this.y = new K2(r2, 16), this.z = new K2(i3, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one; +function Ft$1(e18, t2, r2, i2) { + $e.BasePoint.call(this, e18, "jacobian"), t2 === null && r2 === null && i2 === null ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new K2(0)) : (this.x = new K2(t2, 16), this.y = new K2(r2, 16), this.z = new K2(i2, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one; } -Ki(Ft$1, $e.BasePoint), te$1.prototype.jpoint = function(t2, r2, i3) { - return new Ft$1(this, t2, r2, i3); +Ki(Ft$1, $e.BasePoint), te$1.prototype.jpoint = function(t2, r2, i2) { + return new Ft$1(this, t2, r2, i2); }, Ft$1.prototype.toP = function() { if (this.isInfinity()) return this.curve.point(null, null); - var t2 = this.z.redInvm(), r2 = t2.redSqr(), i3 = this.x.redMul(r2), n4 = this.y.redMul(r2).redMul(t2); - return this.curve.point(i3, n4); + var t2 = this.z.redInvm(), r2 = t2.redSqr(), i2 = this.x.redMul(r2), n5 = this.y.redMul(r2).redMul(t2); + return this.curve.point(i2, n5); }, Ft$1.prototype.neg = function() { return this.curve.jpoint(this.x, this.y.redNeg(), this.z); }, Ft$1.prototype.add = function(t2) { @@ -108004,20 +37310,20 @@ Ki(Ft$1, $e.BasePoint), te$1.prototype.jpoint = function(t2, r2, i3) { return t2; if (t2.isInfinity()) return this; - var r2 = t2.z.redSqr(), i3 = this.z.redSqr(), n4 = this.x.redMul(r2), o2 = t2.x.redMul(i3), h4 = this.y.redMul(r2.redMul(t2.z)), p3 = t2.y.redMul(i3.redMul(this.z)), A2 = n4.redSub(o2), v6 = h4.redSub(p3); + var r2 = t2.z.redSqr(), i2 = this.z.redSqr(), n5 = this.x.redMul(r2), o2 = t2.x.redMul(i2), h4 = this.y.redMul(r2.redMul(t2.z)), p3 = t2.y.redMul(i2.redMul(this.z)), A2 = n5.redSub(o2), v6 = h4.redSub(p3); if (A2.cmpn(0) === 0) return v6.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl(); - var w2 = A2.redSqr(), y3 = w2.redMul(A2), S4 = n4.redMul(w2), N2 = v6.redSqr().redIAdd(y3).redISub(S4).redISub(S4), I2 = v6.redMul(S4.redISub(N2)).redISub(h4.redMul(y3)), C3 = this.z.redMul(t2.z).redMul(A2); + var w2 = A2.redSqr(), y3 = w2.redMul(A2), S4 = n5.redMul(w2), N2 = v6.redSqr().redIAdd(y3).redISub(S4).redISub(S4), I2 = v6.redMul(S4.redISub(N2)).redISub(h4.redMul(y3)), C3 = this.z.redMul(t2.z).redMul(A2); return this.curve.jpoint(N2, I2, C3); }, Ft$1.prototype.mixedAdd = function(t2) { if (this.isInfinity()) return t2.toJ(); if (t2.isInfinity()) return this; - var r2 = this.z.redSqr(), i3 = this.x, n4 = t2.x.redMul(r2), o2 = this.y, h4 = t2.y.redMul(r2).redMul(this.z), p3 = i3.redSub(n4), A2 = o2.redSub(h4); + var r2 = this.z.redSqr(), i2 = this.x, n5 = t2.x.redMul(r2), o2 = this.y, h4 = t2.y.redMul(r2).redMul(this.z), p3 = i2.redSub(n5), A2 = o2.redSub(h4); if (p3.cmpn(0) === 0) return A2.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl(); - var v6 = p3.redSqr(), w2 = v6.redMul(p3), y3 = i3.redMul(v6), S4 = A2.redSqr().redIAdd(w2).redISub(y3).redISub(y3), N2 = A2.redMul(y3.redISub(S4)).redISub(o2.redMul(w2)), I2 = this.z.redMul(p3); + var v6 = p3.redSqr(), w2 = v6.redMul(p3), y3 = i2.redMul(v6), S4 = A2.redSqr().redIAdd(w2).redISub(y3).redISub(y3), N2 = A2.redMul(y3.redISub(S4)).redISub(o2.redMul(w2)), I2 = this.z.redMul(p3); return this.curve.jpoint(S4, N2, I2); }, Ft$1.prototype.dblp = function(t2) { if (t2 === 0) @@ -108028,14 +37334,14 @@ Ki(Ft$1, $e.BasePoint), te$1.prototype.jpoint = function(t2, r2, i3) { return this.dbl(); var r2; if (this.curve.zeroA || this.curve.threeA) { - var i3 = this; + var i2 = this; for (r2 = 0; r2 < t2; r2++) - i3 = i3.dbl(); - return i3; + i2 = i2.dbl(); + return i2; } - var n4 = this.curve.a, o2 = this.curve.tinv, h4 = this.x, p3 = this.y, A2 = this.z, v6 = A2.redSqr().redSqr(), w2 = p3.redAdd(p3); + var n5 = this.curve.a, o2 = this.curve.tinv, h4 = this.x, p3 = this.y, A2 = this.z, v6 = A2.redSqr().redSqr(), w2 = p3.redAdd(p3); for (r2 = 0; r2 < t2; r2++) { - var y3 = h4.redSqr(), S4 = w2.redSqr(), N2 = S4.redSqr(), I2 = y3.redAdd(y3).redIAdd(y3).redIAdd(n4.redMul(v6)), C3 = h4.redMul(S4), D2 = I2.redSqr().redISub(C3.redAdd(C3)), U5 = C3.redISub(D2), J2 = I2.redMul(U5); + var y3 = h4.redSqr(), S4 = w2.redSqr(), N2 = S4.redSqr(), I2 = y3.redAdd(y3).redIAdd(y3).redIAdd(n5.redMul(v6)), C3 = h4.redMul(S4), D2 = I2.redSqr().redISub(C3.redAdd(C3)), U5 = C3.redISub(D2), J2 = I2.redMul(U5); J2 = J2.redIAdd(J2).redISub(N2); var Bt2 = w2.redMul(A2); r2 + 1 < t2 && (v6 = v6.redMul(N2)), h4 = D2, A2 = Bt2, w2 = J2; @@ -108044,52 +37350,52 @@ Ki(Ft$1, $e.BasePoint), te$1.prototype.jpoint = function(t2, r2, i3) { }, Ft$1.prototype.dbl = function() { return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl(); }, Ft$1.prototype._zeroDbl = function() { - var t2, r2, i3; + var t2, r2, i2; if (this.zOne) { - var n4 = this.x.redSqr(), o2 = this.y.redSqr(), h4 = o2.redSqr(), p3 = this.x.redAdd(o2).redSqr().redISub(n4).redISub(h4); + var n5 = this.x.redSqr(), o2 = this.y.redSqr(), h4 = o2.redSqr(), p3 = this.x.redAdd(o2).redSqr().redISub(n5).redISub(h4); p3 = p3.redIAdd(p3); - var A2 = n4.redAdd(n4).redIAdd(n4), v6 = A2.redSqr().redISub(p3).redISub(p3), w2 = h4.redIAdd(h4); - w2 = w2.redIAdd(w2), w2 = w2.redIAdd(w2), t2 = v6, r2 = A2.redMul(p3.redISub(v6)).redISub(w2), i3 = this.y.redAdd(this.y); + var A2 = n5.redAdd(n5).redIAdd(n5), v6 = A2.redSqr().redISub(p3).redISub(p3), w2 = h4.redIAdd(h4); + w2 = w2.redIAdd(w2), w2 = w2.redIAdd(w2), t2 = v6, r2 = A2.redMul(p3.redISub(v6)).redISub(w2), i2 = this.y.redAdd(this.y); } else { var y3 = this.x.redSqr(), S4 = this.y.redSqr(), N2 = S4.redSqr(), I2 = this.x.redAdd(S4).redSqr().redISub(y3).redISub(N2); I2 = I2.redIAdd(I2); var C3 = y3.redAdd(y3).redIAdd(y3), D2 = C3.redSqr(), U5 = N2.redIAdd(N2); - U5 = U5.redIAdd(U5), U5 = U5.redIAdd(U5), t2 = D2.redISub(I2).redISub(I2), r2 = C3.redMul(I2.redISub(t2)).redISub(U5), i3 = this.y.redMul(this.z), i3 = i3.redIAdd(i3); + U5 = U5.redIAdd(U5), U5 = U5.redIAdd(U5), t2 = D2.redISub(I2).redISub(I2), r2 = C3.redMul(I2.redISub(t2)).redISub(U5), i2 = this.y.redMul(this.z), i2 = i2.redIAdd(i2); } - return this.curve.jpoint(t2, r2, i3); + return this.curve.jpoint(t2, r2, i2); }, Ft$1.prototype._threeDbl = function() { - var t2, r2, i3; + var t2, r2, i2; if (this.zOne) { - var n4 = this.x.redSqr(), o2 = this.y.redSqr(), h4 = o2.redSqr(), p3 = this.x.redAdd(o2).redSqr().redISub(n4).redISub(h4); + var n5 = this.x.redSqr(), o2 = this.y.redSqr(), h4 = o2.redSqr(), p3 = this.x.redAdd(o2).redSqr().redISub(n5).redISub(h4); p3 = p3.redIAdd(p3); - var A2 = n4.redAdd(n4).redIAdd(n4).redIAdd(this.curve.a), v6 = A2.redSqr().redISub(p3).redISub(p3); + var A2 = n5.redAdd(n5).redIAdd(n5).redIAdd(this.curve.a), v6 = A2.redSqr().redISub(p3).redISub(p3); t2 = v6; var w2 = h4.redIAdd(h4); - w2 = w2.redIAdd(w2), w2 = w2.redIAdd(w2), r2 = A2.redMul(p3.redISub(v6)).redISub(w2), i3 = this.y.redAdd(this.y); + w2 = w2.redIAdd(w2), w2 = w2.redIAdd(w2), r2 = A2.redMul(p3.redISub(v6)).redISub(w2), i2 = this.y.redAdd(this.y); } else { var y3 = this.z.redSqr(), S4 = this.y.redSqr(), N2 = this.x.redMul(S4), I2 = this.x.redSub(y3).redMul(this.x.redAdd(y3)); I2 = I2.redAdd(I2).redIAdd(I2); var C3 = N2.redIAdd(N2); C3 = C3.redIAdd(C3); var D2 = C3.redAdd(C3); - t2 = I2.redSqr().redISub(D2), i3 = this.y.redAdd(this.z).redSqr().redISub(S4).redISub(y3); + t2 = I2.redSqr().redISub(D2), i2 = this.y.redAdd(this.z).redSqr().redISub(S4).redISub(y3); var U5 = S4.redSqr(); U5 = U5.redIAdd(U5), U5 = U5.redIAdd(U5), U5 = U5.redIAdd(U5), r2 = I2.redMul(C3.redISub(t2)).redISub(U5); } - return this.curve.jpoint(t2, r2, i3); + return this.curve.jpoint(t2, r2, i2); }, Ft$1.prototype._dbl = function() { - var t2 = this.curve.a, r2 = this.x, i3 = this.y, n4 = this.z, o2 = n4.redSqr().redSqr(), h4 = r2.redSqr(), p3 = i3.redSqr(), A2 = h4.redAdd(h4).redIAdd(h4).redIAdd(t2.redMul(o2)), v6 = r2.redAdd(r2); + var t2 = this.curve.a, r2 = this.x, i2 = this.y, n5 = this.z, o2 = n5.redSqr().redSqr(), h4 = r2.redSqr(), p3 = i2.redSqr(), A2 = h4.redAdd(h4).redIAdd(h4).redIAdd(t2.redMul(o2)), v6 = r2.redAdd(r2); v6 = v6.redIAdd(v6); var w2 = v6.redMul(p3), y3 = A2.redSqr().redISub(w2.redAdd(w2)), S4 = w2.redISub(y3), N2 = p3.redSqr(); N2 = N2.redIAdd(N2), N2 = N2.redIAdd(N2), N2 = N2.redIAdd(N2); - var I2 = A2.redMul(S4).redISub(N2), C3 = i3.redAdd(i3).redMul(n4); + var I2 = A2.redMul(S4).redISub(N2), C3 = i2.redAdd(i2).redMul(n5); return this.curve.jpoint(y3, I2, C3); }, Ft$1.prototype.trpl = function() { if (!this.curve.zeroA) return this.dbl().add(this); - var t2 = this.x.redSqr(), r2 = this.y.redSqr(), i3 = this.z.redSqr(), n4 = r2.redSqr(), o2 = t2.redAdd(t2).redIAdd(t2), h4 = o2.redSqr(), p3 = this.x.redAdd(r2).redSqr().redISub(t2).redISub(n4); + var t2 = this.x.redSqr(), r2 = this.y.redSqr(), i2 = this.z.redSqr(), n5 = r2.redSqr(), o2 = t2.redAdd(t2).redIAdd(t2), h4 = o2.redSqr(), p3 = this.x.redAdd(r2).redSqr().redISub(t2).redISub(n5); p3 = p3.redIAdd(p3), p3 = p3.redAdd(p3).redIAdd(p3), p3 = p3.redISub(h4); - var A2 = p3.redSqr(), v6 = n4.redIAdd(n4); + var A2 = p3.redSqr(), v6 = n5.redIAdd(n5); v6 = v6.redIAdd(v6), v6 = v6.redIAdd(v6), v6 = v6.redIAdd(v6); var w2 = o2.redIAdd(p3).redSqr().redISub(h4).redISub(A2).redISub(v6), y3 = r2.redMul(w2); y3 = y3.redIAdd(y3), y3 = y3.redIAdd(y3); @@ -108097,7 +37403,7 @@ Ki(Ft$1, $e.BasePoint), te$1.prototype.jpoint = function(t2, r2, i3) { S4 = S4.redIAdd(S4), S4 = S4.redIAdd(S4); var N2 = this.y.redMul(w2.redMul(v6.redISub(w2)).redISub(p3.redMul(A2))); N2 = N2.redIAdd(N2), N2 = N2.redIAdd(N2), N2 = N2.redIAdd(N2); - var I2 = this.z.redAdd(p3).redSqr().redISub(i3).redISub(A2); + var I2 = this.z.redAdd(p3).redSqr().redISub(i2).redISub(A2); return this.curve.jpoint(S4, N2, I2); }, Ft$1.prototype.mul = function(t2, r2) { return t2 = new K2(t2, r2), this.curve._wnafMul(this, t2); @@ -108106,19 +37412,19 @@ Ki(Ft$1, $e.BasePoint), te$1.prototype.jpoint = function(t2, r2, i3) { return this.eq(t2.toJ()); if (this === t2) return true; - var r2 = this.z.redSqr(), i3 = t2.z.redSqr(); - if (this.x.redMul(i3).redISub(t2.x.redMul(r2)).cmpn(0) !== 0) + var r2 = this.z.redSqr(), i2 = t2.z.redSqr(); + if (this.x.redMul(i2).redISub(t2.x.redMul(r2)).cmpn(0) !== 0) return false; - var n4 = r2.redMul(this.z), o2 = i3.redMul(t2.z); - return this.y.redMul(o2).redISub(t2.y.redMul(n4)).cmpn(0) === 0; + var n5 = r2.redMul(this.z), o2 = i2.redMul(t2.z); + return this.y.redMul(o2).redISub(t2.y.redMul(n5)).cmpn(0) === 0; }, Ft$1.prototype.eqXToP = function(t2) { - var r2 = this.z.redSqr(), i3 = t2.toRed(this.curve.red).redMul(r2); - if (this.x.cmp(i3) === 0) + var r2 = this.z.redSqr(), i2 = t2.toRed(this.curve.red).redMul(r2); + if (this.x.cmp(i2) === 0) return true; - for (var n4 = t2.clone(), o2 = this.curve.redN.redMul(r2); ; ) { - if (n4.iadd(this.curve.n), n4.cmp(this.curve.p) >= 0) + for (var n5 = t2.clone(), o2 = this.curve.redN.redMul(r2); ; ) { + if (n5.iadd(this.curve.n), n5.cmp(this.curve.p) >= 0) return false; - if (i3.redIAdd(o2), this.x.cmp(i3) === 0) + if (i2.redIAdd(o2), this.x.cmp(i2) === 0) return true; } }, Ft$1.prototype.inspect = function() { @@ -108130,14 +37436,14 @@ var zr$1 = lr$2(function(e18, t2) { var r2 = t2; r2.base = $e, r2.short = Va, r2.mont = null, r2.edwards = null; }), jr$1 = lr$2(function(e18, t2) { - var r2 = t2, i3 = Gt$1.assert; - function n4(p3) { - p3.type === "short" ? this.curve = new zr$1.short(p3) : p3.type === "edwards" ? this.curve = new zr$1.edwards(p3) : this.curve = new zr$1.mont(p3), this.g = this.curve.g, this.n = this.curve.n, this.hash = p3.hash, i3(this.g.validate(), "Invalid curve"), i3(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); + var r2 = t2, i2 = Gt$1.assert; + function n5(p3) { + p3.type === "short" ? this.curve = new zr$1.short(p3) : p3.type === "edwards" ? this.curve = new zr$1.edwards(p3) : this.curve = new zr$1.mont(p3), this.g = this.curve.g, this.n = this.curve.n, this.hash = p3.hash, i2(this.g.validate(), "Invalid curve"), i2(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); } - r2.PresetCurve = n4; + r2.PresetCurve = n5; function o2(p3, A2) { Object.defineProperty(r2, p3, { configurable: true, enumerable: true, get: function() { - var v6 = new n4(A2); + var v6 = new n5(A2); return Object.defineProperty(r2, p3, { configurable: true, enumerable: true, value: v6 }), v6; } }); } @@ -108154,41 +37460,41 @@ function Re(e18) { if (!(this instanceof Re)) return new Re(e18); this.hash = e18.hash, this.predResist = !!e18.predResist, this.outLen = this.hash.outSize, this.minEntropy = e18.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null; - var t2 = fe$1.toArray(e18.entropy, e18.entropyEnc || "hex"), r2 = fe$1.toArray(e18.nonce, e18.nonceEnc || "hex"), i3 = fe$1.toArray(e18.pers, e18.persEnc || "hex"); - qi$1(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(t2, r2, i3); + var t2 = fe$1.toArray(e18.entropy, e18.entropyEnc || "hex"), r2 = fe$1.toArray(e18.nonce, e18.nonceEnc || "hex"), i2 = fe$1.toArray(e18.pers, e18.persEnc || "hex"); + qi$1(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(t2, r2, i2); } var qf = Re; -Re.prototype._init = function(t2, r2, i3) { - var n4 = t2.concat(r2).concat(i3); +Re.prototype._init = function(t2, r2, i2) { + var n5 = t2.concat(r2).concat(i2); this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8); for (var o2 = 0; o2 < this.V.length; o2++) this.K[o2] = 0, this.V[o2] = 1; - this._update(n4), this._reseed = 1, this.reseedInterval = 281474976710656; + this._update(n5), this._reseed = 1, this.reseedInterval = 281474976710656; }, Re.prototype._hmac = function() { return new se.hmac(this.hash, this.K); }, Re.prototype._update = function(t2) { var r2 = this._hmac().update(this.V).update([0]); t2 && (r2 = r2.update(t2)), this.K = r2.digest(), this.V = this._hmac().update(this.V).digest(), t2 && (this.K = this._hmac().update(this.V).update([1]).update(t2).digest(), this.V = this._hmac().update(this.V).digest()); -}, Re.prototype.reseed = function(t2, r2, i3, n4) { - typeof r2 != "string" && (n4 = i3, i3 = r2, r2 = null), t2 = fe$1.toArray(t2, r2), i3 = fe$1.toArray(i3, n4), qi$1(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(t2.concat(i3 || [])), this._reseed = 1; -}, Re.prototype.generate = function(t2, r2, i3, n4) { +}, Re.prototype.reseed = function(t2, r2, i2, n5) { + typeof r2 != "string" && (n5 = i2, i2 = r2, r2 = null), t2 = fe$1.toArray(t2, r2), i2 = fe$1.toArray(i2, n5), qi$1(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(t2.concat(i2 || [])), this._reseed = 1; +}, Re.prototype.generate = function(t2, r2, i2, n5) { if (this._reseed > this.reseedInterval) throw new Error("Reseed is required"); - typeof r2 != "string" && (n4 = i3, i3 = r2, r2 = null), i3 && (i3 = fe$1.toArray(i3, n4 || "hex"), this._update(i3)); + typeof r2 != "string" && (n5 = i2, i2 = r2, r2 = null), i2 && (i2 = fe$1.toArray(i2, n5 || "hex"), this._update(i2)); for (var o2 = []; o2.length < t2; ) this.V = this._hmac().update(this.V).digest(), o2 = o2.concat(this.V); var h4 = o2.slice(0, t2); - return this._update(i3), this._reseed++, fe$1.encode(h4, r2); + return this._update(i2), this._reseed++, fe$1.encode(h4, r2); }; var Hi = Gt$1.assert; function kt$1(e18, t2) { this.ec = e18, this.priv = null, this.pub = null, t2.priv && this._importPrivate(t2.priv, t2.privEnc), t2.pub && this._importPublic(t2.pub, t2.pubEnc); } var Li = kt$1; -kt$1.fromPublic = function(t2, r2, i3) { - return r2 instanceof kt$1 ? r2 : new kt$1(t2, { pub: r2, pubEnc: i3 }); -}, kt$1.fromPrivate = function(t2, r2, i3) { - return r2 instanceof kt$1 ? r2 : new kt$1(t2, { priv: r2, privEnc: i3 }); +kt$1.fromPublic = function(t2, r2, i2) { + return r2 instanceof kt$1 ? r2 : new kt$1(t2, { pub: r2, pubEnc: i2 }); +}, kt$1.fromPrivate = function(t2, r2, i2) { + return r2 instanceof kt$1 ? r2 : new kt$1(t2, { priv: r2, privEnc: i2 }); }, kt$1.prototype.validate = function() { var t2 = this.getPublic(); return t2.isInfinity() ? { result: false, reason: "Invalid public key" } : t2.validate() ? t2.mul(this.ec.curve.n).isInfinity() ? { result: true, reason: null } : { result: false, reason: "Public key * N != O" } : { result: false, reason: "Public key is not a point" }; @@ -108206,8 +37512,8 @@ kt$1.fromPublic = function(t2, r2, i3) { this.pub = this.ec.curve.decodePoint(t2, r2); }, kt$1.prototype.derive = function(t2) { return t2.validate() || Hi(t2.validate(), "public point not validated"), t2.mul(this.priv).getX(); -}, kt$1.prototype.sign = function(t2, r2, i3) { - return this.ec.sign(t2, this, r2, i3); +}, kt$1.prototype.sign = function(t2, r2, i2) { + return this.ec.sign(t2, this, r2, i2); }, kt$1.prototype.verify = function(t2, r2) { return this.ec.verify(t2, r2, this); }, kt$1.prototype.inspect = function() { @@ -108227,12 +37533,12 @@ function zi(e18, t2) { var r2 = e18[t2.place++]; if (!(r2 & 128)) return r2; - var i3 = r2 & 15; - if (i3 === 0 || i3 > 4) + var i2 = r2 & 15; + if (i2 === 0 || i2 > 4) return false; - for (var n4 = 0, o2 = 0, h4 = t2.place; o2 < i3; o2++, h4++) - n4 <<= 8, n4 |= e18[h4], n4 >>>= 0; - return n4 <= 127 ? false : (t2.place = h4, n4); + for (var n5 = 0, o2 = 0, h4 = t2.place; o2 < i2; o2++, h4++) + n5 <<= 8, n5 |= e18[h4], n5 >>>= 0; + return n5 <= 127 ? false : (t2.place = h4, n5); } function Kf(e18) { for (var t2 = 0, r2 = e18.length - 1; !e18[t2] && !(e18[t2 + 1] & 128) && t2 < r2; ) @@ -108241,22 +37547,22 @@ function Kf(e18) { } Qr$1.prototype._importDER = function(t2, r2) { t2 = Gt$1.toArray(t2, r2); - var i3 = new Xa(); - if (t2[i3.place++] !== 48) + var i2 = new Xa(); + if (t2[i2.place++] !== 48) return false; - var n4 = zi(t2, i3); - if (n4 === false || n4 + i3.place !== t2.length || t2[i3.place++] !== 2) + var n5 = zi(t2, i2); + if (n5 === false || n5 + i2.place !== t2.length || t2[i2.place++] !== 2) return false; - var o2 = zi(t2, i3); + var o2 = zi(t2, i2); if (o2 === false) return false; - var h4 = t2.slice(i3.place, o2 + i3.place); - if (i3.place += o2, t2[i3.place++] !== 2) + var h4 = t2.slice(i2.place, o2 + i2.place); + if (i2.place += o2, t2[i2.place++] !== 2) return false; - var p3 = zi(t2, i3); - if (p3 === false || t2.length !== p3 + i3.place) + var p3 = zi(t2, i2); + if (p3 === false || t2.length !== p3 + i2.place) return false; - var A2 = t2.slice(i3.place, p3 + i3.place); + var A2 = t2.slice(i2.place, p3 + i2.place); if (h4[0] === 0) if (h4[1] & 128) h4 = h4.slice(1); @@ -108280,12 +37586,12 @@ function ji(e18, t2) { e18.push(t2); } Qr$1.prototype.toDER = function(t2) { - var r2 = this.r.toArray(), i3 = this.s.toArray(); - for (r2[0] & 128 && (r2 = [0].concat(r2)), i3[0] & 128 && (i3 = [0].concat(i3)), r2 = Kf(r2), i3 = Kf(i3); !i3[0] && !(i3[1] & 128); ) - i3 = i3.slice(1); - var n4 = [2]; - ji(n4, r2.length), n4 = n4.concat(r2), n4.push(2), ji(n4, i3.length); - var o2 = n4.concat(i3), h4 = [48]; + var r2 = this.r.toArray(), i2 = this.s.toArray(); + for (r2[0] & 128 && (r2 = [0].concat(r2)), i2[0] & 128 && (i2 = [0].concat(i2)), r2 = Kf(r2), i2 = Kf(i2); !i2[0] && !(i2[1] & 128); ) + i2 = i2.slice(1); + var n5 = [2]; + ji(n5, r2.length), n5 = n5.concat(r2), n5.push(2), ji(n5, i2.length); + var o2 = n5.concat(i2), h4 = [48]; return ji(h4, o2.length), h4 = h4.concat(o2), Gt$1.encode(h4, t2); }; var $a$1 = function() { @@ -108305,18 +37611,18 @@ ee$1.prototype.keyPair = function(t2) { return Li.fromPublic(this, t2, r2); }, ee$1.prototype.genKeyPair = function(t2) { t2 || (t2 = {}); - for (var r2 = new qf({ hash: this.hash, pers: t2.pers, persEnc: t2.persEnc || "utf8", entropy: t2.entropy || $a$1(this.hash.hmacStrength), entropyEnc: t2.entropy && t2.entropyEnc || "utf8", nonce: this.n.toArray() }), i3 = this.n.byteLength(), n4 = this.n.sub(new K2(2)); ; ) { - var o2 = new K2(r2.generate(i3)); - if (!(o2.cmp(n4) > 0)) + for (var r2 = new qf({ hash: this.hash, pers: t2.pers, persEnc: t2.persEnc || "utf8", entropy: t2.entropy || $a$1(this.hash.hmacStrength), entropyEnc: t2.entropy && t2.entropyEnc || "utf8", nonce: this.n.toArray() }), i2 = this.n.byteLength(), n5 = this.n.sub(new K2(2)); ; ) { + var o2 = new K2(r2.generate(i2)); + if (!(o2.cmp(n5) > 0)) return o2.iaddn(1), this.keyFromPrivate(o2); } }, ee$1.prototype._truncateToN = function(t2, r2) { - var i3 = t2.byteLength() * 8 - this.n.bitLength(); - return i3 > 0 && (t2 = t2.ushrn(i3)), !r2 && t2.cmp(this.n) >= 0 ? t2.sub(this.n) : t2; -}, ee$1.prototype.sign = function(t2, r2, i3, n4) { - typeof i3 == "object" && (n4 = i3, i3 = null), n4 || (n4 = {}), r2 = this.keyFromPrivate(r2, i3), t2 = this._truncateToN(new K2(t2, 16)); - for (var o2 = this.n.byteLength(), h4 = r2.getPrivate().toArray("be", o2), p3 = t2.toArray("be", o2), A2 = new qf({ hash: this.hash, entropy: h4, nonce: p3, pers: n4.pers, persEnc: n4.persEnc || "utf8" }), v6 = this.n.sub(new K2(1)), w2 = 0; ; w2++) { - var y3 = n4.k ? n4.k(w2) : new K2(A2.generate(this.n.byteLength())); + var i2 = t2.byteLength() * 8 - this.n.bitLength(); + return i2 > 0 && (t2 = t2.ushrn(i2)), !r2 && t2.cmp(this.n) >= 0 ? t2.sub(this.n) : t2; +}, ee$1.prototype.sign = function(t2, r2, i2, n5) { + typeof i2 == "object" && (n5 = i2, i2 = null), n5 || (n5 = {}), r2 = this.keyFromPrivate(r2, i2), t2 = this._truncateToN(new K2(t2, 16)); + for (var o2 = this.n.byteLength(), h4 = r2.getPrivate().toArray("be", o2), p3 = t2.toArray("be", o2), A2 = new qf({ hash: this.hash, entropy: h4, nonce: p3, pers: n5.pers, persEnc: n5.persEnc || "utf8" }), v6 = this.n.sub(new K2(1)), w2 = 0; ; w2++) { + var y3 = n5.k ? n5.k(w2) : new K2(A2.generate(this.n.byteLength())); if (y3 = this._truncateToN(y3, true), !(y3.cmpn(1) <= 0 || y3.cmp(v6) >= 0)) { var S4 = this.g.mul(y3); if (!S4.isInfinity()) { @@ -108325,39 +37631,39 @@ ee$1.prototype.keyPair = function(t2) { var C3 = y3.invm(this.n).mul(I2.mul(r2.getPrivate()).iadd(t2)); if (C3 = C3.umod(this.n), C3.cmpn(0) !== 0) { var D2 = (S4.getY().isOdd() ? 1 : 0) | (N2.cmp(I2) !== 0 ? 2 : 0); - return n4.canonical && C3.cmp(this.nh) > 0 && (C3 = this.n.sub(C3), D2 ^= 1), new Jr$1({ r: I2, s: C3, recoveryParam: D2 }); + return n5.canonical && C3.cmp(this.nh) > 0 && (C3 = this.n.sub(C3), D2 ^= 1), new Jr$1({ r: I2, s: C3, recoveryParam: D2 }); } } } } } -}, ee$1.prototype.verify = function(t2, r2, i3, n4) { - t2 = this._truncateToN(new K2(t2, 16)), i3 = this.keyFromPublic(i3, n4), r2 = new Jr$1(r2, "hex"); +}, ee$1.prototype.verify = function(t2, r2, i2, n5) { + t2 = this._truncateToN(new K2(t2, 16)), i2 = this.keyFromPublic(i2, n5), r2 = new Jr$1(r2, "hex"); var o2 = r2.r, h4 = r2.s; if (o2.cmpn(1) < 0 || o2.cmp(this.n) >= 0 || h4.cmpn(1) < 0 || h4.cmp(this.n) >= 0) return false; var p3 = h4.invm(this.n), A2 = p3.mul(t2).umod(this.n), v6 = p3.mul(o2).umod(this.n), w2; - return this.curve._maxwellTrick ? (w2 = this.g.jmulAdd(A2, i3.getPublic(), v6), w2.isInfinity() ? false : w2.eqXToP(o2)) : (w2 = this.g.mulAdd(A2, i3.getPublic(), v6), w2.isInfinity() ? false : w2.getX().umod(this.n).cmp(o2) === 0); -}, ee$1.prototype.recoverPubKey = function(e18, t2, r2, i3) { - Hf((3 & r2) === r2, "The recovery param is more than two bits"), t2 = new Jr$1(t2, i3); - var n4 = this.n, o2 = new K2(e18), h4 = t2.r, p3 = t2.s, A2 = r2 & 1, v6 = r2 >> 1; + return this.curve._maxwellTrick ? (w2 = this.g.jmulAdd(A2, i2.getPublic(), v6), w2.isInfinity() ? false : w2.eqXToP(o2)) : (w2 = this.g.mulAdd(A2, i2.getPublic(), v6), w2.isInfinity() ? false : w2.getX().umod(this.n).cmp(o2) === 0); +}, ee$1.prototype.recoverPubKey = function(e18, t2, r2, i2) { + Hf((3 & r2) === r2, "The recovery param is more than two bits"), t2 = new Jr$1(t2, i2); + var n5 = this.n, o2 = new K2(e18), h4 = t2.r, p3 = t2.s, A2 = r2 & 1, v6 = r2 >> 1; if (h4.cmp(this.curve.p.umod(this.curve.n)) >= 0 && v6) throw new Error("Unable to find sencond key candinate"); v6 ? h4 = this.curve.pointFromX(h4.add(this.curve.n), A2) : h4 = this.curve.pointFromX(h4, A2); - var w2 = t2.r.invm(n4), y3 = n4.sub(o2).mul(w2).umod(n4), S4 = p3.mul(w2).umod(n4); + var w2 = t2.r.invm(n5), y3 = n5.sub(o2).mul(w2).umod(n5), S4 = p3.mul(w2).umod(n5); return this.g.mulAdd(y3, h4, S4); -}, ee$1.prototype.getKeyRecoveryParam = function(e18, t2, r2, i3) { - if (t2 = new Jr$1(t2, i3), t2.recoveryParam !== null) +}, ee$1.prototype.getKeyRecoveryParam = function(e18, t2, r2, i2) { + if (t2 = new Jr$1(t2, i2), t2.recoveryParam !== null) return t2.recoveryParam; - for (var n4 = 0; n4 < 4; n4++) { + for (var n5 = 0; n5 < 4; n5++) { var o2; try { - o2 = this.recoverPubKey(e18, t2, n4); + o2 = this.recoverPubKey(e18, t2, n5); } catch { continue; } if (o2.eq(r2)) - return n4; + return n5; } throw new Error("Unable to find valid recovery factor"); }; @@ -108379,32 +37685,32 @@ class iu { wr$1(this, "publicKey", "0x" + r2.getPublic(false, "hex")), wr$1(this, "compressedPublicKey", "0x" + r2.getPublic(true, "hex")), wr$1(this, "_isSigningKey", true); } _addPoint(t2) { - const r2 = ve$1().keyFromPublic(Ot$1(this.publicKey)), i3 = ve$1().keyFromPublic(Ot$1(t2)); - return "0x" + r2.pub.add(i3.pub).encodeCompressed("hex"); + const r2 = ve$1().keyFromPublic(Ot$1(this.publicKey)), i2 = ve$1().keyFromPublic(Ot$1(t2)); + return "0x" + r2.pub.add(i2.pub).encodeCompressed("hex"); } signDigest(t2) { - const r2 = ve$1().keyFromPrivate(Ot$1(this.privateKey)), i3 = Ot$1(t2); - i3.length !== 32 && Qi.throwArgumentError("bad digest length", "digest", t2); - const n4 = r2.sign(i3, { canonical: true }); - return Wn({ recoveryParam: n4.recoveryParam, r: oe$2("0x" + n4.r.toString(16), 32), s: oe$2("0x" + n4.s.toString(16), 32) }); + const r2 = ve$1().keyFromPrivate(Ot$1(this.privateKey)), i2 = Ot$1(t2); + i2.length !== 32 && Qi.throwArgumentError("bad digest length", "digest", t2); + const n5 = r2.sign(i2, { canonical: true }); + return Wn({ recoveryParam: n5.recoveryParam, r: oe$2("0x" + n5.r.toString(16), 32), s: oe$2("0x" + n5.s.toString(16), 32) }); } computeSharedSecret(t2) { - const r2 = ve$1().keyFromPrivate(Ot$1(this.privateKey)), i3 = ve$1().keyFromPublic(Ot$1(Lf(t2))); - return oe$2("0x" + r2.derive(i3.getPublic()).toString(16), 32); + const r2 = ve$1().keyFromPrivate(Ot$1(this.privateKey)), i2 = ve$1().keyFromPublic(Ot$1(Lf(t2))); + return oe$2("0x" + r2.derive(i2.getPublic()).toString(16), 32); } static isSigningKey(t2) { return !!(t2 && t2._isSigningKey); } } function nu(e18, t2) { - const r2 = Wn(t2), i3 = { r: Ot$1(r2.r), s: Ot$1(r2.s) }; - return "0x" + ve$1().recoverPubKey(Ot$1(e18), i3, r2.recoveryParam).encode("hex", false); + const r2 = Wn(t2), i2 = { r: Ot$1(r2.r), s: Ot$1(r2.s) }; + return "0x" + ve$1().recoverPubKey(Ot$1(e18), i2, r2.recoveryParam).encode("hex", false); } function Lf(e18, t2) { const r2 = Ot$1(e18); if (r2.length === 32) { - const i3 = new iu(r2); - return t2 ? "0x" + ve$1().keyFromPrivate(r2).getPublic(true, "hex") : i3.publicKey; + const i2 = new iu(r2); + return t2 ? "0x" + ve$1().keyFromPrivate(r2).getPublic(true, "hex") : i2.publicKey; } else { if (r2.length === 33) return t2 ? Kt$1(r2) : "0x" + ve$1().keyFromPublic(r2).getPublic(false, "hex"); @@ -108425,12 +37731,12 @@ function su(e18, t2) { return ou(nu(Ot$1(e18), t2)); } const au = "https://rpc.walletconnect.org/v1"; -async function jf(e18, t2, r2, i3, n4, o2) { +async function jf(e18, t2, r2, i2, n5, o2) { switch (r2.t) { case "eip191": return Qf(e18, t2, r2.s); case "eip1271": - return await Jf(e18, t2, r2.s, i3, n4, o2); + return await Jf(e18, t2, r2.s, i2, n5, o2); default: throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r2.t}`); } @@ -108438,9 +37744,9 @@ async function jf(e18, t2, r2, i3, n4, o2) { function Qf(e18, t2, r2) { return su(df(t2), r2).toLowerCase() === e18.toLowerCase(); } -async function Jf(e18, t2, r2, i3, n4, o2) { +async function Jf(e18, t2, r2, i2, n5, o2) { try { - const h4 = "0x1626ba7e", p3 = "0000000000000000000000000000000000000000000000000000000000000040", A2 = "0000000000000000000000000000000000000000000000000000000000000041", v6 = r2.substring(2), w2 = df(t2).substring(2), y3 = h4 + w2 + p3 + A2 + v6, S4 = await fetch(`${o2 || au}/?chainId=${i3}&projectId=${n4}`, { method: "POST", body: JSON.stringify({ id: uu(), jsonrpc: "2.0", method: "eth_call", params: [{ to: e18, data: y3 }, "latest"] }) }), { result: N2 } = await S4.json(); + const h4 = "0x1626ba7e", p3 = "0000000000000000000000000000000000000000000000000000000000000040", A2 = "0000000000000000000000000000000000000000000000000000000000000041", v6 = r2.substring(2), w2 = df(t2).substring(2), y3 = h4 + w2 + p3 + A2 + v6, S4 = await fetch(`${o2 || au}/?chainId=${i2}&projectId=${n5}`, { method: "POST", body: JSON.stringify({ id: uu(), jsonrpc: "2.0", method: "eth_call", params: [{ to: e18, data: y3 }, "latest"] }) }), { result: N2 } = await S4.json(); return N2 ? N2.slice(0, h4.length).toLowerCase() === h4.toLowerCase() : false; } catch (h4) { return console.error("isValidEip1271Signature: ", h4), false; @@ -108471,21 +37777,21 @@ const vu = "did:pkh:", Gr$1 = (e18) => e18 == null ? void 0 : e18.split(":"), Yi return t2.pop(); }; async function mu(e18) { - const { cacao: t2, projectId: r2 } = e18, { s: i3, p: n4 } = t2, o2 = Wf(n4, n4.iss), h4 = Vi(n4.iss); - return await jf(h4, o2, i3, Yi(n4.iss), r2); + const { cacao: t2, projectId: r2 } = e18, { s: i2, p: n5 } = t2, o2 = Wf(n5, n5.iss), h4 = Vi(n5.iss); + return await jf(h4, o2, i2, Yi(n5.iss), r2); } const Wf = (e18, t2) => { - const r2 = `${e18.domain} wants you to sign in with your Ethereum account:`, i3 = Vi(t2); + const r2 = `${e18.domain} wants you to sign in with your Ethereum account:`, i2 = Vi(t2); if (!e18.aud && !e18.uri) throw new Error("Either `aud` or `uri` is required to construct the message"); - let n4 = e18.statement || void 0; + let n5 = e18.statement || void 0; const o2 = `URI: ${e18.aud || e18.uri}`, h4 = `Version: ${e18.version}`, p3 = `Chain ID: ${Yi(t2)}`, A2 = `Nonce: ${e18.nonce}`, v6 = `Issued At: ${e18.iat}`, w2 = e18.exp ? `Expiration Time: ${e18.exp}` : void 0, y3 = e18.nbf ? `Not Before: ${e18.nbf}` : void 0, S4 = e18.requestId ? `Request ID: ${e18.requestId}` : void 0, N2 = e18.resources ? `Resources:${e18.resources.map((C3) => ` - ${C3}`).join("")}` : void 0, I2 = Vr$1(e18.resources); if (I2) { const C3 = Oe(I2); - n4 = $i(n4, C3); + n5 = $i(n5, C3); } - return [r2, i3, "", n4, "", o2, h4, p3, A2, v6, w2, y3, S4, N2].filter((C3) => C3 != null).join(` + return [r2, i2, "", n5, "", o2, h4, p3, A2, v6, w2, y3, S4, N2].filter((C3) => C3 != null).join(` `); }; function to(e18) { @@ -108503,33 +37809,33 @@ function ge(e18) { if (!(t2 != null && t2.length)) throw new Error("No resources found in `att` property"); t2.forEach((r2) => { - const i3 = e18.att[r2]; - if (Array.isArray(i3)) + const i2 = e18.att[r2]; + if (Array.isArray(i2)) throw new Error(`Resource must be an object: ${r2}`); - if (typeof i3 != "object") + if (typeof i2 != "object") throw new Error(`Resource must be an object: ${r2}`); - if (!Object.keys(i3).length) + if (!Object.keys(i2).length) throw new Error(`Resource object is empty: ${r2}`); - Object.keys(i3).forEach((n4) => { - const o2 = i3[n4]; + Object.keys(i2).forEach((n5) => { + const o2 = i2[n5]; if (!Array.isArray(o2)) - throw new Error(`Ability limits ${n4} must be an array of objects, found: ${o2}`); + throw new Error(`Ability limits ${n5} must be an array of objects, found: ${o2}`); if (!o2.length) - throw new Error(`Value of ${n4} is empty array, must be an array with objects`); + throw new Error(`Value of ${n5} is empty array, must be an array with objects`); o2.forEach((h4) => { if (typeof h4 != "object") - throw new Error(`Ability limits (${n4}) must be an array of objects, found: ${h4}`); + throw new Error(`Ability limits (${n5}) must be an array of objects, found: ${h4}`); }); }); }); } -function ro(e18, t2, r2, i3 = {}) { - return r2 == null ? void 0 : r2.sort((n4, o2) => n4.localeCompare(o2)), { att: { [e18]: Wi$1(t2, r2, i3) } }; +function ro(e18, t2, r2, i2 = {}) { + return r2 == null ? void 0 : r2.sort((n5, o2) => n5.localeCompare(o2)), { att: { [e18]: Wi$1(t2, r2, i2) } }; } function Wi$1(e18, t2, r2 = {}) { - t2 = t2 == null ? void 0 : t2.sort((n4, o2) => n4.localeCompare(o2)); - const i3 = t2.map((n4) => ({ [`${e18}/${n4}`]: [r2] })); - return Object.assign({}, ...i3); + t2 = t2 == null ? void 0 : t2.sort((n5, o2) => n5.localeCompare(o2)); + const i2 = t2.map((n5) => ({ [`${e18}/${n5}`]: [r2] })); + return Object.assign({}, ...i2); } function Yr$1(e18) { return ge(e18), `urn:recap:${to(e18).replace(/=/g, "")}`; @@ -108539,34 +37845,34 @@ function Oe(e18) { return ge(t2), t2; } function xu(e18, t2, r2) { - const i3 = ro(e18, t2, r2); - return Yr$1(i3); + const i2 = ro(e18, t2, r2); + return Yr$1(i2); } function Xi(e18) { return e18 && e18.includes("urn:recap:"); } function Mu(e18, t2) { - const r2 = Oe(e18), i3 = Oe(t2), n4 = no(r2, i3); - return Yr$1(n4); + const r2 = Oe(e18), i2 = Oe(t2), n5 = no(r2, i2); + return Yr$1(n5); } function no(e18, t2) { ge(e18), ge(t2); - const r2 = Object.keys(e18.att).concat(Object.keys(t2.att)).sort((n4, o2) => n4.localeCompare(o2)), i3 = { att: {} }; - return r2.forEach((n4) => { + const r2 = Object.keys(e18.att).concat(Object.keys(t2.att)).sort((n5, o2) => n5.localeCompare(o2)), i2 = { att: {} }; + return r2.forEach((n5) => { var o2, h4; - Object.keys(((o2 = e18.att) == null ? void 0 : o2[n4]) || {}).concat(Object.keys(((h4 = t2.att) == null ? void 0 : h4[n4]) || {})).sort((p3, A2) => p3.localeCompare(A2)).forEach((p3) => { + Object.keys(((o2 = e18.att) == null ? void 0 : o2[n5]) || {}).concat(Object.keys(((h4 = t2.att) == null ? void 0 : h4[n5]) || {})).sort((p3, A2) => p3.localeCompare(A2)).forEach((p3) => { var A2, v6; - i3.att[n4] = Vf(Gi({}, i3.att[n4]), { [p3]: ((A2 = e18.att[n4]) == null ? void 0 : A2[p3]) || ((v6 = t2.att[n4]) == null ? void 0 : v6[p3]) }); + i2.att[n5] = Vf(Gi({}, i2.att[n5]), { [p3]: ((A2 = e18.att[n5]) == null ? void 0 : A2[p3]) || ((v6 = t2.att[n5]) == null ? void 0 : v6[p3]) }); }); - }), i3; + }), i2; } function $i(e18 = "", t2) { ge(t2); const r2 = "I further authorize the stated URI to perform the following actions on my behalf: "; if (e18.includes(r2)) return e18; - const i3 = []; - let n4 = 0; + const i2 = []; + let n5 = 0; Object.keys(t2.att).forEach((p3) => { const A2 = Object.keys(t2.att[p3]).map((y3) => ({ ability: y3.split("/")[0], action: y3.split("/")[1] })); A2.sort((y3, S4) => y3.action.localeCompare(S4.action)); @@ -108574,27 +37880,27 @@ function $i(e18 = "", t2) { A2.forEach((y3) => { v6[y3.ability] || (v6[y3.ability] = []), v6[y3.ability].push(y3.action); }); - const w2 = Object.keys(v6).map((y3) => (n4++, `(${n4}) '${y3}': '${v6[y3].join("', '")}' for '${p3}'.`)); - i3.push(w2.join(", ").replace(".,", ".")); + const w2 = Object.keys(v6).map((y3) => (n5++, `(${n5}) '${y3}': '${v6[y3].join("', '")}' for '${p3}'.`)); + i2.push(w2.join(", ").replace(".,", ".")); }); - const o2 = i3.join(" "), h4 = `${r2}${o2}`; + const o2 = i2.join(" "), h4 = `${r2}${o2}`; return `${e18 ? e18 + " " : ""}${h4}`; } function Eu(e18) { var t2; const r2 = Oe(e18); ge(r2); - const i3 = (t2 = r2.att) == null ? void 0 : t2.eip155; - return i3 ? Object.keys(i3).map((n4) => n4.split("/")[1]) : []; + const i2 = (t2 = r2.att) == null ? void 0 : t2.eip155; + return i2 ? Object.keys(i2).map((n5) => n5.split("/")[1]) : []; } function Su(e18) { const t2 = Oe(e18); ge(t2); const r2 = []; - return Object.values(t2.att).forEach((i3) => { - Object.values(i3).forEach((n4) => { + return Object.values(t2.att).forEach((i2) => { + Object.values(i2).forEach((n5) => { var o2; - (o2 = n4 == null ? void 0 : n4[0]) != null && o2.chains && r2.push(n4[0].chains); + (o2 = n5 == null ? void 0 : n5[0]) != null && o2.chains && r2.push(n5[0].chains); }); }), [...new Set(r2.flat())]; } @@ -108607,78 +37913,78 @@ function Vr$1(e18) { const Zi = "base10", Lt$2 = "base16", tn$1 = "base64pad", Iu = "base64url", dr$2 = "utf8", en$1 = 0, pr$2 = 1, Sr$1 = 2, Nu = 0, oo = 1, Ir$1 = 12, rn$1 = 32; function _u() { const e18 = x25519.generateKeyPair(); - return { privateKey: toString$1(e18.secretKey, Lt$2), publicKey: toString$1(e18.publicKey, Lt$2) }; + return { privateKey: toString$3(e18.secretKey, Lt$2), publicKey: toString$3(e18.publicKey, Lt$2) }; } function Bu() { const e18 = random.randomBytes(rn$1); - return toString$1(e18, Lt$2); + return toString$3(e18, Lt$2); } function Cu(e18, t2) { - const r2 = x25519.sharedKey(fromString(e18, Lt$2), fromString(t2, Lt$2), true), i3 = new HKDF_1(sha256.SHA256, r2).expand(rn$1); - return toString$1(i3, Lt$2); + const r2 = x25519.sharedKey(fromString(e18, Lt$2), fromString(t2, Lt$2), true), i2 = new HKDF_1(sha256$3.SHA256, r2).expand(rn$1); + return toString$3(i2, Lt$2); } function Ru(e18) { - const t2 = sha256.hash(fromString(e18, Lt$2)); - return toString$1(t2, Lt$2); + const t2 = sha256$3.hash(fromString(e18, Lt$2)); + return toString$3(t2, Lt$2); } function Ou(e18) { - const t2 = sha256.hash(fromString(e18, dr$2)); - return toString$1(t2, Lt$2); + const t2 = sha256$3.hash(fromString(e18, dr$2)); + return toString$3(t2, Lt$2); } function nn$1(e18) { return fromString(`${e18}`, Zi); } function Ze$1(e18) { - return Number(toString$1(e18, Zi)); + return Number(toString$3(e18, Zi)); } function Pu(e18) { const t2 = nn$1(typeof e18.type < "u" ? e18.type : en$1); if (Ze$1(t2) === pr$2 && typeof e18.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope"); - const r2 = typeof e18.senderPublicKey < "u" ? fromString(e18.senderPublicKey, Lt$2) : void 0, i3 = typeof e18.iv < "u" ? fromString(e18.iv, Lt$2) : random.randomBytes(Ir$1), n4 = new chacha20poly1305.ChaCha20Poly1305(fromString(e18.symKey, Lt$2)).seal(i3, fromString(e18.message, dr$2)); - return fn$1({ type: t2, sealed: n4, iv: i3, senderPublicKey: r2, encoding: e18.encoding }); + const r2 = typeof e18.senderPublicKey < "u" ? fromString(e18.senderPublicKey, Lt$2) : void 0, i2 = typeof e18.iv < "u" ? fromString(e18.iv, Lt$2) : random.randomBytes(Ir$1), n5 = new chacha20poly1305.ChaCha20Poly1305(fromString(e18.symKey, Lt$2)).seal(i2, fromString(e18.message, dr$2)); + return fn$1({ type: t2, sealed: n5, iv: i2, senderPublicKey: r2, encoding: e18.encoding }); } function Tu(e18, t2) { - const r2 = nn$1(Sr$1), i3 = random.randomBytes(Ir$1), n4 = fromString(e18, dr$2); - return fn$1({ type: r2, sealed: n4, iv: i3, encoding: t2 }); + const r2 = nn$1(Sr$1), i2 = random.randomBytes(Ir$1), n5 = fromString(e18, dr$2); + return fn$1({ type: r2, sealed: n5, iv: i2, encoding: t2 }); } function Du(e18) { - const t2 = new chacha20poly1305.ChaCha20Poly1305(fromString(e18.symKey, Lt$2)), { sealed: r2, iv: i3 } = Wr$1({ encoded: e18.encoded, encoding: e18 == null ? void 0 : e18.encoding }), n4 = t2.open(i3, r2); - if (n4 === null) + const t2 = new chacha20poly1305.ChaCha20Poly1305(fromString(e18.symKey, Lt$2)), { sealed: r2, iv: i2 } = Wr$1({ encoded: e18.encoded, encoding: e18 == null ? void 0 : e18.encoding }), n5 = t2.open(i2, r2); + if (n5 === null) throw new Error("Failed to decrypt"); - return toString$1(n4, dr$2); + return toString$3(n5, dr$2); } function Fu(e18, t2) { const { sealed: r2 } = Wr$1({ encoded: e18, encoding: t2 }); - return toString$1(r2, dr$2); + return toString$3(r2, dr$2); } function fn$1(e18) { const { encoding: t2 = tn$1 } = e18; if (Ze$1(e18.type) === Sr$1) - return toString$1(concat([e18.type, e18.sealed]), t2); + return toString$3(concat$1([e18.type, e18.sealed]), t2); if (Ze$1(e18.type) === pr$2) { if (typeof e18.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope"); - return toString$1(concat([e18.type, e18.senderPublicKey, e18.iv, e18.sealed]), t2); + return toString$3(concat$1([e18.type, e18.senderPublicKey, e18.iv, e18.sealed]), t2); } - return toString$1(concat([e18.type, e18.iv, e18.sealed]), t2); + return toString$3(concat$1([e18.type, e18.iv, e18.sealed]), t2); } function Wr$1(e18) { - const { encoded: t2, encoding: r2 = tn$1 } = e18, i3 = fromString(t2, r2), n4 = i3.slice(Nu, oo), o2 = oo; - if (Ze$1(n4) === pr$2) { - const v6 = o2 + rn$1, w2 = v6 + Ir$1, y3 = i3.slice(o2, v6), S4 = i3.slice(v6, w2), N2 = i3.slice(w2); - return { type: n4, sealed: N2, iv: S4, senderPublicKey: y3 }; + const { encoded: t2, encoding: r2 = tn$1 } = e18, i2 = fromString(t2, r2), n5 = i2.slice(Nu, oo), o2 = oo; + if (Ze$1(n5) === pr$2) { + const v6 = o2 + rn$1, w2 = v6 + Ir$1, y3 = i2.slice(o2, v6), S4 = i2.slice(v6, w2), N2 = i2.slice(w2); + return { type: n5, sealed: N2, iv: S4, senderPublicKey: y3 }; } - if (Ze$1(n4) === Sr$1) { - const v6 = i3.slice(o2), w2 = random.randomBytes(Ir$1); - return { type: n4, sealed: v6, iv: w2 }; + if (Ze$1(n5) === Sr$1) { + const v6 = i2.slice(o2), w2 = random.randomBytes(Ir$1); + return { type: n5, sealed: v6, iv: w2 }; } - const h4 = o2 + Ir$1, p3 = i3.slice(o2, h4), A2 = i3.slice(h4); - return { type: n4, sealed: A2, iv: p3 }; + const h4 = o2 + Ir$1, p3 = i2.slice(o2, h4), A2 = i2.slice(h4); + return { type: n5, sealed: A2, iv: p3 }; } function Uu(e18, t2) { const r2 = Wr$1({ encoded: e18, encoding: t2 == null ? void 0 : t2.encoding }); - return so({ type: Ze$1(r2.type), senderPublicKey: typeof r2.senderPublicKey < "u" ? toString$1(r2.senderPublicKey, Lt$2) : void 0, receiverPublicKey: t2 == null ? void 0 : t2.receiverPublicKey }); + return so({ type: Ze$1(r2.type), senderPublicKey: typeof r2.senderPublicKey < "u" ? toString$3(r2.senderPublicKey, Lt$2) : void 0, receiverPublicKey: t2 == null ? void 0 : t2.receiverPublicKey }); } function so(e18) { const t2 = (e18 == null ? void 0 : e18.type) || en$1; @@ -108708,10 +38014,10 @@ function Hu(e18) { return Buffer.from(Ku(e18), "base64"); } function Lu(e18, t2) { - const [r2, i3, n4] = e18.split("."), o2 = Hu(n4); + const [r2, i2, n5] = e18.split("."), o2 = Hu(n5); if (o2.length !== 64) throw new Error("Invalid signature length"); - const h4 = o2.slice(0, 32).toString("hex"), p3 = o2.slice(32, 64).toString("hex"), A2 = `${r2}.${i3}`, v6 = new sha256.SHA256().update(Buffer.from(A2)).digest(), w2 = ao(t2), y3 = Buffer.from(v6).toString("hex"); + const h4 = o2.slice(0, 32).toString("hex"), p3 = o2.slice(32, 64).toString("hex"), A2 = `${r2}.${i2}`, v6 = new sha256$3.SHA256().update(Buffer.from(A2)).digest(), w2 = ao(t2), y3 = Buffer.from(v6).toString("hex"); if (!w2.verify(y3, { r: h4, s: p3 })) throw new Error("Invalid signature"); return decodeJWT(e18).payload; @@ -108735,10 +38041,10 @@ var Qu = Object.defineProperty, Ju = Object.defineProperties, Gu = Object.getOwn return e18; }, Wu = (e18, t2) => Ju(e18, Gu(t2)); function po(e18, t2 = "-") { - const r2 = {}, i3 = "relay" + t2; - return Object.keys(e18).forEach((n4) => { - if (n4.startsWith(i3)) { - const o2 = n4.replace(i3, ""), h4 = e18[n4]; + const r2 = {}, i2 = "relay" + t2; + return Object.keys(e18).forEach((n5) => { + if (n5.startsWith(i2)) { + const o2 = n5.replace(i2, ""), h4 = e18[n5]; r2[o2] = h4; } }), r2; @@ -108749,18 +38055,18 @@ function Xu(e18) { A2 != null && A2.includes("wc:") && (e18 = A2); } e18 = e18.includes("wc://") ? e18.replace("wc://", "") : e18, e18 = e18.includes("wc:") ? e18.replace("wc:", "") : e18; - const t2 = e18.indexOf(":"), r2 = e18.indexOf("?") !== -1 ? e18.indexOf("?") : void 0, i3 = e18.substring(0, t2), n4 = e18.substring(t2 + 1, r2).split("@"), o2 = typeof r2 < "u" ? e18.substring(r2) : "", h4 = queryString.parse(o2), p3 = typeof h4.methods == "string" ? h4.methods.split(",") : void 0; - return { protocol: i3, topic: vo(n4[0]), version: parseInt(n4[1], 10), symKey: h4.symKey, relay: po(h4), methods: p3, expiryTimestamp: h4.expiryTimestamp ? parseInt(h4.expiryTimestamp, 10) : void 0 }; + const t2 = e18.indexOf(":"), r2 = e18.indexOf("?") !== -1 ? e18.indexOf("?") : void 0, i2 = e18.substring(0, t2), n5 = e18.substring(t2 + 1, r2).split("@"), o2 = typeof r2 < "u" ? e18.substring(r2) : "", h4 = queryString.parse(o2), p3 = typeof h4.methods == "string" ? h4.methods.split(",") : void 0; + return { protocol: i2, topic: vo(n5[0]), version: parseInt(n5[1], 10), symKey: h4.symKey, relay: po(h4), methods: p3, expiryTimestamp: h4.expiryTimestamp ? parseInt(h4.expiryTimestamp, 10) : void 0 }; } function vo(e18) { return e18.startsWith("//") ? e18.substring(2) : e18; } function go(e18, t2 = "-") { - const r2 = "relay", i3 = {}; - return Object.keys(e18).forEach((n4) => { - const o2 = r2 + t2 + n4; - e18[n4] && (i3[o2] = e18[n4]); - }), i3; + const r2 = "relay", i2 = {}; + return Object.keys(e18).forEach((n5) => { + const o2 = r2 + t2 + n5; + e18[n5] && (i2[o2] = e18[n5]); + }), i2; } function $u(e18) { return `${e18.protocol}:${e18.topic}@${e18.version}?` + queryString.stringify(lo(Wu(lo({ symKey: e18.symKey }, go(e18.relay)), { expiryTimestamp: e18.expiryTimestamp }), e18.methods ? { methods: e18.methods.join(",") } : {})); @@ -108771,8 +38077,8 @@ function Zu(e18, t2, r2) { function tr$1(e18) { const t2 = []; return e18.forEach((r2) => { - const [i3, n4] = r2.split(":"); - t2.push(`${i3}:${n4}`); + const [i2, n5] = r2.split(":"); + t2.push(`${i2}:${n5}`); }), t2; } function bo(e18) { @@ -108783,44 +38089,44 @@ function bo(e18) { } function yo(e18, t2) { const r2 = []; - return Object.values(e18).forEach((i3) => { - tr$1(i3.accounts).includes(t2) && r2.push(...i3.methods); + return Object.values(e18).forEach((i2) => { + tr$1(i2.accounts).includes(t2) && r2.push(...i2.methods); }), r2; } function wo(e18, t2) { const r2 = []; - return Object.values(e18).forEach((i3) => { - tr$1(i3.accounts).includes(t2) && r2.push(...i3.events); + return Object.values(e18).forEach((i2) => { + tr$1(i2.accounts).includes(t2) && r2.push(...i2.events); }), r2; } -function on$1(e18) { +function on$2(e18) { return e18.includes(":"); } function xo(e18) { - return on$1(e18) ? e18.split(":")[0] : e18; + return on$2(e18) ? e18.split(":")[0] : e18; } function Mo(e18) { const t2 = {}; return e18 == null ? void 0 : e18.forEach((r2) => { - const [i3, n4] = r2.split(":"); - t2[i3] || (t2[i3] = { accounts: [], chains: [], events: [] }), t2[i3].accounts.push(r2), t2[i3].chains.push(`${i3}:${n4}`); + const [i2, n5] = r2.split(":"); + t2[i2] || (t2[i2] = { accounts: [], chains: [], events: [] }), t2[i2].accounts.push(r2), t2[i2].chains.push(`${i2}:${n5}`); }), t2; } function uh(e18, t2) { - t2 = t2.map((i3) => i3.replace("did:pkh:", "")); + t2 = t2.map((i2) => i2.replace("did:pkh:", "")); const r2 = Mo(t2); - for (const [i3, n4] of Object.entries(r2)) - n4.methods ? n4.methods = me$1(n4.methods, e18) : n4.methods = e18, n4.events = ["chainChanged", "accountsChanged"]; + for (const [i2, n5] of Object.entries(r2)) + n5.methods ? n5.methods = me$1(n5.methods, e18) : n5.methods = e18, n5.events = ["chainChanged", "accountsChanged"]; return r2; } const Eo = { INVALID_METHOD: { message: "Invalid method.", code: 1001 }, INVALID_EVENT: { message: "Invalid event.", code: 1002 }, INVALID_UPDATE_REQUEST: { message: "Invalid update request.", code: 1003 }, INVALID_EXTEND_REQUEST: { message: "Invalid extend request.", code: 1004 }, INVALID_SESSION_SETTLE_REQUEST: { message: "Invalid session settle request.", code: 1005 }, UNAUTHORIZED_METHOD: { message: "Unauthorized method.", code: 3001 }, UNAUTHORIZED_EVENT: { message: "Unauthorized event.", code: 3002 }, UNAUTHORIZED_UPDATE_REQUEST: { message: "Unauthorized update request.", code: 3003 }, UNAUTHORIZED_EXTEND_REQUEST: { message: "Unauthorized extend request.", code: 3004 }, USER_REJECTED: { message: "User rejected.", code: 5e3 }, USER_REJECTED_CHAINS: { message: "User rejected chains.", code: 5001 }, USER_REJECTED_METHODS: { message: "User rejected methods.", code: 5002 }, USER_REJECTED_EVENTS: { message: "User rejected events.", code: 5003 }, UNSUPPORTED_CHAINS: { message: "Unsupported chains.", code: 5100 }, UNSUPPORTED_METHODS: { message: "Unsupported methods.", code: 5101 }, UNSUPPORTED_EVENTS: { message: "Unsupported events.", code: 5102 }, UNSUPPORTED_ACCOUNTS: { message: "Unsupported accounts.", code: 5103 }, UNSUPPORTED_NAMESPACE_KEY: { message: "Unsupported namespace key.", code: 5104 }, USER_DISCONNECTED: { message: "User disconnected.", code: 6e3 }, SESSION_SETTLEMENT_FAILED: { message: "Session settlement failed.", code: 7e3 }, WC_METHOD_UNSUPPORTED: { message: "Unsupported wc_ method.", code: 10001 } }, So = { NOT_INITIALIZED: { message: "Not initialized.", code: 1 }, NO_MATCHING_KEY: { message: "No matching key.", code: 2 }, RESTORE_WILL_OVERRIDE: { message: "Restore will override.", code: 3 }, RESUBSCRIBED: { message: "Resubscribed.", code: 4 }, MISSING_OR_INVALID: { message: "Missing or invalid.", code: 5 }, EXPIRED: { message: "Expired.", code: 6 }, UNKNOWN_TYPE: { message: "Unknown type.", code: 7 }, MISMATCHED_TOPIC: { message: "Mismatched topic.", code: 8 }, NON_CONFORMING_NAMESPACES: { message: "Non conforming namespaces.", code: 9 } }; function xe$1(e18, t2) { - const { message: r2, code: i3 } = So[e18]; - return { message: t2 ? `${r2} ${t2}` : r2, code: i3 }; + const { message: r2, code: i2 } = So[e18]; + return { message: t2 ? `${r2} ${t2}` : r2, code: i2 }; } function er$1(e18, t2) { - const { message: r2, code: i3 } = Eo[e18]; - return { message: t2 ? `${r2} ${t2}` : r2, code: i3 }; + const { message: r2, code: i2 } = Eo[e18]; + return { message: t2 ? `${r2} ${t2}` : r2, code: i2 }; } function Nr$1(e18, t2) { return Array.isArray(e18) ? typeof t2 < "u" && e18.length ? e18.every(t2) : true : false; @@ -108838,9 +38144,9 @@ function $r$1(e18, t2) { return t2 && Pe(e18) ? true : typeof e18 == "number" && !isNaN(e18); } function hh(e18, t2) { - const { requiredNamespaces: r2 } = t2, i3 = Object.keys(e18.namespaces), n4 = Object.keys(r2); + const { requiredNamespaces: r2 } = t2, i2 = Object.keys(e18.namespaces), n5 = Object.keys(r2); let o2 = true; - return _e$2(n4, i3) ? (i3.forEach((h4) => { + return _e$2(n5, i2) ? (i2.forEach((h4) => { const { accounts: p3, methods: A2, events: v6 } = e18.namespaces[h4], w2 = tr$1(p3), y3 = r2[h4]; (!_e$2(Or$1(h4, y3), w2) || !_e$2(y3.methods, A2) || !_e$2(y3.events, v6)) && (o2 = false); }), o2) : false; @@ -108893,33 +38199,33 @@ function an$1(e18) { return Nr$1(e18) ? e18.length && (t2 = e18.every((r2) => Yt$1(r2, false))) : t2 = false, t2; } function No(e18, t2, r2) { - let i3 = null; - return Nr$1(t2) && t2.length ? t2.forEach((n4) => { - i3 || _r$1(n4) || (i3 = er$1("UNSUPPORTED_CHAINS", `${r2}, chain ${n4} should be a string and conform to "namespace:chainId" format`)); - }) : _r$1(e18) || (i3 = er$1("UNSUPPORTED_CHAINS", `${r2}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)), i3; + let i2 = null; + return Nr$1(t2) && t2.length ? t2.forEach((n5) => { + i2 || _r$1(n5) || (i2 = er$1("UNSUPPORTED_CHAINS", `${r2}, chain ${n5} should be a string and conform to "namespace:chainId" format`)); + }) : _r$1(e18) || (i2 = er$1("UNSUPPORTED_CHAINS", `${r2}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)), i2; } function _o(e18, t2, r2) { - let i3 = null; - return Object.entries(e18).forEach(([n4, o2]) => { - if (i3) + let i2 = null; + return Object.entries(e18).forEach(([n5, o2]) => { + if (i2) return; - const h4 = No(n4, Or$1(n4, o2), `${t2} ${r2}`); - h4 && (i3 = h4); - }), i3; + const h4 = No(n5, Or$1(n5, o2), `${t2} ${r2}`); + h4 && (i2 = h4); + }), i2; } function Bo(e18, t2) { let r2 = null; - return Nr$1(e18) ? e18.forEach((i3) => { - r2 || Io(i3) || (r2 = er$1("UNSUPPORTED_ACCOUNTS", `${t2}, account ${i3} should be a string and conform to "namespace:chainId:address" format`)); + return Nr$1(e18) ? e18.forEach((i2) => { + r2 || Io(i2) || (r2 = er$1("UNSUPPORTED_ACCOUNTS", `${t2}, account ${i2} should be a string and conform to "namespace:chainId:address" format`)); }) : r2 = er$1("UNSUPPORTED_ACCOUNTS", `${t2}, accounts should be an array of strings conforming to "namespace:chainId:address" format`), r2; } function Co(e18, t2) { let r2 = null; - return Object.values(e18).forEach((i3) => { + return Object.values(e18).forEach((i2) => { if (r2) return; - const n4 = Bo(i3 == null ? void 0 : i3.accounts, `${t2} namespace`); - n4 && (r2 = n4); + const n5 = Bo(i2 == null ? void 0 : i2.accounts, `${t2} namespace`); + n5 && (r2 = n5); }), r2; } function Ro(e18, t2) { @@ -108928,31 +38234,31 @@ function Ro(e18, t2) { } function un$1(e18, t2) { let r2 = null; - return Object.values(e18).forEach((i3) => { + return Object.values(e18).forEach((i2) => { if (r2) return; - const n4 = Ro(i3, `${t2}, namespace`); - n4 && (r2 = n4); + const n5 = Ro(i2, `${t2}, namespace`); + n5 && (r2 = n5); }), r2; } function vh(e18, t2, r2) { - let i3 = null; + let i2 = null; if (e18 && Xr$1(e18)) { - const n4 = un$1(e18, t2); - n4 && (i3 = n4); + const n5 = un$1(e18, t2); + n5 && (i2 = n5); const o2 = _o(e18, t2, r2); - o2 && (i3 = o2); + o2 && (i2 = o2); } else - i3 = xe$1("MISSING_OR_INVALID", `${t2}, ${r2} should be an object with data`); - return i3; + i2 = xe$1("MISSING_OR_INVALID", `${t2}, ${r2} should be an object with data`); + return i2; } function Oo(e18, t2) { let r2 = null; if (e18 && Xr$1(e18)) { - const i3 = un$1(e18, t2); - i3 && (r2 = i3); - const n4 = Co(e18, t2); - n4 && (r2 = n4); + const i2 = un$1(e18, t2); + i2 && (r2 = i2); + const n5 = Co(e18, t2); + n5 && (r2 = n5); } else r2 = xe$1("MISSING_OR_INVALID", `${t2}, namespaces should be an object with data`); return r2; @@ -108962,8 +38268,8 @@ function Po(e18) { } function gh(e18, t2) { let r2 = false; - return t2 && !e18 ? r2 = true : e18 && Nr$1(e18) && e18.length && e18.forEach((i3) => { - r2 = Po(i3); + return t2 && !e18 ? r2 = true : e18 && Nr$1(e18) && e18.length && e18.forEach((i2) => { + r2 = Po(i2); }), r2; } function mh(e18) { @@ -108994,29 +38300,29 @@ function Sh(e18, t2, r2) { return Yt$1(r2, false) ? wo(e18, t2).includes(r2) : false; } function To(e18, t2, r2) { - let i3 = null; - const n4 = Ih(e18), o2 = Nh(t2), h4 = Object.keys(n4), p3 = Object.keys(o2), A2 = Do(Object.keys(e18)), v6 = Do(Object.keys(t2)), w2 = A2.filter((y3) => !v6.includes(y3)); - return w2.length && (i3 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces keys don't satisfy requiredNamespaces. + let i2 = null; + const n5 = Ih(e18), o2 = Nh(t2), h4 = Object.keys(n5), p3 = Object.keys(o2), A2 = Do(Object.keys(e18)), v6 = Do(Object.keys(t2)), w2 = A2.filter((y3) => !v6.includes(y3)); + return w2.length && (i2 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces keys don't satisfy requiredNamespaces. Required: ${w2.toString()} - Received: ${Object.keys(t2).toString()}`)), _e$2(h4, p3) || (i3 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces chains don't satisfy required namespaces. + Received: ${Object.keys(t2).toString()}`)), _e$2(h4, p3) || (i2 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces chains don't satisfy required namespaces. Required: ${h4.toString()} Approved: ${p3.toString()}`)), Object.keys(t2).forEach((y3) => { - if (!y3.includes(":") || i3) + if (!y3.includes(":") || i2) return; const S4 = tr$1(t2[y3].accounts); - S4.includes(y3) || (i3 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces accounts don't satisfy namespace accounts for ${y3} + S4.includes(y3) || (i2 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces accounts don't satisfy namespace accounts for ${y3} Required: ${y3} Approved: ${S4.toString()}`)); }), h4.forEach((y3) => { - i3 || (_e$2(n4[y3].methods, o2[y3].methods) ? _e$2(n4[y3].events, o2[y3].events) || (i3 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces events don't satisfy namespace events for ${y3}`)) : i3 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces methods don't satisfy namespace methods for ${y3}`)); - }), i3; + i2 || (_e$2(n5[y3].methods, o2[y3].methods) ? _e$2(n5[y3].events, o2[y3].events) || (i2 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces events don't satisfy namespace events for ${y3}`)) : i2 = xe$1("NON_CONFORMING_NAMESPACES", `${r2} namespaces methods don't satisfy namespace methods for ${y3}`)); + }), i2; } function Ih(e18) { const t2 = {}; return Object.keys(e18).forEach((r2) => { - var i3; - r2.includes(":") ? t2[r2] = e18[r2] : (i3 = e18[r2].chains) == null || i3.forEach((n4) => { - t2[n4] = { methods: e18[r2].methods, events: e18[r2].events }; + var i2; + r2.includes(":") ? t2[r2] = e18[r2] : (i2 = e18[r2].chains) == null || i2.forEach((n5) => { + t2[n5] = { methods: e18[r2].methods, events: e18[r2].events }; }); }), t2; } @@ -109029,9 +38335,9 @@ function Nh(e18) { if (r2.includes(":")) t2[r2] = e18[r2]; else { - const i3 = tr$1(e18[r2].accounts); - i3 == null ? void 0 : i3.forEach((n4) => { - t2[n4] = { accounts: e18[r2].accounts.filter((o2) => o2.includes(`${n4}:`)), methods: e18[r2].methods, events: e18[r2].events }; + const i2 = tr$1(e18[r2].accounts); + i2 == null ? void 0 : i2.forEach((n5) => { + t2[n5] = { accounts: e18[r2].accounts.filter((o2) => o2.includes(`${n5}:`)), methods: e18[r2].methods, events: e18[r2].events }; }); } }), t2; @@ -109134,28 +38440,28 @@ function parseConnectionError(e18, url, type2) { return e18.message.includes("getaddrinfo ENOTFOUND") || e18.message.includes("connect ECONNREFUSED") ? new Error(`Unavailable ${type2} RPC url at ${url}`) : e18; } var cjs = {}; -var crypto$1 = {}; +var crypto$5 = {}; var hasRequiredCrypto; function requireCrypto() { if (hasRequiredCrypto) - return crypto$1; + return crypto$5; hasRequiredCrypto = 1; - Object.defineProperty(crypto$1, "__esModule", { value: true }); - crypto$1.isBrowserCryptoAvailable = crypto$1.getSubtleCrypto = crypto$1.getBrowerCrypto = void 0; + Object.defineProperty(crypto$5, "__esModule", { value: true }); + crypto$5.isBrowserCryptoAvailable = crypto$5.getSubtleCrypto = crypto$5.getBrowerCrypto = void 0; function getBrowerCrypto() { return (commonjsGlobal === null || commonjsGlobal === void 0 ? void 0 : commonjsGlobal.crypto) || (commonjsGlobal === null || commonjsGlobal === void 0 ? void 0 : commonjsGlobal.msCrypto) || {}; } - crypto$1.getBrowerCrypto = getBrowerCrypto; + crypto$5.getBrowerCrypto = getBrowerCrypto; function getSubtleCrypto() { const browserCrypto = getBrowerCrypto(); return browserCrypto.subtle || browserCrypto.webkitSubtle; } - crypto$1.getSubtleCrypto = getSubtleCrypto; + crypto$5.getSubtleCrypto = getSubtleCrypto; function isBrowserCryptoAvailable() { return !!getBrowerCrypto() && !!getSubtleCrypto(); } - crypto$1.isBrowserCryptoAvailable = isBrowserCryptoAvailable; - return crypto$1; + crypto$5.isBrowserCryptoAvailable = isBrowserCryptoAvailable; + return crypto$5; } var env = {}; var hasRequiredEnv; @@ -109181,7 +38487,7 @@ function requireEnv() { } (function(exports) { Object.defineProperty(exports, "__esModule", { value: true }); - const tslib_1 = require$$0$1; + const tslib_1 = require$$0$2; tslib_1.__exportStar(requireCrypto(), exports); tslib_1.__exportStar(requireEnv(), exports); })(cjs); @@ -109232,12 +38538,12 @@ function formatErrorMessage(error, data) { } class e17 { } -class n3 extends e17 { +let n$1 = class n3 extends e17 { constructor() { super(); } -} -class r extends n3 { +}; +class r extends n$1 { constructor(c2) { super(); } @@ -109306,20 +38612,20 @@ class o extends r { return this.requestStrict(formatJsonRpcRequest(t2.method, t2.params || [], t2.id || getBigIntRpcId().toString()), e18); } async requestStrict(t2, e18) { - return new Promise(async (i3, s2) => { + return new Promise(async (i2, s2) => { if (!this.connection.connected) try { await this.open(); - } catch (n4) { - s2(n4); + } catch (n5) { + s2(n5); } - this.events.on(`${t2.id}`, (n4) => { - isJsonRpcError(n4) ? s2(n4.error) : i3(n4.result); + this.events.on(`${t2.id}`, (n5) => { + isJsonRpcError(n5) ? s2(n5.error) : i2(n5.result); }); try { await this.connection.send(t2, e18); - } catch (n4) { - s2(n4); + } catch (n5) { + s2(n5); } }); } @@ -109342,8 +38648,8 @@ class o extends r { this.hasRegisteredEventListeners || (this.connection.on("payload", (t2) => this.onPayload(t2)), this.connection.on("close", (t2) => this.onClose(t2)), this.connection.on("error", (t2) => this.events.emit("error", t2)), this.connection.on("register_error", (t2) => this.onClose()), this.hasRegisteredEventListeners = true); } } -const w$2 = () => typeof WebSocket < "u" ? WebSocket : typeof global < "u" && typeof global.WebSocket < "u" ? global.WebSocket : typeof window < "u" && typeof window.WebSocket < "u" ? window.WebSocket : typeof self < "u" && typeof self.WebSocket < "u" ? self.WebSocket : require("ws"), b = () => typeof WebSocket < "u" || typeof global < "u" && typeof global.WebSocket < "u" || typeof window < "u" && typeof window.WebSocket < "u" || typeof self < "u" && typeof self.WebSocket < "u", a2 = (c2) => c2.split("?")[0], h3 = 10, S3 = w$2(); -let f$1 = class f { +const w$2 = () => typeof WebSocket < "u" ? WebSocket : typeof global < "u" && typeof global.WebSocket < "u" ? global.WebSocket : typeof window < "u" && typeof window.WebSocket < "u" ? window.WebSocket : typeof self < "u" && typeof self.WebSocket < "u" ? self.WebSocket : require("ws"), b$1 = () => typeof WebSocket < "u" || typeof global < "u" && typeof global.WebSocket < "u" || typeof window < "u" && typeof window.WebSocket < "u" || typeof self < "u" && typeof self.WebSocket < "u", a2 = (c2) => c2.split("?")[0], h3 = 10, S$1 = w$2(); +let f$3 = class f { constructor(e18) { if (this.url = e18, this.events = new eventsExports.EventEmitter(), this.registering = false, !isWsUrl(e18)) throw new Error(`Provided URL is not compatible with WebSocket connection: ${e18}`); @@ -109376,8 +38682,8 @@ let f$1 = class f { t2(new Error("Connection already closed")); return; } - this.socket.onclose = (n4) => { - this.onClose(n4), e18(); + this.socket.onclose = (n5) => { + this.onClose(n5), e18(); }, this.socket.close(); }); } @@ -109394,25 +38700,25 @@ let f$1 = class f { throw new Error(`Provided URL is not compatible with WebSocket connection: ${e18}`); if (this.registering) { const t2 = this.events.getMaxListeners(); - return (this.events.listenerCount("register_error") >= t2 || this.events.listenerCount("open") >= t2) && this.events.setMaxListeners(t2 + 1), new Promise((n4, o2) => { + return (this.events.listenerCount("register_error") >= t2 || this.events.listenerCount("open") >= t2) && this.events.setMaxListeners(t2 + 1), new Promise((n5, o2) => { this.events.once("register_error", (s2) => { this.resetMaxListeners(), o2(s2); }), this.events.once("open", () => { if (this.resetMaxListeners(), typeof this.socket > "u") return o2(new Error("WebSocket connection is missing or invalid")); - n4(this.socket); + n5(this.socket); }); }); } - return this.url = e18, this.registering = true, new Promise((t2, n4) => { - const o2 = new URLSearchParams(e18).get("origin"), s2 = cjs.isReactNative() ? { headers: { origin: o2 } } : { rejectUnauthorized: !isLocalhostUrl(e18) }, i3 = new S3(e18, [], s2); - b() ? i3.onerror = (r2) => { + return this.url = e18, this.registering = true, new Promise((t2, n5) => { + const o2 = new URLSearchParams(e18).get("origin"), s2 = cjs.isReactNative() ? { headers: { origin: o2 } } : { rejectUnauthorized: !isLocalhostUrl(e18) }, i2 = new S$1(e18, [], s2); + b$1() ? i2.onerror = (r2) => { const l2 = r2; - n4(this.emitError(l2.error)); - } : i3.on("error", (r2) => { - n4(this.emitError(r2)); - }), i3.onopen = () => { - this.onOpen(i3), t2(i3); + n5(this.emitError(l2.error)); + } : i2.on("error", (r2) => { + n5(this.emitError(r2)); + }), i2.onopen = () => { + this.onOpen(i2), t2(i2); }; }); } @@ -109429,7 +38735,7 @@ let f$1 = class f { this.events.emit("payload", t2); } onError(e18, t2) { - const n4 = this.parseError(t2), o2 = n4.message || n4.toString(), s2 = formatJsonRpcError(e18, o2); + const n5 = this.parseError(t2), o2 = n5.message || n5.toString(), s2 = formatJsonRpcError(e18, o2); this.events.emit("payload", s2); } parseError(e18, t2 = this.url) { @@ -109498,9 +38804,9 @@ lodash_isequal.exports; } return false; } - function baseTimes(n4, iteratee) { - var index2 = -1, result = Array(n4); - while (++index2 < n4) { + function baseTimes(n5, iteratee) { + var index2 = -1, result = Array(n5); + while (++index2 < n5) { result[index2] = iteratee(index2); } return result; @@ -110095,17 +39401,17 @@ lodash_isequal.exports; })(lodash_isequal, lodash_isequal.exports); var lodash_isequalExports = lodash_isequal.exports; const bs = /* @__PURE__ */ getDefaultExportFromCjs$1(lodash_isequalExports); -const be$1 = "wc", fe = 2, ne = "core", O$1 = `${be$1}@2:${ne}:`, Xe = { name: ne, logger: "error" }, Ze = { database: ":memory:" }, Qe = "crypto", _e$1 = "client_ed25519_seed", et = cjs$3.ONE_DAY, tt = "keychain", it$1 = "0.3", st$1 = "messages", rt$1 = "0.3", nt$1 = cjs$3.SIX_HOURS, ot$1 = "publisher", at$1 = "irn", ct$1 = "error", Ee = "wss://relay.walletconnect.org", ht$1 = "relayer", w$1 = { message: "relayer_message", message_ack: "relayer_message_ack", connect: "relayer_connect", disconnect: "relayer_disconnect", error: "relayer_error", connection_stalled: "relayer_connection_stalled", transport_closed: "relayer_transport_closed", publish: "relayer_publish" }, lt$1 = "_subscription", T$1 = { payload: "payload", connect: "connect", disconnect: "disconnect", error: "error" }, ut$1 = 0.1, oe$1 = "2.17.0", F$1 = { link_mode: "link_mode", relay: "relay" }, dt$1 = "0.3", gt$1 = "WALLETCONNECT_CLIENT_ID", ve = "WALLETCONNECT_LINK_MODE_APPS", A = { created: "subscription_created", deleted: "subscription_deleted", expired: "subscription_expired", disabled: "subscription_disabled", sync: "subscription_sync", resubscribed: "subscription_resubscribed" }, pt$1 = "subscription", yt$1 = "0.3", Dt = cjs$3.FIVE_SECONDS * 1e3, mt = "pairing", bt = "0.3", j$1 = { wc_pairingDelete: { req: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1e3 }, res: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1001 } }, wc_pairingPing: { req: { ttl: cjs$3.THIRTY_SECONDS, prompt: false, tag: 1002 }, res: { ttl: cjs$3.THIRTY_SECONDS, prompt: false, tag: 1003 } }, unregistered_method: { req: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 0 }, res: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 0 } } }, q = { create: "pairing_create", expire: "pairing_expire", delete: "pairing_delete", ping: "pairing_ping" }, P$1 = { created: "history_created", updated: "history_updated", deleted: "history_deleted", sync: "history_sync" }, ft = "history", _t = "0.3", Et = "expirer", R2 = { created: "expirer_created", deleted: "expirer_deleted", expired: "expirer_expired", sync: "expirer_sync" }, vt = "0.3", wt = "verify-api", Is$1 = "https://verify.walletconnect.com", It = "https://verify.walletconnect.org", Z = It, Tt$1 = `${Z}/v3`, Ct = [Is$1, It], St = "echo", Pt = "https://echo.walletconnect.com", z$1 = { pairing_started: "pairing_started", pairing_uri_validation_success: "pairing_uri_validation_success", pairing_uri_not_expired: "pairing_uri_not_expired", store_new_pairing: "store_new_pairing", subscribing_pairing_topic: "subscribing_pairing_topic", subscribe_pairing_topic_success: "subscribe_pairing_topic_success", existing_pairing: "existing_pairing", pairing_not_expired: "pairing_not_expired", emit_inactive_pairing: "emit_inactive_pairing", emit_session_proposal: "emit_session_proposal", subscribing_to_pairing_topic: "subscribing_to_pairing_topic" }, M2 = { no_wss_connection: "no_wss_connection", no_internet_connection: "no_internet_connection", malformed_pairing_uri: "malformed_pairing_uri", active_pairing_already_exists: "active_pairing_already_exists", subscribe_pairing_topic_failure: "subscribe_pairing_topic_failure", pairing_expired: "pairing_expired", proposal_expired: "proposal_expired", proposal_listener_not_found: "proposal_listener_not_found" }, Cs = { session_approve_started: "session_approve_started", proposal_not_expired: "proposal_not_expired", session_namespaces_validation_success: "session_namespaces_validation_success", create_session_topic: "create_session_topic", subscribing_session_topic: "subscribing_session_topic", subscribe_session_topic_success: "subscribe_session_topic_success", publishing_session_approve: "publishing_session_approve", session_approve_publish_success: "session_approve_publish_success", store_session: "store_session", publishing_session_settle: "publishing_session_settle", session_settle_publish_success: "session_settle_publish_success" }, Ss$1 = { no_internet_connection: "no_internet_connection", no_wss_connection: "no_wss_connection", proposal_expired: "proposal_expired", subscribe_session_topic_failure: "subscribe_session_topic_failure", session_approve_publish_failure: "session_approve_publish_failure", session_settle_publish_failure: "session_settle_publish_failure", session_approve_namespace_validation_failure: "session_approve_namespace_validation_failure", proposal_not_found: "proposal_not_found" }, Ps = { authenticated_session_approve_started: "authenticated_session_approve_started", authenticated_session_not_expired: "authenticated_session_not_expired", chains_caip2_compliant: "chains_caip2_compliant", chains_evm_compliant: "chains_evm_compliant", create_authenticated_session_topic: "create_authenticated_session_topic", cacaos_verified: "cacaos_verified", store_authenticated_session: "store_authenticated_session", subscribing_authenticated_session_topic: "subscribing_authenticated_session_topic", subscribe_authenticated_session_topic_success: "subscribe_authenticated_session_topic_success", publishing_authenticated_session_approve: "publishing_authenticated_session_approve", authenticated_session_approve_publish_success: "authenticated_session_approve_publish_success" }, Rs$1 = { no_internet_connection: "no_internet_connection", no_wss_connection: "no_wss_connection", missing_session_authenticate_request: "missing_session_authenticate_request", session_authenticate_request_expired: "session_authenticate_request_expired", chains_caip2_compliant_failure: "chains_caip2_compliant_failure", chains_evm_compliant_failure: "chains_evm_compliant_failure", invalid_cacao: "invalid_cacao", subscribe_authenticated_session_topic_failure: "subscribe_authenticated_session_topic_failure", authenticated_session_approve_publish_failure: "authenticated_session_approve_publish_failure", authenticated_session_pending_request_not_found: "authenticated_session_pending_request_not_found" }, Rt = 0.1, xt = "event-client", Ot = 86400, At = "https://pulse.walletconnect.org/batch"; +const be$1 = "wc", fe = 2, ne = "core", O$1 = `${be$1}@2:${ne}:`, Xe = { name: ne, logger: "error" }, Ze = { database: ":memory:" }, Qe = "crypto", _e$1 = "client_ed25519_seed", et$1 = cjs$3.ONE_DAY, tt = "keychain", it$1 = "0.3", st$1 = "messages", rt$1 = "0.3", nt$1 = cjs$3.SIX_HOURS, ot$1 = "publisher", at$1 = "irn", ct$1 = "error", Ee = "wss://relay.walletconnect.org", ht$1 = "relayer", w$1 = { message: "relayer_message", message_ack: "relayer_message_ack", connect: "relayer_connect", disconnect: "relayer_disconnect", error: "relayer_error", connection_stalled: "relayer_connection_stalled", transport_closed: "relayer_transport_closed", publish: "relayer_publish" }, lt$1 = "_subscription", T$1 = { payload: "payload", connect: "connect", disconnect: "disconnect", error: "error" }, ut$3 = 0.1, oe$1 = "2.17.0", F$1 = { link_mode: "link_mode", relay: "relay" }, dt$1 = "0.3", gt$1 = "WALLETCONNECT_CLIENT_ID", ve = "WALLETCONNECT_LINK_MODE_APPS", A = { created: "subscription_created", deleted: "subscription_deleted", expired: "subscription_expired", disabled: "subscription_disabled", sync: "subscription_sync", resubscribed: "subscription_resubscribed" }, pt$1 = "subscription", yt$1 = "0.3", Dt = cjs$3.FIVE_SECONDS * 1e3, mt = "pairing", bt = "0.3", j$1 = { wc_pairingDelete: { req: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1e3 }, res: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1001 } }, wc_pairingPing: { req: { ttl: cjs$3.THIRTY_SECONDS, prompt: false, tag: 1002 }, res: { ttl: cjs$3.THIRTY_SECONDS, prompt: false, tag: 1003 } }, unregistered_method: { req: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 0 }, res: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 0 } } }, q = { create: "pairing_create", expire: "pairing_expire", delete: "pairing_delete", ping: "pairing_ping" }, P$1 = { created: "history_created", updated: "history_updated", deleted: "history_deleted", sync: "history_sync" }, ft = "history", _t = "0.3", Et = "expirer", R2 = { created: "expirer_created", deleted: "expirer_deleted", expired: "expirer_expired", sync: "expirer_sync" }, vt = "0.3", wt = "verify-api", Is$1 = "https://verify.walletconnect.com", It = "https://verify.walletconnect.org", Z = It, Tt$1 = `${Z}/v3`, Ct = [Is$1, It], St = "echo", Pt = "https://echo.walletconnect.com", z$1 = { pairing_started: "pairing_started", pairing_uri_validation_success: "pairing_uri_validation_success", pairing_uri_not_expired: "pairing_uri_not_expired", store_new_pairing: "store_new_pairing", subscribing_pairing_topic: "subscribing_pairing_topic", subscribe_pairing_topic_success: "subscribe_pairing_topic_success", existing_pairing: "existing_pairing", pairing_not_expired: "pairing_not_expired", emit_inactive_pairing: "emit_inactive_pairing", emit_session_proposal: "emit_session_proposal", subscribing_to_pairing_topic: "subscribing_to_pairing_topic" }, M2 = { no_wss_connection: "no_wss_connection", no_internet_connection: "no_internet_connection", malformed_pairing_uri: "malformed_pairing_uri", active_pairing_already_exists: "active_pairing_already_exists", subscribe_pairing_topic_failure: "subscribe_pairing_topic_failure", pairing_expired: "pairing_expired", proposal_expired: "proposal_expired", proposal_listener_not_found: "proposal_listener_not_found" }, Cs = { session_approve_started: "session_approve_started", proposal_not_expired: "proposal_not_expired", session_namespaces_validation_success: "session_namespaces_validation_success", create_session_topic: "create_session_topic", subscribing_session_topic: "subscribing_session_topic", subscribe_session_topic_success: "subscribe_session_topic_success", publishing_session_approve: "publishing_session_approve", session_approve_publish_success: "session_approve_publish_success", store_session: "store_session", publishing_session_settle: "publishing_session_settle", session_settle_publish_success: "session_settle_publish_success" }, Ss$1 = { no_internet_connection: "no_internet_connection", no_wss_connection: "no_wss_connection", proposal_expired: "proposal_expired", subscribe_session_topic_failure: "subscribe_session_topic_failure", session_approve_publish_failure: "session_approve_publish_failure", session_settle_publish_failure: "session_settle_publish_failure", session_approve_namespace_validation_failure: "session_approve_namespace_validation_failure", proposal_not_found: "proposal_not_found" }, Ps = { authenticated_session_approve_started: "authenticated_session_approve_started", authenticated_session_not_expired: "authenticated_session_not_expired", chains_caip2_compliant: "chains_caip2_compliant", chains_evm_compliant: "chains_evm_compliant", create_authenticated_session_topic: "create_authenticated_session_topic", cacaos_verified: "cacaos_verified", store_authenticated_session: "store_authenticated_session", subscribing_authenticated_session_topic: "subscribing_authenticated_session_topic", subscribe_authenticated_session_topic_success: "subscribe_authenticated_session_topic_success", publishing_authenticated_session_approve: "publishing_authenticated_session_approve", authenticated_session_approve_publish_success: "authenticated_session_approve_publish_success" }, Rs$1 = { no_internet_connection: "no_internet_connection", no_wss_connection: "no_wss_connection", missing_session_authenticate_request: "missing_session_authenticate_request", session_authenticate_request_expired: "session_authenticate_request_expired", chains_caip2_compliant_failure: "chains_caip2_compliant_failure", chains_evm_compliant_failure: "chains_evm_compliant_failure", invalid_cacao: "invalid_cacao", subscribe_authenticated_session_topic_failure: "subscribe_authenticated_session_topic_failure", authenticated_session_approve_publish_failure: "authenticated_session_approve_publish_failure", authenticated_session_pending_request_not_found: "authenticated_session_pending_request_not_found" }, Rt = 0.1, xt = "event-client", Ot = 86400, At = "https://pulse.walletconnect.org/batch"; function xs(o2, e18) { if (o2.length >= 255) throw new TypeError("Alphabet too long"); for (var t2 = new Uint8Array(256), s2 = 0; s2 < t2.length; s2++) t2[s2] = 255; - for (var i3 = 0; i3 < o2.length; i3++) { - var r2 = o2.charAt(i3), n4 = r2.charCodeAt(0); - if (t2[n4] !== 255) + for (var i2 = 0; i2 < o2.length; i2++) { + var r2 = o2.charAt(i2), n5 = r2.charCodeAt(0); + if (t2[n5] !== 255) throw new TypeError(r2 + " is ambiguous"); - t2[n4] = i3; + t2[n5] = i2; } var a3 = o2.length, c2 = o2.charAt(0), h4 = Math.log(a3) / Math.log(256), d4 = Math.log(256) / Math.log(a3); function g3(l2) { @@ -110113,9 +39419,9 @@ function xs(o2, e18) { throw new TypeError("Expected Uint8Array"); if (l2.length === 0) return ""; - for (var p3 = 0, E2 = 0, D2 = 0, f3 = l2.length; D2 !== f3 && l2[D2] === 0; ) + for (var p3 = 0, E2 = 0, D2 = 0, f4 = l2.length; D2 !== f4 && l2[D2] === 0; ) D2++, p3++; - for (var N2 = (f3 - D2) * d4 + 1 >>> 0, C3 = new Uint8Array(N2); D2 !== f3; ) { + for (var N2 = (f4 - D2) * d4 + 1 >>> 0, C3 = new Uint8Array(N2); D2 !== f4; ) { for (var L4 = l2[D2], $ = 0, x3 = N2 - 1; (L4 !== 0 || $ < E2) && x3 !== -1; x3--, $++) L4 += 256 * C3[x3] >>> 0, C3[x3] = L4 % a3 >>> 0, L4 = L4 / a3 >>> 0; if (L4 !== 0) @@ -110137,20 +39443,20 @@ function xs(o2, e18) { if (l2[p3] !== " ") { for (var E2 = 0, D2 = 0; l2[p3] === c2; ) E2++, p3++; - for (var f3 = (l2.length - p3) * h4 + 1 >>> 0, N2 = new Uint8Array(f3); l2[p3]; ) { + for (var f4 = (l2.length - p3) * h4 + 1 >>> 0, N2 = new Uint8Array(f4); l2[p3]; ) { var C3 = t2[l2.charCodeAt(p3)]; if (C3 === 255) return; - for (var L4 = 0, $ = f3 - 1; (C3 !== 0 || L4 < D2) && $ !== -1; $--, L4++) + for (var L4 = 0, $ = f4 - 1; (C3 !== 0 || L4 < D2) && $ !== -1; $--, L4++) C3 += a3 * N2[$] >>> 0, N2[$] = C3 % 256 >>> 0, C3 = C3 / 256 >>> 0; if (C3 !== 0) throw new Error("Non-zero carry"); D2 = L4, p3++; } if (l2[p3] !== " ") { - for (var x3 = f3 - D2; x3 !== f3 && N2[x3] === 0; ) + for (var x3 = f4 - D2; x3 !== f4 && N2[x3] === 0; ) x3++; - for (var k2 = new Uint8Array(E2 + (f3 - x3)), ie2 = E2; x3 !== f3; ) + for (var k2 = new Uint8Array(E2 + (f4 - x3)), ie2 = E2; x3 !== f4; ) k2[ie2++] = N2[x3++]; return k2; } @@ -110218,8 +39524,8 @@ class Ms { } const Lt$1 = (o2, e18) => new Ms({ ...o2.decoders || { [o2.prefix]: o2 }, ...e18.decoders || { [e18.prefix]: e18 } }); class $s { - constructor(e18, t2, s2, i3) { - this.name = e18, this.prefix = t2, this.baseEncode = s2, this.baseDecode = i3, this.encoder = new zs(e18, t2, s2), this.decoder = new ks(e18, t2, i3); + constructor(e18, t2, s2, i2) { + this.name = e18, this.prefix = t2, this.baseEncode = s2, this.baseDecode = i2, this.encoder = new zs(e18, t2, s2), this.decoder = new ks(e18, t2, i2); } encode(e18) { return this.encoder.encode(e18); @@ -110229,40 +39535,40 @@ class $s { } } const ae$1 = ({ name: o2, prefix: e18, encode: t2, decode: s2 }) => new $s(o2, e18, t2, s2), Q = ({ prefix: o2, name: e18, alphabet: t2 }) => { - const { encode: s2, decode: i3 } = As(t2, e18); - return ae$1({ prefix: o2, name: e18, encode: s2, decode: (r2) => Nt(i3(r2)) }); + const { encode: s2, decode: i2 } = As(t2, e18); + return ae$1({ prefix: o2, name: e18, encode: s2, decode: (r2) => Nt(i2(r2)) }); }, Fs = (o2, e18, t2, s2) => { - const i3 = {}; + const i2 = {}; for (let d4 = 0; d4 < e18.length; ++d4) - i3[e18[d4]] = d4; + i2[e18[d4]] = d4; let r2 = o2.length; for (; o2[r2 - 1] === "="; ) --r2; - const n4 = new Uint8Array(r2 * t2 / 8 | 0); + const n5 = new Uint8Array(r2 * t2 / 8 | 0); let a3 = 0, c2 = 0, h4 = 0; for (let d4 = 0; d4 < r2; ++d4) { - const g3 = i3[o2[d4]]; + const g3 = i2[o2[d4]]; if (g3 === void 0) throw new SyntaxError(`Non-${s2} character`); - c2 = c2 << t2 | g3, a3 += t2, a3 >= 8 && (a3 -= 8, n4[h4++] = 255 & c2 >> a3); + c2 = c2 << t2 | g3, a3 += t2, a3 >= 8 && (a3 -= 8, n5[h4++] = 255 & c2 >> a3); } if (a3 >= t2 || 255 & c2 << 8 - a3) throw new SyntaxError("Unexpected end of data"); - return n4; + return n5; }, Us = (o2, e18, t2) => { - const s2 = e18[e18.length - 1] === "=", i3 = (1 << t2) - 1; - let r2 = "", n4 = 0, a3 = 0; + const s2 = e18[e18.length - 1] === "=", i2 = (1 << t2) - 1; + let r2 = "", n5 = 0, a3 = 0; for (let c2 = 0; c2 < o2.length; ++c2) - for (a3 = a3 << 8 | o2[c2], n4 += 8; n4 > t2; ) - n4 -= t2, r2 += e18[i3 & a3 >> n4]; - if (n4 && (r2 += e18[i3 & a3 << t2 - n4]), s2) + for (a3 = a3 << 8 | o2[c2], n5 += 8; n5 > t2; ) + n5 -= t2, r2 += e18[i2 & a3 >> n5]; + if (n5 && (r2 += e18[i2 & a3 << t2 - n5]), s2) for (; r2.length * t2 & 7; ) r2 += "="; return r2; -}, _2 = ({ name: o2, prefix: e18, bitsPerChar: t2, alphabet: s2 }) => ae$1({ prefix: e18, name: o2, encode(i3) { - return Us(i3, s2, t2); -}, decode(i3) { - return Fs(i3, s2, t2, o2); +}, _2 = ({ name: o2, prefix: e18, bitsPerChar: t2, alphabet: s2 }) => ae$1({ prefix: e18, name: o2, encode(i2) { + return Us(i2, s2, t2); +}, decode(i2) { + return Fs(i2, s2, t2, o2); } }), Ks = ae$1({ prefix: "\0", name: "identity", encode: (o2) => Ls(o2), decode: (o2) => Ns(o2) }); var Bs = Object.freeze({ __proto__: null, identity: Ks }); const Vs = _2({ prefix: "0", name: "base2", alphabet: "01", bitsPerChar: 1 }); @@ -110307,24 +39613,24 @@ function Mt(o2, e18, t2) { } var Rr = we$1, xr = 128, $t = 127; function we$1(o2, s2) { - var t2 = 0, s2 = s2 || 0, i3 = 0, r2 = s2, n4, a3 = o2.length; + var t2 = 0, s2 = s2 || 0, i2 = 0, r2 = s2, n5, a3 = o2.length; do { if (r2 >= a3) throw we$1.bytes = 0, new RangeError("Could not decode varint"); - n4 = o2[r2++], t2 += i3 < 28 ? (n4 & $t) << i3 : (n4 & $t) * Math.pow(2, i3), i3 += 7; - } while (n4 >= xr); + n5 = o2[r2++], t2 += i2 < 28 ? (n5 & $t) << i2 : (n5 & $t) * Math.pow(2, i2), i2 += 7; + } while (n5 >= xr); return we$1.bytes = r2 - s2, t2; } var Or = Math.pow(2, 7), Ar = Math.pow(2, 14), Nr = Math.pow(2, 21), Lr = Math.pow(2, 28), zr = Math.pow(2, 35), kr = Math.pow(2, 42), Mr = Math.pow(2, 49), $r = Math.pow(2, 56), Fr = Math.pow(2, 63), Ur = function(o2) { return o2 < Or ? 1 : o2 < Ar ? 2 : o2 < Nr ? 3 : o2 < Lr ? 4 : o2 < zr ? 5 : o2 < kr ? 6 : o2 < Mr ? 7 : o2 < $r ? 8 : o2 < Fr ? 9 : 10; -}, Kr = { encode: Tr, decode: Rr, encodingLength: Ur }, Ft = Kr; +}, Kr$1 = { encode: Tr, decode: Rr, encodingLength: Ur }, Ft = Kr$1; const Ut3 = (o2, e18, t2 = 0) => (Ft.encode(o2, e18, t2), e18), Kt = (o2) => Ft.encodingLength(o2), Ie = (o2, e18) => { - const t2 = e18.byteLength, s2 = Kt(o2), i3 = s2 + Kt(t2), r2 = new Uint8Array(i3 + t2); - return Ut3(o2, r2, 0), Ut3(t2, r2, s2), r2.set(e18, i3), new Br(o2, t2, e18, r2); + const t2 = e18.byteLength, s2 = Kt(o2), i2 = s2 + Kt(t2), r2 = new Uint8Array(i2 + t2); + return Ut3(o2, r2, 0), Ut3(t2, r2, s2), r2.set(e18, i2), new Br(o2, t2, e18, r2); }; class Br { - constructor(e18, t2, s2, i3) { - this.code = e18, this.size = t2, this.digest = s2, this.bytes = i3; + constructor(e18, t2, s2, i2) { + this.code = e18, this.size = t2, this.digest = s2, this.bytes = i2; } } const Bt = ({ name: o2, code: e18, encode: t2 }) => new Vr(o2, e18, t2); @@ -110378,16 +39684,16 @@ class Jt { const s2 = await this.getKeyChain(); typeof s2 < "u" && (this.keychain = s2), this.initialized = true; } - }, this.has = (s2) => (this.isInitialized(), this.keychain.has(s2)), this.set = async (s2, i3) => { - this.isInitialized(), this.keychain.set(s2, i3), await this.persist(); + }, this.has = (s2) => (this.isInitialized(), this.keychain.has(s2)), this.set = async (s2, i2) => { + this.isInitialized(), this.keychain.set(s2, i2), await this.persist(); }, this.get = (s2) => { this.isInitialized(); - const i3 = this.keychain.get(s2); - if (typeof i3 > "u") { + const i2 = this.keychain.get(s2); + if (typeof i2 > "u") { const { message: r2 } = xe$1("NO_MATCHING_KEY", `${this.name}: ${s2}`); throw new Error(r2); } - return i3; + return i2; }, this.del = async (s2) => { this.isInitialized(), this.keychain.delete(s2), await this.persist(); }, this.core = e18, this.logger = E$1(t2, this.name); @@ -110419,64 +39725,64 @@ class Wt { constructor(e18, t2, s2) { this.core = e18, this.logger = t2, this.name = Qe, this.randomSessionIdentifier = Bu(), this.initialized = false, this.init = async () => { this.initialized || (await this.keychain.init(), this.initialized = true); - }, this.hasKeys = (i3) => (this.isInitialized(), this.keychain.has(i3)), this.getClientId = async () => { + }, this.hasKeys = (i2) => (this.isInitialized(), this.keychain.has(i2)), this.getClientId = async () => { this.isInitialized(); - const i3 = await this.getClientSeed(), r2 = generateKeyPair(i3); + const i2 = await this.getClientSeed(), r2 = generateKeyPair(i2); return encodeIss(r2.publicKey); }, this.generateKeyPair = () => { this.isInitialized(); - const i3 = _u(); - return this.setPrivateKey(i3.publicKey, i3.privateKey); - }, this.signJWT = async (i3) => { + const i2 = _u(); + return this.setPrivateKey(i2.publicKey, i2.privateKey); + }, this.signJWT = async (i2) => { this.isInitialized(); - const r2 = await this.getClientSeed(), n4 = generateKeyPair(r2), a3 = this.randomSessionIdentifier, c2 = et; - return await signJWT(a3, i3, c2, n4); - }, this.generateSharedKey = (i3, r2, n4) => { + const r2 = await this.getClientSeed(), n5 = generateKeyPair(r2), a3 = this.randomSessionIdentifier, c2 = et$1; + return await signJWT(a3, i2, c2, n5); + }, this.generateSharedKey = (i2, r2, n5) => { this.isInitialized(); - const a3 = this.getPrivateKey(i3), c2 = Cu(a3, r2); - return this.setSymKey(c2, n4); - }, this.setSymKey = async (i3, r2) => { + const a3 = this.getPrivateKey(i2), c2 = Cu(a3, r2); + return this.setSymKey(c2, n5); + }, this.setSymKey = async (i2, r2) => { this.isInitialized(); - const n4 = r2 || Ru(i3); - return await this.keychain.set(n4, i3), n4; - }, this.deleteKeyPair = async (i3) => { - this.isInitialized(), await this.keychain.del(i3); - }, this.deleteSymKey = async (i3) => { - this.isInitialized(), await this.keychain.del(i3); - }, this.encode = async (i3, r2, n4) => { + const n5 = r2 || Ru(i2); + return await this.keychain.set(n5, i2), n5; + }, this.deleteKeyPair = async (i2) => { + this.isInitialized(), await this.keychain.del(i2); + }, this.deleteSymKey = async (i2) => { + this.isInitialized(), await this.keychain.del(i2); + }, this.encode = async (i2, r2, n5) => { this.isInitialized(); - const a3 = so(n4), c2 = safeJsonStringify(r2); + const a3 = so(n5), c2 = safeJsonStringify(r2); if (qu(a3)) - return Tu(c2, n4 == null ? void 0 : n4.encoding); + return Tu(c2, n5 == null ? void 0 : n5.encoding); if (ku(a3)) { const m3 = a3.senderPublicKey, b2 = a3.receiverPublicKey; - i3 = await this.generateSharedKey(m3, b2); + i2 = await this.generateSharedKey(m3, b2); } - const h4 = this.getSymKey(i3), { type: d4, senderPublicKey: g3 } = a3; - return Pu({ type: d4, symKey: h4, message: c2, senderPublicKey: g3, encoding: n4 == null ? void 0 : n4.encoding }); - }, this.decode = async (i3, r2, n4) => { + const h4 = this.getSymKey(i2), { type: d4, senderPublicKey: g3 } = a3; + return Pu({ type: d4, symKey: h4, message: c2, senderPublicKey: g3, encoding: n5 == null ? void 0 : n5.encoding }); + }, this.decode = async (i2, r2, n5) => { this.isInitialized(); - const a3 = Uu(r2, n4); + const a3 = Uu(r2, n5); if (qu(a3)) { - const c2 = Fu(r2, n4 == null ? void 0 : n4.encoding); + const c2 = Fu(r2, n5 == null ? void 0 : n5.encoding); return safeJsonParse(c2); } if (ku(a3)) { const c2 = a3.receiverPublicKey, h4 = a3.senderPublicKey; - i3 = await this.generateSharedKey(c2, h4); + i2 = await this.generateSharedKey(c2, h4); } try { - const c2 = this.getSymKey(i3), h4 = Du({ symKey: c2, encoded: r2, encoding: n4 == null ? void 0 : n4.encoding }); + const c2 = this.getSymKey(i2), h4 = Du({ symKey: c2, encoded: r2, encoding: n5 == null ? void 0 : n5.encoding }); return safeJsonParse(h4); } catch (c2) { - this.logger.error(`Failed to decode message from topic: '${i3}', clientId: '${await this.getClientId()}'`), this.logger.error(c2); - } - }, this.getPayloadType = (i3, r2 = tn$1) => { - const n4 = Wr$1({ encoded: i3, encoding: r2 }); - return Ze$1(n4.type); - }, this.getPayloadSenderPublicKey = (i3, r2 = tn$1) => { - const n4 = Wr$1({ encoded: i3, encoding: r2 }); - return n4.senderPublicKey ? toString$1(n4.senderPublicKey, Lt$2) : void 0; + this.logger.error(`Failed to decode message from topic: '${i2}', clientId: '${await this.getClientId()}'`), this.logger.error(c2); + } + }, this.getPayloadType = (i2, r2 = tn$1) => { + const n5 = Wr$1({ encoded: i2, encoding: r2 }); + return Ze$1(n5.type); + }, this.getPayloadSenderPublicKey = (i2, r2 = tn$1) => { + const n5 = Wr$1({ encoded: i2, encoding: r2 }); + return n5.senderPublicKey ? toString$3(n5.senderPublicKey, Lt$2) : void 0; }, this.core = e18, this.logger = E$1(t2, this.name), this.keychain = s2 || new Jt(this.core, this.logger); } get context() { @@ -110521,19 +39827,19 @@ class Xt extends a$1 { this.initialized = true; } } - }, this.set = async (s2, i3) => { + }, this.set = async (s2, i2) => { this.isInitialized(); - const r2 = Ou(i3); - let n4 = this.messages.get(s2); - return typeof n4 > "u" && (n4 = {}), typeof n4[r2] < "u" || (n4[r2] = i3, this.messages.set(s2, n4), await this.persist()), r2; + const r2 = Ou(i2); + let n5 = this.messages.get(s2); + return typeof n5 > "u" && (n5 = {}), typeof n5[r2] < "u" || (n5[r2] = i2, this.messages.set(s2, n5), await this.persist()), r2; }, this.get = (s2) => { this.isInitialized(); - let i3 = this.messages.get(s2); - return typeof i3 > "u" && (i3 = {}), i3; - }, this.has = (s2, i3) => { + let i2 = this.messages.get(s2); + return typeof i2 > "u" && (i2 = {}), i2; + }, this.has = (s2, i2) => { this.isInitialized(); - const r2 = this.get(s2), n4 = Ou(i3); - return typeof r2[n4] < "u"; + const r2 = this.get(s2), n5 = Ou(i2); + return typeof r2[n5] < "u"; }, this.del = async (s2) => { this.isInitialized(), this.messages.delete(s2), await this.persist(); }, this.logger = E$1(e18, this.name), this.core = t2; @@ -110563,39 +39869,39 @@ class Xt extends a$1 { } class en extends g$1 { constructor(e18, t2) { - super(e18, t2), this.relayer = e18, this.logger = t2, this.events = new eventsExports.EventEmitter(), this.name = ot$1, this.queue = /* @__PURE__ */ new Map(), this.publishTimeout = cjs$3.toMiliseconds(cjs$3.ONE_MINUTE), this.failedPublishTimeout = cjs$3.toMiliseconds(cjs$3.ONE_SECOND), this.needsTransportRestart = false, this.publish = async (s2, i3, r2) => { - var n4; - this.logger.debug("Publishing Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: s2, message: i3, opts: r2 } }); - const a3 = (r2 == null ? void 0 : r2.ttl) || nt$1, c2 = zu(r2), h4 = (r2 == null ? void 0 : r2.prompt) || false, d4 = (r2 == null ? void 0 : r2.tag) || 0, g3 = (r2 == null ? void 0 : r2.id) || getBigIntRpcId().toString(), m3 = { topic: s2, message: i3, opts: { ttl: a3, relay: c2, prompt: h4, tag: d4, id: g3, attestation: r2 == null ? void 0 : r2.attestation } }, b2 = `Failed to publish payload, please try again. id:${g3} tag:${d4}`, l2 = Date.now(); + super(e18, t2), this.relayer = e18, this.logger = t2, this.events = new eventsExports.EventEmitter(), this.name = ot$1, this.queue = /* @__PURE__ */ new Map(), this.publishTimeout = cjs$3.toMiliseconds(cjs$3.ONE_MINUTE), this.failedPublishTimeout = cjs$3.toMiliseconds(cjs$3.ONE_SECOND), this.needsTransportRestart = false, this.publish = async (s2, i2, r2) => { + var n5; + this.logger.debug("Publishing Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: s2, message: i2, opts: r2 } }); + const a3 = (r2 == null ? void 0 : r2.ttl) || nt$1, c2 = zu(r2), h4 = (r2 == null ? void 0 : r2.prompt) || false, d4 = (r2 == null ? void 0 : r2.tag) || 0, g3 = (r2 == null ? void 0 : r2.id) || getBigIntRpcId().toString(), m3 = { topic: s2, message: i2, opts: { ttl: a3, relay: c2, prompt: h4, tag: d4, id: g3, attestation: r2 == null ? void 0 : r2.attestation } }, b2 = `Failed to publish payload, please try again. id:${g3} tag:${d4}`, l2 = Date.now(); let p3, E2 = 1; try { for (; p3 === void 0; ) { if (Date.now() - l2 > this.publishTimeout) throw new Error(b2); - this.logger.trace({ id: g3, attempts: E2 }, `publisher.publish - attempt ${E2}`), p3 = await await ms$1(this.rpcPublish(s2, i3, a3, c2, h4, d4, g3, r2 == null ? void 0 : r2.attestation).catch((D2) => this.logger.warn(D2)), this.publishTimeout, b2), E2++, p3 || await new Promise((D2) => setTimeout(D2, this.failedPublishTimeout)); + this.logger.trace({ id: g3, attempts: E2 }, `publisher.publish - attempt ${E2}`), p3 = await await ms$1(this.rpcPublish(s2, i2, a3, c2, h4, d4, g3, r2 == null ? void 0 : r2.attestation).catch((D2) => this.logger.warn(D2)), this.publishTimeout, b2), E2++, p3 || await new Promise((D2) => setTimeout(D2, this.failedPublishTimeout)); } - this.relayer.events.emit(w$1.publish, m3), this.logger.debug("Successfully Published Payload"), this.logger.trace({ type: "method", method: "publish", params: { id: g3, topic: s2, message: i3, opts: r2 } }); + this.relayer.events.emit(w$1.publish, m3), this.logger.debug("Successfully Published Payload"), this.logger.trace({ type: "method", method: "publish", params: { id: g3, topic: s2, message: i2, opts: r2 } }); } catch (D2) { - if (this.logger.debug("Failed to Publish Payload"), this.logger.error(D2), (n4 = r2 == null ? void 0 : r2.internal) != null && n4.throwOnFailedPublish) + if (this.logger.debug("Failed to Publish Payload"), this.logger.error(D2), (n5 = r2 == null ? void 0 : r2.internal) != null && n5.throwOnFailedPublish) throw D2; this.queue.set(g3, m3); } - }, this.on = (s2, i3) => { - this.events.on(s2, i3); - }, this.once = (s2, i3) => { - this.events.once(s2, i3); - }, this.off = (s2, i3) => { - this.events.off(s2, i3); - }, this.removeListener = (s2, i3) => { - this.events.removeListener(s2, i3); + }, this.on = (s2, i2) => { + this.events.on(s2, i2); + }, this.once = (s2, i2) => { + this.events.once(s2, i2); + }, this.off = (s2, i2) => { + this.events.off(s2, i2); + }, this.removeListener = (s2, i2) => { + this.events.removeListener(s2, i2); }, this.relayer = e18, this.logger = E$1(t2, this.name), this.registerEventListeners(); } get context() { return y$2(this.logger); } - rpcPublish(e18, t2, s2, i3, r2, n4, a3, c2) { + rpcPublish(e18, t2, s2, i2, r2, n5, a3, c2) { var h4, d4, g3, m3; - const b2 = { method: ju(i3.protocol).publish, params: { topic: e18, message: t2, ttl: s2, prompt: r2, tag: n4, attestation: c2 }, id: a3 }; + const b2 = { method: ju(i2.protocol).publish, params: { topic: e18, message: t2, ttl: s2, prompt: r2, tag: n5, attestation: c2 }, id: a3 }; return Pe((h4 = b2.params) == null ? void 0 : h4.prompt) && ((d4 = b2.params) == null || delete d4.prompt), Pe((g3 = b2.params) == null ? void 0 : g3.tag) && ((m3 = b2.params) == null || delete m3.tag), this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "message", direction: "outgoing", request: b2 }), this.relayer.request(b2); } removeRequestFromQueue(e18) { @@ -110603,8 +39909,8 @@ class en extends g$1 { } checkQueue() { this.queue.forEach(async (e18) => { - const { topic: t2, message: s2, opts: i3 } = e18; - await this.publish(t2, s2, i3); + const { topic: t2, message: s2, opts: i2 } = e18; + await this.publish(t2, s2, i2); }); } registerEventListeners() { @@ -110634,12 +39940,12 @@ class tn { const s2 = this.get(e18); if (!this.exists(e18, t2)) return; - const i3 = s2.filter((r2) => r2 !== t2); - if (!i3.length) { + const i2 = s2.filter((r2) => r2 !== t2); + if (!i2.length) { this.map.delete(e18); return; } - this.map.set(e18, i3); + this.map.set(e18, i2); }, this.clear = () => { this.map.clear(); }; @@ -110648,9 +39954,9 @@ class tn { return Array.from(this.map.keys()); } } -var sn = Object.defineProperty, rn = Object.defineProperties, nn = Object.getOwnPropertyDescriptors, Zt = Object.getOwnPropertySymbols, on = Object.prototype.hasOwnProperty, an = Object.prototype.propertyIsEnumerable, Qt = (o2, e18, t2) => e18 in o2 ? sn(o2, e18, { enumerable: true, configurable: true, writable: true, value: t2 }) : o2[e18] = t2, ee = (o2, e18) => { +var sn = Object.defineProperty, rn = Object.defineProperties, nn = Object.getOwnPropertyDescriptors, Zt = Object.getOwnPropertySymbols, on$1 = Object.prototype.hasOwnProperty, an = Object.prototype.propertyIsEnumerable, Qt = (o2, e18, t2) => e18 in o2 ? sn(o2, e18, { enumerable: true, configurable: true, writable: true, value: t2 }) : o2[e18] = t2, ee = (o2, e18) => { for (var t2 in e18 || (e18 = {})) - on.call(e18, t2) && Qt(o2, t2, e18[t2]); + on$1.call(e18, t2) && Qt(o2, t2, e18[t2]); if (Zt) for (var t2 of Zt(e18)) an.call(e18, t2) && Qt(o2, t2, e18[t2]); @@ -110660,37 +39966,37 @@ class ei extends d$1 { constructor(e18, t2) { super(e18, t2), this.relayer = e18, this.logger = t2, this.subscriptions = /* @__PURE__ */ new Map(), this.topicMap = new tn(), this.events = new eventsExports.EventEmitter(), this.name = pt$1, this.version = yt$1, this.pending = /* @__PURE__ */ new Map(), this.cached = [], this.initialized = false, this.pendingSubscriptionWatchLabel = "pending_sub_watch_label", this.pollingInterval = 20, this.storagePrefix = O$1, this.subscribeTimeout = cjs$3.toMiliseconds(cjs$3.ONE_MINUTE), this.restartInProgress = false, this.batchSubscribeTopicsLimit = 500, this.pendingBatchMessages = [], this.init = async () => { this.initialized || (this.logger.trace("Initialized"), this.registerEventListeners(), this.clientId = await this.relayer.core.crypto.getClientId(), await this.restore()), this.initialized = true; - }, this.subscribe = async (s2, i3) => { - this.isInitialized(), this.logger.debug("Subscribing Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: s2, opts: i3 } }); + }, this.subscribe = async (s2, i2) => { + this.isInitialized(), this.logger.debug("Subscribing Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: s2, opts: i2 } }); try { - const r2 = zu(i3), n4 = { topic: s2, relay: r2, transportType: i3 == null ? void 0 : i3.transportType }; - this.pending.set(s2, n4); - const a3 = await this.rpcSubscribe(s2, r2, i3 == null ? void 0 : i3.transportType); - return typeof a3 == "string" && (this.onSubscribe(a3, n4), this.logger.debug("Successfully Subscribed Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: s2, opts: i3 } })), a3; + const r2 = zu(i2), n5 = { topic: s2, relay: r2, transportType: i2 == null ? void 0 : i2.transportType }; + this.pending.set(s2, n5); + const a3 = await this.rpcSubscribe(s2, r2, i2 == null ? void 0 : i2.transportType); + return typeof a3 == "string" && (this.onSubscribe(a3, n5), this.logger.debug("Successfully Subscribed Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: s2, opts: i2 } })), a3; } catch (r2) { throw this.logger.debug("Failed to Subscribe Topic"), this.logger.error(r2), r2; } - }, this.unsubscribe = async (s2, i3) => { - await this.restartToComplete(), this.isInitialized(), typeof (i3 == null ? void 0 : i3.id) < "u" ? await this.unsubscribeById(s2, i3.id, i3) : await this.unsubscribeByTopic(s2, i3); + }, this.unsubscribe = async (s2, i2) => { + await this.restartToComplete(), this.isInitialized(), typeof (i2 == null ? void 0 : i2.id) < "u" ? await this.unsubscribeById(s2, i2.id, i2) : await this.unsubscribeByTopic(s2, i2); }, this.isSubscribed = async (s2) => { if (this.topics.includes(s2)) return true; - const i3 = `${this.pendingSubscriptionWatchLabel}_${s2}`; - return await new Promise((r2, n4) => { + const i2 = `${this.pendingSubscriptionWatchLabel}_${s2}`; + return await new Promise((r2, n5) => { const a3 = new cjs$3.Watch(); - a3.start(i3); + a3.start(i2); const c2 = setInterval(() => { - !this.pending.has(s2) && this.topics.includes(s2) && (clearInterval(c2), a3.stop(i3), r2(true)), a3.elapsed(i3) >= Dt && (clearInterval(c2), a3.stop(i3), n4(new Error("Subscription resolution timeout"))); + !this.pending.has(s2) && this.topics.includes(s2) && (clearInterval(c2), a3.stop(i2), r2(true)), a3.elapsed(i2) >= Dt && (clearInterval(c2), a3.stop(i2), n5(new Error("Subscription resolution timeout"))); }, this.pollingInterval); }).catch(() => false); - }, this.on = (s2, i3) => { - this.events.on(s2, i3); - }, this.once = (s2, i3) => { - this.events.once(s2, i3); - }, this.off = (s2, i3) => { - this.events.off(s2, i3); - }, this.removeListener = (s2, i3) => { - this.events.removeListener(s2, i3); + }, this.on = (s2, i2) => { + this.events.on(s2, i2); + }, this.once = (s2, i2) => { + this.events.once(s2, i2); + }, this.off = (s2, i2) => { + this.events.off(s2, i2); + }, this.removeListener = (s2, i2) => { + this.events.removeListener(s2, i2); }, this.start = async () => { await this.onConnect(); }, this.stop = async () => { @@ -110733,28 +40039,28 @@ class ei extends d$1 { } async unsubscribeByTopic(e18, t2) { const s2 = this.topicMap.get(e18); - await Promise.all(s2.map(async (i3) => await this.unsubscribeById(e18, i3, t2))); + await Promise.all(s2.map(async (i2) => await this.unsubscribeById(e18, i2, t2))); } async unsubscribeById(e18, t2, s2) { this.logger.debug("Unsubscribing Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e18, id: t2, opts: s2 } }); try { - const i3 = zu(s2); - await this.rpcUnsubscribe(e18, t2, i3); + const i2 = zu(s2); + await this.rpcUnsubscribe(e18, t2, i2); const r2 = er$1("USER_DISCONNECTED", `${this.name}, ${e18}`); await this.onUnsubscribe(e18, t2, r2), this.logger.debug("Successfully Unsubscribed Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e18, id: t2, opts: s2 } }); - } catch (i3) { - throw this.logger.debug("Failed to Unsubscribe Topic"), this.logger.error(i3), i3; + } catch (i2) { + throw this.logger.debug("Failed to Unsubscribe Topic"), this.logger.error(i2), i2; } } async rpcSubscribe(e18, t2, s2 = F$1.relay) { s2 === F$1.relay && await this.restartToComplete(); - const i3 = { method: ju(t2.protocol).subscribe, params: { topic: e18 } }; - this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i3 }); + const i2 = { method: ju(t2.protocol).subscribe, params: { topic: e18 } }; + this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i2 }); try { const r2 = Ou(e18 + this.clientId); return s2 === F$1.link_mode ? (setTimeout(() => { - (this.relayer.connected || this.relayer.connecting) && this.relayer.request(i3).catch((n4) => this.logger.warn(n4)); - }, cjs$3.toMiliseconds(cjs$3.ONE_SECOND)), r2) : await await ms$1(this.relayer.request(i3).catch((n4) => this.logger.warn(n4)), this.subscribeTimeout) ? r2 : null; + (this.relayer.connected || this.relayer.connecting) && this.relayer.request(i2).catch((n5) => this.logger.warn(n5)); + }, cjs$3.toMiliseconds(cjs$3.ONE_SECOND)), r2) : await await ms$1(this.relayer.request(i2).catch((n5) => this.logger.warn(n5)), this.subscribeTimeout) ? r2 : null; } catch { this.logger.debug("Outgoing Relay Subscribe Payload stalled"), this.relayer.events.emit(w$1.connection_stalled); } @@ -110763,10 +40069,10 @@ class ei extends d$1 { async rpcBatchSubscribe(e18) { if (!e18.length) return; - const t2 = e18[0].relay, s2 = { method: ju(t2.protocol).batchSubscribe, params: { topics: e18.map((i3) => i3.topic) } }; + const t2 = e18[0].relay, s2 = { method: ju(t2.protocol).batchSubscribe, params: { topics: e18.map((i2) => i2.topic) } }; this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: s2 }); try { - return await await ms$1(this.relayer.request(s2).catch((i3) => this.logger.warn(i3)), this.subscribeTimeout); + return await await ms$1(this.relayer.request(s2).catch((i2) => this.logger.warn(i2)), this.subscribeTimeout); } catch { this.relayer.events.emit(w$1.connection_stalled); } @@ -110776,17 +40082,17 @@ class ei extends d$1 { return; const t2 = e18[0].relay, s2 = { method: ju(t2.protocol).batchFetchMessages, params: { topics: e18.map((r2) => r2.topic) } }; this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: s2 }); - let i3; + let i2; try { - i3 = await await ms$1(this.relayer.request(s2).catch((r2) => this.logger.warn(r2)), this.subscribeTimeout); + i2 = await await ms$1(this.relayer.request(s2).catch((r2) => this.logger.warn(r2)), this.subscribeTimeout); } catch { this.relayer.events.emit(w$1.connection_stalled); } - return i3; + return i2; } rpcUnsubscribe(e18, t2, s2) { - const i3 = { method: ju(s2.protocol).unsubscribe, params: { topic: e18, id: t2 } }; - return this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i3 }), this.relayer.request(i3); + const i2 = { method: ju(s2.protocol).unsubscribe, params: { topic: e18, id: t2 } }; + return this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i2 }), this.relayer.request(i2); } onSubscribe(e18, t2) { this.setSubscription(e18, Ce$1(ee({}, t2), { id: e18 })), this.pending.delete(t2.topic); @@ -110856,7 +40162,7 @@ class ei extends d$1 { if (!e18.length) return; const t2 = await this.rpcBatchSubscribe(e18); - Nr$1(t2) && this.onBatchSubscribe(t2.map((s2, i3) => Ce$1(ee({}, e18[i3]), { id: s2 }))); + Nr$1(t2) && this.onBatchSubscribe(t2.map((s2, i2) => Ce$1(ee({}, e18[i2]), { id: s2 }))); } async batchFetchMessages(e18) { if (!e18.length) @@ -110915,24 +40221,24 @@ var cn = Object.defineProperty, ti = Object.getOwnPropertySymbols, hn = Object.p class si extends u { constructor(e18) { super(e18), this.protocol = "wc", this.version = 2, this.events = new eventsExports.EventEmitter(), this.name = ht$1, this.transportExplicitlyClosed = false, this.initialized = false, this.connectionAttemptInProgress = false, this.connectionStatusPollingInterval = 20, this.staleConnectionErrors = ["socket hang up", "stalled", "interrupted"], this.hasExperiencedNetworkDisruption = false, this.requestsInFlight = /* @__PURE__ */ new Map(), this.heartBeatTimeout = cjs$3.toMiliseconds(cjs$3.THIRTY_SECONDS + cjs$3.ONE_SECOND), this.request = async (t2) => { - var s2, i3; + var s2, i2; this.logger.debug("Publishing Request Payload"); const r2 = t2.id || getBigIntRpcId().toString(); await this.toEstablishConnection(); try { - const n4 = this.provider.request(t2); - this.requestsInFlight.set(r2, { promise: n4, request: t2 }), this.logger.trace({ id: r2, method: t2.method, topic: (s2 = t2.params) == null ? void 0 : s2.topic }, "relayer.request - attempt to publish..."); + const n5 = this.provider.request(t2); + this.requestsInFlight.set(r2, { promise: n5, request: t2 }), this.logger.trace({ id: r2, method: t2.method, topic: (s2 = t2.params) == null ? void 0 : s2.topic }, "relayer.request - attempt to publish..."); const a3 = await new Promise(async (c2, h4) => { const d4 = () => { h4(new Error(`relayer.request - publish interrupted, id: ${r2}`)); }; this.provider.on(T$1.disconnect, d4); - const g3 = await n4; + const g3 = await n5; this.provider.off(T$1.disconnect, d4), c2(g3); }); - return this.logger.trace({ id: r2, method: t2.method, topic: (i3 = t2.params) == null ? void 0 : i3.topic }, "relayer.request - published"), a3; - } catch (n4) { - throw this.logger.debug(`Failed to Publish Request: ${r2}`), n4; + return this.logger.trace({ id: r2, method: t2.method, topic: (i2 = t2.params) == null ? void 0 : i2.topic }, "relayer.request - published"), a3; + } catch (n5) { + throw this.logger.debug(`Failed to Publish Request: ${r2}`), n5; } finally { this.requestsInFlight.delete(r2); } @@ -110940,8 +40246,8 @@ class si extends u { if (bi$1()) try { clearTimeout(this.pingTimeout), this.pingTimeout = setTimeout(() => { - var t2, s2, i3; - (i3 = (s2 = (t2 = this.provider) == null ? void 0 : t2.connection) == null ? void 0 : s2.socket) == null || i3.terminate(); + var t2, s2, i2; + (i2 = (s2 = (t2 = this.provider) == null ? void 0 : t2.connection) == null ? void 0 : s2.socket) == null || i2.terminate(); }, this.heartBeatTimeout); } catch (t2) { this.logger.warn(t2); @@ -110983,15 +40289,15 @@ class si extends u { async subscribe(e18, t2) { var s2; this.isInitialized(), (t2 == null ? void 0 : t2.transportType) === "relay" && await this.toEstablishConnection(); - let i3 = ((s2 = this.subscriber.topicMap.get(e18)) == null ? void 0 : s2[0]) || "", r2; - const n4 = (a3) => { - a3.topic === e18 && (this.subscriber.off(A.created, n4), r2()); + let i2 = ((s2 = this.subscriber.topicMap.get(e18)) == null ? void 0 : s2[0]) || "", r2; + const n5 = (a3) => { + a3.topic === e18 && (this.subscriber.off(A.created, n5), r2()); }; return await Promise.all([new Promise((a3) => { - r2 = a3, this.subscriber.on(A.created, n4); + r2 = a3, this.subscriber.on(A.created, n5); }), new Promise(async (a3) => { - i3 = await this.subscriber.subscribe(e18, t2) || i3, a3(); - })]), i3; + i2 = await this.subscriber.subscribe(e18, t2) || i2, a3(); + })]), i2; } async unsubscribe(e18, t2) { this.isInitialized(), await this.subscriber.unsubscribe(e18, t2); @@ -111024,10 +40330,10 @@ class si extends u { await this.confirmOnlineStateOrThrow(), e18 && e18 !== this.relayUrl && (this.relayUrl = e18, await this.transportDisconnect()), await this.createProvider(), this.connectionAttemptInProgress = true, this.transportExplicitlyClosed = false; try { await new Promise(async (t2, s2) => { - const i3 = () => { - this.provider.off(T$1.disconnect, i3), s2(new Error("Connection interrupted while trying to subscribe")); + const i2 = () => { + this.provider.off(T$1.disconnect, i2), s2(new Error("Connection interrupted while trying to subscribe")); }; - this.provider.on(T$1.disconnect, i3), await ms$1(this.provider.connect(), cjs$3.toMiliseconds(cjs$3.ONE_MINUTE), `Socket stalled when trying to connect to ${this.relayUrl}`).catch((r2) => { + this.provider.on(T$1.disconnect, i2), await ms$1(this.provider.connect(), cjs$3.toMiliseconds(cjs$3.ONE_MINUTE), `Socket stalled when trying to connect to ${this.relayUrl}`).catch((r2) => { s2(r2); }).finally(() => { clearTimeout(this.reconnectTimeout), this.reconnectTimeout = void 0; @@ -111056,33 +40362,33 @@ class si extends u { this.logger.trace("Batch message events is empty. Ignoring..."); return; } - const t2 = e18.sort((s2, i3) => s2.publishedAt - i3.publishedAt); + const t2 = e18.sort((s2, i2) => s2.publishedAt - i2.publishedAt); this.logger.trace(`Batch of ${t2.length} message events sorted`); for (const s2 of t2) try { await this.onMessageEvent(s2); - } catch (i3) { - this.logger.warn(i3); + } catch (i2) { + this.logger.warn(i2); } this.logger.trace(`Batch of ${t2.length} message events processed`); } async onLinkMessageEvent(e18, t2) { const { topic: s2 } = e18; if (!t2.sessionExists) { - const i3 = ws$1(cjs$3.FIVE_MINUTES), r2 = { topic: s2, expiry: i3, relay: { protocol: "irn" }, active: false }; + const i2 = ws$1(cjs$3.FIVE_MINUTES), r2 = { topic: s2, expiry: i2, relay: { protocol: "irn" }, active: false }; await this.core.pairing.pairings.set(s2, r2); } this.events.emit(w$1.message, e18), await this.recordMessageEvent(e18); } startPingTimeout() { - var e18, t2, s2, i3, r2; + var e18, t2, s2, i2, r2; if (bi$1()) try { - (t2 = (e18 = this.provider) == null ? void 0 : e18.connection) != null && t2.socket && ((r2 = (i3 = (s2 = this.provider) == null ? void 0 : s2.connection) == null ? void 0 : i3.socket) == null || r2.once("ping", () => { + (t2 = (e18 = this.provider) == null ? void 0 : e18.connection) != null && t2.socket && ((r2 = (i2 = (s2 = this.provider) == null ? void 0 : s2.connection) == null ? void 0 : i2.socket) == null || r2.once("ping", () => { this.resetPingTimeout(); })), this.resetPingTimeout(); - } catch (n4) { - this.logger.warn(n4); + } catch (n5) { + this.logger.warn(n5); } } isConnectionStalled(e18) { @@ -111091,7 +40397,7 @@ class si extends u { async createProvider() { this.provider.connection && this.unregisterProviderListeners(); const e18 = await this.core.crypto.signJWT(this.relayUrl); - this.provider = new o(new f$1(ss({ sdkVersion: oe$1, protocol: this.protocol, version: this.version, relayUrl: this.relayUrl, projectId: this.projectId, auth: e18, useOnCloseEvent: true, bundleId: this.bundleId }))), this.registerProviderListeners(); + this.provider = new o(new f$3(ss({ sdkVersion: oe$1, protocol: this.protocol, version: this.version, relayUrl: this.relayUrl, projectId: this.projectId, auth: e18, useOnCloseEvent: true, bundleId: this.bundleId }))), this.registerProviderListeners(); } async recordMessageEvent(e18) { const { topic: t2, message: s2 } = e18; @@ -111103,14 +40409,14 @@ class si extends u { return this.logger.debug(`Ignoring invalid/empty message: ${s2}`), true; if (!await this.subscriber.isSubscribed(t2)) return this.logger.debug(`Ignoring message for non-subscribed topic ${t2}`), true; - const i3 = this.messages.has(t2, s2); - return i3 && this.logger.debug(`Ignoring duplicate message: ${s2}`), i3; + const i2 = this.messages.has(t2, s2); + return i2 && this.logger.debug(`Ignoring duplicate message: ${s2}`), i2; } async onProviderPayload(e18) { if (this.logger.debug("Incoming Relay Payload"), this.logger.trace({ type: "payload", direction: "incoming", payload: e18 }), isJsonRpcRequest(e18)) { if (!e18.method.endsWith(lt$1)) return; - const t2 = e18.params, { topic: s2, message: i3, publishedAt: r2, attestation: n4 } = t2.data, a3 = { topic: s2, message: i3, publishedAt: r2, transportType: F$1.relay, attestation: n4 }; + const t2 = e18.params, { topic: s2, message: i2, publishedAt: r2, attestation: n5 } = t2.data, a3 = { topic: s2, message: i2, publishedAt: r2, transportType: F$1.relay, attestation: n5 }; this.logger.debug("Emitting Relayer Payload"), this.logger.trace(un({ type: "event", event: t2.id }, a3)), this.events.emit(t2.id, a3), await this.acknowledgePayload(e18), await this.onMessageEvent(a3); } else isJsonRpcResponse(e18) && this.events.emit(w$1.message_ack, e18); @@ -111134,7 +40440,7 @@ class si extends u { async onProviderDisconnect() { await this.subscriber.stop(), this.requestsInFlight.clear(), clearTimeout(this.pingTimeout), this.events.emit(w$1.disconnect), this.connectionAttemptInProgress = false, !this.transportExplicitlyClosed && (this.reconnectTimeout || (this.reconnectTimeout = setTimeout(async () => { await this.transportOpen().catch((e18) => this.logger.error(e18)); - }, cjs$3.toMiliseconds(ut$1)))); + }, cjs$3.toMiliseconds(ut$3)))); } isInitialized() { if (!this.initialized) { @@ -111159,20 +40465,20 @@ var dn = Object.defineProperty, ri = Object.getOwnPropertySymbols, gn = Object.p return o2; }; class ai extends p$1 { - constructor(e18, t2, s2, i3 = O$1, r2 = void 0) { - super(e18, t2, s2, i3), this.core = e18, this.logger = t2, this.name = s2, this.map = /* @__PURE__ */ new Map(), this.version = dt$1, this.cached = [], this.initialized = false, this.storagePrefix = O$1, this.recentlyDeleted = [], this.recentlyDeletedLimit = 200, this.init = async () => { - this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((n4) => { - this.getKey && n4 !== null && !Pe(n4) ? this.map.set(this.getKey(n4), n4) : lh(n4) ? this.map.set(n4.id, n4) : dh(n4) && this.map.set(n4.topic, n4); + constructor(e18, t2, s2, i2 = O$1, r2 = void 0) { + super(e18, t2, s2, i2), this.core = e18, this.logger = t2, this.name = s2, this.map = /* @__PURE__ */ new Map(), this.version = dt$1, this.cached = [], this.initialized = false, this.storagePrefix = O$1, this.recentlyDeleted = [], this.recentlyDeletedLimit = 200, this.init = async () => { + this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((n5) => { + this.getKey && n5 !== null && !Pe(n5) ? this.map.set(this.getKey(n5), n5) : lh(n5) ? this.map.set(n5.id, n5) : dh(n5) && this.map.set(n5.topic, n5); }), this.cached = [], this.initialized = true); - }, this.set = async (n4, a3) => { - this.isInitialized(), this.map.has(n4) ? await this.update(n4, a3) : (this.logger.debug("Setting value"), this.logger.trace({ type: "method", method: "set", key: n4, value: a3 }), this.map.set(n4, a3), await this.persist()); - }, this.get = (n4) => (this.isInitialized(), this.logger.debug("Getting value"), this.logger.trace({ type: "method", method: "get", key: n4 }), this.getData(n4)), this.getAll = (n4) => (this.isInitialized(), n4 ? this.values.filter((a3) => Object.keys(n4).every((c2) => bs(a3[c2], n4[c2]))) : this.values), this.update = async (n4, a3) => { - this.isInitialized(), this.logger.debug("Updating value"), this.logger.trace({ type: "method", method: "update", key: n4, update: a3 }); - const c2 = oi(oi({}, this.getData(n4)), a3); - this.map.set(n4, c2), await this.persist(); - }, this.delete = async (n4, a3) => { - this.isInitialized(), this.map.has(n4) && (this.logger.debug("Deleting value"), this.logger.trace({ type: "method", method: "delete", key: n4, reason: a3 }), this.map.delete(n4), this.addToRecentlyDeleted(n4), await this.persist()); - }, this.logger = E$1(t2, this.name), this.storagePrefix = i3, this.getKey = r2; + }, this.set = async (n5, a3) => { + this.isInitialized(), this.map.has(n5) ? await this.update(n5, a3) : (this.logger.debug("Setting value"), this.logger.trace({ type: "method", method: "set", key: n5, value: a3 }), this.map.set(n5, a3), await this.persist()); + }, this.get = (n5) => (this.isInitialized(), this.logger.debug("Getting value"), this.logger.trace({ type: "method", method: "get", key: n5 }), this.getData(n5)), this.getAll = (n5) => (this.isInitialized(), n5 ? this.values.filter((a3) => Object.keys(n5).every((c2) => bs(a3[c2], n5[c2]))) : this.values), this.update = async (n5, a3) => { + this.isInitialized(), this.logger.debug("Updating value"), this.logger.trace({ type: "method", method: "update", key: n5, update: a3 }); + const c2 = oi(oi({}, this.getData(n5)), a3); + this.map.set(n5, c2), await this.persist(); + }, this.delete = async (n5, a3) => { + this.isInitialized(), this.map.has(n5) && (this.logger.debug("Deleting value"), this.logger.trace({ type: "method", method: "delete", key: n5, reason: a3 }), this.map.delete(n5), this.addToRecentlyDeleted(n5), await this.persist()); + }, this.logger = E$1(t2, this.name), this.storagePrefix = i2, this.getKey = r2; } get context() { return y$2(this.logger); @@ -111202,8 +40508,8 @@ class ai extends p$1 { const t2 = this.map.get(e18); if (!t2) { if (this.recentlyDeleted.includes(e18)) { - const { message: i3 } = xe$1("MISSING_OR_INVALID", `Record was recently deleted - ${this.name}: ${e18}`); - throw this.logger.error(i3), new Error(i3); + const { message: i2 } = xe$1("MISSING_OR_INVALID", `Record was recently deleted - ${this.name}: ${e18}`); + throw this.logger.error(i2), new Error(i2); } const { message: s2 } = xe$1("NO_MATCHING_KEY", `${this.name}: ${e18}`); throw this.logger.error(s2), new Error(s2); @@ -111242,142 +40548,142 @@ class ci { this.isInitialized(), this.registeredMethods = [.../* @__PURE__ */ new Set([...this.registeredMethods, ...s2])]; }, this.create = async (s2) => { this.isInitialized(); - const i3 = Bu(), r2 = await this.core.crypto.setSymKey(i3), n4 = ws$1(cjs$3.FIVE_MINUTES), a3 = { protocol: at$1 }, c2 = { topic: r2, expiry: n4, relay: a3, active: false, methods: s2 == null ? void 0 : s2.methods }, h4 = $u({ protocol: this.core.protocol, version: this.core.version, topic: r2, symKey: i3, relay: a3, expiryTimestamp: n4, methods: s2 == null ? void 0 : s2.methods }); - return this.events.emit(q.create, c2), this.core.expirer.set(r2, n4), await this.pairings.set(r2, c2), await this.core.relayer.subscribe(r2, { transportType: s2 == null ? void 0 : s2.transportType }), { topic: r2, uri: h4 }; + const i2 = Bu(), r2 = await this.core.crypto.setSymKey(i2), n5 = ws$1(cjs$3.FIVE_MINUTES), a3 = { protocol: at$1 }, c2 = { topic: r2, expiry: n5, relay: a3, active: false, methods: s2 == null ? void 0 : s2.methods }, h4 = $u({ protocol: this.core.protocol, version: this.core.version, topic: r2, symKey: i2, relay: a3, expiryTimestamp: n5, methods: s2 == null ? void 0 : s2.methods }); + return this.events.emit(q.create, c2), this.core.expirer.set(r2, n5), await this.pairings.set(r2, c2), await this.core.relayer.subscribe(r2, { transportType: s2 == null ? void 0 : s2.transportType }), { topic: r2, uri: h4 }; }, this.pair = async (s2) => { this.isInitialized(); - const i3 = this.core.eventClient.createEvent({ properties: { topic: s2 == null ? void 0 : s2.uri, trace: [z$1.pairing_started] } }); - this.isValidPair(s2, i3); - const { topic: r2, symKey: n4, relay: a3, expiryTimestamp: c2, methods: h4 } = Xu(s2.uri); - i3.props.properties.topic = r2, i3.addTrace(z$1.pairing_uri_validation_success), i3.addTrace(z$1.pairing_uri_not_expired); + const i2 = this.core.eventClient.createEvent({ properties: { topic: s2 == null ? void 0 : s2.uri, trace: [z$1.pairing_started] } }); + this.isValidPair(s2, i2); + const { topic: r2, symKey: n5, relay: a3, expiryTimestamp: c2, methods: h4 } = Xu(s2.uri); + i2.props.properties.topic = r2, i2.addTrace(z$1.pairing_uri_validation_success), i2.addTrace(z$1.pairing_uri_not_expired); let d4; if (this.pairings.keys.includes(r2)) { - if (d4 = this.pairings.get(r2), i3.addTrace(z$1.existing_pairing), d4.active) - throw i3.setError(M2.active_pairing_already_exists), new Error(`Pairing already exists: ${r2}. Please try again with a new connection URI.`); - i3.addTrace(z$1.pairing_not_expired); + if (d4 = this.pairings.get(r2), i2.addTrace(z$1.existing_pairing), d4.active) + throw i2.setError(M2.active_pairing_already_exists), new Error(`Pairing already exists: ${r2}. Please try again with a new connection URI.`); + i2.addTrace(z$1.pairing_not_expired); } const g3 = c2 || ws$1(cjs$3.FIVE_MINUTES), m3 = { topic: r2, relay: a3, expiry: g3, active: false, methods: h4 }; - this.core.expirer.set(r2, g3), await this.pairings.set(r2, m3), i3.addTrace(z$1.store_new_pairing), s2.activatePairing && await this.activate({ topic: r2 }), this.events.emit(q.create, m3), i3.addTrace(z$1.emit_inactive_pairing), this.core.crypto.keychain.has(r2) || await this.core.crypto.setSymKey(n4, r2), i3.addTrace(z$1.subscribing_pairing_topic); + this.core.expirer.set(r2, g3), await this.pairings.set(r2, m3), i2.addTrace(z$1.store_new_pairing), s2.activatePairing && await this.activate({ topic: r2 }), this.events.emit(q.create, m3), i2.addTrace(z$1.emit_inactive_pairing), this.core.crypto.keychain.has(r2) || await this.core.crypto.setSymKey(n5, r2), i2.addTrace(z$1.subscribing_pairing_topic); try { await this.core.relayer.confirmOnlineStateOrThrow(); } catch { - i3.setError(M2.no_internet_connection); + i2.setError(M2.no_internet_connection); } try { await this.core.relayer.subscribe(r2, { relay: a3 }); } catch (b2) { - throw i3.setError(M2.subscribe_pairing_topic_failure), b2; + throw i2.setError(M2.subscribe_pairing_topic_failure), b2; } - return i3.addTrace(z$1.subscribe_pairing_topic_success), m3; + return i2.addTrace(z$1.subscribe_pairing_topic_success), m3; }, this.activate = async ({ topic: s2 }) => { this.isInitialized(); - const i3 = ws$1(cjs$3.THIRTY_DAYS); - this.core.expirer.set(s2, i3), await this.pairings.update(s2, { active: true, expiry: i3 }); + const i2 = ws$1(cjs$3.THIRTY_DAYS); + this.core.expirer.set(s2, i2), await this.pairings.update(s2, { active: true, expiry: i2 }); }, this.ping = async (s2) => { this.isInitialized(), await this.isValidPing(s2); - const { topic: i3 } = s2; - if (this.pairings.keys.includes(i3)) { - const r2 = await this.sendRequest(i3, "wc_pairingPing", {}), { done: n4, resolve: a3, reject: c2 } = gs(); + const { topic: i2 } = s2; + if (this.pairings.keys.includes(i2)) { + const r2 = await this.sendRequest(i2, "wc_pairingPing", {}), { done: n5, resolve: a3, reject: c2 } = gs(); this.events.once(Ms$1("pairing_ping", r2), ({ error: h4 }) => { h4 ? c2(h4) : a3(); - }), await n4(); + }), await n5(); } - }, this.updateExpiry = async ({ topic: s2, expiry: i3 }) => { - this.isInitialized(), await this.pairings.update(s2, { expiry: i3 }); - }, this.updateMetadata = async ({ topic: s2, metadata: i3 }) => { - this.isInitialized(), await this.pairings.update(s2, { peerMetadata: i3 }); + }, this.updateExpiry = async ({ topic: s2, expiry: i2 }) => { + this.isInitialized(), await this.pairings.update(s2, { expiry: i2 }); + }, this.updateMetadata = async ({ topic: s2, metadata: i2 }) => { + this.isInitialized(), await this.pairings.update(s2, { peerMetadata: i2 }); }, this.getPairings = () => (this.isInitialized(), this.pairings.values), this.disconnect = async (s2) => { this.isInitialized(), await this.isValidDisconnect(s2); - const { topic: i3 } = s2; - this.pairings.keys.includes(i3) && (await this.sendRequest(i3, "wc_pairingDelete", er$1("USER_DISCONNECTED")), await this.deletePairing(i3)); + const { topic: i2 } = s2; + this.pairings.keys.includes(i2) && (await this.sendRequest(i2, "wc_pairingDelete", er$1("USER_DISCONNECTED")), await this.deletePairing(i2)); }, this.formatUriFromPairing = (s2) => { this.isInitialized(); - const { topic: i3, relay: r2, expiry: n4, methods: a3 } = s2, c2 = this.core.crypto.keychain.get(i3); - return $u({ protocol: this.core.protocol, version: this.core.version, topic: i3, symKey: c2, relay: r2, expiryTimestamp: n4, methods: a3 }); - }, this.sendRequest = async (s2, i3, r2) => { - const n4 = formatJsonRpcRequest(i3, r2), a3 = await this.core.crypto.encode(s2, n4), c2 = j$1[i3].req; - return this.core.history.set(s2, n4), this.core.relayer.publish(s2, a3, c2), n4.id; - }, this.sendResult = async (s2, i3, r2) => { - const n4 = formatJsonRpcResult(s2, r2), a3 = await this.core.crypto.encode(i3, n4), c2 = await this.core.history.get(i3, s2), h4 = j$1[c2.request.method].res; - await this.core.relayer.publish(i3, a3, h4), await this.core.history.resolve(n4); - }, this.sendError = async (s2, i3, r2) => { - const n4 = formatJsonRpcError(s2, r2), a3 = await this.core.crypto.encode(i3, n4), c2 = await this.core.history.get(i3, s2), h4 = j$1[c2.request.method] ? j$1[c2.request.method].res : j$1.unregistered_method.res; - await this.core.relayer.publish(i3, a3, h4), await this.core.history.resolve(n4); - }, this.deletePairing = async (s2, i3) => { - await this.core.relayer.unsubscribe(s2), await Promise.all([this.pairings.delete(s2, er$1("USER_DISCONNECTED")), this.core.crypto.deleteSymKey(s2), i3 ? Promise.resolve() : this.core.expirer.del(s2)]); + const { topic: i2, relay: r2, expiry: n5, methods: a3 } = s2, c2 = this.core.crypto.keychain.get(i2); + return $u({ protocol: this.core.protocol, version: this.core.version, topic: i2, symKey: c2, relay: r2, expiryTimestamp: n5, methods: a3 }); + }, this.sendRequest = async (s2, i2, r2) => { + const n5 = formatJsonRpcRequest(i2, r2), a3 = await this.core.crypto.encode(s2, n5), c2 = j$1[i2].req; + return this.core.history.set(s2, n5), this.core.relayer.publish(s2, a3, c2), n5.id; + }, this.sendResult = async (s2, i2, r2) => { + const n5 = formatJsonRpcResult(s2, r2), a3 = await this.core.crypto.encode(i2, n5), c2 = await this.core.history.get(i2, s2), h4 = j$1[c2.request.method].res; + await this.core.relayer.publish(i2, a3, h4), await this.core.history.resolve(n5); + }, this.sendError = async (s2, i2, r2) => { + const n5 = formatJsonRpcError(s2, r2), a3 = await this.core.crypto.encode(i2, n5), c2 = await this.core.history.get(i2, s2), h4 = j$1[c2.request.method] ? j$1[c2.request.method].res : j$1.unregistered_method.res; + await this.core.relayer.publish(i2, a3, h4), await this.core.history.resolve(n5); + }, this.deletePairing = async (s2, i2) => { + await this.core.relayer.unsubscribe(s2), await Promise.all([this.pairings.delete(s2, er$1("USER_DISCONNECTED")), this.core.crypto.deleteSymKey(s2), i2 ? Promise.resolve() : this.core.expirer.del(s2)]); }, this.cleanup = async () => { - const s2 = this.pairings.getAll().filter((i3) => xs$1(i3.expiry)); - await Promise.all(s2.map((i3) => this.deletePairing(i3.topic))); + const s2 = this.pairings.getAll().filter((i2) => xs$1(i2.expiry)); + await Promise.all(s2.map((i2) => this.deletePairing(i2.topic))); }, this.onRelayEventRequest = (s2) => { - const { topic: i3, payload: r2 } = s2; + const { topic: i2, payload: r2 } = s2; switch (r2.method) { case "wc_pairingPing": - return this.onPairingPingRequest(i3, r2); + return this.onPairingPingRequest(i2, r2); case "wc_pairingDelete": - return this.onPairingDeleteRequest(i3, r2); + return this.onPairingDeleteRequest(i2, r2); default: - return this.onUnknownRpcMethodRequest(i3, r2); + return this.onUnknownRpcMethodRequest(i2, r2); } }, this.onRelayEventResponse = async (s2) => { - const { topic: i3, payload: r2 } = s2, n4 = (await this.core.history.get(i3, r2.id)).request.method; - switch (n4) { + const { topic: i2, payload: r2 } = s2, n5 = (await this.core.history.get(i2, r2.id)).request.method; + switch (n5) { case "wc_pairingPing": - return this.onPairingPingResponse(i3, r2); + return this.onPairingPingResponse(i2, r2); default: - return this.onUnknownRpcMethodResponse(n4); + return this.onUnknownRpcMethodResponse(n5); } - }, this.onPairingPingRequest = async (s2, i3) => { - const { id: r2 } = i3; + }, this.onPairingPingRequest = async (s2, i2) => { + const { id: r2 } = i2; try { this.isValidPing({ topic: s2 }), await this.sendResult(r2, s2, true), this.events.emit(q.ping, { id: r2, topic: s2 }); - } catch (n4) { - await this.sendError(r2, s2, n4), this.logger.error(n4); + } catch (n5) { + await this.sendError(r2, s2, n5), this.logger.error(n5); } - }, this.onPairingPingResponse = (s2, i3) => { - const { id: r2 } = i3; + }, this.onPairingPingResponse = (s2, i2) => { + const { id: r2 } = i2; setTimeout(() => { - isJsonRpcResult(i3) ? this.events.emit(Ms$1("pairing_ping", r2), {}) : isJsonRpcError(i3) && this.events.emit(Ms$1("pairing_ping", r2), { error: i3.error }); + isJsonRpcResult(i2) ? this.events.emit(Ms$1("pairing_ping", r2), {}) : isJsonRpcError(i2) && this.events.emit(Ms$1("pairing_ping", r2), { error: i2.error }); }, 500); - }, this.onPairingDeleteRequest = async (s2, i3) => { - const { id: r2 } = i3; + }, this.onPairingDeleteRequest = async (s2, i2) => { + const { id: r2 } = i2; try { this.isValidDisconnect({ topic: s2 }), await this.deletePairing(s2), this.events.emit(q.delete, { id: r2, topic: s2 }); - } catch (n4) { - await this.sendError(r2, s2, n4), this.logger.error(n4); + } catch (n5) { + await this.sendError(r2, s2, n5), this.logger.error(n5); } - }, this.onUnknownRpcMethodRequest = async (s2, i3) => { - const { id: r2, method: n4 } = i3; + }, this.onUnknownRpcMethodRequest = async (s2, i2) => { + const { id: r2, method: n5 } = i2; try { - if (this.registeredMethods.includes(n4)) + if (this.registeredMethods.includes(n5)) return; - const a3 = er$1("WC_METHOD_UNSUPPORTED", n4); + const a3 = er$1("WC_METHOD_UNSUPPORTED", n5); await this.sendError(r2, s2, a3), this.logger.error(a3); } catch (a3) { await this.sendError(r2, s2, a3), this.logger.error(a3); } }, this.onUnknownRpcMethodResponse = (s2) => { this.registeredMethods.includes(s2) || this.logger.error(er$1("WC_METHOD_UNSUPPORTED", s2)); - }, this.isValidPair = (s2, i3) => { + }, this.isValidPair = (s2, i2) => { var r2; if (!Ah(s2)) { const { message: a3 } = xe$1("MISSING_OR_INVALID", `pair() params: ${s2}`); - throw i3.setError(M2.malformed_pairing_uri), new Error(a3); + throw i2.setError(M2.malformed_pairing_uri), new Error(a3); } if (!ch(s2.uri)) { const { message: a3 } = xe$1("MISSING_OR_INVALID", `pair() uri: ${s2.uri}`); - throw i3.setError(M2.malformed_pairing_uri), new Error(a3); + throw i2.setError(M2.malformed_pairing_uri), new Error(a3); } - const n4 = Xu(s2 == null ? void 0 : s2.uri); - if (!((r2 = n4 == null ? void 0 : n4.relay) != null && r2.protocol)) { + const n5 = Xu(s2 == null ? void 0 : s2.uri); + if (!((r2 = n5 == null ? void 0 : n5.relay) != null && r2.protocol)) { const { message: a3 } = xe$1("MISSING_OR_INVALID", "pair() uri#relay-protocol"); - throw i3.setError(M2.malformed_pairing_uri), new Error(a3); + throw i2.setError(M2.malformed_pairing_uri), new Error(a3); } - if (!(n4 != null && n4.symKey)) { + if (!(n5 != null && n5.symKey)) { const { message: a3 } = xe$1("MISSING_OR_INVALID", "pair() uri#symKey"); - throw i3.setError(M2.malformed_pairing_uri), new Error(a3); + throw i2.setError(M2.malformed_pairing_uri), new Error(a3); } - if (n4 != null && n4.expiryTimestamp && cjs$3.toMiliseconds(n4 == null ? void 0 : n4.expiryTimestamp) < Date.now()) { - i3.setError(M2.pairing_expired); + if (n5 != null && n5.expiryTimestamp && cjs$3.toMiliseconds(n5 == null ? void 0 : n5.expiryTimestamp) < Date.now()) { + i2.setError(M2.pairing_expired); const { message: a3 } = xe$1("EXPIRED", "pair() URI has expired. Please try again with a new connection URI."); throw new Error(a3); } @@ -111386,28 +40692,28 @@ class ci { const { message: r2 } = xe$1("MISSING_OR_INVALID", `ping() params: ${s2}`); throw new Error(r2); } - const { topic: i3 } = s2; - await this.isValidPairingTopic(i3); + const { topic: i2 } = s2; + await this.isValidPairingTopic(i2); }, this.isValidDisconnect = async (s2) => { if (!Ah(s2)) { const { message: r2 } = xe$1("MISSING_OR_INVALID", `disconnect() params: ${s2}`); throw new Error(r2); } - const { topic: i3 } = s2; - await this.isValidPairingTopic(i3); + const { topic: i2 } = s2; + await this.isValidPairingTopic(i2); }, this.isValidPairingTopic = async (s2) => { if (!Yt$1(s2, false)) { - const { message: i3 } = xe$1("MISSING_OR_INVALID", `pairing topic should be a string: ${s2}`); - throw new Error(i3); + const { message: i2 } = xe$1("MISSING_OR_INVALID", `pairing topic should be a string: ${s2}`); + throw new Error(i2); } if (!this.pairings.keys.includes(s2)) { - const { message: i3 } = xe$1("NO_MATCHING_KEY", `pairing topic doesn't exist: ${s2}`); - throw new Error(i3); + const { message: i2 } = xe$1("NO_MATCHING_KEY", `pairing topic doesn't exist: ${s2}`); + throw new Error(i2); } if (xs$1(this.pairings.get(s2).expiry)) { await this.deletePairing(s2); - const { message: i3 } = xe$1("EXPIRED", `pairing topic: ${s2}`); - throw new Error(i3); + const { message: i2 } = xe$1("EXPIRED", `pairing topic: ${s2}`); + throw new Error(i2); } }, this.core = e18, this.logger = E$1(t2, this.name), this.pairings = new ai(this.core, this.logger, this.name, this.storagePrefix); } @@ -111422,14 +40728,14 @@ class ci { } registerRelayerEvents() { this.core.relayer.on(w$1.message, async (e18) => { - const { topic: t2, message: s2, transportType: i3 } = e18; - if (!this.pairings.keys.includes(t2) || i3 === F$1.link_mode || this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(s2))) + const { topic: t2, message: s2, transportType: i2 } = e18; + if (!this.pairings.keys.includes(t2) || i2 === F$1.link_mode || this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(s2))) return; const r2 = await this.core.crypto.decode(t2, s2); try { isJsonRpcRequest(r2) ? (this.core.history.set(t2, r2), this.onRelayEventRequest({ topic: t2, payload: r2 })) : isJsonRpcResponse(r2) && (await this.core.history.resolve(r2), await this.onRelayEventResponse({ topic: t2, payload: r2 }), this.core.history.delete(t2, r2.id)); - } catch (n4) { - this.logger.error(n4); + } catch (n5) { + this.logger.error(n5); } }); } @@ -111444,32 +40750,32 @@ class hi extends h$1 { constructor(e18, t2) { super(e18, t2), this.core = e18, this.logger = t2, this.records = /* @__PURE__ */ new Map(), this.events = new eventsExports.EventEmitter(), this.name = ft, this.version = _t, this.cached = [], this.initialized = false, this.storagePrefix = O$1, this.init = async () => { this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((s2) => this.records.set(s2.id, s2)), this.cached = [], this.registerEventListeners(), this.initialized = true); - }, this.set = (s2, i3, r2) => { - if (this.isInitialized(), this.logger.debug("Setting JSON-RPC request history record"), this.logger.trace({ type: "method", method: "set", topic: s2, request: i3, chainId: r2 }), this.records.has(i3.id)) + }, this.set = (s2, i2, r2) => { + if (this.isInitialized(), this.logger.debug("Setting JSON-RPC request history record"), this.logger.trace({ type: "method", method: "set", topic: s2, request: i2, chainId: r2 }), this.records.has(i2.id)) return; - const n4 = { id: i3.id, topic: s2, request: { method: i3.method, params: i3.params || null }, chainId: r2, expiry: ws$1(cjs$3.THIRTY_DAYS) }; - this.records.set(n4.id, n4), this.persist(), this.events.emit(P$1.created, n4); + const n5 = { id: i2.id, topic: s2, request: { method: i2.method, params: i2.params || null }, chainId: r2, expiry: ws$1(cjs$3.THIRTY_DAYS) }; + this.records.set(n5.id, n5), this.persist(), this.events.emit(P$1.created, n5); }, this.resolve = async (s2) => { if (this.isInitialized(), this.logger.debug("Updating JSON-RPC response history record"), this.logger.trace({ type: "method", method: "update", response: s2 }), !this.records.has(s2.id)) return; - const i3 = await this.getRecord(s2.id); - typeof i3.response > "u" && (i3.response = isJsonRpcError(s2) ? { error: s2.error } : { result: s2.result }, this.records.set(i3.id, i3), this.persist(), this.events.emit(P$1.updated, i3)); - }, this.get = async (s2, i3) => (this.isInitialized(), this.logger.debug("Getting record"), this.logger.trace({ type: "method", method: "get", topic: s2, id: i3 }), await this.getRecord(i3)), this.delete = (s2, i3) => { - this.isInitialized(), this.logger.debug("Deleting record"), this.logger.trace({ type: "method", method: "delete", id: i3 }), this.values.forEach((r2) => { + const i2 = await this.getRecord(s2.id); + typeof i2.response > "u" && (i2.response = isJsonRpcError(s2) ? { error: s2.error } : { result: s2.result }, this.records.set(i2.id, i2), this.persist(), this.events.emit(P$1.updated, i2)); + }, this.get = async (s2, i2) => (this.isInitialized(), this.logger.debug("Getting record"), this.logger.trace({ type: "method", method: "get", topic: s2, id: i2 }), await this.getRecord(i2)), this.delete = (s2, i2) => { + this.isInitialized(), this.logger.debug("Deleting record"), this.logger.trace({ type: "method", method: "delete", id: i2 }), this.values.forEach((r2) => { if (r2.topic === s2) { - if (typeof i3 < "u" && r2.id !== i3) + if (typeof i2 < "u" && r2.id !== i2) return; this.records.delete(r2.id), this.events.emit(P$1.deleted, r2); } }), this.persist(); - }, this.exists = async (s2, i3) => (this.isInitialized(), this.records.has(i3) ? (await this.getRecord(i3)).topic === s2 : false), this.on = (s2, i3) => { - this.events.on(s2, i3); - }, this.once = (s2, i3) => { - this.events.once(s2, i3); - }, this.off = (s2, i3) => { - this.events.off(s2, i3); - }, this.removeListener = (s2, i3) => { - this.events.removeListener(s2, i3); + }, this.exists = async (s2, i2) => (this.isInitialized(), this.records.has(i2) ? (await this.getRecord(i2)).topic === s2 : false), this.on = (s2, i2) => { + this.events.on(s2, i2); + }, this.once = (s2, i2) => { + this.events.once(s2, i2); + }, this.off = (s2, i2) => { + this.events.off(s2, i2); + }, this.removeListener = (s2, i2) => { + this.events.removeListener(s2, i2); }, this.logger = E$1(t2, this.name); } get context() { @@ -111566,32 +40872,32 @@ class li extends x$1 { this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((s2) => this.expirations.set(s2.target, s2)), this.cached = [], this.registerEventListeners(), this.initialized = true); }, this.has = (s2) => { try { - const i3 = this.formatTarget(s2); - return typeof this.getExpiration(i3) < "u"; + const i2 = this.formatTarget(s2); + return typeof this.getExpiration(i2) < "u"; } catch { return false; } - }, this.set = (s2, i3) => { + }, this.set = (s2, i2) => { this.isInitialized(); - const r2 = this.formatTarget(s2), n4 = { target: r2, expiry: i3 }; - this.expirations.set(r2, n4), this.checkExpiry(r2, n4), this.events.emit(R2.created, { target: r2, expiration: n4 }); + const r2 = this.formatTarget(s2), n5 = { target: r2, expiry: i2 }; + this.expirations.set(r2, n5), this.checkExpiry(r2, n5), this.events.emit(R2.created, { target: r2, expiration: n5 }); }, this.get = (s2) => { this.isInitialized(); - const i3 = this.formatTarget(s2); - return this.getExpiration(i3); + const i2 = this.formatTarget(s2); + return this.getExpiration(i2); }, this.del = (s2) => { if (this.isInitialized(), this.has(s2)) { - const i3 = this.formatTarget(s2), r2 = this.getExpiration(i3); - this.expirations.delete(i3), this.events.emit(R2.deleted, { target: i3, expiration: r2 }); - } - }, this.on = (s2, i3) => { - this.events.on(s2, i3); - }, this.once = (s2, i3) => { - this.events.once(s2, i3); - }, this.off = (s2, i3) => { - this.events.off(s2, i3); - }, this.removeListener = (s2, i3) => { - this.events.removeListener(s2, i3); + const i2 = this.formatTarget(s2), r2 = this.getExpiration(i2); + this.expirations.delete(i2), this.events.emit(R2.deleted, { target: i2, expiration: r2 }); + } + }, this.on = (s2, i2) => { + this.events.on(s2, i2); + }, this.once = (s2, i2) => { + this.events.once(s2, i2); + }, this.off = (s2, i2) => { + this.events.off(s2, i2); + }, this.removeListener = (s2, i2) => { + this.events.removeListener(s2, i2); }, this.logger = E$1(t2, this.name); } get context() { @@ -111703,10 +41009,10 @@ function mn() { return G("navigator"); } y2.getNavigatorOrThrow = mn; -function bn() { +function bn$1() { return U("navigator"); } -y2.getNavigator = bn; +y2.getNavigator = bn$1; function fn() { return G("location"); } @@ -111734,12 +41040,12 @@ y2.getLocalStorage = In; class di extends y$1 { constructor(e18, t2, s2) { super(e18, t2, s2), this.core = e18, this.logger = t2, this.store = s2, this.name = wt, this.verifyUrlV3 = Tt$1, this.storagePrefix = O$1, this.version = fe, this.init = async () => { - var i3; - this.isDevEnv || (this.publicKey = await this.store.getItem(this.storeKey), this.publicKey && cjs$3.toMiliseconds((i3 = this.publicKey) == null ? void 0 : i3.expiresAt) < Date.now() && (this.logger.debug("verify v2 public key expired"), await this.removePublicKey())); - }, this.register = async (i3) => { + var i2; + this.isDevEnv || (this.publicKey = await this.store.getItem(this.storeKey), this.publicKey && cjs$3.toMiliseconds((i2 = this.publicKey) == null ? void 0 : i2.expiresAt) < Date.now() && (this.logger.debug("verify v2 public key expired"), await this.removePublicKey())); + }, this.register = async (i2) => { if (!gr$1() || this.isDevEnv) return; - const r2 = window.location.origin, { id: n4, decryptedId: a3 } = i3, c2 = `${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${r2}&id=${n4}&decryptedId=${a3}`; + const r2 = window.location.origin, { id: n5, decryptedId: a3 } = i2, c2 = `${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${r2}&id=${n5}&decryptedId=${a3}`; try { const h4 = ui(), d4 = this.startAbortTimer(cjs$3.ONE_SECOND * 5), g3 = await new Promise((m3, b2) => { const l2 = () => { @@ -111751,14 +41057,14 @@ class di extends y$1 { const E2 = (D2) => { if (D2.data && typeof D2.data == "string") try { - const f3 = JSON.parse(D2.data); - if (f3.type === "verify_attestation") { - if (decodeJWT(f3.attestation).payload.id !== n4) + const f4 = JSON.parse(D2.data); + if (f4.type === "verify_attestation") { + if (decodeJWT(f4.attestation).payload.id !== n5) return; - clearInterval(d4), h4.body.removeChild(p3), this.abortController.signal.removeEventListener("abort", l2), window.removeEventListener("message", E2), m3(f3.attestation === null ? "" : f3.attestation); + clearInterval(d4), h4.body.removeChild(p3), this.abortController.signal.removeEventListener("abort", l2), window.removeEventListener("message", E2), m3(f4.attestation === null ? "" : f4.attestation); } - } catch (f3) { - this.logger.warn(f3); + } catch (f4) { + this.logger.warn(f4); } }; h4.body.appendChild(p3), window.addEventListener("message", E2, { signal: this.abortController.signal }); @@ -111768,10 +41074,10 @@ class di extends y$1 { this.logger.warn(h4); } return ""; - }, this.resolve = async (i3) => { + }, this.resolve = async (i2) => { if (this.isDevEnv) return ""; - const { attestationId: r2, hash: n4, encryptedId: a3 } = i3; + const { attestationId: r2, hash: n5, encryptedId: a3 } = i2; if (r2 === "") { this.logger.debug("resolve: attestationId is empty, skipping"); return; @@ -111788,41 +41094,41 @@ class di extends y$1 { return h4; } } - if (!n4) + if (!n5) return; - const c2 = this.getVerifyUrl(i3 == null ? void 0 : i3.verifyUrl); - return this.fetchAttestation(n4, c2); - }, this.fetchAttestation = async (i3, r2) => { - this.logger.debug(`resolving attestation: ${i3} from url: ${r2}`); - const n4 = this.startAbortTimer(cjs$3.ONE_SECOND * 5), a3 = await fetch(`${r2}/attestation/${i3}?v2Supported=true`, { signal: this.abortController.signal }); - return clearTimeout(n4), a3.status === 200 ? await a3.json() : void 0; - }, this.getVerifyUrl = (i3) => { - let r2 = i3 || Z; + const c2 = this.getVerifyUrl(i2 == null ? void 0 : i2.verifyUrl); + return this.fetchAttestation(n5, c2); + }, this.fetchAttestation = async (i2, r2) => { + this.logger.debug(`resolving attestation: ${i2} from url: ${r2}`); + const n5 = this.startAbortTimer(cjs$3.ONE_SECOND * 5), a3 = await fetch(`${r2}/attestation/${i2}?v2Supported=true`, { signal: this.abortController.signal }); + return clearTimeout(n5), a3.status === 200 ? await a3.json() : void 0; + }, this.getVerifyUrl = (i2) => { + let r2 = i2 || Z; return Ct.includes(r2) || (this.logger.info(`verify url: ${r2}, not included in trusted list, assigning default: ${Z}`), r2 = Z), r2; }, this.fetchPublicKey = async () => { try { this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`); - const i3 = this.startAbortTimer(cjs$3.FIVE_SECONDS), r2 = await fetch(`${this.verifyUrlV3}/public-key`, { signal: this.abortController.signal }); - return clearTimeout(i3), await r2.json(); - } catch (i3) { - this.logger.warn(i3); + const i2 = this.startAbortTimer(cjs$3.FIVE_SECONDS), r2 = await fetch(`${this.verifyUrlV3}/public-key`, { signal: this.abortController.signal }); + return clearTimeout(i2), await r2.json(); + } catch (i2) { + this.logger.warn(i2); } - }, this.persistPublicKey = async (i3) => { - this.logger.debug("persisting public key to local storage", i3), await this.store.setItem(this.storeKey, i3), this.publicKey = i3; + }, this.persistPublicKey = async (i2) => { + this.logger.debug("persisting public key to local storage", i2), await this.store.setItem(this.storeKey, i2), this.publicKey = i2; }, this.removePublicKey = async () => { this.logger.debug("removing verify v2 public key from storage"), await this.store.removeItem(this.storeKey), this.publicKey = void 0; - }, this.isValidJwtAttestation = async (i3) => { + }, this.isValidJwtAttestation = async (i2) => { const r2 = await this.getPublicKey(); try { if (r2) - return this.validateAttestation(i3, r2); + return this.validateAttestation(i2, r2); } catch (a3) { this.logger.error(a3), this.logger.warn("error validating attestation"); } - const n4 = await this.fetchAndPersistPublicKey(); + const n5 = await this.fetchAndPersistPublicKey(); try { - if (n4) - return this.validateAttestation(i3, n4); + if (n5) + return this.validateAttestation(i2, n5); } catch (a3) { this.logger.error(a3), this.logger.warn("error validating attestation"); } @@ -111830,13 +41136,13 @@ class di extends y$1 { if (this.fetchPromise) return await this.fetchPromise, this.publicKey; this.fetchPromise = new Promise(async (r2) => { - const n4 = await this.fetchPublicKey(); - n4 && (await this.persistPublicKey(n4), r2(n4)); + const n5 = await this.fetchPublicKey(); + n5 && (await this.persistPublicKey(n5), r2(n5)); }); - const i3 = await this.fetchPromise; - return this.fetchPromise = void 0, i3; - }, this.validateAttestation = (i3, r2) => { - const n4 = Lu(i3, r2.publicKey), a3 = { hasExpired: cjs$3.toMiliseconds(n4.exp) < Date.now(), payload: n4 }; + const i2 = await this.fetchPromise; + return this.fetchPromise = void 0, i2; + }, this.validateAttestation = (i2, r2) => { + const n5 = Lu(i2, r2.publicKey), a3 = { hasExpired: cjs$3.toMiliseconds(n5.exp) < Date.now(), payload: n5 }; if (a3.hasExpired) throw this.logger.warn("resolve: jwt attestation expired"), new Error("JWT attestation expired"); return { origin: a3.payload.origin, isScam: a3.payload.isScam, isVerified: a3.payload.isVerified }; @@ -111855,8 +41161,8 @@ class di extends y$1 { class gi extends v$2 { constructor(e18, t2) { super(e18, t2), this.projectId = e18, this.logger = t2, this.context = St, this.registerDeviceToken = async (s2) => { - const { clientId: i3, token: r2, notificationType: n4, enableEncrypted: a3 = false } = s2, c2 = `${Pt}/${this.projectId}/clients`; - await fetch(c2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ client_id: i3, type: n4, token: r2, always_raw: a3 }) }); + const { clientId: i2, token: r2, notificationType: n5, enableEncrypted: a3 = false } = s2, c2 = `${Pt}/${this.projectId}/clients`; + await fetch(c2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ client_id: i2, type: n5, token: r2, always_raw: a3 }) }); }, this.logger = E$1(t2, this.context); } } @@ -111873,66 +41179,66 @@ class Di extends C$1 { super(e18, t2, s2), this.core = e18, this.logger = t2, this.context = xt, this.storagePrefix = O$1, this.storageVersion = Rt, this.events = /* @__PURE__ */ new Map(), this.shouldPersist = false, this.init = async () => { if (!_s$1()) try { - const i3 = { eventId: Ns$1(), timestamp: Date.now(), domain: this.getAppDomain(), props: { event: "INIT", type: "", properties: { client_id: await this.core.crypto.getClientId(), user_agent: Pn$1(this.core.relayer.protocol, this.core.relayer.version, oe$1) } } }; - await this.sendEvent([i3]); - } catch (i3) { - this.logger.warn(i3); + const i2 = { eventId: Ns$1(), timestamp: Date.now(), domain: this.getAppDomain(), props: { event: "INIT", type: "", properties: { client_id: await this.core.crypto.getClientId(), user_agent: Pn$1(this.core.relayer.protocol, this.core.relayer.version, oe$1) } } }; + await this.sendEvent([i2]); + } catch (i2) { + this.logger.warn(i2); } - }, this.createEvent = (i3) => { - const { event: r2 = "ERROR", type: n4 = "", properties: { topic: a3, trace: c2 } } = i3, h4 = Ns$1(), d4 = this.core.projectId || "", g3 = Date.now(), m3 = te({ eventId: h4, timestamp: g3, props: { event: r2, type: n4, properties: { topic: a3, trace: c2 } }, bundleId: d4, domain: this.getAppDomain() }, this.setMethods(h4)); + }, this.createEvent = (i2) => { + const { event: r2 = "ERROR", type: n5 = "", properties: { topic: a3, trace: c2 } } = i2, h4 = Ns$1(), d4 = this.core.projectId || "", g3 = Date.now(), m3 = te({ eventId: h4, timestamp: g3, props: { event: r2, type: n5, properties: { topic: a3, trace: c2 } }, bundleId: d4, domain: this.getAppDomain() }, this.setMethods(h4)); return this.telemetryEnabled && (this.events.set(h4, m3), this.shouldPersist = true), m3; - }, this.getEvent = (i3) => { - const { eventId: r2, topic: n4 } = i3; + }, this.getEvent = (i2) => { + const { eventId: r2, topic: n5 } = i2; if (r2) return this.events.get(r2); - const a3 = Array.from(this.events.values()).find((c2) => c2.props.properties.topic === n4); + const a3 = Array.from(this.events.values()).find((c2) => c2.props.properties.topic === n5); if (a3) return te(te({}, a3), this.setMethods(a3.eventId)); - }, this.deleteEvent = (i3) => { - const { eventId: r2 } = i3; + }, this.deleteEvent = (i2) => { + const { eventId: r2 } = i2; this.events.delete(r2), this.shouldPersist = true; }, this.setEventListeners = () => { this.core.heartbeat.on(r$2.pulse, async () => { - this.shouldPersist && await this.persist(), this.events.forEach((i3) => { - cjs$3.fromMiliseconds(Date.now()) - cjs$3.fromMiliseconds(i3.timestamp) > Ot && (this.events.delete(i3.eventId), this.shouldPersist = true); + this.shouldPersist && await this.persist(), this.events.forEach((i2) => { + cjs$3.fromMiliseconds(Date.now()) - cjs$3.fromMiliseconds(i2.timestamp) > Ot && (this.events.delete(i2.eventId), this.shouldPersist = true); }); }); - }, this.setMethods = (i3) => ({ addTrace: (r2) => this.addTrace(i3, r2), setError: (r2) => this.setError(i3, r2) }), this.addTrace = (i3, r2) => { - const n4 = this.events.get(i3); - n4 && (n4.props.properties.trace.push(r2), this.events.set(i3, n4), this.shouldPersist = true); - }, this.setError = (i3, r2) => { - const n4 = this.events.get(i3); - n4 && (n4.props.type = r2, n4.timestamp = Date.now(), this.events.set(i3, n4), this.shouldPersist = true); + }, this.setMethods = (i2) => ({ addTrace: (r2) => this.addTrace(i2, r2), setError: (r2) => this.setError(i2, r2) }), this.addTrace = (i2, r2) => { + const n5 = this.events.get(i2); + n5 && (n5.props.properties.trace.push(r2), this.events.set(i2, n5), this.shouldPersist = true); + }, this.setError = (i2, r2) => { + const n5 = this.events.get(i2); + n5 && (n5.props.type = r2, n5.timestamp = Date.now(), this.events.set(i2, n5), this.shouldPersist = true); }, this.persist = async () => { await this.core.storage.setItem(this.storageKey, Array.from(this.events.values())), this.shouldPersist = false; }, this.restore = async () => { try { - const i3 = await this.core.storage.getItem(this.storageKey) || []; - if (!i3.length) + const i2 = await this.core.storage.getItem(this.storageKey) || []; + if (!i2.length) return; - i3.forEach((r2) => { + i2.forEach((r2) => { this.events.set(r2.eventId, te(te({}, r2), this.setMethods(r2.eventId))); }); - } catch (i3) { - this.logger.warn(i3); + } catch (i2) { + this.logger.warn(i2); } }, this.submit = async () => { if (!this.telemetryEnabled || this.events.size === 0) return; - const i3 = []; - for (const [r2, n4] of this.events) - n4.props.type && i3.push(n4); - if (i3.length !== 0) + const i2 = []; + for (const [r2, n5] of this.events) + n5.props.type && i2.push(n5); + if (i2.length !== 0) try { - if ((await this.sendEvent(i3)).ok) - for (const r2 of i3) + if ((await this.sendEvent(i2)).ok) + for (const r2 of i2) this.events.delete(r2.eventId), this.shouldPersist = true; } catch (r2) { this.logger.warn(r2); } - }, this.sendEvent = async (i3) => { + }, this.sendEvent = async (i2) => { const r2 = this.getAppDomain() ? "" : "&sp=desktop"; - return await fetch(`${At}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${oe$1}${r2}`, { method: "POST", body: JSON.stringify(i3) }); + return await fetch(`${At}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${oe$1}${r2}`, { method: "POST", body: JSON.stringify(i2) }); }, this.getAppDomain = () => fs$1().url, this.logger = E$1(t2, this.context), this.telemetryEnabled = s2, s2 ? this.restore().then(async () => { await this.submit(), this.setEventListeners(); }) : this.persist(); @@ -111949,20 +41255,20 @@ var Pn = Object.defineProperty, mi = Object.getOwnPropertySymbols, Rn = Object.p xn.call(e18, t2) && bi(o2, t2, e18[t2]); return o2; }; -class ce extends n$1 { +class ce extends n$2 { constructor(e18) { var t2; - super(e18), this.protocol = be$1, this.version = fe, this.name = ne, this.events = new eventsExports.EventEmitter(), this.initialized = false, this.on = (n4, a3) => this.events.on(n4, a3), this.once = (n4, a3) => this.events.once(n4, a3), this.off = (n4, a3) => this.events.off(n4, a3), this.removeListener = (n4, a3) => this.events.removeListener(n4, a3), this.dispatchEnvelope = ({ topic: n4, message: a3, sessionExists: c2 }) => { - if (!n4 || !a3) + super(e18), this.protocol = be$1, this.version = fe, this.name = ne, this.events = new eventsExports.EventEmitter(), this.initialized = false, this.on = (n5, a3) => this.events.on(n5, a3), this.once = (n5, a3) => this.events.once(n5, a3), this.off = (n5, a3) => this.events.off(n5, a3), this.removeListener = (n5, a3) => this.events.removeListener(n5, a3), this.dispatchEnvelope = ({ topic: n5, message: a3, sessionExists: c2 }) => { + if (!n5 || !a3) return; - const h4 = { topic: n4, message: a3, publishedAt: Date.now(), transportType: F$1.link_mode }; + const h4 = { topic: n5, message: a3, publishedAt: Date.now(), transportType: F$1.link_mode }; this.relayer.onLinkMessageEvent(h4, { sessionExists: c2 }); }, this.projectId = e18 == null ? void 0 : e18.projectId, this.relayUrl = (e18 == null ? void 0 : e18.relayUrl) || Ee, this.customStoragePrefix = e18 != null && e18.customStoragePrefix ? `:${e18.customStoragePrefix}` : ""; - const s2 = k({ level: typeof (e18 == null ? void 0 : e18.logger) == "string" && e18.logger ? e18.logger : Xe.logger }), { logger: i3, chunkLoggerController: r2 } = A$1({ opts: s2, maxSizeInBytes: e18 == null ? void 0 : e18.maxLogBlobSizeInBytes, loggerOverride: e18 == null ? void 0 : e18.logger }); + const s2 = k({ level: typeof (e18 == null ? void 0 : e18.logger) == "string" && e18.logger ? e18.logger : Xe.logger }), { logger: i2, chunkLoggerController: r2 } = A$1({ opts: s2, maxSizeInBytes: e18 == null ? void 0 : e18.maxLogBlobSizeInBytes, loggerOverride: e18 == null ? void 0 : e18.logger }); this.logChunkController = r2, (t2 = this.logChunkController) != null && t2.downloadLogsBlobInBrowser && (window.downloadLogsBlobInBrowser = async () => { - var n4, a3; - (n4 = this.logChunkController) != null && n4.downloadLogsBlobInBrowser && ((a3 = this.logChunkController) == null || a3.downloadLogsBlobInBrowser({ clientId: await this.crypto.getClientId() })); - }), this.logger = E$1(i3, this.name), this.heartbeat = new i$1(), this.crypto = new Wt(this, this.logger, e18 == null ? void 0 : e18.keychain), this.history = new hi(this, this.logger), this.expirer = new li(this, this.logger), this.storage = e18 != null && e18.storage ? e18.storage : new h$2(fi(fi({}, Ze), e18 == null ? void 0 : e18.storageOptions)), this.relayer = new si({ core: this, logger: this.logger, relayUrl: this.relayUrl, projectId: this.projectId }), this.pairing = new ci(this, this.logger), this.verify = new di(this, this.logger, this.storage), this.echoClient = new gi(this.projectId || "", this.logger), this.linkModeSupportedApps = [], this.eventClient = new Di(this, this.logger, e18 == null ? void 0 : e18.telemetryEnabled); + var n5, a3; + (n5 = this.logChunkController) != null && n5.downloadLogsBlobInBrowser && ((a3 = this.logChunkController) == null || a3.downloadLogsBlobInBrowser({ clientId: await this.crypto.getClientId() })); + }), this.logger = E$1(i2, this.name), this.heartbeat = new i$4(), this.crypto = new Wt(this, this.logger, e18 == null ? void 0 : e18.keychain), this.history = new hi(this, this.logger), this.expirer = new li(this, this.logger), this.storage = e18 != null && e18.storage ? e18.storage : new h$2(fi(fi({}, Ze), e18 == null ? void 0 : e18.storageOptions)), this.relayer = new si({ core: this, logger: this.logger, relayUrl: this.relayUrl, projectId: this.projectId }), this.pairing = new ci(this, this.logger), this.verify = new di(this, this.logger, this.storage), this.echoClient = new gi(this.projectId || "", this.logger), this.linkModeSupportedApps = [], this.eventClient = new Di(this, this.logger, e18 == null ? void 0 : e18.telemetryEnabled); } static async init(e18) { const t2 = new ce(e18); @@ -111994,11 +41300,11 @@ class ce extends n$1 { } const On = ce; const be = "wc", Ce = 2, Le = "client", ye = `${be}@${Ce}:${Le}:`, we = { name: Le, logger: "error", controller: false, relayUrl: "wss://relay.walletconnect.org" }, xe = "WALLETCONNECT_DEEPLINK_CHOICE", st = "proposal", it = "Proposal expired", rt = "session", z2 = cjs$3.SEVEN_DAYS, nt = "engine", v$1 = { wc_sessionPropose: { req: { ttl: cjs$3.FIVE_MINUTES, prompt: true, tag: 1100 }, res: { ttl: cjs$3.FIVE_MINUTES, prompt: false, tag: 1101 }, reject: { ttl: cjs$3.FIVE_MINUTES, prompt: false, tag: 1120 }, autoReject: { ttl: cjs$3.FIVE_MINUTES, prompt: false, tag: 1121 } }, wc_sessionSettle: { req: { ttl: cjs$3.FIVE_MINUTES, prompt: false, tag: 1102 }, res: { ttl: cjs$3.FIVE_MINUTES, prompt: false, tag: 1103 } }, wc_sessionUpdate: { req: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1104 }, res: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1105 } }, wc_sessionExtend: { req: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1106 }, res: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1107 } }, wc_sessionRequest: { req: { ttl: cjs$3.FIVE_MINUTES, prompt: true, tag: 1108 }, res: { ttl: cjs$3.FIVE_MINUTES, prompt: false, tag: 1109 } }, wc_sessionEvent: { req: { ttl: cjs$3.FIVE_MINUTES, prompt: true, tag: 1110 }, res: { ttl: cjs$3.FIVE_MINUTES, prompt: false, tag: 1111 } }, wc_sessionDelete: { req: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1112 }, res: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1113 } }, wc_sessionPing: { req: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1114 }, res: { ttl: cjs$3.ONE_DAY, prompt: false, tag: 1115 } }, wc_sessionAuthenticate: { req: { ttl: cjs$3.ONE_HOUR, prompt: true, tag: 1116 }, res: { ttl: cjs$3.ONE_HOUR, prompt: false, tag: 1117 }, reject: { ttl: cjs$3.FIVE_MINUTES, prompt: false, tag: 1118 }, autoReject: { ttl: cjs$3.FIVE_MINUTES, prompt: false, tag: 1119 } } }, me = { min: cjs$3.FIVE_MINUTES, max: cjs$3.SEVEN_DAYS }, x2 = { idle: "IDLE", active: "ACTIVE" }, ot = "request", at = ["wc_sessionPropose", "wc_sessionRequest", "wc_authRequest", "wc_sessionAuthenticate"], ct = "wc", lt = "auth", pt = "authKeys", ht = "pairingTopics", dt = "requests", oe = `${ct}@${1.5}:${lt}:`, ae = `${oe}:PUB_KEY`; -var ys = Object.defineProperty, ws = Object.defineProperties, ms = Object.getOwnPropertyDescriptors, ut = Object.getOwnPropertySymbols, _s = Object.prototype.hasOwnProperty, Es = Object.prototype.propertyIsEnumerable, gt = (q2, o2, e18) => o2 in q2 ? ys(q2, o2, { enumerable: true, configurable: true, writable: true, value: e18 }) : q2[o2] = e18, I = (q2, o2) => { +var ys = Object.defineProperty, ws = Object.defineProperties, ms = Object.getOwnPropertyDescriptors, ut$2 = Object.getOwnPropertySymbols, _s = Object.prototype.hasOwnProperty, Es = Object.prototype.propertyIsEnumerable, gt = (q2, o2, e18) => o2 in q2 ? ys(q2, o2, { enumerable: true, configurable: true, writable: true, value: e18 }) : q2[o2] = e18, I = (q2, o2) => { for (var e18 in o2 || (o2 = {})) _s.call(o2, e18) && gt(q2, e18, o2[e18]); - if (ut) - for (var e18 of ut(o2)) + if (ut$2) + for (var e18 of ut$2(o2)) Es.call(o2, e18) && gt(q2, e18, o2[e18]); return q2; }, D = (q2, o2) => ws(q2, ms(o2)); @@ -112012,7 +41318,7 @@ class Rs extends M$1 { this.isInitialized(), await this.confirmOnlineStateOrThrow(); const t2 = D(I({}, e18), { requiredNamespaces: e18.requiredNamespaces || {}, optionalNamespaces: e18.optionalNamespaces || {} }); await this.isValidConnect(t2); - const { pairingTopic: s2, requiredNamespaces: i3, optionalNamespaces: r2, sessionProperties: n4, relays: a3 } = t2; + const { pairingTopic: s2, requiredNamespaces: i2, optionalNamespaces: r2, sessionProperties: n5, relays: a3 } = t2; let c2 = s2, h4, p3 = false; try { c2 && (p3 = this.client.core.pairing.pairings.get(c2).active); @@ -112027,7 +41333,7 @@ class Rs extends M$1 { const { message: E2 } = xe$1("NO_MATCHING_KEY", `connect() pairing topic: ${c2}`); throw new Error(E2); } - const d4 = await this.client.core.crypto.generateKeyPair(), l2 = v$1.wc_sessionPropose.req.ttl || cjs$3.FIVE_MINUTES, w2 = ws$1(l2), m3 = I({ requiredNamespaces: i3, optionalNamespaces: r2, relays: a3 ?? [{ protocol: at$1 }], proposer: { publicKey: d4, metadata: this.client.metadata }, expiryTimestamp: w2, pairingTopic: c2 }, n4 && { sessionProperties: n4 }), { reject: y3, resolve: _3, done: R3 } = gs(l2, it); + const d4 = await this.client.core.crypto.generateKeyPair(), l2 = v$1.wc_sessionPropose.req.ttl || cjs$3.FIVE_MINUTES, w2 = ws$1(l2), m3 = I({ requiredNamespaces: i2, optionalNamespaces: r2, relays: a3 ?? [{ protocol: at$1 }], proposer: { publicKey: d4, metadata: this.client.metadata }, expiryTimestamp: w2, pairingTopic: c2 }, n5 && { sessionProperties: n5 }), { reject: y3, resolve: _3, done: R3 } = gs(l2, it); this.events.once(Ms$1("session_connect"), async ({ error: E2, session: S4 }) => { if (E2) y3(E2); @@ -112047,7 +41353,7 @@ class Rs extends M$1 { throw this.client.logger.error("pair() failed"), t2; } }, this.approve = async (e18) => { - var t2, s2, i3; + var t2, s2, i2; const r2 = this.client.core.eventClient.createEvent({ properties: { topic: (t2 = e18 == null ? void 0 : e18.id) == null ? void 0 : t2.toString(), trace: [Cs.session_approve_started] } }); try { this.isInitialized(), await this.confirmOnlineStateOrThrow(); @@ -112064,11 +41370,11 @@ class Rs extends M$1 { } catch (N2) { throw this.client.logger.error("approve() -> isValidApprove() failed"), r2.setError(Ss$1.session_approve_namespace_validation_failure), N2; } - const { id: n4, relayProtocol: a3, namespaces: c2, sessionProperties: h4, sessionConfig: p3 } = e18, d4 = this.client.proposal.get(n4); + const { id: n5, relayProtocol: a3, namespaces: c2, sessionProperties: h4, sessionConfig: p3 } = e18, d4 = this.client.proposal.get(n5); this.client.core.eventClient.deleteEvent({ eventId: r2.eventId }); const { pairingTopic: l2, proposer: w2, requiredNamespaces: m3, optionalNamespaces: y3 } = d4; let _3 = (s2 = this.client.core.eventClient) == null ? void 0 : s2.getEvent({ topic: l2 }); - _3 || (_3 = (i3 = this.client.core.eventClient) == null ? void 0 : i3.createEvent({ type: Cs.session_approve_started, properties: { topic: l2, trace: [Cs.session_approve_started, Cs.session_namespaces_validation_success] } })); + _3 || (_3 = (i2 = this.client.core.eventClient) == null ? void 0 : i2.createEvent({ type: Cs.session_approve_started, properties: { topic: l2, trace: [Cs.session_approve_started, Cs.session_namespaces_validation_success] } })); const R3 = await this.client.core.crypto.generateKeyPair(), V3 = w2.publicKey, E2 = await this.client.core.crypto.generateSharedKey(R3, V3), S4 = I(I({ relay: { protocol: a3 ?? "irn" }, namespaces: c2, controller: { publicKey: R3, metadata: this.client.metadata }, expiry: ws$1(z2) }, h4 && { sessionProperties: h4 }), p3 && { sessionConfig: p3 }), M3 = F$1.relay; _3.addTrace(Cs.subscribing_session_topic); try { @@ -112082,13 +41388,13 @@ class Rs extends M$1 { try { _3.addTrace(Cs.publishing_session_settle), await this.sendRequest({ topic: E2, method: "wc_sessionSettle", params: S4, throwOnFailedPublish: true }).catch((N2) => { throw _3 == null ? void 0 : _3.setError(Ss$1.session_settle_publish_failure), N2; - }), _3.addTrace(Cs.session_settle_publish_success), _3.addTrace(Cs.publishing_session_approve), await this.sendResult({ id: n4, topic: l2, result: { relay: { protocol: a3 ?? "irn" }, responderPublicKey: R3 }, throwOnFailedPublish: true }).catch((N2) => { + }), _3.addTrace(Cs.session_settle_publish_success), _3.addTrace(Cs.publishing_session_approve), await this.sendResult({ id: n5, topic: l2, result: { relay: { protocol: a3 ?? "irn" }, responderPublicKey: R3 }, throwOnFailedPublish: true }).catch((N2) => { throw _3 == null ? void 0 : _3.setError(Ss$1.session_approve_publish_failure), N2; }), _3.addTrace(Cs.session_approve_publish_success); } catch (N2) { throw this.client.logger.error(N2), this.client.session.delete(E2, er$1("USER_DISCONNECTED")), await this.client.core.relayer.unsubscribe(E2), N2; } - return this.client.core.eventClient.deleteEvent({ eventId: _3.eventId }), await this.client.core.pairing.updateMetadata({ topic: l2, metadata: w2.metadata }), await this.client.proposal.delete(n4, er$1("USER_DISCONNECTED")), await this.client.core.pairing.activate({ topic: l2 }), await this.setExpiry(E2, ws$1(z2)), { topic: E2, acknowledged: () => Promise.resolve(this.client.session.get(E2)) }; + return this.client.core.eventClient.deleteEvent({ eventId: _3.eventId }), await this.client.core.pairing.updateMetadata({ topic: l2, metadata: w2.metadata }), await this.client.proposal.delete(n5, er$1("USER_DISCONNECTED")), await this.client.core.pairing.activate({ topic: l2 }), await this.setExpiry(E2, ws$1(z2)), { topic: E2, acknowledged: () => Promise.resolve(this.client.session.get(E2)) }; }, this.reject = async (e18) => { this.isInitialized(), await this.confirmOnlineStateOrThrow(); try { @@ -112097,13 +41403,13 @@ class Rs extends M$1 { throw this.client.logger.error("reject() -> isValidReject() failed"), r2; } const { id: t2, reason: s2 } = e18; - let i3; + let i2; try { - i3 = this.client.proposal.get(t2).pairingTopic; + i2 = this.client.proposal.get(t2).pairingTopic; } catch (r2) { throw this.client.logger.error(`reject() -> proposal.get(${t2}) failed`), r2; } - i3 && (await this.sendError({ id: t2, topic: i3, error: s2, rpcOpts: v$1.wc_sessionPropose.reject }), await this.client.proposal.delete(t2, er$1("USER_DISCONNECTED"))); + i2 && (await this.sendError({ id: t2, topic: i2, error: s2, rpcOpts: v$1.wc_sessionPropose.reject }), await this.client.proposal.delete(t2, er$1("USER_DISCONNECTED"))); }, this.update = async (e18) => { this.isInitialized(), await this.confirmOnlineStateOrThrow(); try { @@ -112111,12 +41417,12 @@ class Rs extends M$1 { } catch (p3) { throw this.client.logger.error("update() -> isValidUpdate() failed"), p3; } - const { topic: t2, namespaces: s2 } = e18, { done: i3, resolve: r2, reject: n4 } = gs(), a3 = payloadId(), c2 = getBigIntRpcId().toString(), h4 = this.client.session.get(t2).namespaces; + const { topic: t2, namespaces: s2 } = e18, { done: i2, resolve: r2, reject: n5 } = gs(), a3 = payloadId(), c2 = getBigIntRpcId().toString(), h4 = this.client.session.get(t2).namespaces; return this.events.once(Ms$1("session_update", a3), ({ error: p3 }) => { - p3 ? n4(p3) : r2(); + p3 ? n5(p3) : r2(); }), await this.client.session.update(t2, { namespaces: s2 }), await this.sendRequest({ topic: t2, method: "wc_sessionUpdate", params: { namespaces: s2 }, throwOnFailedPublish: true, clientRpcId: a3, relayRpcId: c2 }).catch((p3) => { - this.client.logger.error(p3), this.client.session.update(t2, { namespaces: h4 }), n4(p3); - }), { acknowledged: i3 }; + this.client.logger.error(p3), this.client.session.update(t2, { namespaces: h4 }), n5(p3); + }), { acknowledged: i2 }; }, this.extend = async (e18) => { this.isInitialized(), await this.confirmOnlineStateOrThrow(); try { @@ -112124,12 +41430,12 @@ class Rs extends M$1 { } catch (a3) { throw this.client.logger.error("extend() -> isValidExtend() failed"), a3; } - const { topic: t2 } = e18, s2 = payloadId(), { done: i3, resolve: r2, reject: n4 } = gs(); + const { topic: t2 } = e18, s2 = payloadId(), { done: i2, resolve: r2, reject: n5 } = gs(); return this.events.once(Ms$1("session_extend", s2), ({ error: a3 }) => { - a3 ? n4(a3) : r2(); + a3 ? n5(a3) : r2(); }), await this.setExpiry(t2, ws$1(z2)), this.sendRequest({ topic: t2, method: "wc_sessionExtend", params: {}, clientRpcId: s2, throwOnFailedPublish: true }).catch((a3) => { - n4(a3); - }), { acknowledged: i3 }; + n5(a3); + }), { acknowledged: i2 }; }, this.request = async (e18) => { this.isInitialized(); try { @@ -112137,29 +41443,29 @@ class Rs extends M$1 { } catch (w2) { throw this.client.logger.error("request() -> isValidRequest() failed"), w2; } - const { chainId: t2, request: s2, topic: i3, expiry: r2 = v$1.wc_sessionRequest.req.ttl } = e18, n4 = this.client.session.get(i3); - (n4 == null ? void 0 : n4.transportType) === F$1.relay && await this.confirmOnlineStateOrThrow(); + const { chainId: t2, request: s2, topic: i2, expiry: r2 = v$1.wc_sessionRequest.req.ttl } = e18, n5 = this.client.session.get(i2); + (n5 == null ? void 0 : n5.transportType) === F$1.relay && await this.confirmOnlineStateOrThrow(); const a3 = payloadId(), c2 = getBigIntRpcId().toString(), { done: h4, resolve: p3, reject: d4 } = gs(r2, "Request expired. Please try again."); this.events.once(Ms$1("session_request", a3), ({ error: w2, result: m3 }) => { w2 ? d4(w2) : p3(m3); }); - const l2 = this.getAppLinkIfEnabled(n4.peer.metadata, n4.transportType); - return l2 ? (await this.sendRequest({ clientRpcId: a3, relayRpcId: c2, topic: i3, method: "wc_sessionRequest", params: { request: D(I({}, s2), { expiryTimestamp: ws$1(r2) }), chainId: t2 }, expiry: r2, throwOnFailedPublish: true, appLink: l2 }).catch((w2) => d4(w2)), this.client.events.emit("session_request_sent", { topic: i3, request: s2, chainId: t2, id: a3 }), await h4()) : await Promise.all([new Promise(async (w2) => { - await this.sendRequest({ clientRpcId: a3, relayRpcId: c2, topic: i3, method: "wc_sessionRequest", params: { request: D(I({}, s2), { expiryTimestamp: ws$1(r2) }), chainId: t2 }, expiry: r2, throwOnFailedPublish: true }).catch((m3) => d4(m3)), this.client.events.emit("session_request_sent", { topic: i3, request: s2, chainId: t2, id: a3 }), w2(); + const l2 = this.getAppLinkIfEnabled(n5.peer.metadata, n5.transportType); + return l2 ? (await this.sendRequest({ clientRpcId: a3, relayRpcId: c2, topic: i2, method: "wc_sessionRequest", params: { request: D(I({}, s2), { expiryTimestamp: ws$1(r2) }), chainId: t2 }, expiry: r2, throwOnFailedPublish: true, appLink: l2 }).catch((w2) => d4(w2)), this.client.events.emit("session_request_sent", { topic: i2, request: s2, chainId: t2, id: a3 }), await h4()) : await Promise.all([new Promise(async (w2) => { + await this.sendRequest({ clientRpcId: a3, relayRpcId: c2, topic: i2, method: "wc_sessionRequest", params: { request: D(I({}, s2), { expiryTimestamp: ws$1(r2) }), chainId: t2 }, expiry: r2, throwOnFailedPublish: true }).catch((m3) => d4(m3)), this.client.events.emit("session_request_sent", { topic: i2, request: s2, chainId: t2, id: a3 }), w2(); }), new Promise(async (w2) => { var m3; - if (!((m3 = n4.sessionConfig) != null && m3.disableDeepLink)) { + if (!((m3 = n5.sessionConfig) != null && m3.disableDeepLink)) { const y3 = await Ss$2(this.client.core.storage, xe); - await Es$1({ id: a3, topic: i3, wcDeepLink: y3 }); + await Es$1({ id: a3, topic: i2, wcDeepLink: y3 }); } w2(); }), h4()]).then((w2) => w2[2]); }, this.respond = async (e18) => { this.isInitialized(), await this.isValidRespond(e18); - const { topic: t2, response: s2 } = e18, { id: i3 } = s2, r2 = this.client.session.get(t2); + const { topic: t2, response: s2 } = e18, { id: i2 } = s2, r2 = this.client.session.get(t2); r2.transportType === F$1.relay && await this.confirmOnlineStateOrThrow(); - const n4 = this.getAppLinkIfEnabled(r2.peer.metadata, r2.transportType); - isJsonRpcResult(s2) ? await this.sendResult({ id: i3, topic: t2, result: s2.result, throwOnFailedPublish: true, appLink: n4 }) : isJsonRpcError(s2) && await this.sendError({ id: i3, topic: t2, error: s2.error, appLink: n4 }), this.cleanupAfterResponse(e18); + const n5 = this.getAppLinkIfEnabled(r2.peer.metadata, r2.transportType); + isJsonRpcResult(s2) ? await this.sendResult({ id: i2, topic: t2, result: s2.result, throwOnFailedPublish: true, appLink: n5 }) : isJsonRpcError(s2) && await this.sendError({ id: i2, topic: t2, error: s2.error, appLink: n5 }), this.cleanupAfterResponse(e18); }, this.ping = async (e18) => { this.isInitialized(), await this.confirmOnlineStateOrThrow(); try { @@ -112169,16 +41475,16 @@ class Rs extends M$1 { } const { topic: t2 } = e18; if (this.client.session.keys.includes(t2)) { - const s2 = payloadId(), i3 = getBigIntRpcId().toString(), { done: r2, resolve: n4, reject: a3 } = gs(); + const s2 = payloadId(), i2 = getBigIntRpcId().toString(), { done: r2, resolve: n5, reject: a3 } = gs(); this.events.once(Ms$1("session_ping", s2), ({ error: c2 }) => { - c2 ? a3(c2) : n4(); - }), await Promise.all([this.sendRequest({ topic: t2, method: "wc_sessionPing", params: {}, throwOnFailedPublish: true, clientRpcId: s2, relayRpcId: i3 }), r2()]); + c2 ? a3(c2) : n5(); + }), await Promise.all([this.sendRequest({ topic: t2, method: "wc_sessionPing", params: {}, throwOnFailedPublish: true, clientRpcId: s2, relayRpcId: i2 }), r2()]); } else this.client.core.pairing.pairings.keys.includes(t2) && await this.client.core.pairing.ping({ topic: t2 }); }, this.emit = async (e18) => { this.isInitialized(), await this.confirmOnlineStateOrThrow(), await this.isValidEmit(e18); - const { topic: t2, event: s2, chainId: i3 } = e18, r2 = getBigIntRpcId().toString(); - await this.sendRequest({ topic: t2, method: "wc_sessionEvent", params: { event: s2, chainId: i3 }, throwOnFailedPublish: true, relayRpcId: r2 }); + const { topic: t2, event: s2, chainId: i2 } = e18, r2 = getBigIntRpcId().toString(); + await this.sendRequest({ topic: t2, method: "wc_sessionEvent", params: { event: s2, chainId: i2 }, throwOnFailedPublish: true, relayRpcId: r2 }); }, this.disconnect = async (e18) => { this.isInitialized(), await this.confirmOnlineStateOrThrow(), await this.isValidDisconnect(e18); const { topic: t2 } = e18; @@ -112193,17 +41499,17 @@ class Rs extends M$1 { }, this.find = (e18) => (this.isInitialized(), this.client.session.getAll().filter((t2) => hh(t2, e18))), this.getPendingSessionRequests = () => this.client.pendingRequest.getAll(), this.authenticate = async (e18, t2) => { var s2; this.isInitialized(), this.isValidAuthenticate(e18); - const i3 = t2 && this.client.core.linkModeSupportedApps.includes(t2) && ((s2 = this.client.metadata.redirect) == null ? void 0 : s2.linkMode), r2 = i3 ? F$1.link_mode : F$1.relay; + const i2 = t2 && this.client.core.linkModeSupportedApps.includes(t2) && ((s2 = this.client.metadata.redirect) == null ? void 0 : s2.linkMode), r2 = i2 ? F$1.link_mode : F$1.relay; r2 === F$1.relay && await this.confirmOnlineStateOrThrow(); - const { chains: n4, statement: a3 = "", uri: c2, domain: h4, nonce: p3, type: d4, exp: l2, nbf: w2, methods: m3 = [], expiry: y3 } = e18, _3 = [...e18.resources || []], { topic: R3, uri: V3 } = await this.client.core.pairing.create({ methods: ["wc_sessionAuthenticate"], transportType: r2 }); + const { chains: n5, statement: a3 = "", uri: c2, domain: h4, nonce: p3, type: d4, exp: l2, nbf: w2, methods: m3 = [], expiry: y3 } = e18, _3 = [...e18.resources || []], { topic: R3, uri: V3 } = await this.client.core.pairing.create({ methods: ["wc_sessionAuthenticate"], transportType: r2 }); this.client.logger.info({ message: "Generated new pairing", pairing: { topic: R3, uri: V3 } }); const E2 = await this.client.core.crypto.generateKeyPair(), S4 = Ru(E2); if (await Promise.all([this.client.auth.authKeys.set(ae, { responseTopic: S4, publicKey: E2 }), this.client.auth.pairingTopics.set(S4, { topic: S4, pairingTopic: R3 })]), await this.client.core.relayer.subscribe(S4, { transportType: r2 }), this.client.logger.info(`sending request to new pairing topic: ${R3}`), m3.length > 0) { - const { namespace: O3 } = An(n4[0]); + const { namespace: O3 } = An(n5[0]); let T9 = xu(O3, "request", m3); Vr$1(_3) && (T9 = Mu(T9, _3.pop())), _3.push(T9); } - const M3 = y3 && y3 > v$1.wc_sessionAuthenticate.req.ttl ? y3 : v$1.wc_sessionAuthenticate.req.ttl, W2 = { authPayload: { type: d4 ?? "caip122", chains: n4, statement: a3, aud: c2, domain: h4, version: "1", nonce: p3, iat: (/* @__PURE__ */ new Date()).toISOString(), exp: l2, nbf: w2, resources: _3 }, requester: { publicKey: E2, metadata: this.client.metadata }, expiryTimestamp: ws$1(M3) }, N2 = { eip155: { chains: n4, methods: [.../* @__PURE__ */ new Set(["personal_sign", ...m3])], events: ["chainChanged", "accountsChanged"] } }, De2 = { requiredNamespaces: {}, optionalNamespaces: N2, relays: [{ protocol: "irn" }], pairingTopic: R3, proposer: { publicKey: E2, metadata: this.client.metadata }, expiryTimestamp: ws$1(v$1.wc_sessionPropose.req.ttl) }, { done: wt2, resolve: Ve2, reject: Ee2 } = gs(M3, "Request expired"), ce2 = async ({ error: O3, session: T9 }) => { + const M3 = y3 && y3 > v$1.wc_sessionAuthenticate.req.ttl ? y3 : v$1.wc_sessionAuthenticate.req.ttl, W2 = { authPayload: { type: d4 ?? "caip122", chains: n5, statement: a3, aud: c2, domain: h4, version: "1", nonce: p3, iat: (/* @__PURE__ */ new Date()).toISOString(), exp: l2, nbf: w2, resources: _3 }, requester: { publicKey: E2, metadata: this.client.metadata }, expiryTimestamp: ws$1(M3) }, N2 = { eip155: { chains: n5, methods: [.../* @__PURE__ */ new Set(["personal_sign", ...m3])], events: ["chainChanged", "accountsChanged"] } }, De2 = { requiredNamespaces: {}, optionalNamespaces: N2, relays: [{ protocol: "irn" }], pairingTopic: R3, proposer: { publicKey: E2, metadata: this.client.metadata }, expiryTimestamp: ws$1(v$1.wc_sessionPropose.req.ttl) }, { done: wt2, resolve: Ve2, reject: Ee2 } = gs(M3, "Request expired"), ce2 = async ({ error: O3, session: T9 }) => { if (this.events.off(Ms$1("session_request", G2), Re2), O3) Ee2(O3); else if (T9) { @@ -112236,7 +41542,7 @@ class Rs extends M$1 { this.events.once(Ms$1("session_connect"), ce2), this.events.once(Ms$1("session_request", G2), Re2); let Se2; try { - if (i3) { + if (i2) { const O3 = formatJsonRpcRequest("wc_sessionAuthenticate", W2, G2); this.client.core.history.set(R3, O3); const T9 = await this.client.core.crypto.encode("", O3, { type: Sr$1, encoding: Iu }); @@ -112248,25 +41554,25 @@ class Rs extends M$1 { } return await this.setProposal(Z2, I({ id: Z2 }, De2)), await this.setAuthRequest(G2, { request: D(I({}, W2), { verifyContext: {} }), pairingTopic: R3, transportType: r2 }), { uri: Se2 ?? V3, response: wt2 }; }, this.approveSessionAuthenticate = async (e18) => { - const { id: t2, auths: s2 } = e18, i3 = this.client.core.eventClient.createEvent({ properties: { topic: t2.toString(), trace: [Ps.authenticated_session_approve_started] } }); + const { id: t2, auths: s2 } = e18, i2 = this.client.core.eventClient.createEvent({ properties: { topic: t2.toString(), trace: [Ps.authenticated_session_approve_started] } }); try { this.isInitialized(); } catch (y3) { - throw i3.setError(Rs$1.no_internet_connection), y3; + throw i2.setError(Rs$1.no_internet_connection), y3; } const r2 = this.getPendingAuthRequest(t2); if (!r2) - throw i3.setError(Rs$1.authenticated_session_pending_request_not_found), new Error(`Could not find pending auth request with id ${t2}`); - const n4 = r2.transportType || F$1.relay; - n4 === F$1.relay && await this.confirmOnlineStateOrThrow(); + throw i2.setError(Rs$1.authenticated_session_pending_request_not_found), new Error(`Could not find pending auth request with id ${t2}`); + const n5 = r2.transportType || F$1.relay; + n5 === F$1.relay && await this.confirmOnlineStateOrThrow(); const a3 = r2.requester.publicKey, c2 = await this.client.core.crypto.generateKeyPair(), h4 = Ru(a3), p3 = { type: pr$2, receiverPublicKey: a3, senderPublicKey: c2 }, d4 = [], l2 = []; for (const y3 of s2) { if (!await mu({ cacao: y3, projectId: this.client.core.projectId })) { - i3.setError(Rs$1.invalid_cacao); + i2.setError(Rs$1.invalid_cacao); const S4 = er$1("SESSION_SETTLEMENT_FAILED", "Signature verification failed"); throw await this.sendError({ id: t2, topic: h4, error: S4, encodeOpts: p3 }), new Error(S4.message); } - i3.addTrace(Ps.cacaos_verified); + i2.addTrace(Ps.cacaos_verified); const { p: _3 } = y3, R3 = Vr$1(_3.resources), V3 = [gu(_3.iss)], E2 = Vi(_3.iss); if (R3) { const S4 = Eu(R3), M3 = Su(R3); @@ -112276,32 +41582,32 @@ class Rs extends M$1 { l2.push(`${S4}:${E2}`); } const w2 = await this.client.core.crypto.generateSharedKey(c2, a3); - i3.addTrace(Ps.create_authenticated_session_topic); + i2.addTrace(Ps.create_authenticated_session_topic); let m3; if ((d4 == null ? void 0 : d4.length) > 0) { - m3 = { topic: w2, acknowledged: true, self: { publicKey: c2, metadata: this.client.metadata }, peer: { publicKey: a3, metadata: r2.requester.metadata }, controller: a3, expiry: ws$1(z2), authentication: s2, requiredNamespaces: {}, optionalNamespaces: {}, relay: { protocol: "irn" }, pairingTopic: r2.pairingTopic, namespaces: uh([...new Set(d4)], [...new Set(l2)]), transportType: n4 }, i3.addTrace(Ps.subscribing_authenticated_session_topic); + m3 = { topic: w2, acknowledged: true, self: { publicKey: c2, metadata: this.client.metadata }, peer: { publicKey: a3, metadata: r2.requester.metadata }, controller: a3, expiry: ws$1(z2), authentication: s2, requiredNamespaces: {}, optionalNamespaces: {}, relay: { protocol: "irn" }, pairingTopic: r2.pairingTopic, namespaces: uh([...new Set(d4)], [...new Set(l2)]), transportType: n5 }, i2.addTrace(Ps.subscribing_authenticated_session_topic); try { - await this.client.core.relayer.subscribe(w2, { transportType: n4 }); + await this.client.core.relayer.subscribe(w2, { transportType: n5 }); } catch (y3) { - throw i3.setError(Rs$1.subscribe_authenticated_session_topic_failure), y3; + throw i2.setError(Rs$1.subscribe_authenticated_session_topic_failure), y3; } - i3.addTrace(Ps.subscribe_authenticated_session_topic_success), await this.client.session.set(w2, m3), i3.addTrace(Ps.store_authenticated_session), await this.client.core.pairing.updateMetadata({ topic: r2.pairingTopic, metadata: r2.requester.metadata }); + i2.addTrace(Ps.subscribe_authenticated_session_topic_success), await this.client.session.set(w2, m3), i2.addTrace(Ps.store_authenticated_session), await this.client.core.pairing.updateMetadata({ topic: r2.pairingTopic, metadata: r2.requester.metadata }); } - i3.addTrace(Ps.publishing_authenticated_session_approve); + i2.addTrace(Ps.publishing_authenticated_session_approve); try { - await this.sendResult({ topic: h4, id: t2, result: { cacaos: s2, responder: { publicKey: c2, metadata: this.client.metadata } }, encodeOpts: p3, throwOnFailedPublish: true, appLink: this.getAppLinkIfEnabled(r2.requester.metadata, n4) }); + await this.sendResult({ topic: h4, id: t2, result: { cacaos: s2, responder: { publicKey: c2, metadata: this.client.metadata } }, encodeOpts: p3, throwOnFailedPublish: true, appLink: this.getAppLinkIfEnabled(r2.requester.metadata, n5) }); } catch (y3) { - throw i3.setError(Rs$1.authenticated_session_approve_publish_failure), y3; + throw i2.setError(Rs$1.authenticated_session_approve_publish_failure), y3; } - return await this.client.auth.requests.delete(t2, { message: "fulfilled", code: 0 }), await this.client.core.pairing.activate({ topic: r2.pairingTopic }), this.client.core.eventClient.deleteEvent({ eventId: i3.eventId }), { session: m3 }; + return await this.client.auth.requests.delete(t2, { message: "fulfilled", code: 0 }), await this.client.core.pairing.activate({ topic: r2.pairingTopic }), this.client.core.eventClient.deleteEvent({ eventId: i2.eventId }), { session: m3 }; }, this.rejectSessionAuthenticate = async (e18) => { this.isInitialized(); - const { id: t2, reason: s2 } = e18, i3 = this.getPendingAuthRequest(t2); - if (!i3) + const { id: t2, reason: s2 } = e18, i2 = this.getPendingAuthRequest(t2); + if (!i2) throw new Error(`Could not find pending auth request with id ${t2}`); - i3.transportType === F$1.relay && await this.confirmOnlineStateOrThrow(); - const r2 = i3.requester.publicKey, n4 = await this.client.core.crypto.generateKeyPair(), a3 = Ru(r2), c2 = { type: pr$2, receiverPublicKey: r2, senderPublicKey: n4 }; - await this.sendError({ id: t2, topic: a3, error: s2, encodeOpts: c2, rpcOpts: v$1.wc_sessionAuthenticate.reject, appLink: this.getAppLinkIfEnabled(i3.requester.metadata, i3.transportType) }), await this.client.auth.requests.delete(t2, { message: "rejected", code: 0 }), await this.client.proposal.delete(t2, er$1("USER_DISCONNECTED")); + i2.transportType === F$1.relay && await this.confirmOnlineStateOrThrow(); + const r2 = i2.requester.publicKey, n5 = await this.client.core.crypto.generateKeyPair(), a3 = Ru(r2), c2 = { type: pr$2, receiverPublicKey: r2, senderPublicKey: n5 }; + await this.sendError({ id: t2, topic: a3, error: s2, encodeOpts: c2, rpcOpts: v$1.wc_sessionAuthenticate.reject, appLink: this.getAppLinkIfEnabled(i2.requester.metadata, i2.transportType) }), await this.client.auth.requests.delete(t2, { message: "rejected", code: 0 }), await this.client.proposal.delete(t2, er$1("USER_DISCONNECTED")); }, this.formatAuthMessage = (e18) => { this.isInitialized(); const { request: t2, iss: s2 } = e18; @@ -112320,32 +41626,32 @@ class Rs extends M$1 { }, this.cleanupDuplicatePairings = async (e18) => { if (e18.pairingTopic) try { - const t2 = this.client.core.pairing.pairings.get(e18.pairingTopic), s2 = this.client.core.pairing.pairings.getAll().filter((i3) => { - var r2, n4; - return ((r2 = i3.peerMetadata) == null ? void 0 : r2.url) && ((n4 = i3.peerMetadata) == null ? void 0 : n4.url) === e18.peer.metadata.url && i3.topic && i3.topic !== t2.topic; + const t2 = this.client.core.pairing.pairings.get(e18.pairingTopic), s2 = this.client.core.pairing.pairings.getAll().filter((i2) => { + var r2, n5; + return ((r2 = i2.peerMetadata) == null ? void 0 : r2.url) && ((n5 = i2.peerMetadata) == null ? void 0 : n5.url) === e18.peer.metadata.url && i2.topic && i2.topic !== t2.topic; }); if (s2.length === 0) return; - this.client.logger.info(`Cleaning up ${s2.length} duplicate pairing(s)`), await Promise.all(s2.map((i3) => this.client.core.pairing.disconnect({ topic: i3.topic }))), this.client.logger.info("Duplicate pairings clean up finished"); + this.client.logger.info(`Cleaning up ${s2.length} duplicate pairing(s)`), await Promise.all(s2.map((i2) => this.client.core.pairing.disconnect({ topic: i2.topic }))), this.client.logger.info("Duplicate pairings clean up finished"); } catch (t2) { this.client.logger.error(t2); } }, this.deleteSession = async (e18) => { var t2; - const { topic: s2, expirerHasDeleted: i3 = false, emitEvent: r2 = true, id: n4 = 0 } = e18, { self: a3 } = this.client.session.get(s2); - await this.client.core.relayer.unsubscribe(s2), await this.client.session.delete(s2, er$1("USER_DISCONNECTED")), this.addToRecentlyDeleted(s2, "session"), this.client.core.crypto.keychain.has(a3.publicKey) && await this.client.core.crypto.deleteKeyPair(a3.publicKey), this.client.core.crypto.keychain.has(s2) && await this.client.core.crypto.deleteSymKey(s2), i3 || this.client.core.expirer.del(s2), this.client.core.storage.removeItem(xe).catch((c2) => this.client.logger.warn(c2)), this.getPendingSessionRequests().forEach((c2) => { + const { topic: s2, expirerHasDeleted: i2 = false, emitEvent: r2 = true, id: n5 = 0 } = e18, { self: a3 } = this.client.session.get(s2); + await this.client.core.relayer.unsubscribe(s2), await this.client.session.delete(s2, er$1("USER_DISCONNECTED")), this.addToRecentlyDeleted(s2, "session"), this.client.core.crypto.keychain.has(a3.publicKey) && await this.client.core.crypto.deleteKeyPair(a3.publicKey), this.client.core.crypto.keychain.has(s2) && await this.client.core.crypto.deleteSymKey(s2), i2 || this.client.core.expirer.del(s2), this.client.core.storage.removeItem(xe).catch((c2) => this.client.logger.warn(c2)), this.getPendingSessionRequests().forEach((c2) => { c2.topic === s2 && this.deletePendingSessionRequest(c2.id, er$1("USER_DISCONNECTED")); - }), s2 === ((t2 = this.sessionRequestQueue.queue[0]) == null ? void 0 : t2.topic) && (this.sessionRequestQueue.state = x2.idle), r2 && this.client.events.emit("session_delete", { id: n4, topic: s2 }); + }), s2 === ((t2 = this.sessionRequestQueue.queue[0]) == null ? void 0 : t2.topic) && (this.sessionRequestQueue.state = x2.idle), r2 && this.client.events.emit("session_delete", { id: n5, topic: s2 }); }, this.deleteProposal = async (e18, t2) => { if (t2) try { - const s2 = this.client.proposal.get(e18), i3 = this.client.core.eventClient.getEvent({ topic: s2.pairingTopic }); - i3 == null ? void 0 : i3.setError(Ss$1.proposal_expired); + const s2 = this.client.proposal.get(e18), i2 = this.client.core.eventClient.getEvent({ topic: s2.pairingTopic }); + i2 == null ? void 0 : i2.setError(Ss$1.proposal_expired); } catch { } await Promise.all([this.client.proposal.delete(e18, er$1("USER_DISCONNECTED")), t2 ? Promise.resolve() : this.client.core.expirer.del(e18)]), this.addToRecentlyDeleted(e18, "proposal"); }, this.deletePendingSessionRequest = async (e18, t2, s2 = false) => { - await Promise.all([this.client.pendingRequest.delete(e18, t2), s2 ? Promise.resolve() : this.client.core.expirer.del(e18)]), this.addToRecentlyDeleted(e18, "request"), this.sessionRequestQueue.queue = this.sessionRequestQueue.queue.filter((i3) => i3.id !== e18), s2 && (this.sessionRequestQueue.state = x2.idle, this.client.events.emit("session_request_expire", { id: e18 })); + await Promise.all([this.client.pendingRequest.delete(e18, t2), s2 ? Promise.resolve() : this.client.core.expirer.del(e18)]), this.addToRecentlyDeleted(e18, "request"), this.sessionRequestQueue.queue = this.sessionRequestQueue.queue.filter((i2) => i2.id !== e18), s2 && (this.sessionRequestQueue.state = x2.idle, this.client.events.emit("session_request_expire", { id: e18 })); }, this.deletePendingAuthRequest = async (e18, t2, s2 = false) => { await Promise.all([this.client.auth.requests.delete(e18, t2), s2 ? Promise.resolve() : this.client.core.expirer.del(e18)]); }, this.setExpiry = async (e18, t2) => { @@ -112353,13 +41659,13 @@ class Rs extends M$1 { }, this.setProposal = async (e18, t2) => { this.client.core.expirer.set(e18, ws$1(v$1.wc_sessionPropose.req.ttl)), await this.client.proposal.set(e18, t2); }, this.setAuthRequest = async (e18, t2) => { - const { request: s2, pairingTopic: i3, transportType: r2 = F$1.relay } = t2; - this.client.core.expirer.set(e18, s2.expiryTimestamp), await this.client.auth.requests.set(e18, { authPayload: s2.authPayload, requester: s2.requester, expiryTimestamp: s2.expiryTimestamp, id: e18, pairingTopic: i3, verifyContext: s2.verifyContext, transportType: r2 }); + const { request: s2, pairingTopic: i2, transportType: r2 = F$1.relay } = t2; + this.client.core.expirer.set(e18, s2.expiryTimestamp), await this.client.auth.requests.set(e18, { authPayload: s2.authPayload, requester: s2.requester, expiryTimestamp: s2.expiryTimestamp, id: e18, pairingTopic: i2, verifyContext: s2.verifyContext, transportType: r2 }); }, this.setPendingSessionRequest = async (e18) => { - const { id: t2, topic: s2, params: i3, verifyContext: r2 } = e18, n4 = i3.request.expiryTimestamp || ws$1(v$1.wc_sessionRequest.req.ttl); - this.client.core.expirer.set(t2, n4), await this.client.pendingRequest.set(t2, { id: t2, topic: s2, params: i3, verifyContext: r2 }); + const { id: t2, topic: s2, params: i2, verifyContext: r2 } = e18, n5 = i2.request.expiryTimestamp || ws$1(v$1.wc_sessionRequest.req.ttl); + this.client.core.expirer.set(t2, n5), await this.client.pendingRequest.set(t2, { id: t2, topic: s2, params: i2, verifyContext: r2 }); }, this.sendRequest = async (e18) => { - const { topic: t2, method: s2, params: i3, expiry: r2, relayRpcId: n4, clientRpcId: a3, throwOnFailedPublish: c2, appLink: h4 } = e18, p3 = formatJsonRpcRequest(s2, i3, a3); + const { topic: t2, method: s2, params: i2, expiry: r2, relayRpcId: n5, clientRpcId: a3, throwOnFailedPublish: c2, appLink: h4 } = e18, p3 = formatJsonRpcRequest(s2, i2, a3); let d4; const l2 = !!h4; try { @@ -112374,21 +41680,21 @@ class Rs extends M$1 { w2 = await this.client.core.verify.register({ id: _3, decryptedId: y3 }); } const m3 = v$1[s2].req; - if (m3.attestation = w2, r2 && (m3.ttl = r2), n4 && (m3.id = n4), this.client.core.history.set(t2, p3), l2) { + if (m3.attestation = w2, r2 && (m3.ttl = r2), n5 && (m3.id = n5), this.client.core.history.set(t2, p3), l2) { const y3 = Zu(h4, t2, d4); await global.Linking.openURL(y3, this.client.name); } else { const y3 = v$1[s2].req; - r2 && (y3.ttl = r2), n4 && (y3.id = n4), c2 ? (y3.internal = D(I({}, y3.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(t2, d4, y3)) : this.client.core.relayer.publish(t2, d4, y3).catch((_3) => this.client.logger.error(_3)); + r2 && (y3.ttl = r2), n5 && (y3.id = n5), c2 ? (y3.internal = D(I({}, y3.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(t2, d4, y3)) : this.client.core.relayer.publish(t2, d4, y3).catch((_3) => this.client.logger.error(_3)); } return p3.id; }, this.sendResult = async (e18) => { - const { id: t2, topic: s2, result: i3, throwOnFailedPublish: r2, encodeOpts: n4, appLink: a3 } = e18, c2 = formatJsonRpcResult(t2, i3); + const { id: t2, topic: s2, result: i2, throwOnFailedPublish: r2, encodeOpts: n5, appLink: a3 } = e18, c2 = formatJsonRpcResult(t2, i2); let h4; const p3 = a3 && typeof (global == null ? void 0 : global.Linking) < "u"; try { const l2 = p3 ? Iu : tn$1; - h4 = await this.client.core.crypto.encode(s2, c2, D(I({}, n4 || {}), { encoding: l2 })); + h4 = await this.client.core.crypto.encode(s2, c2, D(I({}, n5 || {}), { encoding: l2 })); } catch (l2) { throw await this.cleanup(), this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s2} failed`), l2; } @@ -112407,7 +41713,7 @@ class Rs extends M$1 { } await this.client.core.history.resolve(c2); }, this.sendError = async (e18) => { - const { id: t2, topic: s2, error: i3, encodeOpts: r2, rpcOpts: n4, appLink: a3 } = e18, c2 = formatJsonRpcError(t2, i3); + const { id: t2, topic: s2, error: i2, encodeOpts: r2, rpcOpts: n5, appLink: a3 } = e18, c2 = formatJsonRpcError(t2, i2); let h4; const p3 = a3 && typeof (global == null ? void 0 : global.Linking) < "u"; try { @@ -112426,15 +41732,15 @@ class Rs extends M$1 { const l2 = Zu(a3, s2, h4); await global.Linking.openURL(l2, this.client.name); } else { - const l2 = n4 || v$1[d4.request.method].res; + const l2 = n5 || v$1[d4.request.method].res; this.client.core.relayer.publish(s2, h4, l2); } await this.client.core.history.resolve(c2); }, this.cleanup = async () => { const e18 = [], t2 = []; this.client.session.getAll().forEach((s2) => { - let i3 = false; - xs$1(s2.expiry) && (i3 = true), this.client.core.crypto.keychain.has(s2.topic) || (i3 = true), i3 && e18.push(s2.topic); + let i2 = false; + xs$1(s2.expiry) && (i2 = true), this.client.core.crypto.keychain.has(s2.topic) || (i2 = true), i2 && e18.push(s2.topic); }), this.client.proposal.getAll().forEach((s2) => { xs$1(s2.expiryTimestamp) && t2.push(s2.id); }), await Promise.all([...e18.map((s2) => this.deleteSession({ topic: s2 })), ...t2.map((s2) => this.deleteProposal(s2))]); @@ -112457,11 +41763,11 @@ class Rs extends M$1 { } this.requestQueue.state = x2.idle; }, this.processRequest = async (e18) => { - const { topic: t2, payload: s2, attestation: i3, transportType: r2, encryptedId: n4 } = e18, a3 = s2.method; + const { topic: t2, payload: s2, attestation: i2, transportType: r2, encryptedId: n5 } = e18, a3 = s2.method; if (!this.shouldIgnorePairingRequest({ topic: t2, requestMethod: a3 })) switch (a3) { case "wc_sessionPropose": - return await this.onSessionProposeRequest({ topic: t2, payload: s2, attestation: i3, encryptedId: n4 }); + return await this.onSessionProposeRequest({ topic: t2, payload: s2, attestation: i2, encryptedId: n5 }); case "wc_sessionSettle": return await this.onSessionSettleRequest(t2, s2); case "wc_sessionUpdate": @@ -112473,19 +41779,19 @@ class Rs extends M$1 { case "wc_sessionDelete": return await this.onSessionDeleteRequest(t2, s2); case "wc_sessionRequest": - return await this.onSessionRequest({ topic: t2, payload: s2, attestation: i3, encryptedId: n4, transportType: r2 }); + return await this.onSessionRequest({ topic: t2, payload: s2, attestation: i2, encryptedId: n5, transportType: r2 }); case "wc_sessionEvent": return await this.onSessionEventRequest(t2, s2); case "wc_sessionAuthenticate": - return await this.onSessionAuthenticateRequest({ topic: t2, payload: s2, attestation: i3, encryptedId: n4, transportType: r2 }); + return await this.onSessionAuthenticateRequest({ topic: t2, payload: s2, attestation: i2, encryptedId: n5, transportType: r2 }); default: return this.client.logger.info(`Unsupported request method ${a3}`); } }, this.onRelayEventResponse = async (e18) => { - const { topic: t2, payload: s2, transportType: i3 } = e18, r2 = (await this.client.core.history.get(t2, s2.id)).request.method; + const { topic: t2, payload: s2, transportType: i2 } = e18, r2 = (await this.client.core.history.get(t2, s2.id)).request.method; switch (r2) { case "wc_sessionPropose": - return this.onSessionProposeResponse(t2, s2, i3); + return this.onSessionProposeResponse(t2, s2, i2); case "wc_sessionSettle": return this.onSessionSettleResponse(t2, s2); case "wc_sessionUpdate": @@ -112505,28 +41811,28 @@ class Rs extends M$1 { const { topic: t2 } = e18, { message: s2 } = xe$1("MISSING_OR_INVALID", `Decoded payload on topic ${t2} is not identifiable as a JSON-RPC request or a response.`); throw new Error(s2); }, this.shouldIgnorePairingRequest = (e18) => { - const { topic: t2, requestMethod: s2 } = e18, i3 = this.expectedPairingMethodMap.get(t2); - return !i3 || i3.includes(s2) ? false : !!(i3.includes("wc_sessionAuthenticate") && this.client.events.listenerCount("session_authenticate") > 0); + const { topic: t2, requestMethod: s2 } = e18, i2 = this.expectedPairingMethodMap.get(t2); + return !i2 || i2.includes(s2) ? false : !!(i2.includes("wc_sessionAuthenticate") && this.client.events.listenerCount("session_authenticate") > 0); }, this.onSessionProposeRequest = async (e18) => { - const { topic: t2, payload: s2, attestation: i3, encryptedId: r2 } = e18, { params: n4, id: a3 } = s2; + const { topic: t2, payload: s2, attestation: i2, encryptedId: r2 } = e18, { params: n5, id: a3 } = s2; try { const c2 = this.client.core.eventClient.getEvent({ topic: t2 }); this.isValidConnect(I({}, s2.params)); - const h4 = n4.expiryTimestamp || ws$1(v$1.wc_sessionPropose.req.ttl), p3 = I({ id: a3, pairingTopic: t2, expiryTimestamp: h4 }, n4); + const h4 = n5.expiryTimestamp || ws$1(v$1.wc_sessionPropose.req.ttl), p3 = I({ id: a3, pairingTopic: t2, expiryTimestamp: h4 }, n5); await this.setProposal(a3, p3); - const d4 = await this.getVerifyContext({ attestationId: i3, hash: Ou(JSON.stringify(s2)), encryptedId: r2, metadata: p3.proposer.metadata }); + const d4 = await this.getVerifyContext({ attestationId: i2, hash: Ou(JSON.stringify(s2)), encryptedId: r2, metadata: p3.proposer.metadata }); this.client.events.listenerCount("session_proposal") === 0 && (console.warn("No listener for session_proposal event"), c2 == null ? void 0 : c2.setError(M2.proposal_listener_not_found)), c2 == null ? void 0 : c2.addTrace(z$1.emit_session_proposal), this.client.events.emit("session_proposal", { id: a3, params: p3, verifyContext: d4 }); } catch (c2) { await this.sendError({ id: a3, topic: t2, error: c2, rpcOpts: v$1.wc_sessionPropose.autoReject }), this.client.logger.error(c2); } }, this.onSessionProposeResponse = async (e18, t2, s2) => { - const { id: i3 } = t2; + const { id: i2 } = t2; if (isJsonRpcResult(t2)) { const { result: r2 } = t2; this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", result: r2 }); - const n4 = this.client.proposal.get(i3); - this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", proposal: n4 }); - const a3 = n4.proposer.publicKey; + const n5 = this.client.proposal.get(i2); + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", proposal: n5 }); + const a3 = n5.proposer.publicKey; this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", selfPublicKey: a3 }); const c2 = r2.responderPublicKey; this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", peerPublicKey: c2 }); @@ -112535,17 +41841,17 @@ class Rs extends M$1 { const p3 = await this.client.core.relayer.subscribe(h4, { transportType: s2 }); this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", subscriptionId: p3 }), await this.client.core.pairing.activate({ topic: e18 }); } else if (isJsonRpcError(t2)) { - await this.client.proposal.delete(i3, er$1("USER_DISCONNECTED")); + await this.client.proposal.delete(i2, er$1("USER_DISCONNECTED")); const r2 = Ms$1("session_connect"); if (this.events.listenerCount(r2) === 0) throw new Error(`emitting ${r2} without any listeners, 954`); this.events.emit(Ms$1("session_connect"), { error: t2.error }); } }, this.onSessionSettleRequest = async (e18, t2) => { - const { id: s2, params: i3 } = t2; + const { id: s2, params: i2 } = t2; try { - this.isValidSessionSettleRequest(i3); - const { relay: r2, controller: n4, expiry: a3, namespaces: c2, sessionProperties: h4, sessionConfig: p3 } = t2.params, d4 = D(I(I({ topic: e18, relay: r2, expiry: a3, namespaces: c2, acknowledged: true, pairingTopic: "", requiredNamespaces: {}, optionalNamespaces: {}, controller: n4.publicKey, self: { publicKey: "", metadata: this.client.metadata }, peer: { publicKey: n4.publicKey, metadata: n4.metadata } }, h4 && { sessionProperties: h4 }), p3 && { sessionConfig: p3 }), { transportType: F$1.relay }), l2 = Ms$1("session_connect"); + this.isValidSessionSettleRequest(i2); + const { relay: r2, controller: n5, expiry: a3, namespaces: c2, sessionProperties: h4, sessionConfig: p3 } = t2.params, d4 = D(I(I({ topic: e18, relay: r2, expiry: a3, namespaces: c2, acknowledged: true, pairingTopic: "", requiredNamespaces: {}, optionalNamespaces: {}, controller: n5.publicKey, self: { publicKey: "", metadata: this.client.metadata }, peer: { publicKey: n5.publicKey, metadata: n5.metadata } }, h4 && { sessionProperties: h4 }), p3 && { sessionConfig: p3 }), { transportType: F$1.relay }), l2 = Ms$1("session_connect"); if (this.events.listenerCount(l2) === 0) throw new Error(`emitting ${l2} without any listeners 997`); this.events.emit(Ms$1("session_connect"), { session: d4 }), await this.sendResult({ id: t2.id, topic: e18, result: true, throwOnFailedPublish: true }); @@ -112556,89 +41862,89 @@ class Rs extends M$1 { const { id: s2 } = t2; isJsonRpcResult(t2) ? (await this.client.session.update(e18, { acknowledged: true }), this.events.emit(Ms$1("session_approve", s2), {})) : isJsonRpcError(t2) && (await this.client.session.delete(e18, er$1("USER_DISCONNECTED")), this.events.emit(Ms$1("session_approve", s2), { error: t2.error })); }, this.onSessionUpdateRequest = async (e18, t2) => { - const { params: s2, id: i3 } = t2; + const { params: s2, id: i2 } = t2; try { - const r2 = `${e18}_session_update`, n4 = Rh.get(r2); - if (n4 && this.isRequestOutOfSync(n4, i3)) { - this.client.logger.info(`Discarding out of sync request - ${i3}`), this.sendError({ id: i3, topic: e18, error: er$1("INVALID_UPDATE_REQUEST") }); + const r2 = `${e18}_session_update`, n5 = Rh.get(r2); + if (n5 && this.isRequestOutOfSync(n5, i2)) { + this.client.logger.info(`Discarding out of sync request - ${i2}`), this.sendError({ id: i2, topic: e18, error: er$1("INVALID_UPDATE_REQUEST") }); return; } this.isValidUpdate(I({ topic: e18 }, s2)); try { - Rh.set(r2, i3), await this.client.session.update(e18, { namespaces: s2.namespaces }), await this.sendResult({ id: i3, topic: e18, result: true, throwOnFailedPublish: true }); + Rh.set(r2, i2), await this.client.session.update(e18, { namespaces: s2.namespaces }), await this.sendResult({ id: i2, topic: e18, result: true, throwOnFailedPublish: true }); } catch (a3) { throw Rh.delete(r2), a3; } - this.client.events.emit("session_update", { id: i3, topic: e18, params: s2 }); + this.client.events.emit("session_update", { id: i2, topic: e18, params: s2 }); } catch (r2) { - await this.sendError({ id: i3, topic: e18, error: r2 }), this.client.logger.error(r2); + await this.sendError({ id: i2, topic: e18, error: r2 }), this.client.logger.error(r2); } }, this.isRequestOutOfSync = (e18, t2) => parseInt(t2.toString().slice(0, -3)) <= parseInt(e18.toString().slice(0, -3)), this.onSessionUpdateResponse = (e18, t2) => { - const { id: s2 } = t2, i3 = Ms$1("session_update", s2); - if (this.events.listenerCount(i3) === 0) - throw new Error(`emitting ${i3} without any listeners`); + const { id: s2 } = t2, i2 = Ms$1("session_update", s2); + if (this.events.listenerCount(i2) === 0) + throw new Error(`emitting ${i2} without any listeners`); isJsonRpcResult(t2) ? this.events.emit(Ms$1("session_update", s2), {}) : isJsonRpcError(t2) && this.events.emit(Ms$1("session_update", s2), { error: t2.error }); }, this.onSessionExtendRequest = async (e18, t2) => { const { id: s2 } = t2; try { this.isValidExtend({ topic: e18 }), await this.setExpiry(e18, ws$1(z2)), await this.sendResult({ id: s2, topic: e18, result: true, throwOnFailedPublish: true }), this.client.events.emit("session_extend", { id: s2, topic: e18 }); - } catch (i3) { - await this.sendError({ id: s2, topic: e18, error: i3 }), this.client.logger.error(i3); + } catch (i2) { + await this.sendError({ id: s2, topic: e18, error: i2 }), this.client.logger.error(i2); } }, this.onSessionExtendResponse = (e18, t2) => { - const { id: s2 } = t2, i3 = Ms$1("session_extend", s2); - if (this.events.listenerCount(i3) === 0) - throw new Error(`emitting ${i3} without any listeners`); + const { id: s2 } = t2, i2 = Ms$1("session_extend", s2); + if (this.events.listenerCount(i2) === 0) + throw new Error(`emitting ${i2} without any listeners`); isJsonRpcResult(t2) ? this.events.emit(Ms$1("session_extend", s2), {}) : isJsonRpcError(t2) && this.events.emit(Ms$1("session_extend", s2), { error: t2.error }); }, this.onSessionPingRequest = async (e18, t2) => { const { id: s2 } = t2; try { this.isValidPing({ topic: e18 }), await this.sendResult({ id: s2, topic: e18, result: true, throwOnFailedPublish: true }), this.client.events.emit("session_ping", { id: s2, topic: e18 }); - } catch (i3) { - await this.sendError({ id: s2, topic: e18, error: i3 }), this.client.logger.error(i3); + } catch (i2) { + await this.sendError({ id: s2, topic: e18, error: i2 }), this.client.logger.error(i2); } }, this.onSessionPingResponse = (e18, t2) => { - const { id: s2 } = t2, i3 = Ms$1("session_ping", s2); - if (this.events.listenerCount(i3) === 0) - throw new Error(`emitting ${i3} without any listeners`); + const { id: s2 } = t2, i2 = Ms$1("session_ping", s2); + if (this.events.listenerCount(i2) === 0) + throw new Error(`emitting ${i2} without any listeners`); setTimeout(() => { isJsonRpcResult(t2) ? this.events.emit(Ms$1("session_ping", s2), {}) : isJsonRpcError(t2) && this.events.emit(Ms$1("session_ping", s2), { error: t2.error }); }, 500); }, this.onSessionDeleteRequest = async (e18, t2) => { const { id: s2 } = t2; try { - this.isValidDisconnect({ topic: e18, reason: t2.params }), Promise.all([new Promise((i3) => { + this.isValidDisconnect({ topic: e18, reason: t2.params }), Promise.all([new Promise((i2) => { this.client.core.relayer.once(w$1.publish, async () => { - i3(await this.deleteSession({ topic: e18, id: s2 })); + i2(await this.deleteSession({ topic: e18, id: s2 })); }); - }), this.sendResult({ id: s2, topic: e18, result: true, throwOnFailedPublish: true }), this.cleanupPendingSentRequestsForTopic({ topic: e18, error: er$1("USER_DISCONNECTED") })]).catch((i3) => this.client.logger.error(i3)); - } catch (i3) { - this.client.logger.error(i3); + }), this.sendResult({ id: s2, topic: e18, result: true, throwOnFailedPublish: true }), this.cleanupPendingSentRequestsForTopic({ topic: e18, error: er$1("USER_DISCONNECTED") })]).catch((i2) => this.client.logger.error(i2)); + } catch (i2) { + this.client.logger.error(i2); } }, this.onSessionRequest = async (e18) => { - var t2, s2, i3; - const { topic: r2, payload: n4, attestation: a3, encryptedId: c2, transportType: h4 } = e18, { id: p3, params: d4 } = n4; + var t2, s2, i2; + const { topic: r2, payload: n5, attestation: a3, encryptedId: c2, transportType: h4 } = e18, { id: p3, params: d4 } = n5; try { await this.isValidRequest(I({ topic: r2 }, d4)); const l2 = this.client.session.get(r2), w2 = await this.getVerifyContext({ attestationId: a3, hash: Ou(JSON.stringify(formatJsonRpcRequest("wc_sessionRequest", d4, p3))), encryptedId: c2, metadata: l2.peer.metadata, transportType: h4 }), m3 = { id: p3, topic: r2, params: d4, verifyContext: w2 }; - await this.setPendingSessionRequest(m3), h4 === F$1.link_mode && (t2 = l2.peer.metadata.redirect) != null && t2.universal && this.client.core.addLinkModeSupportedApp((s2 = l2.peer.metadata.redirect) == null ? void 0 : s2.universal), (i3 = this.client.signConfig) != null && i3.disableRequestQueue ? this.emitSessionRequest(m3) : (this.addSessionRequestToSessionRequestQueue(m3), this.processSessionRequestQueue()); + await this.setPendingSessionRequest(m3), h4 === F$1.link_mode && (t2 = l2.peer.metadata.redirect) != null && t2.universal && this.client.core.addLinkModeSupportedApp((s2 = l2.peer.metadata.redirect) == null ? void 0 : s2.universal), (i2 = this.client.signConfig) != null && i2.disableRequestQueue ? this.emitSessionRequest(m3) : (this.addSessionRequestToSessionRequestQueue(m3), this.processSessionRequestQueue()); } catch (l2) { await this.sendError({ id: p3, topic: r2, error: l2 }), this.client.logger.error(l2); } }, this.onSessionRequestResponse = (e18, t2) => { - const { id: s2 } = t2, i3 = Ms$1("session_request", s2); - if (this.events.listenerCount(i3) === 0) - throw new Error(`emitting ${i3} without any listeners`); + const { id: s2 } = t2, i2 = Ms$1("session_request", s2); + if (this.events.listenerCount(i2) === 0) + throw new Error(`emitting ${i2} without any listeners`); isJsonRpcResult(t2) ? this.events.emit(Ms$1("session_request", s2), { result: t2.result }) : isJsonRpcError(t2) && this.events.emit(Ms$1("session_request", s2), { error: t2.error }); }, this.onSessionEventRequest = async (e18, t2) => { - const { id: s2, params: i3 } = t2; + const { id: s2, params: i2 } = t2; try { - const r2 = `${e18}_session_event_${i3.event.name}`, n4 = Rh.get(r2); - if (n4 && this.isRequestOutOfSync(n4, s2)) { + const r2 = `${e18}_session_event_${i2.event.name}`, n5 = Rh.get(r2); + if (n5 && this.isRequestOutOfSync(n5, s2)) { this.client.logger.info(`Discarding out of sync request - ${s2}`); return; } - this.isValidEmit(I({ topic: e18 }, i3)), this.client.events.emit("session_event", { id: s2, topic: e18, params: i3 }), Rh.set(r2, s2); + this.isValidEmit(I({ topic: e18 }, i2)), this.client.events.emit("session_event", { id: s2, topic: e18, params: i2 }), Rh.set(r2, s2); } catch (r2) { await this.sendError({ id: s2, topic: e18, error: r2 }), this.client.logger.error(r2); } @@ -112647,14 +41953,14 @@ class Rs extends M$1 { this.client.logger.trace({ type: "method", method: "onSessionAuthenticateResponse", topic: e18, payload: t2 }), isJsonRpcResult(t2) ? this.events.emit(Ms$1("session_request", s2), { result: t2.result }) : isJsonRpcError(t2) && this.events.emit(Ms$1("session_request", s2), { error: t2.error }); }, this.onSessionAuthenticateRequest = async (e18) => { var t2; - const { topic: s2, payload: i3, attestation: r2, encryptedId: n4, transportType: a3 } = e18; + const { topic: s2, payload: i2, attestation: r2, encryptedId: n5, transportType: a3 } = e18; try { - const { requester: c2, authPayload: h4, expiryTimestamp: p3 } = i3.params, d4 = await this.getVerifyContext({ attestationId: r2, hash: Ou(JSON.stringify(i3)), encryptedId: n4, metadata: c2.metadata, transportType: a3 }), l2 = { requester: c2, pairingTopic: s2, id: i3.id, authPayload: h4, verifyContext: d4, expiryTimestamp: p3 }; - await this.setAuthRequest(i3.id, { request: l2, pairingTopic: s2, transportType: a3 }), a3 === F$1.link_mode && (t2 = c2.metadata.redirect) != null && t2.universal && this.client.core.addLinkModeSupportedApp(c2.metadata.redirect.universal), this.client.events.emit("session_authenticate", { topic: s2, params: i3.params, id: i3.id, verifyContext: d4 }); + const { requester: c2, authPayload: h4, expiryTimestamp: p3 } = i2.params, d4 = await this.getVerifyContext({ attestationId: r2, hash: Ou(JSON.stringify(i2)), encryptedId: n5, metadata: c2.metadata, transportType: a3 }), l2 = { requester: c2, pairingTopic: s2, id: i2.id, authPayload: h4, verifyContext: d4, expiryTimestamp: p3 }; + await this.setAuthRequest(i2.id, { request: l2, pairingTopic: s2, transportType: a3 }), a3 === F$1.link_mode && (t2 = c2.metadata.redirect) != null && t2.universal && this.client.core.addLinkModeSupportedApp(c2.metadata.redirect.universal), this.client.events.emit("session_authenticate", { topic: s2, params: i2.params, id: i2.id, verifyContext: d4 }); } catch (c2) { this.client.logger.error(c2); - const h4 = i3.params.requester.publicKey, p3 = await this.client.core.crypto.generateKeyPair(), d4 = this.getAppLinkIfEnabled(i3.params.requester.metadata, a3), l2 = { type: pr$2, receiverPublicKey: h4, senderPublicKey: p3 }; - await this.sendError({ id: i3.id, topic: s2, error: c2, encodeOpts: l2, rpcOpts: v$1.wc_sessionAuthenticate.autoReject, appLink: d4 }); + const h4 = i2.params.requester.publicKey, p3 = await this.client.core.crypto.generateKeyPair(), d4 = this.getAppLinkIfEnabled(i2.params.requester.metadata, a3), l2 = { type: pr$2, receiverPublicKey: h4, senderPublicKey: p3 }; + await this.sendError({ id: i2.id, topic: s2, error: c2, encodeOpts: l2, rpcOpts: v$1.wc_sessionAuthenticate.autoReject, appLink: d4 }); } }, this.addSessionRequestToSessionRequestQueue = (e18) => { this.sessionRequestQueue.queue.push(e18); @@ -112664,11 +41970,11 @@ class Rs extends M$1 { }, cjs$3.toMiliseconds(this.requestQueueDelay)); }, this.cleanupPendingSentRequestsForTopic = ({ topic: e18, error: t2 }) => { const s2 = this.client.core.history.pending; - s2.length > 0 && s2.filter((i3) => i3.topic === e18 && i3.request.method === "wc_sessionRequest").forEach((i3) => { - const r2 = i3.request.id, n4 = Ms$1("session_request", r2); - if (this.events.listenerCount(n4) === 0) - throw new Error(`emitting ${n4} without any listeners`); - this.events.emit(Ms$1("session_request", i3.request.id), { error: t2 }); + s2.length > 0 && s2.filter((i2) => i2.topic === e18 && i2.request.method === "wc_sessionRequest").forEach((i2) => { + const r2 = i2.request.id, n5 = Ms$1("session_request", r2); + if (this.events.listenerCount(n5) === 0) + throw new Error(`emitting ${n5} without any listeners`); + this.events.emit(Ms$1("session_request", i2.request.id), { error: t2 }); }); }, this.processSessionRequestQueue = () => { if (this.sessionRequestQueue.state === x2.active) { @@ -112697,12 +42003,12 @@ class Rs extends M$1 { const { message: a3 } = xe$1("MISSING_OR_INVALID", `connect() params: ${JSON.stringify(e18)}`); throw new Error(a3); } - const { pairingTopic: t2, requiredNamespaces: s2, optionalNamespaces: i3, sessionProperties: r2, relays: n4 } = e18; - if (Pe(t2) || await this.isValidPairingTopic(t2), !gh(n4, true)) { - const { message: a3 } = xe$1("MISSING_OR_INVALID", `connect() relays: ${n4}`); + const { pairingTopic: t2, requiredNamespaces: s2, optionalNamespaces: i2, sessionProperties: r2, relays: n5 } = e18; + if (Pe(t2) || await this.isValidPairingTopic(t2), !gh(n5, true)) { + const { message: a3 } = xe$1("MISSING_OR_INVALID", `connect() relays: ${n5}`); throw new Error(a3); } - !Pe(s2) && Xr$1(s2) !== 0 && this.validateNamespaces(s2, "requiredNamespaces"), !Pe(i3) && Xr$1(i3) !== 0 && this.validateNamespaces(i3, "optionalNamespaces"), Pe(r2) || this.validateSessionProps(r2, "sessionProperties"); + !Pe(s2) && Xr$1(s2) !== 0 && this.validateNamespaces(s2, "requiredNamespaces"), !Pe(i2) && Xr$1(i2) !== 0 && this.validateNamespaces(i2, "optionalNamespaces"), Pe(r2) || this.validateSessionProps(r2, "sessionProperties"); }, this.validateNamespaces = (e18, t2) => { const s2 = vh(e18, "connect()", t2); if (s2) @@ -112710,43 +42016,43 @@ class Rs extends M$1 { }, this.isValidApprove = async (e18) => { if (!Ah(e18)) throw new Error(xe$1("MISSING_OR_INVALID", `approve() params: ${e18}`).message); - const { id: t2, namespaces: s2, relayProtocol: i3, sessionProperties: r2 } = e18; + const { id: t2, namespaces: s2, relayProtocol: i2, sessionProperties: r2 } = e18; this.checkRecentlyDeleted(t2), await this.isValidProposalId(t2); - const n4 = this.client.proposal.get(t2), a3 = Oo(s2, "approve()"); + const n5 = this.client.proposal.get(t2), a3 = Oo(s2, "approve()"); if (a3) throw new Error(a3.message); - const c2 = To(n4.requiredNamespaces, s2, "approve()"); + const c2 = To(n5.requiredNamespaces, s2, "approve()"); if (c2) throw new Error(c2.message); - if (!Yt$1(i3, true)) { - const { message: h4 } = xe$1("MISSING_OR_INVALID", `approve() relayProtocol: ${i3}`); + if (!Yt$1(i2, true)) { + const { message: h4 } = xe$1("MISSING_OR_INVALID", `approve() relayProtocol: ${i2}`); throw new Error(h4); } Pe(r2) || this.validateSessionProps(r2, "sessionProperties"); }, this.isValidReject = async (e18) => { if (!Ah(e18)) { - const { message: i3 } = xe$1("MISSING_OR_INVALID", `reject() params: ${e18}`); - throw new Error(i3); + const { message: i2 } = xe$1("MISSING_OR_INVALID", `reject() params: ${e18}`); + throw new Error(i2); } const { id: t2, reason: s2 } = e18; if (this.checkRecentlyDeleted(t2), await this.isValidProposalId(t2), !bh(s2)) { - const { message: i3 } = xe$1("MISSING_OR_INVALID", `reject() reason: ${JSON.stringify(s2)}`); - throw new Error(i3); + const { message: i2 } = xe$1("MISSING_OR_INVALID", `reject() reason: ${JSON.stringify(s2)}`); + throw new Error(i2); } }, this.isValidSessionSettleRequest = (e18) => { if (!Ah(e18)) { const { message: c2 } = xe$1("MISSING_OR_INVALID", `onSessionSettleRequest() params: ${e18}`); throw new Error(c2); } - const { relay: t2, controller: s2, namespaces: i3, expiry: r2 } = e18; + const { relay: t2, controller: s2, namespaces: i2, expiry: r2 } = e18; if (!Po(t2)) { const { message: c2 } = xe$1("MISSING_OR_INVALID", "onSessionSettleRequest() relay protocol should be a string"); throw new Error(c2); } - const n4 = ph(s2, "onSessionSettleRequest()"); - if (n4) - throw new Error(n4.message); - const a3 = Oo(i3, "onSessionSettleRequest()"); + const n5 = ph(s2, "onSessionSettleRequest()"); + if (n5) + throw new Error(n5.message); + const a3 = Oo(i2, "onSessionSettleRequest()"); if (a3) throw new Error(a3.message); if (xs$1(r2)) { @@ -112760,12 +42066,12 @@ class Rs extends M$1 { } const { topic: t2, namespaces: s2 } = e18; this.checkRecentlyDeleted(t2), await this.isValidSessionTopic(t2); - const i3 = this.client.session.get(t2), r2 = Oo(s2, "update()"); + const i2 = this.client.session.get(t2), r2 = Oo(s2, "update()"); if (r2) throw new Error(r2.message); - const n4 = To(i3.requiredNamespaces, s2, "update()"); - if (n4) - throw new Error(n4.message); + const n5 = To(i2.requiredNamespaces, s2, "update()"); + if (n5) + throw new Error(n5.message); }, this.isValidExtend = async (e18) => { if (!Ah(e18)) { const { message: s2 } = xe$1("MISSING_OR_INVALID", `extend() params: ${e18}`); @@ -112778,18 +42084,18 @@ class Rs extends M$1 { const { message: a3 } = xe$1("MISSING_OR_INVALID", `request() params: ${e18}`); throw new Error(a3); } - const { topic: t2, request: s2, chainId: i3, expiry: r2 } = e18; + const { topic: t2, request: s2, chainId: i2, expiry: r2 } = e18; this.checkRecentlyDeleted(t2), await this.isValidSessionTopic(t2); - const { namespaces: n4 } = this.client.session.get(t2); - if (!Mh(n4, i3)) { - const { message: a3 } = xe$1("MISSING_OR_INVALID", `request() chainId: ${i3}`); + const { namespaces: n5 } = this.client.session.get(t2); + if (!Mh(n5, i2)) { + const { message: a3 } = xe$1("MISSING_OR_INVALID", `request() chainId: ${i2}`); throw new Error(a3); } if (!yh(s2)) { const { message: a3 } = xe$1("MISSING_OR_INVALID", `request() ${JSON.stringify(s2)}`); throw new Error(a3); } - if (!Eh(n4, i3, s2.method)) { + if (!Eh(n5, i2, s2.method)) { const { message: a3 } = xe$1("MISSING_OR_INVALID", `request() method: ${s2.method}`); throw new Error(a3); } @@ -112803,14 +42109,14 @@ class Rs extends M$1 { const { message: r2 } = xe$1("MISSING_OR_INVALID", `respond() params: ${e18}`); throw new Error(r2); } - const { topic: s2, response: i3 } = e18; + const { topic: s2, response: i2 } = e18; try { await this.isValidSessionTopic(s2); } catch (r2) { throw (t2 = e18 == null ? void 0 : e18.response) != null && t2.id && this.cleanupAfterResponse(e18), r2; } - if (!wh(i3)) { - const { message: r2 } = xe$1("MISSING_OR_INVALID", `respond() response: ${JSON.stringify(i3)}`); + if (!wh(i2)) { + const { message: r2 } = xe$1("MISSING_OR_INVALID", `respond() response: ${JSON.stringify(i2)}`); throw new Error(r2); } }, this.isValidPing = async (e18) => { @@ -112822,23 +42128,23 @@ class Rs extends M$1 { await this.isValidSessionOrPairingTopic(t2); }, this.isValidEmit = async (e18) => { if (!Ah(e18)) { - const { message: n4 } = xe$1("MISSING_OR_INVALID", `emit() params: ${e18}`); - throw new Error(n4); + const { message: n5 } = xe$1("MISSING_OR_INVALID", `emit() params: ${e18}`); + throw new Error(n5); } - const { topic: t2, event: s2, chainId: i3 } = e18; + const { topic: t2, event: s2, chainId: i2 } = e18; await this.isValidSessionTopic(t2); const { namespaces: r2 } = this.client.session.get(t2); - if (!Mh(r2, i3)) { - const { message: n4 } = xe$1("MISSING_OR_INVALID", `emit() chainId: ${i3}`); - throw new Error(n4); + if (!Mh(r2, i2)) { + const { message: n5 } = xe$1("MISSING_OR_INVALID", `emit() chainId: ${i2}`); + throw new Error(n5); } if (!xh(s2)) { - const { message: n4 } = xe$1("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(s2)}`); - throw new Error(n4); + const { message: n5 } = xe$1("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(s2)}`); + throw new Error(n5); } - if (!Sh(r2, i3, s2.name)) { - const { message: n4 } = xe$1("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(s2)}`); - throw new Error(n4); + if (!Sh(r2, i2, s2.name)) { + const { message: n5 } = xe$1("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(s2)}`); + throw new Error(n5); } }, this.isValidDisconnect = async (e18) => { if (!Ah(e18)) { @@ -112848,28 +42154,28 @@ class Rs extends M$1 { const { topic: t2 } = e18; await this.isValidSessionOrPairingTopic(t2); }, this.isValidAuthenticate = (e18) => { - const { chains: t2, uri: s2, domain: i3, nonce: r2 } = e18; + const { chains: t2, uri: s2, domain: i2, nonce: r2 } = e18; if (!Array.isArray(t2) || t2.length === 0) throw new Error("chains is required and must be a non-empty array"); if (!Yt$1(s2, false)) throw new Error("uri is required parameter"); - if (!Yt$1(i3, false)) + if (!Yt$1(i2, false)) throw new Error("domain is required parameter"); if (!Yt$1(r2, false)) throw new Error("nonce is required parameter"); if ([...new Set(t2.map((a3) => An(a3).namespace))].length > 1) throw new Error("Multi-namespace requests are not supported. Please request single namespace only."); - const { namespace: n4 } = An(t2[0]); - if (n4 !== "eip155") + const { namespace: n5 } = An(t2[0]); + if (n5 !== "eip155") throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains."); }, this.getVerifyContext = async (e18) => { - const { attestationId: t2, hash: s2, encryptedId: i3, metadata: r2, transportType: n4 } = e18, a3 = { verified: { verifyUrl: r2.verifyUrl || Z, validation: "UNKNOWN", origin: r2.url || "" } }; + const { attestationId: t2, hash: s2, encryptedId: i2, metadata: r2, transportType: n5 } = e18, a3 = { verified: { verifyUrl: r2.verifyUrl || Z, validation: "UNKNOWN", origin: r2.url || "" } }; try { - if (n4 === F$1.link_mode) { - const h4 = this.getAppLinkIfEnabled(r2, n4); + if (n5 === F$1.link_mode) { + const h4 = this.getAppLinkIfEnabled(r2, n5); return a3.verified.validation = h4 && new URL(h4).origin === new URL(r2.url).origin ? "VALID" : "INVALID", a3; } - const c2 = await this.client.core.verify.resolve({ attestationId: t2, hash: s2, encryptedId: i3, verifyUrl: r2.verifyUrl }); + const c2 = await this.client.core.verify.resolve({ attestationId: t2, hash: s2, encryptedId: i2, verifyUrl: r2.verifyUrl }); c2 && (a3.verified.origin = c2.origin, a3.verified.isScam = c2.isScam, a3.verified.validation = c2.origin === new URL(r2.url).origin ? "VALID" : "INVALID"); } catch (c2) { this.client.logger.warn(c2); @@ -112878,8 +42184,8 @@ class Rs extends M$1 { }, this.validateSessionProps = (e18, t2) => { Object.values(e18).forEach((s2) => { if (!Yt$1(s2, false)) { - const { message: i3 } = xe$1("MISSING_OR_INVALID", `${t2} must be in Record format. Received: ${JSON.stringify(s2)}`); - throw new Error(i3); + const { message: i2 } = xe$1("MISSING_OR_INVALID", `${t2} must be in Record format. Received: ${JSON.stringify(s2)}`); + throw new Error(i2); } }); }, this.getPendingAuthRequest = (e18) => { @@ -112888,9 +42194,9 @@ class Rs extends M$1 { }, this.addToRecentlyDeleted = (e18, t2) => { if (this.recentlyDeletedMap.set(e18, t2), this.recentlyDeletedMap.size >= this.recentlyDeletedLimit) { let s2 = 0; - const i3 = this.recentlyDeletedLimit / 2; + const i2 = this.recentlyDeletedLimit / 2; for (const r2 of this.recentlyDeletedMap.keys()) { - if (s2++ >= i3) + if (s2++ >= i2) break; this.recentlyDeletedMap.delete(r2); } @@ -112902,16 +42208,16 @@ class Rs extends M$1 { throw new Error(s2); } }, this.isLinkModeEnabled = (e18, t2) => { - var s2, i3, r2, n4, a3, c2, h4, p3, d4; - return !e18 || t2 !== F$1.link_mode ? false : ((i3 = (s2 = this.client.metadata) == null ? void 0 : s2.redirect) == null ? void 0 : i3.linkMode) === true && ((n4 = (r2 = this.client.metadata) == null ? void 0 : r2.redirect) == null ? void 0 : n4.universal) !== void 0 && ((c2 = (a3 = this.client.metadata) == null ? void 0 : a3.redirect) == null ? void 0 : c2.universal) !== "" && ((h4 = e18 == null ? void 0 : e18.redirect) == null ? void 0 : h4.universal) !== void 0 && ((p3 = e18 == null ? void 0 : e18.redirect) == null ? void 0 : p3.universal) !== "" && ((d4 = e18 == null ? void 0 : e18.redirect) == null ? void 0 : d4.linkMode) === true && this.client.core.linkModeSupportedApps.includes(e18.redirect.universal) && typeof (global == null ? void 0 : global.Linking) < "u"; + var s2, i2, r2, n5, a3, c2, h4, p3, d4; + return !e18 || t2 !== F$1.link_mode ? false : ((i2 = (s2 = this.client.metadata) == null ? void 0 : s2.redirect) == null ? void 0 : i2.linkMode) === true && ((n5 = (r2 = this.client.metadata) == null ? void 0 : r2.redirect) == null ? void 0 : n5.universal) !== void 0 && ((c2 = (a3 = this.client.metadata) == null ? void 0 : a3.redirect) == null ? void 0 : c2.universal) !== "" && ((h4 = e18 == null ? void 0 : e18.redirect) == null ? void 0 : h4.universal) !== void 0 && ((p3 = e18 == null ? void 0 : e18.redirect) == null ? void 0 : p3.universal) !== "" && ((d4 = e18 == null ? void 0 : e18.redirect) == null ? void 0 : d4.linkMode) === true && this.client.core.linkModeSupportedApps.includes(e18.redirect.universal) && typeof (global == null ? void 0 : global.Linking) < "u"; }, this.getAppLinkIfEnabled = (e18, t2) => { var s2; return this.isLinkModeEnabled(e18, t2) ? (s2 = e18 == null ? void 0 : e18.redirect) == null ? void 0 : s2.universal : void 0; }, this.handleLinkModeMessage = ({ url: e18 }) => { if (!e18 || !e18.includes("wc_ev") || !e18.includes("topic")) return; - const t2 = Is$2(e18, "topic") || "", s2 = decodeURIComponent(Is$2(e18, "wc_ev") || ""), i3 = this.client.session.keys.includes(t2); - i3 && this.client.session.update(t2, { transportType: F$1.link_mode }), this.client.core.dispatchEnvelope({ topic: t2, message: s2, sessionExists: i3 }); + const t2 = Is$2(e18, "topic") || "", s2 = decodeURIComponent(Is$2(e18, "wc_ev") || ""), i2 = this.client.session.keys.includes(t2); + i2 && this.client.session.update(t2, { transportType: F$1.link_mode }), this.client.core.dispatchEnvelope({ topic: t2, message: s2, sessionExists: i2 }); }, this.registerLinkModeListeners = async () => { var e18; if (_s$1() || rr$1() && (e18 = this.client.metadata.redirect) != null && e18.linkMode) { @@ -112941,9 +42247,9 @@ class Rs extends M$1 { }); } async onRelayMessage(o2) { - const { topic: e18, message: t2, attestation: s2, transportType: i3 } = o2, { publicKey: r2 } = this.client.auth.authKeys.keys.includes(ae) ? this.client.auth.authKeys.get(ae) : { responseTopic: void 0, publicKey: void 0 }, n4 = await this.client.core.crypto.decode(e18, t2, { receiverPublicKey: r2, encoding: i3 === F$1.link_mode ? Iu : tn$1 }); + const { topic: e18, message: t2, attestation: s2, transportType: i2 } = o2, { publicKey: r2 } = this.client.auth.authKeys.keys.includes(ae) ? this.client.auth.authKeys.get(ae) : { responseTopic: void 0, publicKey: void 0 }, n5 = await this.client.core.crypto.decode(e18, t2, { receiverPublicKey: r2, encoding: i2 === F$1.link_mode ? Iu : tn$1 }); try { - isJsonRpcRequest(n4) ? (this.client.core.history.set(e18, n4), this.onRelayEventRequest({ topic: e18, payload: n4, attestation: s2, transportType: i3, encryptedId: Ou(t2) })) : isJsonRpcResponse(n4) ? (await this.client.core.history.resolve(n4), await this.onRelayEventResponse({ topic: e18, payload: n4, transportType: i3 }), this.client.core.history.delete(e18, n4.id)) : this.onRelayEventUnknownPayload({ topic: e18, payload: n4, transportType: i3 }); + isJsonRpcRequest(n5) ? (this.client.core.history.set(e18, n5), this.onRelayEventRequest({ topic: e18, payload: n5, attestation: s2, transportType: i2, encryptedId: Ou(t2) })) : isJsonRpcResponse(n5) ? (await this.client.core.history.resolve(n5), await this.onRelayEventResponse({ topic: e18, payload: n5, transportType: i2 }), this.client.core.history.delete(e18, n5.id)) : this.onRelayEventUnknownPayload({ topic: e18, payload: n5, transportType: i2 }); } catch (a3) { this.client.logger.error(a3); } @@ -113063,7 +42369,7 @@ class Ts { await this.authKeys.init(), await this.pairingTopics.init(), await this.requests.init(); } } -class _e extends S$1 { +class _e extends S$2 { constructor(o2) { super(o2), this.protocol = be, this.version = Ce, this.name = we.name, this.events = new eventsExports.EventEmitter(), this.on = (t2, s2) => this.events.on(t2, s2), this.once = (t2, s2) => this.events.once(t2, s2), this.off = (t2, s2) => this.events.off(t2, s2), this.removeListener = (t2, s2) => this.events.removeListener(t2, s2), this.removeAllListeners = (t2) => this.events.removeAllListeners(t2), this.connect = async (t2) => { try { @@ -113146,8 +42452,8 @@ class _e extends S$1 { }, this.authenticate = async (t2, s2) => { try { return await this.engine.authenticate(t2, s2); - } catch (i3) { - throw this.logger.error(i3.message), i3; + } catch (i2) { + throw this.logger.error(i2.message), i2; } }, this.formatAuthMessage = (t2) => { try { @@ -113362,8 +42668,8 @@ var browserPonyfill = { exports: {} }; function readArrayBufferAsText(buf) { var view = new Uint8Array(buf); var chars = new Array(view.length); - for (var i3 = 0; i3 < view.length; i3++) { - chars[i3] = String.fromCharCode(view[i3]); + for (var i2 = 0; i2 < view.length; i2++) { + chars[i2] = String.fromCharCode(view[i2]); } return chars.join(""); } @@ -113661,7 +42967,7 @@ var P = Object.defineProperty, w = Object.defineProperties, E = Object.getOwnPro return r2; }, v2 = (r2, t2) => w(r2, E(t2)); const j = { Accept: "application/json", "Content-Type": "application/json" }, T = "POST", d3 = { headers: j, method: T }, g2 = 10; -class f2 { +let f$2 = class f2 { constructor(t2, e18 = false) { if (this.url = t2, this.disableProviderPing = e18, this.events = new eventsExports.EventEmitter(), this.isAvailable = false, this.registering = false, !isHttpUrl(t2)) throw new Error(`Provided URL is not compatible with HTTP connection: ${t2}`); @@ -113707,12 +43013,12 @@ class f2 { throw new Error(`Provided URL is not compatible with HTTP connection: ${t2}`); if (this.registering) { const e18 = this.events.getMaxListeners(); - return (this.events.listenerCount("register_error") >= e18 || this.events.listenerCount("open") >= e18) && this.events.setMaxListeners(e18 + 1), new Promise((s2, i3) => { - this.events.once("register_error", (n4) => { - this.resetMaxListeners(), i3(n4); + return (this.events.listenerCount("register_error") >= e18 || this.events.listenerCount("open") >= e18) && this.events.setMaxListeners(e18 + 1), new Promise((s2, i2) => { + this.events.once("register_error", (n5) => { + this.resetMaxListeners(), i2(n5); }), this.events.once("open", () => { if (this.resetMaxListeners(), typeof this.isAvailable > "u") - return i3(new Error("HTTP connection is missing or invalid")); + return i2(new Error("HTTP connection is missing or invalid")); s2(); }); }); @@ -113742,8 +43048,8 @@ class f2 { this.events.emit("payload", e18); } onError(t2, e18) { - const s2 = this.parseError(e18), i3 = s2.message || s2.toString(), n4 = formatJsonRpcError(t2, i3); - this.events.emit("payload", n4); + const s2 = this.parseError(e18), i2 = s2.message || s2.toString(), n5 = formatJsonRpcError(t2, i2); + this.events.emit("payload", n5); } parseError(t2, e18 = this.url) { return parseConnectionError(t2, e18, "HTTP"); @@ -113751,9 +43057,9 @@ class f2 { resetMaxListeners() { this.events.getMaxListeners() > g2 && this.events.setMaxListeners(g2); } -} +}; const ya = "error", Yg = "wss://relay.walletconnect.org", Zg = "wc", Xg = "universal_provider", Sa = `${Zg}@2:${Xg}:`, Oa = "https://rpc.walletconnect.org/v1/", ze = "generic", Qg = `${Oa}bundler`, Tt = { DEFAULT_CHAIN_CHANGED: "default_chain_changed" }; -var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, qi = { exports: {} }; +var _n = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, qi = { exports: {} }; /** * @license * Lodash @@ -113764,11 +43070,11 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : */ (function(P2, s2) { (function() { - var i3, p3 = "4.17.21", w2 = 200, I2 = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", y3 = "Expected a function", J2 = "Invalid `variable` option passed into `_.template`", Ht2 = "__lodash_hash_undefined__", Ke2 = 500, Ie2 = "__lodash_placeholder__", Dt2 = 1, Bt2 = 2, xe2 = 4, Ee2 = 1, mn2 = 2, vt2 = 1, he2 = 2, Gi2 = 4, Nt2 = 8, ye2 = 16, $t2 = 32, Se2 = 64, Gt2 = 128, Je2 = 256, gr2 = 512, Ma2 = 30, Ba2 = "...", Ga2 = 800, za2 = 16, zi2 = 1, Ka2 = 2, Ja2 = 3, le2 = 1 / 0, ee2 = 9007199254740991, Ya2 = 17976931348623157e292, wn2 = 0 / 0, Ut4 = 4294967295, Za2 = Ut4 - 1, Xa2 = Ut4 >>> 1, Qa2 = [["ary", Gt2], ["bind", vt2], ["bindKey", he2], ["curry", Nt2], ["curryRight", ye2], ["flip", gr2], ["partial", $t2], ["partialRight", Se2], ["rearg", Je2]], Oe2 = "[object Arguments]", Pn2 = "[object Array]", Va2 = "[object AsyncFunction]", Ye2 = "[object Boolean]", Ze2 = "[object Date]", ka2 = "[object DOMException]", Cn2 = "[object Error]", An2 = "[object Function]", Ki2 = "[object GeneratorFunction]", Et2 = "[object Map]", Xe2 = "[object Number]", ja2 = "[object Null]", zt2 = "[object Object]", Ji2 = "[object Promise]", to2 = "[object Proxy]", Qe2 = "[object RegExp]", yt2 = "[object Set]", Ve2 = "[object String]", In2 = "[object Symbol]", eo2 = "[object Undefined]", ke2 = "[object WeakMap]", no2 = "[object WeakSet]", je2 = "[object ArrayBuffer]", Re2 = "[object DataView]", vr3 = "[object Float32Array]", _r4 = "[object Float64Array]", mr2 = "[object Int8Array]", wr2 = "[object Int16Array]", Pr2 = "[object Int32Array]", Cr2 = "[object Uint8Array]", Ar2 = "[object Uint8ClampedArray]", Ir2 = "[object Uint16Array]", xr2 = "[object Uint32Array]", ro2 = /\b__p \+= '';/g, io = /\b(__p \+=) '' \+/g, so2 = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Yi2 = /&(?:amp|lt|gt|quot|#39);/g, Zi2 = /[&<>"']/g, uo2 = RegExp(Yi2.source), ao2 = RegExp(Zi2.source), oo2 = /<%-([\s\S]+?)%>/g, co2 = /<%([\s\S]+?)%>/g, Xi2 = /<%=([\s\S]+?)%>/g, fo = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ho2 = /^\w*$/, lo2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Er2 = /[\\^$.*+?()[\]{}|]/g, po2 = RegExp(Er2.source), yr2 = /^\s+/, go2 = /\s/, vo2 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, _o3 = /\{\n\/\* \[wrapped with (.+)\] \*/, mo = /,? & /, wo2 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, Po2 = /[()=,{}\[\]\/\s]/, Co2 = /\\(\\)?/g, Ao = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Qi2 = /\w*$/, Io2 = /^[-+]0x[0-9a-f]+$/i, xo2 = /^0b[01]+$/i, Eo2 = /^\[object .+?Constructor\]$/, yo2 = /^0o[0-7]+$/i, So2 = /^(?:0|[1-9]\d*)$/, Oo2 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, xn2 = /($^)/, Ro2 = /['\n\r\u2028\u2029\\]/g, En2 = "\\ud800-\\udfff", bo2 = "\\u0300-\\u036f", To2 = "\\ufe20-\\ufe2f", Lo = "\\u20d0-\\u20ff", Vi2 = bo2 + To2 + Lo, ki2 = "\\u2700-\\u27bf", ji2 = "a-z\\xdf-\\xf6\\xf8-\\xff", Ho = "\\xac\\xb1\\xd7\\xf7", Do2 = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", No2 = "\\u2000-\\u206f", $o = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", ts2 = "A-Z\\xc0-\\xd6\\xd8-\\xde", es2 = "\\ufe0e\\ufe0f", ns2 = Ho + Do2 + No2 + $o, Sr2 = "['’]", Uo2 = "[" + En2 + "]", rs2 = "[" + ns2 + "]", yn2 = "[" + Vi2 + "]", is2 = "\\d+", qo2 = "[" + ki2 + "]", ss2 = "[" + ji2 + "]", us2 = "[^" + En2 + ns2 + is2 + ki2 + ji2 + ts2 + "]", Or2 = "\\ud83c[\\udffb-\\udfff]", Fo2 = "(?:" + yn2 + "|" + Or2 + ")", as2 = "[^" + En2 + "]", Rr2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", br2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", be2 = "[" + ts2 + "]", os2 = "\\u200d", cs2 = "(?:" + ss2 + "|" + us2 + ")", Wo2 = "(?:" + be2 + "|" + us2 + ")", fs2 = "(?:" + Sr2 + "(?:d|ll|m|re|s|t|ve))?", hs2 = "(?:" + Sr2 + "(?:D|LL|M|RE|S|T|VE))?", ls2 = Fo2 + "?", ps2 = "[" + es2 + "]?", Mo2 = "(?:" + os2 + "(?:" + [as2, Rr2, br2].join("|") + ")" + ps2 + ls2 + ")*", Bo2 = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", Go = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", ds2 = ps2 + ls2 + Mo2, zo2 = "(?:" + [qo2, Rr2, br2].join("|") + ")" + ds2, Ko2 = "(?:" + [as2 + yn2 + "?", yn2, Rr2, br2, Uo2].join("|") + ")", Jo = RegExp(Sr2, "g"), Yo = RegExp(yn2, "g"), Tr2 = RegExp(Or2 + "(?=" + Or2 + ")|" + Ko2 + ds2, "g"), Zo2 = RegExp([be2 + "?" + ss2 + "+" + fs2 + "(?=" + [rs2, be2, "$"].join("|") + ")", Wo2 + "+" + hs2 + "(?=" + [rs2, be2 + cs2, "$"].join("|") + ")", be2 + "?" + cs2 + "+" + fs2, be2 + "+" + hs2, Go, Bo2, is2, zo2].join("|"), "g"), Xo = RegExp("[" + os2 + En2 + Vi2 + es2 + "]"), Qo = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, Vo = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"], ko2 = -1, G2 = {}; - G2[vr3] = G2[_r4] = G2[mr2] = G2[wr2] = G2[Pr2] = G2[Cr2] = G2[Ar2] = G2[Ir2] = G2[xr2] = true, G2[Oe2] = G2[Pn2] = G2[je2] = G2[Ye2] = G2[Re2] = G2[Ze2] = G2[Cn2] = G2[An2] = G2[Et2] = G2[Xe2] = G2[zt2] = G2[Qe2] = G2[yt2] = G2[Ve2] = G2[ke2] = false; + var i2, p3 = "4.17.21", w2 = 200, I2 = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", y3 = "Expected a function", J2 = "Invalid `variable` option passed into `_.template`", Ht2 = "__lodash_hash_undefined__", Ke2 = 500, Ie2 = "__lodash_placeholder__", Dt2 = 1, Bt2 = 2, xe2 = 4, Ee2 = 1, mn2 = 2, vt2 = 1, he2 = 2, Gi2 = 4, Nt2 = 8, ye2 = 16, $t2 = 32, Se2 = 64, Gt2 = 128, Je2 = 256, gr2 = 512, Ma2 = 30, Ba2 = "...", Ga2 = 800, za2 = 16, zi2 = 1, Ka2 = 2, Ja2 = 3, le2 = 1 / 0, ee2 = 9007199254740991, Ya2 = 17976931348623157e292, wn2 = 0 / 0, Ut4 = 4294967295, Za2 = Ut4 - 1, Xa2 = Ut4 >>> 1, Qa2 = [["ary", Gt2], ["bind", vt2], ["bindKey", he2], ["curry", Nt2], ["curryRight", ye2], ["flip", gr2], ["partial", $t2], ["partialRight", Se2], ["rearg", Je2]], Oe2 = "[object Arguments]", Pn2 = "[object Array]", Va2 = "[object AsyncFunction]", Ye2 = "[object Boolean]", Ze2 = "[object Date]", ka2 = "[object DOMException]", Cn2 = "[object Error]", An2 = "[object Function]", Ki2 = "[object GeneratorFunction]", Et2 = "[object Map]", Xe2 = "[object Number]", ja2 = "[object Null]", zt2 = "[object Object]", Ji2 = "[object Promise]", to2 = "[object Proxy]", Qe2 = "[object RegExp]", yt2 = "[object Set]", Ve2 = "[object String]", In2 = "[object Symbol]", eo2 = "[object Undefined]", ke2 = "[object WeakMap]", no2 = "[object WeakSet]", je2 = "[object ArrayBuffer]", Re2 = "[object DataView]", vr3 = "[object Float32Array]", _r3 = "[object Float64Array]", mr2 = "[object Int8Array]", wr2 = "[object Int16Array]", Pr2 = "[object Int32Array]", Cr2 = "[object Uint8Array]", Ar2 = "[object Uint8ClampedArray]", Ir2 = "[object Uint16Array]", xr2 = "[object Uint32Array]", ro2 = /\b__p \+= '';/g, io = /\b(__p \+=) '' \+/g, so2 = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Yi2 = /&(?:amp|lt|gt|quot|#39);/g, Zi2 = /[&<>"']/g, uo2 = RegExp(Yi2.source), ao2 = RegExp(Zi2.source), oo2 = /<%-([\s\S]+?)%>/g, co2 = /<%([\s\S]+?)%>/g, Xi2 = /<%=([\s\S]+?)%>/g, fo = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ho2 = /^\w*$/, lo2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Er2 = /[\\^$.*+?()[\]{}|]/g, po2 = RegExp(Er2.source), yr2 = /^\s+/, go2 = /\s/, vo2 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, _o3 = /\{\n\/\* \[wrapped with (.+)\] \*/, mo = /,? & /, wo2 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, Po2 = /[()=,{}\[\]\/\s]/, Co2 = /\\(\\)?/g, Ao = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Qi2 = /\w*$/, Io2 = /^[-+]0x[0-9a-f]+$/i, xo2 = /^0b[01]+$/i, Eo2 = /^\[object .+?Constructor\]$/, yo2 = /^0o[0-7]+$/i, So2 = /^(?:0|[1-9]\d*)$/, Oo2 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, xn2 = /($^)/, Ro2 = /['\n\r\u2028\u2029\\]/g, En2 = "\\ud800-\\udfff", bo2 = "\\u0300-\\u036f", To2 = "\\ufe20-\\ufe2f", Lo = "\\u20d0-\\u20ff", Vi2 = bo2 + To2 + Lo, ki2 = "\\u2700-\\u27bf", ji2 = "a-z\\xdf-\\xf6\\xf8-\\xff", Ho = "\\xac\\xb1\\xd7\\xf7", Do2 = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", No2 = "\\u2000-\\u206f", $o = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", ts2 = "A-Z\\xc0-\\xd6\\xd8-\\xde", es2 = "\\ufe0e\\ufe0f", ns2 = Ho + Do2 + No2 + $o, Sr2 = "['’]", Uo2 = "[" + En2 + "]", rs2 = "[" + ns2 + "]", yn2 = "[" + Vi2 + "]", is2 = "\\d+", qo2 = "[" + ki2 + "]", ss2 = "[" + ji2 + "]", us2 = "[^" + En2 + ns2 + is2 + ki2 + ji2 + ts2 + "]", Or2 = "\\ud83c[\\udffb-\\udfff]", Fo2 = "(?:" + yn2 + "|" + Or2 + ")", as2 = "[^" + En2 + "]", Rr2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", br2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", be2 = "[" + ts2 + "]", os2 = "\\u200d", cs2 = "(?:" + ss2 + "|" + us2 + ")", Wo2 = "(?:" + be2 + "|" + us2 + ")", fs2 = "(?:" + Sr2 + "(?:d|ll|m|re|s|t|ve))?", hs2 = "(?:" + Sr2 + "(?:D|LL|M|RE|S|T|VE))?", ls2 = Fo2 + "?", ps2 = "[" + es2 + "]?", Mo2 = "(?:" + os2 + "(?:" + [as2, Rr2, br2].join("|") + ")" + ps2 + ls2 + ")*", Bo2 = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", Go = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", ds2 = ps2 + ls2 + Mo2, zo2 = "(?:" + [qo2, Rr2, br2].join("|") + ")" + ds2, Ko2 = "(?:" + [as2 + yn2 + "?", yn2, Rr2, br2, Uo2].join("|") + ")", Jo = RegExp(Sr2, "g"), Yo = RegExp(yn2, "g"), Tr2 = RegExp(Or2 + "(?=" + Or2 + ")|" + Ko2 + ds2, "g"), Zo2 = RegExp([be2 + "?" + ss2 + "+" + fs2 + "(?=" + [rs2, be2, "$"].join("|") + ")", Wo2 + "+" + hs2 + "(?=" + [rs2, be2 + cs2, "$"].join("|") + ")", be2 + "?" + cs2 + "+" + fs2, be2 + "+" + hs2, Go, Bo2, is2, zo2].join("|"), "g"), Xo = RegExp("[" + os2 + En2 + Vi2 + es2 + "]"), Qo = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, Vo = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"], ko2 = -1, G2 = {}; + G2[vr3] = G2[_r3] = G2[mr2] = G2[wr2] = G2[Pr2] = G2[Cr2] = G2[Ar2] = G2[Ir2] = G2[xr2] = true, G2[Oe2] = G2[Pn2] = G2[je2] = G2[Ye2] = G2[Re2] = G2[Ze2] = G2[Cn2] = G2[An2] = G2[Et2] = G2[Xe2] = G2[zt2] = G2[Qe2] = G2[yt2] = G2[Ve2] = G2[ke2] = false; var B2 = {}; - B2[Oe2] = B2[Pn2] = B2[je2] = B2[Re2] = B2[Ye2] = B2[Ze2] = B2[vr3] = B2[_r4] = B2[mr2] = B2[wr2] = B2[Pr2] = B2[Et2] = B2[Xe2] = B2[zt2] = B2[Qe2] = B2[yt2] = B2[Ve2] = B2[In2] = B2[Cr2] = B2[Ar2] = B2[Ir2] = B2[xr2] = true, B2[Cn2] = B2[An2] = B2[ke2] = false; - var jo = { À: "A", Á: "A", Â: "A", Ã: "A", Ä: "A", Å: "A", à: "a", á: "a", â: "a", ã: "a", ä: "a", å: "a", Ç: "C", ç: "c", Ð: "D", ð: "d", È: "E", É: "E", Ê: "E", Ë: "E", è: "e", é: "e", ê: "e", ë: "e", Ì: "I", Í: "I", Î: "I", Ï: "I", ì: "i", í: "i", î: "i", ï: "i", Ñ: "N", ñ: "n", Ò: "O", Ó: "O", Ô: "O", Õ: "O", Ö: "O", Ø: "O", ò: "o", ó: "o", ô: "o", õ: "o", ö: "o", ø: "o", Ù: "U", Ú: "U", Û: "U", Ü: "U", ù: "u", ú: "u", û: "u", ü: "u", Ý: "Y", ý: "y", ÿ: "y", Æ: "Ae", æ: "ae", Þ: "Th", þ: "th", ß: "ss", Ā: "A", Ă: "A", Ą: "A", ā: "a", ă: "a", ą: "a", Ć: "C", Ĉ: "C", Ċ: "C", Č: "C", ć: "c", ĉ: "c", ċ: "c", č: "c", Ď: "D", Đ: "D", ď: "d", đ: "d", Ē: "E", Ĕ: "E", Ė: "E", Ę: "E", Ě: "E", ē: "e", ĕ: "e", ė: "e", ę: "e", ě: "e", Ĝ: "G", Ğ: "G", Ġ: "G", Ģ: "G", ĝ: "g", ğ: "g", ġ: "g", ģ: "g", Ĥ: "H", Ħ: "H", ĥ: "h", ħ: "h", Ĩ: "I", Ī: "I", Ĭ: "I", Į: "I", İ: "I", ĩ: "i", ī: "i", ĭ: "i", į: "i", ı: "i", Ĵ: "J", ĵ: "j", Ķ: "K", ķ: "k", ĸ: "k", Ĺ: "L", Ļ: "L", Ľ: "L", Ŀ: "L", Ł: "L", ĺ: "l", ļ: "l", ľ: "l", ŀ: "l", ł: "l", Ń: "N", Ņ: "N", Ň: "N", Ŋ: "N", ń: "n", ņ: "n", ň: "n", ŋ: "n", Ō: "O", Ŏ: "O", Ő: "O", ō: "o", ŏ: "o", ő: "o", Ŕ: "R", Ŗ: "R", Ř: "R", ŕ: "r", ŗ: "r", ř: "r", Ś: "S", Ŝ: "S", Ş: "S", Š: "S", ś: "s", ŝ: "s", ş: "s", š: "s", Ţ: "T", Ť: "T", Ŧ: "T", ţ: "t", ť: "t", ŧ: "t", Ũ: "U", Ū: "U", Ŭ: "U", Ů: "U", Ű: "U", Ų: "U", ũ: "u", ū: "u", ŭ: "u", ů: "u", ű: "u", ų: "u", Ŵ: "W", ŵ: "w", Ŷ: "Y", ŷ: "y", Ÿ: "Y", Ź: "Z", Ż: "Z", Ž: "Z", ź: "z", ż: "z", ž: "z", IJ: "IJ", ij: "ij", Œ: "Oe", œ: "oe", ʼn: "'n", ſ: "s" }, tc2 = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ec2 = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }, nc2 = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }, rc2 = parseFloat, ic2 = parseInt, gs2 = typeof _n2 == "object" && _n2 && _n2.Object === Object && _n2, sc2 = typeof self == "object" && self && self.Object === Object && self, j2 = gs2 || sc2 || Function("return this")(), Lr2 = s2 && !s2.nodeType && s2, pe2 = Lr2 && true && P2 && !P2.nodeType && P2, vs2 = pe2 && pe2.exports === Lr2, Hr2 = vs2 && gs2.process, _t2 = function() { + B2[Oe2] = B2[Pn2] = B2[je2] = B2[Re2] = B2[Ye2] = B2[Ze2] = B2[vr3] = B2[_r3] = B2[mr2] = B2[wr2] = B2[Pr2] = B2[Et2] = B2[Xe2] = B2[zt2] = B2[Qe2] = B2[yt2] = B2[Ve2] = B2[In2] = B2[Cr2] = B2[Ar2] = B2[Ir2] = B2[xr2] = true, B2[Cn2] = B2[An2] = B2[ke2] = false; + var jo = { À: "A", Á: "A", Â: "A", Ã: "A", Ä: "A", Å: "A", à: "a", á: "a", â: "a", ã: "a", ä: "a", å: "a", Ç: "C", ç: "c", Ð: "D", ð: "d", È: "E", É: "E", Ê: "E", Ë: "E", è: "e", é: "e", ê: "e", ë: "e", Ì: "I", Í: "I", Î: "I", Ï: "I", ì: "i", í: "i", î: "i", ï: "i", Ñ: "N", ñ: "n", Ò: "O", Ó: "O", Ô: "O", Õ: "O", Ö: "O", Ø: "O", ò: "o", ó: "o", ô: "o", õ: "o", ö: "o", ø: "o", Ù: "U", Ú: "U", Û: "U", Ü: "U", ù: "u", ú: "u", û: "u", ü: "u", Ý: "Y", ý: "y", ÿ: "y", Æ: "Ae", æ: "ae", Þ: "Th", þ: "th", ß: "ss", Ā: "A", Ă: "A", Ą: "A", ā: "a", ă: "a", ą: "a", Ć: "C", Ĉ: "C", Ċ: "C", Č: "C", ć: "c", ĉ: "c", ċ: "c", č: "c", Ď: "D", Đ: "D", ď: "d", đ: "d", Ē: "E", Ĕ: "E", Ė: "E", Ę: "E", Ě: "E", ē: "e", ĕ: "e", ė: "e", ę: "e", ě: "e", Ĝ: "G", Ğ: "G", Ġ: "G", Ģ: "G", ĝ: "g", ğ: "g", ġ: "g", ģ: "g", Ĥ: "H", Ħ: "H", ĥ: "h", ħ: "h", Ĩ: "I", Ī: "I", Ĭ: "I", Į: "I", İ: "I", ĩ: "i", ī: "i", ĭ: "i", į: "i", ı: "i", Ĵ: "J", ĵ: "j", Ķ: "K", ķ: "k", ĸ: "k", Ĺ: "L", Ļ: "L", Ľ: "L", Ŀ: "L", Ł: "L", ĺ: "l", ļ: "l", ľ: "l", ŀ: "l", ł: "l", Ń: "N", Ņ: "N", Ň: "N", Ŋ: "N", ń: "n", ņ: "n", ň: "n", ŋ: "n", Ō: "O", Ŏ: "O", Ő: "O", ō: "o", ŏ: "o", ő: "o", Ŕ: "R", Ŗ: "R", Ř: "R", ŕ: "r", ŗ: "r", ř: "r", Ś: "S", Ŝ: "S", Ş: "S", Š: "S", ś: "s", ŝ: "s", ş: "s", š: "s", Ţ: "T", Ť: "T", Ŧ: "T", ţ: "t", ť: "t", ŧ: "t", Ũ: "U", Ū: "U", Ŭ: "U", Ů: "U", Ű: "U", Ų: "U", ũ: "u", ū: "u", ŭ: "u", ů: "u", ű: "u", ų: "u", Ŵ: "W", ŵ: "w", Ŷ: "Y", ŷ: "y", Ÿ: "Y", Ź: "Z", Ż: "Z", Ž: "Z", ź: "z", ż: "z", ž: "z", IJ: "IJ", ij: "ij", Œ: "Oe", œ: "oe", ʼn: "'n", ſ: "s" }, tc2 = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ec2 = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }, nc2 = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }, rc2 = parseFloat, ic2 = parseInt, gs2 = typeof _n == "object" && _n && _n.Object === Object && _n, sc2 = typeof self == "object" && self && self.Object === Object && self, j2 = gs2 || sc2 || Function("return this")(), Lr2 = s2 && !s2.nodeType && s2, pe2 = Lr2 && true && P2 && !P2.nodeType && P2, vs2 = pe2 && pe2.exports === Lr2, Hr2 = vs2 && gs2.process, _t2 = function() { try { var h4 = pe2 && pe2.require && pe2.require("util").types; return h4 || Hr2 && Hr2.binding && Hr2.binding("util"); @@ -113894,12 +43200,12 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } function Ur2(h4) { return function(g3) { - return g3 == null ? i3 : g3[h4]; + return g3 == null ? i2 : g3[h4]; }; } function qr2(h4) { return function(g3) { - return h4 == null ? i3 : h4[g3]; + return h4 == null ? i2 : h4[g3]; }; } function Ss2(h4, g3, d4, A2, R3) { @@ -113916,7 +43222,7 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Fr2(h4, g3) { for (var d4, A2 = -1, R3 = h4.length; ++A2 < R3; ) { var U5 = g3(h4[A2]); - U5 !== i3 && (d4 = d4 === i3 ? U5 : d4 + U5); + U5 !== i2 && (d4 = d4 === i2 ? U5 : d4 + U5); } return d4; } @@ -113966,7 +43272,7 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return "\\" + nc2[h4]; } function wc2(h4, g3) { - return h4 == null ? i3 : h4[g3]; + return h4 == null ? i2 : h4[g3]; } function Le2(h4) { return Xo.test(h4); @@ -114049,13 +43355,13 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var d4 = g3.Array, A2 = g3.Date, R3 = g3.Error, U5 = g3.Function, Q2 = g3.Math, M3 = g3.Object, Gr2 = g3.RegExp, bc2 = g3.String, wt2 = g3.TypeError, bn2 = d4.prototype, Tc2 = U5.prototype, Ne2 = M3.prototype, Tn2 = g3["__core-js_shared__"], Ln2 = Tc2.toString, W2 = Ne2.hasOwnProperty, Lc2 = 0, Hs2 = function() { var t2 = /[^.]+$/.exec(Tn2 && Tn2.keys && Tn2.keys.IE_PROTO || ""); return t2 ? "Symbol(src)_1." + t2 : ""; - }(), Hn2 = Ne2.toString, Hc2 = Ln2.call(M3), Dc2 = j2._, Nc2 = Gr2("^" + Ln2.call(W2).replace(Er2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Dn2 = vs2 ? g3.Buffer : i3, se2 = g3.Symbol, Nn2 = g3.Uint8Array, Ds2 = Dn2 ? Dn2.allocUnsafe : i3, $n2 = Ts2(M3.getPrototypeOf, M3), Ns2 = M3.create, $s2 = Ne2.propertyIsEnumerable, Un2 = bn2.splice, Us2 = se2 ? se2.isConcatSpreadable : i3, en2 = se2 ? se2.iterator : i3, de2 = se2 ? se2.toStringTag : i3, qn2 = function() { + }(), Hn2 = Ne2.toString, Hc2 = Ln2.call(M3), Dc2 = j2._, Nc2 = Gr2("^" + Ln2.call(W2).replace(Er2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Dn2 = vs2 ? g3.Buffer : i2, se2 = g3.Symbol, Nn2 = g3.Uint8Array, Ds2 = Dn2 ? Dn2.allocUnsafe : i2, $n2 = Ts2(M3.getPrototypeOf, M3), Ns2 = M3.create, $s2 = Ne2.propertyIsEnumerable, Un2 = bn2.splice, Us2 = se2 ? se2.isConcatSpreadable : i2, en2 = se2 ? se2.iterator : i2, de2 = se2 ? se2.toStringTag : i2, qn2 = function() { try { var t2 = we2(M3, "defineProperty"); return t2({}, "", {}), t2; } catch { } - }(), $c2 = g3.clearTimeout !== j2.clearTimeout && g3.clearTimeout, Uc2 = A2 && A2.now !== j2.Date.now && A2.now, qc2 = g3.setTimeout !== j2.setTimeout && g3.setTimeout, Fn2 = Q2.ceil, Wn2 = Q2.floor, zr2 = M3.getOwnPropertySymbols, Fc2 = Dn2 ? Dn2.isBuffer : i3, qs2 = g3.isFinite, Wc2 = bn2.join, Mc2 = Ts2(M3.keys, M3), V3 = Q2.max, et2 = Q2.min, Bc2 = A2.now, Gc2 = g3.parseInt, Fs2 = Q2.random, zc2 = bn2.reverse, Kr2 = we2(g3, "DataView"), nn2 = we2(g3, "Map"), Jr2 = we2(g3, "Promise"), $e2 = we2(g3, "Set"), rn2 = we2(g3, "WeakMap"), sn2 = we2(M3, "create"), Mn = rn2 && new rn2(), Ue2 = {}, Kc2 = Pe2(Kr2), Jc2 = Pe2(nn2), Yc2 = Pe2(Jr2), Zc2 = Pe2($e2), Xc2 = Pe2(rn2), Bn2 = se2 ? se2.prototype : i3, un2 = Bn2 ? Bn2.valueOf : i3, Ws2 = Bn2 ? Bn2.toString : i3; + }(), $c2 = g3.clearTimeout !== j2.clearTimeout && g3.clearTimeout, Uc2 = A2 && A2.now !== j2.Date.now && A2.now, qc2 = g3.setTimeout !== j2.setTimeout && g3.setTimeout, Fn2 = Q2.ceil, Wn2 = Q2.floor, zr2 = M3.getOwnPropertySymbols, Fc2 = Dn2 ? Dn2.isBuffer : i2, qs2 = g3.isFinite, Wc2 = bn2.join, Mc2 = Ts2(M3.keys, M3), V3 = Q2.max, et2 = Q2.min, Bc2 = A2.now, Gc2 = g3.parseInt, Fs2 = Q2.random, zc2 = bn2.reverse, Kr2 = we2(g3, "DataView"), nn2 = we2(g3, "Map"), Jr2 = we2(g3, "Promise"), $e2 = we2(g3, "Set"), rn2 = we2(g3, "WeakMap"), sn2 = we2(M3, "create"), Mn = rn2 && new rn2(), Ue2 = {}, Kc2 = Pe2(Kr2), Jc2 = Pe2(nn2), Yc2 = Pe2(Jr2), Zc2 = Pe2($e2), Xc2 = Pe2(rn2), Bn2 = se2 ? se2.prototype : i2, un2 = Bn2 ? Bn2.valueOf : i2, Ws2 = Bn2 ? Bn2.toString : i2; function a3(t2) { if (Y2(t2) && !b2(t2) && !(t2 instanceof N2)) { if (t2 instanceof Pt2) @@ -114074,14 +43380,14 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : if (Ns2) return Ns2(e18); t2.prototype = e18; - var n4 = new t2(); - return t2.prototype = i3, n4; + var n5 = new t2(); + return t2.prototype = i2, n5; }; }(); function Gn2() { } function Pt2(t2, e18) { - this.__wrapped__ = t2, this.__actions__ = [], this.__chain__ = !!e18, this.__index__ = 0, this.__values__ = i3; + this.__wrapped__ = t2, this.__actions__ = [], this.__chain__ = !!e18, this.__index__ = 0, this.__values__ = i2; } a3.templateSettings = { escape: oo2, evaluate: co2, interpolate: Xi2, variable: "", imports: { _: a3 } }, a3.prototype = Gn2.prototype, a3.prototype.constructor = a3, Pt2.prototype = qe2(Gn2.prototype), Pt2.prototype.constructor = Pt2; function N2(t2) { @@ -114100,8 +43406,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return t2; } function kc2() { - var t2 = this.__wrapped__.value(), e18 = this.__dir__, n4 = b2(t2), r2 = e18 < 0, u2 = n4 ? t2.length : 0, o2 = hh2(0, u2, this.__views__), c2 = o2.start, f3 = o2.end, l2 = f3 - c2, v6 = r2 ? f3 : c2 - 1, _3 = this.__iteratees__, m3 = _3.length, C3 = 0, x3 = et2(l2, this.__takeCount__); - if (!n4 || !r2 && u2 == l2 && x3 == l2) + var t2 = this.__wrapped__.value(), e18 = this.__dir__, n5 = b2(t2), r2 = e18 < 0, u2 = n5 ? t2.length : 0, o2 = hh2(0, u2, this.__views__), c2 = o2.start, f4 = o2.end, l2 = f4 - c2, v6 = r2 ? f4 : c2 - 1, _3 = this.__iteratees__, m3 = _3.length, C3 = 0, x3 = et2(l2, this.__takeCount__); + if (!n5 || !r2 && u2 == l2 && x3 == l2) return fu(t2, this.__actions__); var S4 = []; t: @@ -114123,8 +43429,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } N2.prototype = qe2(Gn2.prototype), N2.prototype.constructor = N2; function ge2(t2) { - var e18 = -1, n4 = t2 == null ? 0 : t2.length; - for (this.clear(); ++e18 < n4; ) { + var e18 = -1, n5 = t2 == null ? 0 : t2.length; + for (this.clear(); ++e18 < n5; ) { var r2 = t2[e18]; this.set(r2[0], r2[1]); } @@ -114139,23 +43445,23 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function ef2(t2) { var e18 = this.__data__; if (sn2) { - var n4 = e18[t2]; - return n4 === Ht2 ? i3 : n4; + var n5 = e18[t2]; + return n5 === Ht2 ? i2 : n5; } - return W2.call(e18, t2) ? e18[t2] : i3; + return W2.call(e18, t2) ? e18[t2] : i2; } function nf2(t2) { var e18 = this.__data__; - return sn2 ? e18[t2] !== i3 : W2.call(e18, t2); + return sn2 ? e18[t2] !== i2 : W2.call(e18, t2); } function rf2(t2, e18) { - var n4 = this.__data__; - return this.size += this.has(t2) ? 0 : 1, n4[t2] = sn2 && e18 === i3 ? Ht2 : e18, this; + var n5 = this.__data__; + return this.size += this.has(t2) ? 0 : 1, n5[t2] = sn2 && e18 === i2 ? Ht2 : e18, this; } ge2.prototype.clear = jc2, ge2.prototype.delete = tf2, ge2.prototype.get = ef2, ge2.prototype.has = nf2, ge2.prototype.set = rf2; function Kt2(t2) { - var e18 = -1, n4 = t2 == null ? 0 : t2.length; - for (this.clear(); ++e18 < n4; ) { + var e18 = -1, n5 = t2 == null ? 0 : t2.length; + for (this.clear(); ++e18 < n5; ) { var r2 = t2[e18]; this.set(r2[0], r2[1]); } @@ -114164,27 +43470,27 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : this.__data__ = [], this.size = 0; } function uf2(t2) { - var e18 = this.__data__, n4 = zn2(e18, t2); - if (n4 < 0) + var e18 = this.__data__, n5 = zn2(e18, t2); + if (n5 < 0) return false; var r2 = e18.length - 1; - return n4 == r2 ? e18.pop() : Un2.call(e18, n4, 1), --this.size, true; + return n5 == r2 ? e18.pop() : Un2.call(e18, n5, 1), --this.size, true; } function af2(t2) { - var e18 = this.__data__, n4 = zn2(e18, t2); - return n4 < 0 ? i3 : e18[n4][1]; + var e18 = this.__data__, n5 = zn2(e18, t2); + return n5 < 0 ? i2 : e18[n5][1]; } function of2(t2) { return zn2(this.__data__, t2) > -1; } function cf2(t2, e18) { - var n4 = this.__data__, r2 = zn2(n4, t2); - return r2 < 0 ? (++this.size, n4.push([t2, e18])) : n4[r2][1] = e18, this; + var n5 = this.__data__, r2 = zn2(n5, t2); + return r2 < 0 ? (++this.size, n5.push([t2, e18])) : n5[r2][1] = e18, this; } Kt2.prototype.clear = sf2, Kt2.prototype.delete = uf2, Kt2.prototype.get = af2, Kt2.prototype.has = of2, Kt2.prototype.set = cf2; function Jt2(t2) { - var e18 = -1, n4 = t2 == null ? 0 : t2.length; - for (this.clear(); ++e18 < n4; ) { + var e18 = -1, n5 = t2 == null ? 0 : t2.length; + for (this.clear(); ++e18 < n5; ) { var r2 = t2[e18]; this.set(r2[0], r2[1]); } @@ -114203,13 +43509,13 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return nr2(this, t2).has(t2); } function df2(t2, e18) { - var n4 = nr2(this, t2), r2 = n4.size; - return n4.set(t2, e18), this.size += n4.size == r2 ? 0 : 1, this; + var n5 = nr2(this, t2), r2 = n5.size; + return n5.set(t2, e18), this.size += n5.size == r2 ? 0 : 1, this; } Jt2.prototype.clear = ff2, Jt2.prototype.delete = hf2, Jt2.prototype.get = lf2, Jt2.prototype.has = pf2, Jt2.prototype.set = df2; function ve2(t2) { - var e18 = -1, n4 = t2 == null ? 0 : t2.length; - for (this.__data__ = new Jt2(); ++e18 < n4; ) + var e18 = -1, n5 = t2 == null ? 0 : t2.length; + for (this.__data__ = new Jt2(); ++e18 < n5; ) this.add(t2[e18]); } function gf2(t2) { @@ -114227,8 +43533,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : this.__data__ = new Kt2(), this.size = 0; } function mf2(t2) { - var e18 = this.__data__, n4 = e18.delete(t2); - return this.size = e18.size, n4; + var e18 = this.__data__, n5 = e18.delete(t2); + return this.size = e18.size, n5; } function wf2(t2) { return this.__data__.get(t2); @@ -114237,25 +43543,25 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return this.__data__.has(t2); } function Cf2(t2, e18) { - var n4 = this.__data__; - if (n4 instanceof Kt2) { - var r2 = n4.__data__; + var n5 = this.__data__; + if (n5 instanceof Kt2) { + var r2 = n5.__data__; if (!nn2 || r2.length < w2 - 1) - return r2.push([t2, e18]), this.size = ++n4.size, this; - n4 = this.__data__ = new Jt2(r2); + return r2.push([t2, e18]), this.size = ++n5.size, this; + n5 = this.__data__ = new Jt2(r2); } - return n4.set(t2, e18), this.size = n4.size, this; + return n5.set(t2, e18), this.size = n5.size, this; } Ot2.prototype.clear = _f3, Ot2.prototype.delete = mf2, Ot2.prototype.get = wf2, Ot2.prototype.has = Pf2, Ot2.prototype.set = Cf2; function Ms2(t2, e18) { - var n4 = b2(t2), r2 = !n4 && Ce2(t2), u2 = !n4 && !r2 && fe2(t2), o2 = !n4 && !r2 && !u2 && Be2(t2), c2 = n4 || r2 || u2 || o2, f3 = c2 ? Wr2(t2.length, bc2) : [], l2 = f3.length; + var n5 = b2(t2), r2 = !n5 && Ce2(t2), u2 = !n5 && !r2 && fe2(t2), o2 = !n5 && !r2 && !u2 && Be2(t2), c2 = n5 || r2 || u2 || o2, f4 = c2 ? Wr2(t2.length, bc2) : [], l2 = f4.length; for (var v6 in t2) - (e18 || W2.call(t2, v6)) && !(c2 && (v6 == "length" || u2 && (v6 == "offset" || v6 == "parent") || o2 && (v6 == "buffer" || v6 == "byteLength" || v6 == "byteOffset") || Qt2(v6, l2))) && f3.push(v6); - return f3; + (e18 || W2.call(t2, v6)) && !(c2 && (v6 == "length" || u2 && (v6 == "offset" || v6 == "parent") || o2 && (v6 == "buffer" || v6 == "byteLength" || v6 == "byteOffset") || Qt2(v6, l2))) && f4.push(v6); + return f4; } function Bs2(t2) { var e18 = t2.length; - return e18 ? t2[ri2(0, e18 - 1)] : i3; + return e18 ? t2[ri2(0, e18 - 1)] : i2; } function Af2(t2, e18) { return rr2(ut2(t2), _e3(e18, 0, t2.length)); @@ -114263,22 +43569,22 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function If2(t2) { return rr2(ut2(t2)); } - function Yr2(t2, e18, n4) { - (n4 !== i3 && !Rt2(t2[e18], n4) || n4 === i3 && !(e18 in t2)) && Yt2(t2, e18, n4); + function Yr2(t2, e18, n5) { + (n5 !== i2 && !Rt2(t2[e18], n5) || n5 === i2 && !(e18 in t2)) && Yt2(t2, e18, n5); } - function an2(t2, e18, n4) { + function an2(t2, e18, n5) { var r2 = t2[e18]; - (!(W2.call(t2, e18) && Rt2(r2, n4)) || n4 === i3 && !(e18 in t2)) && Yt2(t2, e18, n4); + (!(W2.call(t2, e18) && Rt2(r2, n5)) || n5 === i2 && !(e18 in t2)) && Yt2(t2, e18, n5); } function zn2(t2, e18) { - for (var n4 = t2.length; n4--; ) - if (Rt2(t2[n4][0], e18)) - return n4; + for (var n5 = t2.length; n5--; ) + if (Rt2(t2[n5][0], e18)) + return n5; return -1; } - function xf2(t2, e18, n4, r2) { + function xf2(t2, e18, n5, r2) { return ue2(t2, function(u2, o2, c2) { - e18(r2, u2, n4(u2), c2); + e18(r2, u2, n5(u2), c2); }), r2; } function Gs2(t2, e18) { @@ -114287,38 +43593,38 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Ef2(t2, e18) { return t2 && Ft2(e18, ot2(e18), t2); } - function Yt2(t2, e18, n4) { - e18 == "__proto__" && qn2 ? qn2(t2, e18, { configurable: true, enumerable: true, value: n4, writable: true }) : t2[e18] = n4; + function Yt2(t2, e18, n5) { + e18 == "__proto__" && qn2 ? qn2(t2, e18, { configurable: true, enumerable: true, value: n5, writable: true }) : t2[e18] = n5; } function Zr2(t2, e18) { - for (var n4 = -1, r2 = e18.length, u2 = d4(r2), o2 = t2 == null; ++n4 < r2; ) - u2[n4] = o2 ? i3 : Oi2(t2, e18[n4]); + for (var n5 = -1, r2 = e18.length, u2 = d4(r2), o2 = t2 == null; ++n5 < r2; ) + u2[n5] = o2 ? i2 : Oi2(t2, e18[n5]); return u2; } - function _e3(t2, e18, n4) { - return t2 === t2 && (n4 !== i3 && (t2 = t2 <= n4 ? t2 : n4), e18 !== i3 && (t2 = t2 >= e18 ? t2 : e18)), t2; + function _e3(t2, e18, n5) { + return t2 === t2 && (n5 !== i2 && (t2 = t2 <= n5 ? t2 : n5), e18 !== i2 && (t2 = t2 >= e18 ? t2 : e18)), t2; } - function Ct2(t2, e18, n4, r2, u2, o2) { - var c2, f3 = e18 & Dt2, l2 = e18 & Bt2, v6 = e18 & xe2; - if (n4 && (c2 = u2 ? n4(t2, r2, u2, o2) : n4(t2)), c2 !== i3) + function Ct2(t2, e18, n5, r2, u2, o2) { + var c2, f4 = e18 & Dt2, l2 = e18 & Bt2, v6 = e18 & xe2; + if (n5 && (c2 = u2 ? n5(t2, r2, u2, o2) : n5(t2)), c2 !== i2) return c2; if (!K3(t2)) return t2; var _3 = b2(t2); if (_3) { - if (c2 = ph2(t2), !f3) + if (c2 = ph2(t2), !f4) return ut2(t2, c2); } else { var m3 = nt2(t2), C3 = m3 == An2 || m3 == Ki2; if (fe2(t2)) - return pu2(t2, f3); + return pu2(t2, f4); if (m3 == zt2 || m3 == Oe2 || C3 && !u2) { - if (c2 = l2 || C3 ? {} : Lu2(t2), !f3) + if (c2 = l2 || C3 ? {} : Lu2(t2), !f4) return l2 ? nh2(t2, Ef2(c2, t2)) : eh2(t2, Gs2(c2, t2)); } else { if (!B2[m3]) return u2 ? t2 : {}; - c2 = dh2(t2, m3, f3); + c2 = dh2(t2, m3, f4); } } o2 || (o2 = new Ot2()); @@ -114326,47 +43632,47 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : if (x3) return x3; o2.set(t2, c2), aa2(t2) ? t2.forEach(function(O3) { - c2.add(Ct2(O3, e18, n4, O3, t2, o2)); + c2.add(Ct2(O3, e18, n5, O3, t2, o2)); }) : sa2(t2) && t2.forEach(function(O3, D2) { - c2.set(D2, Ct2(O3, e18, n4, D2, t2, o2)); + c2.set(D2, Ct2(O3, e18, n5, D2, t2, o2)); }); - var S4 = v6 ? l2 ? di2 : pi2 : l2 ? ot2 : k2, L4 = _3 ? i3 : S4(t2); + var S4 = v6 ? l2 ? di2 : pi2 : l2 ? ot2 : k2, L4 = _3 ? i2 : S4(t2); return mt2(L4 || t2, function(O3, D2) { - L4 && (D2 = O3, O3 = t2[D2]), an2(c2, D2, Ct2(O3, e18, n4, D2, t2, o2)); + L4 && (D2 = O3, O3 = t2[D2]), an2(c2, D2, Ct2(O3, e18, n5, D2, t2, o2)); }), c2; } function yf2(t2) { var e18 = k2(t2); - return function(n4) { - return zs2(n4, t2, e18); + return function(n5) { + return zs2(n5, t2, e18); }; } - function zs2(t2, e18, n4) { - var r2 = n4.length; + function zs2(t2, e18, n5) { + var r2 = n5.length; if (t2 == null) return !r2; for (t2 = M3(t2); r2--; ) { - var u2 = n4[r2], o2 = e18[u2], c2 = t2[u2]; - if (c2 === i3 && !(u2 in t2) || !o2(c2)) + var u2 = n5[r2], o2 = e18[u2], c2 = t2[u2]; + if (c2 === i2 && !(u2 in t2) || !o2(c2)) return false; } return true; } - function Ks2(t2, e18, n4) { + function Ks2(t2, e18, n5) { if (typeof t2 != "function") throw new wt2(y3); return dn2(function() { - t2.apply(i3, n4); + t2.apply(i2, n5); }, e18); } - function on2(t2, e18, n4, r2) { - var u2 = -1, o2 = Sn2, c2 = true, f3 = t2.length, l2 = [], v6 = e18.length; - if (!f3) + function on2(t2, e18, n5, r2) { + var u2 = -1, o2 = Sn2, c2 = true, f4 = t2.length, l2 = [], v6 = e18.length; + if (!f4) return l2; - n4 && (e18 = z3(e18, ht2(n4))), r2 ? (o2 = Dr2, c2 = false) : e18.length >= w2 && (o2 = tn2, c2 = false, e18 = new ve2(e18)); + n5 && (e18 = z3(e18, ht2(n5))), r2 ? (o2 = Dr2, c2 = false) : e18.length >= w2 && (o2 = tn2, c2 = false, e18 = new ve2(e18)); t: - for (; ++u2 < f3; ) { - var _3 = t2[u2], m3 = n4 == null ? _3 : n4(_3); + for (; ++u2 < f4; ) { + var _3 = t2[u2], m3 = n5 == null ? _3 : n5(_3); if (_3 = r2 || _3 !== 0 ? _3 : 0, c2 && m3 === m3) { for (var C3 = v6; C3--; ) if (e18[C3] === m3) @@ -114379,36 +43685,36 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } var ue2 = mu2(qt2), Js2 = mu2(Qr2, true); function Sf2(t2, e18) { - var n4 = true; + var n5 = true; return ue2(t2, function(r2, u2, o2) { - return n4 = !!e18(r2, u2, o2), n4; - }), n4; + return n5 = !!e18(r2, u2, o2), n5; + }), n5; } - function Kn2(t2, e18, n4) { + function Kn2(t2, e18, n5) { for (var r2 = -1, u2 = t2.length; ++r2 < u2; ) { var o2 = t2[r2], c2 = e18(o2); - if (c2 != null && (f3 === i3 ? c2 === c2 && !pt2(c2) : n4(c2, f3))) - var f3 = c2, l2 = o2; + if (c2 != null && (f4 === i2 ? c2 === c2 && !pt2(c2) : n5(c2, f4))) + var f4 = c2, l2 = o2; } return l2; } - function Of2(t2, e18, n4, r2) { + function Of2(t2, e18, n5, r2) { var u2 = t2.length; - for (n4 = T9(n4), n4 < 0 && (n4 = -n4 > u2 ? 0 : u2 + n4), r2 = r2 === i3 || r2 > u2 ? u2 : T9(r2), r2 < 0 && (r2 += u2), r2 = n4 > r2 ? 0 : ca2(r2); n4 < r2; ) - t2[n4++] = e18; + for (n5 = T9(n5), n5 < 0 && (n5 = -n5 > u2 ? 0 : u2 + n5), r2 = r2 === i2 || r2 > u2 ? u2 : T9(r2), r2 < 0 && (r2 += u2), r2 = n5 > r2 ? 0 : ca2(r2); n5 < r2; ) + t2[n5++] = e18; return t2; } function Ys2(t2, e18) { - var n4 = []; + var n5 = []; return ue2(t2, function(r2, u2, o2) { - e18(r2, u2, o2) && n4.push(r2); - }), n4; + e18(r2, u2, o2) && n5.push(r2); + }), n5; } - function tt2(t2, e18, n4, r2, u2) { + function tt2(t2, e18, n5, r2, u2) { var o2 = -1, c2 = t2.length; - for (n4 || (n4 = vh2), u2 || (u2 = []); ++o2 < c2; ) { - var f3 = t2[o2]; - e18 > 0 && n4(f3) ? e18 > 1 ? tt2(f3, e18 - 1, n4, r2, u2) : re2(u2, f3) : r2 || (u2[u2.length] = f3); + for (n5 || (n5 = vh2), u2 || (u2 = []); ++o2 < c2; ) { + var f4 = t2[o2]; + e18 > 0 && n5(f4) ? e18 > 1 ? tt2(f4, e18 - 1, n5, r2, u2) : re2(u2, f4) : r2 || (u2[u2.length] = f4); } return u2; } @@ -114420,22 +43726,22 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return t2 && Zs2(t2, e18, k2); } function Jn2(t2, e18) { - return ne2(e18, function(n4) { - return Vt2(t2[n4]); + return ne2(e18, function(n5) { + return Vt2(t2[n5]); }); } function me2(t2, e18) { e18 = oe2(e18, t2); - for (var n4 = 0, r2 = e18.length; t2 != null && n4 < r2; ) - t2 = t2[Wt2(e18[n4++])]; - return n4 && n4 == r2 ? t2 : i3; + for (var n5 = 0, r2 = e18.length; t2 != null && n5 < r2; ) + t2 = t2[Wt2(e18[n5++])]; + return n5 && n5 == r2 ? t2 : i2; } - function Xs2(t2, e18, n4) { + function Xs2(t2, e18, n5) { var r2 = e18(t2); - return b2(t2) ? r2 : re2(r2, n4(t2)); + return b2(t2) ? r2 : re2(r2, n5(t2)); } function rt2(t2) { - return t2 == null ? t2 === i3 ? eo2 : ja2 : de2 && de2 in M3(t2) ? fh2(t2) : Ih2(t2); + return t2 == null ? t2 === i2 ? eo2 : ja2 : de2 && de2 in M3(t2) ? fh2(t2) : Ih2(t2); } function Vr2(t2, e18) { return t2 > e18; @@ -114446,23 +43752,23 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function bf2(t2, e18) { return t2 != null && e18 in M3(t2); } - function Tf2(t2, e18, n4) { - return t2 >= et2(e18, n4) && t2 < V3(e18, n4); + function Tf2(t2, e18, n5) { + return t2 >= et2(e18, n5) && t2 < V3(e18, n5); } - function kr2(t2, e18, n4) { - for (var r2 = n4 ? Dr2 : Sn2, u2 = t2[0].length, o2 = t2.length, c2 = o2, f3 = d4(o2), l2 = 1 / 0, v6 = []; c2--; ) { + function kr2(t2, e18, n5) { + for (var r2 = n5 ? Dr2 : Sn2, u2 = t2[0].length, o2 = t2.length, c2 = o2, f4 = d4(o2), l2 = 1 / 0, v6 = []; c2--; ) { var _3 = t2[c2]; - c2 && e18 && (_3 = z3(_3, ht2(e18))), l2 = et2(_3.length, l2), f3[c2] = !n4 && (e18 || u2 >= 120 && _3.length >= 120) ? new ve2(c2 && _3) : i3; + c2 && e18 && (_3 = z3(_3, ht2(e18))), l2 = et2(_3.length, l2), f4[c2] = !n5 && (e18 || u2 >= 120 && _3.length >= 120) ? new ve2(c2 && _3) : i2; } _3 = t2[0]; - var m3 = -1, C3 = f3[0]; + var m3 = -1, C3 = f4[0]; t: for (; ++m3 < u2 && v6.length < l2; ) { var x3 = _3[m3], S4 = e18 ? e18(x3) : x3; - if (x3 = n4 || x3 !== 0 ? x3 : 0, !(C3 ? tn2(C3, S4) : r2(v6, S4, n4))) { + if (x3 = n5 || x3 !== 0 ? x3 : 0, !(C3 ? tn2(C3, S4) : r2(v6, S4, n5))) { for (c2 = o2; --c2; ) { - var L4 = f3[c2]; - if (!(L4 ? tn2(L4, S4) : r2(t2[c2], S4, n4))) + var L4 = f4[c2]; + if (!(L4 ? tn2(L4, S4) : r2(t2[c2], S4, n5))) continue t; } C3 && C3.push(S4), v6.push(x3); @@ -114470,15 +43776,15 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } return v6; } - function Lf2(t2, e18, n4, r2) { + function Lf2(t2, e18, n5, r2) { return qt2(t2, function(u2, o2, c2) { - e18(r2, n4(u2), o2, c2); + e18(r2, n5(u2), o2, c2); }), r2; } - function cn2(t2, e18, n4) { + function cn2(t2, e18, n5) { e18 = oe2(e18, t2), t2 = $u2(t2, e18); var r2 = t2 == null ? t2 : t2[Wt2(It2(e18))]; - return r2 == null ? i3 : ft2(r2, t2, n4); + return r2 == null ? i2 : ft2(r2, t2, n5); } function Qs2(t2) { return Y2(t2) && rt2(t2) == Oe2; @@ -114489,11 +43795,11 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Df2(t2) { return Y2(t2) && rt2(t2) == Ze2; } - function fn2(t2, e18, n4, r2, u2) { - return t2 === e18 ? true : t2 == null || e18 == null || !Y2(t2) && !Y2(e18) ? t2 !== t2 && e18 !== e18 : Nf2(t2, e18, n4, r2, fn2, u2); + function fn2(t2, e18, n5, r2, u2) { + return t2 === e18 ? true : t2 == null || e18 == null || !Y2(t2) && !Y2(e18) ? t2 !== t2 && e18 !== e18 : Nf2(t2, e18, n5, r2, fn2, u2); } - function Nf2(t2, e18, n4, r2, u2, o2) { - var c2 = b2(t2), f3 = b2(e18), l2 = c2 ? Pn2 : nt2(t2), v6 = f3 ? Pn2 : nt2(e18); + function Nf2(t2, e18, n5, r2, u2, o2) { + var c2 = b2(t2), f4 = b2(e18), l2 = c2 ? Pn2 : nt2(t2), v6 = f4 ? Pn2 : nt2(e18); l2 = l2 == Oe2 ? zt2 : l2, v6 = v6 == Oe2 ? zt2 : v6; var _3 = l2 == zt2, m3 = v6 == zt2, C3 = l2 == v6; if (C3 && fe2(t2)) { @@ -114502,39 +43808,39 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : c2 = true, _3 = false; } if (C3 && !_3) - return o2 || (o2 = new Ot2()), c2 || Be2(t2) ? Ru2(t2, e18, n4, r2, u2, o2) : oh2(t2, e18, l2, n4, r2, u2, o2); - if (!(n4 & Ee2)) { + return o2 || (o2 = new Ot2()), c2 || Be2(t2) ? Ru2(t2, e18, n5, r2, u2, o2) : oh2(t2, e18, l2, n5, r2, u2, o2); + if (!(n5 & Ee2)) { var x3 = _3 && W2.call(t2, "__wrapped__"), S4 = m3 && W2.call(e18, "__wrapped__"); if (x3 || S4) { var L4 = x3 ? t2.value() : t2, O3 = S4 ? e18.value() : e18; - return o2 || (o2 = new Ot2()), u2(L4, O3, n4, r2, o2); + return o2 || (o2 = new Ot2()), u2(L4, O3, n5, r2, o2); } } - return C3 ? (o2 || (o2 = new Ot2()), ch2(t2, e18, n4, r2, u2, o2)) : false; + return C3 ? (o2 || (o2 = new Ot2()), ch2(t2, e18, n5, r2, u2, o2)) : false; } function $f2(t2) { return Y2(t2) && nt2(t2) == Et2; } - function jr2(t2, e18, n4, r2) { - var u2 = n4.length, o2 = u2, c2 = !r2; + function jr2(t2, e18, n5, r2) { + var u2 = n5.length, o2 = u2, c2 = !r2; if (t2 == null) return !o2; for (t2 = M3(t2); u2--; ) { - var f3 = n4[u2]; - if (c2 && f3[2] ? f3[1] !== t2[f3[0]] : !(f3[0] in t2)) + var f4 = n5[u2]; + if (c2 && f4[2] ? f4[1] !== t2[f4[0]] : !(f4[0] in t2)) return false; } for (; ++u2 < o2; ) { - f3 = n4[u2]; - var l2 = f3[0], v6 = t2[l2], _3 = f3[1]; - if (c2 && f3[2]) { - if (v6 === i3 && !(l2 in t2)) + f4 = n5[u2]; + var l2 = f4[0], v6 = t2[l2], _3 = f4[1]; + if (c2 && f4[2]) { + if (v6 === i2 && !(l2 in t2)) return false; } else { var m3 = new Ot2(); if (r2) var C3 = r2(v6, _3, l2, t2, e18, m3); - if (!(C3 === i3 ? fn2(_3, v6, Ee2 | mn2, r2, m3) : C3)) + if (!(C3 === i2 ? fn2(_3, v6, Ee2 | mn2, r2, m3) : C3)) return false; } } @@ -114562,68 +43868,68 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : if (!pn2(t2)) return Mc2(t2); var e18 = []; - for (var n4 in M3(t2)) - W2.call(t2, n4) && n4 != "constructor" && e18.push(n4); + for (var n5 in M3(t2)) + W2.call(t2, n5) && n5 != "constructor" && e18.push(n5); return e18; } function Wf2(t2) { if (!K3(t2)) return Ah2(t2); - var e18 = pn2(t2), n4 = []; + var e18 = pn2(t2), n5 = []; for (var r2 in t2) - r2 == "constructor" && (e18 || !W2.call(t2, r2)) || n4.push(r2); - return n4; + r2 == "constructor" && (e18 || !W2.call(t2, r2)) || n5.push(r2); + return n5; } function ei2(t2, e18) { return t2 < e18; } function js2(t2, e18) { - var n4 = -1, r2 = at2(t2) ? d4(t2.length) : []; + var n5 = -1, r2 = at2(t2) ? d4(t2.length) : []; return ue2(t2, function(u2, o2, c2) { - r2[++n4] = e18(u2, o2, c2); + r2[++n5] = e18(u2, o2, c2); }), r2; } function tu2(t2) { var e18 = vi2(t2); - return e18.length == 1 && e18[0][2] ? Du2(e18[0][0], e18[0][1]) : function(n4) { - return n4 === t2 || jr2(n4, t2, e18); + return e18.length == 1 && e18[0][2] ? Du2(e18[0][0], e18[0][1]) : function(n5) { + return n5 === t2 || jr2(n5, t2, e18); }; } function eu2(t2, e18) { - return mi2(t2) && Hu2(e18) ? Du2(Wt2(t2), e18) : function(n4) { - var r2 = Oi2(n4, t2); - return r2 === i3 && r2 === e18 ? Ri2(n4, t2) : fn2(e18, r2, Ee2 | mn2); + return mi2(t2) && Hu2(e18) ? Du2(Wt2(t2), e18) : function(n5) { + var r2 = Oi2(n5, t2); + return r2 === i2 && r2 === e18 ? Ri2(n5, t2) : fn2(e18, r2, Ee2 | mn2); }; } - function Yn2(t2, e18, n4, r2, u2) { + function Yn2(t2, e18, n5, r2, u2) { t2 !== e18 && Xr2(e18, function(o2, c2) { if (u2 || (u2 = new Ot2()), K3(o2)) - Mf2(t2, e18, c2, n4, Yn2, r2, u2); + Mf2(t2, e18, c2, n5, Yn2, r2, u2); else { - var f3 = r2 ? r2(Pi2(t2, c2), o2, c2 + "", t2, e18, u2) : i3; - f3 === i3 && (f3 = o2), Yr2(t2, c2, f3); + var f4 = r2 ? r2(Pi2(t2, c2), o2, c2 + "", t2, e18, u2) : i2; + f4 === i2 && (f4 = o2), Yr2(t2, c2, f4); } }, ot2); } - function Mf2(t2, e18, n4, r2, u2, o2, c2) { - var f3 = Pi2(t2, n4), l2 = Pi2(e18, n4), v6 = c2.get(l2); + function Mf2(t2, e18, n5, r2, u2, o2, c2) { + var f4 = Pi2(t2, n5), l2 = Pi2(e18, n5), v6 = c2.get(l2); if (v6) { - Yr2(t2, n4, v6); + Yr2(t2, n5, v6); return; } - var _3 = o2 ? o2(f3, l2, n4 + "", t2, e18, c2) : i3, m3 = _3 === i3; + var _3 = o2 ? o2(f4, l2, n5 + "", t2, e18, c2) : i2, m3 = _3 === i2; if (m3) { var C3 = b2(l2), x3 = !C3 && fe2(l2), S4 = !C3 && !x3 && Be2(l2); - _3 = l2, C3 || x3 || S4 ? b2(f3) ? _3 = f3 : Z2(f3) ? _3 = ut2(f3) : x3 ? (m3 = false, _3 = pu2(l2, true)) : S4 ? (m3 = false, _3 = du2(l2, true)) : _3 = [] : gn2(l2) || Ce2(l2) ? (_3 = f3, Ce2(f3) ? _3 = fa2(f3) : (!K3(f3) || Vt2(f3)) && (_3 = Lu2(l2))) : m3 = false; + _3 = l2, C3 || x3 || S4 ? b2(f4) ? _3 = f4 : Z2(f4) ? _3 = ut2(f4) : x3 ? (m3 = false, _3 = pu2(l2, true)) : S4 ? (m3 = false, _3 = du2(l2, true)) : _3 = [] : gn2(l2) || Ce2(l2) ? (_3 = f4, Ce2(f4) ? _3 = fa2(f4) : (!K3(f4) || Vt2(f4)) && (_3 = Lu2(l2))) : m3 = false; } - m3 && (c2.set(l2, _3), u2(_3, l2, r2, o2, c2), c2.delete(l2)), Yr2(t2, n4, _3); + m3 && (c2.set(l2, _3), u2(_3, l2, r2, o2, c2), c2.delete(l2)), Yr2(t2, n5, _3); } function nu2(t2, e18) { - var n4 = t2.length; - if (n4) - return e18 += e18 < 0 ? n4 : 0, Qt2(e18, n4) ? t2[e18] : i3; + var n5 = t2.length; + if (n5) + return e18 += e18 < 0 ? n5 : 0, Qt2(e18, n5) ? t2[e18] : i2; } - function ru2(t2, e18, n4) { + function ru2(t2, e18, n5) { e18.length ? e18 = z3(e18, function(o2) { return b2(o2) ? function(c2) { return me2(c2, o2.length === 1 ? o2[0] : o2); @@ -114631,25 +43937,25 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : }) : e18 = [ct2]; var r2 = -1; e18 = z3(e18, ht2(E2())); - var u2 = js2(t2, function(o2, c2, f3) { + var u2 = js2(t2, function(o2, c2, f4) { var l2 = z3(e18, function(v6) { return v6(o2); }); return { criteria: l2, index: ++r2, value: o2 }; }); return pc2(u2, function(o2, c2) { - return th2(o2, c2, n4); + return th2(o2, c2, n5); }); } function Bf2(t2, e18) { - return iu2(t2, e18, function(n4, r2) { + return iu2(t2, e18, function(n5, r2) { return Ri2(t2, r2); }); } - function iu2(t2, e18, n4) { + function iu2(t2, e18, n5) { for (var r2 = -1, u2 = e18.length, o2 = {}; ++r2 < u2; ) { - var c2 = e18[r2], f3 = me2(t2, c2); - n4(f3, c2) && hn2(o2, oe2(c2, t2), f3); + var c2 = e18[r2], f4 = me2(t2, c2); + n5(f4, c2) && hn2(o2, oe2(c2, t2), f4); } return o2; } @@ -114658,17 +43964,17 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return me2(e18, t2); }; } - function ni2(t2, e18, n4, r2) { - var u2 = r2 ? lc2 : Te2, o2 = -1, c2 = e18.length, f3 = t2; - for (t2 === e18 && (e18 = ut2(e18)), n4 && (f3 = z3(t2, ht2(n4))); ++o2 < c2; ) - for (var l2 = 0, v6 = e18[o2], _3 = n4 ? n4(v6) : v6; (l2 = u2(f3, _3, l2, r2)) > -1; ) - f3 !== t2 && Un2.call(f3, l2, 1), Un2.call(t2, l2, 1); + function ni2(t2, e18, n5, r2) { + var u2 = r2 ? lc2 : Te2, o2 = -1, c2 = e18.length, f4 = t2; + for (t2 === e18 && (e18 = ut2(e18)), n5 && (f4 = z3(t2, ht2(n5))); ++o2 < c2; ) + for (var l2 = 0, v6 = e18[o2], _3 = n5 ? n5(v6) : v6; (l2 = u2(f4, _3, l2, r2)) > -1; ) + f4 !== t2 && Un2.call(f4, l2, 1), Un2.call(t2, l2, 1); return t2; } function su2(t2, e18) { - for (var n4 = t2 ? e18.length : 0, r2 = n4 - 1; n4--; ) { - var u2 = e18[n4]; - if (n4 == r2 || u2 !== o2) { + for (var n5 = t2 ? e18.length : 0, r2 = n5 - 1; n5--; ) { + var u2 = e18[n5]; + if (n5 == r2 || u2 !== o2) { var o2 = u2; Qt2(u2) ? Un2.call(t2, u2, 1) : ui2(t2, u2); } @@ -114678,19 +43984,19 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function ri2(t2, e18) { return t2 + Wn2(Fs2() * (e18 - t2 + 1)); } - function zf2(t2, e18, n4, r2) { - for (var u2 = -1, o2 = V3(Fn2((e18 - t2) / (n4 || 1)), 0), c2 = d4(o2); o2--; ) - c2[r2 ? o2 : ++u2] = t2, t2 += n4; + function zf2(t2, e18, n5, r2) { + for (var u2 = -1, o2 = V3(Fn2((e18 - t2) / (n5 || 1)), 0), c2 = d4(o2); o2--; ) + c2[r2 ? o2 : ++u2] = t2, t2 += n5; return c2; } function ii2(t2, e18) { - var n4 = ""; + var n5 = ""; if (!t2 || e18 < 1 || e18 > ee2) - return n4; + return n5; do - e18 % 2 && (n4 += t2), e18 = Wn2(e18 / 2), e18 && (t2 += t2); + e18 % 2 && (n5 += t2), e18 = Wn2(e18 / 2), e18 && (t2 += t2); while (e18); - return n4; + return n5; } function H2(t2, e18) { return Ci2(Nu2(t2, e18, ct2), t2 + ""); @@ -114699,22 +44005,22 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return Bs2(Ge2(t2)); } function Jf2(t2, e18) { - var n4 = Ge2(t2); - return rr2(n4, _e3(e18, 0, n4.length)); + var n5 = Ge2(t2); + return rr2(n5, _e3(e18, 0, n5.length)); } - function hn2(t2, e18, n4, r2) { + function hn2(t2, e18, n5, r2) { if (!K3(t2)) return t2; e18 = oe2(e18, t2); - for (var u2 = -1, o2 = e18.length, c2 = o2 - 1, f3 = t2; f3 != null && ++u2 < o2; ) { - var l2 = Wt2(e18[u2]), v6 = n4; + for (var u2 = -1, o2 = e18.length, c2 = o2 - 1, f4 = t2; f4 != null && ++u2 < o2; ) { + var l2 = Wt2(e18[u2]), v6 = n5; if (l2 === "__proto__" || l2 === "constructor" || l2 === "prototype") return t2; if (u2 != c2) { - var _3 = f3[l2]; - v6 = r2 ? r2(_3, l2, f3) : i3, v6 === i3 && (v6 = K3(_3) ? _3 : Qt2(e18[u2 + 1]) ? [] : {}); + var _3 = f4[l2]; + v6 = r2 ? r2(_3, l2, f4) : i2, v6 === i2 && (v6 = K3(_3) ? _3 : Qt2(e18[u2 + 1]) ? [] : {}); } - an2(f3, l2, v6), f3 = f3[l2]; + an2(f4, l2, v6), f4 = f4[l2]; } return t2; } @@ -114726,50 +44032,50 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Zf2(t2) { return rr2(Ge2(t2)); } - function At2(t2, e18, n4) { + function At2(t2, e18, n5) { var r2 = -1, u2 = t2.length; - e18 < 0 && (e18 = -e18 > u2 ? 0 : u2 + e18), n4 = n4 > u2 ? u2 : n4, n4 < 0 && (n4 += u2), u2 = e18 > n4 ? 0 : n4 - e18 >>> 0, e18 >>>= 0; + e18 < 0 && (e18 = -e18 > u2 ? 0 : u2 + e18), n5 = n5 > u2 ? u2 : n5, n5 < 0 && (n5 += u2), u2 = e18 > n5 ? 0 : n5 - e18 >>> 0, e18 >>>= 0; for (var o2 = d4(u2); ++r2 < u2; ) o2[r2] = t2[r2 + e18]; return o2; } function Xf2(t2, e18) { - var n4; + var n5; return ue2(t2, function(r2, u2, o2) { - return n4 = e18(r2, u2, o2), !n4; - }), !!n4; + return n5 = e18(r2, u2, o2), !n5; + }), !!n5; } - function Zn2(t2, e18, n4) { + function Zn2(t2, e18, n5) { var r2 = 0, u2 = t2 == null ? r2 : t2.length; if (typeof e18 == "number" && e18 === e18 && u2 <= Xa2) { for (; r2 < u2; ) { var o2 = r2 + u2 >>> 1, c2 = t2[o2]; - c2 !== null && !pt2(c2) && (n4 ? c2 <= e18 : c2 < e18) ? r2 = o2 + 1 : u2 = o2; + c2 !== null && !pt2(c2) && (n5 ? c2 <= e18 : c2 < e18) ? r2 = o2 + 1 : u2 = o2; } return u2; } - return si2(t2, e18, ct2, n4); + return si2(t2, e18, ct2, n5); } - function si2(t2, e18, n4, r2) { + function si2(t2, e18, n5, r2) { var u2 = 0, o2 = t2 == null ? 0 : t2.length; if (o2 === 0) return 0; - e18 = n4(e18); - for (var c2 = e18 !== e18, f3 = e18 === null, l2 = pt2(e18), v6 = e18 === i3; u2 < o2; ) { - var _3 = Wn2((u2 + o2) / 2), m3 = n4(t2[_3]), C3 = m3 !== i3, x3 = m3 === null, S4 = m3 === m3, L4 = pt2(m3); + e18 = n5(e18); + for (var c2 = e18 !== e18, f4 = e18 === null, l2 = pt2(e18), v6 = e18 === i2; u2 < o2; ) { + var _3 = Wn2((u2 + o2) / 2), m3 = n5(t2[_3]), C3 = m3 !== i2, x3 = m3 === null, S4 = m3 === m3, L4 = pt2(m3); if (c2) var O3 = r2 || S4; else - v6 ? O3 = S4 && (r2 || C3) : f3 ? O3 = S4 && C3 && (r2 || !x3) : l2 ? O3 = S4 && C3 && !x3 && (r2 || !L4) : x3 || L4 ? O3 = false : O3 = r2 ? m3 <= e18 : m3 < e18; + v6 ? O3 = S4 && (r2 || C3) : f4 ? O3 = S4 && C3 && (r2 || !x3) : l2 ? O3 = S4 && C3 && !x3 && (r2 || !L4) : x3 || L4 ? O3 = false : O3 = r2 ? m3 <= e18 : m3 < e18; O3 ? u2 = _3 + 1 : o2 = _3; } return et2(o2, Za2); } function au2(t2, e18) { - for (var n4 = -1, r2 = t2.length, u2 = 0, o2 = []; ++n4 < r2; ) { - var c2 = t2[n4], f3 = e18 ? e18(c2) : c2; - if (!n4 || !Rt2(f3, l2)) { - var l2 = f3; + for (var n5 = -1, r2 = t2.length, u2 = 0, o2 = []; ++n5 < r2; ) { + var c2 = t2[n5], f4 = e18 ? e18(c2) : c2; + if (!n5 || !Rt2(f4, l2)) { + var l2 = f4; o2[u2++] = c2 === 0 ? 0 : c2; } } @@ -114788,9 +44094,9 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var e18 = t2 + ""; return e18 == "0" && 1 / t2 == -le2 ? "-0" : e18; } - function ae2(t2, e18, n4) { - var r2 = -1, u2 = Sn2, o2 = t2.length, c2 = true, f3 = [], l2 = f3; - if (n4) + function ae2(t2, e18, n5) { + var r2 = -1, u2 = Sn2, o2 = t2.length, c2 = true, f4 = [], l2 = f4; + if (n5) c2 = false, u2 = Dr2; else if (o2 >= w2) { var v6 = e18 ? null : uh2(t2); @@ -114798,50 +44104,50 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return Rn2(v6); c2 = false, u2 = tn2, l2 = new ve2(); } else - l2 = e18 ? [] : f3; + l2 = e18 ? [] : f4; t: for (; ++r2 < o2; ) { var _3 = t2[r2], m3 = e18 ? e18(_3) : _3; - if (_3 = n4 || _3 !== 0 ? _3 : 0, c2 && m3 === m3) { + if (_3 = n5 || _3 !== 0 ? _3 : 0, c2 && m3 === m3) { for (var C3 = l2.length; C3--; ) if (l2[C3] === m3) continue t; - e18 && l2.push(m3), f3.push(_3); + e18 && l2.push(m3), f4.push(_3); } else - u2(l2, m3, n4) || (l2 !== f3 && l2.push(m3), f3.push(_3)); + u2(l2, m3, n5) || (l2 !== f4 && l2.push(m3), f4.push(_3)); } - return f3; + return f4; } function ui2(t2, e18) { return e18 = oe2(e18, t2), t2 = $u2(t2, e18), t2 == null || delete t2[Wt2(It2(e18))]; } - function cu2(t2, e18, n4, r2) { - return hn2(t2, e18, n4(me2(t2, e18)), r2); + function cu2(t2, e18, n5, r2) { + return hn2(t2, e18, n5(me2(t2, e18)), r2); } - function Xn2(t2, e18, n4, r2) { + function Xn2(t2, e18, n5, r2) { for (var u2 = t2.length, o2 = r2 ? u2 : -1; (r2 ? o2-- : ++o2 < u2) && e18(t2[o2], o2, t2); ) ; - return n4 ? At2(t2, r2 ? 0 : o2, r2 ? o2 + 1 : u2) : At2(t2, r2 ? o2 + 1 : 0, r2 ? u2 : o2); + return n5 ? At2(t2, r2 ? 0 : o2, r2 ? o2 + 1 : u2) : At2(t2, r2 ? o2 + 1 : 0, r2 ? u2 : o2); } function fu(t2, e18) { - var n4 = t2; - return n4 instanceof N2 && (n4 = n4.value()), Nr2(e18, function(r2, u2) { + var n5 = t2; + return n5 instanceof N2 && (n5 = n5.value()), Nr2(e18, function(r2, u2) { return u2.func.apply(u2.thisArg, re2([r2], u2.args)); - }, n4); + }, n5); } - function ai2(t2, e18, n4) { + function ai2(t2, e18, n5) { var r2 = t2.length; if (r2 < 2) return r2 ? ae2(t2[0]) : []; for (var u2 = -1, o2 = d4(r2); ++u2 < r2; ) - for (var c2 = t2[u2], f3 = -1; ++f3 < r2; ) - f3 != u2 && (o2[u2] = on2(o2[u2] || c2, t2[f3], e18, n4)); - return ae2(tt2(o2, 1), e18, n4); + for (var c2 = t2[u2], f4 = -1; ++f4 < r2; ) + f4 != u2 && (o2[u2] = on2(o2[u2] || c2, t2[f4], e18, n5)); + return ae2(tt2(o2, 1), e18, n5); } - function hu2(t2, e18, n4) { + function hu2(t2, e18, n5) { for (var r2 = -1, u2 = t2.length, o2 = e18.length, c2 = {}; ++r2 < u2; ) { - var f3 = r2 < o2 ? e18[r2] : i3; - n4(c2, t2[r2], f3); + var f4 = r2 < o2 ? e18[r2] : i2; + n5(c2, t2[r2], f4); } return c2; } @@ -114855,9 +44161,9 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return b2(t2) ? t2 : mi2(t2, e18) ? [t2] : Wu2(q2(t2)); } var Qf2 = H2; - function ce2(t2, e18, n4) { + function ce2(t2, e18, n5) { var r2 = t2.length; - return n4 = n4 === i3 ? r2 : n4, !e18 && n4 >= r2 ? t2 : At2(t2, e18, n4); + return n5 = n5 === i2 ? r2 : n5, !e18 && n5 >= r2 ? t2 : At2(t2, e18, n5); } var lu2 = $c2 || function(t2) { return j2.clearTimeout(t2); @@ -114865,7 +44171,7 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function pu2(t2, e18) { if (e18) return t2.slice(); - var n4 = t2.length, r2 = Ds2 ? Ds2(n4) : new t2.constructor(n4); + var n5 = t2.length, r2 = Ds2 ? Ds2(n5) : new t2.constructor(n5); return t2.copy(r2), r2; } function fi2(t2) { @@ -114873,8 +44179,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return new Nn2(e18).set(new Nn2(t2)), e18; } function Vf2(t2, e18) { - var n4 = e18 ? fi2(t2.buffer) : t2.buffer; - return new t2.constructor(n4, t2.byteOffset, t2.byteLength); + var n5 = e18 ? fi2(t2.buffer) : t2.buffer; + return new t2.constructor(n5, t2.byteOffset, t2.byteLength); } function kf2(t2) { var e18 = new t2.constructor(t2.source, Qi2.exec(t2)); @@ -114884,119 +44190,119 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return un2 ? M3(un2.call(t2)) : {}; } function du2(t2, e18) { - var n4 = e18 ? fi2(t2.buffer) : t2.buffer; - return new t2.constructor(n4, t2.byteOffset, t2.length); + var n5 = e18 ? fi2(t2.buffer) : t2.buffer; + return new t2.constructor(n5, t2.byteOffset, t2.length); } function gu2(t2, e18) { if (t2 !== e18) { - var n4 = t2 !== i3, r2 = t2 === null, u2 = t2 === t2, o2 = pt2(t2), c2 = e18 !== i3, f3 = e18 === null, l2 = e18 === e18, v6 = pt2(e18); - if (!f3 && !v6 && !o2 && t2 > e18 || o2 && c2 && l2 && !f3 && !v6 || r2 && c2 && l2 || !n4 && l2 || !u2) + var n5 = t2 !== i2, r2 = t2 === null, u2 = t2 === t2, o2 = pt2(t2), c2 = e18 !== i2, f4 = e18 === null, l2 = e18 === e18, v6 = pt2(e18); + if (!f4 && !v6 && !o2 && t2 > e18 || o2 && c2 && l2 && !f4 && !v6 || r2 && c2 && l2 || !n5 && l2 || !u2) return 1; - if (!r2 && !o2 && !v6 && t2 < e18 || v6 && n4 && u2 && !r2 && !o2 || f3 && n4 && u2 || !c2 && u2 || !l2) + if (!r2 && !o2 && !v6 && t2 < e18 || v6 && n5 && u2 && !r2 && !o2 || f4 && n5 && u2 || !c2 && u2 || !l2) return -1; } return 0; } - function th2(t2, e18, n4) { - for (var r2 = -1, u2 = t2.criteria, o2 = e18.criteria, c2 = u2.length, f3 = n4.length; ++r2 < c2; ) { + function th2(t2, e18, n5) { + for (var r2 = -1, u2 = t2.criteria, o2 = e18.criteria, c2 = u2.length, f4 = n5.length; ++r2 < c2; ) { var l2 = gu2(u2[r2], o2[r2]); if (l2) { - if (r2 >= f3) + if (r2 >= f4) return l2; - var v6 = n4[r2]; + var v6 = n5[r2]; return l2 * (v6 == "desc" ? -1 : 1); } } return t2.index - e18.index; } - function vu2(t2, e18, n4, r2) { - for (var u2 = -1, o2 = t2.length, c2 = n4.length, f3 = -1, l2 = e18.length, v6 = V3(o2 - c2, 0), _3 = d4(l2 + v6), m3 = !r2; ++f3 < l2; ) - _3[f3] = e18[f3]; + function vu2(t2, e18, n5, r2) { + for (var u2 = -1, o2 = t2.length, c2 = n5.length, f4 = -1, l2 = e18.length, v6 = V3(o2 - c2, 0), _3 = d4(l2 + v6), m3 = !r2; ++f4 < l2; ) + _3[f4] = e18[f4]; for (; ++u2 < c2; ) - (m3 || u2 < o2) && (_3[n4[u2]] = t2[u2]); + (m3 || u2 < o2) && (_3[n5[u2]] = t2[u2]); for (; v6--; ) - _3[f3++] = t2[u2++]; + _3[f4++] = t2[u2++]; return _3; } - function _u2(t2, e18, n4, r2) { - for (var u2 = -1, o2 = t2.length, c2 = -1, f3 = n4.length, l2 = -1, v6 = e18.length, _3 = V3(o2 - f3, 0), m3 = d4(_3 + v6), C3 = !r2; ++u2 < _3; ) + function _u2(t2, e18, n5, r2) { + for (var u2 = -1, o2 = t2.length, c2 = -1, f4 = n5.length, l2 = -1, v6 = e18.length, _3 = V3(o2 - f4, 0), m3 = d4(_3 + v6), C3 = !r2; ++u2 < _3; ) m3[u2] = t2[u2]; for (var x3 = u2; ++l2 < v6; ) m3[x3 + l2] = e18[l2]; - for (; ++c2 < f3; ) - (C3 || u2 < o2) && (m3[x3 + n4[c2]] = t2[u2++]); + for (; ++c2 < f4; ) + (C3 || u2 < o2) && (m3[x3 + n5[c2]] = t2[u2++]); return m3; } function ut2(t2, e18) { - var n4 = -1, r2 = t2.length; - for (e18 || (e18 = d4(r2)); ++n4 < r2; ) - e18[n4] = t2[n4]; + var n5 = -1, r2 = t2.length; + for (e18 || (e18 = d4(r2)); ++n5 < r2; ) + e18[n5] = t2[n5]; return e18; } - function Ft2(t2, e18, n4, r2) { - var u2 = !n4; - n4 || (n4 = {}); + function Ft2(t2, e18, n5, r2) { + var u2 = !n5; + n5 || (n5 = {}); for (var o2 = -1, c2 = e18.length; ++o2 < c2; ) { - var f3 = e18[o2], l2 = r2 ? r2(n4[f3], t2[f3], f3, n4, t2) : i3; - l2 === i3 && (l2 = t2[f3]), u2 ? Yt2(n4, f3, l2) : an2(n4, f3, l2); + var f4 = e18[o2], l2 = r2 ? r2(n5[f4], t2[f4], f4, n5, t2) : i2; + l2 === i2 && (l2 = t2[f4]), u2 ? Yt2(n5, f4, l2) : an2(n5, f4, l2); } - return n4; + return n5; } function eh2(t2, e18) { - return Ft2(t2, _i3(t2), e18); + return Ft2(t2, _i2(t2), e18); } function nh2(t2, e18) { return Ft2(t2, bu(t2), e18); } function Qn2(t2, e18) { - return function(n4, r2) { - var u2 = b2(n4) ? uc2 : xf2, o2 = e18 ? e18() : {}; - return u2(n4, t2, E2(r2, 2), o2); + return function(n5, r2) { + var u2 = b2(n5) ? uc2 : xf2, o2 = e18 ? e18() : {}; + return u2(n5, t2, E2(r2, 2), o2); }; } function Fe2(t2) { - return H2(function(e18, n4) { - var r2 = -1, u2 = n4.length, o2 = u2 > 1 ? n4[u2 - 1] : i3, c2 = u2 > 2 ? n4[2] : i3; - for (o2 = t2.length > 3 && typeof o2 == "function" ? (u2--, o2) : i3, c2 && it2(n4[0], n4[1], c2) && (o2 = u2 < 3 ? i3 : o2, u2 = 1), e18 = M3(e18); ++r2 < u2; ) { - var f3 = n4[r2]; - f3 && t2(e18, f3, r2, o2); + return H2(function(e18, n5) { + var r2 = -1, u2 = n5.length, o2 = u2 > 1 ? n5[u2 - 1] : i2, c2 = u2 > 2 ? n5[2] : i2; + for (o2 = t2.length > 3 && typeof o2 == "function" ? (u2--, o2) : i2, c2 && it2(n5[0], n5[1], c2) && (o2 = u2 < 3 ? i2 : o2, u2 = 1), e18 = M3(e18); ++r2 < u2; ) { + var f4 = n5[r2]; + f4 && t2(e18, f4, r2, o2); } return e18; }); } function mu2(t2, e18) { - return function(n4, r2) { - if (n4 == null) - return n4; - if (!at2(n4)) - return t2(n4, r2); - for (var u2 = n4.length, o2 = e18 ? u2 : -1, c2 = M3(n4); (e18 ? o2-- : ++o2 < u2) && r2(c2[o2], o2, c2) !== false; ) + return function(n5, r2) { + if (n5 == null) + return n5; + if (!at2(n5)) + return t2(n5, r2); + for (var u2 = n5.length, o2 = e18 ? u2 : -1, c2 = M3(n5); (e18 ? o2-- : ++o2 < u2) && r2(c2[o2], o2, c2) !== false; ) ; - return n4; + return n5; }; } function wu(t2) { - return function(e18, n4, r2) { - for (var u2 = -1, o2 = M3(e18), c2 = r2(e18), f3 = c2.length; f3--; ) { - var l2 = c2[t2 ? f3 : ++u2]; - if (n4(o2[l2], l2, o2) === false) + return function(e18, n5, r2) { + for (var u2 = -1, o2 = M3(e18), c2 = r2(e18), f4 = c2.length; f4--; ) { + var l2 = c2[t2 ? f4 : ++u2]; + if (n5(o2[l2], l2, o2) === false) break; } return e18; }; } - function rh2(t2, e18, n4) { + function rh2(t2, e18, n5) { var r2 = e18 & vt2, u2 = ln2(t2); function o2() { var c2 = this && this !== j2 && this instanceof o2 ? u2 : t2; - return c2.apply(r2 ? n4 : this, arguments); + return c2.apply(r2 ? n5 : this, arguments); } return o2; } function Pu2(t2) { return function(e18) { e18 = q2(e18); - var n4 = Le2(e18) ? St2(e18) : i3, r2 = n4 ? n4[0] : e18.charAt(0), u2 = n4 ? ce2(n4, 1).join("") : e18.slice(1); + var n5 = Le2(e18) ? St2(e18) : i2, r2 = n5 ? n5[0] : e18.charAt(0), u2 = n5 ? ce2(n5, 1).join("") : e18.slice(1); return r2[t2]() + u2; }; } @@ -115026,39 +44332,39 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : case 7: return new t2(e18[0], e18[1], e18[2], e18[3], e18[4], e18[5], e18[6]); } - var n4 = qe2(t2.prototype), r2 = t2.apply(n4, e18); - return K3(r2) ? r2 : n4; + var n5 = qe2(t2.prototype), r2 = t2.apply(n5, e18); + return K3(r2) ? r2 : n5; }; } - function ih2(t2, e18, n4) { + function ih2(t2, e18, n5) { var r2 = ln2(t2); function u2() { - for (var o2 = arguments.length, c2 = d4(o2), f3 = o2, l2 = Me2(u2); f3--; ) - c2[f3] = arguments[f3]; + for (var o2 = arguments.length, c2 = d4(o2), f4 = o2, l2 = Me2(u2); f4--; ) + c2[f4] = arguments[f4]; var v6 = o2 < 3 && c2[0] !== l2 && c2[o2 - 1] !== l2 ? [] : ie2(c2, l2); - if (o2 -= v6.length, o2 < n4) - return Eu2(t2, e18, Vn2, u2.placeholder, i3, c2, v6, i3, i3, n4 - o2); + if (o2 -= v6.length, o2 < n5) + return Eu2(t2, e18, Vn2, u2.placeholder, i2, c2, v6, i2, i2, n5 - o2); var _3 = this && this !== j2 && this instanceof u2 ? r2 : t2; return ft2(_3, this, c2); } return u2; } function Cu2(t2) { - return function(e18, n4, r2) { + return function(e18, n5, r2) { var u2 = M3(e18); if (!at2(e18)) { - var o2 = E2(n4, 3); - e18 = k2(e18), n4 = function(f3) { - return o2(u2[f3], f3, u2); + var o2 = E2(n5, 3); + e18 = k2(e18), n5 = function(f4) { + return o2(u2[f4], f4, u2); }; } - var c2 = t2(e18, n4, r2); - return c2 > -1 ? u2[o2 ? e18[c2] : c2] : i3; + var c2 = t2(e18, n5, r2); + return c2 > -1 ? u2[o2 ? e18[c2] : c2] : i2; }; } function Au(t2) { return Xt2(function(e18) { - var n4 = e18.length, r2 = n4, u2 = Pt2.prototype.thru; + var n5 = e18.length, r2 = n5, u2 = Pt2.prototype.thru; for (t2 && e18.reverse(); r2--; ) { var o2 = e18[r2]; if (typeof o2 != "function") @@ -115066,23 +44372,23 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : if (u2 && !c2 && er2(o2) == "wrapper") var c2 = new Pt2([], true); } - for (r2 = c2 ? r2 : n4; ++r2 < n4; ) { + for (r2 = c2 ? r2 : n5; ++r2 < n5; ) { o2 = e18[r2]; - var f3 = er2(o2), l2 = f3 == "wrapper" ? gi2(o2) : i3; - l2 && wi2(l2[0]) && l2[1] == (Gt2 | Nt2 | $t2 | Je2) && !l2[4].length && l2[9] == 1 ? c2 = c2[er2(l2[0])].apply(c2, l2[3]) : c2 = o2.length == 1 && wi2(o2) ? c2[f3]() : c2.thru(o2); + var f4 = er2(o2), l2 = f4 == "wrapper" ? gi2(o2) : i2; + l2 && wi2(l2[0]) && l2[1] == (Gt2 | Nt2 | $t2 | Je2) && !l2[4].length && l2[9] == 1 ? c2 = c2[er2(l2[0])].apply(c2, l2[3]) : c2 = o2.length == 1 && wi2(o2) ? c2[f4]() : c2.thru(o2); } return function() { var v6 = arguments, _3 = v6[0]; if (c2 && v6.length == 1 && b2(_3)) return c2.plant(_3).value(); - for (var m3 = 0, C3 = n4 ? e18[m3].apply(this, v6) : _3; ++m3 < n4; ) + for (var m3 = 0, C3 = n5 ? e18[m3].apply(this, v6) : _3; ++m3 < n5; ) C3 = e18[m3].call(this, C3); return C3; }; }); } - function Vn2(t2, e18, n4, r2, u2, o2, c2, f3, l2, v6) { - var _3 = e18 & Gt2, m3 = e18 & vt2, C3 = e18 & he2, x3 = e18 & (Nt2 | ye2), S4 = e18 & gr2, L4 = C3 ? i3 : ln2(t2); + function Vn2(t2, e18, n5, r2, u2, o2, c2, f4, l2, v6) { + var _3 = e18 & Gt2, m3 = e18 & vt2, C3 = e18 & he2, x3 = e18 & (Nt2 | ye2), S4 = e18 & gr2, L4 = C3 ? i2 : ln2(t2); function O3() { for (var D2 = arguments.length, $ = d4(D2), dt2 = D2; dt2--; ) $[dt2] = arguments[dt2]; @@ -115090,84 +44396,84 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var st2 = Me2(O3), gt2 = gc2($, st2); if (r2 && ($ = vu2($, r2, u2, x3)), o2 && ($ = _u2($, o2, c2, x3)), D2 -= gt2, x3 && D2 < v6) { var X2 = ie2($, st2); - return Eu2(t2, e18, Vn2, O3.placeholder, n4, $, X2, f3, l2, v6 - D2); + return Eu2(t2, e18, Vn2, O3.placeholder, n5, $, X2, f4, l2, v6 - D2); } - var bt2 = m3 ? n4 : this, jt2 = C3 ? bt2[t2] : t2; - return D2 = $.length, f3 ? $ = xh2($, f3) : S4 && D2 > 1 && $.reverse(), _3 && l2 < D2 && ($.length = l2), this && this !== j2 && this instanceof O3 && (jt2 = L4 || ln2(jt2)), jt2.apply(bt2, $); + var bt2 = m3 ? n5 : this, jt2 = C3 ? bt2[t2] : t2; + return D2 = $.length, f4 ? $ = xh2($, f4) : S4 && D2 > 1 && $.reverse(), _3 && l2 < D2 && ($.length = l2), this && this !== j2 && this instanceof O3 && (jt2 = L4 || ln2(jt2)), jt2.apply(bt2, $); } return O3; } function Iu2(t2, e18) { - return function(n4, r2) { - return Lf2(n4, t2, e18(r2), {}); + return function(n5, r2) { + return Lf2(n5, t2, e18(r2), {}); }; } function kn2(t2, e18) { - return function(n4, r2) { + return function(n5, r2) { var u2; - if (n4 === i3 && r2 === i3) + if (n5 === i2 && r2 === i2) return e18; - if (n4 !== i3 && (u2 = n4), r2 !== i3) { - if (u2 === i3) + if (n5 !== i2 && (u2 = n5), r2 !== i2) { + if (u2 === i2) return r2; - typeof n4 == "string" || typeof r2 == "string" ? (n4 = lt2(n4), r2 = lt2(r2)) : (n4 = ou2(n4), r2 = ou2(r2)), u2 = t2(n4, r2); + typeof n5 == "string" || typeof r2 == "string" ? (n5 = lt2(n5), r2 = lt2(r2)) : (n5 = ou2(n5), r2 = ou2(r2)), u2 = t2(n5, r2); } return u2; }; } function hi2(t2) { return Xt2(function(e18) { - return e18 = z3(e18, ht2(E2())), H2(function(n4) { + return e18 = z3(e18, ht2(E2())), H2(function(n5) { var r2 = this; return t2(e18, function(u2) { - return ft2(u2, r2, n4); + return ft2(u2, r2, n5); }); }); }); } function jn2(t2, e18) { - e18 = e18 === i3 ? " " : lt2(e18); - var n4 = e18.length; - if (n4 < 2) - return n4 ? ii2(e18, t2) : e18; + e18 = e18 === i2 ? " " : lt2(e18); + var n5 = e18.length; + if (n5 < 2) + return n5 ? ii2(e18, t2) : e18; var r2 = ii2(e18, Fn2(t2 / He2(e18))); return Le2(e18) ? ce2(St2(r2), 0, t2).join("") : r2.slice(0, t2); } - function sh2(t2, e18, n4, r2) { + function sh2(t2, e18, n5, r2) { var u2 = e18 & vt2, o2 = ln2(t2); function c2() { - for (var f3 = -1, l2 = arguments.length, v6 = -1, _3 = r2.length, m3 = d4(_3 + l2), C3 = this && this !== j2 && this instanceof c2 ? o2 : t2; ++v6 < _3; ) + for (var f4 = -1, l2 = arguments.length, v6 = -1, _3 = r2.length, m3 = d4(_3 + l2), C3 = this && this !== j2 && this instanceof c2 ? o2 : t2; ++v6 < _3; ) m3[v6] = r2[v6]; for (; l2--; ) - m3[v6++] = arguments[++f3]; - return ft2(C3, u2 ? n4 : this, m3); + m3[v6++] = arguments[++f4]; + return ft2(C3, u2 ? n5 : this, m3); } return c2; } function xu2(t2) { - return function(e18, n4, r2) { - return r2 && typeof r2 != "number" && it2(e18, n4, r2) && (n4 = r2 = i3), e18 = kt2(e18), n4 === i3 ? (n4 = e18, e18 = 0) : n4 = kt2(n4), r2 = r2 === i3 ? e18 < n4 ? 1 : -1 : kt2(r2), zf2(e18, n4, r2, t2); + return function(e18, n5, r2) { + return r2 && typeof r2 != "number" && it2(e18, n5, r2) && (n5 = r2 = i2), e18 = kt2(e18), n5 === i2 ? (n5 = e18, e18 = 0) : n5 = kt2(n5), r2 = r2 === i2 ? e18 < n5 ? 1 : -1 : kt2(r2), zf2(e18, n5, r2, t2); }; } function tr2(t2) { - return function(e18, n4) { - return typeof e18 == "string" && typeof n4 == "string" || (e18 = xt2(e18), n4 = xt2(n4)), t2(e18, n4); + return function(e18, n5) { + return typeof e18 == "string" && typeof n5 == "string" || (e18 = xt2(e18), n5 = xt2(n5)), t2(e18, n5); }; } - function Eu2(t2, e18, n4, r2, u2, o2, c2, f3, l2, v6) { - var _3 = e18 & Nt2, m3 = _3 ? c2 : i3, C3 = _3 ? i3 : c2, x3 = _3 ? o2 : i3, S4 = _3 ? i3 : o2; + function Eu2(t2, e18, n5, r2, u2, o2, c2, f4, l2, v6) { + var _3 = e18 & Nt2, m3 = _3 ? c2 : i2, C3 = _3 ? i2 : c2, x3 = _3 ? o2 : i2, S4 = _3 ? i2 : o2; e18 |= _3 ? $t2 : Se2, e18 &= ~(_3 ? Se2 : $t2), e18 & Gi2 || (e18 &= ~(vt2 | he2)); - var L4 = [t2, e18, u2, x3, m3, S4, C3, f3, l2, v6], O3 = n4.apply(i3, L4); + var L4 = [t2, e18, u2, x3, m3, S4, C3, f4, l2, v6], O3 = n5.apply(i2, L4); return wi2(t2) && Uu2(O3, L4), O3.placeholder = r2, qu2(O3, t2, e18); } function li2(t2) { var e18 = Q2[t2]; - return function(n4, r2) { - if (n4 = xt2(n4), r2 = r2 == null ? 0 : et2(T9(r2), 292), r2 && qs2(n4)) { - var u2 = (q2(n4) + "e").split("e"), o2 = e18(u2[0] + "e" + (+u2[1] + r2)); + return function(n5, r2) { + if (n5 = xt2(n5), r2 = r2 == null ? 0 : et2(T9(r2), 292), r2 && qs2(n5)) { + var u2 = (q2(n5) + "e").split("e"), o2 = e18(u2[0] + "e" + (+u2[1] + r2)); return u2 = (q2(o2) + "e").split("e"), +(u2[0] + "e" + (+u2[1] - r2)); } - return e18(n4); + return e18(n5); }; } var uh2 = $e2 && 1 / Rn2(new $e2([, -0]))[1] == le2 ? function(t2) { @@ -115175,49 +44481,49 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } : Di2; function yu(t2) { return function(e18) { - var n4 = nt2(e18); - return n4 == Et2 ? Br2(e18) : n4 == yt2 ? Ac2(e18) : dc2(e18, t2(e18)); + var n5 = nt2(e18); + return n5 == Et2 ? Br2(e18) : n5 == yt2 ? Ac2(e18) : dc2(e18, t2(e18)); }; } - function Zt2(t2, e18, n4, r2, u2, o2, c2, f3) { + function Zt2(t2, e18, n5, r2, u2, o2, c2, f4) { var l2 = e18 & he2; if (!l2 && typeof t2 != "function") throw new wt2(y3); var v6 = r2 ? r2.length : 0; - if (v6 || (e18 &= ~($t2 | Se2), r2 = u2 = i3), c2 = c2 === i3 ? c2 : V3(T9(c2), 0), f3 = f3 === i3 ? f3 : T9(f3), v6 -= u2 ? u2.length : 0, e18 & Se2) { + if (v6 || (e18 &= ~($t2 | Se2), r2 = u2 = i2), c2 = c2 === i2 ? c2 : V3(T9(c2), 0), f4 = f4 === i2 ? f4 : T9(f4), v6 -= u2 ? u2.length : 0, e18 & Se2) { var _3 = r2, m3 = u2; - r2 = u2 = i3; + r2 = u2 = i2; } - var C3 = l2 ? i3 : gi2(t2), x3 = [t2, e18, n4, r2, u2, _3, m3, o2, c2, f3]; - if (C3 && Ch2(x3, C3), t2 = x3[0], e18 = x3[1], n4 = x3[2], r2 = x3[3], u2 = x3[4], f3 = x3[9] = x3[9] === i3 ? l2 ? 0 : t2.length : V3(x3[9] - v6, 0), !f3 && e18 & (Nt2 | ye2) && (e18 &= ~(Nt2 | ye2)), !e18 || e18 == vt2) - var S4 = rh2(t2, e18, n4); + var C3 = l2 ? i2 : gi2(t2), x3 = [t2, e18, n5, r2, u2, _3, m3, o2, c2, f4]; + if (C3 && Ch2(x3, C3), t2 = x3[0], e18 = x3[1], n5 = x3[2], r2 = x3[3], u2 = x3[4], f4 = x3[9] = x3[9] === i2 ? l2 ? 0 : t2.length : V3(x3[9] - v6, 0), !f4 && e18 & (Nt2 | ye2) && (e18 &= ~(Nt2 | ye2)), !e18 || e18 == vt2) + var S4 = rh2(t2, e18, n5); else - e18 == Nt2 || e18 == ye2 ? S4 = ih2(t2, e18, f3) : (e18 == $t2 || e18 == (vt2 | $t2)) && !u2.length ? S4 = sh2(t2, e18, n4, r2) : S4 = Vn2.apply(i3, x3); + e18 == Nt2 || e18 == ye2 ? S4 = ih2(t2, e18, f4) : (e18 == $t2 || e18 == (vt2 | $t2)) && !u2.length ? S4 = sh2(t2, e18, n5, r2) : S4 = Vn2.apply(i2, x3); var L4 = C3 ? uu2 : Uu2; return qu2(L4(S4, x3), t2, e18); } - function Su2(t2, e18, n4, r2) { - return t2 === i3 || Rt2(t2, Ne2[n4]) && !W2.call(r2, n4) ? e18 : t2; + function Su2(t2, e18, n5, r2) { + return t2 === i2 || Rt2(t2, Ne2[n5]) && !W2.call(r2, n5) ? e18 : t2; } - function Ou2(t2, e18, n4, r2, u2, o2) { - return K3(t2) && K3(e18) && (o2.set(e18, t2), Yn2(t2, e18, i3, Ou2, o2), o2.delete(e18)), t2; + function Ou2(t2, e18, n5, r2, u2, o2) { + return K3(t2) && K3(e18) && (o2.set(e18, t2), Yn2(t2, e18, i2, Ou2, o2), o2.delete(e18)), t2; } function ah2(t2) { - return gn2(t2) ? i3 : t2; + return gn2(t2) ? i2 : t2; } - function Ru2(t2, e18, n4, r2, u2, o2) { - var c2 = n4 & Ee2, f3 = t2.length, l2 = e18.length; - if (f3 != l2 && !(c2 && l2 > f3)) + function Ru2(t2, e18, n5, r2, u2, o2) { + var c2 = n5 & Ee2, f4 = t2.length, l2 = e18.length; + if (f4 != l2 && !(c2 && l2 > f4)) return false; var v6 = o2.get(t2), _3 = o2.get(e18); if (v6 && _3) return v6 == e18 && _3 == t2; - var m3 = -1, C3 = true, x3 = n4 & mn2 ? new ve2() : i3; - for (o2.set(t2, e18), o2.set(e18, t2); ++m3 < f3; ) { + var m3 = -1, C3 = true, x3 = n5 & mn2 ? new ve2() : i2; + for (o2.set(t2, e18), o2.set(e18, t2); ++m3 < f4; ) { var S4 = t2[m3], L4 = e18[m3]; if (r2) var O3 = c2 ? r2(L4, S4, m3, e18, t2, o2) : r2(S4, L4, m3, t2, e18, o2); - if (O3 !== i3) { + if (O3 !== i2) { if (O3) continue; C3 = false; @@ -115225,21 +44531,21 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } if (x3) { if (!$r2(e18, function(D2, $) { - if (!tn2(x3, $) && (S4 === D2 || u2(S4, D2, n4, r2, o2))) + if (!tn2(x3, $) && (S4 === D2 || u2(S4, D2, n5, r2, o2))) return x3.push($); })) { C3 = false; break; } - } else if (!(S4 === L4 || u2(S4, L4, n4, r2, o2))) { + } else if (!(S4 === L4 || u2(S4, L4, n5, r2, o2))) { C3 = false; break; } } return o2.delete(t2), o2.delete(e18), C3; } - function oh2(t2, e18, n4, r2, u2, o2, c2) { - switch (n4) { + function oh2(t2, e18, n5, r2, u2, o2, c2) { + switch (n5) { case Re2: if (t2.byteLength != e18.byteLength || t2.byteOffset != e18.byteOffset) return false; @@ -115256,16 +44562,16 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : case Ve2: return t2 == e18 + ""; case Et2: - var f3 = Br2; + var f4 = Br2; case yt2: var l2 = r2 & Ee2; - if (f3 || (f3 = Rn2), t2.size != e18.size && !l2) + if (f4 || (f4 = Rn2), t2.size != e18.size && !l2) return false; var v6 = c2.get(t2); if (v6) return v6 == e18; r2 |= mn2, c2.set(t2, e18); - var _3 = Ru2(f3(t2), f3(e18), r2, u2, o2, c2); + var _3 = Ru2(f4(t2), f4(e18), r2, u2, o2, c2); return c2.delete(t2), _3; case In2: if (un2) @@ -115273,12 +44579,12 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } return false; } - function ch2(t2, e18, n4, r2, u2, o2) { - var c2 = n4 & Ee2, f3 = pi2(t2), l2 = f3.length, v6 = pi2(e18), _3 = v6.length; + function ch2(t2, e18, n5, r2, u2, o2) { + var c2 = n5 & Ee2, f4 = pi2(t2), l2 = f4.length, v6 = pi2(e18), _3 = v6.length; if (l2 != _3 && !c2) return false; for (var m3 = l2; m3--; ) { - var C3 = f3[m3]; + var C3 = f4[m3]; if (!(c2 ? C3 in e18 : W2.call(e18, C3))) return false; } @@ -115288,11 +44594,11 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var L4 = true; o2.set(t2, e18), o2.set(e18, t2); for (var O3 = c2; ++m3 < l2; ) { - C3 = f3[m3]; + C3 = f4[m3]; var D2 = t2[C3], $ = e18[C3]; if (r2) var dt2 = c2 ? r2($, D2, C3, e18, t2, o2) : r2(D2, $, C3, t2, e18, o2); - if (!(dt2 === i3 ? D2 === $ || u2(D2, $, n4, r2, o2) : dt2)) { + if (!(dt2 === i2 ? D2 === $ || u2(D2, $, n5, r2, o2) : dt2)) { L4 = false; break; } @@ -115305,10 +44611,10 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return o2.delete(t2), o2.delete(e18), L4; } function Xt2(t2) { - return Ci2(Nu2(t2, i3, zu2), t2 + ""); + return Ci2(Nu2(t2, i2, zu2), t2 + ""); } function pi2(t2) { - return Xs2(t2, k2, _i3); + return Xs2(t2, k2, _i2); } function di2(t2) { return Xs2(t2, ot2, bu); @@ -115317,8 +44623,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return Mn.get(t2); } : Di2; function er2(t2) { - for (var e18 = t2.name + "", n4 = Ue2[e18], r2 = W2.call(Ue2, e18) ? n4.length : 0; r2--; ) { - var u2 = n4[r2], o2 = u2.func; + for (var e18 = t2.name + "", n5 = Ue2[e18], r2 = W2.call(Ue2, e18) ? n5.length : 0; r2--; ) { + var u2 = n5[r2], o2 = u2.func; if (o2 == null || o2 == t2) return u2.name; } @@ -115333,41 +44639,41 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return t2 = t2 === Li2 ? ks2 : t2, arguments.length ? t2(arguments[0], arguments[1]) : t2; } function nr2(t2, e18) { - var n4 = t2.__data__; - return _h3(e18) ? n4[typeof e18 == "string" ? "string" : "hash"] : n4.map; + var n5 = t2.__data__; + return _h3(e18) ? n5[typeof e18 == "string" ? "string" : "hash"] : n5.map; } function vi2(t2) { - for (var e18 = k2(t2), n4 = e18.length; n4--; ) { - var r2 = e18[n4], u2 = t2[r2]; - e18[n4] = [r2, u2, Hu2(u2)]; + for (var e18 = k2(t2), n5 = e18.length; n5--; ) { + var r2 = e18[n5], u2 = t2[r2]; + e18[n5] = [r2, u2, Hu2(u2)]; } return e18; } function we2(t2, e18) { - var n4 = wc2(t2, e18); - return Vs2(n4) ? n4 : i3; + var n5 = wc2(t2, e18); + return Vs2(n5) ? n5 : i2; } function fh2(t2) { - var e18 = W2.call(t2, de2), n4 = t2[de2]; + var e18 = W2.call(t2, de2), n5 = t2[de2]; try { - t2[de2] = i3; + t2[de2] = i2; var r2 = true; } catch { } var u2 = Hn2.call(t2); - return r2 && (e18 ? t2[de2] = n4 : delete t2[de2]), u2; + return r2 && (e18 ? t2[de2] = n5 : delete t2[de2]), u2; } - var _i3 = zr2 ? function(t2) { + var _i2 = zr2 ? function(t2) { return t2 == null ? [] : (t2 = M3(t2), ne2(zr2(t2), function(e18) { return $s2.call(t2, e18); })); } : Ni2, bu = zr2 ? function(t2) { for (var e18 = []; t2; ) - re2(e18, _i3(t2)), t2 = $n2(t2); + re2(e18, _i2(t2)), t2 = $n2(t2); return e18; } : Ni2, nt2 = rt2; (Kr2 && nt2(new Kr2(new ArrayBuffer(1))) != Re2 || nn2 && nt2(new nn2()) != Et2 || Jr2 && nt2(Jr2.resolve()) != Ji2 || $e2 && nt2(new $e2()) != yt2 || rn2 && nt2(new rn2()) != ke2) && (nt2 = function(t2) { - var e18 = rt2(t2), n4 = e18 == zt2 ? t2.constructor : i3, r2 = n4 ? Pe2(n4) : ""; + var e18 = rt2(t2), n5 = e18 == zt2 ? t2.constructor : i2, r2 = n5 ? Pe2(n5) : ""; if (r2) switch (r2) { case Kc2: @@ -115383,9 +44689,9 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } return e18; }); - function hh2(t2, e18, n4) { - for (var r2 = -1, u2 = n4.length; ++r2 < u2; ) { - var o2 = n4[r2], c2 = o2.size; + function hh2(t2, e18, n5) { + for (var r2 = -1, u2 = n5.length; ++r2 < u2; ) { + var o2 = n5[r2], c2 = o2.size; switch (o2.type) { case "drop": t2 += c2; @@ -115407,24 +44713,24 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var e18 = t2.match(_o3); return e18 ? e18[1].split(mo) : []; } - function Tu2(t2, e18, n4) { + function Tu2(t2, e18, n5) { e18 = oe2(e18, t2); for (var r2 = -1, u2 = e18.length, o2 = false; ++r2 < u2; ) { var c2 = Wt2(e18[r2]); - if (!(o2 = t2 != null && n4(t2, c2))) + if (!(o2 = t2 != null && n5(t2, c2))) break; t2 = t2[c2]; } return o2 || ++r2 != u2 ? o2 : (u2 = t2 == null ? 0 : t2.length, !!u2 && cr2(u2) && Qt2(c2, u2) && (b2(t2) || Ce2(t2))); } function ph2(t2) { - var e18 = t2.length, n4 = new t2.constructor(e18); - return e18 && typeof t2[0] == "string" && W2.call(t2, "index") && (n4.index = t2.index, n4.input = t2.input), n4; + var e18 = t2.length, n5 = new t2.constructor(e18); + return e18 && typeof t2[0] == "string" && W2.call(t2, "index") && (n5.index = t2.index, n5.input = t2.input), n5; } function Lu2(t2) { return typeof t2.constructor == "function" && !pn2(t2) ? qe2($n2(t2)) : {}; } - function dh2(t2, e18, n4) { + function dh2(t2, e18, n5) { var r2 = t2.constructor; switch (e18) { case je2: @@ -115433,9 +44739,9 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : case Ze2: return new r2(+t2); case Re2: - return Vf2(t2, n4); + return Vf2(t2, n5); case vr3: - case _r4: + case _r3: case mr2: case wr2: case Pr2: @@ -115443,7 +44749,7 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : case Ar2: case Ir2: case xr2: - return du2(t2, n4); + return du2(t2, n5); case Et2: return new r2(); case Xe2: @@ -115458,11 +44764,11 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } } function gh2(t2, e18) { - var n4 = e18.length; - if (!n4) + var n5 = e18.length; + if (!n5) return t2; - var r2 = n4 - 1; - return e18[r2] = (n4 > 1 ? "& " : "") + e18[r2], e18 = e18.join(n4 > 2 ? ", " : " "), t2.replace(vo2, `{ + var r2 = n5 - 1; + return e18[r2] = (n5 > 1 ? "& " : "") + e18[r2], e18 = e18.join(n5 > 2 ? ", " : " "), t2.replace(vo2, `{ /* [wrapped with ` + e18 + `] */ `); } @@ -115470,32 +44776,32 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return b2(t2) || Ce2(t2) || !!(Us2 && t2 && t2[Us2]); } function Qt2(t2, e18) { - var n4 = typeof t2; - return e18 = e18 ?? ee2, !!e18 && (n4 == "number" || n4 != "symbol" && So2.test(t2)) && t2 > -1 && t2 % 1 == 0 && t2 < e18; + var n5 = typeof t2; + return e18 = e18 ?? ee2, !!e18 && (n5 == "number" || n5 != "symbol" && So2.test(t2)) && t2 > -1 && t2 % 1 == 0 && t2 < e18; } - function it2(t2, e18, n4) { - if (!K3(n4)) + function it2(t2, e18, n5) { + if (!K3(n5)) return false; var r2 = typeof e18; - return (r2 == "number" ? at2(n4) && Qt2(e18, n4.length) : r2 == "string" && e18 in n4) ? Rt2(n4[e18], t2) : false; + return (r2 == "number" ? at2(n5) && Qt2(e18, n5.length) : r2 == "string" && e18 in n5) ? Rt2(n5[e18], t2) : false; } function mi2(t2, e18) { if (b2(t2)) return false; - var n4 = typeof t2; - return n4 == "number" || n4 == "symbol" || n4 == "boolean" || t2 == null || pt2(t2) ? true : ho2.test(t2) || !fo.test(t2) || e18 != null && t2 in M3(e18); + var n5 = typeof t2; + return n5 == "number" || n5 == "symbol" || n5 == "boolean" || t2 == null || pt2(t2) ? true : ho2.test(t2) || !fo.test(t2) || e18 != null && t2 in M3(e18); } function _h3(t2) { var e18 = typeof t2; return e18 == "string" || e18 == "number" || e18 == "symbol" || e18 == "boolean" ? t2 !== "__proto__" : t2 === null; } function wi2(t2) { - var e18 = er2(t2), n4 = a3[e18]; - if (typeof n4 != "function" || !(e18 in N2.prototype)) + var e18 = er2(t2), n5 = a3[e18]; + if (typeof n5 != "function" || !(e18 in N2.prototype)) return false; - if (t2 === n4) + if (t2 === n5) return true; - var r2 = gi2(n4); + var r2 = gi2(n5); return !!r2 && t2 === r2[0]; } function mh2(t2) { @@ -115503,62 +44809,62 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } var wh2 = Tn2 ? Vt2 : $i2; function pn2(t2) { - var e18 = t2 && t2.constructor, n4 = typeof e18 == "function" && e18.prototype || Ne2; - return t2 === n4; + var e18 = t2 && t2.constructor, n5 = typeof e18 == "function" && e18.prototype || Ne2; + return t2 === n5; } function Hu2(t2) { return t2 === t2 && !K3(t2); } function Du2(t2, e18) { - return function(n4) { - return n4 == null ? false : n4[t2] === e18 && (e18 !== i3 || t2 in M3(n4)); + return function(n5) { + return n5 == null ? false : n5[t2] === e18 && (e18 !== i2 || t2 in M3(n5)); }; } function Ph2(t2) { var e18 = ar2(t2, function(r2) { - return n4.size === Ke2 && n4.clear(), r2; - }), n4 = e18.cache; + return n5.size === Ke2 && n5.clear(), r2; + }), n5 = e18.cache; return e18; } function Ch2(t2, e18) { - var n4 = t2[1], r2 = e18[1], u2 = n4 | r2, o2 = u2 < (vt2 | he2 | Gt2), c2 = r2 == Gt2 && n4 == Nt2 || r2 == Gt2 && n4 == Je2 && t2[7].length <= e18[8] || r2 == (Gt2 | Je2) && e18[7].length <= e18[8] && n4 == Nt2; + var n5 = t2[1], r2 = e18[1], u2 = n5 | r2, o2 = u2 < (vt2 | he2 | Gt2), c2 = r2 == Gt2 && n5 == Nt2 || r2 == Gt2 && n5 == Je2 && t2[7].length <= e18[8] || r2 == (Gt2 | Je2) && e18[7].length <= e18[8] && n5 == Nt2; if (!(o2 || c2)) return t2; - r2 & vt2 && (t2[2] = e18[2], u2 |= n4 & vt2 ? 0 : Gi2); - var f3 = e18[3]; - if (f3) { + r2 & vt2 && (t2[2] = e18[2], u2 |= n5 & vt2 ? 0 : Gi2); + var f4 = e18[3]; + if (f4) { var l2 = t2[3]; - t2[3] = l2 ? vu2(l2, f3, e18[4]) : f3, t2[4] = l2 ? ie2(t2[3], Ie2) : e18[4]; + t2[3] = l2 ? vu2(l2, f4, e18[4]) : f4, t2[4] = l2 ? ie2(t2[3], Ie2) : e18[4]; } - return f3 = e18[5], f3 && (l2 = t2[5], t2[5] = l2 ? _u2(l2, f3, e18[6]) : f3, t2[6] = l2 ? ie2(t2[5], Ie2) : e18[6]), f3 = e18[7], f3 && (t2[7] = f3), r2 & Gt2 && (t2[8] = t2[8] == null ? e18[8] : et2(t2[8], e18[8])), t2[9] == null && (t2[9] = e18[9]), t2[0] = e18[0], t2[1] = u2, t2; + return f4 = e18[5], f4 && (l2 = t2[5], t2[5] = l2 ? _u2(l2, f4, e18[6]) : f4, t2[6] = l2 ? ie2(t2[5], Ie2) : e18[6]), f4 = e18[7], f4 && (t2[7] = f4), r2 & Gt2 && (t2[8] = t2[8] == null ? e18[8] : et2(t2[8], e18[8])), t2[9] == null && (t2[9] = e18[9]), t2[0] = e18[0], t2[1] = u2, t2; } function Ah2(t2) { var e18 = []; if (t2 != null) - for (var n4 in M3(t2)) - e18.push(n4); + for (var n5 in M3(t2)) + e18.push(n5); return e18; } function Ih2(t2) { return Hn2.call(t2); } - function Nu2(t2, e18, n4) { - return e18 = V3(e18 === i3 ? t2.length - 1 : e18, 0), function() { + function Nu2(t2, e18, n5) { + return e18 = V3(e18 === i2 ? t2.length - 1 : e18, 0), function() { for (var r2 = arguments, u2 = -1, o2 = V3(r2.length - e18, 0), c2 = d4(o2); ++u2 < o2; ) c2[u2] = r2[e18 + u2]; u2 = -1; - for (var f3 = d4(e18 + 1); ++u2 < e18; ) - f3[u2] = r2[u2]; - return f3[e18] = n4(c2), ft2(t2, this, f3); + for (var f4 = d4(e18 + 1); ++u2 < e18; ) + f4[u2] = r2[u2]; + return f4[e18] = n5(c2), ft2(t2, this, f4); }; } function $u2(t2, e18) { return e18.length < 2 ? t2 : me2(t2, At2(e18, 0, -1)); } function xh2(t2, e18) { - for (var n4 = t2.length, r2 = et2(e18.length, n4), u2 = ut2(t2); r2--; ) { + for (var n5 = t2.length, r2 = et2(e18.length, n5), u2 = ut2(t2); r2--; ) { var o2 = e18[r2]; - t2[r2] = Qt2(o2, n4) ? u2[o2] : i3; + t2[r2] = Qt2(o2, n5) ? u2[o2] : i2; } return t2; } @@ -115569,34 +44875,34 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var Uu2 = Fu2(uu2), dn2 = qc2 || function(t2, e18) { return j2.setTimeout(t2, e18); }, Ci2 = Fu2(Yf2); - function qu2(t2, e18, n4) { + function qu2(t2, e18, n5) { var r2 = e18 + ""; - return Ci2(t2, gh2(r2, Eh2(lh2(r2), n4))); + return Ci2(t2, gh2(r2, Eh2(lh2(r2), n5))); } function Fu2(t2) { - var e18 = 0, n4 = 0; + var e18 = 0, n5 = 0; return function() { - var r2 = Bc2(), u2 = za2 - (r2 - n4); - if (n4 = r2, u2 > 0) { + var r2 = Bc2(), u2 = za2 - (r2 - n5); + if (n5 = r2, u2 > 0) { if (++e18 >= Ga2) return arguments[0]; } else e18 = 0; - return t2.apply(i3, arguments); + return t2.apply(i2, arguments); }; } function rr2(t2, e18) { - var n4 = -1, r2 = t2.length, u2 = r2 - 1; - for (e18 = e18 === i3 ? r2 : e18; ++n4 < e18; ) { - var o2 = ri2(n4, u2), c2 = t2[o2]; - t2[o2] = t2[n4], t2[n4] = c2; + var n5 = -1, r2 = t2.length, u2 = r2 - 1; + for (e18 = e18 === i2 ? r2 : e18; ++n5 < e18; ) { + var o2 = ri2(n5, u2), c2 = t2[o2]; + t2[o2] = t2[n5], t2[n5] = c2; } return t2.length = e18, t2; } var Wu2 = Ph2(function(t2) { var e18 = []; - return t2.charCodeAt(0) === 46 && e18.push(""), t2.replace(lo2, function(n4, r2, u2, o2) { - e18.push(u2 ? o2.replace(Co2, "$1") : r2 || n4); + return t2.charCodeAt(0) === 46 && e18.push(""), t2.replace(lo2, function(n5, r2, u2, o2) { + e18.push(u2 ? o2.replace(Co2, "$1") : r2 || n5); }), e18; }); function Wt2(t2) { @@ -115619,9 +44925,9 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return ""; } function Eh2(t2, e18) { - return mt2(Qa2, function(n4) { - var r2 = "_." + n4[0]; - e18 & n4[1] && !Sn2(t2, r2) && t2.push(r2); + return mt2(Qa2, function(n5) { + var r2 = "_." + n5[0]; + e18 & n5[1] && !Sn2(t2, r2) && t2.push(r2); }), t2.sort(); } function Mu2(t2) { @@ -115630,8 +44936,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var e18 = new Pt2(t2.__wrapped__, t2.__chain__); return e18.__actions__ = ut2(t2.__actions__), e18.__index__ = t2.__index__, e18.__values__ = t2.__values__, e18; } - function yh2(t2, e18, n4) { - (n4 ? it2(t2, e18, n4) : e18 === i3) ? e18 = 1 : e18 = V3(T9(e18), 0); + function yh2(t2, e18, n5) { + (n5 ? it2(t2, e18, n5) : e18 === i2) ? e18 = 1 : e18 = V3(T9(e18), 0); var r2 = t2 == null ? 0 : t2.length; if (!r2 || e18 < 1) return []; @@ -115640,7 +44946,7 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return c2; } function Sh2(t2) { - for (var e18 = -1, n4 = t2 == null ? 0 : t2.length, r2 = 0, u2 = []; ++e18 < n4; ) { + for (var e18 = -1, n5 = t2 == null ? 0 : t2.length, r2 = 0, u2 = []; ++e18 < n5; ) { var o2 = t2[e18]; o2 && (u2[r2++] = o2); } @@ -115650,26 +44956,26 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var t2 = arguments.length; if (!t2) return []; - for (var e18 = d4(t2 - 1), n4 = arguments[0], r2 = t2; r2--; ) + for (var e18 = d4(t2 - 1), n5 = arguments[0], r2 = t2; r2--; ) e18[r2 - 1] = arguments[r2]; - return re2(b2(n4) ? ut2(n4) : [n4], tt2(e18, 1)); + return re2(b2(n5) ? ut2(n5) : [n5], tt2(e18, 1)); } var Rh2 = H2(function(t2, e18) { return Z2(t2) ? on2(t2, tt2(e18, 1, Z2, true)) : []; }), bh2 = H2(function(t2, e18) { - var n4 = It2(e18); - return Z2(n4) && (n4 = i3), Z2(t2) ? on2(t2, tt2(e18, 1, Z2, true), E2(n4, 2)) : []; + var n5 = It2(e18); + return Z2(n5) && (n5 = i2), Z2(t2) ? on2(t2, tt2(e18, 1, Z2, true), E2(n5, 2)) : []; }), Th2 = H2(function(t2, e18) { - var n4 = It2(e18); - return Z2(n4) && (n4 = i3), Z2(t2) ? on2(t2, tt2(e18, 1, Z2, true), i3, n4) : []; + var n5 = It2(e18); + return Z2(n5) && (n5 = i2), Z2(t2) ? on2(t2, tt2(e18, 1, Z2, true), i2, n5) : []; }); - function Lh2(t2, e18, n4) { + function Lh2(t2, e18, n5) { var r2 = t2 == null ? 0 : t2.length; - return r2 ? (e18 = n4 || e18 === i3 ? 1 : T9(e18), At2(t2, e18 < 0 ? 0 : e18, r2)) : []; + return r2 ? (e18 = n5 || e18 === i2 ? 1 : T9(e18), At2(t2, e18 < 0 ? 0 : e18, r2)) : []; } - function Hh2(t2, e18, n4) { + function Hh2(t2, e18, n5) { var r2 = t2 == null ? 0 : t2.length; - return r2 ? (e18 = n4 || e18 === i3 ? 1 : T9(e18), e18 = r2 - e18, At2(t2, 0, e18 < 0 ? 0 : e18)) : []; + return r2 ? (e18 = n5 || e18 === i2 ? 1 : T9(e18), e18 = r2 - e18, At2(t2, 0, e18 < 0 ? 0 : e18)) : []; } function Dh2(t2, e18) { return t2 && t2.length ? Xn2(t2, E2(e18, 3), true, true) : []; @@ -115677,23 +44983,23 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Nh2(t2, e18) { return t2 && t2.length ? Xn2(t2, E2(e18, 3), true) : []; } - function $h2(t2, e18, n4, r2) { + function $h2(t2, e18, n5, r2) { var u2 = t2 == null ? 0 : t2.length; - return u2 ? (n4 && typeof n4 != "number" && it2(t2, e18, n4) && (n4 = 0, r2 = u2), Of2(t2, e18, n4, r2)) : []; + return u2 ? (n5 && typeof n5 != "number" && it2(t2, e18, n5) && (n5 = 0, r2 = u2), Of2(t2, e18, n5, r2)) : []; } - function Bu2(t2, e18, n4) { + function Bu2(t2, e18, n5) { var r2 = t2 == null ? 0 : t2.length; if (!r2) return -1; - var u2 = n4 == null ? 0 : T9(n4); + var u2 = n5 == null ? 0 : T9(n5); return u2 < 0 && (u2 = V3(r2 + u2, 0)), On2(t2, E2(e18, 3), u2); } - function Gu2(t2, e18, n4) { + function Gu2(t2, e18, n5) { var r2 = t2 == null ? 0 : t2.length; if (!r2) return -1; var u2 = r2 - 1; - return n4 !== i3 && (u2 = T9(n4), u2 = n4 < 0 ? V3(r2 + u2, 0) : et2(u2, r2 - 1)), On2(t2, E2(e18, 3), u2, true); + return n5 !== i2 && (u2 = T9(n5), u2 = n5 < 0 ? V3(r2 + u2, 0) : et2(u2, r2 - 1)), On2(t2, E2(e18, 3), u2, true); } function zu2(t2) { var e18 = t2 == null ? 0 : t2.length; @@ -115704,24 +45010,24 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return e18 ? tt2(t2, le2) : []; } function qh2(t2, e18) { - var n4 = t2 == null ? 0 : t2.length; - return n4 ? (e18 = e18 === i3 ? 1 : T9(e18), tt2(t2, e18)) : []; + var n5 = t2 == null ? 0 : t2.length; + return n5 ? (e18 = e18 === i2 ? 1 : T9(e18), tt2(t2, e18)) : []; } function Fh2(t2) { - for (var e18 = -1, n4 = t2 == null ? 0 : t2.length, r2 = {}; ++e18 < n4; ) { + for (var e18 = -1, n5 = t2 == null ? 0 : t2.length, r2 = {}; ++e18 < n5; ) { var u2 = t2[e18]; r2[u2[0]] = u2[1]; } return r2; } function Ku2(t2) { - return t2 && t2.length ? t2[0] : i3; + return t2 && t2.length ? t2[0] : i2; } - function Wh2(t2, e18, n4) { + function Wh2(t2, e18, n5) { var r2 = t2 == null ? 0 : t2.length; if (!r2) return -1; - var u2 = n4 == null ? 0 : T9(n4); + var u2 = n5 == null ? 0 : T9(n5); return u2 < 0 && (u2 = V3(r2 + u2, 0)), Te2(t2, e18, u2); } function Mh2(t2) { @@ -115732,74 +45038,74 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var e18 = z3(t2, oi2); return e18.length && e18[0] === t2[0] ? kr2(e18) : []; }), Gh2 = H2(function(t2) { - var e18 = It2(t2), n4 = z3(t2, oi2); - return e18 === It2(n4) ? e18 = i3 : n4.pop(), n4.length && n4[0] === t2[0] ? kr2(n4, E2(e18, 2)) : []; + var e18 = It2(t2), n5 = z3(t2, oi2); + return e18 === It2(n5) ? e18 = i2 : n5.pop(), n5.length && n5[0] === t2[0] ? kr2(n5, E2(e18, 2)) : []; }), zh2 = H2(function(t2) { - var e18 = It2(t2), n4 = z3(t2, oi2); - return e18 = typeof e18 == "function" ? e18 : i3, e18 && n4.pop(), n4.length && n4[0] === t2[0] ? kr2(n4, i3, e18) : []; + var e18 = It2(t2), n5 = z3(t2, oi2); + return e18 = typeof e18 == "function" ? e18 : i2, e18 && n5.pop(), n5.length && n5[0] === t2[0] ? kr2(n5, i2, e18) : []; }); function Kh2(t2, e18) { return t2 == null ? "" : Wc2.call(t2, e18); } function It2(t2) { var e18 = t2 == null ? 0 : t2.length; - return e18 ? t2[e18 - 1] : i3; + return e18 ? t2[e18 - 1] : i2; } - function Jh2(t2, e18, n4) { + function Jh2(t2, e18, n5) { var r2 = t2 == null ? 0 : t2.length; if (!r2) return -1; var u2 = r2; - return n4 !== i3 && (u2 = T9(n4), u2 = u2 < 0 ? V3(r2 + u2, 0) : et2(u2, r2 - 1)), e18 === e18 ? xc2(t2, e18, u2) : On2(t2, Es2, u2, true); + return n5 !== i2 && (u2 = T9(n5), u2 = u2 < 0 ? V3(r2 + u2, 0) : et2(u2, r2 - 1)), e18 === e18 ? xc2(t2, e18, u2) : On2(t2, Es2, u2, true); } function Yh2(t2, e18) { - return t2 && t2.length ? nu2(t2, T9(e18)) : i3; + return t2 && t2.length ? nu2(t2, T9(e18)) : i2; } var Zh2 = H2(Ju2); function Ju2(t2, e18) { return t2 && t2.length && e18 && e18.length ? ni2(t2, e18) : t2; } - function Xh2(t2, e18, n4) { - return t2 && t2.length && e18 && e18.length ? ni2(t2, e18, E2(n4, 2)) : t2; + function Xh2(t2, e18, n5) { + return t2 && t2.length && e18 && e18.length ? ni2(t2, e18, E2(n5, 2)) : t2; } - function Qh2(t2, e18, n4) { - return t2 && t2.length && e18 && e18.length ? ni2(t2, e18, i3, n4) : t2; + function Qh2(t2, e18, n5) { + return t2 && t2.length && e18 && e18.length ? ni2(t2, e18, i2, n5) : t2; } var Vh2 = Xt2(function(t2, e18) { - var n4 = t2 == null ? 0 : t2.length, r2 = Zr2(t2, e18); + var n5 = t2 == null ? 0 : t2.length, r2 = Zr2(t2, e18); return su2(t2, z3(e18, function(u2) { - return Qt2(u2, n4) ? +u2 : u2; + return Qt2(u2, n5) ? +u2 : u2; }).sort(gu2)), r2; }); function kh2(t2, e18) { - var n4 = []; + var n5 = []; if (!(t2 && t2.length)) - return n4; + return n5; var r2 = -1, u2 = [], o2 = t2.length; for (e18 = E2(e18, 3); ++r2 < o2; ) { var c2 = t2[r2]; - e18(c2, r2, t2) && (n4.push(c2), u2.push(r2)); + e18(c2, r2, t2) && (n5.push(c2), u2.push(r2)); } - return su2(t2, u2), n4; + return su2(t2, u2), n5; } function Ai2(t2) { return t2 == null ? t2 : zc2.call(t2); } - function jh2(t2, e18, n4) { + function jh2(t2, e18, n5) { var r2 = t2 == null ? 0 : t2.length; - return r2 ? (n4 && typeof n4 != "number" && it2(t2, e18, n4) ? (e18 = 0, n4 = r2) : (e18 = e18 == null ? 0 : T9(e18), n4 = n4 === i3 ? r2 : T9(n4)), At2(t2, e18, n4)) : []; + return r2 ? (n5 && typeof n5 != "number" && it2(t2, e18, n5) ? (e18 = 0, n5 = r2) : (e18 = e18 == null ? 0 : T9(e18), n5 = n5 === i2 ? r2 : T9(n5)), At2(t2, e18, n5)) : []; } function tl2(t2, e18) { return Zn2(t2, e18); } - function el2(t2, e18, n4) { - return si2(t2, e18, E2(n4, 2)); + function el2(t2, e18, n5) { + return si2(t2, e18, E2(n5, 2)); } function nl2(t2, e18) { - var n4 = t2 == null ? 0 : t2.length; - if (n4) { + var n5 = t2 == null ? 0 : t2.length; + if (n5) { var r2 = Zn2(t2, e18); - if (r2 < n4 && Rt2(t2[r2], e18)) + if (r2 < n5 && Rt2(t2[r2], e18)) return r2; } return -1; @@ -115807,12 +45113,12 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function rl2(t2, e18) { return Zn2(t2, e18, true); } - function il2(t2, e18, n4) { - return si2(t2, e18, E2(n4, 2), true); + function il2(t2, e18, n5) { + return si2(t2, e18, E2(n5, 2), true); } function sl2(t2, e18) { - var n4 = t2 == null ? 0 : t2.length; - if (n4) { + var n5 = t2 == null ? 0 : t2.length; + if (n5) { var r2 = Zn2(t2, e18, true) - 1; if (Rt2(t2[r2], e18)) return r2; @@ -115829,12 +45135,12 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var e18 = t2 == null ? 0 : t2.length; return e18 ? At2(t2, 1, e18) : []; } - function cl2(t2, e18, n4) { - return t2 && t2.length ? (e18 = n4 || e18 === i3 ? 1 : T9(e18), At2(t2, 0, e18 < 0 ? 0 : e18)) : []; + function cl2(t2, e18, n5) { + return t2 && t2.length ? (e18 = n5 || e18 === i2 ? 1 : T9(e18), At2(t2, 0, e18 < 0 ? 0 : e18)) : []; } - function fl2(t2, e18, n4) { + function fl2(t2, e18, n5) { var r2 = t2 == null ? 0 : t2.length; - return r2 ? (e18 = n4 || e18 === i3 ? 1 : T9(e18), e18 = r2 - e18, At2(t2, e18 < 0 ? 0 : e18, r2)) : []; + return r2 ? (e18 = n5 || e18 === i2 ? 1 : T9(e18), e18 = r2 - e18, At2(t2, e18 < 0 ? 0 : e18, r2)) : []; } function hl2(t2, e18) { return t2 && t2.length ? Xn2(t2, E2(e18, 3), false, true) : []; @@ -115846,10 +45152,10 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return ae2(tt2(t2, 1, Z2, true)); }), dl2 = H2(function(t2) { var e18 = It2(t2); - return Z2(e18) && (e18 = i3), ae2(tt2(t2, 1, Z2, true), E2(e18, 2)); + return Z2(e18) && (e18 = i2), ae2(tt2(t2, 1, Z2, true), E2(e18, 2)); }), gl2 = H2(function(t2) { var e18 = It2(t2); - return e18 = typeof e18 == "function" ? e18 : i3, ae2(tt2(t2, 1, Z2, true), i3, e18); + return e18 = typeof e18 == "function" ? e18 : i2, ae2(tt2(t2, 1, Z2, true), i2, e18); }); function vl(t2) { return t2 && t2.length ? ae2(t2) : []; @@ -115858,25 +45164,25 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return t2 && t2.length ? ae2(t2, E2(e18, 2)) : []; } function ml2(t2, e18) { - return e18 = typeof e18 == "function" ? e18 : i3, t2 && t2.length ? ae2(t2, i3, e18) : []; + return e18 = typeof e18 == "function" ? e18 : i2, t2 && t2.length ? ae2(t2, i2, e18) : []; } function Ii2(t2) { if (!(t2 && t2.length)) return []; var e18 = 0; - return t2 = ne2(t2, function(n4) { - if (Z2(n4)) - return e18 = V3(n4.length, e18), true; - }), Wr2(e18, function(n4) { - return z3(t2, Ur2(n4)); + return t2 = ne2(t2, function(n5) { + if (Z2(n5)) + return e18 = V3(n5.length, e18), true; + }), Wr2(e18, function(n5) { + return z3(t2, Ur2(n5)); }); } function Yu2(t2, e18) { if (!(t2 && t2.length)) return []; - var n4 = Ii2(t2); - return e18 == null ? n4 : z3(n4, function(r2) { - return ft2(e18, i3, r2); + var n5 = Ii2(t2); + return e18 == null ? n5 : z3(n5, function(r2) { + return ft2(e18, i2, r2); }); } var wl = H2(function(t2, e18) { @@ -115885,10 +45191,10 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return ai2(ne2(t2, Z2)); }), Cl = H2(function(t2) { var e18 = It2(t2); - return Z2(e18) && (e18 = i3), ai2(ne2(t2, Z2), E2(e18, 2)); + return Z2(e18) && (e18 = i2), ai2(ne2(t2, Z2), E2(e18, 2)); }), Al = H2(function(t2) { var e18 = It2(t2); - return e18 = typeof e18 == "function" ? e18 : i3, ai2(ne2(t2, Z2), i3, e18); + return e18 = typeof e18 == "function" ? e18 : i2, ai2(ne2(t2, Z2), i2, e18); }), Il = H2(Ii2); function xl(t2, e18) { return hu2(t2 || [], e18 || [], an2); @@ -115897,8 +45203,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return hu2(t2 || [], e18 || [], hn2); } var yl = H2(function(t2) { - var e18 = t2.length, n4 = e18 > 1 ? t2[e18 - 1] : i3; - return n4 = typeof n4 == "function" ? (t2.pop(), n4) : i3, Yu2(t2, n4); + var e18 = t2.length, n5 = e18 > 1 ? t2[e18 - 1] : i2; + return n5 = typeof n5 == "function" ? (t2.pop(), n5) : i2, Yu2(t2, n5); }); function Zu2(t2) { var e18 = a3(t2); @@ -115911,11 +45217,11 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return e18(t2); } var Ol = Xt2(function(t2) { - var e18 = t2.length, n4 = e18 ? t2[0] : 0, r2 = this.__wrapped__, u2 = function(o2) { + var e18 = t2.length, n5 = e18 ? t2[0] : 0, r2 = this.__wrapped__, u2 = function(o2) { return Zr2(o2, t2); }; - return e18 > 1 || this.__actions__.length || !(r2 instanceof N2) || !Qt2(n4) ? this.thru(u2) : (r2 = r2.slice(n4, +n4 + (e18 ? 1 : 0)), r2.__actions__.push({ func: ir2, args: [u2], thisArg: i3 }), new Pt2(r2, this.__chain__).thru(function(o2) { - return e18 && !o2.length && o2.push(i3), o2; + return e18 > 1 || this.__actions__.length || !(r2 instanceof N2) || !Qt2(n5) ? this.thru(u2) : (r2 = r2.slice(n5, +n5 + (e18 ? 1 : 0)), r2.__actions__.push({ func: ir2, args: [u2], thisArg: i2 }), new Pt2(r2, this.__chain__).thru(function(o2) { + return e18 && !o2.length && o2.push(i2), o2; })); }); function Rl() { @@ -115925,19 +45231,19 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return new Pt2(this.value(), this.__chain__); } function Tl() { - this.__values__ === i3 && (this.__values__ = oa2(this.value())); - var t2 = this.__index__ >= this.__values__.length, e18 = t2 ? i3 : this.__values__[this.__index__++]; + this.__values__ === i2 && (this.__values__ = oa2(this.value())); + var t2 = this.__index__ >= this.__values__.length, e18 = t2 ? i2 : this.__values__[this.__index__++]; return { done: t2, value: e18 }; } function Ll() { return this; } function Hl(t2) { - for (var e18, n4 = this; n4 instanceof Gn2; ) { - var r2 = Mu2(n4); - r2.__index__ = 0, r2.__values__ = i3, e18 ? u2.__wrapped__ = r2 : e18 = r2; + for (var e18, n5 = this; n5 instanceof Gn2; ) { + var r2 = Mu2(n5); + r2.__index__ = 0, r2.__values__ = i2, e18 ? u2.__wrapped__ = r2 : e18 = r2; var u2 = r2; - n4 = n4.__wrapped__; + n5 = n5.__wrapped__; } return u2.__wrapped__ = t2, e18; } @@ -115945,23 +45251,23 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var t2 = this.__wrapped__; if (t2 instanceof N2) { var e18 = t2; - return this.__actions__.length && (e18 = new N2(this)), e18 = e18.reverse(), e18.__actions__.push({ func: ir2, args: [Ai2], thisArg: i3 }), new Pt2(e18, this.__chain__); + return this.__actions__.length && (e18 = new N2(this)), e18 = e18.reverse(), e18.__actions__.push({ func: ir2, args: [Ai2], thisArg: i2 }), new Pt2(e18, this.__chain__); } return this.thru(Ai2); } function Nl() { return fu(this.__wrapped__, this.__actions__); } - var $l = Qn2(function(t2, e18, n4) { - W2.call(t2, n4) ? ++t2[n4] : Yt2(t2, n4, 1); + var $l = Qn2(function(t2, e18, n5) { + W2.call(t2, n5) ? ++t2[n5] : Yt2(t2, n5, 1); }); - function Ul(t2, e18, n4) { + function Ul(t2, e18, n5) { var r2 = b2(t2) ? Is2 : Sf2; - return n4 && it2(t2, e18, n4) && (e18 = i3), r2(t2, E2(e18, 3)); + return n5 && it2(t2, e18, n5) && (e18 = i2), r2(t2, E2(e18, 3)); } function ql2(t2, e18) { - var n4 = b2(t2) ? ne2 : Ys2; - return n4(t2, E2(e18, 3)); + var n5 = b2(t2) ? ne2 : Ys2; + return n5(t2, E2(e18, 3)); } var Fl = Cu2(Bu2), Wl = Cu2(Gu2); function Ml(t2, e18) { @@ -115970,63 +45276,63 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Bl(t2, e18) { return tt2(sr2(t2, e18), le2); } - function Gl(t2, e18, n4) { - return n4 = n4 === i3 ? 1 : T9(n4), tt2(sr2(t2, e18), n4); + function Gl(t2, e18, n5) { + return n5 = n5 === i2 ? 1 : T9(n5), tt2(sr2(t2, e18), n5); } function Xu2(t2, e18) { - var n4 = b2(t2) ? mt2 : ue2; - return n4(t2, E2(e18, 3)); + var n5 = b2(t2) ? mt2 : ue2; + return n5(t2, E2(e18, 3)); } function Qu2(t2, e18) { - var n4 = b2(t2) ? ac2 : Js2; - return n4(t2, E2(e18, 3)); + var n5 = b2(t2) ? ac2 : Js2; + return n5(t2, E2(e18, 3)); } - var zl = Qn2(function(t2, e18, n4) { - W2.call(t2, n4) ? t2[n4].push(e18) : Yt2(t2, n4, [e18]); + var zl = Qn2(function(t2, e18, n5) { + W2.call(t2, n5) ? t2[n5].push(e18) : Yt2(t2, n5, [e18]); }); - function Kl2(t2, e18, n4, r2) { - t2 = at2(t2) ? t2 : Ge2(t2), n4 = n4 && !r2 ? T9(n4) : 0; + function Kl2(t2, e18, n5, r2) { + t2 = at2(t2) ? t2 : Ge2(t2), n5 = n5 && !r2 ? T9(n5) : 0; var u2 = t2.length; - return n4 < 0 && (n4 = V3(u2 + n4, 0)), fr2(t2) ? n4 <= u2 && t2.indexOf(e18, n4) > -1 : !!u2 && Te2(t2, e18, n4) > -1; + return n5 < 0 && (n5 = V3(u2 + n5, 0)), fr2(t2) ? n5 <= u2 && t2.indexOf(e18, n5) > -1 : !!u2 && Te2(t2, e18, n5) > -1; } - var Jl = H2(function(t2, e18, n4) { + var Jl = H2(function(t2, e18, n5) { var r2 = -1, u2 = typeof e18 == "function", o2 = at2(t2) ? d4(t2.length) : []; return ue2(t2, function(c2) { - o2[++r2] = u2 ? ft2(e18, c2, n4) : cn2(c2, e18, n4); + o2[++r2] = u2 ? ft2(e18, c2, n5) : cn2(c2, e18, n5); }), o2; - }), Yl = Qn2(function(t2, e18, n4) { - Yt2(t2, n4, e18); + }), Yl = Qn2(function(t2, e18, n5) { + Yt2(t2, n5, e18); }); function sr2(t2, e18) { - var n4 = b2(t2) ? z3 : js2; - return n4(t2, E2(e18, 3)); + var n5 = b2(t2) ? z3 : js2; + return n5(t2, E2(e18, 3)); } - function Zl(t2, e18, n4, r2) { - return t2 == null ? [] : (b2(e18) || (e18 = e18 == null ? [] : [e18]), n4 = r2 ? i3 : n4, b2(n4) || (n4 = n4 == null ? [] : [n4]), ru2(t2, e18, n4)); + function Zl(t2, e18, n5, r2) { + return t2 == null ? [] : (b2(e18) || (e18 = e18 == null ? [] : [e18]), n5 = r2 ? i2 : n5, b2(n5) || (n5 = n5 == null ? [] : [n5]), ru2(t2, e18, n5)); } - var Xl = Qn2(function(t2, e18, n4) { - t2[n4 ? 0 : 1].push(e18); + var Xl = Qn2(function(t2, e18, n5) { + t2[n5 ? 0 : 1].push(e18); }, function() { return [[], []]; }); - function Ql(t2, e18, n4) { + function Ql(t2, e18, n5) { var r2 = b2(t2) ? Nr2 : Ss2, u2 = arguments.length < 3; - return r2(t2, E2(e18, 4), n4, u2, ue2); + return r2(t2, E2(e18, 4), n5, u2, ue2); } - function Vl(t2, e18, n4) { + function Vl(t2, e18, n5) { var r2 = b2(t2) ? oc2 : Ss2, u2 = arguments.length < 3; - return r2(t2, E2(e18, 4), n4, u2, Js2); + return r2(t2, E2(e18, 4), n5, u2, Js2); } function kl2(t2, e18) { - var n4 = b2(t2) ? ne2 : Ys2; - return n4(t2, or2(E2(e18, 3))); + var n5 = b2(t2) ? ne2 : Ys2; + return n5(t2, or2(E2(e18, 3))); } function jl2(t2) { var e18 = b2(t2) ? Bs2 : Kf2; return e18(t2); } - function tp(t2, e18, n4) { - (n4 ? it2(t2, e18, n4) : e18 === i3) ? e18 = 1 : e18 = T9(e18); + function tp(t2, e18, n5) { + (n5 ? it2(t2, e18, n5) : e18 === i2) ? e18 = 1 : e18 = T9(e18); var r2 = b2(t2) ? Af2 : Jf2; return r2(t2, e18); } @@ -116042,15 +45348,15 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var e18 = nt2(t2); return e18 == Et2 || e18 == yt2 ? t2.size : ti2(t2).length; } - function rp2(t2, e18, n4) { + function rp2(t2, e18, n5) { var r2 = b2(t2) ? $r2 : Xf2; - return n4 && it2(t2, e18, n4) && (e18 = i3), r2(t2, E2(e18, 3)); + return n5 && it2(t2, e18, n5) && (e18 = i2), r2(t2, E2(e18, 3)); } var ip = H2(function(t2, e18) { if (t2 == null) return []; - var n4 = e18.length; - return n4 > 1 && it2(t2, e18[0], e18[1]) ? e18 = [] : n4 > 2 && it2(e18[0], e18[1], e18[2]) && (e18 = [e18[0]]), ru2(t2, tt2(e18, 1), []); + var n5 = e18.length; + return n5 > 1 && it2(t2, e18[0], e18[1]) ? e18 = [] : n5 > 2 && it2(e18[0], e18[1], e18[2]) && (e18 = [e18[0]]), ru2(t2, tt2(e18, 1), []); }), ur2 = Uc2 || function() { return j2.Date.now(); }; @@ -116062,53 +45368,53 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return e18.apply(this, arguments); }; } - function Vu2(t2, e18, n4) { - return e18 = n4 ? i3 : e18, e18 = t2 && e18 == null ? t2.length : e18, Zt2(t2, Gt2, i3, i3, i3, i3, e18); + function Vu2(t2, e18, n5) { + return e18 = n5 ? i2 : e18, e18 = t2 && e18 == null ? t2.length : e18, Zt2(t2, Gt2, i2, i2, i2, i2, e18); } function ku2(t2, e18) { - var n4; + var n5; if (typeof e18 != "function") throw new wt2(y3); return t2 = T9(t2), function() { - return --t2 > 0 && (n4 = e18.apply(this, arguments)), t2 <= 1 && (e18 = i3), n4; + return --t2 > 0 && (n5 = e18.apply(this, arguments)), t2 <= 1 && (e18 = i2), n5; }; } - var xi2 = H2(function(t2, e18, n4) { + var xi2 = H2(function(t2, e18, n5) { var r2 = vt2; - if (n4.length) { - var u2 = ie2(n4, Me2(xi2)); + if (n5.length) { + var u2 = ie2(n5, Me2(xi2)); r2 |= $t2; } - return Zt2(t2, r2, e18, n4, u2); - }), ju2 = H2(function(t2, e18, n4) { + return Zt2(t2, r2, e18, n5, u2); + }), ju2 = H2(function(t2, e18, n5) { var r2 = vt2 | he2; - if (n4.length) { - var u2 = ie2(n4, Me2(ju2)); + if (n5.length) { + var u2 = ie2(n5, Me2(ju2)); r2 |= $t2; } - return Zt2(e18, r2, t2, n4, u2); + return Zt2(e18, r2, t2, n5, u2); }); - function ta2(t2, e18, n4) { - e18 = n4 ? i3 : e18; - var r2 = Zt2(t2, Nt2, i3, i3, i3, i3, i3, e18); + function ta2(t2, e18, n5) { + e18 = n5 ? i2 : e18; + var r2 = Zt2(t2, Nt2, i2, i2, i2, i2, i2, e18); return r2.placeholder = ta2.placeholder, r2; } - function ea2(t2, e18, n4) { - e18 = n4 ? i3 : e18; - var r2 = Zt2(t2, ye2, i3, i3, i3, i3, i3, e18); + function ea2(t2, e18, n5) { + e18 = n5 ? i2 : e18; + var r2 = Zt2(t2, ye2, i2, i2, i2, i2, i2, e18); return r2.placeholder = ea2.placeholder, r2; } - function na2(t2, e18, n4) { - var r2, u2, o2, c2, f3, l2, v6 = 0, _3 = false, m3 = false, C3 = true; + function na2(t2, e18, n5) { + var r2, u2, o2, c2, f4, l2, v6 = 0, _3 = false, m3 = false, C3 = true; if (typeof t2 != "function") throw new wt2(y3); - e18 = xt2(e18) || 0, K3(n4) && (_3 = !!n4.leading, m3 = "maxWait" in n4, o2 = m3 ? V3(xt2(n4.maxWait) || 0, e18) : o2, C3 = "trailing" in n4 ? !!n4.trailing : C3); + e18 = xt2(e18) || 0, K3(n5) && (_3 = !!n5.leading, m3 = "maxWait" in n5, o2 = m3 ? V3(xt2(n5.maxWait) || 0, e18) : o2, C3 = "trailing" in n5 ? !!n5.trailing : C3); function x3(X2) { var bt2 = r2, jt2 = u2; - return r2 = u2 = i3, v6 = X2, c2 = t2.apply(jt2, bt2), c2; + return r2 = u2 = i2, v6 = X2, c2 = t2.apply(jt2, bt2), c2; } function S4(X2) { - return v6 = X2, f3 = dn2(D2, e18), _3 ? x3(X2) : c2; + return v6 = X2, f4 = dn2(D2, e18), _3 ? x3(X2) : c2; } function L4(X2) { var bt2 = X2 - l2, jt2 = X2 - v6, Ca2 = e18 - bt2; @@ -116116,39 +45422,39 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } function O3(X2) { var bt2 = X2 - l2, jt2 = X2 - v6; - return l2 === i3 || bt2 >= e18 || bt2 < 0 || m3 && jt2 >= o2; + return l2 === i2 || bt2 >= e18 || bt2 < 0 || m3 && jt2 >= o2; } function D2() { var X2 = ur2(); if (O3(X2)) return $(X2); - f3 = dn2(D2, L4(X2)); + f4 = dn2(D2, L4(X2)); } function $(X2) { - return f3 = i3, C3 && r2 ? x3(X2) : (r2 = u2 = i3, c2); + return f4 = i2, C3 && r2 ? x3(X2) : (r2 = u2 = i2, c2); } function dt2() { - f3 !== i3 && lu2(f3), v6 = 0, r2 = l2 = u2 = f3 = i3; + f4 !== i2 && lu2(f4), v6 = 0, r2 = l2 = u2 = f4 = i2; } function st2() { - return f3 === i3 ? c2 : $(ur2()); + return f4 === i2 ? c2 : $(ur2()); } function gt2() { var X2 = ur2(), bt2 = O3(X2); if (r2 = arguments, u2 = this, l2 = X2, bt2) { - if (f3 === i3) + if (f4 === i2) return S4(l2); if (m3) - return lu2(f3), f3 = dn2(D2, e18), x3(l2); + return lu2(f4), f4 = dn2(D2, e18), x3(l2); } - return f3 === i3 && (f3 = dn2(D2, e18)), c2; + return f4 === i2 && (f4 = dn2(D2, e18)), c2; } return gt2.cancel = dt2, gt2.flush = st2, gt2; } var up = H2(function(t2, e18) { return Ks2(t2, 1, e18); - }), ap = H2(function(t2, e18, n4) { - return Ks2(t2, xt2(e18) || 0, n4); + }), ap = H2(function(t2, e18, n5) { + return Ks2(t2, xt2(e18) || 0, n5); }); function op(t2) { return Zt2(t2, gr2); @@ -116156,14 +45462,14 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function ar2(t2, e18) { if (typeof t2 != "function" || e18 != null && typeof e18 != "function") throw new wt2(y3); - var n4 = function() { - var r2 = arguments, u2 = e18 ? e18.apply(this, r2) : r2[0], o2 = n4.cache; + var n5 = function() { + var r2 = arguments, u2 = e18 ? e18.apply(this, r2) : r2[0], o2 = n5.cache; if (o2.has(u2)) return o2.get(u2); var c2 = t2.apply(this, r2); - return n4.cache = o2.set(u2, c2) || o2, c2; + return n5.cache = o2.set(u2, c2) || o2, c2; }; - return n4.cache = new (ar2.Cache || Jt2)(), n4; + return n5.cache = new (ar2.Cache || Jt2)(), n5; } ar2.Cache = Jt2; function or2(t2) { @@ -116189,39 +45495,39 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } var fp = Qf2(function(t2, e18) { e18 = e18.length == 1 && b2(e18[0]) ? z3(e18[0], ht2(E2())) : z3(tt2(e18, 1), ht2(E2())); - var n4 = e18.length; + var n5 = e18.length; return H2(function(r2) { - for (var u2 = -1, o2 = et2(r2.length, n4); ++u2 < o2; ) + for (var u2 = -1, o2 = et2(r2.length, n5); ++u2 < o2; ) r2[u2] = e18[u2].call(this, r2[u2]); return ft2(t2, this, r2); }); }), Ei2 = H2(function(t2, e18) { - var n4 = ie2(e18, Me2(Ei2)); - return Zt2(t2, $t2, i3, e18, n4); + var n5 = ie2(e18, Me2(Ei2)); + return Zt2(t2, $t2, i2, e18, n5); }), ra2 = H2(function(t2, e18) { - var n4 = ie2(e18, Me2(ra2)); - return Zt2(t2, Se2, i3, e18, n4); + var n5 = ie2(e18, Me2(ra2)); + return Zt2(t2, Se2, i2, e18, n5); }), hp = Xt2(function(t2, e18) { - return Zt2(t2, Je2, i3, i3, i3, e18); + return Zt2(t2, Je2, i2, i2, i2, e18); }); function lp(t2, e18) { if (typeof t2 != "function") throw new wt2(y3); - return e18 = e18 === i3 ? e18 : T9(e18), H2(t2, e18); + return e18 = e18 === i2 ? e18 : T9(e18), H2(t2, e18); } function pp(t2, e18) { if (typeof t2 != "function") throw new wt2(y3); - return e18 = e18 == null ? 0 : V3(T9(e18), 0), H2(function(n4) { - var r2 = n4[e18], u2 = ce2(n4, 0, e18); + return e18 = e18 == null ? 0 : V3(T9(e18), 0), H2(function(n5) { + var r2 = n5[e18], u2 = ce2(n5, 0, e18); return r2 && re2(u2, r2), ft2(t2, this, u2); }); } - function dp(t2, e18, n4) { + function dp(t2, e18, n5) { var r2 = true, u2 = true; if (typeof t2 != "function") throw new wt2(y3); - return K3(n4) && (r2 = "leading" in n4 ? !!n4.leading : r2, u2 = "trailing" in n4 ? !!n4.trailing : u2), na2(t2, e18, { leading: r2, maxWait: e18, trailing: u2 }); + return K3(n5) && (r2 = "leading" in n5 ? !!n5.leading : r2, u2 = "trailing" in n5 ? !!n5.trailing : u2), na2(t2, e18, { leading: r2, maxWait: e18, trailing: u2 }); } function gp(t2) { return Vu2(t2, 1); @@ -116239,13 +45545,13 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return Ct2(t2, xe2); } function wp(t2, e18) { - return e18 = typeof e18 == "function" ? e18 : i3, Ct2(t2, xe2, e18); + return e18 = typeof e18 == "function" ? e18 : i2, Ct2(t2, xe2, e18); } function Pp(t2) { return Ct2(t2, Dt2 | xe2); } function Cp(t2, e18) { - return e18 = typeof e18 == "function" ? e18 : i3, Ct2(t2, Dt2 | xe2, e18); + return e18 = typeof e18 == "function" ? e18 : i2, Ct2(t2, Dt2 | xe2, e18); } function Ap(t2, e18) { return e18 == null || zs2(t2, e18, k2(e18)); @@ -116283,18 +45589,18 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return !t2.size; if (pn2(t2)) return !ti2(t2).length; - for (var n4 in t2) - if (W2.call(t2, n4)) + for (var n5 in t2) + if (W2.call(t2, n5)) return false; return true; } function bp(t2, e18) { return fn2(t2, e18); } - function Tp(t2, e18, n4) { - n4 = typeof n4 == "function" ? n4 : i3; - var r2 = n4 ? n4(t2, e18) : i3; - return r2 === i3 ? fn2(t2, e18, i3, n4) : !!r2; + function Tp(t2, e18, n5) { + n5 = typeof n5 == "function" ? n5 : i2; + var r2 = n5 ? n5(t2, e18) : i2; + return r2 === i2 ? fn2(t2, e18, i2, n5) : !!r2; } function yi2(t2) { if (!Y2(t2)) @@ -116328,8 +45634,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Hp(t2, e18) { return t2 === e18 || jr2(t2, e18, vi2(e18)); } - function Dp(t2, e18, n4) { - return n4 = typeof n4 == "function" ? n4 : i3, jr2(t2, e18, vi2(e18), n4); + function Dp(t2, e18, n5) { + return n5 = typeof n5 == "function" ? n5 : i2, jr2(t2, e18, vi2(e18), n5); } function Np(t2) { return ua2(t2) && t2 != +t2; @@ -116354,8 +45660,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var e18 = $n2(t2); if (e18 === null) return true; - var n4 = W2.call(e18, "constructor") && e18.constructor; - return typeof n4 == "function" && n4 instanceof n4 && Ln2.call(n4) == Hc2; + var n5 = W2.call(e18, "constructor") && e18.constructor; + return typeof n5 == "function" && n5 instanceof n5 && Ln2.call(n5) == Hc2; } var Si2 = Ps2 ? ht2(Ps2) : Uf2; function Fp2(t2) { @@ -116370,7 +45676,7 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } var Be2 = As2 ? ht2(As2) : Ff2; function Wp(t2) { - return t2 === i3; + return t2 === i2; } function Mp(t2) { return Y2(t2) && nt2(t2) == ke2; @@ -116388,8 +45694,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return fr2(t2) ? St2(t2) : ut2(t2); if (en2 && t2[en2]) return Cc2(t2[en2]()); - var e18 = nt2(t2), n4 = e18 == Et2 ? Br2 : e18 == yt2 ? Rn2 : Ge2; - return n4(t2); + var e18 = nt2(t2), n5 = e18 == Et2 ? Br2 : e18 == yt2 ? Rn2 : Ge2; + return n5(t2); } function kt2(t2) { if (!t2) @@ -116401,8 +45707,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return t2 === t2 ? t2 : 0; } function T9(t2) { - var e18 = kt2(t2), n4 = e18 % 1; - return e18 === e18 ? n4 ? e18 - n4 : e18 : 0; + var e18 = kt2(t2), n5 = e18 % 1; + return e18 === e18 ? n5 ? e18 - n5 : e18 : 0; } function ca2(t2) { return t2 ? _e3(T9(t2), 0, Ut4) : 0; @@ -116419,8 +45725,8 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : if (typeof t2 != "string") return t2 === 0 ? t2 : +t2; t2 = Os2(t2); - var n4 = xo2.test(t2); - return n4 || yo2.test(t2) ? ic2(t2.slice(2), n4 ? 2 : 8) : Io2.test(t2) ? wn2 : +t2; + var n5 = xo2.test(t2); + return n5 || yo2.test(t2) ? ic2(t2.slice(2), n5 ? 2 : 8) : Io2.test(t2) ? wn2 : +t2; } function fa2(t2) { return Ft2(t2, ot2(t2)); @@ -116436,30 +45742,30 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : Ft2(e18, k2(e18), t2); return; } - for (var n4 in e18) - W2.call(e18, n4) && an2(t2, n4, e18[n4]); + for (var n5 in e18) + W2.call(e18, n5) && an2(t2, n5, e18[n5]); }), ha2 = Fe2(function(t2, e18) { Ft2(e18, ot2(e18), t2); - }), hr2 = Fe2(function(t2, e18, n4, r2) { + }), hr2 = Fe2(function(t2, e18, n5, r2) { Ft2(e18, ot2(e18), t2, r2); - }), Yp = Fe2(function(t2, e18, n4, r2) { + }), Yp = Fe2(function(t2, e18, n5, r2) { Ft2(e18, k2(e18), t2, r2); }), Zp = Xt2(Zr2); function Xp(t2, e18) { - var n4 = qe2(t2); - return e18 == null ? n4 : Gs2(n4, e18); + var n5 = qe2(t2); + return e18 == null ? n5 : Gs2(n5, e18); } var Qp = H2(function(t2, e18) { t2 = M3(t2); - var n4 = -1, r2 = e18.length, u2 = r2 > 2 ? e18[2] : i3; - for (u2 && it2(e18[0], e18[1], u2) && (r2 = 1); ++n4 < r2; ) - for (var o2 = e18[n4], c2 = ot2(o2), f3 = -1, l2 = c2.length; ++f3 < l2; ) { - var v6 = c2[f3], _3 = t2[v6]; - (_3 === i3 || Rt2(_3, Ne2[v6]) && !W2.call(t2, v6)) && (t2[v6] = o2[v6]); + var n5 = -1, r2 = e18.length, u2 = r2 > 2 ? e18[2] : i2; + for (u2 && it2(e18[0], e18[1], u2) && (r2 = 1); ++n5 < r2; ) + for (var o2 = e18[n5], c2 = ot2(o2), f4 = -1, l2 = c2.length; ++f4 < l2; ) { + var v6 = c2[f4], _3 = t2[v6]; + (_3 === i2 || Rt2(_3, Ne2[v6]) && !W2.call(t2, v6)) && (t2[v6] = o2[v6]); } return t2; }), Vp = H2(function(t2) { - return t2.push(i3, Ou2), ft2(la2, i3, t2); + return t2.push(i2, Ou2), ft2(la2, i2, t2); }); function kp(t2, e18) { return xs2(t2, E2(e18, 3), qt2); @@ -116485,9 +45791,9 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function sd2(t2) { return t2 == null ? [] : Jn2(t2, ot2(t2)); } - function Oi2(t2, e18, n4) { - var r2 = t2 == null ? i3 : me2(t2, e18); - return r2 === i3 ? n4 : r2; + function Oi2(t2, e18, n5) { + var r2 = t2 == null ? i2 : me2(t2, e18); + return r2 === i2 ? n5 : r2; } function ud2(t2, e18) { return t2 != null && Tu2(t2, e18, Rf2); @@ -116495,10 +45801,10 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Ri2(t2, e18) { return t2 != null && Tu2(t2, e18, bf2); } - var ad2 = Iu2(function(t2, e18, n4) { - e18 != null && typeof e18.toString != "function" && (e18 = Hn2.call(e18)), t2[e18] = n4; - }, Ti2(ct2)), od2 = Iu2(function(t2, e18, n4) { - e18 != null && typeof e18.toString != "function" && (e18 = Hn2.call(e18)), W2.call(t2, e18) ? t2[e18].push(n4) : t2[e18] = [n4]; + var ad2 = Iu2(function(t2, e18, n5) { + e18 != null && typeof e18.toString != "function" && (e18 = Hn2.call(e18)), t2[e18] = n5; + }, Ti2(ct2)), od2 = Iu2(function(t2, e18, n5) { + e18 != null && typeof e18.toString != "function" && (e18 = Hn2.call(e18)), W2.call(t2, e18) ? t2[e18].push(n5) : t2[e18] = [n5]; }, E2), cd2 = H2(cn2); function k2(t2) { return at2(t2) ? Ms2(t2) : ti2(t2); @@ -116507,32 +45813,32 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return at2(t2) ? Ms2(t2, true) : Wf2(t2); } function fd2(t2, e18) { - var n4 = {}; + var n5 = {}; return e18 = E2(e18, 3), qt2(t2, function(r2, u2, o2) { - Yt2(n4, e18(r2, u2, o2), r2); - }), n4; + Yt2(n5, e18(r2, u2, o2), r2); + }), n5; } function hd2(t2, e18) { - var n4 = {}; + var n5 = {}; return e18 = E2(e18, 3), qt2(t2, function(r2, u2, o2) { - Yt2(n4, u2, e18(r2, u2, o2)); - }), n4; + Yt2(n5, u2, e18(r2, u2, o2)); + }), n5; } - var ld2 = Fe2(function(t2, e18, n4) { - Yn2(t2, e18, n4); - }), la2 = Fe2(function(t2, e18, n4, r2) { - Yn2(t2, e18, n4, r2); + var ld2 = Fe2(function(t2, e18, n5) { + Yn2(t2, e18, n5); + }), la2 = Fe2(function(t2, e18, n5, r2) { + Yn2(t2, e18, n5, r2); }), pd2 = Xt2(function(t2, e18) { - var n4 = {}; + var n5 = {}; if (t2 == null) - return n4; + return n5; var r2 = false; e18 = z3(e18, function(o2) { return o2 = oe2(o2, t2), r2 || (r2 = o2.length > 1), o2; - }), Ft2(t2, di2(t2), n4), r2 && (n4 = Ct2(n4, Dt2 | Bt2 | xe2, ah2)); + }), Ft2(t2, di2(t2), n5), r2 && (n5 = Ct2(n5, Dt2 | Bt2 | xe2, ah2)); for (var u2 = e18.length; u2--; ) - ui2(n4, e18[u2]); - return n4; + ui2(n5, e18[u2]); + return n5; }); function dd2(t2, e18) { return pa2(t2, or2(E2(e18))); @@ -116543,47 +45849,47 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function pa2(t2, e18) { if (t2 == null) return {}; - var n4 = z3(di2(t2), function(r2) { + var n5 = z3(di2(t2), function(r2) { return [r2]; }); - return e18 = E2(e18), iu2(t2, n4, function(r2, u2) { + return e18 = E2(e18), iu2(t2, n5, function(r2, u2) { return e18(r2, u2[0]); }); } - function vd2(t2, e18, n4) { + function vd2(t2, e18, n5) { e18 = oe2(e18, t2); var r2 = -1, u2 = e18.length; - for (u2 || (u2 = 1, t2 = i3); ++r2 < u2; ) { - var o2 = t2 == null ? i3 : t2[Wt2(e18[r2])]; - o2 === i3 && (r2 = u2, o2 = n4), t2 = Vt2(o2) ? o2.call(t2) : o2; + for (u2 || (u2 = 1, t2 = i2); ++r2 < u2; ) { + var o2 = t2 == null ? i2 : t2[Wt2(e18[r2])]; + o2 === i2 && (r2 = u2, o2 = n5), t2 = Vt2(o2) ? o2.call(t2) : o2; } return t2; } - function _d2(t2, e18, n4) { - return t2 == null ? t2 : hn2(t2, e18, n4); + function _d2(t2, e18, n5) { + return t2 == null ? t2 : hn2(t2, e18, n5); } - function md2(t2, e18, n4, r2) { - return r2 = typeof r2 == "function" ? r2 : i3, t2 == null ? t2 : hn2(t2, e18, n4, r2); + function md2(t2, e18, n5, r2) { + return r2 = typeof r2 == "function" ? r2 : i2, t2 == null ? t2 : hn2(t2, e18, n5, r2); } var da2 = yu(k2), ga2 = yu(ot2); - function wd2(t2, e18, n4) { + function wd2(t2, e18, n5) { var r2 = b2(t2), u2 = r2 || fe2(t2) || Be2(t2); - if (e18 = E2(e18, 4), n4 == null) { + if (e18 = E2(e18, 4), n5 == null) { var o2 = t2 && t2.constructor; - u2 ? n4 = r2 ? new o2() : [] : K3(t2) ? n4 = Vt2(o2) ? qe2($n2(t2)) : {} : n4 = {}; + u2 ? n5 = r2 ? new o2() : [] : K3(t2) ? n5 = Vt2(o2) ? qe2($n2(t2)) : {} : n5 = {}; } - return (u2 ? mt2 : qt2)(t2, function(c2, f3, l2) { - return e18(n4, c2, f3, l2); - }), n4; + return (u2 ? mt2 : qt2)(t2, function(c2, f4, l2) { + return e18(n5, c2, f4, l2); + }), n5; } function Pd2(t2, e18) { return t2 == null ? true : ui2(t2, e18); } - function Cd2(t2, e18, n4) { - return t2 == null ? t2 : cu2(t2, e18, ci2(n4)); + function Cd2(t2, e18, n5) { + return t2 == null ? t2 : cu2(t2, e18, ci2(n5)); } - function Ad2(t2, e18, n4, r2) { - return r2 = typeof r2 == "function" ? r2 : i3, t2 == null ? t2 : cu2(t2, e18, ci2(n4), r2); + function Ad2(t2, e18, n5, r2) { + return r2 = typeof r2 == "function" ? r2 : i2, t2 == null ? t2 : cu2(t2, e18, ci2(n5), r2); } function Ge2(t2) { return t2 == null ? [] : Mr2(t2, k2(t2)); @@ -116591,25 +45897,25 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Id2(t2) { return t2 == null ? [] : Mr2(t2, ot2(t2)); } - function xd2(t2, e18, n4) { - return n4 === i3 && (n4 = e18, e18 = i3), n4 !== i3 && (n4 = xt2(n4), n4 = n4 === n4 ? n4 : 0), e18 !== i3 && (e18 = xt2(e18), e18 = e18 === e18 ? e18 : 0), _e3(xt2(t2), e18, n4); + function xd2(t2, e18, n5) { + return n5 === i2 && (n5 = e18, e18 = i2), n5 !== i2 && (n5 = xt2(n5), n5 = n5 === n5 ? n5 : 0), e18 !== i2 && (e18 = xt2(e18), e18 = e18 === e18 ? e18 : 0), _e3(xt2(t2), e18, n5); } - function Ed2(t2, e18, n4) { - return e18 = kt2(e18), n4 === i3 ? (n4 = e18, e18 = 0) : n4 = kt2(n4), t2 = xt2(t2), Tf2(t2, e18, n4); + function Ed2(t2, e18, n5) { + return e18 = kt2(e18), n5 === i2 ? (n5 = e18, e18 = 0) : n5 = kt2(n5), t2 = xt2(t2), Tf2(t2, e18, n5); } - function yd2(t2, e18, n4) { - if (n4 && typeof n4 != "boolean" && it2(t2, e18, n4) && (e18 = n4 = i3), n4 === i3 && (typeof e18 == "boolean" ? (n4 = e18, e18 = i3) : typeof t2 == "boolean" && (n4 = t2, t2 = i3)), t2 === i3 && e18 === i3 ? (t2 = 0, e18 = 1) : (t2 = kt2(t2), e18 === i3 ? (e18 = t2, t2 = 0) : e18 = kt2(e18)), t2 > e18) { + function yd2(t2, e18, n5) { + if (n5 && typeof n5 != "boolean" && it2(t2, e18, n5) && (e18 = n5 = i2), n5 === i2 && (typeof e18 == "boolean" ? (n5 = e18, e18 = i2) : typeof t2 == "boolean" && (n5 = t2, t2 = i2)), t2 === i2 && e18 === i2 ? (t2 = 0, e18 = 1) : (t2 = kt2(t2), e18 === i2 ? (e18 = t2, t2 = 0) : e18 = kt2(e18)), t2 > e18) { var r2 = t2; t2 = e18, e18 = r2; } - if (n4 || t2 % 1 || e18 % 1) { + if (n5 || t2 % 1 || e18 % 1) { var u2 = Fs2(); return et2(t2 + u2 * (e18 - t2 + rc2("1e-" + ((u2 + "").length - 1))), e18); } return ri2(t2, e18); } - var Sd2 = We2(function(t2, e18, n4) { - return e18 = e18.toLowerCase(), t2 + (n4 ? va2(e18) : e18); + var Sd2 = We2(function(t2, e18, n5) { + return e18 = e18.toLowerCase(), t2 + (n5 ? va2(e18) : e18); }); function va2(t2) { return bi2(q2(t2).toLowerCase()); @@ -116617,12 +45923,12 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function _a3(t2) { return t2 = q2(t2), t2 && t2.replace(Oo2, vc2).replace(Yo, ""); } - function Od2(t2, e18, n4) { + function Od2(t2, e18, n5) { t2 = q2(t2), e18 = lt2(e18); var r2 = t2.length; - n4 = n4 === i3 ? r2 : _e3(T9(n4), 0, r2); - var u2 = n4; - return n4 -= e18.length, n4 >= 0 && t2.slice(n4, u2) == e18; + n5 = n5 === i2 ? r2 : _e3(T9(n5), 0, r2); + var u2 = n5; + return n5 -= e18.length, n5 >= 0 && t2.slice(n5, u2) == e18; } function Rd2(t2) { return t2 = q2(t2), t2 && ao2.test(t2) ? t2.replace(Zi2, _c2) : t2; @@ -116630,58 +45936,58 @@ var _n2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function bd2(t2) { return t2 = q2(t2), t2 && po2.test(t2) ? t2.replace(Er2, "\\$&") : t2; } - var Td2 = We2(function(t2, e18, n4) { - return t2 + (n4 ? "-" : "") + e18.toLowerCase(); - }), Ld2 = We2(function(t2, e18, n4) { - return t2 + (n4 ? " " : "") + e18.toLowerCase(); + var Td2 = We2(function(t2, e18, n5) { + return t2 + (n5 ? "-" : "") + e18.toLowerCase(); + }), Ld2 = We2(function(t2, e18, n5) { + return t2 + (n5 ? " " : "") + e18.toLowerCase(); }), Hd2 = Pu2("toLowerCase"); - function Dd2(t2, e18, n4) { + function Dd2(t2, e18, n5) { t2 = q2(t2), e18 = T9(e18); var r2 = e18 ? He2(t2) : 0; if (!e18 || r2 >= e18) return t2; var u2 = (e18 - r2) / 2; - return jn2(Wn2(u2), n4) + t2 + jn2(Fn2(u2), n4); + return jn2(Wn2(u2), n5) + t2 + jn2(Fn2(u2), n5); } - function Nd2(t2, e18, n4) { + function Nd2(t2, e18, n5) { t2 = q2(t2), e18 = T9(e18); var r2 = e18 ? He2(t2) : 0; - return e18 && r2 < e18 ? t2 + jn2(e18 - r2, n4) : t2; + return e18 && r2 < e18 ? t2 + jn2(e18 - r2, n5) : t2; } - function $d2(t2, e18, n4) { + function $d2(t2, e18, n5) { t2 = q2(t2), e18 = T9(e18); var r2 = e18 ? He2(t2) : 0; - return e18 && r2 < e18 ? jn2(e18 - r2, n4) + t2 : t2; + return e18 && r2 < e18 ? jn2(e18 - r2, n5) + t2 : t2; } - function Ud2(t2, e18, n4) { - return n4 || e18 == null ? e18 = 0 : e18 && (e18 = +e18), Gc2(q2(t2).replace(yr2, ""), e18 || 0); + function Ud2(t2, e18, n5) { + return n5 || e18 == null ? e18 = 0 : e18 && (e18 = +e18), Gc2(q2(t2).replace(yr2, ""), e18 || 0); } - function qd2(t2, e18, n4) { - return (n4 ? it2(t2, e18, n4) : e18 === i3) ? e18 = 1 : e18 = T9(e18), ii2(q2(t2), e18); + function qd2(t2, e18, n5) { + return (n5 ? it2(t2, e18, n5) : e18 === i2) ? e18 = 1 : e18 = T9(e18), ii2(q2(t2), e18); } function Fd2() { var t2 = arguments, e18 = q2(t2[0]); return t2.length < 3 ? e18 : e18.replace(t2[1], t2[2]); } - var Wd2 = We2(function(t2, e18, n4) { - return t2 + (n4 ? "_" : "") + e18.toLowerCase(); + var Wd2 = We2(function(t2, e18, n5) { + return t2 + (n5 ? "_" : "") + e18.toLowerCase(); }); - function Md2(t2, e18, n4) { - return n4 && typeof n4 != "number" && it2(t2, e18, n4) && (e18 = n4 = i3), n4 = n4 === i3 ? Ut4 : n4 >>> 0, n4 ? (t2 = q2(t2), t2 && (typeof e18 == "string" || e18 != null && !Si2(e18)) && (e18 = lt2(e18), !e18 && Le2(t2)) ? ce2(St2(t2), 0, n4) : t2.split(e18, n4)) : []; + function Md2(t2, e18, n5) { + return n5 && typeof n5 != "number" && it2(t2, e18, n5) && (e18 = n5 = i2), n5 = n5 === i2 ? Ut4 : n5 >>> 0, n5 ? (t2 = q2(t2), t2 && (typeof e18 == "string" || e18 != null && !Si2(e18)) && (e18 = lt2(e18), !e18 && Le2(t2)) ? ce2(St2(t2), 0, n5) : t2.split(e18, n5)) : []; } - var Bd2 = We2(function(t2, e18, n4) { - return t2 + (n4 ? " " : "") + bi2(e18); + var Bd2 = We2(function(t2, e18, n5) { + return t2 + (n5 ? " " : "") + bi2(e18); }); - function Gd2(t2, e18, n4) { - return t2 = q2(t2), n4 = n4 == null ? 0 : _e3(T9(n4), 0, t2.length), e18 = lt2(e18), t2.slice(n4, n4 + e18.length) == e18; + function Gd2(t2, e18, n5) { + return t2 = q2(t2), n5 = n5 == null ? 0 : _e3(T9(n5), 0, t2.length), e18 = lt2(e18), t2.slice(n5, n5 + e18.length) == e18; } - function zd2(t2, e18, n4) { + function zd2(t2, e18, n5) { var r2 = a3.templateSettings; - n4 && it2(t2, e18, n4) && (e18 = i3), t2 = q2(t2), e18 = hr2({}, e18, r2, Su2); - var u2 = hr2({}, e18.imports, r2.imports, Su2), o2 = k2(u2), c2 = Mr2(u2, o2), f3, l2, v6 = 0, _3 = e18.interpolate || xn2, m3 = "__p += '", C3 = Gr2((e18.escape || xn2).source + "|" + _3.source + "|" + (_3 === Xi2 ? Ao : xn2).source + "|" + (e18.evaluate || xn2).source + "|$", "g"), x3 = "//# sourceURL=" + (W2.call(e18, "sourceURL") ? (e18.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++ko2 + "]") + ` + n5 && it2(t2, e18, n5) && (e18 = i2), t2 = q2(t2), e18 = hr2({}, e18, r2, Su2); + var u2 = hr2({}, e18.imports, r2.imports, Su2), o2 = k2(u2), c2 = Mr2(u2, o2), f4, l2, v6 = 0, _3 = e18.interpolate || xn2, m3 = "__p += '", C3 = Gr2((e18.escape || xn2).source + "|" + _3.source + "|" + (_3 === Xi2 ? Ao : xn2).source + "|" + (e18.evaluate || xn2).source + "|$", "g"), x3 = "//# sourceURL=" + (W2.call(e18, "sourceURL") ? (e18.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++ko2 + "]") + ` `; t2.replace(C3, function(O3, D2, $, dt2, st2, gt2) { - return $ || ($ = dt2), m3 += t2.slice(v6, gt2).replace(Ro2, mc2), D2 && (f3 = true, m3 += `' + + return $ || ($ = dt2), m3 += t2.slice(v6, gt2).replace(Ro2, mc2), D2 && (f4 = true, m3 += `' + __e(` + D2 + `) + '`), st2 && (l2 = true, m3 += `'; ` + st2 + `; @@ -116700,13 +46006,13 @@ __p += '`), $ && (m3 += `' + throw new R3(J2); m3 = (l2 ? m3.replace(ro2, "") : m3).replace(io, "$1").replace(so2, "$1;"), m3 = "function(" + (S4 || "obj") + `) { ` + (S4 ? "" : `obj || (obj = {}); -`) + "var __t, __p = ''" + (f3 ? ", __e = _.escape" : "") + (l2 ? `, __j = Array.prototype.join; +`) + "var __t, __p = ''" + (f4 ? ", __e = _.escape" : "") + (l2 ? `, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } ` : `; `) + m3 + `return __p }`; var L4 = wa2(function() { - return U5(o2, x3 + "return " + m3).apply(i3, c2); + return U5(o2, x3 + "return " + m3).apply(i2, c2); }); if (L4.source = m3, yi2(L4)) throw L4; @@ -116718,24 +46024,24 @@ function print() { __p += __j.call(arguments, '') } function Jd2(t2) { return q2(t2).toUpperCase(); } - function Yd2(t2, e18, n4) { - if (t2 = q2(t2), t2 && (n4 || e18 === i3)) + function Yd2(t2, e18, n5) { + if (t2 = q2(t2), t2 && (n5 || e18 === i2)) return Os2(t2); if (!t2 || !(e18 = lt2(e18))) return t2; var r2 = St2(t2), u2 = St2(e18), o2 = Rs2(r2, u2), c2 = bs2(r2, u2) + 1; return ce2(r2, o2, c2).join(""); } - function Zd2(t2, e18, n4) { - if (t2 = q2(t2), t2 && (n4 || e18 === i3)) + function Zd2(t2, e18, n5) { + if (t2 = q2(t2), t2 && (n5 || e18 === i2)) return t2.slice(0, Ls2(t2) + 1); if (!t2 || !(e18 = lt2(e18))) return t2; var r2 = St2(t2), u2 = bs2(r2, St2(e18)) + 1; return ce2(r2, 0, u2).join(""); } - function Xd2(t2, e18, n4) { - if (t2 = q2(t2), t2 && (n4 || e18 === i3)) + function Xd2(t2, e18, n5) { + if (t2 = q2(t2), t2 && (n5 || e18 === i2)) return t2.replace(yr2, ""); if (!t2 || !(e18 = lt2(e18))) return t2; @@ -116743,10 +46049,10 @@ function print() { __p += __j.call(arguments, '') } return ce2(r2, u2).join(""); } function Qd2(t2, e18) { - var n4 = Ma2, r2 = Ba2; + var n5 = Ma2, r2 = Ba2; if (K3(e18)) { var u2 = "separator" in e18 ? e18.separator : u2; - n4 = "length" in e18 ? T9(e18.length) : n4, r2 = "omission" in e18 ? lt2(e18.omission) : r2; + n5 = "length" in e18 ? T9(e18.length) : n5, r2 = "omission" in e18 ? lt2(e18.omission) : r2; } t2 = q2(t2); var o2 = t2.length; @@ -116754,22 +46060,22 @@ function print() { __p += __j.call(arguments, '') } var c2 = St2(t2); o2 = c2.length; } - if (n4 >= o2) + if (n5 >= o2) return t2; - var f3 = n4 - He2(r2); - if (f3 < 1) + var f4 = n5 - He2(r2); + if (f4 < 1) return r2; - var l2 = c2 ? ce2(c2, 0, f3).join("") : t2.slice(0, f3); - if (u2 === i3) + var l2 = c2 ? ce2(c2, 0, f4).join("") : t2.slice(0, f4); + if (u2 === i2) return l2 + r2; - if (c2 && (f3 += l2.length - f3), Si2(u2)) { - if (t2.slice(f3).search(u2)) { + if (c2 && (f4 += l2.length - f4), Si2(u2)) { + if (t2.slice(f4).search(u2)) { var v6, _3 = l2; for (u2.global || (u2 = Gr2(u2.source, q2(Qi2.exec(u2)) + "g")), u2.lastIndex = 0; v6 = u2.exec(_3); ) var m3 = v6.index; - l2 = l2.slice(0, m3 === i3 ? f3 : m3); + l2 = l2.slice(0, m3 === i2 ? f4 : m3); } - } else if (t2.indexOf(lt2(u2), f3) != f3) { + } else if (t2.indexOf(lt2(u2), f4) != f4) { var C3 = l2.lastIndexOf(u2); C3 > -1 && (l2 = l2.slice(0, C3)); } @@ -116778,29 +46084,29 @@ function print() { __p += __j.call(arguments, '') } function Vd2(t2) { return t2 = q2(t2), t2 && uo2.test(t2) ? t2.replace(Yi2, Ec2) : t2; } - var kd2 = We2(function(t2, e18, n4) { - return t2 + (n4 ? " " : "") + e18.toUpperCase(); + var kd2 = We2(function(t2, e18, n5) { + return t2 + (n5 ? " " : "") + e18.toUpperCase(); }), bi2 = Pu2("toUpperCase"); - function ma2(t2, e18, n4) { - return t2 = q2(t2), e18 = n4 ? i3 : e18, e18 === i3 ? Pc2(t2) ? Oc2(t2) : hc2(t2) : t2.match(e18) || []; + function ma2(t2, e18, n5) { + return t2 = q2(t2), e18 = n5 ? i2 : e18, e18 === i2 ? Pc2(t2) ? Oc2(t2) : hc2(t2) : t2.match(e18) || []; } var wa2 = H2(function(t2, e18) { try { - return ft2(t2, i3, e18); - } catch (n4) { - return yi2(n4) ? n4 : new R3(n4); + return ft2(t2, i2, e18); + } catch (n5) { + return yi2(n5) ? n5 : new R3(n5); } }), jd2 = Xt2(function(t2, e18) { - return mt2(e18, function(n4) { - n4 = Wt2(n4), Yt2(t2, n4, xi2(t2[n4], t2)); + return mt2(e18, function(n5) { + n5 = Wt2(n5), Yt2(t2, n5, xi2(t2[n5], t2)); }), t2; }); function tg2(t2) { - var e18 = t2 == null ? 0 : t2.length, n4 = E2(); + var e18 = t2 == null ? 0 : t2.length, n5 = E2(); return t2 = e18 ? z3(t2, function(r2) { if (typeof r2[1] != "function") throw new wt2(y3); - return [n4(r2[0]), r2[1]]; + return [n5(r2[0]), r2[1]]; }) : [], H2(function(r2) { for (var u2 = -1; ++u2 < e18; ) { var o2 = t2[u2]; @@ -116834,21 +46140,21 @@ function print() { __p += __j.call(arguments, '') } return eu2(t2, Ct2(e18, Dt2)); } var ag2 = H2(function(t2, e18) { - return function(n4) { - return cn2(n4, t2, e18); + return function(n5) { + return cn2(n5, t2, e18); }; }), og2 = H2(function(t2, e18) { - return function(n4) { - return cn2(t2, n4, e18); + return function(n5) { + return cn2(t2, n5, e18); }; }); - function Hi2(t2, e18, n4) { + function Hi2(t2, e18, n5) { var r2 = k2(e18), u2 = Jn2(e18, r2); - n4 == null && !(K3(e18) && (u2.length || !r2.length)) && (n4 = e18, e18 = t2, t2 = this, u2 = Jn2(e18, k2(e18))); - var o2 = !(K3(n4) && "chain" in n4) || !!n4.chain, c2 = Vt2(t2); - return mt2(u2, function(f3) { - var l2 = e18[f3]; - t2[f3] = l2, c2 && (t2.prototype[f3] = function() { + n5 == null && !(K3(e18) && (u2.length || !r2.length)) && (n5 = e18, e18 = t2, t2 = this, u2 = Jn2(e18, k2(e18))); + var o2 = !(K3(n5) && "chain" in n5) || !!n5.chain, c2 = Vt2(t2); + return mt2(u2, function(f4) { + var l2 = e18[f4]; + t2[f4] = l2, c2 && (t2.prototype[f4] = function() { var v6 = this.__chain__; if (o2 || v6) { var _3 = t2(this.__wrapped__), m3 = _3.__actions__ = ut2(this.__actions__); @@ -116874,7 +46180,7 @@ function print() { __p += __j.call(arguments, '') } } function dg2(t2) { return function(e18) { - return t2 == null ? i3 : me2(t2, e18); + return t2 == null ? i2 : me2(t2, e18); }; } var gg2 = xu2(), vg2 = xu2(true); @@ -116896,10 +46202,10 @@ function print() { __p += __j.call(arguments, '') } function Pg2(t2, e18) { if (t2 = T9(t2), t2 < 1 || t2 > ee2) return []; - var n4 = Ut4, r2 = et2(t2, Ut4); + var n5 = Ut4, r2 = et2(t2, Ut4); e18 = E2(e18), t2 -= Ut4; - for (var u2 = Wr2(r2, e18); ++n4 < t2; ) - e18(n4); + for (var u2 = Wr2(r2, e18); ++n5 < t2; ) + e18(n5); return u2; } function Cg2(t2) { @@ -116915,10 +46221,10 @@ function print() { __p += __j.call(arguments, '') } return t2 / e18; }, 1), yg2 = li2("floor"); function Sg2(t2) { - return t2 && t2.length ? Kn2(t2, ct2, Vr2) : i3; + return t2 && t2.length ? Kn2(t2, ct2, Vr2) : i2; } function Og2(t2, e18) { - return t2 && t2.length ? Kn2(t2, E2(e18, 2), Vr2) : i3; + return t2 && t2.length ? Kn2(t2, E2(e18, 2), Vr2) : i2; } function Rg2(t2) { return ys2(t2, ct2); @@ -116927,10 +46233,10 @@ function print() { __p += __j.call(arguments, '') } return ys2(t2, E2(e18, 2)); } function Tg2(t2) { - return t2 && t2.length ? Kn2(t2, ct2, ei2) : i3; + return t2 && t2.length ? Kn2(t2, ct2, ei2) : i2; } function Lg2(t2, e18) { - return t2 && t2.length ? Kn2(t2, E2(e18, 2), ei2) : i3; + return t2 && t2.length ? Kn2(t2, E2(e18, 2), ei2) : i2; } var Hg2 = kn2(function(t2, e18) { return t2 * e18; @@ -116945,34 +46251,34 @@ function print() { __p += __j.call(arguments, '') } } return a3.after = sp, a3.ary = Vu2, a3.assign = Jp, a3.assignIn = ha2, a3.assignInWith = hr2, a3.assignWith = Yp, a3.at = Zp, a3.before = ku2, a3.bind = xi2, a3.bindAll = jd2, a3.bindKey = ju2, a3.castArray = _p2, a3.chain = Zu2, a3.chunk = yh2, a3.compact = Sh2, a3.concat = Oh2, a3.cond = tg2, a3.conforms = eg2, a3.constant = Ti2, a3.countBy = $l, a3.create = Xp, a3.curry = ta2, a3.curryRight = ea2, a3.debounce = na2, a3.defaults = Qp, a3.defaultsDeep = Vp, a3.defer = up, a3.delay = ap, a3.difference = Rh2, a3.differenceBy = bh2, a3.differenceWith = Th2, a3.drop = Lh2, a3.dropRight = Hh2, a3.dropRightWhile = Dh2, a3.dropWhile = Nh2, a3.fill = $h2, a3.filter = ql2, a3.flatMap = Ml, a3.flatMapDeep = Bl, a3.flatMapDepth = Gl, a3.flatten = zu2, a3.flattenDeep = Uh2, a3.flattenDepth = qh2, a3.flip = op, a3.flow = rg2, a3.flowRight = ig2, a3.fromPairs = Fh2, a3.functions = id2, a3.functionsIn = sd2, a3.groupBy = zl, a3.initial = Mh2, a3.intersection = Bh2, a3.intersectionBy = Gh2, a3.intersectionWith = zh2, a3.invert = ad2, a3.invertBy = od2, a3.invokeMap = Jl, a3.iteratee = Li2, a3.keyBy = Yl, a3.keys = k2, a3.keysIn = ot2, a3.map = sr2, a3.mapKeys = fd2, a3.mapValues = hd2, a3.matches = sg2, a3.matchesProperty = ug2, a3.memoize = ar2, a3.merge = ld2, a3.mergeWith = la2, a3.method = ag2, a3.methodOf = og2, a3.mixin = Hi2, a3.negate = or2, a3.nthArg = fg2, a3.omit = pd2, a3.omitBy = dd2, a3.once = cp, a3.orderBy = Zl, a3.over = hg2, a3.overArgs = fp, a3.overEvery = lg2, a3.overSome = pg2, a3.partial = Ei2, a3.partialRight = ra2, a3.partition = Xl, a3.pick = gd2, a3.pickBy = pa2, a3.property = Pa2, a3.propertyOf = dg2, a3.pull = Zh2, a3.pullAll = Ju2, a3.pullAllBy = Xh2, a3.pullAllWith = Qh2, a3.pullAt = Vh2, a3.range = gg2, a3.rangeRight = vg2, a3.rearg = hp, a3.reject = kl2, a3.remove = kh2, a3.rest = lp, a3.reverse = Ai2, a3.sampleSize = tp, a3.set = _d2, a3.setWith = md2, a3.shuffle = ep2, a3.slice = jh2, a3.sortBy = ip, a3.sortedUniq = ul2, a3.sortedUniqBy = al2, a3.split = Md2, a3.spread = pp, a3.tail = ol2, a3.take = cl2, a3.takeRight = fl2, a3.takeRightWhile = hl2, a3.takeWhile = ll2, a3.tap = Sl, a3.throttle = dp, a3.thru = ir2, a3.toArray = oa2, a3.toPairs = da2, a3.toPairsIn = ga2, a3.toPath = Cg2, a3.toPlainObject = fa2, a3.transform = wd2, a3.unary = gp, a3.union = pl2, a3.unionBy = dl2, a3.unionWith = gl2, a3.uniq = vl, a3.uniqBy = _l2, a3.uniqWith = ml2, a3.unset = Pd2, a3.unzip = Ii2, a3.unzipWith = Yu2, a3.update = Cd2, a3.updateWith = Ad2, a3.values = Ge2, a3.valuesIn = Id2, a3.without = wl, a3.words = ma2, a3.wrap = vp, a3.xor = Pl, a3.xorBy = Cl, a3.xorWith = Al, a3.zip = Il, a3.zipObject = xl, a3.zipObjectDeep = El, a3.zipWith = yl, a3.entries = da2, a3.entriesIn = ga2, a3.extend = ha2, a3.extendWith = hr2, Hi2(a3, a3), a3.add = Ig2, a3.attempt = wa2, a3.camelCase = Sd2, a3.capitalize = va2, a3.ceil = xg2, a3.clamp = xd2, a3.clone = mp, a3.cloneDeep = Pp, a3.cloneDeepWith = Cp, a3.cloneWith = wp, a3.conformsTo = Ap, a3.deburr = _a3, a3.defaultTo = ng2, a3.divide = Eg2, a3.endsWith = Od2, a3.eq = Rt2, a3.escape = Rd2, a3.escapeRegExp = bd2, a3.every = Ul, a3.find = Fl, a3.findIndex = Bu2, a3.findKey = kp, a3.findLast = Wl, a3.findLastIndex = Gu2, a3.findLastKey = jp, a3.floor = yg2, a3.forEach = Xu2, a3.forEachRight = Qu2, a3.forIn = td2, a3.forInRight = ed2, a3.forOwn = nd2, a3.forOwnRight = rd2, a3.get = Oi2, a3.gt = Ip, a3.gte = xp, a3.has = ud2, a3.hasIn = Ri2, a3.head = Ku2, a3.identity = ct2, a3.includes = Kl2, a3.indexOf = Wh2, a3.inRange = Ed2, a3.invoke = cd2, a3.isArguments = Ce2, a3.isArray = b2, a3.isArrayBuffer = Ep, a3.isArrayLike = at2, a3.isArrayLikeObject = Z2, a3.isBoolean = yp, a3.isBuffer = fe2, a3.isDate = Sp, a3.isElement = Op, a3.isEmpty = Rp, a3.isEqual = bp, a3.isEqualWith = Tp, a3.isError = yi2, a3.isFinite = Lp, a3.isFunction = Vt2, a3.isInteger = ia2, a3.isLength = cr2, a3.isMap = sa2, a3.isMatch = Hp, a3.isMatchWith = Dp, a3.isNaN = Np, a3.isNative = $p, a3.isNil = qp, a3.isNull = Up, a3.isNumber = ua2, a3.isObject = K3, a3.isObjectLike = Y2, a3.isPlainObject = gn2, a3.isRegExp = Si2, a3.isSafeInteger = Fp2, a3.isSet = aa2, a3.isString = fr2, a3.isSymbol = pt2, a3.isTypedArray = Be2, a3.isUndefined = Wp, a3.isWeakMap = Mp, a3.isWeakSet = Bp, a3.join = Kh2, a3.kebabCase = Td2, a3.last = It2, a3.lastIndexOf = Jh2, a3.lowerCase = Ld2, a3.lowerFirst = Hd2, a3.lt = Gp, a3.lte = zp, a3.max = Sg2, a3.maxBy = Og2, a3.mean = Rg2, a3.meanBy = bg2, a3.min = Tg2, a3.minBy = Lg2, a3.stubArray = Ni2, a3.stubFalse = $i2, a3.stubObject = _g2, a3.stubString = mg2, a3.stubTrue = wg2, a3.multiply = Hg2, a3.nth = Yh2, a3.noConflict = cg2, a3.noop = Di2, a3.now = ur2, a3.pad = Dd2, a3.padEnd = Nd2, a3.padStart = $d2, a3.parseInt = Ud2, a3.random = yd2, a3.reduce = Ql, a3.reduceRight = Vl, a3.repeat = qd2, a3.replace = Fd2, a3.result = vd2, a3.round = Dg2, a3.runInContext = h4, a3.sample = jl2, a3.size = np, a3.snakeCase = Wd2, a3.some = rp2, a3.sortedIndex = tl2, a3.sortedIndexBy = el2, a3.sortedIndexOf = nl2, a3.sortedLastIndex = rl2, a3.sortedLastIndexBy = il2, a3.sortedLastIndexOf = sl2, a3.startCase = Bd2, a3.startsWith = Gd2, a3.subtract = Ng2, a3.sum = $g2, a3.sumBy = Ug2, a3.template = zd2, a3.times = Pg2, a3.toFinite = kt2, a3.toInteger = T9, a3.toLength = ca2, a3.toLower = Kd2, a3.toNumber = xt2, a3.toSafeInteger = Kp, a3.toString = q2, a3.toUpper = Jd2, a3.trim = Yd2, a3.trimEnd = Zd2, a3.trimStart = Xd2, a3.truncate = Qd2, a3.unescape = Vd2, a3.uniqueId = Ag2, a3.upperCase = kd2, a3.upperFirst = bi2, a3.each = Xu2, a3.eachRight = Qu2, a3.first = Ku2, Hi2(a3, function() { var t2 = {}; - return qt2(a3, function(e18, n4) { - W2.call(a3.prototype, n4) || (t2[n4] = e18); + return qt2(a3, function(e18, n5) { + W2.call(a3.prototype, n5) || (t2[n5] = e18); }), t2; }(), { chain: false }), a3.VERSION = p3, mt2(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(t2) { a3[t2].placeholder = a3; }), mt2(["drop", "take"], function(t2, e18) { - N2.prototype[t2] = function(n4) { - n4 = n4 === i3 ? 1 : V3(T9(n4), 0); + N2.prototype[t2] = function(n5) { + n5 = n5 === i2 ? 1 : V3(T9(n5), 0); var r2 = this.__filtered__ && !e18 ? new N2(this) : this.clone(); - return r2.__filtered__ ? r2.__takeCount__ = et2(n4, r2.__takeCount__) : r2.__views__.push({ size: et2(n4, Ut4), type: t2 + (r2.__dir__ < 0 ? "Right" : "") }), r2; - }, N2.prototype[t2 + "Right"] = function(n4) { - return this.reverse()[t2](n4).reverse(); + return r2.__filtered__ ? r2.__takeCount__ = et2(n5, r2.__takeCount__) : r2.__views__.push({ size: et2(n5, Ut4), type: t2 + (r2.__dir__ < 0 ? "Right" : "") }), r2; + }, N2.prototype[t2 + "Right"] = function(n5) { + return this.reverse()[t2](n5).reverse(); }; }), mt2(["filter", "map", "takeWhile"], function(t2, e18) { - var n4 = e18 + 1, r2 = n4 == zi2 || n4 == Ja2; + var n5 = e18 + 1, r2 = n5 == zi2 || n5 == Ja2; N2.prototype[t2] = function(u2) { var o2 = this.clone(); - return o2.__iteratees__.push({ iteratee: E2(u2, 3), type: n4 }), o2.__filtered__ = o2.__filtered__ || r2, o2; + return o2.__iteratees__.push({ iteratee: E2(u2, 3), type: n5 }), o2.__filtered__ = o2.__filtered__ || r2, o2; }; }), mt2(["head", "last"], function(t2, e18) { - var n4 = "take" + (e18 ? "Right" : ""); + var n5 = "take" + (e18 ? "Right" : ""); N2.prototype[t2] = function() { - return this[n4](1).value()[0]; + return this[n5](1).value()[0]; }; }), mt2(["initial", "tail"], function(t2, e18) { - var n4 = "drop" + (e18 ? "" : "Right"); + var n5 = "drop" + (e18 ? "" : "Right"); N2.prototype[t2] = function() { - return this.__filtered__ ? new N2(this) : this[n4](1); + return this.__filtered__ ? new N2(this) : this[n5](1); }; }), N2.prototype.compact = function() { return this.filter(ct2); @@ -116981,70 +46287,70 @@ function print() { __p += __j.call(arguments, '') } }, N2.prototype.findLast = function(t2) { return this.reverse().find(t2); }, N2.prototype.invokeMap = H2(function(t2, e18) { - return typeof t2 == "function" ? new N2(this) : this.map(function(n4) { - return cn2(n4, t2, e18); + return typeof t2 == "function" ? new N2(this) : this.map(function(n5) { + return cn2(n5, t2, e18); }); }), N2.prototype.reject = function(t2) { return this.filter(or2(E2(t2))); }, N2.prototype.slice = function(t2, e18) { t2 = T9(t2); - var n4 = this; - return n4.__filtered__ && (t2 > 0 || e18 < 0) ? new N2(n4) : (t2 < 0 ? n4 = n4.takeRight(-t2) : t2 && (n4 = n4.drop(t2)), e18 !== i3 && (e18 = T9(e18), n4 = e18 < 0 ? n4.dropRight(-e18) : n4.take(e18 - t2)), n4); + var n5 = this; + return n5.__filtered__ && (t2 > 0 || e18 < 0) ? new N2(n5) : (t2 < 0 ? n5 = n5.takeRight(-t2) : t2 && (n5 = n5.drop(t2)), e18 !== i2 && (e18 = T9(e18), n5 = e18 < 0 ? n5.dropRight(-e18) : n5.take(e18 - t2)), n5); }, N2.prototype.takeRightWhile = function(t2) { return this.reverse().takeWhile(t2).reverse(); }, N2.prototype.toArray = function() { return this.take(Ut4); }, qt2(N2.prototype, function(t2, e18) { - var n4 = /^(?:filter|find|map|reject)|While$/.test(e18), r2 = /^(?:head|last)$/.test(e18), u2 = a3[r2 ? "take" + (e18 == "last" ? "Right" : "") : e18], o2 = r2 || /^find/.test(e18); + var n5 = /^(?:filter|find|map|reject)|While$/.test(e18), r2 = /^(?:head|last)$/.test(e18), u2 = a3[r2 ? "take" + (e18 == "last" ? "Right" : "") : e18], o2 = r2 || /^find/.test(e18); u2 && (a3.prototype[e18] = function() { - var c2 = this.__wrapped__, f3 = r2 ? [1] : arguments, l2 = c2 instanceof N2, v6 = f3[0], _3 = l2 || b2(c2), m3 = function(D2) { - var $ = u2.apply(a3, re2([D2], f3)); + var c2 = this.__wrapped__, f4 = r2 ? [1] : arguments, l2 = c2 instanceof N2, v6 = f4[0], _3 = l2 || b2(c2), m3 = function(D2) { + var $ = u2.apply(a3, re2([D2], f4)); return r2 && C3 ? $[0] : $; }; - _3 && n4 && typeof v6 == "function" && v6.length != 1 && (l2 = _3 = false); + _3 && n5 && typeof v6 == "function" && v6.length != 1 && (l2 = _3 = false); var C3 = this.__chain__, x3 = !!this.__actions__.length, S4 = o2 && !C3, L4 = l2 && !x3; if (!o2 && _3) { c2 = L4 ? c2 : new N2(this); - var O3 = t2.apply(c2, f3); - return O3.__actions__.push({ func: ir2, args: [m3], thisArg: i3 }), new Pt2(O3, C3); + var O3 = t2.apply(c2, f4); + return O3.__actions__.push({ func: ir2, args: [m3], thisArg: i2 }), new Pt2(O3, C3); } - return S4 && L4 ? t2.apply(this, f3) : (O3 = this.thru(m3), S4 ? r2 ? O3.value()[0] : O3.value() : O3); + return S4 && L4 ? t2.apply(this, f4) : (O3 = this.thru(m3), S4 ? r2 ? O3.value()[0] : O3.value() : O3); }); }), mt2(["pop", "push", "shift", "sort", "splice", "unshift"], function(t2) { - var e18 = bn2[t2], n4 = /^(?:push|sort|unshift)$/.test(t2) ? "tap" : "thru", r2 = /^(?:pop|shift)$/.test(t2); + var e18 = bn2[t2], n5 = /^(?:push|sort|unshift)$/.test(t2) ? "tap" : "thru", r2 = /^(?:pop|shift)$/.test(t2); a3.prototype[t2] = function() { var u2 = arguments; if (r2 && !this.__chain__) { var o2 = this.value(); return e18.apply(b2(o2) ? o2 : [], u2); } - return this[n4](function(c2) { + return this[n5](function(c2) { return e18.apply(b2(c2) ? c2 : [], u2); }); }; }), qt2(N2.prototype, function(t2, e18) { - var n4 = a3[e18]; - if (n4) { - var r2 = n4.name + ""; - W2.call(Ue2, r2) || (Ue2[r2] = []), Ue2[r2].push({ name: e18, func: n4 }); + var n5 = a3[e18]; + if (n5) { + var r2 = n5.name + ""; + W2.call(Ue2, r2) || (Ue2[r2] = []), Ue2[r2].push({ name: e18, func: n5 }); } - }), Ue2[Vn2(i3, he2).name] = [{ name: "wrapper", func: i3 }], N2.prototype.clone = Qc2, N2.prototype.reverse = Vc2, N2.prototype.value = kc2, a3.prototype.at = Ol, a3.prototype.chain = Rl, a3.prototype.commit = bl2, a3.prototype.next = Tl, a3.prototype.plant = Hl, a3.prototype.reverse = Dl, a3.prototype.toJSON = a3.prototype.valueOf = a3.prototype.value = Nl, a3.prototype.first = a3.prototype.head, en2 && (a3.prototype[en2] = Ll), a3; + }), Ue2[Vn2(i2, he2).name] = [{ name: "wrapper", func: i2 }], N2.prototype.clone = Qc2, N2.prototype.reverse = Vc2, N2.prototype.value = kc2, a3.prototype.at = Ol, a3.prototype.chain = Rl, a3.prototype.commit = bl2, a3.prototype.next = Tl, a3.prototype.plant = Hl, a3.prototype.reverse = Dl, a3.prototype.toJSON = a3.prototype.valueOf = a3.prototype.value = Nl, a3.prototype.first = a3.prototype.head, en2 && (a3.prototype[en2] = Ll), a3; }, De2 = Rc2(); pe2 ? ((pe2.exports = De2)._ = De2, Lr2._ = De2) : j2._ = De2; - }).call(_n2); + }).call(_n); })(qi, qi.exports); -var Vg = Object.defineProperty, kg = Object.defineProperties, jg = Object.getOwnPropertyDescriptors, Ra = Object.getOwnPropertySymbols, tv = Object.prototype.hasOwnProperty, ev = Object.prototype.propertyIsEnumerable, ba = (P2, s2, i3) => s2 in P2 ? Vg(P2, s2, { enumerable: true, configurable: true, writable: true, value: i3 }) : P2[s2] = i3, lr = (P2, s2) => { - for (var i3 in s2 || (s2 = {})) - tv.call(s2, i3) && ba(P2, i3, s2[i3]); +var Vg = Object.defineProperty, kg = Object.defineProperties, jg = Object.getOwnPropertyDescriptors, Ra = Object.getOwnPropertySymbols, tv = Object.prototype.hasOwnProperty, ev = Object.prototype.propertyIsEnumerable, ba = (P2, s2, i2) => s2 in P2 ? Vg(P2, s2, { enumerable: true, configurable: true, writable: true, value: i2 }) : P2[s2] = i2, lr = (P2, s2) => { + for (var i2 in s2 || (s2 = {})) + tv.call(s2, i2) && ba(P2, i2, s2[i2]); if (Ra) - for (var i3 of Ra(s2)) - ev.call(s2, i3) && ba(P2, i3, s2[i3]); + for (var i2 of Ra(s2)) + ev.call(s2, i2) && ba(P2, i2, s2[i2]); return P2; }, nv = (P2, s2) => kg(P2, jg(s2)); -function Lt(P2, s2, i3) { +function Lt(P2, s2, i2) { var p3; const w2 = An(P2); - return ((p3 = s2.rpcMap) == null ? void 0 : p3[w2.reference]) || `${Oa}?chainId=${w2.namespace}:${w2.reference}&projectId=${i3}`; + return ((p3 = s2.rpcMap) == null ? void 0 : p3[w2.reference]) || `${Oa}?chainId=${w2.namespace}:${w2.reference}&projectId=${i2}`; } function Ae(P2) { return P2.includes(":") ? P2.split(":")[1] : P2; @@ -117053,27 +46359,27 @@ function Ta(P2) { return P2.map((s2) => `${s2.split(":")[0]}:${s2.split(":")[1]}`); } function rv(P2, s2) { - const i3 = Object.keys(s2.namespaces).filter((w2) => w2.includes(P2)); - if (!i3.length) + const i2 = Object.keys(s2.namespaces).filter((w2) => w2.includes(P2)); + if (!i2.length) return []; const p3 = []; - return i3.forEach((w2) => { + return i2.forEach((w2) => { const I2 = s2.namespaces[w2].accounts; p3.push(...I2); }), p3; } function Fi(P2 = {}, s2 = {}) { - const i3 = La(P2), p3 = La(s2); - return qi.exports.merge(i3, p3); + const i2 = La(P2), p3 = La(s2); + return qi.exports.merge(i2, p3); } function La(P2) { - var s2, i3, p3, w2; + var s2, i2, p3, w2; const I2 = {}; if (!Xr$1(P2)) return I2; for (const [y3, J2] of Object.entries(P2)) { - const Ht2 = on$1(y3) ? [y3] : J2.chains, Ke2 = J2.methods || [], Ie2 = J2.events || [], Dt2 = J2.rpcMap || {}, Bt2 = xo(y3); - I2[Bt2] = nv(lr(lr({}, I2[Bt2]), J2), { chains: me$1(Ht2, (s2 = I2[Bt2]) == null ? void 0 : s2.chains), methods: me$1(Ke2, (i3 = I2[Bt2]) == null ? void 0 : i3.methods), events: me$1(Ie2, (p3 = I2[Bt2]) == null ? void 0 : p3.events), rpcMap: lr(lr({}, Dt2), (w2 = I2[Bt2]) == null ? void 0 : w2.rpcMap) }); + const Ht2 = on$2(y3) ? [y3] : J2.chains, Ke2 = J2.methods || [], Ie2 = J2.events || [], Dt2 = J2.rpcMap || {}, Bt2 = xo(y3); + I2[Bt2] = nv(lr(lr({}, I2[Bt2]), J2), { chains: me$1(Ht2, (s2 = I2[Bt2]) == null ? void 0 : s2.chains), methods: me$1(Ke2, (i2 = I2[Bt2]) == null ? void 0 : i2.methods), events: me$1(Ie2, (p3 = I2[Bt2]) == null ? void 0 : p3.events), rpcMap: lr(lr({}, Dt2), (w2 = I2[Bt2]) == null ? void 0 : w2.rpcMap) }); } return I2; } @@ -117082,9 +46388,9 @@ function iv(P2) { } function Ha(P2) { const s2 = {}; - for (const [i3, p3] of Object.entries(P2)) { - const w2 = p3.methods || [], I2 = p3.events || [], y3 = p3.accounts || [], J2 = on$1(i3) ? [i3] : p3.chains ? p3.chains : Ta(p3.accounts); - s2[i3] = { chains: J2, methods: w2, events: I2, accounts: y3 }; + for (const [i2, p3] of Object.entries(P2)) { + const w2 = p3.methods || [], I2 = p3.events || [], y3 = p3.accounts || [], J2 = on$2(i2) ? [i2] : p3.chains ? p3.chains : Ta(p3.accounts); + s2[i2] = { chains: J2, methods: w2, events: I2, accounts: y3 }; } return s2; } @@ -117117,44 +46423,44 @@ class sv { request(s2) { return this.namespace.methods.includes(s2.request.method) ? this.client.request(s2) : this.getHttpProvider().request(s2.request); } - setDefaultChain(s2, i3) { - this.httpProviders[s2] || this.setHttpProvider(s2, i3), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); + setDefaultChain(s2, i2) { + this.httpProviders[s2] || this.setHttpProvider(s2, i2), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]) || [] : []; + return s2 ? s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]) || [] : []; } createHttpProviders() { const s2 = {}; - return this.namespace.chains.forEach((i3) => { + return this.namespace.chains.forEach((i2) => { var p3; - const w2 = Ae(i3); - s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i3]); + const w2 = Ae(i2); + s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i2]); }), s2; } getHttpProvider() { - const s2 = `${this.name}:${this.chainId}`, i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const s2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } - createHttpProvider(s2, i3) { - const p3 = i3 || Lt(s2, this.namespace, this.client.core.projectId); + createHttpProvider(s2, i2) { + const p3 = i2 || Lt(s2, this.namespace, this.client.core.projectId); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); - return new o(new f2(p3, F("disableProviderPing"))); + return new o(new f$2(p3, F("disableProviderPing"))); } } -var uv = Object.defineProperty, av = Object.defineProperties, ov = Object.getOwnPropertyDescriptors, Na = Object.getOwnPropertySymbols, cv = Object.prototype.hasOwnProperty, fv = Object.prototype.propertyIsEnumerable, $a = (P2, s2, i3) => s2 in P2 ? uv(P2, s2, { enumerable: true, configurable: true, writable: true, value: i3 }) : P2[s2] = i3, Ua = (P2, s2) => { - for (var i3 in s2 || (s2 = {})) - cv.call(s2, i3) && $a(P2, i3, s2[i3]); +var uv = Object.defineProperty, av = Object.defineProperties, ov = Object.getOwnPropertyDescriptors, Na = Object.getOwnPropertySymbols, cv = Object.prototype.hasOwnProperty, fv = Object.prototype.propertyIsEnumerable, $a = (P2, s2, i2) => s2 in P2 ? uv(P2, s2, { enumerable: true, configurable: true, writable: true, value: i2 }) : P2[s2] = i2, Ua = (P2, s2) => { + for (var i2 in s2 || (s2 = {})) + cv.call(s2, i2) && $a(P2, i2, s2[i2]); if (Na) - for (var i3 of Na(s2)) - fv.call(s2, i3) && $a(P2, i3, s2[i3]); + for (var i2 of Na(s2)) + fv.call(s2, i2) && $a(P2, i2, s2[i2]); return P2; }, qa = (P2, s2) => av(P2, ov(s2)); class hv { @@ -117181,8 +46487,8 @@ class hv { updateNamespace(s2) { this.namespace = Object.assign(this.namespace, s2); } - setDefaultChain(s2, i3) { - this.httpProviders[s2] || this.setHttpProvider(parseInt(s2), i3), this.chainId = parseInt(s2), this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); + setDefaultChain(s2, i2) { + this.httpProviders[s2] || this.setHttpProvider(parseInt(s2), i2), this.chainId = parseInt(s2), this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); } requestAccounts() { return this.getAccounts(); @@ -117197,37 +46503,37 @@ class hv { throw new Error("ChainId not found"); return s2.split(":")[1]; } - createHttpProvider(s2, i3) { - const p3 = i3 || Lt(`${this.name}:${s2}`, this.namespace, this.client.core.projectId); + createHttpProvider(s2, i2) { + const p3 = i2 || Lt(`${this.name}:${s2}`, this.namespace, this.client.core.projectId); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); - return new o(new f2(p3, F("disableProviderPing"))); + return new o(new f$2(p3, F("disableProviderPing"))); } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } createHttpProviders() { const s2 = {}; - return this.namespace.chains.forEach((i3) => { + return this.namespace.chains.forEach((i2) => { var p3; - const w2 = parseInt(Ae(i3)); - s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i3]); + const w2 = parseInt(Ae(i2)); + s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i2]); }), s2; } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? [...new Set(s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]))] : []; + return s2 ? [...new Set(s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } getHttpProvider() { - const s2 = this.chainId, i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const s2 = this.chainId, i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } async handleSwitchChain(s2) { - var i3, p3; - let w2 = s2.request.params ? (i3 = s2.request.params[0]) == null ? void 0 : i3.chainId : "0x0"; + var i2, p3; + let w2 = s2.request.params ? (i2 = s2.request.params[0]) == null ? void 0 : i2.chainId : "0x0"; w2 = w2.startsWith("0x") ? w2 : `0x${w2}`; const I2 = parseInt(w2, 16); if (this.isChainApproved(I2)) @@ -117242,8 +46548,8 @@ class hv { return this.namespace.chains.includes(`${this.name}:${s2}`); } async getCapabilities(s2) { - var i3, p3, w2; - const I2 = (p3 = (i3 = s2.request) == null ? void 0 : i3.params) == null ? void 0 : p3[0]; + var i2, p3, w2; + const I2 = (p3 = (i2 = s2.request) == null ? void 0 : i2.params) == null ? void 0 : p3[0]; if (!I2) throw new Error("Missing address parameter in `wallet_getCapabilities` request"); const y3 = this.client.session.get(s2.topic), J2 = ((w2 = y3 == null ? void 0 : y3.sessionProperties) == null ? void 0 : w2.capabilities) || {}; @@ -117258,8 +46564,8 @@ class hv { return Ht2; } async getCallStatus(s2) { - var i3, p3; - const w2 = this.client.session.get(s2.topic), I2 = (i3 = w2.sessionProperties) == null ? void 0 : i3.bundler_name; + var i2, p3; + const w2 = this.client.session.get(s2.topic), I2 = (i2 = w2.sessionProperties) == null ? void 0 : i2.bundler_name; if (I2) { const J2 = this.getBundlerUrl(s2.chainId, I2); try { @@ -117279,15 +46585,15 @@ class hv { return await this.client.request(s2); throw new Error("Fetching call status not approved by the wallet."); } - async getUserOperationReceipt(s2, i3) { + async getUserOperationReceipt(s2, i2) { var p3; - const w2 = new URL(s2), I2 = await fetch(w2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(formatJsonRpcRequest("eth_getUserOperationReceipt", [(p3 = i3.request.params) == null ? void 0 : p3[0]])) }); + const w2 = new URL(s2), I2 = await fetch(w2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(formatJsonRpcRequest("eth_getUserOperationReceipt", [(p3 = i2.request.params) == null ? void 0 : p3[0]])) }); if (!I2.ok) throw new Error(`Failed to fetch user operation receipt - ${I2.status}`); return await I2.json(); } - getBundlerUrl(s2, i3) { - return `${Qg}?projectId=${this.client.core.projectId}&chainId=${s2}&bundler=${i3}`; + getBundlerUrl(s2, i2) { + return `${Qg}?projectId=${this.client.core.projectId}&chainId=${s2}&bundler=${i2}`; } } class lv { @@ -117303,8 +46609,8 @@ class lv { request(s2) { return this.namespace.methods.includes(s2.request.method) ? this.client.request(s2) : this.getHttpProvider().request(s2.request); } - setDefaultChain(s2, i3) { - this.httpProviders[s2] || this.setHttpProvider(s2, i3), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); + setDefaultChain(s2, i2) { + this.httpProviders[s2] || this.setHttpProvider(s2, i2), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); } getDefaultChain() { if (this.chainId) @@ -117318,31 +46624,31 @@ class lv { } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? [...new Set(s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]))] : []; + return s2 ? [...new Set(s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const s2 = {}; - return this.namespace.chains.forEach((i3) => { + return this.namespace.chains.forEach((i2) => { var p3; - const w2 = Ae(i3); - s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i3]); + const w2 = Ae(i2); + s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i2]); }), s2; } getHttpProvider() { - const s2 = `${this.name}:${this.chainId}`, i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const s2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } - createHttpProvider(s2, i3) { - const p3 = i3 || Lt(s2, this.namespace, this.client.core.projectId); + createHttpProvider(s2, i2) { + const p3 = i2 || Lt(s2, this.namespace, this.client.core.projectId); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); - return new o(new f2(p3, F("disableProviderPing"))); + return new o(new f$2(p3, F("disableProviderPing"))); } } class pv { @@ -117368,36 +46674,36 @@ class pv { request(s2) { return this.namespace.methods.includes(s2.request.method) ? this.client.request(s2) : this.getHttpProvider().request(s2.request); } - setDefaultChain(s2, i3) { - this.httpProviders[s2] || this.setHttpProvider(s2, i3), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`); + setDefaultChain(s2, i2) { + this.httpProviders[s2] || this.setHttpProvider(s2, i2), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`); } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? [...new Set(s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]))] : []; + return s2 ? [...new Set(s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const s2 = {}; - return this.namespace.chains.forEach((i3) => { + return this.namespace.chains.forEach((i2) => { var p3; - const w2 = Ae(i3); - s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i3]); + const w2 = Ae(i2); + s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i2]); }), s2; } getHttpProvider() { - const s2 = `${this.name}:${this.chainId}`, i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const s2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } - createHttpProvider(s2, i3) { - const p3 = i3 || Lt(s2, this.namespace, this.client.core.projectId); + createHttpProvider(s2, i2) { + const p3 = i2 || Lt(s2, this.namespace, this.client.core.projectId); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); - return new o(new f2(p3, F("disableProviderPing"))); + return new o(new f$2(p3, F("disableProviderPing"))); } } class dv { @@ -117413,9 +46719,9 @@ class dv { request(s2) { return this.namespace.methods.includes(s2.request.method) ? this.client.request(s2) : this.getHttpProvider().request(s2.request); } - setDefaultChain(s2, i3) { + setDefaultChain(s2, i2) { if (!this.httpProviders[s2]) { - const p3 = i3 || Lt(`${this.name}:${s2}`, this.namespace, this.client.core.projectId); + const p3 = i2 || Lt(`${this.name}:${s2}`, this.namespace, this.client.core.projectId); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); this.setHttpProvider(s2, p3); @@ -117434,28 +46740,28 @@ class dv { } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? [...new Set(s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]))] : []; + return s2 ? [...new Set(s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const s2 = {}; - return this.namespace.chains.forEach((i3) => { + return this.namespace.chains.forEach((i2) => { var p3; - s2[i3] = this.createHttpProvider(i3, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i3]); + s2[i2] = this.createHttpProvider(i2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i2]); }), s2; } getHttpProvider() { - const s2 = `${this.name}:${this.chainId}`, i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const s2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } - createHttpProvider(s2, i3) { - const p3 = i3 || Lt(s2, this.namespace, this.client.core.projectId); - return typeof p3 > "u" ? void 0 : new o(new f2(p3, F("disableProviderPing"))); + createHttpProvider(s2, i2) { + const p3 = i2 || Lt(s2, this.namespace, this.client.core.projectId); + return typeof p3 > "u" ? void 0 : new o(new f$2(p3, F("disableProviderPing"))); } } class gv { @@ -117481,40 +46787,40 @@ class gv { request(s2) { return this.namespace.methods.includes(s2.request.method) ? this.client.request(s2) : this.getHttpProvider().request(s2.request); } - setDefaultChain(s2, i3) { - this.httpProviders[s2] || this.setHttpProvider(s2, i3), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`); + setDefaultChain(s2, i2) { + this.httpProviders[s2] || this.setHttpProvider(s2, i2), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`); } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? [...new Set(s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]))] : []; + return s2 ? [...new Set(s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const s2 = {}; - return this.namespace.chains.forEach((i3) => { - const p3 = this.getCardanoRPCUrl(i3), w2 = Ae(i3); + return this.namespace.chains.forEach((i2) => { + const p3 = this.getCardanoRPCUrl(i2), w2 = Ae(i2); s2[w2] = this.createHttpProvider(w2, p3); }), s2; } getHttpProvider() { - const s2 = `${this.name}:${this.chainId}`, i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const s2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } getCardanoRPCUrl(s2) { - const i3 = this.namespace.rpcMap; - if (i3) - return i3[s2]; + const i2 = this.namespace.rpcMap; + if (i2) + return i2[s2]; } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } - createHttpProvider(s2, i3) { - const p3 = i3 || this.getCardanoRPCUrl(s2); + createHttpProvider(s2, i2) { + const p3 = i2 || this.getCardanoRPCUrl(s2); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); - return new o(new f2(p3, F("disableProviderPing"))); + return new o(new f$2(p3, F("disableProviderPing"))); } } class vv { @@ -117530,8 +46836,8 @@ class vv { request(s2) { return this.namespace.methods.includes(s2.request.method) ? this.client.request(s2) : this.getHttpProvider().request(s2.request); } - setDefaultChain(s2, i3) { - this.httpProviders[s2] || this.setHttpProvider(s2, i3), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); + setDefaultChain(s2, i2) { + this.httpProviders[s2] || this.setHttpProvider(s2, i2), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); } getDefaultChain() { if (this.chainId) @@ -117545,31 +46851,31 @@ class vv { } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? [...new Set(s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]))] : []; + return s2 ? [...new Set(s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const s2 = {}; - return this.namespace.chains.forEach((i3) => { + return this.namespace.chains.forEach((i2) => { var p3; - const w2 = Ae(i3); - s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i3]); + const w2 = Ae(i2); + s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i2]); }), s2; } getHttpProvider() { - const s2 = `${this.name}:${this.chainId}`, i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const s2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } - createHttpProvider(s2, i3) { - const p3 = i3 || Lt(s2, this.namespace, this.client.core.projectId); + createHttpProvider(s2, i2) { + const p3 = i2 || Lt(s2, this.namespace, this.client.core.projectId); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); - return new o(new f2(p3, F("disableProviderPing"))); + return new o(new f$2(p3, F("disableProviderPing"))); } } class _v { @@ -117585,8 +46891,8 @@ class _v { request(s2) { return this.namespace.methods.includes(s2.request.method) ? this.client.request(s2) : this.getHttpProvider().request(s2.request); } - setDefaultChain(s2, i3) { - this.httpProviders[s2] || this.setHttpProvider(s2, i3), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); + setDefaultChain(s2, i2) { + this.httpProviders[s2] || this.setHttpProvider(s2, i2), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); } getDefaultChain() { if (this.chainId) @@ -117600,31 +46906,31 @@ class _v { } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? [...new Set(s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]))] : []; + return s2 ? [...new Set(s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const s2 = {}; - return this.namespace.chains.forEach((i3) => { + return this.namespace.chains.forEach((i2) => { var p3; - const w2 = Ae(i3); - s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i3]); + const w2 = Ae(i2); + s2[w2] = this.createHttpProvider(w2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i2]); }), s2; } getHttpProvider() { - const s2 = `${this.name}:${this.chainId}`, i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const s2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } - createHttpProvider(s2, i3) { - const p3 = i3 || Lt(s2, this.namespace, this.client.core.projectId); + createHttpProvider(s2, i2) { + const p3 = i2 || Lt(s2, this.namespace, this.client.core.projectId); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); - return new o(new f2(p3, F("disableProviderPing"))); + return new o(new f$2(p3, F("disableProviderPing"))); } } class mv { @@ -117650,9 +46956,9 @@ class mv { request(s2) { return this.namespace.methods.includes(s2.request.method) ? this.client.request(s2) : this.getHttpProvider().request(s2.request); } - setDefaultChain(s2, i3) { + setDefaultChain(s2, i2) { if (this.chainId = s2, !this.httpProviders[s2]) { - const p3 = i3 || Lt(`${this.name}:${s2}`, this.namespace); + const p3 = i2 || Lt(`${this.name}:${s2}`, this.namespace); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); this.setHttpProvider(s2, p3); @@ -117661,28 +46967,28 @@ class mv { } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]) || [] : []; + return s2 ? s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]) || [] : []; } createHttpProviders() { const s2 = {}; - return this.namespace.chains.forEach((i3) => { + return this.namespace.chains.forEach((i2) => { var p3; - s2[i3] = this.createHttpProvider(i3, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i3]); + s2[i2] = this.createHttpProvider(i2, (p3 = this.namespace.rpcMap) == null ? void 0 : p3[i2]); }), s2; } getHttpProvider() { - const s2 = `${this.name}:${this.chainId}`, i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const s2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } - createHttpProvider(s2, i3) { - const p3 = i3 || Lt(s2, this.namespace); - return typeof p3 > "u" ? void 0 : new o(new f2(p3, F("disableProviderPing"))); + createHttpProvider(s2, i2) { + const p3 = i2 || Lt(s2, this.namespace); + return typeof p3 > "u" ? void 0 : new o(new f$2(p3, F("disableProviderPing"))); } } class wv { @@ -117698,8 +47004,8 @@ class wv { request(s2) { return this.namespace.methods.includes(s2.request.method) ? this.client.request(s2) : this.getHttpProvider(s2.chainId).request(s2.request); } - setDefaultChain(s2, i3) { - this.httpProviders[s2] || this.setHttpProvider(s2, i3), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); + setDefaultChain(s2, i2) { + this.httpProviders[s2] || this.setHttpProvider(s2, i2), this.chainId = s2, this.events.emit(Tt.DEFAULT_CHAIN_CHANGED, `${this.name}:${s2}`); } getDefaultChain() { if (this.chainId) @@ -117713,39 +47019,39 @@ class wv { } getAccounts() { const s2 = this.namespace.accounts; - return s2 ? [...new Set(s2.filter((i3) => i3.split(":")[1] === this.chainId.toString()).map((i3) => i3.split(":")[2]))] : []; + return s2 ? [...new Set(s2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { - var s2, i3; + var s2, i2; const p3 = {}; - return (i3 = (s2 = this.namespace) == null ? void 0 : s2.accounts) == null || i3.forEach((w2) => { + return (i2 = (s2 = this.namespace) == null ? void 0 : s2.accounts) == null || i2.forEach((w2) => { const I2 = An(w2); p3[`${I2.namespace}:${I2.reference}`] = this.createHttpProvider(w2); }), p3; } getHttpProvider(s2) { - const i3 = this.httpProviders[s2]; - if (typeof i3 > "u") + const i2 = this.httpProviders[s2]; + if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${s2} not found`); - return i3; + return i2; } - setHttpProvider(s2, i3) { - const p3 = this.createHttpProvider(s2, i3); + setHttpProvider(s2, i2) { + const p3 = this.createHttpProvider(s2, i2); p3 && (this.httpProviders[s2] = p3); } - createHttpProvider(s2, i3) { - const p3 = i3 || Lt(s2, this.namespace, this.client.core.projectId); + createHttpProvider(s2, i2) { + const p3 = i2 || Lt(s2, this.namespace, this.client.core.projectId); if (!p3) throw new Error(`No RPC url provided for chainId: ${s2}`); - return new o(new f2(p3, F("disableProviderPing"))); + return new o(new f$2(p3, F("disableProviderPing"))); } } -var Pv = Object.defineProperty, Cv = Object.defineProperties, Av = Object.getOwnPropertyDescriptors, Fa = Object.getOwnPropertySymbols, Iv = Object.prototype.hasOwnProperty, xv = Object.prototype.propertyIsEnumerable, Wa = (P2, s2, i3) => s2 in P2 ? Pv(P2, s2, { enumerable: true, configurable: true, writable: true, value: i3 }) : P2[s2] = i3, pr = (P2, s2) => { - for (var i3 in s2 || (s2 = {})) - Iv.call(s2, i3) && Wa(P2, i3, s2[i3]); +var Pv = Object.defineProperty, Cv = Object.defineProperties, Av = Object.getOwnPropertyDescriptors, Fa = Object.getOwnPropertySymbols, Iv = Object.prototype.hasOwnProperty, xv = Object.prototype.propertyIsEnumerable, Wa = (P2, s2, i2) => s2 in P2 ? Pv(P2, s2, { enumerable: true, configurable: true, writable: true, value: i2 }) : P2[s2] = i2, pr = (P2, s2) => { + for (var i2 in s2 || (s2 = {})) + Iv.call(s2, i2) && Wa(P2, i2, s2[i2]); if (Fa) - for (var i3 of Fa(s2)) - xv.call(s2, i3) && Wa(P2, i3, s2[i3]); + for (var i2 of Fa(s2)) + xv.call(s2, i2) && Wa(P2, i2, s2[i2]); return P2; }, Bi = (P2, s2) => Cv(P2, Av(s2)); class dr2 { @@ -117753,18 +47059,18 @@ class dr2 { this.events = new Jg(), this.rpcProviders = {}, this.shouldAbortPairingAttempt = false, this.maxPairingAttempts = 10, this.disableProviderPing = false, this.providerOpts = s2, this.logger = typeof (s2 == null ? void 0 : s2.logger) < "u" && typeof (s2 == null ? void 0 : s2.logger) != "string" ? s2.logger : Mg(k({ level: (s2 == null ? void 0 : s2.logger) || ya })), this.disableProviderPing = (s2 == null ? void 0 : s2.disableProviderPing) || false; } static async init(s2) { - const i3 = new dr2(s2); - return await i3.initialize(), i3; + const i2 = new dr2(s2); + return await i2.initialize(), i2; } - async request(s2, i3, p3) { - const [w2, I2] = this.validateChain(i3); + async request(s2, i2, p3) { + const [w2, I2] = this.validateChain(i2); if (!this.session) throw new Error("Please call connect() before request()"); return await this.getProvider(w2).request({ request: pr({}, s2), chainId: `${w2}:${I2}`, topic: this.session.topic, expiry: p3 }); } - sendAsync(s2, i3, p3, w2) { + sendAsync(s2, i2, p3, w2) { const I2 = (/* @__PURE__ */ new Date()).getTime(); - this.request(s2, p3, w2).then((y3) => i3(null, formatJsonRpcResult(I2, y3))).catch((y3) => i3(y3, void 0)); + this.request(s2, p3, w2).then((y3) => i2(null, formatJsonRpcResult(I2, y3))).catch((y3) => i2(y3, void 0)); } async enable() { if (!this.client) @@ -117783,11 +47089,11 @@ class dr2 { if (this.setNamespaces(s2), await this.cleanupPendingPairings(), !s2.skipPairing) return await this.pair(s2.pairingTopic); } - async authenticate(s2, i3) { + async authenticate(s2, i2) { if (!this.client) throw new Error("Sign Client not initialized"); this.setNamespaces(s2), await this.cleanupPendingPairings(); - const { uri: p3, response: w2 } = await this.client.authenticate(s2, i3); + const { uri: p3, response: w2 } = await this.client.authenticate(s2, i2); p3 && (this.uri = p3, this.events.emit("display_uri", p3)); const I2 = await w2(); if (this.session = I2.session, this.session) { @@ -117796,28 +47102,28 @@ class dr2 { } return I2; } - on(s2, i3) { - this.events.on(s2, i3); + on(s2, i2) { + this.events.on(s2, i2); } - once(s2, i3) { - this.events.once(s2, i3); + once(s2, i2) { + this.events.once(s2, i2); } - removeListener(s2, i3) { - this.events.removeListener(s2, i3); + removeListener(s2, i2) { + this.events.removeListener(s2, i2); } - off(s2, i3) { - this.events.off(s2, i3); + off(s2, i2) { + this.events.off(s2, i2); } get isWalletConnect() { return true; } async pair(s2) { this.shouldAbortPairingAttempt = false; - let i3 = 0; + let i2 = 0; do { if (this.shouldAbortPairingAttempt) throw new Error("Pairing aborted"); - if (i3 >= this.maxPairingAttempts) + if (i2 >= this.maxPairingAttempts) throw new Error("Max auto pairing attempts reached"); const { uri: p3, approval: w2 } = await this.client.connect({ pairingTopic: s2, requiredNamespaces: this.namespaces, optionalNamespaces: this.optionalNamespaces, sessionProperties: this.sessionProperties }); p3 && (this.uri = p3, this.events.emit("display_uri", p3)), await w2().then((I2) => { @@ -117827,17 +47133,17 @@ class dr2 { }).catch((I2) => { if (I2.message !== it) throw I2; - i3++; + i2++; }); } while (!this.session); return this.onConnect(), this.session; } - setDefaultChain(s2, i3) { + setDefaultChain(s2, i2) { try { if (!this.session) return; const [p3, w2] = this.validateChain(s2), I2 = this.getProvider(p3); - I2.name === ze ? I2.setDefaultChain(`${p3}:${w2}`, i3) : I2.setDefaultChain(w2, i3); + I2.name === ze ? I2.setDefaultChain(`${p3}:${w2}`, i2) : I2.setDefaultChain(w2, i2); } catch (p3) { if (!/Please call connect/.test(p3.message)) throw p3; @@ -117845,11 +47151,11 @@ class dr2 { } async cleanupPendingPairings(s2 = {}) { this.logger.info("Cleaning up inactive pairings..."); - const i3 = this.client.pairing.getAll(); - if (Nr$1(i3)) { - for (const p3 of i3) + const i2 = this.client.pairing.getAll(); + if (Nr$1(i2)) { + for (const p3 of i2) s2.deletePairings ? this.client.core.expirer.set(p3.topic, 0) : await this.client.core.relayer.subscriber.unsubscribe(p3.topic); - this.logger.info(`Inactive pairings cleared: ${i3.length}`); + this.logger.info(`Inactive pairings cleared: ${i2.length}`); } } abortPairingAttempt() { @@ -117872,38 +47178,38 @@ class dr2 { throw new Error("Sign Client not initialized"); if (!this.session) throw new Error("Session not initialized. Please call connect() before enable()"); - const s2 = [...new Set(Object.keys(this.session.namespaces).map((i3) => xo(i3)))]; - Mi("client", this.client), Mi("events", this.events), Mi("disableProviderPing", this.disableProviderPing), s2.forEach((i3) => { + const s2 = [...new Set(Object.keys(this.session.namespaces).map((i2) => xo(i2)))]; + Mi("client", this.client), Mi("events", this.events), Mi("disableProviderPing", this.disableProviderPing), s2.forEach((i2) => { if (!this.session) return; - const p3 = rv(i3, this.session), w2 = Ta(p3), I2 = Fi(this.namespaces, this.optionalNamespaces), y3 = Bi(pr({}, I2[i3]), { accounts: p3, chains: w2 }); - switch (i3) { + const p3 = rv(i2, this.session), w2 = Ta(p3), I2 = Fi(this.namespaces, this.optionalNamespaces), y3 = Bi(pr({}, I2[i2]), { accounts: p3, chains: w2 }); + switch (i2) { case "eip155": - this.rpcProviders[i3] = new hv({ namespace: y3 }); + this.rpcProviders[i2] = new hv({ namespace: y3 }); break; case "algorand": - this.rpcProviders[i3] = new dv({ namespace: y3 }); + this.rpcProviders[i2] = new dv({ namespace: y3 }); break; case "solana": - this.rpcProviders[i3] = new lv({ namespace: y3 }); + this.rpcProviders[i2] = new lv({ namespace: y3 }); break; case "cosmos": - this.rpcProviders[i3] = new pv({ namespace: y3 }); + this.rpcProviders[i2] = new pv({ namespace: y3 }); break; case "polkadot": - this.rpcProviders[i3] = new sv({ namespace: y3 }); + this.rpcProviders[i2] = new sv({ namespace: y3 }); break; case "cip34": - this.rpcProviders[i3] = new gv({ namespace: y3 }); + this.rpcProviders[i2] = new gv({ namespace: y3 }); break; case "elrond": - this.rpcProviders[i3] = new vv({ namespace: y3 }); + this.rpcProviders[i2] = new vv({ namespace: y3 }); break; case "multiversx": - this.rpcProviders[i3] = new _v({ namespace: y3 }); + this.rpcProviders[i2] = new _v({ namespace: y3 }); break; case "near": - this.rpcProviders[i3] = new mv({ namespace: y3 }); + this.rpcProviders[i2] = new mv({ namespace: y3 }); break; default: this.rpcProviders[ze] ? this.rpcProviders[ze].updateNamespace(y3) : this.rpcProviders[ze] = new wv({ namespace: y3 }); @@ -117916,20 +47222,20 @@ class dr2 { this.client.on("session_ping", (s2) => { this.events.emit("session_ping", s2); }), this.client.on("session_event", (s2) => { - const { params: i3 } = s2, { event: p3 } = i3; + const { params: i2 } = s2, { event: p3 } = i2; if (p3.name === "accountsChanged") { const w2 = p3.data; w2 && Nr$1(w2) && this.events.emit("accountsChanged", w2.map(iv)); } else if (p3.name === "chainChanged") { - const w2 = i3.chainId, I2 = i3.event.data, y3 = xo(w2), J2 = Wi(w2) !== Wi(I2) ? `${y3}:${Wi(I2)}` : w2; + const w2 = i2.chainId, I2 = i2.event.data, y3 = xo(w2), J2 = Wi(w2) !== Wi(I2) ? `${y3}:${Wi(I2)}` : w2; this.onChainChanged(J2); } else this.events.emit(p3.name, p3.data); this.events.emit("session_event", s2); - }), this.client.on("session_update", ({ topic: s2, params: i3 }) => { + }), this.client.on("session_update", ({ topic: s2, params: i2 }) => { var p3; - const { namespaces: w2 } = i3, I2 = (p3 = this.client) == null ? void 0 : p3.session.get(s2); - this.session = Bi(pr({}, I2), { namespaces: w2 }), this.onSessionUpdate(), this.events.emit("session_update", { topic: s2, params: i3 }); + const { namespaces: w2 } = i2, I2 = (p3 = this.client) == null ? void 0 : p3.session.get(s2); + this.session = Bi(pr({}, I2), { namespaces: w2 }), this.onSessionUpdate(), this.events.emit("session_update", { topic: s2, params: i2 }); }), this.client.on("session_delete", async (s2) => { await this.cleanup(), this.events.emit("session_delete", s2), this.events.emit("disconnect", Bi(pr({}, er$1("USER_DISCONNECTED")), { data: s2.topic })); }), this.on(Tt.DEFAULT_CHAIN_CHANGED, (s2) => { @@ -117941,22 +47247,22 @@ class dr2 { } onSessionUpdate() { Object.keys(this.rpcProviders).forEach((s2) => { - var i3; - this.getProvider(s2).updateNamespace((i3 = this.session) == null ? void 0 : i3.namespaces[s2]); + var i2; + this.getProvider(s2).updateNamespace((i2 = this.session) == null ? void 0 : i2.namespaces[s2]); }); } setNamespaces(s2) { - const { namespaces: i3, optionalNamespaces: p3, sessionProperties: w2 } = s2; - i3 && Object.keys(i3).length && (this.namespaces = i3), p3 && Object.keys(p3).length && (this.optionalNamespaces = p3), this.sessionProperties = w2, this.persist("namespaces", i3), this.persist("optionalNamespaces", p3); + const { namespaces: i2, optionalNamespaces: p3, sessionProperties: w2 } = s2; + i2 && Object.keys(i2).length && (this.namespaces = i2), p3 && Object.keys(p3).length && (this.optionalNamespaces = p3), this.sessionProperties = w2, this.persist("namespaces", i2), this.persist("optionalNamespaces", p3); } validateChain(s2) { - const [i3, p3] = (s2 == null ? void 0 : s2.split(":")) || ["", ""]; + const [i2, p3] = (s2 == null ? void 0 : s2.split(":")) || ["", ""]; if (!this.namespaces || !Object.keys(this.namespaces).length) - return [i3, p3]; - if (i3 && !Object.keys(this.namespaces || {}).map((y3) => xo(y3)).includes(i3)) - throw new Error(`Namespace '${i3}' is not configured. Please call connect() first with namespace config.`); - if (i3 && p3) - return [i3, p3]; + return [i2, p3]; + if (i2 && !Object.keys(this.namespaces || {}).map((y3) => xo(y3)).includes(i2)) + throw new Error(`Namespace '${i2}' is not configured. Please call connect() first with namespace config.`); + if (i2 && p3) + return [i2, p3]; const w2 = xo(Object.keys(this.namespaces)[0]), I2 = this.rpcProviders[w2].getDefaultChain(); return [w2, I2]; } @@ -117964,11 +47270,11 @@ class dr2 { const [s2] = this.validateChain(); return await this.getProvider(s2).requestAccounts(); } - onChainChanged(s2, i3 = false) { + onChainChanged(s2, i2 = false) { if (!this.namespaces) return; const [p3, w2] = this.validateChain(s2); - w2 && (i3 || this.getProvider(p3).setDefaultChain(w2), this.namespaces[p3] ? this.namespaces[p3].defaultChain = w2 : this.namespaces[`${p3}:${w2}`] ? this.namespaces[`${p3}:${w2}`].defaultChain = w2 : this.namespaces[`${p3}:${w2}`] = { defaultChain: w2 }, this.persist("namespaces", this.namespaces), this.events.emit("chainChanged", w2)); + w2 && (i2 || this.getProvider(p3).setDefaultChain(w2), this.namespaces[p3] ? this.namespaces[p3].defaultChain = w2 : this.namespaces[`${p3}:${w2}`] ? this.namespaces[`${p3}:${w2}`].defaultChain = w2 : this.namespaces[`${p3}:${w2}`] = { defaultChain: w2 }, this.persist("namespaces", this.namespaces), this.events.emit("chainChanged", w2)); } onConnect() { this.createProviders(), this.events.emit("connect", { session: this.session }); @@ -117976,8 +47282,8 @@ class dr2 { async cleanup() { this.session = void 0, this.namespaces = void 0, this.optionalNamespaces = void 0, this.sessionProperties = void 0, this.persist("namespaces", void 0), this.persist("optionalNamespaces", void 0), this.persist("sessionProperties", void 0), await this.cleanupPendingPairings({ deletePairings: true }); } - persist(s2, i3) { - this.client.core.storage.setItem(`${Sa}/${s2}`, i3); + persist(s2, i2) { + this.client.core.storage.setItem(`${Sa}/${s2}`, i2); } async getFromStore(s2) { return await this.client.core.storage.getItem(`${Sa}/${s2}`); @@ -117991,18 +47297,18 @@ var uaParser = { exports: {} }; var AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", BROWSER = "Browser", CHROME = "Chrome", EDGE = "Edge", FIREFOX = "Firefox", GOOGLE = "Google", HUAWEI = "Huawei", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", OPERA = "Opera", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", FACEBOOK = "Facebook", CHROMIUM_OS = "Chromium OS", MAC_OS = "Mac OS", SUFFIX_BROWSER = " Browser"; var extend2 = function(regexes2, extensions) { var mergedRegexes = {}; - for (var i3 in regexes2) { - if (extensions[i3] && extensions[i3].length % 2 === 0) { - mergedRegexes[i3] = extensions[i3].concat(regexes2[i3]); + for (var i2 in regexes2) { + if (extensions[i2] && extensions[i2].length % 2 === 0) { + mergedRegexes[i2] = extensions[i2].concat(regexes2[i2]); } else { - mergedRegexes[i3] = regexes2[i3]; + mergedRegexes[i2] = regexes2[i2]; } } return mergedRegexes; }, enumerize = function(arr) { var enums = {}; - for (var i3 = 0; i3 < arr.length; i3++) { - enums[arr[i3].toUpperCase()] = arr[i3]; + for (var i2 = 0; i2 < arr.length; i2++) { + enums[arr[i2].toUpperCase()] = arr[i2]; } return enums; }, has = function(str1, str2) { @@ -118018,9 +47324,9 @@ var uaParser = { exports: {} }; } }; var rgxMapper = function(ua2, arrays) { - var i3 = 0, j2, k2, p3, q2, matches2, match; - while (i3 < arrays.length && !matches2) { - var regex2 = arrays[i3], props = arrays[i3 + 1]; + var i2 = 0, j2, k2, p3, q2, matches2, match; + while (i2 < arrays.length && !matches2) { + var regex2 = arrays[i2], props = arrays[i2 + 1]; j2 = k2 = 0; while (j2 < regex2.length && !matches2) { if (!regex2[j2]) { @@ -118053,18 +47359,18 @@ var uaParser = { exports: {} }; } } } - i3 += 2; + i2 += 2; } }, strMapper = function(str, map) { - for (var i3 in map) { - if (typeof map[i3] === OBJ_TYPE && map[i3].length > 0) { - for (var j2 = 0; j2 < map[i3].length; j2++) { - if (has(map[i3][j2], str)) { - return i3 === UNKNOWN ? undefined$1 : i3; + for (var i2 in map) { + if (typeof map[i2] === OBJ_TYPE && map[i2].length > 0) { + for (var j2 = 0; j2 < map[i2].length; j2++) { + if (has(map[i2][j2], str)) { + return i2 === UNKNOWN ? undefined$1 : i2; } } - } else if (has(map[i3], str)) { - return i3 === UNKNOWN ? undefined$1 : i3; + } else if (has(map[i2], str)) { + return i2 === UNKNOWN ? undefined$1 : i2; } } return map.hasOwnProperty("*") ? map["*"] : str; @@ -119032,1602 +48338,72514 @@ var uaParser = { exports: {} }; /windows.+ edge\/([\w\.]+)/i // EdgeHTML ], - [VERSION2, [NAME, EDGE + "HTML"]], + [VERSION2, [NAME, EDGE + "HTML"]], + [ + /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i + // Blink + ], + [VERSION2, [NAME, "Blink"]], + [ + /(presto)\/([\w\.]+)/i, + // Presto + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, + // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna + /ekioh(flow)\/([\w\.]+)/i, + // Flow + /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, + // KHTML/Tasman/Links + /(icab)[\/ ]([23]\.[\d\.]+)/i, + // iCab + /\b(libweb)/i + ], + [NAME, VERSION2], + [ + /rv\:([\w\.]{1,9})\b.+(gecko)/i + // Gecko + ], + [VERSION2, NAME] + ], + os: [ + [ + // Windows + /microsoft (windows) (vista|xp)/i + // Windows (iTunes) + ], + [NAME, VERSION2], + [ + /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i + // Windows Phone + ], + [NAME, [VERSION2, strMapper, windowsVersionMap]], + [ + /windows nt 6\.2; (arm)/i, + // Windows RT + /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i, + /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i + ], + [[VERSION2, strMapper, windowsVersionMap], [NAME, "Windows"]], + [ + // iOS/macOS + /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, + // iOS + /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, + /cfnetwork\/.+darwin/i + ], + [[VERSION2, /_/g, "."], [NAME, "iOS"]], + [ + /(mac os x) ?([\w\. ]*)/i, + /(macintosh|mac_powerpc\b)(?!.+haiku)/i + // Mac OS + ], + [[NAME, MAC_OS], [VERSION2, /_/g, "."]], + [ + // Mobile OSes + /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i + // Android-x86/HarmonyOS + ], + [VERSION2, NAME], + [ + // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS + /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, + /(blackberry)\w*\/([\w\.]*)/i, + // Blackberry + /(tizen|kaios)[\/ ]([\w\.]+)/i, + // Tizen/KaiOS + /\((series40);/i + // Series 40 + ], + [NAME, VERSION2], + [ + /\(bb(10);/i + // BlackBerry 10 + ], + [VERSION2, [NAME, BLACKBERRY]], + [ + /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i + // Symbian + ], + [VERSION2, [NAME, "Symbian"]], + [ + /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i + // Firefox OS + ], + [VERSION2, [NAME, FIREFOX + " OS"]], + [ + /web0s;.+rt(tv)/i, + /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i + // WebOS + ], + [VERSION2, [NAME, "webOS"]], + [ + /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i + // watchOS + ], + [VERSION2, [NAME, "watchOS"]], + [ + // Google Chromecast + /crkey\/([\d\.]+)/i + // Google Chromecast + ], + [VERSION2, [NAME, CHROME + "cast"]], + [ + /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i + // Chromium OS + ], + [[NAME, CHROMIUM_OS], VERSION2], [ - /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i - // Blink + // Smart TVs + /panasonic;(viera)/i, + // Panasonic Viera + /(netrange)mmh/i, + // Netrange + /(nettv)\/(\d+\.[\w\.]+)/i, + // NetTV + // Console + /(nintendo|playstation) ([wids345portablevuch]+)/i, + // Nintendo/Playstation + /(xbox); +xbox ([^\);]+)/i, + // Microsoft Xbox (360, One, X, S, Series X, Series S) + // Other + /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, + // Joli/Palm + /(mint)[\/\(\) ]?(\w*)/i, + // Mint + /(mageia|vectorlinux)[; ]/i, + // Mageia/VectorLinux + /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, + // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire + /(hurd|linux) ?([\w\.]*)/i, + // Hurd/Linux + /(gnu) ?([\w\.]*)/i, + // GNU + /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, + // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly + /(haiku) (\w+)/i + // Haiku ], - [VERSION2, [NAME, "Blink"]], + [NAME, VERSION2], [ - /(presto)\/([\w\.]+)/i, - // Presto - /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, - // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna - /ekioh(flow)\/([\w\.]+)/i, - // Flow - /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, - // KHTML/Tasman/Links - /(icab)[\/ ]([23]\.[\d\.]+)/i, - // iCab - /\b(libweb)/i + /(sunos) ?([\w\.\d]*)/i + // Solaris ], - [NAME, VERSION2], + [[NAME, "Solaris"], VERSION2], [ - /rv\:([\w\.]{1,9})\b.+(gecko)/i - // Gecko + /((?:open)?solaris)[-\/ ]?([\w\.]*)/i, + // Solaris + /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, + // AIX + /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, + // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS + /(unix) ?([\w\.]*)/i + // UNIX ], - [VERSION2, NAME] + [NAME, VERSION2] + ] + }; + var UAParser2 = function(ua2, extensions) { + if (typeof ua2 === OBJ_TYPE) { + extensions = ua2; + ua2 = undefined$1; + } + if (!(this instanceof UAParser2)) { + return new UAParser2(ua2, extensions).getResult(); + } + var _navigator = typeof window2 !== UNDEF_TYPE && window2.navigator ? window2.navigator : undefined$1; + var _ua = ua2 || (_navigator && _navigator.userAgent ? _navigator.userAgent : EMPTY); + var _uach = _navigator && _navigator.userAgentData ? _navigator.userAgentData : undefined$1; + var _rgxmap = extensions ? extend2(regexes, extensions) : regexes; + var _isSelfNav = _navigator && _navigator.userAgent == _ua; + this.getBrowser = function() { + var _browser = {}; + _browser[NAME] = undefined$1; + _browser[VERSION2] = undefined$1; + rgxMapper.call(_browser, _ua, _rgxmap.browser); + _browser[MAJOR] = majorize(_browser[VERSION2]); + if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) { + _browser[NAME] = "Brave"; + } + return _browser; + }; + this.getCPU = function() { + var _cpu = {}; + _cpu[ARCHITECTURE] = undefined$1; + rgxMapper.call(_cpu, _ua, _rgxmap.cpu); + return _cpu; + }; + this.getDevice = function() { + var _device = {}; + _device[VENDOR] = undefined$1; + _device[MODEL] = undefined$1; + _device[TYPE] = undefined$1; + rgxMapper.call(_device, _ua, _rgxmap.device); + if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) { + _device[TYPE] = MOBILE; + } + if (_isSelfNav && _device[MODEL] == "Macintosh" && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) { + _device[MODEL] = "iPad"; + _device[TYPE] = TABLET; + } + return _device; + }; + this.getEngine = function() { + var _engine = {}; + _engine[NAME] = undefined$1; + _engine[VERSION2] = undefined$1; + rgxMapper.call(_engine, _ua, _rgxmap.engine); + return _engine; + }; + this.getOS = function() { + var _os = {}; + _os[NAME] = undefined$1; + _os[VERSION2] = undefined$1; + rgxMapper.call(_os, _ua, _rgxmap.os); + if (_isSelfNav && !_os[NAME] && _uach && _uach.platform && _uach.platform != "Unknown") { + _os[NAME] = _uach.platform.replace(/chrome os/i, CHROMIUM_OS).replace(/macos/i, MAC_OS); + } + return _os; + }; + this.getResult = function() { + return { + ua: this.getUA(), + browser: this.getBrowser(), + engine: this.getEngine(), + os: this.getOS(), + device: this.getDevice(), + cpu: this.getCPU() + }; + }; + this.getUA = function() { + return _ua; + }; + this.setUA = function(ua3) { + _ua = typeof ua3 === STR_TYPE && ua3.length > UA_MAX_LENGTH ? trim2(ua3, UA_MAX_LENGTH) : ua3; + return this; + }; + this.setUA(_ua); + return this; + }; + UAParser2.VERSION = LIBVERSION; + UAParser2.BROWSER = enumerize([NAME, VERSION2, MAJOR]); + UAParser2.CPU = enumerize([ARCHITECTURE]); + UAParser2.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]); + UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION2]); + { + if (module.exports) { + exports = module.exports = UAParser2; + } + exports.UAParser = UAParser2; + } + var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto); + if ($ && !$.ua) { + var parser = new UAParser2(); + $.ua = parser.getResult(); + $.ua.get = function() { + return parser.getUA(); + }; + $.ua.set = function(ua2) { + parser.setUA(ua2); + var result = parser.getResult(); + for (var prop in result) { + $.ua[prop] = result[prop]; + } + }; + } + })(typeof window === "object" ? window : commonjsGlobal); +})(uaParser, uaParser.exports); +var uaParserExports = uaParser.exports; +const UAParser = /* @__PURE__ */ getDefaultExportFromCjs$1(uaParserExports); +class InMemoryStorage { + static getInstance() { + if (!InMemoryStorage.instance) { + InMemoryStorage.instance = new InMemoryStorage(); + } + return InMemoryStorage.instance; + } + constructor() { + Object.defineProperty(this, "storage", { + enumerable: true, + configurable: true, + writable: true, + value: {} + }); + } + get length() { + return Object.keys(this.storage).length; + } + clear() { + this.storage = {}; + } + getItem(key2) { + return this.storage[key2] ?? null; + } + key(index2) { + const keys2 = Object.keys(this.storage); + if (index2 < 0 || index2 >= keys2.length) { + return null; + } + return keys2[index2] ?? null; + } + removeItem(key2) { + delete this.storage[key2]; + } + setItem(key2, value) { + this.storage[key2] = value; + } +} +function openLink$1(href, target = "_self") { + console.log(`open link self: ${href}`); + window.open(href, target, "noopener noreferrer"); +} +function openLinkBlank(href) { + console.log(`open link blank: ${href}`); + openLink$1(href, "_blank"); +} +function openDeeplinkWithFallback(href, fallback) { + const doFallback = () => { + if (isBrowser$1("safari") || isOS("android") && isBrowser$1("firefox")) { + return; + } + fallback(); + }; + const fallbackTimeout = setTimeout(() => doFallback(), 200); + window.addEventListener("blur", () => clearTimeout(fallbackTimeout), { once: true }); + openLink$1(href, "_self"); +} +function getWindow() { + if (typeof window !== "undefined") { + return window; + } + return void 0; +} +function tryGetLocalStorage() { + if (isLocalStorageAvailable()) { + return localStorage; + } + if (isNodeJs()) { + throw new Error("`localStorage` is unavailable, but it is required"); + } + return InMemoryStorage.getInstance(); +} +function isLocalStorageAvailable() { + try { + return typeof localStorage !== "undefined"; + } catch { + return false; + } +} +function isNodeJs() { + return typeof process !== "undefined" && process.versions != null && process.versions.node != null; +} +function getUserAgent$1() { + var _a3, _b2, _c2; + const results = new UAParser().getResult(); + const osName = (_a3 = results.os.name) == null ? void 0 : _a3.toLowerCase(); + const deviceModel = (_b2 = results.device.model) == null ? void 0 : _b2.toLowerCase(); + let os2; + switch (true) { + case deviceModel === "ipad": + os2 = "ipad"; + break; + case osName === "ios": + os2 = "ios"; + break; + case osName === "android": + os2 = "android"; + break; + case osName === "mac os": + os2 = "macos"; + break; + case osName === "linux": + os2 = "linux"; + break; + case (osName == null ? void 0 : osName.includes("windows")): + os2 = "windows"; + break; + } + const browserName = (_c2 = results.browser.name) == null ? void 0 : _c2.toLowerCase(); + let browser2; + switch (true) { + case browserName === "chrome": + browser2 = "chrome"; + break; + case browserName === "firefox": + browser2 = "firefox"; + break; + case (browserName == null ? void 0 : browserName.includes("safari")): + browser2 = "safari"; + break; + case (browserName == null ? void 0 : browserName.includes("opera")): + browser2 = "opera"; + break; + } + return { + os: os2, + browser: browser2 + }; +} +function isOS(...os2) { + return os2.includes(getUserAgent$1().os); +} +function isBrowser$1(...browser2) { + return browser2.includes(getUserAgent$1().browser); +} +let initParams = {}; +try { + let locationHash = location.hash.toString(); + initParams = urlParseHashParams(locationHash); +} catch (e18) { +} +let tmaPlatform = "unknown"; +if (initParams == null ? void 0 : initParams.tgWebAppPlatform) { + tmaPlatform = initParams.tgWebAppPlatform ?? "unknown"; +} +if (tmaPlatform === "unknown") { + const window2 = getWindow(); + tmaPlatform = ((_k = (_j = window2 == null ? void 0 : window2.Telegram) == null ? void 0 : _j.WebApp) == null ? void 0 : _k.platform) ?? "unknown"; +} +let webAppVersion = "6.0"; +if (initParams == null ? void 0 : initParams.tgWebAppVersion) { + webAppVersion = initParams.tgWebAppVersion; +} +if (!webAppVersion) { + const window2 = getWindow(); + webAppVersion = ((_m = (_l = window2 == null ? void 0 : window2.Telegram) == null ? void 0 : _l.WebApp) == null ? void 0 : _m.version) ?? "6.0"; +} +function isTmaPlatform(...platforms) { + return platforms.includes(tmaPlatform); +} +function isInTMA() { + var _a3; + return tmaPlatform !== "unknown" || !!((_a3 = getWindow()) == null ? void 0 : _a3.TelegramWebviewProxy); +} +function isInTelegramBrowser() { + var _a3; + const isTelegramWebview = !!((_a3 = getWindow()) == null ? void 0 : _a3.TelegramWebview); + return (isInTMA() || isTelegramWebview) && tmaPlatform === "unknown"; +} +function sendOpenTelegramLink(link, fallback) { + const url = new URL(link); + if (url.protocol !== "http:" && url.protocol !== "https:") { + if (fallback) { + return fallback(); + } + throw new Error(`Url protocol is not supported: ${url}`); + } + if (url.hostname !== "t.me") { + if (fallback) { + return fallback(); + } + throw new Error(`Url host is not supported: ${url}`); + } + const pathFull = url.pathname + url.search; + if (isIframe() || versionAtLeast("6.1")) { + postEvent("web_app_open_tg_link", { path_full: pathFull }); + } else { + openLinkBlank("https://t.me" + pathFull); + } +} +function isIframe() { + try { + const window2 = getWindow(); + if (!window2) { + return false; + } + return window2.parent != null && window2 !== window2.parent; + } catch (e18) { + return false; + } +} +function postEvent(eventType, eventData) { + try { + const window2 = getWindow(); + if (!window2) { + throw new Error(`Can't post event to parent window: window is not defined`); + } + if (window2.TelegramWebviewProxy !== void 0) { + window2.TelegramWebviewProxy.postEvent(eventType, JSON.stringify(eventData)); + } else if (window2.external && "notify" in window2.external) { + window2.external.notify(JSON.stringify({ eventType, eventData })); + } else if (isIframe()) { + const trustedTarget = "*"; + const message2 = JSON.stringify({ eventType, eventData }); + window2.parent.postMessage(message2, trustedTarget); + } else { + throw new Error(`Can't post event to TMA`); + } + } catch (e18) { + console.log(`Can't post event to parent window: ${e18}`); + } +} +function urlParseHashParams(locationHash) { + locationHash = locationHash.replace(/^#/, ""); + let params = {}; + if (!locationHash.length) { + return params; + } + if (locationHash.indexOf("=") < 0 && locationHash.indexOf("?") < 0) { + params._path = urlSafeDecode(locationHash); + return params; + } + let qIndex = locationHash.indexOf("?"); + if (qIndex >= 0) { + let pathParam = locationHash.substr(0, qIndex); + params._path = urlSafeDecode(pathParam); + locationHash = locationHash.substr(qIndex + 1); + } + let query_params = urlParseQueryString(locationHash); + for (let k2 in query_params) { + params[k2] = query_params[k2]; + } + return params; +} +function urlSafeDecode(urlencoded) { + try { + urlencoded = urlencoded.replace(/\+/g, "%20"); + return decodeURIComponent(urlencoded); + } catch (e18) { + return urlencoded; + } +} +function urlParseQueryString(queryString2) { + let params = {}; + if (!queryString2.length) { + return params; + } + let queryStringParams = queryString2.split("&"); + let i2, param, paramName, paramValue; + for (i2 = 0; i2 < queryStringParams.length; i2++) { + param = queryStringParams[i2].split("="); + paramName = urlSafeDecode(param[0]); + paramValue = param[1] == null ? null : urlSafeDecode(param[1]); + params[paramName] = paramValue; + } + return params; +} +function versionCompare(v12, v22) { + if (typeof v12 !== "string") + v12 = ""; + if (typeof v22 !== "string") + v22 = ""; + let v1List = v12.replace(/^\s+|\s+$/g, "").split("."); + let v2List = v22.replace(/^\s+|\s+$/g, "").split("."); + let a3, i2, p1, p22; + a3 = Math.max(v1List.length, v2List.length); + for (i2 = 0; i2 < a3; i2++) { + p1 = parseInt(v1List[i2]) || 0; + p22 = parseInt(v2List[i2]) || 0; + if (p1 === p22) + continue; + if (p1 > p22) + return 1; + return -1; + } + return 0; +} +function versionAtLeast(ver) { + return versionCompare(webAppVersion, ver) >= 0; +} +function isTelegramUrl(link) { + if (!link) { + return false; + } + const url = new URL(link); + return url.protocol === "tg:" || url.hostname === "t.me"; +} +function encodeTelegramUrlParameters(parameters) { + return parameters.replaceAll(".", "%2E").replaceAll("-", "%2D").replaceAll("_", "%5F").replaceAll("&", "-").replaceAll("=", "__").replaceAll("%", "--"); +} +function addReturnStrategy(url, strategy) { + let returnStrategy; + if (typeof strategy === "string") { + returnStrategy = strategy; + } else { + returnStrategy = isInTMA() ? strategy.twaReturnUrl || strategy.returnStrategy : "stay"; + } + const newUrl = addQueryParameter(url, "ret", returnStrategy); + if (!isTelegramUrl(url)) { + return newUrl; + } + const lastParam = newUrl.slice(newUrl.lastIndexOf("&") + 1); + return newUrl.slice(0, newUrl.lastIndexOf("&")) + "-" + encodeTelegramUrlParameters(lastParam); +} +function redirectToTelegram(universalLink, startapp, options) { + options = { ...options }; + const directLinkUrl = new URL(universalLink); + if (!directLinkUrl.searchParams.has("startapp")) { + directLinkUrl.searchParams.append("startapp", startapp); + } + if (isInTelegramBrowser()) { + openLink$1(directLinkUrl.toString()); + } else if (isInTMA()) { + if (isTmaPlatform("ios", "macos", "tdesktop", "web")) { + options.returnStrategy = "back"; + const linkWitStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); + sendOpenTelegramLink(linkWitStrategy); + } else if (isTmaPlatform("weba")) { + sendOpenTelegramLink(addReturnStrategy(directLinkUrl.toString(), options)); + } else { + openLinkBlank(addReturnStrategy(directLinkUrl.toString(), options)); + } + } else { + if (isOS("ios")) { + if (options.returnStrategy === "back") { + if (isBrowser$1("safari")) { + options.returnStrategy = "back"; + } else if (isBrowser$1("chrome")) { + options.returnStrategy = "googlechrome://"; + } else if (isBrowser$1("firefox")) { + options.returnStrategy = "firefox://"; + } else if (isBrowser$1("opera")) { + options.returnStrategy = "opera-http://"; + } else { + options.returnStrategy = location.href; + } + } + const isChrome = isBrowser$1("chrome"); + const isFirefox = isBrowser$1("firefox"); + const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect; + if (useDeepLink) { + const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); + const deepLink = convertToTGDeepLink(linkWithStrategy); + openDeeplinkWithFallback(deepLink, () => openLink$1(linkWithStrategy)); + } else { + const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); + openLink$1(linkWithStrategy); + } + } else if (isOS("android")) { + options.returnStrategy = "back"; + const isChrome = isBrowser$1("chrome"); + const isFirefox = isBrowser$1("firefox"); + const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect; + if (useDeepLink) { + const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); + const deepLink = convertToTGDeepLink(linkWithStrategy); + openDeeplinkWithFallback(deepLink, () => openLinkBlank(linkWithStrategy)); + } else { + const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); + openLinkBlank(linkWithStrategy); + } + } else if (isOS("ipad")) { + if (options.returnStrategy === "back") { + if (isBrowser$1("safari")) { + options.returnStrategy = "back"; + } else if (isBrowser$1("chrome")) { + options.returnStrategy = "googlechrome://"; + } else if (isBrowser$1("firefox")) { + options.returnStrategy = "firefox://"; + } else if (isBrowser$1("opera")) { + options.returnStrategy = "opera-http://"; + } else { + options.returnStrategy = location.href; + } + } + const isChrome = isBrowser$1("chrome"); + const isFirefox = isBrowser$1("firefox"); + const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect; + const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); + if (useDeepLink) { + const deepLink = convertToTGDeepLink(linkWithStrategy); + openDeeplinkWithFallback(deepLink, () => openLinkBlank(linkWithStrategy)); + } else { + openLinkBlank(linkWithStrategy); + } + } else if (isOS("macos", "windows", "linux")) { + options.returnStrategy = "back"; + options.twaReturnUrl = void 0; + const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); + if (options.forceRedirect) { + openLinkBlank(linkWithStrategy); + } else { + const deepLink = convertToTGDeepLink(linkWithStrategy); + openDeeplinkWithFallback(deepLink, () => openLinkBlank(linkWithStrategy)); + } + } else { + openLinkBlank(addReturnStrategy(directLinkUrl.toString(), options)); + } + } +} +function addQueryParameter(url, key2, value) { + const parsed = new URL(url); + parsed.searchParams.append(key2, value); + return parsed.toString(); +} +function convertToTGDeepLink(directLink) { + const parsed = new URL(directLink); + const [, domain, appname] = parsed.pathname.split("/"); + const startapp = parsed.searchParams.get("startapp"); + return `tg://resolve?domain=${domain}&appname=${appname}&startapp=${startapp}`; +} +const PROD_TG_MINI_WALLET_URL = "https://t.me/codexfieldbot/wallet?mode=compact"; +const TEST_TG_MINI_WALLET_URL = "https://t.me/codexfield_test_bot/wallet?mode=compact"; +const LOCAL_DEBUG_KEY = "_cfw_debug"; +const LOCAL_RETURN_URL_KEY = "_cfw_return_url"; +const MEM_WALLET_OPEN_OPTION = "mem_cfw_wallet_open_option"; +const ACTION_WC_PAIR = "wc_pair"; +const ACTION_WC_MSG = "wc_msg"; +function base64urlEncode(content) { + return btoa(content).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); +} +function setToStorage(key2, value) { + tryGetLocalStorage().setItem(key2, value ?? ""); +} +function getFromStorage(key2) { + return tryGetLocalStorage().getItem(key2); +} +function genStartappParams(action, data, returnUrl) { + const params = { + action, + data, + returnUrl, + openOption: getWalletOpenOption() + }; + return base64urlEncode(JSON.stringify(params)); +} +function openTgMiniWalletForConnect(wcUrl, returnUrl, debug) { + setToStorage(LOCAL_RETURN_URL_KEY, returnUrl); + setToStorage(LOCAL_DEBUG_KEY, debug ? "true" : "false"); + const universalLink = debug ? TEST_TG_MINI_WALLET_URL : PROD_TG_MINI_WALLET_URL; + const startParams = genStartappParams(ACTION_WC_PAIR, wcUrl, returnUrl); + redirectToTelegram(universalLink, startParams, { + returnStrategy: "back", + twaReturnUrl: returnUrl, + forceRedirect: false + }); +} +function openTgMiniWalletForMsg(method, returnUrl, debug) { + const openOption = getWalletOpenOption(); + if (openOption === "stay" || openOption === "connect_and_sign" && method === "personal_sign") { + console.log(`no need open wallet for openOption: ${openOption}`); + return; + } + let _returnUrl; + if (returnUrl === void 0 || returnUrl.length === 0) { + _returnUrl = getFromStorage(LOCAL_RETURN_URL_KEY) ?? void 0; + } else { + _returnUrl = returnUrl; + } + let _debug; + if (debug === void 0) { + _debug = getFromStorage(LOCAL_DEBUG_KEY) === "true"; + } else { + _debug = debug; + } + const universalLink = _debug ? TEST_TG_MINI_WALLET_URL : PROD_TG_MINI_WALLET_URL; + const startParams = genStartappParams(ACTION_WC_MSG, (/* @__PURE__ */ new Date()).getTime().toString(), _returnUrl); + redirectToTelegram(universalLink, startParams, { + returnStrategy: "back", + twaReturnUrl: _returnUrl, + forceRedirect: false + }); +} +function getWalletOpenOption() { + const option = InMemoryStorage.getInstance().getItem(MEM_WALLET_OPEN_OPTION); + if (option === void 0 || option === null || option.length === 0) + return "auto"; + return option; +} +const REQUIRED_METHODS = ["eth_sendTransaction", "personal_sign"]; +const OPTIONAL_METHODS = [ + "eth_accounts", + "eth_requestAccounts", + "eth_sendRawTransaction", + "eth_sign", + "eth_signTransaction", + "eth_signTypedData", + "eth_signTypedData_v3", + "eth_signTypedData_v4", + "eth_sendTransaction", + "personal_sign", + "wallet_switchEthereumChain", + "wallet_addEthereumChain", + "wallet_getPermissions", + "wallet_requestPermissions", + "wallet_registerOnboarding", + "wallet_watchAsset", + "wallet_scanQRCode", + "wallet_sendCalls", + "wallet_getCapabilities", + "wallet_getCallsStatus", + "wallet_showCallsStatus" +]; +const LAUNCH_WALLET_METHODS = [ + "eth_sendRawTransaction", + "eth_sign", + "eth_signTransaction", + "eth_signTypedData", + "eth_signTypedData_v3", + "eth_signTypedData_v4", + "eth_sendTransaction", + "personal_sign" +]; +const REQUIRED_EVENTS = ["chainChanged", "accountsChanged"]; +const OPTIONAL_EVENTS = [ + "chainChanged", + "accountsChanged", + "message", + "disconnect", + "connect" +]; +const PROTOCOL = "wc"; +const WC_VERSION = 2; +const CONTEXT = "ethereum_provider"; +const STORAGE_KEY = `${PROTOCOL}@${WC_VERSION}:${CONTEXT}:`; +const RPC_URL = "https://rpc.walletconnect.com/v1/"; +function getEthereumChainId(chains) { + var _a3; + return Number((_a3 = chains[0]) == null ? void 0 : _a3.split(":")[1]); +} +function toHexChainId(chainId) { + return `0x${chainId.toString(16)}`; +} +function buildNamespaces(params) { + const { chains, optionalChains, methods, optionalMethods, events: events2, optionalEvents, rpcMap } = params; + if (!Er$2(chains)) { + throw new Error("Invalid chains"); + } + const required = { + chains, + methods: methods || REQUIRED_METHODS, + events: events2 || REQUIRED_EVENTS, + // @ts-ignore + rpcMap: { + ...chains.length ? { [getEthereumChainId(chains)]: rpcMap[getEthereumChainId(chains)] } : {} + } + }; + const eventsRequiringPermissions = events2 == null ? void 0 : events2.filter((event) => !REQUIRED_EVENTS.includes(event)); + const methodsRequiringPermissions = methods == null ? void 0 : methods.filter((event) => !REQUIRED_METHODS.includes(event)); + if (!optionalChains && !optionalEvents && !optionalMethods && !(eventsRequiringPermissions == null ? void 0 : eventsRequiringPermissions.length) && !(methodsRequiringPermissions == null ? void 0 : methodsRequiringPermissions.length)) { + return { required: chains.length ? required : void 0 }; + } + const shouldIncludeRequiredChains = (eventsRequiringPermissions == null ? void 0 : eventsRequiringPermissions.length) && (methodsRequiringPermissions == null ? void 0 : methodsRequiringPermissions.length) || !optionalChains; + const optional2 = { + chains: [ + ...new Set(shouldIncludeRequiredChains ? required.chains.concat(optionalChains || []) : optionalChains) + ], + methods: [ + ...new Set(required.methods.concat((optionalMethods == null ? void 0 : optionalMethods.length) ? optionalMethods : OPTIONAL_METHODS)) + ], + events: [ + ...new Set(required.events.concat((optionalEvents == null ? void 0 : optionalEvents.length) ? optionalEvents : OPTIONAL_EVENTS)) + ], + rpcMap + }; + return { + required: chains.length ? required : void 0, + optional: optionalChains.length ? optional2 : void 0 + }; +} +class EthereumProvider { + constructor() { + Object.defineProperty(this, "events", { + enumerable: true, + configurable: true, + writable: true, + value: new eventsExports.EventEmitter() + }); + Object.defineProperty(this, "namespace", { + enumerable: true, + configurable: true, + writable: true, + value: "eip155" + }); + Object.defineProperty(this, "accounts", { + enumerable: true, + configurable: true, + writable: true, + value: [] + }); + Object.defineProperty(this, "signer", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "chainId", { + enumerable: true, + configurable: true, + writable: true, + value: 1 + }); + Object.defineProperty(this, "modal", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "rpc", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "on", { + enumerable: true, + configurable: true, + writable: true, + value: (event, listener) => { + this.events.on(event, listener); + return this; + } + }); + Object.defineProperty(this, "once", { + enumerable: true, + configurable: true, + writable: true, + value: (event, listener) => { + this.events.once(event, listener); + return this; + } + }); + Object.defineProperty(this, "removeListener", { + enumerable: true, + configurable: true, + writable: true, + value: (event, listener) => { + this.events.removeListener(event, listener); + return this; + } + }); + Object.defineProperty(this, "off", { + enumerable: true, + configurable: true, + writable: true, + value: (event, listener) => { + this.events.off(event, listener); + return this; + } + }); + Object.defineProperty(this, "parseAccount", { + enumerable: true, + configurable: true, + writable: true, + value: (payload) => { + return this.isCompatibleChainId(payload) ? this.parseAccountId(payload).address : payload; + } + }); + this.signer = {}; + this.rpc = {}; + } + static async init(opts) { + const provider = new EthereumProvider(); + await provider.initialize(opts); + return provider; + } + async request(args, expiry) { + console.log(`request method ${args.method}`); + if (LAUNCH_WALLET_METHODS.includes(args.method)) { + openTgMiniWalletForMsg(args.method); + } + return await this.signer.request(args, this.formatChainId(this.chainId), expiry); + } + sendAsync(args, callback, expiry) { + this.signer.sendAsync(args, callback, this.formatChainId(this.chainId), expiry); + } + get connected() { + if (!this.signer.client) + return false; + return this.signer.client.core.relayer.connected; + } + get connecting() { + if (!this.signer.client) + return false; + return this.signer.client.core.relayer.connecting; + } + async enable() { + if (!this.session) + await this.connect(); + const accounts2 = await this.request({ method: "eth_requestAccounts" }); + return accounts2; + } + async connect(opts) { + if (!this.signer.client) { + throw new Error("Provider not initialized. Call init() first"); + } + this.loadConnectOpts(opts); + const { required, optional: optional2 } = buildNamespaces(this.rpc); + try { + const session = await new Promise(async (resolve, reject) => { + var _a3; + if (this.rpc.showQrModal) { + (_a3 = this.modal) == null ? void 0 : _a3.subscribeModal((state) => { + if (!state.open && !this.signer.session) { + this.signer.abortPairingAttempt(); + reject(new Error("Connection request reset. Please try again.")); + } + }); + } + await this.signer.connect({ + namespaces: { + ...required && { + [this.namespace]: required + } + }, + ...optional2 && { + optionalNamespaces: { + [this.namespace]: optional2 + } + }, + pairingTopic: opts == null ? void 0 : opts.pairingTopic + }).then((session2) => { + resolve(session2); + }).catch((error) => { + reject(new Error(error.message)); + }); + }); + if (!session) + return; + const accounts2 = zo(session.namespaces, [this.namespace]); + this.setChainIds(this.rpc.chains.length ? this.rpc.chains : accounts2); + this.setAccounts(accounts2); + this.events.emit("connect", { chainId: toHexChainId(this.chainId) }); + } catch (error) { + this.signer.logger.error(error); + throw error; + } finally { + if (this.modal) + this.modal.closeModal(); + } + } + async authenticate(params) { + if (!this.signer.client) { + throw new Error("Provider not initialized. Call init() first"); + } + this.loadConnectOpts({ + chains: params == null ? void 0 : params.chains + }); + try { + const result = await new Promise(async (resolve, reject) => { + var _a3; + if (this.rpc.showQrModal) { + (_a3 = this.modal) == null ? void 0 : _a3.subscribeModal((state) => { + if (!state.open && !this.signer.session) { + this.signer.abortPairingAttempt(); + reject(new Error("Connection request reset. Please try again.")); + } + }); + } + await this.signer.authenticate({ + ...params, + chains: this.rpc.chains + }).then((result2) => { + resolve(result2); + }).catch((error) => { + reject(new Error(error.message)); + }); + }); + const session = result.session; + if (session) { + const accounts2 = zo(session.namespaces, [this.namespace]); + this.setChainIds(this.rpc.chains.length ? this.rpc.chains : accounts2); + this.setAccounts(accounts2); + this.events.emit("connect", { chainId: toHexChainId(this.chainId) }); + } + return result; + } catch (error) { + this.signer.logger.error(error); + throw error; + } finally { + if (this.modal) + this.modal.closeModal(); + } + } + async disconnect() { + if (this.session) { + await this.signer.disconnect(); + } + this.reset(); + } + get isWalletConnect() { + return true; + } + get session() { + return this.signer.session; + } + // ---------- Protected --------------------------------------------- // + registerEventListeners() { + this.signer.on("session_event", (payload) => { + const { params } = payload; + const { event } = params; + if (event.name === "accountsChanged") { + this.accounts = this.parseAccounts(event.data); + this.events.emit("accountsChanged", this.accounts); + } else if (event.name === "chainChanged") { + this.setChainId(this.formatChainId(event.data)); + } else { + this.events.emit(event.name, event.data); + } + this.events.emit("session_event", payload); + }); + this.signer.on("chainChanged", (chainId) => { + const chain = parseInt(chainId); + this.chainId = chain; + this.events.emit("chainChanged", toHexChainId(this.chainId)); + this.persist(); + }); + this.signer.on("session_update", (payload) => { + this.events.emit("session_update", payload); + }); + this.signer.on("session_delete", (payload) => { + this.reset(); + this.events.emit("session_delete", payload); + this.events.emit("disconnect", { + ...tr$2("USER_DISCONNECTED"), + data: payload.topic, + name: "USER_DISCONNECTED" + }); + }); + this.signer.on("display_uri", (uri) => { + openTgMiniWalletForConnect(uri, this.rpc.returnUrl, this.rpc.debug); + }); + } + switchEthereumChain(chainId) { + this.request({ + method: "wallet_switchEthereumChain", + params: [{ chainId: chainId.toString(16) }] + }); + } + isCompatibleChainId(chainId) { + return typeof chainId === "string" ? chainId.startsWith(`${this.namespace}:`) : false; + } + formatChainId(chainId) { + return `${this.namespace}:${chainId}`; + } + parseChainId(chainId) { + return Number(chainId.split(":")[1]); + } + setChainIds(chains) { + const compatible = chains.filter((x3) => this.isCompatibleChainId(x3)); + const chainIds = compatible.map((c2) => this.parseChainId(c2)); + if (chainIds.length) { + this.chainId = chainIds[0] ?? 1; + this.events.emit("chainChanged", toHexChainId(this.chainId)); + this.persist(); + } + } + setChainId(chain) { + if (this.isCompatibleChainId(chain)) { + const chainId = this.parseChainId(chain); + this.chainId = chainId; + this.switchEthereumChain(chainId); + } + } + parseAccountId(account) { + const [namespace, reference, address2] = account.split(":"); + const chainId = `${namespace}:${reference}`; + return { chainId, address: address2 ?? "" }; + } + setAccounts(accounts2) { + this.accounts = accounts2.filter((x3) => this.parseChainId(this.parseAccountId(x3).chainId) === this.chainId).map((x3) => this.parseAccountId(x3).address); + this.events.emit("accountsChanged", this.accounts); + } + getRpcConfig(opts) { + const requiredChains = (opts == null ? void 0 : opts.chains) ?? []; + const optionalChains = (opts == null ? void 0 : opts.optionalChains) ?? []; + const allChains = requiredChains.concat(optionalChains); + if (!allChains.length) + throw new Error("No chains specified in either `chains` or `optionalChains`"); + const requiredMethods = requiredChains.length ? (opts == null ? void 0 : opts.methods) || REQUIRED_METHODS : []; + const requiredEvents = requiredChains.length ? (opts == null ? void 0 : opts.events) || REQUIRED_EVENTS : []; + const optionalMethods = (opts == null ? void 0 : opts.optionalMethods) || []; + const optionalEvents = (opts == null ? void 0 : opts.optionalEvents) || []; + const rpcMap = (opts == null ? void 0 : opts.rpcMap) || this.buildRpcMap(allChains, opts.projectId); + const qrModalOptions = (opts == null ? void 0 : opts.qrModalOptions) || void 0; + return { + chains: requiredChains == null ? void 0 : requiredChains.map((chain) => this.formatChainId(chain)), + optionalChains: optionalChains.map((chain) => this.formatChainId(chain)), + methods: requiredMethods, + events: requiredEvents, + optionalMethods, + optionalEvents, + rpcMap, + showQrModal: Boolean(opts == null ? void 0 : opts.showQrModal), + qrModalOptions, + projectId: opts.projectId, + metadata: opts.metadata, + returnUrl: opts.returnUrl, + debug: opts.debug + }; + } + buildRpcMap(chains, projectId) { + const map = {}; + chains.forEach((chain) => { + map[chain] = this.getRpcUrl(chain, projectId); + }); + return map; + } + async initialize(opts) { + this.rpc = this.getRpcConfig(opts); + this.chainId = this.rpc.chains.length ? getEthereumChainId(this.rpc.chains) : getEthereumChainId(this.rpc.optionalChains); + this.signer = await Ev.init({ + projectId: this.rpc.projectId, + metadata: this.rpc.metadata, + disableProviderPing: opts.disableProviderPing, + relayUrl: opts.relayUrl, + storageOptions: opts.storageOptions + }); + this.registerEventListeners(); + await this.loadPersistedSession(); + } + loadConnectOpts(opts) { + if (!opts) + return; + const { chains, optionalChains, rpcMap } = opts; + if (chains && Er$2(chains)) { + this.rpc.chains = chains.map((chain) => this.formatChainId(chain)); + chains.forEach((chain) => { + this.rpc.rpcMap[chain] = (rpcMap == null ? void 0 : rpcMap[chain]) || this.getRpcUrl(chain); + }); + } + if (optionalChains && Er$2(optionalChains)) { + this.rpc.optionalChains = []; + this.rpc.optionalChains = optionalChains == null ? void 0 : optionalChains.map((chain) => this.formatChainId(chain)); + optionalChains.forEach((chain) => { + this.rpc.rpcMap[chain] = (rpcMap == null ? void 0 : rpcMap[chain]) || this.getRpcUrl(chain); + }); + } + } + getRpcUrl(chainId, projectId) { + var _a3; + const providedRpc = (_a3 = this.rpc.rpcMap) == null ? void 0 : _a3[chainId]; + return providedRpc || `${RPC_URL}?chainId=eip155:${chainId}&projectId=${projectId || this.rpc.projectId}`; + } + async loadPersistedSession() { + if (!this.session) + return; + try { + const chainId = await this.signer.client.core.storage.getItem(`${STORAGE_KEY}/chainId`); + const namespace = this.session.namespaces[`${this.namespace}:${chainId}`] ? this.session.namespaces[`${this.namespace}:${chainId}`] : this.session.namespaces[this.namespace]; + this.setChainIds(chainId ? [this.formatChainId(chainId)] : namespace == null ? void 0 : namespace.accounts); + this.setAccounts(namespace == null ? void 0 : namespace.accounts); + } catch (error) { + this.signer.logger.error("Failed to load persisted session, clearing state..."); + this.signer.logger.error(error); + await this.disconnect().catch((error2) => this.signer.logger.warn(error2)); + } + } + reset() { + this.chainId = 1; + this.accounts = []; + } + persist() { + if (!this.session) + return; + this.signer.client.core.storage.setItem(`${STORAGE_KEY}/chainId`, this.chainId); + } + parseAccounts(payload) { + if (typeof payload === "string" || payload instanceof String) { + return [this.parseAccount(payload)]; + } + return payload.map((account) => this.parseAccount(account)); + } +} +const EthereumProvider$1 = EthereumProvider; +codexFieldWallet$1.type = "codexFieldWallet"; +function codexFieldWallet$1(parameters) { + const isNewChainsStale = parameters.isNewChainsStale ?? true; + let provider_; + let providerPromise; + const NAMESPACE = "eip155"; + let accountsChanged; + let chainChanged; + let connect2; + let displayUri; + let sessionDelete; + let disconnect2; + return createConnector((config2) => ({ + id: "codex-field-wallet", + name: "CodexFieldWallet", + type: codexFieldWallet$1.type, + async setup() { + const provider = await this.getProvider().catch(() => null); + if (!provider) + return; + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider.on("connect", connect2); + } + if (!sessionDelete) { + sessionDelete = this.onSessionDelete.bind(this); + provider.on("session_delete", sessionDelete); + } + }, + async connect({ chainId, ...rest } = {}) { + var _a3, _b2; + try { + const provider = await this.getProvider(); + if (!provider) + throw new ProviderNotFoundError(); + if (!displayUri) { + displayUri = this.onDisplayUri; + provider.on("display_uri", displayUri); + } + let targetChainId = chainId; + if (!targetChainId) { + const state = await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem("state")) ?? {}; + const isChainSupported = config2.chains.some((x3) => x3.id === state.chainId); + if (isChainSupported) + targetChainId = state.chainId; + else + targetChainId = (_b2 = config2.chains[0]) == null ? void 0 : _b2.id; + } + if (!targetChainId) + throw new Error("No chains found on connector."); + const isChainsStale = await this.isChainsStale(); + if (provider.session && isChainsStale) + await provider.disconnect(); + if (!provider.session || isChainsStale) { + const optionalChains = config2.chains.filter((chain) => chain.id !== targetChainId).map((optionalChain) => optionalChain.id); + await provider.connect({ + optionalChains: [targetChainId, ...optionalChains], + ..."pairingTopic" in rest ? { pairingTopic: rest.pairingTopic } : {} + }); + this.setRequestedChainsIds(config2.chains.map((x3) => x3.id)); + } + const accounts2 = (await provider.enable()).map((x3) => getAddress$2(x3)); + const currentChainId = await this.getChainId(); + if (displayUri) { + provider.removeListener("display_uri", displayUri); + displayUri = void 0; + } + if (connect2) { + provider.removeListener("connect", connect2); + connect2 = void 0; + } + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider.on("accountsChanged", accountsChanged); + } + if (!chainChanged) { + chainChanged = this.onChainChanged.bind(this); + provider.on("chainChanged", chainChanged); + } + if (!disconnect2) { + disconnect2 = this.onDisconnect.bind(this); + provider.on("disconnect", disconnect2); + } + if (!sessionDelete) { + sessionDelete = this.onSessionDelete.bind(this); + provider.on("session_delete", sessionDelete); + } + return { accounts: accounts2, chainId: currentChainId }; + } catch (error) { + if (/(user rejected|connection request reset)/i.test(error == null ? void 0 : error.message)) { + throw new UserRejectedRequestError(error); + } + throw error; + } + }, + async disconnect() { + const provider = await this.getProvider(); + try { + await (provider == null ? void 0 : provider.disconnect()); + } catch (error) { + if (!/No matching key/i.test(error.message)) + throw error; + } finally { + if (chainChanged) { + provider == null ? void 0 : provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider == null ? void 0 : provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; + } + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider == null ? void 0 : provider.on("connect", connect2); + } + if (accountsChanged) { + provider == null ? void 0 : provider.removeListener("accountsChanged", accountsChanged); + accountsChanged = void 0; + } + if (sessionDelete) { + provider == null ? void 0 : provider.removeListener("session_delete", sessionDelete); + sessionDelete = void 0; + } + this.setRequestedChainsIds([]); + } + }, + async getAccounts() { + const provider = await this.getProvider(); + return provider.accounts.map((x3) => getAddress$2(x3)); + }, + async getProvider({ chainId } = {}) { + var _a3; + async function initProvider() { + const optionalChains = config2.chains.map((x3) => x3.id); + if (!optionalChains.length) + return; + return await EthereumProvider$1.init({ + ...parameters, + disableProviderPing: true, + optionalChains, + projectId: parameters.projectId, + rpcMap: Object.fromEntries(config2.chains.map((chain) => { + const [url] = extractRpcUrls({ + chain, + transports: config2.transports + }); + return [chain.id, url]; + })), + showQrModal: parameters.showQrModal ?? true, + returnUrl: parameters.returnUrl, + debug: parameters.debug + }); + } + if (!provider_) { + if (!providerPromise) + providerPromise = initProvider(); + provider_ = await providerPromise; + provider_ == null ? void 0 : provider_.events.setMaxListeners(Number.POSITIVE_INFINITY); + } + if (chainId) + await ((_a3 = this.switchChain) == null ? void 0 : _a3.call(this, { chainId })); + return provider_; + }, + async getChainId() { + const provider = await this.getProvider(); + return provider.chainId; + }, + async isAuthorized() { + try { + const [accounts2, provider] = await Promise.all([ + this.getAccounts(), + this.getProvider() + ]); + if (!accounts2.length) + return false; + const isChainsStale = await this.isChainsStale(); + if (isChainsStale && provider.session) { + await provider.disconnect().catch(() => { + }); + return false; + } + return true; + } catch { + return false; + } + }, + async switchChain({ addEthereumChainParameter, chainId }) { + var _a3, _b2, _c2; + const provider = await this.getProvider(); + if (!provider) + throw new ProviderNotFoundError(); + const chain = config2.chains.find((x3) => x3.id === chainId); + if (!chain) + throw new SwitchChainError(new ChainNotConfiguredError()); + try { + await Promise.all([ + new Promise((resolve) => { + const listener = ({ chainId: currentChainId }) => { + if (currentChainId === chainId) { + config2.emitter.off("change", listener); + resolve(); + } + }; + config2.emitter.on("change", listener); + }), + provider.request({ + method: "wallet_switchEthereumChain", + params: [{ chainId: numberToHex(chainId) }] + }) + ]); + const requestedChains = await this.getRequestedChainsIds(); + this.setRequestedChainsIds([...requestedChains, chainId]); + return chain; + } catch (err) { + const error = err; + if (/(user rejected)/i.test(error.message)) + throw new UserRejectedRequestError(error); + try { + let blockExplorerUrls; + if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) + blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; + else + blockExplorerUrls = ((_a3 = chain.blockExplorers) == null ? void 0 : _a3.default.url) ? [(_b2 = chain.blockExplorers) == null ? void 0 : _b2.default.url] : []; + let rpcUrls; + if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) + rpcUrls = addEthereumChainParameter.rpcUrls; + else + rpcUrls = [...chain.rpcUrls.default.http]; + const addEthereumChain = { + blockExplorerUrls, + chainId: numberToHex(chainId), + chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, + iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, + nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, + rpcUrls + }; + await provider.request({ + method: "wallet_addEthereumChain", + params: [addEthereumChain] + }); + const requestedChains = await this.getRequestedChainsIds(); + this.setRequestedChainsIds([...requestedChains, chainId]); + return chain; + } catch (error2) { + throw new UserRejectedRequestError(error2); + } + } + }, + onAccountsChanged(accounts2) { + if (accounts2.length === 0) + this.onDisconnect(); + else + config2.emitter.emit("change", { + accounts: accounts2.map((x3) => getAddress$2(x3)) + }); + }, + onChainChanged(chain) { + const chainId = Number(chain); + config2.emitter.emit("change", { chainId }); + }, + async onConnect(connectInfo) { + const chainId = Number(connectInfo.chainId); + const accounts2 = await this.getAccounts(); + config2.emitter.emit("connect", { accounts: accounts2, chainId }); + }, + async onDisconnect(_error) { + this.setRequestedChainsIds([]); + config2.emitter.emit("disconnect"); + const provider = await this.getProvider(); + if (accountsChanged) { + provider.removeListener("accountsChanged", accountsChanged); + accountsChanged = void 0; + } + if (chainChanged) { + provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; + } + if (sessionDelete) { + provider.removeListener("session_delete", sessionDelete); + sessionDelete = void 0; + } + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider.on("connect", connect2); + } + }, + onDisplayUri(uri) { + }, + onSessionDelete() { + this.onDisconnect(); + }, + getNamespaceChainsIds() { + var _a3, _b2, _c2; + if (!provider_) + return []; + const chainIds = (_c2 = (_b2 = (_a3 = provider_.session) == null ? void 0 : _a3.namespaces[NAMESPACE]) == null ? void 0 : _b2.accounts) == null ? void 0 : _c2.map((account) => Number.parseInt(account.split(":")[1] || "")); + return chainIds ?? []; + }, + async getRequestedChainsIds() { + var _a3; + return await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem(this.requestedChainsStorageKey)) ?? []; + }, + /** + * Checks if the target chains match the chains that were + * initially requested by the connector for the WalletConnect session. + * If there is a mismatch, this means that the chains on the connector + * are considered stale, and need to be revalidated at a later point (via + * connection). + * + * There may be a scenario where a dapp adds a chain to the + * connector later on, however, this chain will not have been approved or rejected + * by the wallet. In this case, the chain is considered stale. + */ + async isChainsStale() { + if (!isNewChainsStale) + return false; + const connectorChains = config2.chains.map((x3) => x3.id); + const namespaceChains = this.getNamespaceChainsIds(); + if (namespaceChains.length && !namespaceChains.some((id2) => connectorChains.includes(id2))) + return false; + const requestedChains = await this.getRequestedChainsIds(); + return !connectorChains.every((id2) => requestedChains.includes(id2)); + }, + async setRequestedChainsIds(chains) { + var _a3; + await ((_a3 = config2.storage) == null ? void 0 : _a3.setItem(this.requestedChainsStorageKey, chains)); + }, + get requestedChainsStorageKey() { + return `${this.id}.requestedChains`; + } + })); +} +function getEvmInjectedProvider(flag) { + if (typeof window === "undefined" || typeof window.ethereum === "undefined") + return; + const providers2 = window.ethereum.providers; + return providers2 ? providers2.find((provider) => provider[flag]) : window.ethereum[flag] ? window.ethereum : void 0; +} +function hasEvmInjectedProvider(flag) { + return Boolean(getEvmInjectedProvider(flag)); +} +function getRecentConnectorId() { + if (typeof window === "undefined") + return; + const recentConnectorId = window.localStorage.getItem("wagmi.recentConnectorId"); + if (recentConnectorId) + return JSON.parse(recentConnectorId); +} +injected.type = "injected"; +function injected(parameters = {}) { + const { shimDisconnect = true, unstable_shimAsyncInject } = parameters; + function getTarget() { + const target = parameters.target; + if (typeof target === "function") { + const result = target(); + if (result) + return result; + } + if (typeof target === "object") + return target; + if (typeof target === "string") + return { + ...targetMap[target] ?? { + id: target, + name: `${target[0].toUpperCase()}${target.slice(1)}`, + provider: `is${target[0].toUpperCase()}${target.slice(1)}` + } + }; + return { + id: "injected", + name: "Injected", + async provider(window2) { + return window2 == null ? void 0 : window2.ethereum; + } + }; + } + let accountsChanged; + let chainChanged; + let connect2; + let disconnect2; + return createConnector((config2) => ({ + get icon() { + return getTarget().icon; + }, + get id() { + return getTarget().id; + }, + get name() { + return getTarget().name; + }, + /** @deprecated */ + get supportsSimulation() { + return true; + }, + type: injected.type, + async setup() { + const provider = await this.getProvider(); + if ((provider == null ? void 0 : provider.on) && parameters.target) { + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider.on("connect", connect2); + } + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider.on("accountsChanged", accountsChanged); + } + } + }, + async connect({ chainId, isReconnecting: isReconnecting2 } = {}) { + var _a3, _b2, _c2, _d2, _e3, _f3; + const provider = await this.getProvider(); + if (!provider) + throw new ProviderNotFoundError(); + let accounts2 = []; + if (isReconnecting2) + accounts2 = await this.getAccounts().catch(() => []); + else if (shimDisconnect) { + try { + const permissions = await provider.request({ + method: "wallet_requestPermissions", + params: [{ eth_accounts: {} }] + }); + accounts2 = (_d2 = (_c2 = (_b2 = (_a3 = permissions[0]) == null ? void 0 : _a3.caveats) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.value) == null ? void 0 : _d2.map((x3) => getAddress$2(x3)); + if (accounts2.length > 0) { + const sortedAccounts = await this.getAccounts(); + accounts2 = sortedAccounts; + } + } catch (err) { + const error = err; + if (error.code === UserRejectedRequestError.code) + throw new UserRejectedRequestError(error); + if (error.code === ResourceUnavailableRpcError.code) + throw error; + } + } + try { + if (!(accounts2 == null ? void 0 : accounts2.length) && !isReconnecting2) { + const requestedAccounts = await provider.request({ + method: "eth_requestAccounts" + }); + accounts2 = requestedAccounts.map((x3) => getAddress$2(x3)); + } + if (connect2) { + provider.removeListener("connect", connect2); + connect2 = void 0; + } + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider.on("accountsChanged", accountsChanged); + } + if (!chainChanged) { + chainChanged = this.onChainChanged.bind(this); + provider.on("chainChanged", chainChanged); + } + if (!disconnect2) { + disconnect2 = this.onDisconnect.bind(this); + provider.on("disconnect", disconnect2); + } + let currentChainId = await this.getChainId(); + if (chainId && currentChainId !== chainId) { + const chain = await this.switchChain({ chainId }).catch((error) => { + if (error.code === UserRejectedRequestError.code) + throw error; + return { id: currentChainId }; + }); + currentChainId = (chain == null ? void 0 : chain.id) ?? currentChainId; + } + if (shimDisconnect) + await ((_e3 = config2.storage) == null ? void 0 : _e3.removeItem(`${this.id}.disconnected`)); + if (!parameters.target) + await ((_f3 = config2.storage) == null ? void 0 : _f3.setItem("injected.connected", true)); + return { accounts: accounts2, chainId: currentChainId }; + } catch (err) { + const error = err; + if (error.code === UserRejectedRequestError.code) + throw new UserRejectedRequestError(error); + if (error.code === ResourceUnavailableRpcError.code) + throw new ResourceUnavailableRpcError(error); + throw error; + } + }, + async disconnect() { + var _a3, _b2; + const provider = await this.getProvider(); + if (!provider) + throw new ProviderNotFoundError(); + if (chainChanged) { + provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; + } + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider.on("connect", connect2); + } + try { + if (this.id !== "trust") { + await withTimeout( + () => ( + // TODO: Remove explicit type for viem@3 + provider.request({ + // `'wallet_revokePermissions'` added in `viem@2.10.3` + method: "wallet_revokePermissions", + params: [{ eth_accounts: {} }] + }) + ), + { timeout: 100 } + ); + } + } catch { + } + if (shimDisconnect) { + await ((_a3 = config2.storage) == null ? void 0 : _a3.setItem(`${this.id}.disconnected`, true)); + } + if (!parameters.target) + await ((_b2 = config2.storage) == null ? void 0 : _b2.removeItem("injected.connected")); + }, + async getAccounts() { + const provider = await this.getProvider(); + if (!provider) + throw new ProviderNotFoundError(); + const accounts2 = await provider.request({ method: "eth_accounts" }); + return accounts2.map((x3) => getAddress$2(x3)); + }, + async getChainId() { + const provider = await this.getProvider(); + if (!provider) + throw new ProviderNotFoundError(); + const hexChainId = await provider.request({ method: "eth_chainId" }); + return Number(hexChainId); + }, + async getProvider() { + if (typeof window === "undefined") + return void 0; + let provider; + const target = getTarget(); + if (typeof target.provider === "function") + provider = await target.provider(window); + else if (typeof target.provider === "string") + provider = findProvider(window, target.provider); + else + provider = target.provider; + if (provider && !provider.removeListener) { + if ("off" in provider && typeof provider.off === "function") + provider.removeListener = provider.off; + else + provider.removeListener = () => { + }; + } + return provider; + }, + async isAuthorized() { + var _a3, _b2; + try { + const isRecentConnector = getRecentConnectorId() === this.id; + const disconnected = await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem(`${this.id}.disconnected`)); + const isDisconnected = !shimDisconnect || !isRecentConnector || disconnected === true; + if (isDisconnected) + return false; + if (!parameters.target) { + const connected = await ((_b2 = config2.storage) == null ? void 0 : _b2.getItem("injected.connected")); + if (!connected) + return false; + } + const provider = await this.getProvider(); + if (!provider) { + if (unstable_shimAsyncInject !== void 0 && unstable_shimAsyncInject !== false) { + const handleEthereum = async () => { + if (typeof window !== "undefined") + window.removeEventListener("ethereum#initialized", handleEthereum); + const provider2 = await this.getProvider(); + return !!provider2; + }; + const timeout = typeof unstable_shimAsyncInject === "number" ? unstable_shimAsyncInject : 1e3; + const res = await Promise.race([ + ...typeof window !== "undefined" ? [ + new Promise( + (resolve) => window.addEventListener( + "ethereum#initialized", + () => resolve(handleEthereum()), + { once: true } + ) + ) + ] : [], + new Promise( + (resolve) => setTimeout(() => resolve(handleEthereum()), timeout) + ) + ]); + if (res) + return true; + } + throw new ProviderNotFoundError(); + } + const accounts2 = await withRetry(() => this.getAccounts()); + return !!accounts2.length; + } catch { + return false; + } + }, + async switchChain({ addEthereumChainParameter, chainId }) { + var _a3, _b2, _c2, _d2; + const provider = await this.getProvider(); + if (!provider) + throw new ProviderNotFoundError(); + const chain = config2.chains.find((x3) => x3.id === chainId); + if (!chain) + throw new SwitchChainError(new ChainNotConfiguredError()); + const promise = new Promise((resolve) => { + const listener = (data) => { + if ("chainId" in data && data.chainId === chainId) { + config2.emitter.off("change", listener); + resolve(); + } + }; + config2.emitter.on("change", listener); + }); + try { + await Promise.all([ + provider.request({ + method: "wallet_switchEthereumChain", + params: [{ chainId: numberToHex(chainId) }] + }).then(async () => { + const currentChainId = await this.getChainId(); + if (currentChainId === chainId) + config2.emitter.emit("change", { chainId }); + }), + promise + ]); + return chain; + } catch (err) { + const error = err; + if (Number(error.code) === 4902 || // Unwrapping for MetaMask Mobile + // https://github.com/MetaMask/metamask-mobile/issues/2944#issuecomment-976988719 + ((_b2 = (_a3 = error == null ? void 0 : error.data) == null ? void 0 : _a3.originalError) == null ? void 0 : _b2.code) === 4902) { + try { + const { default: blockExplorer, ...blockExplorers } = chain.blockExplorers ?? {}; + let blockExplorerUrls; + if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) + blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; + else if (blockExplorer) + blockExplorerUrls = [ + blockExplorer.url, + ...Object.values(blockExplorers).map((x3) => x3.url) + ]; + let rpcUrls; + if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) + rpcUrls = addEthereumChainParameter.rpcUrls; + else + rpcUrls = [((_d2 = chain.rpcUrls.default) == null ? void 0 : _d2.http[0]) ?? ""]; + const addEthereumChain = { + blockExplorerUrls, + chainId: numberToHex(chainId), + chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, + iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, + nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, + rpcUrls + }; + await Promise.all([ + provider.request({ + method: "wallet_addEthereumChain", + params: [addEthereumChain] + }).then(async () => { + const currentChainId = await this.getChainId(); + if (currentChainId === chainId) + config2.emitter.emit("change", { chainId }); + else + throw new UserRejectedRequestError( + new Error("User rejected switch after adding network.") + ); + }), + promise + ]); + return chain; + } catch (error2) { + throw new UserRejectedRequestError(error2); + } + } + if (error.code === UserRejectedRequestError.code) + throw new UserRejectedRequestError(error); + throw new SwitchChainError(error); + } + }, + async onAccountsChanged(accounts2) { + var _a3; + const isRecentConnector = getRecentConnectorId() === this.id; + if (this.id === "trust" && !isRecentConnector) + return; + if (accounts2.length === 0) + this.onDisconnect(); + else if (config2.emitter.listenerCount("connect")) { + const chainId = (await this.getChainId()).toString(); + this.onConnect({ chainId }); + if (shimDisconnect) + await ((_a3 = config2.storage) == null ? void 0 : _a3.removeItem(`${this.id}.disconnected`)); + } else + config2.emitter.emit("change", { + accounts: accounts2.map((x3) => getAddress$2(x3)) + }); + }, + onChainChanged(chain) { + const chainId = Number(chain); + config2.emitter.emit("change", { chainId }); + }, + async onConnect(connectInfo) { + const accounts2 = await this.getAccounts(); + if (accounts2.length === 0) + return; + const chainId = Number(connectInfo.chainId); + config2.emitter.emit("connect", { accounts: accounts2, chainId }); + const provider = await this.getProvider(); + if (provider) { + if (connect2) { + provider.removeListener("connect", connect2); + connect2 = void 0; + } + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider.on("accountsChanged", accountsChanged); + } + if (!chainChanged) { + chainChanged = this.onChainChanged.bind(this); + provider.on("chainChanged", chainChanged); + } + if (!disconnect2) { + disconnect2 = this.onDisconnect.bind(this); + provider.on("disconnect", disconnect2); + } + } + }, + async onDisconnect(error) { + const provider = await this.getProvider(); + if (error && error.code === 1013) { + if (provider && !!(await this.getAccounts()).length) + return; + } + config2.emitter.emit("disconnect"); + if (provider) { + if (chainChanged) { + provider.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider.removeListener("disconnect", disconnect2); + disconnect2 = void 0; + } + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider.on("connect", connect2); + } + } + } + })); +} +const targetMap = { + coinbaseWallet: { + id: "coinbaseWallet", + name: "Coinbase Wallet", + async provider(window2) { + if (window2 == null ? void 0 : window2.coinbaseWalletExtension) + return window2.coinbaseWalletExtension; + return findProvider(window2, "isCoinbaseWallet"); + } + }, + metaMask: { + id: "metaMask", + name: "MetaMask", + async provider(window2) { + return findProvider(window2, (provider) => { + if (!provider.isMetaMask) + return false; + if (provider.isBraveWallet && !provider._events && !provider._state) + return false; + const flags = [ + "isApexWallet", + "isAvalanche", + "isBitKeep", + "isBlockWallet", + "isKuCoinWallet", + "isMathWallet", + "isOkxWallet", + "isOKExWallet", + "isOneInchIOSWallet", + "isOneInchAndroidWallet", + "isOpera", + "isPortal", + "isRabby", + "isTokenPocket", + "isTokenary", + "isUniswapWallet", + "isZerion" + ]; + for (const flag of flags) + if (provider[flag]) + return false; + return true; + }); + } + }, + phantom: { + id: "phantom", + name: "Phantom", + async provider(window2) { + var _a3, _b2; + if ((_a3 = window2 == null ? void 0 : window2.phantom) == null ? void 0 : _a3.ethereum) + return (_b2 = window2.phantom) == null ? void 0 : _b2.ethereum; + return findProvider(window2, "isPhantom"); + } + } +}; +function findProvider(window2, select2) { + function isProvider(provider) { + if (typeof select2 === "function") + return select2(provider); + if (typeof select2 === "string") + return provider[select2]; + return true; + } + const ethereum = window2.ethereum; + if (ethereum == null ? void 0 : ethereum.providers) + return ethereum.providers.find((provider) => isProvider(provider)); + if (ethereum && isProvider(ethereum)) + return ethereum; + return void 0; +} +function isAndroid() { + return typeof navigator !== "undefined" && /android/i.test(navigator.userAgent); +} +function isSmallIOS() { + return typeof navigator !== "undefined" && /iPhone|iPod/.test(navigator.userAgent); +} +function isLargeIOS() { + return typeof navigator !== "undefined" && (/iPad/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1); +} +function isIOS() { + return isSmallIOS() || isLargeIOS(); +} +function isMobile() { + return isAndroid() || isIOS(); +} +function isPC() { + return !isMobile(); +} +function isBrowser() { + return !isTMA(); +} +function isTMA() { + if (typeof window === "undefined") { + return false; + } + const check = (host) => { + return typeof host !== "undefined" && "TelegramWebviewProxy" in host && "postEvent" in host.TelegramWebviewProxy && typeof host.TelegramWebviewProxy.postEvent === "function"; + }; + return check(window); +} +async function sleep$2(duration = 1e3) { + return new Promise((resolve) => { + setTimeout(() => { + resolve(null); + }, duration); + }); +} +async function openLink(uri, target = "_self") { + if (!uri) + return; + const finalTarget = isTMA() ? "_blank" : target; + window.open(uri, finalTarget, "noopener noreferrer"); +} +function trustWallet(props = {}) { + const { connectorOptions, ...restProps } = props; + return { + ...trustWalletConfig, + id: "trust", + walletType: "evm", + showQRCode: false, + platforms: ["tg-android", "tg-ios", "tg-pc", "browser-android", "browser-ios", "browser-pc"], + isInstalled() { + return !!getProvider$1$1(); + }, + getDeepLink() { + const encodedUrl = encodeURIComponent(window.location.href); + return `https://link.trustwallet.com/open_url?coin_id=60&url=${encodedUrl}`; + }, + getUri(uri) { + let encodedUri = encodeURIComponent(uri); + if (isTMA() && isAndroid()) { + encodedUri = encodeURIComponent(encodedUri); + } + return `https://link.trustwallet.com/wc?uri=${encodedUri}`; + }, + getCreateConnectorFn() { + let isReady = false; + return injected({ + shimDisconnect: true, + target: { + id: trustWallet().id, + name: trustWallet().name, + async provider() { + if (!isReady) { + await sleep$2(); + } + isReady = true; + return getProvider$1$1(); + } + }, + ...connectorOptions + }); + }, + ...restProps + }; +} +function getProvider$1$1() { + var _a3; + if (typeof window === "undefined") + return; + if (!((_a3 = window == null ? void 0 : window.trustwallet) == null ? void 0 : _a3.request)) + return; + return window.trustwallet ?? window.trustWallet ?? getEvmInjectedProvider("isTrust"); +} +const WalletConnectTransparentIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", ...props, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("g", { clipPath: "url(#clip0_3705_10415)", children: /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M11.9465 14.9229C16.3942 10.581 23.605 10.581 28.0527 14.9229L28.5879 15.4454C28.8103 15.6625 28.8103 16.0145 28.5879 16.2316L26.7568 18.0191C26.6457 18.1276 26.4654 18.1276 26.3542 18.0191L25.6176 17.3C22.5149 14.271 17.4843 14.271 14.3816 17.3L13.5928 18.0701C13.4816 18.1786 13.3013 18.1786 13.1901 18.0701L11.359 16.2826C11.1367 16.0655 11.1367 15.7135 11.359 15.4964L11.9465 14.9229ZM31.8395 18.6197L33.4691 20.2105C33.6915 20.4276 33.6915 20.7796 33.4691 20.9967L26.1209 28.1703C25.8986 28.3874 25.538 28.3874 25.3156 28.1703L20.1003 23.079C20.0447 23.0247 19.9546 23.0247 19.899 23.079L14.6838 28.1703C14.4614 28.3874 14.1008 28.3874 13.8785 28.1703L6.53007 20.9966C6.30769 20.7795 6.30769 20.4276 6.53007 20.2105L8.15972 18.6196C8.38209 18.4025 8.74264 18.4025 8.96502 18.6196L14.1804 23.7109C14.236 23.7652 14.3261 23.7652 14.3817 23.7109L19.5969 18.6196C19.8192 18.4025 20.1798 18.4025 20.4021 18.6195L25.6175 23.7109C25.6732 23.7652 25.7633 23.7652 25.8188 23.7109L31.0342 18.6197C31.2565 18.4026 31.6171 18.4026 31.8395 18.6197Z", + fill: "#3396FF" + } + ) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("clipPath", { id: "clip0_3705_10415", children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: "40", height: "40", fill: "white" }) }) }) + ] }); +}; +const WalletConnectIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 68 68", fill: "none", ...props, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: "68", height: "68", rx: "16", fill: "#3396FF" }), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M20.0995 25.2382C27.7768 17.7435 40.224 17.7435 47.9013 25.2382L48.8252 26.1402C49.209 26.5149 49.209 27.1225 48.8252 27.4972L45.6645 30.5828C45.4726 30.7702 45.1614 30.7702 44.9694 30.5828L43.6979 29.3416C38.3422 24.113 29.6586 24.113 24.3029 29.3416L22.9412 30.6708C22.7493 30.8582 22.438 30.8582 22.2461 30.6708L19.0854 27.5853C18.7016 27.2105 18.7016 26.603 19.0854 26.2282L20.0995 25.2382ZM54.4379 31.6195L57.2509 34.3655C57.6348 34.7403 57.6348 35.3478 57.2509 35.7226L44.5667 48.1054C44.1829 48.4801 43.5606 48.4801 43.1766 48.1054L34.1742 39.317C34.0782 39.2233 33.9227 39.2233 33.8267 39.317L24.8244 48.1054C24.4406 48.4801 23.8182 48.4801 23.4344 48.1054L10.7498 35.7225C10.3659 35.3477 10.3659 34.7402 10.7498 34.3654L13.5629 31.6193C13.9467 31.2446 14.5691 31.2446 14.9529 31.6193L23.9556 40.4077C24.0515 40.5015 24.207 40.5015 24.303 40.4077L33.3052 31.6193C33.689 31.2446 34.3114 31.2446 34.6952 31.6192L43.6978 40.4077C43.7939 40.5015 43.9494 40.5015 44.0453 40.4077L53.0478 31.6195C53.4316 31.2447 54.054 31.2447 54.4379 31.6195Z", + fill: "white" + } + ) + ] }); +}; +const walletConnectConfig = { + name: "WalletConnect", + logos: { + default: /* @__PURE__ */ jsxRuntimeExports.jsx(WalletConnectIcon, {}), + transparent: /* @__PURE__ */ jsxRuntimeExports.jsx(WalletConnectTransparentIcon, {}) + }, + downloadUrls: { + default: void 0 + } +}; +let evmGlobalData = {}; +const setEvmGlobalData = (value) => { + evmGlobalData = { + ...evmGlobalData, + ...value + }; +}; +const getEvmGlobalData = () => { + return evmGlobalData; +}; +function walletConnect(props = {}) { + const { connectorOptions, ...restProps } = props; + return { + ...walletConnectConfig, + id: "walletConnect", + walletType: "evm", + showQRCode: !(connectorOptions == null ? void 0 : connectorOptions.showQrModal), + platforms: ["tg-android", "tg-ios", "tg-pc", "browser-android", "browser-ios", "browser-pc"], + isInstalled() { + return true; + }, + getDeepLink() { + return void 0; + }, + getUri(uri) { + return uri; + }, + getCreateConnectorFn() { + const { walletConnectProjectId, metadata } = getEvmGlobalData(); + const hasAllAppData = (metadata == null ? void 0 : metadata.name) && metadata.icon && metadata.description && metadata.url; + if (!walletConnectProjectId) { + throw new Error("walletConnectProjectId is required."); + } + return walletConnect$1({ + // https://github.com/WalletConnect/walletconnect-monorepo/issues/2830 + relayUrl: "wss://relay.walletconnect.org", + projectId: walletConnectProjectId, + metadata: hasAllAppData ? { + name: metadata.name, + description: metadata.description, + url: metadata.url, + icons: [metadata.icon] + } : void 0, + qrModalOptions: { + explorerRecommendedWalletIds: [ + "8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4", + "c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96", + "4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0" + ] + }, + ...connectorOptions, + showQrModal: true + }); + }, + ...restProps + }; +} +function isWalletConnect(id2) { + return id2 === walletConnect().id; +} +const BinanceWeb3WalletTransparentIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx(BinanceWeb3WalletIcon, { width: 40, height: 40, ...props }); +}; +const BinanceWeb3WalletIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 68 68", fill: "none", ...props, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M0 18.1333C0 8.11857 8.11857 0 18.1333 0H49.8667C59.8814 0 68 8.11857 68 18.1333V49.8667C68 59.8814 59.8814 68 49.8667 68H18.1333C8.11857 68 0 59.8814 0 49.8667V18.1333Z", + fill: "#0B0E11" + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M24.7562 30.201L34.0001 20.9572L43.2487 30.2059L48.6274 24.8269L34.0001 10.1992L19.3774 24.8221L24.7562 30.201ZM15.5792 28.6199L20.958 33.9987L15.5789 39.3778L10.2002 33.999L15.5792 28.6199ZM24.7562 37.7973L34.0001 47.0409L43.2485 37.7927L48.6303 43.1688L48.6274 43.1715L34.0001 57.7992L19.3772 43.1763L19.3697 43.1689L24.7562 37.7973ZM57.8002 33.9997L52.4215 39.3785L47.0427 33.9997L52.4215 28.6209L57.8002 33.9997Z", + fill: "#F0B90B" + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M39.4555 33.9965H39.458L33.9999 28.5382L28.5391 33.9991L28.5465 34.0067L33.9999 39.4601L39.4606 33.9991L39.4555 33.9965Z", + fill: "#F0B90B" + } + ) + ] }); +}; +const binanceWeb3WalletConfig = { + name: "Binance Web3 Wallet", + logos: { + default: /* @__PURE__ */ jsxRuntimeExports.jsx(BinanceWeb3WalletIcon, {}), + transparent: /* @__PURE__ */ jsxRuntimeExports.jsx(BinanceWeb3WalletTransparentIcon, {}) + }, + downloadUrls: { + default: "https://www.binance.com/en/web3wallet" + }, + spinnerColor: void 0 +}; +function binanceWeb3Wallet(props = {}) { + const { connectorOptions, ...restProps } = props; + return { + ...binanceWeb3WalletConfig, + id: "binanceWeb3Wallet", + walletType: "evm", + showQRCode: false, + platforms: ["tg-android", "tg-ios", "tg-pc", "browser-android", "browser-ios", "browser-pc"], + isInstalled() { + return true; + }, + getDeepLink() { + return void 0; + }, + getUri() { + return void 0; + }, + getCreateConnectorFn() { + const connector = m$2(); + return connector({ + ...connectorOptions + }); + }, + ...restProps + }; +} +const CodexFieldWalletTransparentIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx(CodexFieldWalletIcon, { ...props }); +}; +const CodexFieldWalletIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsxs( + "svg", + { + width: "61", + height: "60", + viewBox: "0 0 61 60", + fill: "none", + xmlnsXlink: "http://www.w3.org/1999/xlink", + ...props, + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M0.5 16C0.5 7.16344 7.66344 0 16.5 0H44.5C53.3366 0 60.5 7.16344 60.5 16V44C60.5 52.8366 53.3366 60 44.5 60H16.5C7.66344 60 0.5 52.8366 0.5 44V16Z", + fill: "#0051FE" + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "mask", + { + id: "mask0_32496_5645", + style: { + maskType: "alpha" + }, + maskUnits: "userSpaceOnUse", + x: "0", + y: "0", + width: "61", + height: "60", + children: /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M0.5 16C0.5 7.16344 7.66344 0 16.5 0H44.5C53.3366 0 60.5 7.16344 60.5 16V44C60.5 52.8366 53.3366 60 44.5 60H16.5C7.66344 60 0.5 52.8366 0.5 44V16Z", + fill: "#0051FE" + } + ) + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx("g", { mask: "url(#mask0_32496_5645)", children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "-1", y: "-1", width: "62", height: "62", fill: "url(#pattern0_32496_5645)" }) }), + /* @__PURE__ */ jsxRuntimeExports.jsxs("defs", { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "pattern", + { + id: "pattern0_32496_5645", + patternContentUnits: "objectBoundingBox", + width: "1", + height: "1", + children: /* @__PURE__ */ jsxRuntimeExports.jsx("use", { xlinkHref: "#image0_32496_5645", transform: "scale(0.002)" }) + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "image", + { + id: "image0_32496_5645", + width: "500", + height: "500", + xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAIAAABEtEjdAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAB9KADAAQAAAABAAAB9AAAAAB3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AoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAj8f4rA/wFAraGm797I1wAAAABJRU5ErkJggg==" + } + ) + ] }) + ] + } + ); +}; +const codexFieldWalletConfig = { + name: "CodexField Wallet", + logos: { + default: /* @__PURE__ */ jsxRuntimeExports.jsx(CodexFieldWalletIcon, {}), + transparent: /* @__PURE__ */ jsxRuntimeExports.jsx(CodexFieldWalletTransparentIcon, {}) + }, + downloadUrls: { + default: "https://t.me/codexfieldbot" + }, + spinnerColor: "#1098FC" +}; +function codexFieldWallet(props = {}) { + const { connectorOptions, ...restProps } = props; + return { + ...codexFieldWalletConfig, + id: "codexFieldWallet", + walletType: "evm", + showQRCode: false, + platforms: ["tg-android", "tg-ios", "tg-pc"], + isInstalled() { + return true; + }, + getDeepLink() { + return void 0; + }, + getUri(uri) { + return void 0; + }, + getCreateConnectorFn() { + const { walletConnectProjectId } = getEvmGlobalData(); + if (!walletConnectProjectId) { + throw new Error("walletConnectProjectId is required."); + } + return codexFieldWallet$1({ + projectId: walletConnectProjectId, + ...connectorOptions + }); + }, + ...restProps + }; +} +const UXUYWalletTransparentIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx(UXUYWalletIcon, { ...props }); +}; +const UXUYWalletIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsxs( + "svg", + { + width: "60", + height: "60", + viewBox: "0 0 60 60", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + xmlnsXlink: "http://www.w3.org/1999/xlink", + ...props, + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: "60", height: "60", fill: "url(#pattern0_33502_70485)" }), + /* @__PURE__ */ jsxRuntimeExports.jsxs("defs", { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "pattern", + { + id: "pattern0_33502_70485", + patternContentUnits: "objectBoundingBox", + width: "1", + height: "1", + children: /* @__PURE__ */ jsxRuntimeExports.jsx("use", { xlinkHref: "#image0_33502_70485", transform: "scale(0.00833333)" }) + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "image", + { + id: "image0_33502_70485", + width: "120", + height: "120", + xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABqnSURBVHgB7V0JkBxXef5ez7n37DG7q9XanhVyLEu2LmNwiAOiAhWTqgQVqUAgFSMqQBwwkQwFtowd2bESbCDYCjgkoQgmhIrJhRWOQJLC6yQOJsbW+pJsS1izliztane19+6c3fn/9173tOSV1D07Mztj5rNbM7PTx/T73v+//3qvBcqMdevWJbLZwDbLwibAStBrgv4coy2Bny8kaZsSQr4+JYQ1lM9HhpLJoSTKCIEyYO3aK7aZpvVOy7K24+ePSL9ICiEGDUN8/ciRZwdRYpSM4ERic8wwMjstS+wiSY2hjmKQJKLvzOdDg6WS7GUTXCe2HBCsyh8wzdC+5RIdwDKwZs0VO4H8Q/T2OtqiqKNU4La8Roj89s7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TPwUDL57CBKjLLXkinJDm02jDwHSjaRD5fQtV8J/HwhyRKqpgpZw6ZpDAH5wWIMJz/4f5E1kJHX3XWBAAAAAElFTkSuQmCC" + } + ) + ] }) + ] + } + ); +}; +const uxuyWalletConfig = { + name: "UXUY Wallet", + logos: { + default: /* @__PURE__ */ jsxRuntimeExports.jsx(UXUYWalletIcon, {}), + transparent: /* @__PURE__ */ jsxRuntimeExports.jsx(UXUYWalletTransparentIcon, {}) + }, + downloadUrls: { + default: "https://uxuy.com/" + }, + spinnerColor: "#1098FC" +}; +function uxuyWallet(props = {}) { + const { connectorOptions, ...restProps } = props; + return { + ...uxuyWalletConfig, + id: "uxuyWallet", + walletType: "evm", + showQRCode: false, + platforms: ["tg-android", "tg-ios", "tg-pc"], + isInstalled() { + return true; + }, + getDeepLink() { + return void 0; + }, + getUri(uri) { + return void 0; + }, + getCreateConnectorFn() { + return injected({ + shimDisconnect: true, + target: { + id: uxuyWallet().id, + name: uxuyWallet().name, + async provider() { + return await getProvider(); + } + }, + ...connectorOptions + }); + }, + ...restProps + }; +} +async function getProvider() { + if (typeof window === "undefined") + return; + try { + const { WalletTgSdk } = (await __vitePreload(() => import("./index.es-07d215c7.js"), true ? [] : void 0, import.meta.url)).default; + const { ethereum } = new WalletTgSdk({ + metaData: { + hostname: window.location.hostname + } + }); + return ethereum; + } catch (err) { + console.error(err); + } +} +var buffer = {}; +var base64Js = {}; +base64Js.byteLength = byteLength; +base64Js.toByteArray = toByteArray; +base64Js.fromByteArray = fromByteArray; +var lookup = []; +var revLookup = []; +var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; +var code$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +for (var i$2 = 0, len = code$1.length; i$2 < len; ++i$2) { + lookup[i$2] = code$1[i$2]; + revLookup[code$1.charCodeAt(i$2)] = i$2; +} +revLookup["-".charCodeAt(0)] = 62; +revLookup["_".charCodeAt(0)] = 63; +function getLens(b64) { + var len = b64.length; + if (len % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) + validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; +} +function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; +} +function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; +} +function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i2; + for (i2 = 0; i2 < len; i2 += 4) { + tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; +} +function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; +} +function encodeChunk(uint8, start, end) { + var tmp; + var output2 = []; + for (var i2 = start; i2 < end; i2 += 3) { + tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); + output2.push(tripletToBase64(tmp)); + } + return output2.join(""); +} +function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i2 = 0, len2 = len - extraBytes; i2 < len2; i2 += maxChunkLength) { + parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len2 ? len2 : i2 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push( + lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" + ); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push( + lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" + ); + } + return parts.join(""); +} +var ieee754 = {}; +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +ieee754.read = function(buffer2, offset2, isLE2, mLen, nBytes) { + var e18, m3; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i2 = isLE2 ? nBytes - 1 : 0; + var d4 = isLE2 ? -1 : 1; + var s2 = buffer2[offset2 + i2]; + i2 += d4; + e18 = s2 & (1 << -nBits) - 1; + s2 >>= -nBits; + nBits += eLen; + for (; nBits > 0; e18 = e18 * 256 + buffer2[offset2 + i2], i2 += d4, nBits -= 8) { + } + m3 = e18 & (1 << -nBits) - 1; + e18 >>= -nBits; + nBits += mLen; + for (; nBits > 0; m3 = m3 * 256 + buffer2[offset2 + i2], i2 += d4, nBits -= 8) { + } + if (e18 === 0) { + e18 = 1 - eBias; + } else if (e18 === eMax) { + return m3 ? NaN : (s2 ? -1 : 1) * Infinity; + } else { + m3 = m3 + Math.pow(2, mLen); + e18 = e18 - eBias; + } + return (s2 ? -1 : 1) * m3 * Math.pow(2, e18 - mLen); +}; +ieee754.write = function(buffer2, value, offset2, isLE2, mLen, nBytes) { + var e18, m3, c2; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt2 = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i2 = isLE2 ? 0 : nBytes - 1; + var d4 = isLE2 ? 1 : -1; + var s2 = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m3 = isNaN(value) ? 1 : 0; + e18 = eMax; + } else { + e18 = Math.floor(Math.log(value) / Math.LN2); + if (value * (c2 = Math.pow(2, -e18)) < 1) { + e18--; + c2 *= 2; + } + if (e18 + eBias >= 1) { + value += rt2 / c2; + } else { + value += rt2 * Math.pow(2, 1 - eBias); + } + if (value * c2 >= 2) { + e18++; + c2 /= 2; + } + if (e18 + eBias >= eMax) { + m3 = 0; + e18 = eMax; + } else if (e18 + eBias >= 1) { + m3 = (value * c2 - 1) * Math.pow(2, mLen); + e18 = e18 + eBias; + } else { + m3 = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e18 = 0; + } + } + for (; mLen >= 8; buffer2[offset2 + i2] = m3 & 255, i2 += d4, m3 /= 256, mLen -= 8) { + } + e18 = e18 << mLen | m3; + eLen += mLen; + for (; eLen > 0; buffer2[offset2 + i2] = e18 & 255, i2 += d4, e18 /= 256, eLen -= 8) { + } + buffer2[offset2 + i2 - d4] |= s2 * 128; +}; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +(function(exports) { + const base642 = base64Js; + const ieee754$1 = ieee754; + const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports.Buffer = Buffer2; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + const K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer2.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 typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto2 = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto2, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto2); + return arr.foo() === 42; + } catch (e18) { + return false; + } + } + Object.defineProperty(Buffer2.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer2.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function Buffer2(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ); + } + return allocUnsafe2(arg); + } + return from2(arg, encodingOrOffset, length); + } + Buffer2.poolSize = 8192; + function from2(value, encodingOrOffset, length) { + if (typeof value === "string") { + return fromString2(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError( + "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value + ); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof value === "number") { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ); + } + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer2.from(valueOf, encodingOrOffset, length); + } + const b2 = fromObject(value); + if (b2) + return b2; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length); + } + throw new TypeError( + "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value + ); + } + Buffer2.from = function(value, encodingOrOffset, length) { + return from2(value, encodingOrOffset, length); + }; + Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer2, Uint8Array); + function assertSize2(size2) { + if (typeof size2 !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size2 < 0) { + throw new RangeError('The value "' + size2 + '" is invalid for option "size"'); + } + } + function alloc(size2, fill, encoding2) { + assertSize2(size2); + if (size2 <= 0) { + return createBuffer(size2); + } + if (fill !== void 0) { + return typeof encoding2 === "string" ? createBuffer(size2).fill(fill, encoding2) : createBuffer(size2).fill(fill); + } + return createBuffer(size2); + } + Buffer2.alloc = function(size2, fill, encoding2) { + return alloc(size2, fill, encoding2); + }; + function allocUnsafe2(size2) { + assertSize2(size2); + return createBuffer(size2 < 0 ? 0 : checked(size2) | 0); + } + Buffer2.allocUnsafe = function(size2) { + return allocUnsafe2(size2); + }; + Buffer2.allocUnsafeSlow = function(size2) { + return allocUnsafe2(size2); + }; + function fromString2(string2, encoding2) { + if (typeof encoding2 !== "string" || encoding2 === "") { + encoding2 = "utf8"; + } + if (!Buffer2.isEncoding(encoding2)) { + throw new TypeError("Unknown encoding: " + encoding2); + } + const length = byteLength2(string2, encoding2) | 0; + let buf = createBuffer(length); + const actual = buf.write(string2, encoding2); + if (actual !== length) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array2) { + const length = array2.length < 0 ? 0 : checked(array2.length) | 0; + const buf = createBuffer(length); + for (let i2 = 0; i2 < length; i2 += 1) { + buf[i2] = array2[i2] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array2, byteOffset, length) { + if (byteOffset < 0 || array2.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array2.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length === void 0) { + buf = new Uint8Array(array2); + } else if (length === void 0) { + buf = new Uint8Array(array2, byteOffset); + } else { + buf = new Uint8Array(array2, byteOffset, length); + } + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer2.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length) { + if (length >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length | 0; + } + function SlowBuffer(length) { + if (+length != length) { + length = 0; + } + return Buffer2.alloc(+length); + } + Buffer2.isBuffer = function isBuffer2(b2) { + return b2 != null && b2._isBuffer === true && b2 !== Buffer2.prototype; + }; + Buffer2.compare = function compare2(a3, b2) { + if (isInstance(a3, Uint8Array)) + a3 = Buffer2.from(a3, a3.offset, a3.byteLength); + if (isInstance(b2, Uint8Array)) + b2 = Buffer2.from(b2, b2.offset, b2.byteLength); + if (!Buffer2.isBuffer(a3) || !Buffer2.isBuffer(b2)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ); + } + if (a3 === b2) + return 0; + let x3 = a3.length; + let y3 = b2.length; + for (let i2 = 0, len = Math.min(x3, y3); i2 < len; ++i2) { + if (a3[i2] !== b2[i2]) { + x3 = a3[i2]; + y3 = b2[i2]; + break; + } + } + if (x3 < y3) + return -1; + if (y3 < x3) + return 1; + return 0; + }; + Buffer2.isEncoding = function isEncoding(encoding2) { + switch (String(encoding2).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; + } + }; + Buffer2.concat = function concat2(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer2.alloc(0); + } + let i2; + if (length === void 0) { + length = 0; + for (i2 = 0; i2 < list.length; ++i2) { + length += list[i2].length; + } + } + const buffer2 = Buffer2.allocUnsafe(length); + let pos = 0; + for (i2 = 0; i2 < list.length; ++i2) { + let buf = list[i2]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer2.length) { + if (!Buffer2.isBuffer(buf)) + buf = Buffer2.from(buf); + buf.copy(buffer2, pos); + } else { + Uint8Array.prototype.set.call( + buffer2, + buf, + pos + ); + } + } else if (!Buffer2.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer2, pos); + } + pos += buf.length; + } + return buffer2; + }; + function byteLength2(string2, encoding2) { + if (Buffer2.isBuffer(string2)) { + return string2.length; + } + if (ArrayBuffer.isView(string2) || isInstance(string2, ArrayBuffer)) { + return string2.byteLength; + } + if (typeof string2 !== "string") { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string2 + ); + } + const len = string2.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding2) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes2(string2).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string2).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes2(string2).length; + } + encoding2 = ("" + encoding2).toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.byteLength = byteLength2; + function slowToString(encoding2, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding2) + encoding2 = "utf8"; + while (true) { + switch (encoding2) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding2); + encoding2 = (encoding2 + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.prototype._isBuffer = true; + function swap(b2, n5, m3) { + const i2 = b2[n5]; + b2[n5] = b2[m3]; + b2[m3] = i2; + } + Buffer2.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i2 = 0; i2 < len; i2 += 2) { + swap(this, i2, i2 + 1); + } + return this; + }; + Buffer2.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i2 = 0; i2 < len; i2 += 4) { + swap(this, i2, i2 + 3); + swap(this, i2 + 1, i2 + 2); + } + return this; + }; + Buffer2.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i2 = 0; i2 < len; i2 += 8) { + swap(this, i2, i2 + 7); + swap(this, i2 + 1, i2 + 6); + swap(this, i2 + 2, i2 + 5); + swap(this, i2 + 3, i2 + 4); + } + return this; + }; + Buffer2.prototype.toString = function toString3() { + const length = this.length; + if (length === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; + Buffer2.prototype.equals = function equals2(b2) { + if (!Buffer2.isBuffer(b2)) + throw new TypeError("Argument must be a Buffer"); + if (this === b2) + return true; + return Buffer2.compare(this, b2) === 0; + }; + Buffer2.prototype.inspect = function inspect6() { + let str = ""; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) + str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + } + Buffer2.prototype.compare = function compare2(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer2.from(target, target.offset, target.byteLength); + } + if (!Buffer2.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target + ); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x3 = thisEnd - thisStart; + let y3 = end - start; + const len = Math.min(x3, y3); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i2 = 0; i2 < len; ++i2) { + if (thisCopy[i2] !== targetCopy[i2]) { + x3 = thisCopy[i2]; + y3 = targetCopy[i2]; + break; + } + } + if (x3 < y3) + return -1; + if (y3 < x3) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer2, val, byteOffset, encoding2, dir) { + if (buffer2.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding2 = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer2.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer2.length + byteOffset; + if (byteOffset >= buffer2.length) { + if (dir) + return -1; + else + byteOffset = buffer2.length - 1; + } else if (byteOffset < 0) { + if (dir) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer2.from(val, encoding2); + } + if (Buffer2.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer2, val, byteOffset, encoding2, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer2, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset); + } + } + return arrayIndexOf(buffer2, [val], byteOffset, encoding2, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding2, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding2 !== void 0) { + encoding2 = String(encoding2).toLowerCase(); + if (encoding2 === "ucs2" || encoding2 === "ucs-2" || encoding2 === "utf16le" || encoding2 === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read(buf, i3) { + if (indexSize === 1) { + return buf[i3]; + } else { + return buf.readUInt16BE(i3 * indexSize); + } + } + let i2; + if (dir) { + let foundIndex = -1; + for (i2 = byteOffset; i2 < arrLength; i2++) { + if (read(arr, i2) === read(val, foundIndex === -1 ? 0 : i2 - foundIndex)) { + if (foundIndex === -1) + foundIndex = i2; + if (i2 - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i2 -= i2 - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i2 = byteOffset; i2 >= 0; i2--) { + let found = true; + for (let j2 = 0; j2 < valLength; j2++) { + if (read(arr, i2 + j2) !== read(val, j2)) { + found = false; + break; + } + } + if (found) + return i2; + } + } + return -1; + } + Buffer2.prototype.includes = function includes2(val, byteOffset, encoding2) { + return this.indexOf(val, byteOffset, encoding2) !== -1; + }; + Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding2) { + return bidirectionalIndexOf(this, val, byteOffset, encoding2, true); + }; + Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding2) { + return bidirectionalIndexOf(this, val, byteOffset, encoding2, false); + }; + function hexWrite(buf, string2, offset2, length) { + offset2 = Number(offset2) || 0; + const remaining = buf.length - offset2; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + const strLen = string2.length; + if (length > strLen / 2) { + length = strLen / 2; + } + let i2; + for (i2 = 0; i2 < length; ++i2) { + const parsed = parseInt(string2.substr(i2 * 2, 2), 16); + if (numberIsNaN(parsed)) + return i2; + buf[offset2 + i2] = parsed; + } + return i2; + } + function utf8Write(buf, string2, offset2, length) { + return blitBuffer(utf8ToBytes2(string2, buf.length - offset2), buf, offset2, length); + } + function asciiWrite(buf, string2, offset2, length) { + return blitBuffer(asciiToBytes(string2), buf, offset2, length); + } + function base64Write(buf, string2, offset2, length) { + return blitBuffer(base64ToBytes(string2), buf, offset2, length); + } + function ucs2Write(buf, string2, offset2, length) { + return blitBuffer(utf16leToBytes(string2, buf.length - offset2), buf, offset2, length); + } + Buffer2.prototype.write = function write3(string2, offset2, length, encoding2) { + if (offset2 === void 0) { + encoding2 = "utf8"; + length = this.length; + offset2 = 0; + } else if (length === void 0 && typeof offset2 === "string") { + encoding2 = offset2; + length = this.length; + offset2 = 0; + } else if (isFinite(offset2)) { + offset2 = offset2 >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding2 === void 0) + encoding2 = "utf8"; + } else { + encoding2 = length; + length = void 0; + } + } else { + throw new Error( + "Buffer.write(string, encoding, offset[, length]) is no longer supported" + ); + } + const remaining = this.length - offset2; + if (length === void 0 || length > remaining) + length = remaining; + if (string2.length > 0 && (length < 0 || offset2 < 0) || offset2 > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding2) + encoding2 = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding2) { + case "hex": + return hexWrite(this, string2, offset2, length); + case "utf8": + case "utf-8": + return utf8Write(this, string2, offset2, length); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string2, offset2, length); + case "base64": + return base64Write(this, string2, offset2, length); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string2, offset2, length); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding2); + encoding2 = ("" + encoding2).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer2.prototype.toJSON = function toJSON3() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base642.fromByteArray(buf); + } else { + return base642.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i2 = start; + while (i2 < end) { + const firstByte = buf[i2]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i2 + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i2 + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i2 + 1]; + thirdByte = buf[i2 + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i2 + 1]; + thirdByte = buf[i2 + 2]; + fourthByte = buf[i2 + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i2 += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + const MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i2 = 0; + while (i2 < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i2, i2 += MAX_ARGUMENTS_LENGTH) + ); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i2 = start; i2 < end; ++i2) { + ret += String.fromCharCode(buf[i2] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i2 = start; i2 < end; ++i2) { + ret += String.fromCharCode(buf[i2]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i2 = start; i2 < end; ++i2) { + out += hexSliceLookupTable[buf[i2]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes2 = buf.slice(start, end); + let res = ""; + for (let i2 = 0; i2 < bytes2.length - 1; i2 += 2) { + res += String.fromCharCode(bytes2[i2] + bytes2[i2 + 1] * 256); + } + return res; + } + Buffer2.prototype.slice = function slice(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer2.prototype); + return newBuf; + }; + function checkOffset(offset2, ext, length) { + if (offset2 % 1 !== 0 || offset2 < 0) + throw new RangeError("offset is not uint"); + if (offset2 + ext > length) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset2, byteLength3, noAssert) { + offset2 = offset2 >>> 0; + byteLength3 = byteLength3 >>> 0; + if (!noAssert) + checkOffset(offset2, byteLength3, this.length); + let val = this[offset2]; + let mul6 = 1; + let i2 = 0; + while (++i2 < byteLength3 && (mul6 *= 256)) { + val += this[offset2 + i2] * mul6; + } + return val; + }; + Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset2, byteLength3, noAssert) { + offset2 = offset2 >>> 0; + byteLength3 = byteLength3 >>> 0; + if (!noAssert) { + checkOffset(offset2, byteLength3, this.length); + } + let val = this[offset2 + --byteLength3]; + let mul6 = 1; + while (byteLength3 > 0 && (mul6 *= 256)) { + val += this[offset2 + --byteLength3] * mul6; + } + return val; + }; + Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 1, this.length); + return this[offset2]; + }; + Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 2, this.length); + return this[offset2] | this[offset2 + 1] << 8; + }; + Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 2, this.length); + return this[offset2] << 8 | this[offset2 + 1]; + }; + Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 4, this.length); + return (this[offset2] | this[offset2 + 1] << 8 | this[offset2 + 2] << 16) + this[offset2 + 3] * 16777216; + }; + Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 4, this.length); + return this[offset2] * 16777216 + (this[offset2 + 1] << 16 | this[offset2 + 2] << 8 | this[offset2 + 3]); + }; + Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset2) { + offset2 = offset2 >>> 0; + validateNumber(offset2, "offset"); + const first = this[offset2]; + const last = this[offset2 + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset2, this.length - 8); + } + const lo2 = first + this[++offset2] * 2 ** 8 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 24; + const hi2 = this[++offset2] + this[++offset2] * 2 ** 8 + this[++offset2] * 2 ** 16 + last * 2 ** 24; + return BigInt(lo2) + (BigInt(hi2) << BigInt(32)); + }); + Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset2) { + offset2 = offset2 >>> 0; + validateNumber(offset2, "offset"); + const first = this[offset2]; + const last = this[offset2 + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset2, this.length - 8); + } + const hi2 = first * 2 ** 24 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 8 + this[++offset2]; + const lo2 = this[++offset2] * 2 ** 24 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 8 + last; + return (BigInt(hi2) << BigInt(32)) + BigInt(lo2); + }); + Buffer2.prototype.readIntLE = function readIntLE(offset2, byteLength3, noAssert) { + offset2 = offset2 >>> 0; + byteLength3 = byteLength3 >>> 0; + if (!noAssert) + checkOffset(offset2, byteLength3, this.length); + let val = this[offset2]; + let mul6 = 1; + let i2 = 0; + while (++i2 < byteLength3 && (mul6 *= 256)) { + val += this[offset2 + i2] * mul6; + } + mul6 *= 128; + if (val >= mul6) + val -= Math.pow(2, 8 * byteLength3); + return val; + }; + Buffer2.prototype.readIntBE = function readIntBE(offset2, byteLength3, noAssert) { + offset2 = offset2 >>> 0; + byteLength3 = byteLength3 >>> 0; + if (!noAssert) + checkOffset(offset2, byteLength3, this.length); + let i2 = byteLength3; + let mul6 = 1; + let val = this[offset2 + --i2]; + while (i2 > 0 && (mul6 *= 256)) { + val += this[offset2 + --i2] * mul6; + } + mul6 *= 128; + if (val >= mul6) + val -= Math.pow(2, 8 * byteLength3); + return val; + }; + Buffer2.prototype.readInt8 = function readInt8(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 1, this.length); + if (!(this[offset2] & 128)) + return this[offset2]; + return (255 - this[offset2] + 1) * -1; + }; + Buffer2.prototype.readInt16LE = function readInt16LE2(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 2, this.length); + const val = this[offset2] | this[offset2 + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt16BE = function readInt16BE2(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 2, this.length); + const val = this[offset2 + 1] | this[offset2] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt32LE = function readInt32LE2(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 4, this.length); + return this[offset2] | this[offset2 + 1] << 8 | this[offset2 + 2] << 16 | this[offset2 + 3] << 24; + }; + Buffer2.prototype.readInt32BE = function readInt32BE2(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 4, this.length); + return this[offset2] << 24 | this[offset2 + 1] << 16 | this[offset2 + 2] << 8 | this[offset2 + 3]; + }; + Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset2) { + offset2 = offset2 >>> 0; + validateNumber(offset2, "offset"); + const first = this[offset2]; + const last = this[offset2 + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset2, this.length - 8); + } + const val = this[offset2 + 4] + this[offset2 + 5] * 2 ** 8 + this[offset2 + 6] * 2 ** 16 + (last << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset2] * 2 ** 8 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 24); + }); + Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset2) { + offset2 = offset2 >>> 0; + validateNumber(offset2, "offset"); + const first = this[offset2]; + const last = this[offset2 + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset2, this.length - 8); + } + const val = (first << 24) + // Overflow + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 8 + this[++offset2]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset2] * 2 ** 24 + this[++offset2] * 2 ** 16 + this[++offset2] * 2 ** 8 + last); + }); + Buffer2.prototype.readFloatLE = function readFloatLE(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 4, this.length); + return ieee754$1.read(this, offset2, true, 23, 4); + }; + Buffer2.prototype.readFloatBE = function readFloatBE(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 4, this.length); + return ieee754$1.read(this, offset2, false, 23, 4); + }; + Buffer2.prototype.readDoubleLE = function readDoubleLE(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 8, this.length); + return ieee754$1.read(this, offset2, true, 52, 8); + }; + Buffer2.prototype.readDoubleBE = function readDoubleBE(offset2, noAssert) { + offset2 = offset2 >>> 0; + if (!noAssert) + checkOffset(offset2, 8, this.length); + return ieee754$1.read(this, offset2, false, 52, 8); + }; + function checkInt(buf, value, offset2, ext, max, min) { + if (!Buffer2.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) + throw new RangeError('"value" argument is out of bounds'); + if (offset2 + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset2, byteLength3, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + byteLength3 = byteLength3 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength3) - 1; + checkInt(this, value, offset2, byteLength3, maxBytes, 0); + } + let mul6 = 1; + let i2 = 0; + this[offset2] = value & 255; + while (++i2 < byteLength3 && (mul6 *= 256)) { + this[offset2 + i2] = value / mul6 & 255; + } + return offset2 + byteLength3; + }; + Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset2, byteLength3, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + byteLength3 = byteLength3 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength3) - 1; + checkInt(this, value, offset2, byteLength3, maxBytes, 0); + } + let i2 = byteLength3 - 1; + let mul6 = 1; + this[offset2 + i2] = value & 255; + while (--i2 >= 0 && (mul6 *= 256)) { + this[offset2 + i2] = value / mul6 & 255; + } + return offset2 + byteLength3; + }; + Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 1, 255, 0); + this[offset2] = value & 255; + return offset2 + 1; + }; + Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 2, 65535, 0); + this[offset2] = value & 255; + this[offset2 + 1] = value >>> 8; + return offset2 + 2; + }; + Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 2, 65535, 0); + this[offset2] = value >>> 8; + this[offset2 + 1] = value & 255; + return offset2 + 2; + }; + Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 4, 4294967295, 0); + this[offset2 + 3] = value >>> 24; + this[offset2 + 2] = value >>> 16; + this[offset2 + 1] = value >>> 8; + this[offset2] = value & 255; + return offset2 + 4; + }; + Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 4, 4294967295, 0); + this[offset2] = value >>> 24; + this[offset2 + 1] = value >>> 16; + this[offset2 + 2] = value >>> 8; + this[offset2 + 3] = value & 255; + return offset2 + 4; + }; + function wrtBigUInt64LE(buf, value, offset2, min, max) { + checkIntBI(value, min, max, buf, offset2, 7); + let lo2 = Number(value & BigInt(4294967295)); + buf[offset2++] = lo2; + lo2 = lo2 >> 8; + buf[offset2++] = lo2; + lo2 = lo2 >> 8; + buf[offset2++] = lo2; + lo2 = lo2 >> 8; + buf[offset2++] = lo2; + let hi2 = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset2++] = hi2; + hi2 = hi2 >> 8; + buf[offset2++] = hi2; + hi2 = hi2 >> 8; + buf[offset2++] = hi2; + hi2 = hi2 >> 8; + buf[offset2++] = hi2; + return offset2; + } + function wrtBigUInt64BE(buf, value, offset2, min, max) { + checkIntBI(value, min, max, buf, offset2, 7); + let lo2 = Number(value & BigInt(4294967295)); + buf[offset2 + 7] = lo2; + lo2 = lo2 >> 8; + buf[offset2 + 6] = lo2; + lo2 = lo2 >> 8; + buf[offset2 + 5] = lo2; + lo2 = lo2 >> 8; + buf[offset2 + 4] = lo2; + let hi2 = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset2 + 3] = hi2; + hi2 = hi2 >> 8; + buf[offset2 + 2] = hi2; + hi2 = hi2 >> 8; + buf[offset2 + 1] = hi2; + hi2 = hi2 >> 8; + buf[offset2] = hi2; + return offset2 + 8; + } + Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset2 = 0) { + return wrtBigUInt64LE(this, value, offset2, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset2 = 0) { + return wrtBigUInt64BE(this, value, offset2, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeIntLE = function writeIntLE(value, offset2, byteLength3, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength3 - 1); + checkInt(this, value, offset2, byteLength3, limit - 1, -limit); + } + let i2 = 0; + let mul6 = 1; + let sub = 0; + this[offset2] = value & 255; + while (++i2 < byteLength3 && (mul6 *= 256)) { + if (value < 0 && sub === 0 && this[offset2 + i2 - 1] !== 0) { + sub = 1; + } + this[offset2 + i2] = (value / mul6 >> 0) - sub & 255; + } + return offset2 + byteLength3; + }; + Buffer2.prototype.writeIntBE = function writeIntBE(value, offset2, byteLength3, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength3 - 1); + checkInt(this, value, offset2, byteLength3, limit - 1, -limit); + } + let i2 = byteLength3 - 1; + let mul6 = 1; + let sub = 0; + this[offset2 + i2] = value & 255; + while (--i2 >= 0 && (mul6 *= 256)) { + if (value < 0 && sub === 0 && this[offset2 + i2 + 1] !== 0) { + sub = 1; + } + this[offset2 + i2] = (value / mul6 >> 0) - sub & 255; + } + return offset2 + byteLength3; + }; + Buffer2.prototype.writeInt8 = function writeInt8(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 1, 127, -128); + if (value < 0) + value = 255 + value + 1; + this[offset2] = value & 255; + return offset2 + 1; + }; + Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 2, 32767, -32768); + this[offset2] = value & 255; + this[offset2 + 1] = value >>> 8; + return offset2 + 2; + }; + Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 2, 32767, -32768); + this[offset2] = value >>> 8; + this[offset2 + 1] = value & 255; + return offset2 + 2; + }; + Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 4, 2147483647, -2147483648); + this[offset2] = value & 255; + this[offset2 + 1] = value >>> 8; + this[offset2 + 2] = value >>> 16; + this[offset2 + 3] = value >>> 24; + return offset2 + 4; + }; + Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset2, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) + checkInt(this, value, offset2, 4, 2147483647, -2147483648); + if (value < 0) + value = 4294967295 + value + 1; + this[offset2] = value >>> 24; + this[offset2 + 1] = value >>> 16; + this[offset2 + 2] = value >>> 8; + this[offset2 + 3] = value & 255; + return offset2 + 4; + }; + Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset2 = 0) { + return wrtBigUInt64LE(this, value, offset2, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset2 = 0) { + return wrtBigUInt64BE(this, value, offset2, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value, offset2, ext, max, min) { + if (offset2 + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset2 < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset2, littleEndian, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset2, 4); + } + ieee754$1.write(buf, value, offset2, littleEndian, 23, 4); + return offset2 + 4; + } + Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset2, noAssert) { + return writeFloat(this, value, offset2, true, noAssert); + }; + Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset2, noAssert) { + return writeFloat(this, value, offset2, false, noAssert); + }; + function writeDouble(buf, value, offset2, littleEndian, noAssert) { + value = +value; + offset2 = offset2 >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset2, 8); + } + ieee754$1.write(buf, value, offset2, littleEndian, 52, 8); + return offset2 + 8; + } + Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset2, noAssert) { + return writeDouble(this, value, offset2, true, noAssert); + }; + Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset2, noAssert) { + return writeDouble(this, value, offset2, false, noAssert); + }; + Buffer2.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer2.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ); + } + return len; + }; + Buffer2.prototype.fill = function fill(val, start, end, encoding2) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding2 = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding2 = end; + end = this.length; + } + if (encoding2 !== void 0 && typeof encoding2 !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding2 === "string" && !Buffer2.isEncoding(encoding2)) { + throw new TypeError("Unknown encoding: " + encoding2); + } + if (val.length === 1) { + const code2 = val.charCodeAt(0); + if (encoding2 === "utf8" && code2 < 128 || encoding2 === "latin1") { + val = code2; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i2; + if (typeof val === "number") { + for (i2 = start; i2 < end; ++i2) { + this[i2] = val; + } + } else { + const bytes2 = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding2); + const len = bytes2.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i2 = 0; i2 < end - start; ++i2) { + this[i2 + start] = bytes2[i2 % len]; + } + } + return this; + }; + const errors = {}; + function E2(sym, getMessage, Base2) { + errors[sym] = class NodeError extends Base2 { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E2( + "ERR_BUFFER_OUT_OF_BOUNDS", + function(name2) { + if (name2) { + return `${name2} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, + RangeError + ); + E2( + "ERR_INVALID_ARG_TYPE", + function(name2, actual) { + return `The "${name2}" argument must be of type number. Received type ${typeof actual}`; + }, + TypeError + ); + E2( + "ERR_OUT_OF_RANGE", + function(str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range}. Received ${received}`; + return msg; + }, + RangeError + ); + function addNumericalSeparator(val) { + let res = ""; + let i2 = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i2 >= start + 4; i2 -= 3) { + res = `_${val.slice(i2 - 3, i2)}${res}`; + } + return `${val.slice(0, i2)}${res}`; + } + function checkBounds(buf, offset2, byteLength3) { + validateNumber(offset2, "offset"); + if (buf[offset2] === void 0 || buf[offset2 + byteLength3] === void 0) { + boundsError(offset2, buf.length - (byteLength3 + 1)); + } + } + function checkIntBI(value, min, max, buf, offset2, byteLength3) { + if (value > max || value < min) { + const n5 = typeof min === "bigint" ? "n" : ""; + let range; + if (byteLength3 > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n5} and < 2${n5} ** ${(byteLength3 + 1) * 8}${n5}`; + } else { + range = `>= -(2${n5} ** ${(byteLength3 + 1) * 8 - 1}${n5}) and < 2 ** ${(byteLength3 + 1) * 8 - 1}${n5}`; + } + } else { + range = `>= ${min}${n5} and <= ${max}${n5}`; + } + throw new errors.ERR_OUT_OF_RANGE("value", range, value); + } + checkBounds(buf, offset2, byteLength3); + } + function validateNumber(value, name2) { + if (typeof value !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name2, "number", value); + } + } + function boundsError(value, length, type2) { + if (Math.floor(value) !== value) { + validateNumber(value, type2); + throw new errors.ERR_OUT_OF_RANGE(type2 || "offset", "an integer", value); + } + if (length < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE( + type2 || "offset", + `>= ${type2 ? 1 : 0} and <= ${length}`, + value + ); + } + const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) + return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes2(string2, units) { + units = units || Infinity; + let codePoint; + const length = string2.length; + let leadSurrogate = null; + const bytes2 = []; + for (let i2 = 0; i2 < length; ++i2) { + codePoint = string2.charCodeAt(i2); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes2.push(239, 191, 189); + continue; + } else if (i2 + 1 === length) { + if ((units -= 3) > -1) + bytes2.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes2.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes2.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes2.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes2.push( + codePoint >> 6 | 192, + codePoint & 63 | 128 + ); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes2.push( + codePoint >> 12 | 224, + codePoint >> 6 & 63 | 128, + codePoint & 63 | 128 + ); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes2.push( + codePoint >> 18 | 240, + codePoint >> 12 & 63 | 128, + codePoint >> 6 & 63 | 128, + codePoint & 63 | 128 + ); + } else { + throw new Error("Invalid code point"); + } + } + return bytes2; + } + function asciiToBytes(str) { + const byteArray = []; + for (let i2 = 0; i2 < str.length; ++i2) { + byteArray.push(str.charCodeAt(i2) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + let c2, hi2, lo2; + const byteArray = []; + for (let i2 = 0; i2 < str.length; ++i2) { + if ((units -= 2) < 0) + break; + c2 = str.charCodeAt(i2); + hi2 = c2 >> 8; + lo2 = c2 % 256; + byteArray.push(lo2); + byteArray.push(hi2); + } + return byteArray; + } + function base64ToBytes(str) { + return base642.toByteArray(base64clean(str)); + } + function blitBuffer(src2, dst, offset2, length) { + let i2; + for (i2 = 0; i2 < length; ++i2) { + if (i2 + offset2 >= dst.length || i2 >= src2.length) + break; + dst[i2 + offset2] = src2[i2]; + } + return i2; + } + function isInstance(obj, type2) { + return obj instanceof type2 || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type2.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + const hexSliceLookupTable = function() { + const alphabet2 = "0123456789abcdef"; + const table = new Array(256); + for (let i2 = 0; i2 < 16; ++i2) { + const i16 = i2 * 16; + for (let j2 = 0; j2 < 16; ++j2) { + table[i16 + j2] = alphabet2[i2] + alphabet2[j2]; + } + } + return table; + }(); + function defineBigIntMethod(fn2) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn2; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } +})(buffer); +function number$2(n5) { + if (!Number.isSafeInteger(n5) || n5 < 0) + throw new Error(`positive integer expected, not ${n5}`); +} +function isBytes$1(a3) { + return a3 instanceof Uint8Array || a3 != null && typeof a3 === "object" && a3.constructor.name === "Uint8Array"; +} +function bytes$2(b2, ...lengths) { + if (!isBytes$1(b2)) + throw new Error("Uint8Array expected"); + if (lengths.length > 0 && !lengths.includes(b2.length)) + throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b2.length}`); +} +function hash$1(h4) { + if (typeof h4 !== "function" || typeof h4.create !== "function") + throw new Error("Hash should be wrapped by utils.wrapConstructor"); + number$2(h4.outputLen); + number$2(h4.blockLen); +} +function exists$1(instance2, checkFinished = true) { + if (instance2.destroyed) + throw new Error("Hash instance has been destroyed"); + if (checkFinished && instance2.finished) + throw new Error("Hash#digest() has already been called"); +} +function output$1(out, instance2) { + bytes$2(out); + const min = instance2.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } +} +const crypto$4 = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const createView$1 = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +const rotr$1 = (word, shift) => word << 32 - shift | word >>> shift; +new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; +function utf8ToBytes$3(str) { + if (typeof str !== "string") + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); +} +function toBytes$1(data) { + if (typeof data === "string") + data = utf8ToBytes$3(data); + bytes$2(data); + return data; +} +function concatBytes$3(...arrays) { + let sum = 0; + for (let i2 = 0; i2 < arrays.length; i2++) { + const a3 = arrays[i2]; + bytes$2(a3); + sum += a3.length; + } + const res = new Uint8Array(sum); + for (let i2 = 0, pad3 = 0; i2 < arrays.length; i2++) { + const a3 = arrays[i2]; + res.set(a3, pad3); + pad3 += a3.length; + } + return res; +} +let Hash$1 = class Hash2 { + // Safe version that clones internal state + clone() { + return this._cloneInto(); + } +}; +function wrapConstructor$1(hashCons) { + const hashC = (msg) => hashCons().update(toBytes$1(msg)).digest(); + const tmp = hashCons(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashCons(); + return hashC; +} +function randomBytes$3(bytesLength = 32) { + if (crypto$4 && typeof crypto$4.getRandomValues === "function") { + return crypto$4.getRandomValues(new Uint8Array(bytesLength)); + } + throw new Error("crypto.getRandomValues must be defined"); +} +function setBigUint64$1(view, byteOffset, value, isLE2) { + if (typeof view.setBigUint64 === "function") + return view.setBigUint64(byteOffset, value, isLE2); + const _32n2 = BigInt(32); + const _u32_max = BigInt(4294967295); + const wh2 = Number(value >> _32n2 & _u32_max); + const wl = Number(value & _u32_max); + const h4 = isLE2 ? 4 : 0; + const l2 = isLE2 ? 0 : 4; + view.setUint32(byteOffset + h4, wh2, isLE2); + view.setUint32(byteOffset + l2, wl, isLE2); +} +const Chi$1 = (a3, b2, c2) => a3 & b2 ^ ~a3 & c2; +const Maj$1 = (a3, b2, c2) => a3 & b2 ^ a3 & c2 ^ b2 & c2; +class HashMD extends Hash$1 { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = createView$1(this.buffer); + } + update(data) { + exists$1(this); + const { view, buffer: buffer2, blockLen } = this; + data = toBytes$1(data); + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + if (take === blockLen) { + const dataView = createView$1(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer2.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + exists$1(this); + output$1(out, this); + this.finished = true; + const { buffer: buffer2, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer2[pos++] = 128; + this.buffer.subarray(pos).fill(0); + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + for (let i2 = pos; i2 < blockLen; i2++) + buffer2[i2] = 0; + setBigUint64$1(view, blockLen - 8, BigInt(this.length * 8), isLE2); + this.process(view, 0); + const oview = createView$1(out); + const len = this.outputLen; + if (len % 4) + throw new Error("_sha2: outputLen should be aligned to 32bit"); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error("_sha2: outputLen bigger than state"); + for (let i2 = 0; i2 < outLen; i2++) + oview.setUint32(4 * i2, state[i2], isLE2); + } + digest() { + const { buffer: buffer2, outputLen } = this; + this.digestInto(buffer2); + const res = buffer2.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to2) { + to2 || (to2 = new this.constructor()); + to2.set(...this.get()); + const { blockLen, buffer: buffer2, length, finished: finished2, destroyed, pos } = this; + to2.length = length; + to2.pos = pos; + to2.finished = finished2; + to2.destroyed = destroyed; + if (length % blockLen) + to2.buffer.set(buffer2); + return to2; + } +} +const U32_MASK64$1 = /* @__PURE__ */ BigInt(2 ** 32 - 1); +const _32n$1 = /* @__PURE__ */ BigInt(32); +function fromBig$1(n5, le2 = false) { + if (le2) + return { h: Number(n5 & U32_MASK64$1), l: Number(n5 >> _32n$1 & U32_MASK64$1) }; + return { h: Number(n5 >> _32n$1 & U32_MASK64$1) | 0, l: Number(n5 & U32_MASK64$1) | 0 }; +} +function split$1(lst, le2 = false) { + let Ah2 = new Uint32Array(lst.length); + let Al = new Uint32Array(lst.length); + for (let i2 = 0; i2 < lst.length; i2++) { + const { h: h4, l: l2 } = fromBig$1(lst[i2], le2); + [Ah2[i2], Al[i2]] = [h4, l2]; + } + return [Ah2, Al]; +} +const toBig$1 = (h4, l2) => BigInt(h4 >>> 0) << _32n$1 | BigInt(l2 >>> 0); +const shrSH$1 = (h4, _l2, s2) => h4 >>> s2; +const shrSL$1 = (h4, l2, s2) => h4 << 32 - s2 | l2 >>> s2; +const rotrSH$1 = (h4, l2, s2) => h4 >>> s2 | l2 << 32 - s2; +const rotrSL$1 = (h4, l2, s2) => h4 << 32 - s2 | l2 >>> s2; +const rotrBH$1 = (h4, l2, s2) => h4 << 64 - s2 | l2 >>> s2 - 32; +const rotrBL$1 = (h4, l2, s2) => h4 >>> s2 - 32 | l2 << 64 - s2; +const rotr32H$1 = (_h3, l2) => l2; +const rotr32L$1 = (h4, _l2) => h4; +const rotlSH$1 = (h4, l2, s2) => h4 << s2 | l2 >>> 32 - s2; +const rotlSL$1 = (h4, l2, s2) => l2 << s2 | h4 >>> 32 - s2; +const rotlBH$1 = (h4, l2, s2) => l2 << s2 - 32 | h4 >>> 64 - s2; +const rotlBL$1 = (h4, l2, s2) => h4 << s2 - 32 | l2 >>> 64 - s2; +function add$1(Ah2, Al, Bh2, Bl) { + const l2 = (Al >>> 0) + (Bl >>> 0); + return { h: Ah2 + Bh2 + (l2 / 2 ** 32 | 0) | 0, l: l2 | 0 }; +} +const add3L$1 = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); +const add3H$1 = (low, Ah2, Bh2, Ch2) => Ah2 + Bh2 + Ch2 + (low / 2 ** 32 | 0) | 0; +const add4L$1 = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); +const add4H$1 = (low, Ah2, Bh2, Ch2, Dh2) => Ah2 + Bh2 + Ch2 + Dh2 + (low / 2 ** 32 | 0) | 0; +const add5L$1 = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); +const add5H$1 = (low, Ah2, Bh2, Ch2, Dh2, Eh2) => Ah2 + Bh2 + Ch2 + Dh2 + Eh2 + (low / 2 ** 32 | 0) | 0; +const u64$3 = { + fromBig: fromBig$1, + split: split$1, + toBig: toBig$1, + shrSH: shrSH$1, + shrSL: shrSL$1, + rotrSH: rotrSH$1, + rotrSL: rotrSL$1, + rotrBH: rotrBH$1, + rotrBL: rotrBL$1, + rotr32H: rotr32H$1, + rotr32L: rotr32L$1, + rotlSH: rotlSH$1, + rotlSL: rotlSL$1, + rotlBH: rotlBH$1, + rotlBL: rotlBL$1, + add: add$1, + add3L: add3L$1, + add3H: add3H$1, + add4L: add4L$1, + add4H: add4H$1, + add5H: add5H$1, + add5L: add5L$1 +}; +const u64$4 = u64$3; +const [SHA512_Kh$1, SHA512_Kl$1] = /* @__PURE__ */ (() => u64$4.split([ + "0x428a2f98d728ae22", + "0x7137449123ef65cd", + "0xb5c0fbcfec4d3b2f", + "0xe9b5dba58189dbbc", + "0x3956c25bf348b538", + "0x59f111f1b605d019", + "0x923f82a4af194f9b", + "0xab1c5ed5da6d8118", + "0xd807aa98a3030242", + "0x12835b0145706fbe", + "0x243185be4ee4b28c", + "0x550c7dc3d5ffb4e2", + "0x72be5d74f27b896f", + "0x80deb1fe3b1696b1", + "0x9bdc06a725c71235", + "0xc19bf174cf692694", + "0xe49b69c19ef14ad2", + "0xefbe4786384f25e3", + "0x0fc19dc68b8cd5b5", + "0x240ca1cc77ac9c65", + "0x2de92c6f592b0275", + "0x4a7484aa6ea6e483", + "0x5cb0a9dcbd41fbd4", + "0x76f988da831153b5", + "0x983e5152ee66dfab", + "0xa831c66d2db43210", + "0xb00327c898fb213f", + "0xbf597fc7beef0ee4", + "0xc6e00bf33da88fc2", + "0xd5a79147930aa725", + "0x06ca6351e003826f", + "0x142929670a0e6e70", + "0x27b70a8546d22ffc", + "0x2e1b21385c26c926", + "0x4d2c6dfc5ac42aed", + "0x53380d139d95b3df", + "0x650a73548baf63de", + "0x766a0abb3c77b2a8", + "0x81c2c92e47edaee6", + "0x92722c851482353b", + "0xa2bfe8a14cf10364", + "0xa81a664bbc423001", + "0xc24b8b70d0f89791", + "0xc76c51a30654be30", + "0xd192e819d6ef5218", + "0xd69906245565a910", + "0xf40e35855771202a", + "0x106aa07032bbd1b8", + "0x19a4c116b8d2d0c8", + "0x1e376c085141ab53", + "0x2748774cdf8eeb99", + "0x34b0bcb5e19b48a8", + "0x391c0cb3c5c95a63", + "0x4ed8aa4ae3418acb", + "0x5b9cca4f7763e373", + "0x682e6ff3d6b2b8a3", + "0x748f82ee5defb2fc", + "0x78a5636f43172f60", + "0x84c87814a1f0ab72", + "0x8cc702081a6439ec", + "0x90befffa23631e28", + "0xa4506cebde82bde9", + "0xbef9a3f7b2c67915", + "0xc67178f2e372532b", + "0xca273eceea26619c", + "0xd186b8c721c0c207", + "0xeada7dd6cde0eb1e", + "0xf57d4f7fee6ed178", + "0x06f067aa72176fba", + "0x0a637dc5a2c898a6", + "0x113f9804bef90dae", + "0x1b710b35131c471b", + "0x28db77f523047d84", + "0x32caab7b40c72493", + "0x3c9ebe0a15c9bebc", + "0x431d67c49c100d4c", + "0x4cc5d4becb3e42b6", + "0x597f299cfc657e2a", + "0x5fcb6fab3ad6faec", + "0x6c44198c4a475817" +].map((n5) => BigInt(n5))))(); +const SHA512_W_H$1 = /* @__PURE__ */ new Uint32Array(80); +const SHA512_W_L$1 = /* @__PURE__ */ new Uint32Array(80); +let SHA512$1 = class SHA512 extends HashMD { + constructor() { + super(128, 64, 16, false); + this.Ah = 1779033703 | 0; + this.Al = 4089235720 | 0; + this.Bh = 3144134277 | 0; + this.Bl = 2227873595 | 0; + this.Ch = 1013904242 | 0; + this.Cl = 4271175723 | 0; + this.Dh = 2773480762 | 0; + this.Dl = 1595750129 | 0; + this.Eh = 1359893119 | 0; + this.El = 2917565137 | 0; + this.Fh = 2600822924 | 0; + this.Fl = 725511199 | 0; + this.Gh = 528734635 | 0; + this.Gl = 4215389547 | 0; + this.Hh = 1541459225 | 0; + this.Hl = 327033209 | 0; + } + // prettier-ignore + get() { + const { Ah: Ah2, Al, Bh: Bh2, Bl, Ch: Ch2, Cl, Dh: Dh2, Dl, Eh: Eh2, El, Fh: Fh2, Fl, Gh: Gh2, Gl, Hh: Hh2, Hl } = this; + return [Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl]; + } + // prettier-ignore + set(Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl) { + this.Ah = Ah2 | 0; + this.Al = Al | 0; + this.Bh = Bh2 | 0; + this.Bl = Bl | 0; + this.Ch = Ch2 | 0; + this.Cl = Cl | 0; + this.Dh = Dh2 | 0; + this.Dl = Dl | 0; + this.Eh = Eh2 | 0; + this.El = El | 0; + this.Fh = Fh2 | 0; + this.Fl = Fl | 0; + this.Gh = Gh2 | 0; + this.Gl = Gl | 0; + this.Hh = Hh2 | 0; + this.Hl = Hl | 0; + } + process(view, offset2) { + for (let i2 = 0; i2 < 16; i2++, offset2 += 4) { + SHA512_W_H$1[i2] = view.getUint32(offset2); + SHA512_W_L$1[i2] = view.getUint32(offset2 += 4); + } + for (let i2 = 16; i2 < 80; i2++) { + const W15h = SHA512_W_H$1[i2 - 15] | 0; + const W15l = SHA512_W_L$1[i2 - 15] | 0; + const s0h = u64$4.rotrSH(W15h, W15l, 1) ^ u64$4.rotrSH(W15h, W15l, 8) ^ u64$4.shrSH(W15h, W15l, 7); + const s0l = u64$4.rotrSL(W15h, W15l, 1) ^ u64$4.rotrSL(W15h, W15l, 8) ^ u64$4.shrSL(W15h, W15l, 7); + const W2h = SHA512_W_H$1[i2 - 2] | 0; + const W2l = SHA512_W_L$1[i2 - 2] | 0; + const s1h = u64$4.rotrSH(W2h, W2l, 19) ^ u64$4.rotrBH(W2h, W2l, 61) ^ u64$4.shrSH(W2h, W2l, 6); + const s1l = u64$4.rotrSL(W2h, W2l, 19) ^ u64$4.rotrBL(W2h, W2l, 61) ^ u64$4.shrSL(W2h, W2l, 6); + const SUMl = u64$4.add4L(s0l, s1l, SHA512_W_L$1[i2 - 7], SHA512_W_L$1[i2 - 16]); + const SUMh = u64$4.add4H(SUMl, s0h, s1h, SHA512_W_H$1[i2 - 7], SHA512_W_H$1[i2 - 16]); + SHA512_W_H$1[i2] = SUMh | 0; + SHA512_W_L$1[i2] = SUMl | 0; + } + let { Ah: Ah2, Al, Bh: Bh2, Bl, Ch: Ch2, Cl, Dh: Dh2, Dl, Eh: Eh2, El, Fh: Fh2, Fl, Gh: Gh2, Gl, Hh: Hh2, Hl } = this; + for (let i2 = 0; i2 < 80; i2++) { + const sigma1h = u64$4.rotrSH(Eh2, El, 14) ^ u64$4.rotrSH(Eh2, El, 18) ^ u64$4.rotrBH(Eh2, El, 41); + const sigma1l = u64$4.rotrSL(Eh2, El, 14) ^ u64$4.rotrSL(Eh2, El, 18) ^ u64$4.rotrBL(Eh2, El, 41); + const CHIh = Eh2 & Fh2 ^ ~Eh2 & Gh2; + const CHIl = El & Fl ^ ~El & Gl; + const T1ll = u64$4.add5L(Hl, sigma1l, CHIl, SHA512_Kl$1[i2], SHA512_W_L$1[i2]); + const T1h = u64$4.add5H(T1ll, Hh2, sigma1h, CHIh, SHA512_Kh$1[i2], SHA512_W_H$1[i2]); + const T1l = T1ll | 0; + const sigma0h = u64$4.rotrSH(Ah2, Al, 28) ^ u64$4.rotrBH(Ah2, Al, 34) ^ u64$4.rotrBH(Ah2, Al, 39); + const sigma0l = u64$4.rotrSL(Ah2, Al, 28) ^ u64$4.rotrBL(Ah2, Al, 34) ^ u64$4.rotrBL(Ah2, Al, 39); + const MAJh = Ah2 & Bh2 ^ Ah2 & Ch2 ^ Bh2 & Ch2; + const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; + Hh2 = Gh2 | 0; + Hl = Gl | 0; + Gh2 = Fh2 | 0; + Gl = Fl | 0; + Fh2 = Eh2 | 0; + Fl = El | 0; + ({ h: Eh2, l: El } = u64$4.add(Dh2 | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh2 = Ch2 | 0; + Dl = Cl | 0; + Ch2 = Bh2 | 0; + Cl = Bl | 0; + Bh2 = Ah2 | 0; + Bl = Al | 0; + const All = u64$4.add3L(T1l, sigma0l, MAJl); + Ah2 = u64$4.add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + ({ h: Ah2, l: Al } = u64$4.add(this.Ah | 0, this.Al | 0, Ah2 | 0, Al | 0)); + ({ h: Bh2, l: Bl } = u64$4.add(this.Bh | 0, this.Bl | 0, Bh2 | 0, Bl | 0)); + ({ h: Ch2, l: Cl } = u64$4.add(this.Ch | 0, this.Cl | 0, Ch2 | 0, Cl | 0)); + ({ h: Dh2, l: Dl } = u64$4.add(this.Dh | 0, this.Dl | 0, Dh2 | 0, Dl | 0)); + ({ h: Eh2, l: El } = u64$4.add(this.Eh | 0, this.El | 0, Eh2 | 0, El | 0)); + ({ h: Fh2, l: Fl } = u64$4.add(this.Fh | 0, this.Fl | 0, Fh2 | 0, Fl | 0)); + ({ h: Gh2, l: Gl } = u64$4.add(this.Gh | 0, this.Gl | 0, Gh2 | 0, Gl | 0)); + ({ h: Hh2, l: Hl } = u64$4.add(this.Hh | 0, this.Hl | 0, Hh2 | 0, Hl | 0)); + this.set(Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl); + } + roundClean() { + SHA512_W_H$1.fill(0); + SHA512_W_L$1.fill(0); + } + destroy() { + this.buffer.fill(0); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } +}; +const sha512$1 = /* @__PURE__ */ wrapConstructor$1(() => new SHA512$1()); +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const _0n$9 = /* @__PURE__ */ BigInt(0); +const _1n$c = /* @__PURE__ */ BigInt(1); +const _2n$8 = /* @__PURE__ */ BigInt(2); +function isBytes(a3) { + return a3 instanceof Uint8Array || a3 != null && typeof a3 === "object" && a3.constructor.name === "Uint8Array"; +} +function abytes(item) { + if (!isBytes(item)) + throw new Error("Uint8Array expected"); +} +const hexes$1 = /* @__PURE__ */ Array.from({ length: 256 }, (_3, i2) => i2.toString(16).padStart(2, "0")); +function bytesToHex$1(bytes2) { + abytes(bytes2); + let hex = ""; + for (let i2 = 0; i2 < bytes2.length; i2++) { + hex += hexes$1[bytes2[i2]]; + } + return hex; +} +function numberToHexUnpadded$1(num) { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; +} +function hexToNumber$1(hex) { + if (typeof hex !== "string") + throw new Error("hex string expected, got " + typeof hex); + return BigInt(hex === "" ? "0" : `0x${hex}`); +} +const asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 }; +function asciiToBase16(char) { + if (char >= asciis._0 && char <= asciis._9) + return char - asciis._0; + if (char >= asciis._A && char <= asciis._F) + return char - (asciis._A - 10); + if (char >= asciis._a && char <= asciis._f) + return char - (asciis._a - 10); + return; +} +function hexToBytes$1(hex) { + if (typeof hex !== "string") + throw new Error("hex string expected, got " + typeof hex); + const hl2 = hex.length; + const al2 = hl2 / 2; + if (hl2 % 2) + throw new Error("padded hex string expected, got unpadded hex of length " + hl2); + const array2 = new Uint8Array(al2); + for (let ai2 = 0, hi2 = 0; ai2 < al2; ai2++, hi2 += 2) { + const n1 = asciiToBase16(hex.charCodeAt(hi2)); + const n22 = asciiToBase16(hex.charCodeAt(hi2 + 1)); + if (n1 === void 0 || n22 === void 0) { + const char = hex[hi2] + hex[hi2 + 1]; + throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi2); + } + array2[ai2] = n1 * 16 + n22; + } + return array2; +} +function bytesToNumberBE$1(bytes2) { + return hexToNumber$1(bytesToHex$1(bytes2)); +} +function bytesToNumberLE$1(bytes2) { + abytes(bytes2); + return hexToNumber$1(bytesToHex$1(Uint8Array.from(bytes2).reverse())); +} +function numberToBytesBE$1(n5, len) { + return hexToBytes$1(n5.toString(16).padStart(len * 2, "0")); +} +function numberToBytesLE$1(n5, len) { + return numberToBytesBE$1(n5, len).reverse(); +} +function numberToVarBytesBE$1(n5) { + return hexToBytes$1(numberToHexUnpadded$1(n5)); +} +function ensureBytes$1(title, hex, expectedLength) { + let res; + if (typeof hex === "string") { + try { + res = hexToBytes$1(hex); + } catch (e18) { + throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e18}`); + } + } else if (isBytes(hex)) { + res = Uint8Array.from(hex); + } else { + throw new Error(`${title} must be hex string or Uint8Array`); + } + const len = res.length; + if (typeof expectedLength === "number" && len !== expectedLength) + throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); + return res; +} +function concatBytes$2(...arrays) { + let sum = 0; + for (let i2 = 0; i2 < arrays.length; i2++) { + const a3 = arrays[i2]; + abytes(a3); + sum += a3.length; + } + const res = new Uint8Array(sum); + for (let i2 = 0, pad3 = 0; i2 < arrays.length; i2++) { + const a3 = arrays[i2]; + res.set(a3, pad3); + pad3 += a3.length; + } + return res; +} +function equalBytes$1(a3, b2) { + if (a3.length !== b2.length) + return false; + let diff = 0; + for (let i2 = 0; i2 < a3.length; i2++) + diff |= a3[i2] ^ b2[i2]; + return diff === 0; +} +function utf8ToBytes$2(str) { + if (typeof str !== "string") + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); +} +function bitLen$1(n5) { + let len; + for (len = 0; n5 > _0n$9; n5 >>= _1n$c, len += 1) + ; + return len; +} +function bitGet$1(n5, pos) { + return n5 >> BigInt(pos) & _1n$c; +} +function bitSet$1(n5, pos, value) { + return n5 | (value ? _1n$c : _0n$9) << BigInt(pos); +} +const bitMask$1 = (n5) => (_2n$8 << BigInt(n5 - 1)) - _1n$c; +const u8n$1 = (data) => new Uint8Array(data); +const u8fr$1 = (arr) => Uint8Array.from(arr); +function createHmacDrbg$1(hashLen, qByteLen, hmacFn) { + if (typeof hashLen !== "number" || hashLen < 2) + throw new Error("hashLen must be a number"); + if (typeof qByteLen !== "number" || qByteLen < 2) + throw new Error("qByteLen must be a number"); + if (typeof hmacFn !== "function") + throw new Error("hmacFn must be a function"); + let v6 = u8n$1(hashLen); + let k2 = u8n$1(hashLen); + let i2 = 0; + const reset = () => { + v6.fill(1); + k2.fill(0); + i2 = 0; + }; + const h4 = (...b2) => hmacFn(k2, v6, ...b2); + const reseed2 = (seed = u8n$1()) => { + k2 = h4(u8fr$1([0]), seed); + v6 = h4(); + if (seed.length === 0) + return; + k2 = h4(u8fr$1([1]), seed); + v6 = h4(); + }; + const gen2 = () => { + if (i2++ >= 1e3) + throw new Error("drbg: tried 1000 values"); + let len = 0; + const out = []; + while (len < qByteLen) { + v6 = h4(); + const sl2 = v6.slice(); + out.push(sl2); + len += v6.length; + } + return concatBytes$2(...out); + }; + const genUntil = (seed, pred) => { + reset(); + reseed2(seed); + let res = void 0; + while (!(res = pred(gen2()))) + reseed2(); + reset(); + return res; + }; + return genUntil; +} +const validatorFns$1 = { + bigint: (val) => typeof val === "bigint", + function: (val) => typeof val === "function", + boolean: (val) => typeof val === "boolean", + string: (val) => typeof val === "string", + stringOrUint8Array: (val) => typeof val === "string" || isBytes(val), + isSafeInteger: (val) => Number.isSafeInteger(val), + array: (val) => Array.isArray(val), + field: (val, object) => object.Fp.isValid(val), + hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen) +}; +function validateObject$1(object, validators2, optValidators = {}) { + const checkField = (fieldName, type2, isOptional) => { + const checkVal = validatorFns$1[type2]; + if (typeof checkVal !== "function") + throw new Error(`Invalid validator "${type2}", expected function`); + const val = object[fieldName]; + if (isOptional && val === void 0) + return; + if (!checkVal(val, object)) { + throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type2}`); + } + }; + for (const [fieldName, type2] of Object.entries(validators2)) + checkField(fieldName, type2, false); + for (const [fieldName, type2] of Object.entries(optValidators)) + checkField(fieldName, type2, true); + return object; +} +const ut$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + abytes, + bitGet: bitGet$1, + bitLen: bitLen$1, + bitMask: bitMask$1, + bitSet: bitSet$1, + bytesToHex: bytesToHex$1, + bytesToNumberBE: bytesToNumberBE$1, + bytesToNumberLE: bytesToNumberLE$1, + concatBytes: concatBytes$2, + createHmacDrbg: createHmacDrbg$1, + ensureBytes: ensureBytes$1, + equalBytes: equalBytes$1, + hexToBytes: hexToBytes$1, + hexToNumber: hexToNumber$1, + isBytes, + numberToBytesBE: numberToBytesBE$1, + numberToBytesLE: numberToBytesLE$1, + numberToHexUnpadded: numberToHexUnpadded$1, + numberToVarBytesBE: numberToVarBytesBE$1, + utf8ToBytes: utf8ToBytes$2, + validateObject: validateObject$1 +}, Symbol.toStringTag, { value: "Module" })); +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const _0n$8 = BigInt(0), _1n$b = BigInt(1), _2n$7 = BigInt(2), _3n$3 = BigInt(3); +const _4n$1 = BigInt(4), _5n$2 = BigInt(5), _8n$3 = BigInt(8); +BigInt(9); +BigInt(16); +function mod$1(a3, b2) { + const result = a3 % b2; + return result >= _0n$8 ? result : b2 + result; +} +function pow$1(num, power, modulo) { + if (modulo <= _0n$8 || power < _0n$8) + throw new Error("Expected power/modulo > 0"); + if (modulo === _1n$b) + return _0n$8; + let res = _1n$b; + while (power > _0n$8) { + if (power & _1n$b) + res = res * num % modulo; + num = num * num % modulo; + power >>= _1n$b; + } + return res; +} +function pow2$1(x3, power, modulo) { + let res = x3; + while (power-- > _0n$8) { + res *= res; + res %= modulo; + } + return res; +} +function invert$1(number2, modulo) { + if (number2 === _0n$8 || modulo <= _0n$8) { + throw new Error(`invert: expected positive integers, got n=${number2} mod=${modulo}`); + } + let a3 = mod$1(number2, modulo); + let b2 = modulo; + let x3 = _0n$8, u2 = _1n$b; + while (a3 !== _0n$8) { + const q2 = b2 / a3; + const r2 = b2 % a3; + const m3 = x3 - u2 * q2; + b2 = a3, a3 = r2, x3 = u2, u2 = m3; + } + const gcd = b2; + if (gcd !== _1n$b) + throw new Error("invert: does not exist"); + return mod$1(x3, modulo); +} +function tonelliShanks$1(P2) { + const legendreC = (P2 - _1n$b) / _2n$7; + let Q2, S4, Z2; + for (Q2 = P2 - _1n$b, S4 = 0; Q2 % _2n$7 === _0n$8; Q2 /= _2n$7, S4++) + ; + for (Z2 = _2n$7; Z2 < P2 && pow$1(Z2, legendreC, P2) !== P2 - _1n$b; Z2++) + ; + if (S4 === 1) { + const p1div4 = (P2 + _1n$b) / _4n$1; + return function tonelliFast(Fp2, n5) { + const root = Fp2.pow(n5, p1div4); + if (!Fp2.eql(Fp2.sqr(root), n5)) + throw new Error("Cannot find square root"); + return root; + }; + } + const Q1div2 = (Q2 + _1n$b) / _2n$7; + return function tonelliSlow(Fp2, n5) { + if (Fp2.pow(n5, legendreC) === Fp2.neg(Fp2.ONE)) + throw new Error("Cannot find square root"); + let r2 = S4; + let g3 = Fp2.pow(Fp2.mul(Fp2.ONE, Z2), Q2); + let x3 = Fp2.pow(n5, Q1div2); + let b2 = Fp2.pow(n5, Q2); + while (!Fp2.eql(b2, Fp2.ONE)) { + if (Fp2.eql(b2, Fp2.ZERO)) + return Fp2.ZERO; + let m3 = 1; + for (let t2 = Fp2.sqr(b2); m3 < r2; m3++) { + if (Fp2.eql(t2, Fp2.ONE)) + break; + t2 = Fp2.sqr(t2); + } + const ge2 = Fp2.pow(g3, _1n$b << BigInt(r2 - m3 - 1)); + g3 = Fp2.sqr(ge2); + x3 = Fp2.mul(x3, ge2); + b2 = Fp2.mul(b2, g3); + r2 = m3; + } + return x3; + }; +} +function FpSqrt$1(P2) { + if (P2 % _4n$1 === _3n$3) { + const p1div4 = (P2 + _1n$b) / _4n$1; + return function sqrt3mod4(Fp2, n5) { + const root = Fp2.pow(n5, p1div4); + if (!Fp2.eql(Fp2.sqr(root), n5)) + throw new Error("Cannot find square root"); + return root; + }; + } + if (P2 % _8n$3 === _5n$2) { + const c1 = (P2 - _5n$2) / _8n$3; + return function sqrt5mod8(Fp2, n5) { + const n22 = Fp2.mul(n5, _2n$7); + const v6 = Fp2.pow(n22, c1); + const nv2 = Fp2.mul(n5, v6); + const i2 = Fp2.mul(Fp2.mul(nv2, _2n$7), v6); + const root = Fp2.mul(nv2, Fp2.sub(i2, Fp2.ONE)); + if (!Fp2.eql(Fp2.sqr(root), n5)) + throw new Error("Cannot find square root"); + return root; + }; + } + return tonelliShanks$1(P2); +} +const isNegativeLE = (num, modulo) => (mod$1(num, modulo) & _1n$b) === _1n$b; +const FIELD_FIELDS$1 = [ + "create", + "isValid", + "is0", + "neg", + "inv", + "sqrt", + "sqr", + "eql", + "add", + "sub", + "mul", + "pow", + "div", + "addN", + "subN", + "mulN", + "sqrN" +]; +function validateField$1(field) { + const initial = { + ORDER: "bigint", + MASK: "bigint", + BYTES: "isSafeInteger", + BITS: "isSafeInteger" + }; + const opts = FIELD_FIELDS$1.reduce((map, val) => { + map[val] = "function"; + return map; + }, initial); + return validateObject$1(field, opts); +} +function FpPow$1(f4, num, power) { + if (power < _0n$8) + throw new Error("Expected power > 0"); + if (power === _0n$8) + return f4.ONE; + if (power === _1n$b) + return num; + let p3 = f4.ONE; + let d4 = num; + while (power > _0n$8) { + if (power & _1n$b) + p3 = f4.mul(p3, d4); + d4 = f4.sqr(d4); + power >>= _1n$b; + } + return p3; +} +function FpInvertBatch$1(f4, nums) { + const tmp = new Array(nums.length); + const lastMultiplied = nums.reduce((acc, num, i2) => { + if (f4.is0(num)) + return acc; + tmp[i2] = acc; + return f4.mul(acc, num); + }, f4.ONE); + const inverted = f4.inv(lastMultiplied); + nums.reduceRight((acc, num, i2) => { + if (f4.is0(num)) + return acc; + tmp[i2] = f4.mul(acc, tmp[i2]); + return f4.mul(acc, num); + }, inverted); + return tmp; +} +function nLength$1(n5, nBitLength) { + const _nBitLength = nBitLength !== void 0 ? nBitLength : n5.toString(2).length; + const nByteLength = Math.ceil(_nBitLength / 8); + return { nBitLength: _nBitLength, nByteLength }; +} +function Field$1(ORDER, bitLen2, isLE2 = false, redef = {}) { + if (ORDER <= _0n$8) + throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); + const { nBitLength: BITS, nByteLength: BYTES } = nLength$1(ORDER, bitLen2); + if (BYTES > 2048) + throw new Error("Field lengths over 2048 bytes are not supported"); + const sqrtP = FpSqrt$1(ORDER); + const f4 = Object.freeze({ + ORDER, + BITS, + BYTES, + MASK: bitMask$1(BITS), + ZERO: _0n$8, + ONE: _1n$b, + create: (num) => mod$1(num, ORDER), + isValid: (num) => { + if (typeof num !== "bigint") + throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); + return _0n$8 <= num && num < ORDER; + }, + is0: (num) => num === _0n$8, + isOdd: (num) => (num & _1n$b) === _1n$b, + neg: (num) => mod$1(-num, ORDER), + eql: (lhs, rhs) => lhs === rhs, + sqr: (num) => mod$1(num * num, ORDER), + add: (lhs, rhs) => mod$1(lhs + rhs, ORDER), + sub: (lhs, rhs) => mod$1(lhs - rhs, ORDER), + mul: (lhs, rhs) => mod$1(lhs * rhs, ORDER), + pow: (num, power) => FpPow$1(f4, num, power), + div: (lhs, rhs) => mod$1(lhs * invert$1(rhs, ORDER), ORDER), + // Same as above, but doesn't normalize + sqrN: (num) => num * num, + addN: (lhs, rhs) => lhs + rhs, + subN: (lhs, rhs) => lhs - rhs, + mulN: (lhs, rhs) => lhs * rhs, + inv: (num) => invert$1(num, ORDER), + sqrt: redef.sqrt || ((n5) => sqrtP(f4, n5)), + invertBatch: (lst) => FpInvertBatch$1(f4, lst), + // TODO: do we really need constant cmov? + // We don't have const-time bigints anyway, so probably will be not very useful + cmov: (a3, b2, c2) => c2 ? b2 : a3, + toBytes: (num) => isLE2 ? numberToBytesLE$1(num, BYTES) : numberToBytesBE$1(num, BYTES), + fromBytes: (bytes2) => { + if (bytes2.length !== BYTES) + throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes2.length}`); + return isLE2 ? bytesToNumberLE$1(bytes2) : bytesToNumberBE$1(bytes2); + } + }); + return Object.freeze(f4); +} +function getFieldBytesLength$1(fieldOrder) { + if (typeof fieldOrder !== "bigint") + throw new Error("field order must be bigint"); + const bitLength = fieldOrder.toString(2).length; + return Math.ceil(bitLength / 8); +} +function getMinHashLength$1(fieldOrder) { + const length = getFieldBytesLength$1(fieldOrder); + return length + Math.ceil(length / 2); +} +function mapHashToField$1(key2, fieldOrder, isLE2 = false) { + const len = key2.length; + const fieldLen = getFieldBytesLength$1(fieldOrder); + const minLen = getMinHashLength$1(fieldOrder); + if (len < 16 || len < minLen || len > 1024) + throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); + const num = isLE2 ? bytesToNumberBE$1(key2) : bytesToNumberLE$1(key2); + const reduced = mod$1(num, fieldOrder - _1n$b) + _1n$b; + return isLE2 ? numberToBytesLE$1(reduced, fieldLen) : numberToBytesBE$1(reduced, fieldLen); +} +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const _0n$7 = BigInt(0); +const _1n$a = BigInt(1); +function wNAF$1(c2, bits) { + const constTimeNegate = (condition, item) => { + const neg4 = item.negate(); + return condition ? neg4 : item; + }; + const opts = (W2) => { + const windows = Math.ceil(bits / W2) + 1; + const windowSize = 2 ** (W2 - 1); + return { windows, windowSize }; + }; + return { + constTimeNegate, + // non-const time multiplication ladder + unsafeLadder(elm, n5) { + let p3 = c2.ZERO; + let d4 = elm; + while (n5 > _0n$7) { + if (n5 & _1n$a) + p3 = p3.add(d4); + d4 = d4.double(); + n5 >>= _1n$a; + } + return p3; + }, + /** + * Creates a wNAF precomputation window. Used for caching. + * Default window size is set by `utils.precompute()` and is equal to 8. + * Number of precomputed points depends on the curve size: + * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: + * - 𝑊 is the window size + * - 𝑛 is the bitlength of the curve order. + * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. + * @returns precomputed point tables flattened to a single array + */ + precomputeWindow(elm, W2) { + const { windows, windowSize } = opts(W2); + const points = []; + let p3 = elm; + let base3 = p3; + for (let window2 = 0; window2 < windows; window2++) { + base3 = p3; + points.push(base3); + for (let i2 = 1; i2 < windowSize; i2++) { + base3 = base3.add(p3); + points.push(base3); + } + p3 = base3.double(); + } + return points; + }, + /** + * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. + * @param W window size + * @param precomputes precomputed tables + * @param n scalar (we don't check here, but should be less than curve order) + * @returns real and fake (for const-time) points + */ + wNAF(W2, precomputes, n5) { + const { windows, windowSize } = opts(W2); + let p3 = c2.ZERO; + let f4 = c2.BASE; + const mask2 = BigInt(2 ** W2 - 1); + const maxNumber = 2 ** W2; + const shiftBy = BigInt(W2); + for (let window2 = 0; window2 < windows; window2++) { + const offset2 = window2 * windowSize; + let wbits = Number(n5 & mask2); + n5 >>= shiftBy; + if (wbits > windowSize) { + wbits -= maxNumber; + n5 += _1n$a; + } + const offset1 = offset2; + const offset22 = offset2 + Math.abs(wbits) - 1; + const cond1 = window2 % 2 !== 0; + const cond2 = wbits < 0; + if (wbits === 0) { + f4 = f4.add(constTimeNegate(cond1, precomputes[offset1])); + } else { + p3 = p3.add(constTimeNegate(cond2, precomputes[offset22])); + } + } + return { p: p3, f: f4 }; + }, + wNAFCached(P2, precomputesMap, n5, transform) { + const W2 = P2._WINDOW_SIZE || 1; + let comp = precomputesMap.get(P2); + if (!comp) { + comp = this.precomputeWindow(P2, W2); + if (W2 !== 1) { + precomputesMap.set(P2, transform(comp)); + } + } + return this.wNAF(W2, comp, n5); + } + }; +} +function validateBasic$1(curve2) { + validateField$1(curve2.Fp); + validateObject$1(curve2, { + n: "bigint", + h: "bigint", + Gx: "field", + Gy: "field" + }, { + nBitLength: "isSafeInteger", + nByteLength: "isSafeInteger" + }); + return Object.freeze({ + ...nLength$1(curve2.n, curve2.nBitLength), + ...curve2, + ...{ p: curve2.Fp.ORDER } + }); +} +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const _0n$6 = BigInt(0), _1n$9 = BigInt(1), _2n$6 = BigInt(2), _8n$2 = BigInt(8); +const VERIFY_DEFAULT = { zip215: true }; +function validateOpts$2(curve2) { + const opts = validateBasic$1(curve2); + validateObject$1(curve2, { + hash: "function", + a: "bigint", + d: "bigint", + randomBytes: "function" + }, { + adjustScalarBytes: "function", + domain: "function", + uvRatio: "function", + mapToCurve: "function" + }); + return Object.freeze({ ...opts }); +} +function twistedEdwards(curveDef) { + const CURVE = validateOpts$2(curveDef); + const { Fp: Fp2, n: CURVE_ORDER, prehash, hash: cHash, randomBytes: randomBytes2, nByteLength, h: cofactor } = CURVE; + const MASK = _2n$6 << BigInt(nByteLength * 8) - _1n$9; + const modP = Fp2.create; + const uvRatio2 = CURVE.uvRatio || ((u2, v6) => { + try { + return { isValid: true, value: Fp2.sqrt(u2 * Fp2.inv(v6)) }; + } catch (e18) { + return { isValid: false, value: _0n$6 }; + } + }); + const adjustScalarBytes2 = CURVE.adjustScalarBytes || ((bytes2) => bytes2); + const domain = CURVE.domain || ((data, ctx, phflag) => { + if (ctx.length || phflag) + throw new Error("Contexts/pre-hash are not supported"); + return data; + }); + const inBig = (n5) => typeof n5 === "bigint" && _0n$6 < n5; + const inRange2 = (n5, max) => inBig(n5) && inBig(max) && n5 < max; + const in0MaskRange = (n5) => n5 === _0n$6 || inRange2(n5, MASK); + function assertInRange(n5, max) { + if (inRange2(n5, max)) + return n5; + throw new Error(`Expected valid scalar < ${max}, got ${typeof n5} ${n5}`); + } + function assertGE0(n5) { + return n5 === _0n$6 ? n5 : assertInRange(n5, CURVE_ORDER); + } + const pointPrecomputes = /* @__PURE__ */ new Map(); + function isPoint2(other) { + if (!(other instanceof Point2)) + throw new Error("ExtendedPoint expected"); + } + class Point2 { + constructor(ex2, ey2, ez2, et2) { + this.ex = ex2; + this.ey = ey2; + this.ez = ez2; + this.et = et2; + if (!in0MaskRange(ex2)) + throw new Error("x required"); + if (!in0MaskRange(ey2)) + throw new Error("y required"); + if (!in0MaskRange(ez2)) + throw new Error("z required"); + if (!in0MaskRange(et2)) + throw new Error("t required"); + } + get x() { + return this.toAffine().x; + } + get y() { + return this.toAffine().y; + } + static fromAffine(p3) { + if (p3 instanceof Point2) + throw new Error("extended point not allowed"); + const { x: x3, y: y3 } = p3 || {}; + if (!in0MaskRange(x3) || !in0MaskRange(y3)) + throw new Error("invalid affine point"); + return new Point2(x3, y3, _1n$9, modP(x3 * y3)); + } + static normalizeZ(points) { + const toInv = Fp2.invertBatch(points.map((p3) => p3.ez)); + return points.map((p3, i2) => p3.toAffine(toInv[i2])).map(Point2.fromAffine); + } + // "Private method", don't use it directly + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); + } + // Not required for fromHex(), which always creates valid points. + // Could be useful for fromAffine(). + assertValidity() { + const { a: a3, d: d4 } = CURVE; + if (this.is0()) + throw new Error("bad point: ZERO"); + const { ex: X2, ey: Y2, ez: Z2, et: T9 } = this; + const X22 = modP(X2 * X2); + const Y22 = modP(Y2 * Y2); + const Z22 = modP(Z2 * Z2); + const Z4 = modP(Z22 * Z22); + const aX2 = modP(X22 * a3); + const left = modP(Z22 * modP(aX2 + Y22)); + const right = modP(Z4 + modP(d4 * modP(X22 * Y22))); + if (left !== right) + throw new Error("bad point: equation left != right (1)"); + const XY = modP(X2 * Y2); + const ZT = modP(Z2 * T9); + if (XY !== ZT) + throw new Error("bad point: equation left != right (2)"); + } + // Compare one point to another. + equals(other) { + isPoint2(other); + const { ex: X1, ey: Y1, ez: Z1 } = this; + const { ex: X2, ey: Y2, ez: Z2 } = other; + const X1Z2 = modP(X1 * Z2); + const X2Z1 = modP(X2 * Z1); + const Y1Z2 = modP(Y1 * Z2); + const Y2Z1 = modP(Y2 * Z1); + return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; + } + is0() { + return this.equals(Point2.ZERO); + } + negate() { + return new Point2(modP(-this.ex), this.ey, this.ez, modP(-this.et)); + } + // Fast algo for doubling Extended Point. + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd + // Cost: 4M + 4S + 1*a + 6add + 1*2. + double() { + const { a: a3 } = CURVE; + const { ex: X1, ey: Y1, ez: Z1 } = this; + const A2 = modP(X1 * X1); + const B2 = modP(Y1 * Y1); + const C3 = modP(_2n$6 * modP(Z1 * Z1)); + const D2 = modP(a3 * A2); + const x1y1 = X1 + Y1; + const E2 = modP(modP(x1y1 * x1y1) - A2 - B2); + const G3 = D2 + B2; + const F2 = G3 - C3; + const H2 = D2 - B2; + const X3 = modP(E2 * F2); + const Y3 = modP(G3 * H2); + const T32 = modP(E2 * H2); + const Z3 = modP(F2 * G3); + return new Point2(X3, Y3, Z3, T32); + } + // Fast algo for adding 2 Extended Points. + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd + // Cost: 9M + 1*a + 1*d + 7add. + add(other) { + isPoint2(other); + const { a: a3, d: d4 } = CURVE; + const { ex: X1, ey: Y1, ez: Z1, et: T12 } = this; + const { ex: X2, ey: Y2, ez: Z2, et: T22 } = other; + if (a3 === BigInt(-1)) { + const A3 = modP((Y1 - X1) * (Y2 + X2)); + const B3 = modP((Y1 + X1) * (Y2 - X2)); + const F3 = modP(B3 - A3); + if (F3 === _0n$6) + return this.double(); + const C4 = modP(Z1 * _2n$6 * T22); + const D3 = modP(T12 * _2n$6 * Z2); + const E3 = D3 + C4; + const G4 = B3 + A3; + const H3 = D3 - C4; + const X32 = modP(E3 * F3); + const Y32 = modP(G4 * H3); + const T33 = modP(E3 * H3); + const Z32 = modP(F3 * G4); + return new Point2(X32, Y32, Z32, T33); + } + const A2 = modP(X1 * X2); + const B2 = modP(Y1 * Y2); + const C3 = modP(T12 * d4 * T22); + const D2 = modP(Z1 * Z2); + const E2 = modP((X1 + Y1) * (X2 + Y2) - A2 - B2); + const F2 = D2 - C3; + const G3 = D2 + C3; + const H2 = modP(B2 - a3 * A2); + const X3 = modP(E2 * F2); + const Y3 = modP(G3 * H2); + const T32 = modP(E2 * H2); + const Z3 = modP(F2 * G3); + return new Point2(X3, Y3, Z3, T32); + } + subtract(other) { + return this.add(other.negate()); + } + wNAF(n5) { + return wnaf.wNAFCached(this, pointPrecomputes, n5, Point2.normalizeZ); + } + // Constant-time multiplication. + multiply(scalar) { + const { p: p3, f: f4 } = this.wNAF(assertInRange(scalar, CURVE_ORDER)); + return Point2.normalizeZ([p3, f4])[0]; + } + // Non-constant-time multiplication. Uses double-and-add algorithm. + // It's faster, but should only be used when you don't care about + // an exposed private key e.g. sig verification. + // Does NOT allow scalars higher than CURVE.n. + multiplyUnsafe(scalar) { + let n5 = assertGE0(scalar); + if (n5 === _0n$6) + return I2; + if (this.equals(I2) || n5 === _1n$9) + return this; + if (this.equals(G2)) + return this.wNAF(n5).p; + return wnaf.unsafeLadder(this, n5); + } + // Checks if point is of small order. + // If you add something to small order point, you will have "dirty" + // point with torsion component. + // Multiplies point by cofactor and checks if the result is 0. + isSmallOrder() { + return this.multiplyUnsafe(cofactor).is0(); + } + // Multiplies point by curve order and checks if the result is 0. + // Returns `false` is the point is dirty. + isTorsionFree() { + return wnaf.unsafeLadder(this, CURVE_ORDER).is0(); + } + // Converts Extended point to default (x, y) coordinates. + // Can accept precomputed Z^-1 - for example, from invertBatch. + toAffine(iz) { + const { ex: x3, ey: y3, ez: z3 } = this; + const is0 = this.is0(); + if (iz == null) + iz = is0 ? _8n$2 : Fp2.inv(z3); + const ax = modP(x3 * iz); + const ay = modP(y3 * iz); + const zz = modP(z3 * iz); + if (is0) + return { x: _0n$6, y: _1n$9 }; + if (zz !== _1n$9) + throw new Error("invZ was invalid"); + return { x: ax, y: ay }; + } + clearCofactor() { + const { h: cofactor2 } = CURVE; + if (cofactor2 === _1n$9) + return this; + return this.multiplyUnsafe(cofactor2); + } + // Converts hash string or Uint8Array to Point. + // Uses algo from RFC8032 5.1.3. + static fromHex(hex, zip215 = false) { + const { d: d4, a: a3 } = CURVE; + const len = Fp2.BYTES; + hex = ensureBytes$1("pointHex", hex, len); + const normed = hex.slice(); + const lastByte = hex[len - 1]; + normed[len - 1] = lastByte & ~128; + const y3 = bytesToNumberLE$1(normed); + if (y3 === _0n$6) + ; + else { + if (zip215) + assertInRange(y3, MASK); + else + assertInRange(y3, Fp2.ORDER); + } + const y22 = modP(y3 * y3); + const u2 = modP(y22 - _1n$9); + const v6 = modP(d4 * y22 - a3); + let { isValid: isValid2, value: x3 } = uvRatio2(u2, v6); + if (!isValid2) + throw new Error("Point.fromHex: invalid y coordinate"); + const isXOdd = (x3 & _1n$9) === _1n$9; + const isLastByteOdd = (lastByte & 128) !== 0; + if (!zip215 && x3 === _0n$6 && isLastByteOdd) + throw new Error("Point.fromHex: x=0 and x_0=1"); + if (isLastByteOdd !== isXOdd) + x3 = modP(-x3); + return Point2.fromAffine({ x: x3, y: y3 }); + } + static fromPrivateKey(privKey) { + return getExtendedPublicKey(privKey).point; + } + toRawBytes() { + const { x: x3, y: y3 } = this.toAffine(); + const bytes2 = numberToBytesLE$1(y3, Fp2.BYTES); + bytes2[bytes2.length - 1] |= x3 & _1n$9 ? 128 : 0; + return bytes2; + } + toHex() { + return bytesToHex$1(this.toRawBytes()); + } + } + Point2.BASE = new Point2(CURVE.Gx, CURVE.Gy, _1n$9, modP(CURVE.Gx * CURVE.Gy)); + Point2.ZERO = new Point2(_0n$6, _1n$9, _1n$9, _0n$6); + const { BASE: G2, ZERO: I2 } = Point2; + const wnaf = wNAF$1(Point2, nByteLength * 8); + function modN(a3) { + return mod$1(a3, CURVE_ORDER); + } + function modN_LE(hash3) { + return modN(bytesToNumberLE$1(hash3)); + } + function getExtendedPublicKey(key2) { + const len = nByteLength; + key2 = ensureBytes$1("private key", key2, len); + const hashed = ensureBytes$1("hashed private key", cHash(key2), 2 * len); + const head = adjustScalarBytes2(hashed.slice(0, len)); + const prefix = hashed.slice(len, 2 * len); + const scalar = modN_LE(head); + const point5 = G2.multiply(scalar); + const pointBytes = point5.toRawBytes(); + return { head, prefix, scalar, point: point5, pointBytes }; + } + function getPublicKey(privKey) { + return getExtendedPublicKey(privKey).pointBytes; + } + function hashDomainToScalar(context = new Uint8Array(), ...msgs) { + const msg = concatBytes$2(...msgs); + return modN_LE(cHash(domain(msg, ensureBytes$1("context", context), !!prehash))); + } + function sign6(msg, privKey, options = {}) { + msg = ensureBytes$1("message", msg); + if (prehash) + msg = prehash(msg); + const { prefix, scalar, pointBytes } = getExtendedPublicKey(privKey); + const r2 = hashDomainToScalar(options.context, prefix, msg); + const R3 = G2.multiply(r2).toRawBytes(); + const k2 = hashDomainToScalar(options.context, R3, pointBytes, msg); + const s2 = modN(r2 + k2 * scalar); + assertGE0(s2); + const res = concatBytes$2(R3, numberToBytesLE$1(s2, Fp2.BYTES)); + return ensureBytes$1("result", res, nByteLength * 2); + } + const verifyOpts = VERIFY_DEFAULT; + function verify6(sig, msg, publicKey2, options = verifyOpts) { + const { context, zip215 } = options; + const len = Fp2.BYTES; + sig = ensureBytes$1("signature", sig, 2 * len); + msg = ensureBytes$1("message", msg); + if (prehash) + msg = prehash(msg); + const s2 = bytesToNumberLE$1(sig.slice(len, 2 * len)); + let A2, R3, SB; + try { + A2 = Point2.fromHex(publicKey2, zip215); + R3 = Point2.fromHex(sig.slice(0, len), zip215); + SB = G2.multiplyUnsafe(s2); + } catch (error) { + return false; + } + if (!zip215 && A2.isSmallOrder()) + return false; + const k2 = hashDomainToScalar(context, R3.toRawBytes(), A2.toRawBytes(), msg); + const RkA = R3.add(A2.multiplyUnsafe(k2)); + return RkA.subtract(SB).clearCofactor().equals(Point2.ZERO); + } + G2._setWindowSize(8); + const utils2 = { + getExtendedPublicKey, + // ed25519 private keys are uniform 32b. No need to check for modulo bias, like in secp256k1. + randomPrivateKey: () => randomBytes2(Fp2.BYTES), + /** + * We're doing scalar multiplication (used in getPublicKey etc) with precomputed BASE_POINT + * values. This slows down first getPublicKey() by milliseconds (see Speed section), + * but allows to speed-up subsequent getPublicKey() calls up to 20x. + * @param windowSize 2, 4, 8, 16 + */ + precompute(windowSize = 8, point5 = Point2.BASE) { + point5._setWindowSize(windowSize); + point5.multiply(BigInt(3)); + return point5; + } + }; + return { + CURVE, + getPublicKey, + sign: sign6, + verify: verify6, + ExtendedPoint: Point2, + utils: utils2 + }; +} +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const ED25519_P = BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"); +const ED25519_SQRT_M1 = /* @__PURE__ */ BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"); +BigInt(0); +const _1n$8 = BigInt(1), _2n$5 = BigInt(2); +BigInt(3); +const _5n$1 = BigInt(5), _8n$1 = BigInt(8); +function ed25519_pow_2_252_3(x3) { + const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); + const P2 = ED25519_P; + const x22 = x3 * x3 % P2; + const b2 = x22 * x3 % P2; + const b4 = pow2$1(b2, _2n$5, P2) * b2 % P2; + const b5 = pow2$1(b4, _1n$8, P2) * x3 % P2; + const b10 = pow2$1(b5, _5n$1, P2) * b5 % P2; + const b20 = pow2$1(b10, _10n, P2) * b10 % P2; + const b40 = pow2$1(b20, _20n, P2) * b20 % P2; + const b80 = pow2$1(b40, _40n, P2) * b40 % P2; + const b160 = pow2$1(b80, _80n, P2) * b80 % P2; + const b240 = pow2$1(b160, _80n, P2) * b80 % P2; + const b250 = pow2$1(b240, _10n, P2) * b10 % P2; + const pow_p_5_8 = pow2$1(b250, _2n$5, P2) * x3 % P2; + return { pow_p_5_8, b2 }; +} +function adjustScalarBytes(bytes2) { + bytes2[0] &= 248; + bytes2[31] &= 127; + bytes2[31] |= 64; + return bytes2; +} +function uvRatio(u2, v6) { + const P2 = ED25519_P; + const v32 = mod$1(v6 * v6 * v6, P2); + const v7 = mod$1(v32 * v32 * v6, P2); + const pow3 = ed25519_pow_2_252_3(u2 * v7).pow_p_5_8; + let x3 = mod$1(u2 * v32 * pow3, P2); + const vx2 = mod$1(v6 * x3 * x3, P2); + const root1 = x3; + const root2 = mod$1(x3 * ED25519_SQRT_M1, P2); + const useRoot1 = vx2 === u2; + const useRoot2 = vx2 === mod$1(-u2, P2); + const noRoot = vx2 === mod$1(-u2 * ED25519_SQRT_M1, P2); + if (useRoot1) + x3 = root1; + if (useRoot2 || noRoot) + x3 = root2; + if (isNegativeLE(x3, P2)) + x3 = mod$1(-x3, P2); + return { isValid: useRoot1 || useRoot2, value: x3 }; +} +const Fp$2 = /* @__PURE__ */ (() => Field$1(ED25519_P, void 0, true))(); +const ed25519Defaults = /* @__PURE__ */ (() => ({ + // Param: a + a: BigInt(-1), + // Fp.create(-1) is proper; our way still works and is faster + // d is equal to -121665/121666 over finite field. + // Negative number is P - number, and division is invert(number, P) + d: BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"), + // Finite field 𝔽p over which we'll do calculations; 2n**255n - 19n + Fp: Fp$2, + // Subgroup order: how many points curve has + // 2n**252n + 27742317777372353535851937790883648493n; + n: BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"), + // Cofactor + h: _8n$1, + // Base point (x, y) aka generator point + Gx: BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"), + Gy: BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"), + hash: sha512$1, + randomBytes: randomBytes$3, + adjustScalarBytes, + // dom2 + // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. + // Constant-time, u/√v + uvRatio +}))(); +const ed25519 = /* @__PURE__ */ (() => twistedEdwards(ed25519Defaults))(); +var bn = { exports: {} }; +bn.exports; +(function(module) { + (function(module2, exports) { + function assert2(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN2(number2, base3, endian) { + if (BN2.isBN(number2)) { + return number2; + } + this.negative = 0; + this.words = null; + this.length = 0; + this.red = null; + if (number2 !== null) { + if (base3 === "le" || base3 === "be") { + endian = base3; + base3 = 10; + } + this._init(number2 || 0, base3 || 10, endian || "be"); + } + } + if (typeof module2 === "object") { + module2.exports = BN2; + } else { + exports.BN = BN2; + } + BN2.BN = BN2; + BN2.wordSize = 26; + var Buffer2; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer2 = window.Buffer; + } else { + Buffer2 = require$$3.Buffer; + } + } catch (e18) { + } + BN2.isBN = function isBN(num) { + if (num instanceof BN2) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words); + }; + BN2.max = function max(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN2.min = function min(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN2.prototype._init = function init3(number2, base3, endian) { + if (typeof number2 === "number") { + return this._initNumber(number2, base3, endian); + } + if (typeof number2 === "object") { + return this._initArray(number2, base3, endian); + } + if (base3 === "hex") { + base3 = 16; + } + assert2(base3 === (base3 | 0) && base3 >= 2 && base3 <= 36); + number2 = number2.toString().replace(/\s+/g, ""); + var start = 0; + if (number2[0] === "-") { + start++; + this.negative = 1; + } + if (start < number2.length) { + if (base3 === 16) { + this._parseHex(number2, start, endian); + } else { + this._parseBase(number2, base3, start); + if (endian === "le") { + this._initArray(this.toArray(), base3, endian); + } + } + } + }; + BN2.prototype._initNumber = function _initNumber(number2, base3, endian) { + if (number2 < 0) { + this.negative = 1; + number2 = -number2; + } + if (number2 < 67108864) { + this.words = [number2 & 67108863]; + this.length = 1; + } else if (number2 < 4503599627370496) { + this.words = [ + number2 & 67108863, + number2 / 67108864 & 67108863 + ]; + this.length = 2; + } else { + assert2(number2 < 9007199254740992); + this.words = [ + number2 & 67108863, + number2 / 67108864 & 67108863, + 1 + ]; + this.length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base3, endian); + }; + BN2.prototype._initArray = function _initArray(number2, base3, endian) { + assert2(typeof number2.length === "number"); + if (number2.length <= 0) { + this.words = [0]; + this.length = 1; + return this; + } + this.length = Math.ceil(number2.length / 3); + this.words = new Array(this.length); + for (var i2 = 0; i2 < this.length; i2++) { + this.words[i2] = 0; + } + var j2, w2; + var off = 0; + if (endian === "be") { + for (i2 = number2.length - 1, j2 = 0; i2 >= 0; i2 -= 3) { + w2 = number2[i2] | number2[i2 - 1] << 8 | number2[i2 - 2] << 16; + this.words[j2] |= w2 << off & 67108863; + this.words[j2 + 1] = w2 >>> 26 - off & 67108863; + off += 24; + if (off >= 26) { + off -= 26; + j2++; + } + } + } else if (endian === "le") { + for (i2 = 0, j2 = 0; i2 < number2.length; i2 += 3) { + w2 = number2[i2] | number2[i2 + 1] << 8 | number2[i2 + 2] << 16; + this.words[j2] |= w2 << off & 67108863; + this.words[j2 + 1] = w2 >>> 26 - off & 67108863; + off += 24; + if (off >= 26) { + off -= 26; + j2++; + } + } + } + return this._strip(); + }; + function parseHex4Bits(string2, index2) { + var c2 = string2.charCodeAt(index2); + if (c2 >= 48 && c2 <= 57) { + return c2 - 48; + } else if (c2 >= 65 && c2 <= 70) { + return c2 - 55; + } else if (c2 >= 97 && c2 <= 102) { + return c2 - 87; + } else { + assert2(false, "Invalid character in " + string2); + } + } + function parseHexByte(string2, lowerBound, index2) { + var r2 = parseHex4Bits(string2, index2); + if (index2 - 1 >= lowerBound) { + r2 |= parseHex4Bits(string2, index2 - 1) << 4; + } + return r2; + } + BN2.prototype._parseHex = function _parseHex(number2, start, endian) { + this.length = Math.ceil((number2.length - start) / 6); + this.words = new Array(this.length); + for (var i2 = 0; i2 < this.length; i2++) { + this.words[i2] = 0; + } + var off = 0; + var j2 = 0; + var w2; + if (endian === "be") { + for (i2 = number2.length - 1; i2 >= start; i2 -= 2) { + w2 = parseHexByte(number2, start, i2) << off; + this.words[j2] |= w2 & 67108863; + if (off >= 18) { + off -= 18; + j2 += 1; + this.words[j2] |= w2 >>> 26; + } else { + off += 8; + } + } + } else { + var parseLength = number2.length - start; + for (i2 = parseLength % 2 === 0 ? start + 1 : start; i2 < number2.length; i2 += 2) { + w2 = parseHexByte(number2, start, i2) << off; + this.words[j2] |= w2 & 67108863; + if (off >= 18) { + off -= 18; + j2 += 1; + this.words[j2] |= w2 >>> 26; + } else { + off += 8; + } + } + } + this._strip(); + }; + function parseBase(str, start, end, mul6) { + var r2 = 0; + var b2 = 0; + var len = Math.min(str.length, end); + for (var i2 = start; i2 < len; i2++) { + var c2 = str.charCodeAt(i2) - 48; + r2 *= mul6; + if (c2 >= 49) { + b2 = c2 - 49 + 10; + } else if (c2 >= 17) { + b2 = c2 - 17 + 10; + } else { + b2 = c2; + } + assert2(c2 >= 0 && b2 < mul6, "Invalid character"); + r2 += b2; + } + return r2; + } + BN2.prototype._parseBase = function _parseBase(number2, base3, start) { + this.words = [0]; + this.length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base3) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base3 | 0; + var total = number2.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i2 = start; i2 < end; i2 += limbLen) { + word = parseBase(number2, i2, i2 + limbLen, base3); + this.imuln(limbPow); + if (this.words[0] + word < 67108864) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow3 = 1; + word = parseBase(number2, i2, number2.length, base3); + for (i2 = 0; i2 < mod2; i2++) { + pow3 *= base3; + } + this.imuln(pow3); + if (this.words[0] + word < 67108864) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + this._strip(); + }; + BN2.prototype.copy = function copy(dest) { + dest.words = new Array(this.length); + for (var i2 = 0; i2 < this.length; i2++) { + dest.words[i2] = this.words[i2]; + } + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + }; + function move(dest, src2) { + dest.words = src2.words; + dest.length = src2.length; + dest.negative = src2.negative; + dest.red = src2.red; + } + BN2.prototype._move = function _move(dest) { + move(dest, this); + }; + BN2.prototype.clone = function clone2() { + var r2 = new BN2(null); + this.copy(r2); + return r2; + }; + BN2.prototype._expand = function _expand(size2) { + while (this.length < size2) { + this.words[this.length++] = 0; + } + return this; + }; + BN2.prototype._strip = function strip() { + while (this.length > 1 && this.words[this.length - 1] === 0) { + this.length--; + } + return this._normSign(); + }; + BN2.prototype._normSign = function _normSign() { + if (this.length === 1 && this.words[0] === 0) { + this.negative = 0; + } + return this; + }; + if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") { + try { + BN2.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect6; + } catch (e18) { + BN2.prototype.inspect = inspect6; + } + } else { + BN2.prototype.inspect = inspect6; + } + function inspect6() { + return (this.red ? ""; + } + var zeros = [ + "", + "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 groupSizes = [ + 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 groupBases = [ + 0, + 0, + 33554432, + 43046721, + 16777216, + 48828125, + 60466176, + 40353607, + 16777216, + 43046721, + 1e7, + 19487171, + 35831808, + 62748517, + 7529536, + 11390625, + 16777216, + 24137569, + 34012224, + 47045881, + 64e6, + 4084101, + 5153632, + 6436343, + 7962624, + 9765625, + 11881376, + 14348907, + 17210368, + 20511149, + 243e5, + 28629151, + 33554432, + 39135393, + 45435424, + 52521875, + 60466176 + ]; + BN2.prototype.toString = function toString3(base3, padding2) { + base3 = base3 || 10; + padding2 = padding2 | 0 || 1; + var out; + if (base3 === 16 || base3 === "hex") { + out = ""; + var off = 0; + var carry = 0; + for (var i2 = 0; i2 < this.length; i2++) { + var w2 = this.words[i2]; + var word = ((w2 << off | carry) & 16777215).toString(16); + carry = w2 >>> 24 - off & 16777215; + off += 2; + if (off >= 26) { + off -= 26; + i2--; + } + if (carry !== 0 || i2 !== this.length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding2 !== 0) { + out = "0" + out; + } + if (this.negative !== 0) { + out = "-" + out; + } + return out; + } + if (base3 === (base3 | 0) && base3 >= 2 && base3 <= 36) { + var groupSize = groupSizes[base3]; + var groupBase = groupBases[base3]; + out = ""; + var c2 = this.clone(); + c2.negative = 0; + while (!c2.isZero()) { + var r2 = c2.modrn(groupBase).toString(base3); + c2 = c2.idivn(groupBase); + if (!c2.isZero()) { + out = zeros[groupSize - r2.length] + r2 + out; + } else { + out = r2 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding2 !== 0) { + out = "0" + out; + } + if (this.negative !== 0) { + out = "-" + out; + } + return out; + } + assert2(false, "Base should be between 2 and 36"); + }; + BN2.prototype.toNumber = function toNumber2() { + var ret = this.words[0]; + if (this.length === 2) { + ret += this.words[1] * 67108864; + } else if (this.length === 3 && this.words[2] === 1) { + ret += 4503599627370496 + this.words[1] * 67108864; + } else if (this.length > 2) { + assert2(false, "Number can only safely store up to 53 bits"); + } + return this.negative !== 0 ? -ret : ret; + }; + BN2.prototype.toJSON = function toJSON3() { + return this.toString(16, 2); + }; + if (Buffer2) { + BN2.prototype.toBuffer = function toBuffer2(endian, length) { + return this.toArrayLike(Buffer2, endian, length); + }; + } + BN2.prototype.toArray = function toArray2(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + var allocate = function allocate2(ArrayType, size2) { + if (ArrayType.allocUnsafe) { + return ArrayType.allocUnsafe(size2); + } + return new ArrayType(size2); + }; + BN2.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + this._strip(); + var byteLength2 = this.byteLength(); + var reqLength = length || Math.max(1, byteLength2); + assert2(byteLength2 <= reqLength, "byte array longer than desired length"); + assert2(reqLength > 0, "Requested array length <= 0"); + var res = allocate(ArrayType, reqLength); + var postfix = endian === "le" ? "LE" : "BE"; + this["_toArrayLike" + postfix](res, byteLength2); + return res; + }; + BN2.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength2) { + var position = 0; + var carry = 0; + for (var i2 = 0, shift = 0; i2 < this.length; i2++) { + var word = this.words[i2] << shift | carry; + res[position++] = word & 255; + if (position < res.length) { + res[position++] = word >> 8 & 255; + } + if (position < res.length) { + res[position++] = word >> 16 & 255; + } + if (shift === 6) { + if (position < res.length) { + res[position++] = word >> 24 & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position < res.length) { + res[position++] = carry; + while (position < res.length) { + res[position++] = 0; + } + } + }; + BN2.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength2) { + var position = res.length - 1; + var carry = 0; + for (var i2 = 0, shift = 0; i2 < this.length; i2++) { + var word = this.words[i2] << shift | carry; + res[position--] = word & 255; + if (position >= 0) { + res[position--] = word >> 8 & 255; + } + if (position >= 0) { + res[position--] = word >> 16 & 255; + } + if (shift === 6) { + if (position >= 0) { + res[position--] = word >> 24 & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position >= 0) { + res[position--] = carry; + while (position >= 0) { + res[position--] = 0; + } + } + }; + if (Math.clz32) { + BN2.prototype._countBits = function _countBits(w2) { + return 32 - Math.clz32(w2); + }; + } else { + BN2.prototype._countBits = function _countBits(w2) { + var t2 = w2; + var r2 = 0; + if (t2 >= 4096) { + r2 += 13; + t2 >>>= 13; + } + if (t2 >= 64) { + r2 += 7; + t2 >>>= 7; + } + if (t2 >= 8) { + r2 += 4; + t2 >>>= 4; + } + if (t2 >= 2) { + r2 += 2; + t2 >>>= 2; + } + return r2 + t2; + }; + } + BN2.prototype._zeroBits = function _zeroBits(w2) { + if (w2 === 0) + return 26; + var t2 = w2; + var r2 = 0; + if ((t2 & 8191) === 0) { + r2 += 13; + t2 >>>= 13; + } + if ((t2 & 127) === 0) { + r2 += 7; + t2 >>>= 7; + } + if ((t2 & 15) === 0) { + r2 += 4; + t2 >>>= 4; + } + if ((t2 & 3) === 0) { + r2 += 2; + t2 >>>= 2; + } + if ((t2 & 1) === 0) { + r2++; + } + return r2; + }; + BN2.prototype.bitLength = function bitLength() { + var w2 = this.words[this.length - 1]; + var hi2 = this._countBits(w2); + return (this.length - 1) * 26 + hi2; + }; + function toBitArray(num) { + var w2 = new Array(num.bitLength()); + for (var bit = 0; bit < w2.length; bit++) { + var off = bit / 26 | 0; + var wbit = bit % 26; + w2[bit] = num.words[off] >>> wbit & 1; + } + return w2; + } + BN2.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r2 = 0; + for (var i2 = 0; i2 < this.length; i2++) { + var b2 = this._zeroBits(this.words[i2]); + r2 += b2; + if (b2 !== 26) + break; + } + return r2; + }; + BN2.prototype.byteLength = function byteLength2() { + return Math.ceil(this.bitLength() / 8); + }; + BN2.prototype.toTwos = function toTwos2(width) { + if (this.negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN2.prototype.fromTwos = function fromTwos2(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN2.prototype.isNeg = function isNeg() { + return this.negative !== 0; + }; + BN2.prototype.neg = function neg4() { + return this.clone().ineg(); + }; + BN2.prototype.ineg = function ineg() { + if (!this.isZero()) { + this.negative ^= 1; + } + return this; + }; + BN2.prototype.iuor = function iuor(num) { + while (this.length < num.length) { + this.words[this.length++] = 0; + } + for (var i2 = 0; i2 < num.length; i2++) { + this.words[i2] = this.words[i2] | num.words[i2]; + } + return this._strip(); + }; + BN2.prototype.ior = function ior(num) { + assert2((this.negative | num.negative) === 0); + return this.iuor(num); + }; + BN2.prototype.or = function or2(num) { + if (this.length > num.length) + return this.clone().ior(num); + return num.clone().ior(this); + }; + BN2.prototype.uor = function uor(num) { + if (this.length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this); + }; + BN2.prototype.iuand = function iuand(num) { + var b2; + if (this.length > num.length) { + b2 = num; + } else { + b2 = this; + } + for (var i2 = 0; i2 < b2.length; i2++) { + this.words[i2] = this.words[i2] & num.words[i2]; + } + this.length = b2.length; + return this._strip(); + }; + BN2.prototype.iand = function iand(num) { + assert2((this.negative | num.negative) === 0); + return this.iuand(num); + }; + BN2.prototype.and = function and(num) { + if (this.length > num.length) + return this.clone().iand(num); + return num.clone().iand(this); + }; + BN2.prototype.uand = function uand(num) { + if (this.length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this); + }; + BN2.prototype.iuxor = function iuxor(num) { + var a3; + var b2; + if (this.length > num.length) { + a3 = this; + b2 = num; + } else { + a3 = num; + b2 = this; + } + for (var i2 = 0; i2 < b2.length; i2++) { + this.words[i2] = a3.words[i2] ^ b2.words[i2]; + } + if (this !== a3) { + for (; i2 < a3.length; i2++) { + this.words[i2] = a3.words[i2]; + } + } + this.length = a3.length; + return this._strip(); + }; + BN2.prototype.ixor = function ixor(num) { + assert2((this.negative | num.negative) === 0); + return this.iuxor(num); + }; + BN2.prototype.xor = function xor(num) { + if (this.length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this); + }; + BN2.prototype.uxor = function uxor(num) { + if (this.length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this); + }; + BN2.prototype.inotn = function inotn(width) { + assert2(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i2 = 0; i2 < bytesNeeded; i2++) { + this.words[i2] = ~this.words[i2] & 67108863; + } + if (bitsLeft > 0) { + this.words[i2] = ~this.words[i2] & 67108863 >> 26 - bitsLeft; + } + return this._strip(); + }; + BN2.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN2.prototype.setn = function setn(bit, val) { + assert2(typeof bit === "number" && bit >= 0); + var off = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off + 1); + if (val) { + this.words[off] = this.words[off] | 1 << wbit; + } else { + this.words[off] = this.words[off] & ~(1 << wbit); + } + return this._strip(); + }; + BN2.prototype.iadd = function iadd(num) { + var r2; + if (this.negative !== 0 && num.negative === 0) { + this.negative = 0; + r2 = this.isub(num); + this.negative ^= 1; + return this._normSign(); + } else if (this.negative === 0 && num.negative !== 0) { + num.negative = 0; + r2 = this.isub(num); + num.negative = 1; + return r2._normSign(); + } + var a3, b2; + if (this.length > num.length) { + a3 = this; + b2 = num; + } else { + a3 = num; + b2 = this; + } + var carry = 0; + for (var i2 = 0; i2 < b2.length; i2++) { + r2 = (a3.words[i2] | 0) + (b2.words[i2] | 0) + carry; + this.words[i2] = r2 & 67108863; + carry = r2 >>> 26; + } + for (; carry !== 0 && i2 < a3.length; i2++) { + r2 = (a3.words[i2] | 0) + carry; + this.words[i2] = r2 & 67108863; + carry = r2 >>> 26; + } + this.length = a3.length; + if (carry !== 0) { + this.words[this.length] = carry; + this.length++; + } else if (a3 !== this) { + for (; i2 < a3.length; i2++) { + this.words[i2] = a3.words[i2]; + } + } + return this; + }; + BN2.prototype.add = function add6(num) { + var res; + if (num.negative !== 0 && this.negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && this.negative !== 0) { + this.negative = 0; + res = num.sub(this); + this.negative = 1; + return res; + } + if (this.length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this); + }; + BN2.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r2 = this.iadd(num); + num.negative = 1; + return r2._normSign(); + } else if (this.negative !== 0) { + this.negative = 0; + this.iadd(num); + this.negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + this.negative = 0; + this.length = 1; + this.words[0] = 0; + return this; + } + var a3, b2; + if (cmp > 0) { + a3 = this; + b2 = num; + } else { + a3 = num; + b2 = this; + } + var carry = 0; + for (var i2 = 0; i2 < b2.length; i2++) { + r2 = (a3.words[i2] | 0) - (b2.words[i2] | 0) + carry; + carry = r2 >> 26; + this.words[i2] = r2 & 67108863; + } + for (; carry !== 0 && i2 < a3.length; i2++) { + r2 = (a3.words[i2] | 0) + carry; + carry = r2 >> 26; + this.words[i2] = r2 & 67108863; + } + if (carry === 0 && i2 < a3.length && a3 !== this) { + for (; i2 < a3.length; i2++) { + this.words[i2] = a3.words[i2]; + } + } + this.length = Math.max(this.length, i2); + if (a3 !== this) { + this.negative = 1; + } + return this._strip(); + }; + BN2.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a3 = self2.words[0] | 0; + var b2 = num.words[0] | 0; + var r2 = a3 * b2; + var lo2 = r2 & 67108863; + var carry = r2 / 67108864 | 0; + out.words[0] = lo2; + for (var k2 = 1; k2 < len; k2++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k2, num.length - 1); + for (var j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { + var i2 = k2 - j2 | 0; + a3 = self2.words[i2] | 0; + b2 = num.words[j2] | 0; + r2 = a3 * b2 + rword; + ncarry += r2 / 67108864 | 0; + rword = r2 & 67108863; + } + out.words[k2] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k2] = carry | 0; + } else { + out.length--; + } + return out._strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a3 = self2.words; + var b2 = num.words; + var o2 = out.words; + var c2 = 0; + var lo2; + var mid; + var hi2; + var a02 = a3[0] | 0; + var al0 = a02 & 8191; + var ah0 = a02 >>> 13; + var a1 = a3[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a3[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a3[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a4 = a3[4] | 0; + var al4 = a4 & 8191; + var ah4 = a4 >>> 13; + var a5 = a3[5] | 0; + var al5 = a5 & 8191; + var ah5 = a5 >>> 13; + var a6 = a3[6] | 0; + var al6 = a6 & 8191; + var ah6 = a6 >>> 13; + var a7 = a3[7] | 0; + var al7 = a7 & 8191; + var ah7 = a7 >>> 13; + var a8 = a3[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a3[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b02 = b2[0] | 0; + var bl0 = b02 & 8191; + var bh0 = b02 >>> 13; + var b1 = b2[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b2[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b3 = b2[3] | 0; + var bl3 = b3 & 8191; + var bh3 = b3 >>> 13; + var b4 = b2[4] | 0; + var bl4 = b4 & 8191; + var bh4 = b4 >>> 13; + var b5 = b2[5] | 0; + var bl5 = b5 & 8191; + var bh5 = b5 >>> 13; + var b6 = b2[6] | 0; + var bl6 = b6 & 8191; + var bh6 = b6 >>> 13; + var b7 = b2[7] | 0; + var bl7 = b7 & 8191; + var bh7 = b7 >>> 13; + var b8 = b2[8] | 0; + var bl8 = b8 & 8191; + var bh8 = b8 >>> 13; + var b9 = b2[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo2 = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi2 = Math.imul(ah0, bh0); + var w02 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w02 >>> 26) | 0; + w02 &= 67108863; + lo2 = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi2 = Math.imul(ah1, bh0); + lo2 = lo2 + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi2 = hi2 + Math.imul(ah0, bh1) | 0; + var w1 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo2 = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi2 = Math.imul(ah2, bh0); + lo2 = lo2 + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi2 = hi2 + Math.imul(ah1, bh1) | 0; + lo2 = lo2 + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi2 = hi2 + Math.imul(ah0, bh2) | 0; + var w2 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w2 >>> 26) | 0; + w2 &= 67108863; + lo2 = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi2 = Math.imul(ah3, bh0); + lo2 = lo2 + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi2 = hi2 + Math.imul(ah2, bh1) | 0; + lo2 = lo2 + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi2 = hi2 + Math.imul(ah1, bh2) | 0; + lo2 = lo2 + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi2 = hi2 + Math.imul(ah0, bh3) | 0; + var w3 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w3 >>> 26) | 0; + w3 &= 67108863; + lo2 = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi2 = Math.imul(ah4, bh0); + lo2 = lo2 + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi2 = hi2 + Math.imul(ah3, bh1) | 0; + lo2 = lo2 + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi2 = hi2 + Math.imul(ah2, bh2) | 0; + lo2 = lo2 + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi2 = hi2 + Math.imul(ah1, bh3) | 0; + lo2 = lo2 + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi2 = hi2 + Math.imul(ah0, bh4) | 0; + var w4 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w4 >>> 26) | 0; + w4 &= 67108863; + lo2 = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi2 = Math.imul(ah5, bh0); + lo2 = lo2 + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi2 = hi2 + Math.imul(ah4, bh1) | 0; + lo2 = lo2 + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi2 = hi2 + Math.imul(ah3, bh2) | 0; + lo2 = lo2 + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi2 = hi2 + Math.imul(ah2, bh3) | 0; + lo2 = lo2 + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi2 = hi2 + Math.imul(ah1, bh4) | 0; + lo2 = lo2 + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi2 = hi2 + Math.imul(ah0, bh5) | 0; + var w5 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w5 >>> 26) | 0; + w5 &= 67108863; + lo2 = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi2 = Math.imul(ah6, bh0); + lo2 = lo2 + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi2 = hi2 + Math.imul(ah5, bh1) | 0; + lo2 = lo2 + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi2 = hi2 + Math.imul(ah4, bh2) | 0; + lo2 = lo2 + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi2 = hi2 + Math.imul(ah3, bh3) | 0; + lo2 = lo2 + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi2 = hi2 + Math.imul(ah2, bh4) | 0; + lo2 = lo2 + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi2 = hi2 + Math.imul(ah1, bh5) | 0; + lo2 = lo2 + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi2 = hi2 + Math.imul(ah0, bh6) | 0; + var w6 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo2 = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi2 = Math.imul(ah7, bh0); + lo2 = lo2 + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi2 = hi2 + Math.imul(ah6, bh1) | 0; + lo2 = lo2 + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi2 = hi2 + Math.imul(ah5, bh2) | 0; + lo2 = lo2 + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi2 = hi2 + Math.imul(ah4, bh3) | 0; + lo2 = lo2 + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi2 = hi2 + Math.imul(ah3, bh4) | 0; + lo2 = lo2 + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi2 = hi2 + Math.imul(ah2, bh5) | 0; + lo2 = lo2 + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi2 = hi2 + Math.imul(ah1, bh6) | 0; + lo2 = lo2 + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi2 = hi2 + Math.imul(ah0, bh7) | 0; + var w7 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo2 = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi2 = Math.imul(ah8, bh0); + lo2 = lo2 + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi2 = hi2 + Math.imul(ah7, bh1) | 0; + lo2 = lo2 + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi2 = hi2 + Math.imul(ah6, bh2) | 0; + lo2 = lo2 + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi2 = hi2 + Math.imul(ah5, bh3) | 0; + lo2 = lo2 + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi2 = hi2 + Math.imul(ah4, bh4) | 0; + lo2 = lo2 + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi2 = hi2 + Math.imul(ah3, bh5) | 0; + lo2 = lo2 + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi2 = hi2 + Math.imul(ah2, bh6) | 0; + lo2 = lo2 + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi2 = hi2 + Math.imul(ah1, bh7) | 0; + lo2 = lo2 + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi2 = hi2 + Math.imul(ah0, bh8) | 0; + var w8 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo2 = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi2 = Math.imul(ah9, bh0); + lo2 = lo2 + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi2 = hi2 + Math.imul(ah8, bh1) | 0; + lo2 = lo2 + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi2 = hi2 + Math.imul(ah7, bh2) | 0; + lo2 = lo2 + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi2 = hi2 + Math.imul(ah6, bh3) | 0; + lo2 = lo2 + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi2 = hi2 + Math.imul(ah5, bh4) | 0; + lo2 = lo2 + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi2 = hi2 + Math.imul(ah4, bh5) | 0; + lo2 = lo2 + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi2 = hi2 + Math.imul(ah3, bh6) | 0; + lo2 = lo2 + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi2 = hi2 + Math.imul(ah2, bh7) | 0; + lo2 = lo2 + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi2 = hi2 + Math.imul(ah1, bh8) | 0; + lo2 = lo2 + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi2 = hi2 + Math.imul(ah0, bh9) | 0; + var w9 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo2 = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi2 = Math.imul(ah9, bh1); + lo2 = lo2 + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi2 = hi2 + Math.imul(ah8, bh2) | 0; + lo2 = lo2 + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi2 = hi2 + Math.imul(ah7, bh3) | 0; + lo2 = lo2 + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi2 = hi2 + Math.imul(ah6, bh4) | 0; + lo2 = lo2 + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi2 = hi2 + Math.imul(ah5, bh5) | 0; + lo2 = lo2 + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi2 = hi2 + Math.imul(ah4, bh6) | 0; + lo2 = lo2 + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi2 = hi2 + Math.imul(ah3, bh7) | 0; + lo2 = lo2 + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi2 = hi2 + Math.imul(ah2, bh8) | 0; + lo2 = lo2 + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi2 = hi2 + Math.imul(ah1, bh9) | 0; + var w10 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo2 = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi2 = Math.imul(ah9, bh2); + lo2 = lo2 + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi2 = hi2 + Math.imul(ah8, bh3) | 0; + lo2 = lo2 + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi2 = hi2 + Math.imul(ah7, bh4) | 0; + lo2 = lo2 + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi2 = hi2 + Math.imul(ah6, bh5) | 0; + lo2 = lo2 + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi2 = hi2 + Math.imul(ah5, bh6) | 0; + lo2 = lo2 + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi2 = hi2 + Math.imul(ah4, bh7) | 0; + lo2 = lo2 + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi2 = hi2 + Math.imul(ah3, bh8) | 0; + lo2 = lo2 + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi2 = hi2 + Math.imul(ah2, bh9) | 0; + var w11 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo2 = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi2 = Math.imul(ah9, bh3); + lo2 = lo2 + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi2 = hi2 + Math.imul(ah8, bh4) | 0; + lo2 = lo2 + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi2 = hi2 + Math.imul(ah7, bh5) | 0; + lo2 = lo2 + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi2 = hi2 + Math.imul(ah6, bh6) | 0; + lo2 = lo2 + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi2 = hi2 + Math.imul(ah5, bh7) | 0; + lo2 = lo2 + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi2 = hi2 + Math.imul(ah4, bh8) | 0; + lo2 = lo2 + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi2 = hi2 + Math.imul(ah3, bh9) | 0; + var w12 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo2 = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi2 = Math.imul(ah9, bh4); + lo2 = lo2 + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi2 = hi2 + Math.imul(ah8, bh5) | 0; + lo2 = lo2 + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi2 = hi2 + Math.imul(ah7, bh6) | 0; + lo2 = lo2 + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi2 = hi2 + Math.imul(ah6, bh7) | 0; + lo2 = lo2 + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi2 = hi2 + Math.imul(ah5, bh8) | 0; + lo2 = lo2 + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi2 = hi2 + Math.imul(ah4, bh9) | 0; + var w13 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo2 = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi2 = Math.imul(ah9, bh5); + lo2 = lo2 + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi2 = hi2 + Math.imul(ah8, bh6) | 0; + lo2 = lo2 + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi2 = hi2 + Math.imul(ah7, bh7) | 0; + lo2 = lo2 + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi2 = hi2 + Math.imul(ah6, bh8) | 0; + lo2 = lo2 + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi2 = hi2 + Math.imul(ah5, bh9) | 0; + var w14 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo2 = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi2 = Math.imul(ah9, bh6); + lo2 = lo2 + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi2 = hi2 + Math.imul(ah8, bh7) | 0; + lo2 = lo2 + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi2 = hi2 + Math.imul(ah7, bh8) | 0; + lo2 = lo2 + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi2 = hi2 + Math.imul(ah6, bh9) | 0; + var w15 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo2 = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi2 = Math.imul(ah9, bh7); + lo2 = lo2 + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi2 = hi2 + Math.imul(ah8, bh8) | 0; + lo2 = lo2 + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi2 = hi2 + Math.imul(ah7, bh9) | 0; + var w16 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo2 = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi2 = Math.imul(ah9, bh8); + lo2 = lo2 + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi2 = hi2 + Math.imul(ah8, bh9) | 0; + var w17 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo2 = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi2 = Math.imul(ah9, bh9); + var w18 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; + c2 = (hi2 + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o2[0] = w02; + o2[1] = w1; + o2[2] = w2; + o2[3] = w3; + o2[4] = w4; + o2[5] = w5; + o2[6] = w6; + o2[7] = w7; + o2[8] = w8; + o2[9] = w9; + o2[10] = w10; + o2[11] = w11; + o2[12] = w12; + o2[13] = w13; + o2[14] = w14; + o2[15] = w15; + o2[16] = w16; + o2[17] = w17; + o2[18] = w18; + if (c2 !== 0) { + o2[19] = c2; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k2 = 0; k2 < out.length - 1; k2++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k2, num.length - 1); + for (var j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { + var i2 = k2 - j2; + var a3 = self2.words[i2] | 0; + var b2 = num.words[j2] | 0; + var r2 = a3 * b2; + var lo2 = r2 & 67108863; + ncarry = ncarry + (r2 / 67108864 | 0) | 0; + lo2 = lo2 + rword | 0; + rword = lo2 & 67108863; + ncarry = ncarry + (lo2 >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k2] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k2] = carry; + } else { + out.length--; + } + return out._strip(); + } + function jumboMulTo(self2, num, out) { + return bigMulTo(self2, num, out); + } + BN2.prototype.mulTo = function mulTo(num, out) { + var res; + var len = this.length + num.length; + if (this.length === 10 && num.length === 10) { + res = comb10MulTo(this, num, out); + } else if (len < 63) { + res = smallMulTo(this, num, out); + } else if (len < 1024) { + res = bigMulTo(this, num, out); + } else { + res = jumboMulTo(this, num, out); + } + return res; + }; + BN2.prototype.mul = function mul6(num) { + var out = new BN2(null); + out.words = new Array(this.length + num.length); + return this.mulTo(num, out); + }; + BN2.prototype.mulf = function mulf(num) { + var out = new BN2(null); + out.words = new Array(this.length + num.length); + return jumboMulTo(this, num, out); + }; + BN2.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this); + }; + BN2.prototype.imuln = function imuln(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert2(typeof num === "number"); + assert2(num < 67108864); + var carry = 0; + for (var i2 = 0; i2 < this.length; i2++) { + var w2 = (this.words[i2] | 0) * num; + var lo2 = (w2 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w2 / 67108864 | 0; + carry += lo2 >>> 26; + this.words[i2] = lo2 & 67108863; + } + if (carry !== 0) { + this.words[i2] = carry; + this.length++; + } + return isNegNum ? this.ineg() : this; + }; + BN2.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN2.prototype.sqr = function sqr() { + return this.mul(this); + }; + BN2.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN2.prototype.pow = function pow3(num) { + var w2 = toBitArray(num); + if (w2.length === 0) + return new BN2(1); + var res = this; + for (var i2 = 0; i2 < w2.length; i2++, res = res.sqr()) { + if (w2[i2] !== 0) + break; + } + if (++i2 < w2.length) { + for (var q2 = res.sqr(); i2 < w2.length; i2++, q2 = q2.sqr()) { + if (w2[i2] === 0) + continue; + res = res.mul(q2); + } + } + return res; + }; + BN2.prototype.iushln = function iushln(bits) { + assert2(typeof bits === "number" && bits >= 0); + var r2 = bits % 26; + var s2 = (bits - r2) / 26; + var carryMask = 67108863 >>> 26 - r2 << 26 - r2; + var i2; + if (r2 !== 0) { + var carry = 0; + for (i2 = 0; i2 < this.length; i2++) { + var newCarry = this.words[i2] & carryMask; + var c2 = (this.words[i2] | 0) - newCarry << r2; + this.words[i2] = c2 | carry; + carry = newCarry >>> 26 - r2; + } + if (carry) { + this.words[i2] = carry; + this.length++; + } + } + if (s2 !== 0) { + for (i2 = this.length - 1; i2 >= 0; i2--) { + this.words[i2 + s2] = this.words[i2]; + } + for (i2 = 0; i2 < s2; i2++) { + this.words[i2] = 0; + } + this.length += s2; + } + return this._strip(); + }; + BN2.prototype.ishln = function ishln(bits) { + assert2(this.negative === 0); + return this.iushln(bits); + }; + BN2.prototype.iushrn = function iushrn(bits, hint, extended) { + assert2(typeof bits === "number" && bits >= 0); + var h4; + if (hint) { + h4 = (hint - hint % 26) / 26; + } else { + h4 = 0; + } + var r2 = bits % 26; + var s2 = Math.min((bits - r2) / 26, this.length); + var mask2 = 67108863 ^ 67108863 >>> r2 << r2; + var maskedWords = extended; + h4 -= s2; + h4 = Math.max(0, h4); + if (maskedWords) { + for (var i2 = 0; i2 < s2; i2++) { + maskedWords.words[i2] = this.words[i2]; + } + maskedWords.length = s2; + } + if (s2 === 0) + ; + else if (this.length > s2) { + this.length -= s2; + for (i2 = 0; i2 < this.length; i2++) { + this.words[i2] = this.words[i2 + s2]; + } + } else { + this.words[0] = 0; + this.length = 1; + } + var carry = 0; + for (i2 = this.length - 1; i2 >= 0 && (carry !== 0 || i2 >= h4); i2--) { + var word = this.words[i2] | 0; + this.words[i2] = carry << 26 - r2 | word >>> r2; + carry = word & mask2; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if (this.length === 0) { + this.words[0] = 0; + this.length = 1; + } + return this._strip(); + }; + BN2.prototype.ishrn = function ishrn(bits, hint, extended) { + assert2(this.negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN2.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN2.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN2.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN2.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN2.prototype.testn = function testn(bit) { + assert2(typeof bit === "number" && bit >= 0); + var r2 = bit % 26; + var s2 = (bit - r2) / 26; + var q2 = 1 << r2; + if (this.length <= s2) + return false; + var w2 = this.words[s2]; + return !!(w2 & q2); + }; + BN2.prototype.imaskn = function imaskn(bits) { + assert2(typeof bits === "number" && bits >= 0); + var r2 = bits % 26; + var s2 = (bits - r2) / 26; + assert2(this.negative === 0, "imaskn works only with positive numbers"); + if (this.length <= s2) { + return this; + } + if (r2 !== 0) { + s2++; + } + this.length = Math.min(s2, this.length); + if (r2 !== 0) { + var mask2 = 67108863 ^ 67108863 >>> r2 << r2; + this.words[this.length - 1] &= mask2; + } + return this._strip(); + }; + BN2.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN2.prototype.iaddn = function iaddn(num) { + assert2(typeof num === "number"); + assert2(num < 67108864); + if (num < 0) + return this.isubn(-num); + if (this.negative !== 0) { + if (this.length === 1 && (this.words[0] | 0) <= num) { + this.words[0] = num - (this.words[0] | 0); + this.negative = 0; + return this; + } + this.negative = 0; + this.isubn(num); + this.negative = 1; + return this; + } + return this._iaddn(num); + }; + BN2.prototype._iaddn = function _iaddn(num) { + this.words[0] += num; + for (var i2 = 0; i2 < this.length && this.words[i2] >= 67108864; i2++) { + this.words[i2] -= 67108864; + if (i2 === this.length - 1) { + this.words[i2 + 1] = 1; + } else { + this.words[i2 + 1]++; + } + } + this.length = Math.max(this.length, i2 + 1); + return this; + }; + BN2.prototype.isubn = function isubn(num) { + assert2(typeof num === "number"); + assert2(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if (this.negative !== 0) { + this.negative = 0; + this.iaddn(num); + this.negative = 1; + return this; + } + this.words[0] -= num; + if (this.length === 1 && this.words[0] < 0) { + this.words[0] = -this.words[0]; + this.negative = 1; + } else { + for (var i2 = 0; i2 < this.length && this.words[i2] < 0; i2++) { + this.words[i2] += 67108864; + this.words[i2 + 1] -= 1; + } + } + return this._strip(); + }; + BN2.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN2.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN2.prototype.iabs = function iabs() { + this.negative = 0; + return this; + }; + BN2.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN2.prototype._ishlnsubmul = function _ishlnsubmul(num, mul6, shift) { + var len = num.length + shift; + var i2; + this._expand(len); + var w2; + var carry = 0; + for (i2 = 0; i2 < num.length; i2++) { + w2 = (this.words[i2 + shift] | 0) + carry; + var right = (num.words[i2] | 0) * mul6; + w2 -= right & 67108863; + carry = (w2 >> 26) - (right / 67108864 | 0); + this.words[i2 + shift] = w2 & 67108863; + } + for (; i2 < this.length - shift; i2++) { + w2 = (this.words[i2 + shift] | 0) + carry; + carry = w2 >> 26; + this.words[i2 + shift] = w2 & 67108863; + } + if (carry === 0) + return this._strip(); + assert2(carry === -1); + carry = 0; + for (i2 = 0; i2 < this.length; i2++) { + w2 = -(this.words[i2] | 0) + carry; + carry = w2 >> 26; + this.words[i2] = w2 & 67108863; + } + this.negative = 1; + return this._strip(); + }; + BN2.prototype._wordDiv = function _wordDiv(num, mode2) { + var shift = this.length - num.length; + var a3 = this.clone(); + var b2 = num; + var bhi = b2.words[b2.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b2 = b2.ushln(shift); + a3.iushln(shift); + bhi = b2.words[b2.length - 1] | 0; + } + var m3 = a3.length - b2.length; + var q2; + if (mode2 !== "mod") { + q2 = new BN2(null); + q2.length = m3 + 1; + q2.words = new Array(q2.length); + for (var i2 = 0; i2 < q2.length; i2++) { + q2.words[i2] = 0; + } + } + var diff = a3.clone()._ishlnsubmul(b2, 1, m3); + if (diff.negative === 0) { + a3 = diff; + if (q2) { + q2.words[m3] = 1; + } + } + for (var j2 = m3 - 1; j2 >= 0; j2--) { + var qj2 = (a3.words[b2.length + j2] | 0) * 67108864 + (a3.words[b2.length + j2 - 1] | 0); + qj2 = Math.min(qj2 / bhi | 0, 67108863); + a3._ishlnsubmul(b2, qj2, j2); + while (a3.negative !== 0) { + qj2--; + a3.negative = 0; + a3._ishlnsubmul(b2, 1, j2); + if (!a3.isZero()) { + a3.negative ^= 1; + } + } + if (q2) { + q2.words[j2] = qj2; + } + } + if (q2) { + q2._strip(); + } + a3._strip(); + if (mode2 !== "div" && shift !== 0) { + a3.iushrn(shift); + } + return { + div: q2 || null, + mod: a3 + }; + }; + BN2.prototype.divmod = function divmod(num, mode2, positive) { + assert2(!num.isZero()); + if (this.isZero()) { + return { + div: new BN2(0), + mod: new BN2(0) + }; + } + var div, mod2, res; + if (this.negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode2); + if (mode2 !== "mod") { + div = res.div.neg(); + } + if (mode2 !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if (this.negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode2); + if (mode2 !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if ((this.negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode2); + if (mode2 !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > this.length || this.cmp(num) < 0) { + return { + div: new BN2(0), + mod: this + }; + } + if (num.length === 1) { + if (mode2 === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode2 === "mod") { + return { + div: null, + mod: new BN2(this.modrn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN2(this.modrn(num.words[0])) + }; + } + return this._wordDiv(num, mode2); + }; + BN2.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN2.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN2.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN2.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r2 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r2 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN2.prototype.modrn = function modrn(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert2(num <= 67108863); + var p3 = (1 << 26) % num; + var acc = 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + acc = (p3 * acc + (this.words[i2] | 0)) % num; + } + return isNegNum ? -acc : acc; + }; + BN2.prototype.modn = function modn(num) { + return this.modrn(num); + }; + BN2.prototype.idivn = function idivn(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert2(num <= 67108863); + var carry = 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + var w2 = (this.words[i2] | 0) + carry * 67108864; + this.words[i2] = w2 / num | 0; + carry = w2 % num; + } + this._strip(); + return isNegNum ? this.ineg() : this; + }; + BN2.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN2.prototype.egcd = function egcd(p3) { + assert2(p3.negative === 0); + assert2(!p3.isZero()); + var x3 = this; + var y3 = p3.clone(); + if (x3.negative !== 0) { + x3 = x3.umod(p3); + } else { + x3 = x3.clone(); + } + var A2 = new BN2(1); + var B2 = new BN2(0); + var C3 = new BN2(0); + var D2 = new BN2(1); + var g3 = 0; + while (x3.isEven() && y3.isEven()) { + x3.iushrn(1); + y3.iushrn(1); + ++g3; + } + var yp = y3.clone(); + var xp = x3.clone(); + while (!x3.isZero()) { + for (var i2 = 0, im = 1; (x3.words[0] & im) === 0 && i2 < 26; ++i2, im <<= 1) + ; + if (i2 > 0) { + x3.iushrn(i2); + while (i2-- > 0) { + if (A2.isOdd() || B2.isOdd()) { + A2.iadd(yp); + B2.isub(xp); + } + A2.iushrn(1); + B2.iushrn(1); + } + } + for (var j2 = 0, jm = 1; (y3.words[0] & jm) === 0 && j2 < 26; ++j2, jm <<= 1) + ; + if (j2 > 0) { + y3.iushrn(j2); + while (j2-- > 0) { + if (C3.isOdd() || D2.isOdd()) { + C3.iadd(yp); + D2.isub(xp); + } + C3.iushrn(1); + D2.iushrn(1); + } + } + if (x3.cmp(y3) >= 0) { + x3.isub(y3); + A2.isub(C3); + B2.isub(D2); + } else { + y3.isub(x3); + C3.isub(A2); + D2.isub(B2); + } + } + return { + a: C3, + b: D2, + gcd: y3.iushln(g3) + }; + }; + BN2.prototype._invmp = function _invmp(p3) { + assert2(p3.negative === 0); + assert2(!p3.isZero()); + var a3 = this; + var b2 = p3.clone(); + if (a3.negative !== 0) { + a3 = a3.umod(p3); + } else { + a3 = a3.clone(); + } + var x1 = new BN2(1); + var x22 = new BN2(0); + var delta = b2.clone(); + while (a3.cmpn(1) > 0 && b2.cmpn(1) > 0) { + for (var i2 = 0, im = 1; (a3.words[0] & im) === 0 && i2 < 26; ++i2, im <<= 1) + ; + if (i2 > 0) { + a3.iushrn(i2); + while (i2-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j2 = 0, jm = 1; (b2.words[0] & jm) === 0 && j2 < 26; ++j2, jm <<= 1) + ; + if (j2 > 0) { + b2.iushrn(j2); + while (j2-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a3.cmp(b2) >= 0) { + a3.isub(b2); + x1.isub(x22); + } else { + b2.isub(a3); + x22.isub(x1); + } + } + var res; + if (a3.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p3); + } + return res; + }; + BN2.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a3 = this.clone(); + var b2 = num.clone(); + a3.negative = 0; + b2.negative = 0; + for (var shift = 0; a3.isEven() && b2.isEven(); shift++) { + a3.iushrn(1); + b2.iushrn(1); + } + do { + while (a3.isEven()) { + a3.iushrn(1); + } + while (b2.isEven()) { + b2.iushrn(1); + } + var r2 = a3.cmp(b2); + if (r2 < 0) { + var t2 = a3; + a3 = b2; + b2 = t2; + } else if (r2 === 0 || b2.cmpn(1) === 0) { + break; + } + a3.isub(b2); + } while (true); + return b2.iushln(shift); + }; + BN2.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN2.prototype.isEven = function isEven() { + return (this.words[0] & 1) === 0; + }; + BN2.prototype.isOdd = function isOdd2() { + return (this.words[0] & 1) === 1; + }; + BN2.prototype.andln = function andln(num) { + return this.words[0] & num; + }; + BN2.prototype.bincn = function bincn(bit) { + assert2(typeof bit === "number"); + var r2 = bit % 26; + var s2 = (bit - r2) / 26; + var q2 = 1 << r2; + if (this.length <= s2) { + this._expand(s2 + 1); + this.words[s2] |= q2; + return this; + } + var carry = q2; + for (var i2 = s2; carry !== 0 && i2 < this.length; i2++) { + var w2 = this.words[i2] | 0; + w2 += carry; + carry = w2 >>> 26; + w2 &= 67108863; + this.words[i2] = w2; + } + if (carry !== 0) { + this.words[i2] = carry; + this.length++; + } + return this; + }; + BN2.prototype.isZero = function isZero() { + return this.length === 1 && this.words[0] === 0; + }; + BN2.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if (this.negative !== 0 && !negative) + return -1; + if (this.negative === 0 && negative) + return 1; + this._strip(); + var res; + if (this.length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert2(num <= 67108863, "Number is too big"); + var w2 = this.words[0] | 0; + res = w2 === num ? 0 : w2 < num ? -1 : 1; + } + if (this.negative !== 0) + return -res | 0; + return res; + }; + BN2.prototype.cmp = function cmp(num) { + if (this.negative !== 0 && num.negative === 0) + return -1; + if (this.negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if (this.negative !== 0) + return -res | 0; + return res; + }; + BN2.prototype.ucmp = function ucmp(num) { + if (this.length > num.length) + return 1; + if (this.length < num.length) + return -1; + var res = 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + var a3 = this.words[i2] | 0; + var b2 = num.words[i2] | 0; + if (a3 === b2) + continue; + if (a3 < b2) { + res = -1; + } else if (a3 > b2) { + res = 1; + } + break; + } + return res; + }; + BN2.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN2.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN2.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN2.prototype.gte = function gte(num) { + return this.cmp(num) >= 0; + }; + BN2.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN2.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN2.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN2.prototype.lte = function lte(num) { + return this.cmp(num) <= 0; + }; + BN2.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN2.prototype.eq = function eq7(num) { + return this.cmp(num) === 0; + }; + BN2.red = function red(num) { + return new Red(num); + }; + BN2.prototype.toRed = function toRed(ctx) { + assert2(!this.red, "Already a number in reduction context"); + assert2(this.negative === 0, "red works only with positives"); + return ctx.convertTo(this)._forceRed(ctx); + }; + BN2.prototype.fromRed = function fromRed() { + assert2(this.red, "fromRed works only with numbers in reduction context"); + return this.red.convertFrom(this); + }; + BN2.prototype._forceRed = function _forceRed(ctx) { + this.red = ctx; + return this; + }; + BN2.prototype.forceRed = function forceRed(ctx) { + assert2(!this.red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN2.prototype.redAdd = function redAdd(num) { + assert2(this.red, "redAdd works only with red numbers"); + return this.red.add(this, num); + }; + BN2.prototype.redIAdd = function redIAdd(num) { + assert2(this.red, "redIAdd works only with red numbers"); + return this.red.iadd(this, num); + }; + BN2.prototype.redSub = function redSub(num) { + assert2(this.red, "redSub works only with red numbers"); + return this.red.sub(this, num); + }; + BN2.prototype.redISub = function redISub(num) { + assert2(this.red, "redISub works only with red numbers"); + return this.red.isub(this, num); + }; + BN2.prototype.redShl = function redShl(num) { + assert2(this.red, "redShl works only with red numbers"); + return this.red.shl(this, num); + }; + BN2.prototype.redMul = function redMul(num) { + assert2(this.red, "redMul works only with red numbers"); + this.red._verify2(this, num); + return this.red.mul(this, num); + }; + BN2.prototype.redIMul = function redIMul(num) { + assert2(this.red, "redMul works only with red numbers"); + this.red._verify2(this, num); + return this.red.imul(this, num); + }; + BN2.prototype.redSqr = function redSqr() { + assert2(this.red, "redSqr works only with red numbers"); + this.red._verify1(this); + return this.red.sqr(this); + }; + BN2.prototype.redISqr = function redISqr() { + assert2(this.red, "redISqr works only with red numbers"); + this.red._verify1(this); + return this.red.isqr(this); + }; + BN2.prototype.redSqrt = function redSqrt() { + assert2(this.red, "redSqrt works only with red numbers"); + this.red._verify1(this); + return this.red.sqrt(this); + }; + BN2.prototype.redInvm = function redInvm() { + assert2(this.red, "redInvm works only with red numbers"); + this.red._verify1(this); + return this.red.invm(this); + }; + BN2.prototype.redNeg = function redNeg() { + assert2(this.red, "redNeg works only with red numbers"); + this.red._verify1(this); + return this.red.neg(this); + }; + BN2.prototype.redPow = function redPow(num) { + assert2(this.red && !num.red, "redPow(normalNum)"); + this.red._verify1(this); + return this.red.pow(this, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p3) { + this.name = name2; + this.p = new BN2(p3, 16); + this.n = this.p.bitLength(); + this.k = new BN2(1).iushln(this.n).isub(this.p); + this.tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN2(null); + tmp.words = new Array(Math.ceil(this.n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r2 = num; + var rlen; + do { + this.split(r2, this.tmp); + r2 = this.imulK(r2); + r2 = r2.iadd(this.tmp); + rlen = r2.bitLength(); + } while (rlen > this.n); + var cmp = rlen < this.n ? -1 : r2.ucmp(this.p); + if (cmp === 0) { + r2.words[0] = 0; + r2.length = 1; + } else if (cmp > 0) { + r2.isub(this.p); + } else { + if (r2.strip !== void 0) { + r2.strip(); + } else { + r2._strip(); + } + } + return r2; + }; + MPrime.prototype.split = function split2(input, out) { + input.iushrn(this.n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul(this.k); + }; + function K256() { + MPrime.call( + this, + "k256", + "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f" + ); + } + inherits2(K256, MPrime); + K256.prototype.split = function split2(input, output2) { + var mask2 = 4194303; + var outLen = Math.min(input.length, 9); + for (var i2 = 0; i2 < outLen; i2++) { + output2.words[i2] = input.words[i2]; + } + output2.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output2.words[output2.length++] = prev & mask2; + for (i2 = 10; i2 < input.length; i2++) { + var next = input.words[i2] | 0; + input.words[i2 - 10] = (next & mask2) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i2 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo2 = 0; + for (var i2 = 0; i2 < num.length; i2++) { + var w2 = num.words[i2] | 0; + lo2 += w2 * 977; + num.words[i2] = lo2 & 67108863; + lo2 = w2 * 64 + (lo2 / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call( + this, + "p224", + "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001" + ); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call( + this, + "p192", + "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff" + ); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call( + this, + "25519", + "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed" + ); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i2 = 0; i2 < num.length; i2++) { + var hi2 = (num.words[i2] | 0) * 19 + carry; + var lo2 = hi2 & 67108863; + hi2 >>>= 26; + num.words[i2] = lo2; + carry = hi2; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN2._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m3) { + if (typeof m3 === "string") { + var prime = BN2._prime(m3); + this.m = prime.p; + this.prime = prime; + } else { + assert2(m3.gtn(1), "modulus must be greater than 1"); + this.m = m3; + this.prime = null; + } + } + Red.prototype._verify1 = function _verify1(a3) { + assert2(a3.negative === 0, "red works only with positives"); + assert2(a3.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a3, b2) { + assert2((a3.negative | b2.negative) === 0, "red works only with positives"); + assert2( + a3.red && a3.red === b2.red, + "red works only with red numbers" + ); + }; + Red.prototype.imod = function imod(a3) { + if (this.prime) + return this.prime.ireduce(a3)._forceRed(this); + move(a3, a3.umod(this.m)._forceRed(this)); + return a3; + }; + Red.prototype.neg = function neg4(a3) { + if (a3.isZero()) { + return a3.clone(); + } + return this.m.sub(a3)._forceRed(this); + }; + Red.prototype.add = function add6(a3, b2) { + this._verify2(a3, b2); + var res = a3.add(b2); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res._forceRed(this); + }; + Red.prototype.iadd = function iadd(a3, b2) { + this._verify2(a3, b2); + var res = a3.iadd(b2); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res; + }; + Red.prototype.sub = function sub(a3, b2) { + this._verify2(a3, b2); + var res = a3.sub(b2); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res._forceRed(this); + }; + Red.prototype.isub = function isub(a3, b2) { + this._verify2(a3, b2); + var res = a3.isub(b2); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res; + }; + Red.prototype.shl = function shl(a3, num) { + this._verify1(a3); + return this.imod(a3.ushln(num)); + }; + Red.prototype.imul = function imul(a3, b2) { + this._verify2(a3, b2); + return this.imod(a3.imul(b2)); + }; + Red.prototype.mul = function mul6(a3, b2) { + this._verify2(a3, b2); + return this.imod(a3.mul(b2)); + }; + Red.prototype.isqr = function isqr(a3) { + return this.imul(a3, a3.clone()); + }; + Red.prototype.sqr = function sqr(a3) { + return this.mul(a3, a3); + }; + Red.prototype.sqrt = function sqrt(a3) { + if (a3.isZero()) + return a3.clone(); + var mod3 = this.m.andln(3); + assert2(mod3 % 2 === 1); + if (mod3 === 3) { + var pow3 = this.m.add(new BN2(1)).iushrn(2); + return this.pow(a3, pow3); + } + var q2 = this.m.subn(1); + var s2 = 0; + while (!q2.isZero() && q2.andln(1) === 0) { + s2++; + q2.iushrn(1); + } + assert2(!q2.isZero()); + var one = new BN2(1).toRed(this); + var nOne = one.redNeg(); + var lpow = this.m.subn(1).iushrn(1); + var z3 = this.m.bitLength(); + z3 = new BN2(2 * z3 * z3).toRed(this); + while (this.pow(z3, lpow).cmp(nOne) !== 0) { + z3.redIAdd(nOne); + } + var c2 = this.pow(z3, q2); + var r2 = this.pow(a3, q2.addn(1).iushrn(1)); + var t2 = this.pow(a3, q2); + var m3 = s2; + while (t2.cmp(one) !== 0) { + var tmp = t2; + for (var i2 = 0; tmp.cmp(one) !== 0; i2++) { + tmp = tmp.redSqr(); + } + assert2(i2 < m3); + var b2 = this.pow(c2, new BN2(1).iushln(m3 - i2 - 1)); + r2 = r2.redMul(b2); + c2 = b2.redSqr(); + t2 = t2.redMul(c2); + m3 = i2; + } + return r2; + }; + Red.prototype.invm = function invm(a3) { + var inv = a3._invmp(this.m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow3(a3, num) { + if (num.isZero()) + return new BN2(1).toRed(this); + if (num.cmpn(1) === 0) + return a3.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN2(1).toRed(this); + wnd[1] = a3; + for (var i2 = 2; i2 < wnd.length; i2++) { + wnd[i2] = this.mul(wnd[i2 - 1], a3); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i2 = num.length - 1; i2 >= 0; i2--) { + var word = num.words[i2]; + for (var j2 = start - 1; j2 >= 0; j2--) { + var bit = word >> j2 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i2 !== 0 || j2 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r2 = num.umod(this.m); + return r2 === num ? r2.clone() : r2; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN2.mont = function mont2(num) { + return new Mont(num); + }; + function Mont(m3) { + Red.call(this, m3); + this.shift = this.m.bitLength(); + if (this.shift % 26 !== 0) { + this.shift += 26 - this.shift % 26; + } + this.r = new BN2(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); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln(this.shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r2 = this.imod(num.mul(this.rinv)); + r2.red = null; + return r2; + }; + Mont.prototype.imul = function imul(a3, b2) { + if (a3.isZero() || b2.isZero()) { + a3.words[0] = 0; + a3.length = 1; + return a3; + } + var t2 = a3.imul(b2); + var c2 = t2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u2 = t2.isub(c2).iushrn(this.shift); + var res = u2; + if (u2.cmp(this.m) >= 0) { + res = u2.isub(this.m); + } else if (u2.cmpn(0) < 0) { + res = u2.iadd(this.m); + } + return res._forceRed(this); + }; + Mont.prototype.mul = function mul6(a3, b2) { + if (a3.isZero() || b2.isZero()) + return new BN2(0)._forceRed(this); + var t2 = a3.mul(b2); + var c2 = t2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u2 = t2.isub(c2).iushrn(this.shift); + var res = u2; + if (u2.cmp(this.m) >= 0) { + res = u2.isub(this.m); + } else if (u2.cmpn(0) < 0) { + res = u2.iadd(this.m); + } + return res._forceRed(this); + }; + Mont.prototype.invm = function invm(a3) { + var res = this.imod(a3._invmp(this.m).mul(this.r2)); + return res._forceRed(this); + }; + })(module, commonjsGlobal); +})(bn); +var bnExports = bn.exports; +const _BN = /* @__PURE__ */ getDefaultExportFromCjs$1(bnExports); +var safeBuffer = { exports: {} }; +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +(function(module, exports) { + var buffer$12 = buffer; + var Buffer2 = buffer$12.Buffer; + function copyProps(src2, dst) { + for (var key2 in src2) { + dst[key2] = src2[key2]; + } + } + if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { + module.exports = buffer$12; + } else { + copyProps(buffer$12, exports); + exports.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer2(arg, encodingOrOffset, length); + } + SafeBuffer.prototype = Object.create(Buffer2.prototype); + copyProps(Buffer2, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer2(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size2, fill, encoding2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer2(size2); + if (fill !== void 0) { + if (typeof encoding2 === "string") { + buf.fill(fill, encoding2); + } else { + buf.fill(fill); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer2(size2); + }; + SafeBuffer.allocUnsafeSlow = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer$12.SlowBuffer(size2); + }; +})(safeBuffer, safeBuffer.exports); +var safeBufferExports = safeBuffer.exports; +var _Buffer = safeBufferExports.Buffer; +function base$2(ALPHABET2) { + if (ALPHABET2.length >= 255) { + throw new TypeError("Alphabet too long"); + } + var BASE_MAP = new Uint8Array(256); + for (var j2 = 0; j2 < BASE_MAP.length; j2++) { + BASE_MAP[j2] = 255; + } + for (var i2 = 0; i2 < ALPHABET2.length; i2++) { + var x3 = ALPHABET2.charAt(i2); + var xc2 = x3.charCodeAt(0); + if (BASE_MAP[xc2] !== 255) { + throw new TypeError(x3 + " is ambiguous"); + } + BASE_MAP[xc2] = i2; + } + var BASE2 = ALPHABET2.length; + var LEADER = ALPHABET2.charAt(0); + var FACTOR = Math.log(BASE2) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE2); + function encode5(source) { + if (Array.isArray(source) || source instanceof Uint8Array) { + source = _Buffer.from(source); + } + if (!_Buffer.isBuffer(source)) { + throw new TypeError("Expected Buffer"); + } + if (source.length === 0) { + return ""; + } + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size2 = (pend - pbegin) * iFACTOR + 1 >>> 0; + var b58 = new Uint8Array(size2); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i3 = 0; + for (var it1 = size2 - 1; (carry !== 0 || i3 < length) && it1 !== -1; it1--, i3++) { + carry += 256 * b58[it1] >>> 0; + b58[it1] = carry % BASE2 >>> 0; + carry = carry / BASE2 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length = i3; + pbegin++; + } + var it2 = size2 - length; + while (it2 !== size2 && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size2; ++it2) { + str += ALPHABET2.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== "string") { + throw new TypeError("Expected String"); + } + if (source.length === 0) { + return _Buffer.alloc(0); + } + var psz = 0; + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size2 = (source.length - psz) * FACTOR + 1 >>> 0; + var b256 = new Uint8Array(size2); + while (psz < source.length) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i3 = 0; + for (var it3 = size2 - 1; (carry !== 0 || i3 < length) && it3 !== -1; it3--, i3++) { + carry += BASE2 * b256[it3] >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = carry / 256 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length = i3; + psz++; + } + var it4 = size2 - length; + while (it4 !== size2 && b256[it4] === 0) { + it4++; + } + var vch = _Buffer.allocUnsafe(zeroes + (size2 - it4)); + vch.fill(0, 0, zeroes); + var j3 = zeroes; + while (it4 !== size2) { + vch[j3++] = b256[it4++]; + } + return vch; + } + function decode3(string2) { + var buffer2 = decodeUnsafe(string2); + if (buffer2) { + return buffer2; + } + throw new Error("Non-base" + BASE2 + " character"); + } + return { + encode: encode5, + decodeUnsafe, + decode: decode3 + }; +} +var src$1 = base$2; +var basex$1 = src$1; +var ALPHABET$3 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; +var bs58$2 = basex$1(ALPHABET$3); +const bs58$3 = /* @__PURE__ */ getDefaultExportFromCjs$1(bs58$2); +const SHA256_K$1 = /* @__PURE__ */ new Uint32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 +]); +const SHA256_IV = /* @__PURE__ */ new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 +]); +const SHA256_W$1 = /* @__PURE__ */ new Uint32Array(64); +let SHA256$2 = class SHA256 extends HashMD { + constructor() { + super(64, 32, 8, false); + this.A = SHA256_IV[0] | 0; + this.B = SHA256_IV[1] | 0; + this.C = SHA256_IV[2] | 0; + this.D = SHA256_IV[3] | 0; + this.E = SHA256_IV[4] | 0; + this.F = SHA256_IV[5] | 0; + this.G = SHA256_IV[6] | 0; + this.H = SHA256_IV[7] | 0; + } + get() { + const { A: A2, B: B2, C: C3, D: D2, E: E2, F: F2, G: G2, H: H2 } = this; + return [A2, B2, C3, D2, E2, F2, G2, H2]; + } + // prettier-ignore + set(A2, B2, C3, D2, E2, F2, G2, H2) { + this.A = A2 | 0; + this.B = B2 | 0; + this.C = C3 | 0; + this.D = D2 | 0; + this.E = E2 | 0; + this.F = F2 | 0; + this.G = G2 | 0; + this.H = H2 | 0; + } + process(view, offset2) { + for (let i2 = 0; i2 < 16; i2++, offset2 += 4) + SHA256_W$1[i2] = view.getUint32(offset2, false); + for (let i2 = 16; i2 < 64; i2++) { + const W15 = SHA256_W$1[i2 - 15]; + const W2 = SHA256_W$1[i2 - 2]; + const s02 = rotr$1(W15, 7) ^ rotr$1(W15, 18) ^ W15 >>> 3; + const s1 = rotr$1(W2, 17) ^ rotr$1(W2, 19) ^ W2 >>> 10; + SHA256_W$1[i2] = s1 + SHA256_W$1[i2 - 7] + s02 + SHA256_W$1[i2 - 16] | 0; + } + let { A: A2, B: B2, C: C3, D: D2, E: E2, F: F2, G: G2, H: H2 } = this; + for (let i2 = 0; i2 < 64; i2++) { + const sigma1 = rotr$1(E2, 6) ^ rotr$1(E2, 11) ^ rotr$1(E2, 25); + const T12 = H2 + sigma1 + Chi$1(E2, F2, G2) + SHA256_K$1[i2] + SHA256_W$1[i2] | 0; + const sigma0 = rotr$1(A2, 2) ^ rotr$1(A2, 13) ^ rotr$1(A2, 22); + const T22 = sigma0 + Maj$1(A2, B2, C3) | 0; + H2 = G2; + G2 = F2; + F2 = E2; + E2 = D2 + T12 | 0; + D2 = C3; + C3 = B2; + B2 = A2; + A2 = T12 + T22 | 0; + } + A2 = A2 + this.A | 0; + B2 = B2 + this.B | 0; + C3 = C3 + this.C | 0; + D2 = D2 + this.D | 0; + E2 = E2 + this.E | 0; + F2 = F2 + this.F | 0; + G2 = G2 + this.G | 0; + H2 = H2 + this.H | 0; + this.set(A2, B2, C3, D2, E2, F2, G2, H2); + } + roundClean() { + SHA256_W$1.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } +}; +const sha256$2 = /* @__PURE__ */ wrapConstructor$1(() => new SHA256$2()); +var lib = {}; +function inRange(a3, min, max) { + return min <= a3 && a3 <= max; +} +function ToDictionary(o2) { + if (o2 === void 0) + return {}; + if (o2 === Object(o2)) + return o2; + throw TypeError("Could not convert argument to dictionary"); +} +function stringToCodePoints(string2) { + var s2 = String(string2); + var n5 = s2.length; + var i2 = 0; + var u2 = []; + while (i2 < n5) { + var c2 = s2.charCodeAt(i2); + if (c2 < 55296 || c2 > 57343) { + u2.push(c2); + } else if (56320 <= c2 && c2 <= 57343) { + u2.push(65533); + } else if (55296 <= c2 && c2 <= 56319) { + if (i2 === n5 - 1) { + u2.push(65533); + } else { + var d4 = string2.charCodeAt(i2 + 1); + if (56320 <= d4 && d4 <= 57343) { + var a3 = c2 & 1023; + var b2 = d4 & 1023; + u2.push(65536 + (a3 << 10) + b2); + i2 += 1; + } else { + u2.push(65533); + } + } + } + i2 += 1; + } + return u2; +} +function codePointsToString(code_points) { + var s2 = ""; + for (var i2 = 0; i2 < code_points.length; ++i2) { + var cp = code_points[i2]; + if (cp <= 65535) { + s2 += String.fromCharCode(cp); + } else { + cp -= 65536; + s2 += String.fromCharCode( + (cp >> 10) + 55296, + (cp & 1023) + 56320 + ); + } + } + return s2; +} +var end_of_stream = -1; +function Stream(tokens) { + this.tokens = [].slice.call(tokens); +} +Stream.prototype = { + /** + * @return {boolean} True if end-of-stream has been hit. + */ + endOfStream: function() { + return !this.tokens.length; + }, + /** + * When a token is read from a stream, the first token in the + * stream must be returned and subsequently removed, and + * end-of-stream must be returned otherwise. + * + * @return {number} Get the next token from the stream, or + * end_of_stream. + */ + read: function() { + if (!this.tokens.length) + return end_of_stream; + return this.tokens.shift(); + }, + /** + * When one or more tokens are prepended to a stream, those tokens + * must be inserted, in given order, before the first token in the + * stream. + * + * @param {(number|!Array.)} token The token(s) to prepend to the stream. + */ + prepend: function(token2) { + if (Array.isArray(token2)) { + var tokens = ( + /**@type {!Array.}*/ + token2 + ); + while (tokens.length) + this.tokens.unshift(tokens.pop()); + } else { + this.tokens.unshift(token2); + } + }, + /** + * When one or more tokens are pushed to a stream, those tokens + * must be inserted, in given order, after the last token in the + * stream. + * + * @param {(number|!Array.)} token The tokens(s) to prepend to the stream. + */ + push: function(token2) { + if (Array.isArray(token2)) { + var tokens = ( + /**@type {!Array.}*/ + token2 + ); + while (tokens.length) + this.tokens.push(tokens.shift()); + } else { + this.tokens.push(token2); + } + } +}; +var finished = -1; +function decoderError(fatal, opt_code_point) { + if (fatal) + throw TypeError("Decoder error"); + return opt_code_point || 65533; +} +var DEFAULT_ENCODING = "utf-8"; +function TextDecoder$1(encoding2, options) { + if (!(this instanceof TextDecoder$1)) { + return new TextDecoder$1(encoding2, options); + } + encoding2 = encoding2 !== void 0 ? String(encoding2).toLowerCase() : DEFAULT_ENCODING; + if (encoding2 !== DEFAULT_ENCODING) { + throw new Error("Encoding not supported. Only utf-8 is supported"); + } + options = ToDictionary(options); + this._streaming = false; + this._BOMseen = false; + this._decoder = null; + this._fatal = Boolean(options["fatal"]); + this._ignoreBOM = Boolean(options["ignoreBOM"]); + Object.defineProperty(this, "encoding", { value: "utf-8" }); + Object.defineProperty(this, "fatal", { value: this._fatal }); + Object.defineProperty(this, "ignoreBOM", { value: this._ignoreBOM }); +} +TextDecoder$1.prototype = { + /** + * @param {ArrayBufferView=} input The buffer of bytes to decode. + * @param {Object=} options + * @return {string} The decoded string. + */ + decode: function decode(input, options) { + var bytes2; + if (typeof input === "object" && input instanceof ArrayBuffer) { + bytes2 = new Uint8Array(input); + } else if (typeof input === "object" && "buffer" in input && input.buffer instanceof ArrayBuffer) { + bytes2 = new Uint8Array( + input.buffer, + input.byteOffset, + input.byteLength + ); + } else { + bytes2 = new Uint8Array(0); + } + options = ToDictionary(options); + if (!this._streaming) { + this._decoder = new UTF8Decoder({ fatal: this._fatal }); + this._BOMseen = false; + } + this._streaming = Boolean(options["stream"]); + var input_stream = new Stream(bytes2); + var code_points = []; + var result; + while (!input_stream.endOfStream()) { + result = this._decoder.handler(input_stream, input_stream.read()); + if (result === finished) + break; + if (result === null) + continue; + if (Array.isArray(result)) + code_points.push.apply( + code_points, + /**@type {!Array.}*/ + result + ); + else + code_points.push(result); + } + if (!this._streaming) { + do { + result = this._decoder.handler(input_stream, input_stream.read()); + if (result === finished) + break; + if (result === null) + continue; + if (Array.isArray(result)) + code_points.push.apply( + code_points, + /**@type {!Array.}*/ + result + ); + else + code_points.push(result); + } while (!input_stream.endOfStream()); + this._decoder = null; + } + if (code_points.length) { + if (["utf-8"].indexOf(this.encoding) !== -1 && !this._ignoreBOM && !this._BOMseen) { + if (code_points[0] === 65279) { + this._BOMseen = true; + code_points.shift(); + } else { + this._BOMseen = true; + } + } + } + return codePointsToString(code_points); + } +}; +function TextEncoder$1(encoding2, options) { + if (!(this instanceof TextEncoder$1)) + return new TextEncoder$1(encoding2, options); + encoding2 = encoding2 !== void 0 ? String(encoding2).toLowerCase() : DEFAULT_ENCODING; + if (encoding2 !== DEFAULT_ENCODING) { + throw new Error("Encoding not supported. Only utf-8 is supported"); + } + options = ToDictionary(options); + this._streaming = false; + this._encoder = null; + this._options = { fatal: Boolean(options["fatal"]) }; + Object.defineProperty(this, "encoding", { value: "utf-8" }); +} +TextEncoder$1.prototype = { + /** + * @param {string=} opt_string The string to encode. + * @param {Object=} options + * @return {Uint8Array} Encoded bytes, as a Uint8Array. + */ + encode: function encode2(opt_string, options) { + opt_string = opt_string ? String(opt_string) : ""; + options = ToDictionary(options); + if (!this._streaming) + this._encoder = new UTF8Encoder(this._options); + this._streaming = Boolean(options["stream"]); + var bytes2 = []; + var input_stream = new Stream(stringToCodePoints(opt_string)); + var result; + while (!input_stream.endOfStream()) { + result = this._encoder.handler(input_stream, input_stream.read()); + if (result === finished) + break; + if (Array.isArray(result)) + bytes2.push.apply( + bytes2, + /**@type {!Array.}*/ + result + ); + else + bytes2.push(result); + } + if (!this._streaming) { + while (true) { + result = this._encoder.handler(input_stream, input_stream.read()); + if (result === finished) + break; + if (Array.isArray(result)) + bytes2.push.apply( + bytes2, + /**@type {!Array.}*/ + result + ); + else + bytes2.push(result); + } + this._encoder = null; + } + return new Uint8Array(bytes2); + } +}; +function UTF8Decoder(options) { + var fatal = options.fatal; + var utf8_code_point = 0, utf8_bytes_seen = 0, utf8_bytes_needed = 0, utf8_lower_boundary = 128, utf8_upper_boundary = 191; + this.handler = function(stream2, bite) { + if (bite === end_of_stream && utf8_bytes_needed !== 0) { + utf8_bytes_needed = 0; + return decoderError(fatal); + } + if (bite === end_of_stream) + return finished; + if (utf8_bytes_needed === 0) { + if (inRange(bite, 0, 127)) { + return bite; + } + if (inRange(bite, 194, 223)) { + utf8_bytes_needed = 1; + utf8_code_point = bite - 192; + } else if (inRange(bite, 224, 239)) { + if (bite === 224) + utf8_lower_boundary = 160; + if (bite === 237) + utf8_upper_boundary = 159; + utf8_bytes_needed = 2; + utf8_code_point = bite - 224; + } else if (inRange(bite, 240, 244)) { + if (bite === 240) + utf8_lower_boundary = 144; + if (bite === 244) + utf8_upper_boundary = 143; + utf8_bytes_needed = 3; + utf8_code_point = bite - 240; + } else { + return decoderError(fatal); + } + utf8_code_point = utf8_code_point << 6 * utf8_bytes_needed; + return null; + } + if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) { + utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; + utf8_lower_boundary = 128; + utf8_upper_boundary = 191; + stream2.prepend(bite); + return decoderError(fatal); + } + utf8_lower_boundary = 128; + utf8_upper_boundary = 191; + utf8_bytes_seen += 1; + utf8_code_point += bite - 128 << 6 * (utf8_bytes_needed - utf8_bytes_seen); + if (utf8_bytes_seen !== utf8_bytes_needed) + return null; + var code_point = utf8_code_point; + utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; + return code_point; + }; +} +function UTF8Encoder(options) { + options.fatal; + this.handler = function(stream2, code_point) { + if (code_point === end_of_stream) + return finished; + if (inRange(code_point, 0, 127)) + return code_point; + var count, offset2; + if (inRange(code_point, 128, 2047)) { + count = 1; + offset2 = 192; + } else if (inRange(code_point, 2048, 65535)) { + count = 2; + offset2 = 224; + } else if (inRange(code_point, 65536, 1114111)) { + count = 3; + offset2 = 240; + } + var bytes2 = [(code_point >> 6 * count) + offset2]; + while (count > 0) { + var temp = code_point >> 6 * (count - 1); + bytes2.push(128 | temp & 63); + count -= 1; + } + return bytes2; + }; +} +const encoding$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + TextDecoder: TextDecoder$1, + TextEncoder: TextEncoder$1 +}, Symbol.toStringTag, { value: "Module" })); +const require$$2 = /* @__PURE__ */ getAugmentedNamespace(encoding$1); +var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k2]; + } }); +} : function(o2, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o2[k22] = m3[k2]; +}); +var __setModuleDefault = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o2, v6) { + Object.defineProperty(o2, "default", { enumerable: true, value: v6 }); +} : function(o2, v6) { + o2["default"] = v6; +}); +var __decorate = commonjsGlobal && commonjsGlobal.__decorate || function(decorators, target, key2, desc) { + var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d4; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r2 = Reflect.decorate(decorators, target, key2, desc); + else + for (var i2 = decorators.length - 1; i2 >= 0; i2--) + if (d4 = decorators[i2]) + r2 = (c2 < 3 ? d4(r2) : c2 > 3 ? d4(target, key2, r2) : d4(target, key2)) || r2; + return c2 > 3 && r2 && Object.defineProperty(target, key2, r2), r2; +}; +var __importStar = commonjsGlobal && commonjsGlobal.__importStar || function(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result = {}; + if (mod2 != null) { + for (var k2 in mod2) + if (k2 !== "default" && Object.hasOwnProperty.call(mod2, k2)) + __createBinding(result, mod2, k2); + } + __setModuleDefault(result, mod2); + return result; +}; +var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod2) { + return mod2 && mod2.__esModule ? mod2 : { "default": mod2 }; +}; +Object.defineProperty(lib, "__esModule", { value: true }); +var deserializeUnchecked_1 = lib.deserializeUnchecked = deserialize_1 = lib.deserialize = serialize_1 = lib.serialize = lib.BinaryReader = lib.BinaryWriter = lib.BorshError = lib.baseDecode = lib.baseEncode = void 0; +const bn_js_1 = __importDefault(bnExports); +const bs58_1 = __importDefault(bs58$2); +const encoding = __importStar(require$$2); +const ResolvedTextDecoder = typeof TextDecoder !== "function" ? encoding.TextDecoder : TextDecoder; +const textDecoder = new ResolvedTextDecoder("utf-8", { fatal: true }); +function baseEncode(value) { + if (typeof value === "string") { + value = Buffer.from(value, "utf8"); + } + return bs58_1.default.encode(Buffer.from(value)); +} +lib.baseEncode = baseEncode; +function baseDecode(value) { + return Buffer.from(bs58_1.default.decode(value)); +} +lib.baseDecode = baseDecode; +const INITIAL_LENGTH = 1024; +class BorshError extends Error { + constructor(message2) { + super(message2); + this.fieldPath = []; + this.originalMessage = message2; + } + addToFieldPath(fieldName) { + this.fieldPath.splice(0, 0, fieldName); + this.message = this.originalMessage + ": " + this.fieldPath.join("."); + } +} +lib.BorshError = BorshError; +class BinaryWriter { + constructor() { + this.buf = Buffer.alloc(INITIAL_LENGTH); + this.length = 0; + } + maybeResize() { + if (this.buf.length < 16 + this.length) { + this.buf = Buffer.concat([this.buf, Buffer.alloc(INITIAL_LENGTH)]); + } + } + writeU8(value) { + this.maybeResize(); + this.buf.writeUInt8(value, this.length); + this.length += 1; + } + writeU16(value) { + this.maybeResize(); + this.buf.writeUInt16LE(value, this.length); + this.length += 2; + } + writeU32(value) { + this.maybeResize(); + this.buf.writeUInt32LE(value, this.length); + this.length += 4; + } + writeU64(value) { + this.maybeResize(); + this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 8))); + } + writeU128(value) { + this.maybeResize(); + this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 16))); + } + writeU256(value) { + this.maybeResize(); + this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 32))); + } + writeU512(value) { + this.maybeResize(); + this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 64))); + } + writeBuffer(buffer2) { + this.buf = Buffer.concat([ + Buffer.from(this.buf.subarray(0, this.length)), + buffer2, + Buffer.alloc(INITIAL_LENGTH) + ]); + this.length += buffer2.length; + } + writeString(str) { + this.maybeResize(); + const b2 = Buffer.from(str, "utf8"); + this.writeU32(b2.length); + this.writeBuffer(b2); + } + writeFixedArray(array2) { + this.writeBuffer(Buffer.from(array2)); + } + writeArray(array2, fn2) { + this.maybeResize(); + this.writeU32(array2.length); + for (const elem of array2) { + this.maybeResize(); + fn2(elem); + } + } + toArray() { + return this.buf.subarray(0, this.length); + } +} +lib.BinaryWriter = BinaryWriter; +function handlingRangeError(target, propertyKey, propertyDescriptor) { + const originalMethod = propertyDescriptor.value; + propertyDescriptor.value = function(...args) { + try { + return originalMethod.apply(this, args); + } catch (e18) { + if (e18 instanceof RangeError) { + const code2 = e18.code; + if (["ERR_BUFFER_OUT_OF_BOUNDS", "ERR_OUT_OF_RANGE"].indexOf(code2) >= 0) { + throw new BorshError("Reached the end of buffer when deserializing"); + } + } + throw e18; + } + }; +} +class BinaryReader { + constructor(buf) { + this.buf = buf; + this.offset = 0; + } + readU8() { + const value = this.buf.readUInt8(this.offset); + this.offset += 1; + return value; + } + readU16() { + const value = this.buf.readUInt16LE(this.offset); + this.offset += 2; + return value; + } + readU32() { + const value = this.buf.readUInt32LE(this.offset); + this.offset += 4; + return value; + } + readU64() { + const buf = this.readBuffer(8); + return new bn_js_1.default(buf, "le"); + } + readU128() { + const buf = this.readBuffer(16); + return new bn_js_1.default(buf, "le"); + } + readU256() { + const buf = this.readBuffer(32); + return new bn_js_1.default(buf, "le"); + } + readU512() { + const buf = this.readBuffer(64); + return new bn_js_1.default(buf, "le"); + } + readBuffer(len) { + if (this.offset + len > this.buf.length) { + throw new BorshError(`Expected buffer length ${len} isn't within bounds`); + } + const result = this.buf.slice(this.offset, this.offset + len); + this.offset += len; + return result; + } + readString() { + const len = this.readU32(); + const buf = this.readBuffer(len); + try { + return textDecoder.decode(buf); + } catch (e18) { + throw new BorshError(`Error decoding UTF-8 string: ${e18}`); + } + } + readFixedArray(len) { + return new Uint8Array(this.readBuffer(len)); + } + readArray(fn2) { + const len = this.readU32(); + const result = Array(); + for (let i2 = 0; i2 < len; ++i2) { + result.push(fn2()); + } + return result; + } +} +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readU8", null); +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readU16", null); +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readU32", null); +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readU64", null); +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readU128", null); +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readU256", null); +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readU512", null); +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readString", null); +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readFixedArray", null); +__decorate([ + handlingRangeError +], BinaryReader.prototype, "readArray", null); +lib.BinaryReader = BinaryReader; +function capitalizeFirstLetter(string2) { + return string2.charAt(0).toUpperCase() + string2.slice(1); +} +function serializeField(schema, fieldName, value, fieldType, writer) { + try { + if (typeof fieldType === "string") { + writer[`write${capitalizeFirstLetter(fieldType)}`](value); + } else if (fieldType instanceof Array) { + if (typeof fieldType[0] === "number") { + if (value.length !== fieldType[0]) { + throw new BorshError(`Expecting byte array of length ${fieldType[0]}, but got ${value.length} bytes`); + } + writer.writeFixedArray(value); + } else if (fieldType.length === 2 && typeof fieldType[1] === "number") { + if (value.length !== fieldType[1]) { + throw new BorshError(`Expecting byte array of length ${fieldType[1]}, but got ${value.length} bytes`); + } + for (let i2 = 0; i2 < fieldType[1]; i2++) { + serializeField(schema, null, value[i2], fieldType[0], writer); + } + } else { + writer.writeArray(value, (item) => { + serializeField(schema, fieldName, item, fieldType[0], writer); + }); + } + } else if (fieldType.kind !== void 0) { + switch (fieldType.kind) { + case "option": { + if (value === null || value === void 0) { + writer.writeU8(0); + } else { + writer.writeU8(1); + serializeField(schema, fieldName, value, fieldType.type, writer); + } + break; + } + case "map": { + writer.writeU32(value.size); + value.forEach((val, key2) => { + serializeField(schema, fieldName, key2, fieldType.key, writer); + serializeField(schema, fieldName, val, fieldType.value, writer); + }); + break; + } + default: + throw new BorshError(`FieldType ${fieldType} unrecognized`); + } + } else { + serializeStruct(schema, value, writer); + } + } catch (error) { + if (error instanceof BorshError) { + error.addToFieldPath(fieldName); + } + throw error; + } +} +function serializeStruct(schema, obj, writer) { + if (typeof obj.borshSerialize === "function") { + obj.borshSerialize(writer); + return; + } + const structSchema = schema.get(obj.constructor); + if (!structSchema) { + throw new BorshError(`Class ${obj.constructor.name} is missing in schema`); + } + if (structSchema.kind === "struct") { + structSchema.fields.map(([fieldName, fieldType]) => { + serializeField(schema, fieldName, obj[fieldName], fieldType, writer); + }); + } else if (structSchema.kind === "enum") { + const name2 = obj[structSchema.field]; + for (let idx = 0; idx < structSchema.values.length; ++idx) { + const [fieldName, fieldType] = structSchema.values[idx]; + if (fieldName === name2) { + writer.writeU8(idx); + serializeField(schema, fieldName, obj[fieldName], fieldType, writer); + break; + } + } + } else { + throw new BorshError(`Unexpected schema kind: ${structSchema.kind} for ${obj.constructor.name}`); + } +} +function serialize(schema, obj, Writer2 = BinaryWriter) { + const writer = new Writer2(); + serializeStruct(schema, obj, writer); + return writer.toArray(); +} +var serialize_1 = lib.serialize = serialize; +function deserializeField(schema, fieldName, fieldType, reader) { + try { + if (typeof fieldType === "string") { + return reader[`read${capitalizeFirstLetter(fieldType)}`](); + } + if (fieldType instanceof Array) { + if (typeof fieldType[0] === "number") { + return reader.readFixedArray(fieldType[0]); + } else if (typeof fieldType[1] === "number") { + const arr = []; + for (let i2 = 0; i2 < fieldType[1]; i2++) { + arr.push(deserializeField(schema, null, fieldType[0], reader)); + } + return arr; + } else { + return reader.readArray(() => deserializeField(schema, fieldName, fieldType[0], reader)); + } + } + if (fieldType.kind === "option") { + const option = reader.readU8(); + if (option) { + return deserializeField(schema, fieldName, fieldType.type, reader); + } + return void 0; + } + if (fieldType.kind === "map") { + let map = /* @__PURE__ */ new Map(); + const length = reader.readU32(); + for (let i2 = 0; i2 < length; i2++) { + const key2 = deserializeField(schema, fieldName, fieldType.key, reader); + const val = deserializeField(schema, fieldName, fieldType.value, reader); + map.set(key2, val); + } + return map; + } + return deserializeStruct(schema, fieldType, reader); + } catch (error) { + if (error instanceof BorshError) { + error.addToFieldPath(fieldName); + } + throw error; + } +} +function deserializeStruct(schema, classType, reader) { + if (typeof classType.borshDeserialize === "function") { + return classType.borshDeserialize(reader); + } + const structSchema = schema.get(classType); + if (!structSchema) { + throw new BorshError(`Class ${classType.name} is missing in schema`); + } + if (structSchema.kind === "struct") { + const result = {}; + for (const [fieldName, fieldType] of schema.get(classType).fields) { + result[fieldName] = deserializeField(schema, fieldName, fieldType, reader); + } + return new classType(result); + } + if (structSchema.kind === "enum") { + const idx = reader.readU8(); + if (idx >= structSchema.values.length) { + throw new BorshError(`Enum index: ${idx} is out of range`); + } + const [fieldName, fieldType] = structSchema.values[idx]; + const fieldValue = deserializeField(schema, fieldName, fieldType, reader); + return new classType({ [fieldName]: fieldValue }); + } + throw new BorshError(`Unexpected schema kind: ${structSchema.kind} for ${classType.constructor.name}`); +} +function deserialize(schema, classType, buffer2, Reader2 = BinaryReader) { + const reader = new Reader2(buffer2); + const result = deserializeStruct(schema, classType, reader); + if (reader.offset < buffer2.length) { + throw new BorshError(`Unexpected ${buffer2.length - reader.offset} bytes after deserialized data`); + } + return result; +} +var deserialize_1 = lib.deserialize = deserialize; +function deserializeUnchecked(schema, classType, buffer2, Reader2 = BinaryReader) { + const reader = new Reader2(buffer2); + return deserializeStruct(schema, classType, reader); +} +deserializeUnchecked_1 = lib.deserializeUnchecked = deserializeUnchecked; +var Layout$1 = {}; +Object.defineProperty(Layout$1, "__esModule", { value: true }); +Layout$1.s16 = Layout$1.s8 = Layout$1.nu64be = Layout$1.u48be = Layout$1.u40be = Layout$1.u32be = Layout$1.u24be = Layout$1.u16be = nu64 = Layout$1.nu64 = Layout$1.u48 = Layout$1.u40 = u32$1 = Layout$1.u32 = Layout$1.u24 = u16 = Layout$1.u16 = u8 = Layout$1.u8 = offset = Layout$1.offset = Layout$1.greedy = Layout$1.Constant = Layout$1.UTF8 = Layout$1.CString = Layout$1.Blob = Layout$1.Boolean = Layout$1.BitField = Layout$1.BitStructure = Layout$1.VariantLayout = Layout$1.Union = Layout$1.UnionLayoutDiscriminator = Layout$1.UnionDiscriminator = Layout$1.Structure = Layout$1.Sequence = Layout$1.DoubleBE = Layout$1.Double = Layout$1.FloatBE = Layout$1.Float = Layout$1.NearInt64BE = Layout$1.NearInt64 = Layout$1.NearUInt64BE = Layout$1.NearUInt64 = Layout$1.IntBE = Layout$1.Int = Layout$1.UIntBE = Layout$1.UInt = Layout$1.OffsetLayout = Layout$1.GreedyCount = Layout$1.ExternalLayout = Layout$1.bindConstructorLayout = Layout$1.nameWithProperty = Layout$1.Layout = Layout$1.uint8ArrayToBuffer = Layout$1.checkUint8Array = void 0; +Layout$1.constant = Layout$1.utf8 = Layout$1.cstr = blob = Layout$1.blob = Layout$1.unionLayoutDiscriminator = Layout$1.union = seq = Layout$1.seq = Layout$1.bits = struct = Layout$1.struct = Layout$1.f64be = Layout$1.f64 = Layout$1.f32be = Layout$1.f32 = Layout$1.ns64be = Layout$1.s48be = Layout$1.s40be = Layout$1.s32be = Layout$1.s24be = Layout$1.s16be = ns64 = Layout$1.ns64 = Layout$1.s48 = Layout$1.s40 = Layout$1.s32 = Layout$1.s24 = void 0; +const buffer_1 = buffer; +function checkUint8Array(b2) { + if (!(b2 instanceof Uint8Array)) { + throw new TypeError("b must be a Uint8Array"); + } +} +Layout$1.checkUint8Array = checkUint8Array; +function uint8ArrayToBuffer(b2) { + checkUint8Array(b2); + return buffer_1.Buffer.from(b2.buffer, b2.byteOffset, b2.length); +} +Layout$1.uint8ArrayToBuffer = uint8ArrayToBuffer; +class Layout { + constructor(span, property) { + if (!Number.isInteger(span)) { + throw new TypeError("span must be an integer"); + } + this.span = span; + this.property = property; + } + /** Function to create an Object into which decoded properties will + * be written. + * + * Used only for layouts that {@link Layout#decode|decode} to Object + * instances, which means: + * * {@link Structure} + * * {@link Union} + * * {@link VariantLayout} + * * {@link BitStructure} + * + * If left undefined the JavaScript representation of these layouts + * will be Object instances. + * + * See {@link bindConstructorLayout}. + */ + makeDestinationObject() { + return {}; + } + /** + * Calculate the span of a specific instance of a layout. + * + * @param {Uint8Array} b - the buffer that contains an encoded instance. + * + * @param {Number} [offset] - the offset at which the encoded instance + * starts. If absent a zero offset is inferred. + * + * @return {Number} - the number of bytes covered by the layout + * instance. If this method is not overridden in a subclass the + * definition-time constant {@link Layout#span|span} will be + * returned. + * + * @throws {RangeError} - if the length of the value cannot be + * determined. + */ + getSpan(b2, offset2) { + if (0 > this.span) { + throw new RangeError("indeterminate span"); + } + return this.span; + } + /** + * Replicate the layout using a new property. + * + * This function must be used to get a structurally-equivalent layout + * with a different name since all {@link Layout} instances are + * immutable. + * + * **NOTE** This is a shallow copy. All fields except {@link + * Layout#property|property} are strictly equal to the origin layout. + * + * @param {String} property - the value for {@link + * Layout#property|property} in the replica. + * + * @returns {Layout} - the copy with {@link Layout#property|property} + * set to `property`. + */ + replicate(property) { + const rv2 = Object.create(this.constructor.prototype); + Object.assign(rv2, this); + rv2.property = property; + return rv2; + } + /** + * Create an object from layout properties and an array of values. + * + * **NOTE** This function returns `undefined` if invoked on a layout + * that does not return its value as an Object. Objects are + * returned for things that are a {@link Structure}, which includes + * {@link VariantLayout|variant layouts} if they are structures, and + * excludes {@link Union}s. If you want this feature for a union + * you must use {@link Union.getVariant|getVariant} to select the + * desired layout. + * + * @param {Array} values - an array of values that correspond to the + * default order for properties. As with {@link Layout#decode|decode} + * layout elements that have no property name are skipped when + * iterating over the array values. Only the top-level properties are + * assigned; arguments are not assigned to properties of contained + * layouts. Any unused values are ignored. + * + * @return {(Object|undefined)} + */ + fromArray(values) { + return void 0; + } +} +Layout$1.Layout = Layout; +function nameWithProperty(name2, lo2) { + if (lo2.property) { + return name2 + "[" + lo2.property + "]"; + } + return name2; +} +Layout$1.nameWithProperty = nameWithProperty; +function bindConstructorLayout(Class, layout) { + if ("function" !== typeof Class) { + throw new TypeError("Class must be constructor"); + } + if (Object.prototype.hasOwnProperty.call(Class, "layout_")) { + throw new Error("Class is already bound to a layout"); + } + if (!(layout && layout instanceof Layout)) { + throw new TypeError("layout must be a Layout"); + } + if (Object.prototype.hasOwnProperty.call(layout, "boundConstructor_")) { + throw new Error("layout is already bound to a constructor"); + } + Class.layout_ = layout; + layout.boundConstructor_ = Class; + layout.makeDestinationObject = () => new Class(); + Object.defineProperty(Class.prototype, "encode", { + value(b2, offset2) { + return layout.encode(this, b2, offset2); + }, + writable: true + }); + Object.defineProperty(Class, "decode", { + value(b2, offset2) { + return layout.decode(b2, offset2); + }, + writable: true + }); +} +Layout$1.bindConstructorLayout = bindConstructorLayout; +class ExternalLayout extends Layout { + /** + * Return `true` iff the external layout decodes to an unsigned + * integer layout. + * + * In that case it can be used as the source of {@link + * Sequence#count|Sequence counts}, {@link Blob#length|Blob lengths}, + * or as {@link UnionLayoutDiscriminator#layout|external union + * discriminators}. + * + * @abstract + */ + isCount() { + throw new Error("ExternalLayout is abstract"); + } +} +Layout$1.ExternalLayout = ExternalLayout; +class GreedyCount extends ExternalLayout { + constructor(elementSpan = 1, property) { + if (!Number.isInteger(elementSpan) || 0 >= elementSpan) { + throw new TypeError("elementSpan must be a (positive) integer"); + } + super(-1, property); + this.elementSpan = elementSpan; + } + /** @override */ + isCount() { + return true; + } + /** @override */ + decode(b2, offset2 = 0) { + checkUint8Array(b2); + const rem = b2.length - offset2; + return Math.floor(rem / this.elementSpan); + } + /** @override */ + encode(src2, b2, offset2) { + return 0; + } +} +Layout$1.GreedyCount = GreedyCount; +class OffsetLayout extends ExternalLayout { + constructor(layout, offset2 = 0, property) { + if (!(layout instanceof Layout)) { + throw new TypeError("layout must be a Layout"); + } + if (!Number.isInteger(offset2)) { + throw new TypeError("offset must be integer or undefined"); + } + super(layout.span, property || layout.property); + this.layout = layout; + this.offset = offset2; + } + /** @override */ + isCount() { + return this.layout instanceof UInt || this.layout instanceof UIntBE; + } + /** @override */ + decode(b2, offset2 = 0) { + return this.layout.decode(b2, offset2 + this.offset); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + return this.layout.encode(src2, b2, offset2 + this.offset); + } +} +Layout$1.OffsetLayout = OffsetLayout; +class UInt extends Layout { + constructor(span, property) { + super(span, property); + if (6 < this.span) { + throw new RangeError("span must not exceed 6 bytes"); + } + } + /** @override */ + decode(b2, offset2 = 0) { + return uint8ArrayToBuffer(b2).readUIntLE(offset2, this.span); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + uint8ArrayToBuffer(b2).writeUIntLE(src2, offset2, this.span); + return this.span; + } +} +Layout$1.UInt = UInt; +class UIntBE extends Layout { + constructor(span, property) { + super(span, property); + if (6 < this.span) { + throw new RangeError("span must not exceed 6 bytes"); + } + } + /** @override */ + decode(b2, offset2 = 0) { + return uint8ArrayToBuffer(b2).readUIntBE(offset2, this.span); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + uint8ArrayToBuffer(b2).writeUIntBE(src2, offset2, this.span); + return this.span; + } +} +Layout$1.UIntBE = UIntBE; +class Int extends Layout { + constructor(span, property) { + super(span, property); + if (6 < this.span) { + throw new RangeError("span must not exceed 6 bytes"); + } + } + /** @override */ + decode(b2, offset2 = 0) { + return uint8ArrayToBuffer(b2).readIntLE(offset2, this.span); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + uint8ArrayToBuffer(b2).writeIntLE(src2, offset2, this.span); + return this.span; + } +} +Layout$1.Int = Int; +class IntBE extends Layout { + constructor(span, property) { + super(span, property); + if (6 < this.span) { + throw new RangeError("span must not exceed 6 bytes"); + } + } + /** @override */ + decode(b2, offset2 = 0) { + return uint8ArrayToBuffer(b2).readIntBE(offset2, this.span); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + uint8ArrayToBuffer(b2).writeIntBE(src2, offset2, this.span); + return this.span; + } +} +Layout$1.IntBE = IntBE; +const V2E32 = Math.pow(2, 32); +function divmodInt64(src2) { + const hi32 = Math.floor(src2 / V2E32); + const lo32 = src2 - hi32 * V2E32; + return { hi32, lo32 }; +} +function roundedInt64(hi32, lo32) { + return hi32 * V2E32 + lo32; +} +class NearUInt64 extends Layout { + constructor(property) { + super(8, property); + } + /** @override */ + decode(b2, offset2 = 0) { + const buffer2 = uint8ArrayToBuffer(b2); + const lo32 = buffer2.readUInt32LE(offset2); + const hi32 = buffer2.readUInt32LE(offset2 + 4); + return roundedInt64(hi32, lo32); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + const split2 = divmodInt64(src2); + const buffer2 = uint8ArrayToBuffer(b2); + buffer2.writeUInt32LE(split2.lo32, offset2); + buffer2.writeUInt32LE(split2.hi32, offset2 + 4); + return 8; + } +} +Layout$1.NearUInt64 = NearUInt64; +class NearUInt64BE extends Layout { + constructor(property) { + super(8, property); + } + /** @override */ + decode(b2, offset2 = 0) { + const buffer2 = uint8ArrayToBuffer(b2); + const hi32 = buffer2.readUInt32BE(offset2); + const lo32 = buffer2.readUInt32BE(offset2 + 4); + return roundedInt64(hi32, lo32); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + const split2 = divmodInt64(src2); + const buffer2 = uint8ArrayToBuffer(b2); + buffer2.writeUInt32BE(split2.hi32, offset2); + buffer2.writeUInt32BE(split2.lo32, offset2 + 4); + return 8; + } +} +Layout$1.NearUInt64BE = NearUInt64BE; +class NearInt64 extends Layout { + constructor(property) { + super(8, property); + } + /** @override */ + decode(b2, offset2 = 0) { + const buffer2 = uint8ArrayToBuffer(b2); + const lo32 = buffer2.readUInt32LE(offset2); + const hi32 = buffer2.readInt32LE(offset2 + 4); + return roundedInt64(hi32, lo32); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + const split2 = divmodInt64(src2); + const buffer2 = uint8ArrayToBuffer(b2); + buffer2.writeUInt32LE(split2.lo32, offset2); + buffer2.writeInt32LE(split2.hi32, offset2 + 4); + return 8; + } +} +Layout$1.NearInt64 = NearInt64; +class NearInt64BE extends Layout { + constructor(property) { + super(8, property); + } + /** @override */ + decode(b2, offset2 = 0) { + const buffer2 = uint8ArrayToBuffer(b2); + const hi32 = buffer2.readInt32BE(offset2); + const lo32 = buffer2.readUInt32BE(offset2 + 4); + return roundedInt64(hi32, lo32); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + const split2 = divmodInt64(src2); + const buffer2 = uint8ArrayToBuffer(b2); + buffer2.writeInt32BE(split2.hi32, offset2); + buffer2.writeUInt32BE(split2.lo32, offset2 + 4); + return 8; + } +} +Layout$1.NearInt64BE = NearInt64BE; +class Float extends Layout { + constructor(property) { + super(4, property); + } + /** @override */ + decode(b2, offset2 = 0) { + return uint8ArrayToBuffer(b2).readFloatLE(offset2); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + uint8ArrayToBuffer(b2).writeFloatLE(src2, offset2); + return 4; + } +} +Layout$1.Float = Float; +class FloatBE extends Layout { + constructor(property) { + super(4, property); + } + /** @override */ + decode(b2, offset2 = 0) { + return uint8ArrayToBuffer(b2).readFloatBE(offset2); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + uint8ArrayToBuffer(b2).writeFloatBE(src2, offset2); + return 4; + } +} +Layout$1.FloatBE = FloatBE; +class Double extends Layout { + constructor(property) { + super(8, property); + } + /** @override */ + decode(b2, offset2 = 0) { + return uint8ArrayToBuffer(b2).readDoubleLE(offset2); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + uint8ArrayToBuffer(b2).writeDoubleLE(src2, offset2); + return 8; + } +} +Layout$1.Double = Double; +class DoubleBE extends Layout { + constructor(property) { + super(8, property); + } + /** @override */ + decode(b2, offset2 = 0) { + return uint8ArrayToBuffer(b2).readDoubleBE(offset2); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + uint8ArrayToBuffer(b2).writeDoubleBE(src2, offset2); + return 8; + } +} +Layout$1.DoubleBE = DoubleBE; +class Sequence extends Layout { + constructor(elementLayout, count, property) { + if (!(elementLayout instanceof Layout)) { + throw new TypeError("elementLayout must be a Layout"); + } + if (!(count instanceof ExternalLayout && count.isCount() || Number.isInteger(count) && 0 <= count)) { + throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout"); + } + let span = -1; + if (!(count instanceof ExternalLayout) && 0 < elementLayout.span) { + span = count * elementLayout.span; + } + super(span, property); + this.elementLayout = elementLayout; + this.count = count; + } + /** @override */ + getSpan(b2, offset2 = 0) { + if (0 <= this.span) { + return this.span; + } + let span = 0; + let count = this.count; + if (count instanceof ExternalLayout) { + count = count.decode(b2, offset2); + } + if (0 < this.elementLayout.span) { + span = count * this.elementLayout.span; + } else { + let idx = 0; + while (idx < count) { + span += this.elementLayout.getSpan(b2, offset2 + span); + ++idx; + } + } + return span; + } + /** @override */ + decode(b2, offset2 = 0) { + const rv2 = []; + let i2 = 0; + let count = this.count; + if (count instanceof ExternalLayout) { + count = count.decode(b2, offset2); + } + while (i2 < count) { + rv2.push(this.elementLayout.decode(b2, offset2)); + offset2 += this.elementLayout.getSpan(b2, offset2); + i2 += 1; + } + return rv2; + } + /** Implement {@link Layout#encode|encode} for {@link Sequence}. + * + * **NOTE** If `src` is shorter than {@link Sequence#count|count} then + * the unused space in the buffer is left unchanged. If `src` is + * longer than {@link Sequence#count|count} the unneeded elements are + * ignored. + * + * **NOTE** If {@link Layout#count|count} is an instance of {@link + * ExternalLayout} then the length of `src` will be encoded as the + * count after `src` is encoded. */ + encode(src2, b2, offset2 = 0) { + const elo = this.elementLayout; + const span = src2.reduce((span2, v6) => { + return span2 + elo.encode(v6, b2, offset2 + span2); + }, 0); + if (this.count instanceof ExternalLayout) { + this.count.encode(src2.length, b2, offset2); + } + return span; + } +} +Layout$1.Sequence = Sequence; +class Structure extends Layout { + constructor(fields, property, decodePrefixes) { + if (!(Array.isArray(fields) && fields.reduce((acc, v6) => acc && v6 instanceof Layout, true))) { + throw new TypeError("fields must be array of Layout instances"); + } + if ("boolean" === typeof property && void 0 === decodePrefixes) { + decodePrefixes = property; + property = void 0; + } + for (const fd2 of fields) { + if (0 > fd2.span && void 0 === fd2.property) { + throw new Error("fields cannot contain unnamed variable-length layout"); + } + } + let span = -1; + try { + span = fields.reduce((span2, fd2) => span2 + fd2.getSpan(), 0); + } catch (e18) { + } + super(span, property); + this.fields = fields; + this.decodePrefixes = !!decodePrefixes; + } + /** @override */ + getSpan(b2, offset2 = 0) { + if (0 <= this.span) { + return this.span; + } + let span = 0; + try { + span = this.fields.reduce((span2, fd2) => { + const fsp = fd2.getSpan(b2, offset2); + offset2 += fsp; + return span2 + fsp; + }, 0); + } catch (e18) { + throw new RangeError("indeterminate span"); + } + return span; + } + /** @override */ + decode(b2, offset2 = 0) { + checkUint8Array(b2); + const dest = this.makeDestinationObject(); + for (const fd2 of this.fields) { + if (void 0 !== fd2.property) { + dest[fd2.property] = fd2.decode(b2, offset2); + } + offset2 += fd2.getSpan(b2, offset2); + if (this.decodePrefixes && b2.length === offset2) { + break; + } + } + return dest; + } + /** Implement {@link Layout#encode|encode} for {@link Structure}. + * + * If `src` is missing a property for a member with a defined {@link + * Layout#property|property} the corresponding region of the buffer is + * left unmodified. */ + encode(src2, b2, offset2 = 0) { + const firstOffset = offset2; + let lastOffset = 0; + let lastWrote = 0; + for (const fd2 of this.fields) { + let span = fd2.span; + lastWrote = 0 < span ? span : 0; + if (void 0 !== fd2.property) { + const fv2 = src2[fd2.property]; + if (void 0 !== fv2) { + lastWrote = fd2.encode(fv2, b2, offset2); + if (0 > span) { + span = fd2.getSpan(b2, offset2); + } + } + } + lastOffset = offset2; + offset2 += span; + } + return lastOffset + lastWrote - firstOffset; + } + /** @override */ + fromArray(values) { + const dest = this.makeDestinationObject(); + for (const fd2 of this.fields) { + if (void 0 !== fd2.property && 0 < values.length) { + dest[fd2.property] = values.shift(); + } + } + return dest; + } + /** + * Get access to the layout of a given property. + * + * @param {String} property - the structure member of interest. + * + * @return {Layout} - the layout associated with `property`, or + * undefined if there is no such property. + */ + layoutFor(property) { + if ("string" !== typeof property) { + throw new TypeError("property must be string"); + } + for (const fd2 of this.fields) { + if (fd2.property === property) { + return fd2; + } + } + return void 0; + } + /** + * Get the offset of a structure member. + * + * @param {String} property - the structure member of interest. + * + * @return {Number} - the offset in bytes to the start of `property` + * within the structure, or undefined if `property` is not a field + * within the structure. If the property is a member but follows a + * variable-length structure member a negative number will be + * returned. + */ + offsetOf(property) { + if ("string" !== typeof property) { + throw new TypeError("property must be string"); + } + let offset2 = 0; + for (const fd2 of this.fields) { + if (fd2.property === property) { + return offset2; + } + if (0 > fd2.span) { + offset2 = -1; + } else if (0 <= offset2) { + offset2 += fd2.span; + } + } + return void 0; + } +} +Layout$1.Structure = Structure; +class UnionDiscriminator { + constructor(property) { + this.property = property; + } + /** Analog to {@link Layout#decode|Layout decode} for union discriminators. + * + * The implementation of this method need not reference the buffer if + * variant information is available through other means. */ + decode(b2, offset2) { + throw new Error("UnionDiscriminator is abstract"); + } + /** Analog to {@link Layout#decode|Layout encode} for union discriminators. + * + * The implementation of this method need not store the value if + * variant information is maintained through other means. */ + encode(src2, b2, offset2) { + throw new Error("UnionDiscriminator is abstract"); + } +} +Layout$1.UnionDiscriminator = UnionDiscriminator; +class UnionLayoutDiscriminator extends UnionDiscriminator { + constructor(layout, property) { + if (!(layout instanceof ExternalLayout && layout.isCount())) { + throw new TypeError("layout must be an unsigned integer ExternalLayout"); + } + super(property || layout.property || "variant"); + this.layout = layout; + } + /** Delegate decoding to {@link UnionLayoutDiscriminator#layout|layout}. */ + decode(b2, offset2) { + return this.layout.decode(b2, offset2); + } + /** Delegate encoding to {@link UnionLayoutDiscriminator#layout|layout}. */ + encode(src2, b2, offset2) { + return this.layout.encode(src2, b2, offset2); + } +} +Layout$1.UnionLayoutDiscriminator = UnionLayoutDiscriminator; +class Union extends Layout { + constructor(discr, defaultLayout, property) { + let discriminator; + if (discr instanceof UInt || discr instanceof UIntBE) { + discriminator = new UnionLayoutDiscriminator(new OffsetLayout(discr)); + } else if (discr instanceof ExternalLayout && discr.isCount()) { + discriminator = new UnionLayoutDiscriminator(discr); + } else if (!(discr instanceof UnionDiscriminator)) { + throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout"); + } else { + discriminator = discr; + } + if (void 0 === defaultLayout) { + defaultLayout = null; + } + if (!(null === defaultLayout || defaultLayout instanceof Layout)) { + throw new TypeError("defaultLayout must be null or a Layout"); + } + if (null !== defaultLayout) { + if (0 > defaultLayout.span) { + throw new Error("defaultLayout must have constant span"); + } + if (void 0 === defaultLayout.property) { + defaultLayout = defaultLayout.replicate("content"); + } + } + let span = -1; + if (defaultLayout) { + span = defaultLayout.span; + if (0 <= span && (discr instanceof UInt || discr instanceof UIntBE)) { + span += discriminator.layout.span; + } + } + super(span, property); + this.discriminator = discriminator; + this.usesPrefixDiscriminator = discr instanceof UInt || discr instanceof UIntBE; + this.defaultLayout = defaultLayout; + this.registry = {}; + let boundGetSourceVariant = this.defaultGetSourceVariant.bind(this); + this.getSourceVariant = function(src2) { + return boundGetSourceVariant(src2); + }; + this.configGetSourceVariant = function(gsv) { + boundGetSourceVariant = gsv.bind(this); + }; + } + /** @override */ + getSpan(b2, offset2 = 0) { + if (0 <= this.span) { + return this.span; + } + const vlo = this.getVariant(b2, offset2); + if (!vlo) { + throw new Error("unable to determine span for unrecognized variant"); + } + return vlo.getSpan(b2, offset2); + } + /** + * Method to infer a registered Union variant compatible with `src`. + * + * The first satisfied rule in the following sequence defines the + * return value: + * * If `src` has properties matching the Union discriminator and + * the default layout, `undefined` is returned regardless of the + * value of the discriminator property (this ensures the default + * layout will be used); + * * If `src` has a property matching the Union discriminator, the + * value of the discriminator identifies a registered variant, and + * either (a) the variant has no layout, or (b) `src` has the + * variant's property, then the variant is returned (because the + * source satisfies the constraints of the variant it identifies); + * * If `src` does not have a property matching the Union + * discriminator, but does have a property matching a registered + * variant, then the variant is returned (because the source + * matches a variant without an explicit conflict); + * * An error is thrown (because we either can't identify a variant, + * or we were explicitly told the variant but can't satisfy it). + * + * @param {Object} src - an object presumed to be compatible with + * the content of the Union. + * + * @return {(undefined|VariantLayout)} - as described above. + * + * @throws {Error} - if `src` cannot be associated with a default or + * registered variant. + */ + defaultGetSourceVariant(src2) { + if (Object.prototype.hasOwnProperty.call(src2, this.discriminator.property)) { + if (this.defaultLayout && this.defaultLayout.property && Object.prototype.hasOwnProperty.call(src2, this.defaultLayout.property)) { + return void 0; + } + const vlo = this.registry[src2[this.discriminator.property]]; + if (vlo && (!vlo.layout || vlo.property && Object.prototype.hasOwnProperty.call(src2, vlo.property))) { + return vlo; + } + } else { + for (const tag in this.registry) { + const vlo = this.registry[tag]; + if (vlo.property && Object.prototype.hasOwnProperty.call(src2, vlo.property)) { + return vlo; + } + } + } + throw new Error("unable to infer src variant"); + } + /** Implement {@link Layout#decode|decode} for {@link Union}. + * + * If the variant is {@link Union#addVariant|registered} the return + * value is an instance of that variant, with no explicit + * discriminator. Otherwise the {@link Union#defaultLayout|default + * layout} is used to decode the content. */ + decode(b2, offset2 = 0) { + let dest; + const dlo = this.discriminator; + const discr = dlo.decode(b2, offset2); + const clo = this.registry[discr]; + if (void 0 === clo) { + const defaultLayout = this.defaultLayout; + let contentOffset = 0; + if (this.usesPrefixDiscriminator) { + contentOffset = dlo.layout.span; + } + dest = this.makeDestinationObject(); + dest[dlo.property] = discr; + dest[defaultLayout.property] = defaultLayout.decode(b2, offset2 + contentOffset); + } else { + dest = clo.decode(b2, offset2); + } + return dest; + } + /** Implement {@link Layout#encode|encode} for {@link Union}. + * + * This API assumes the `src` object is consistent with the union's + * {@link Union#defaultLayout|default layout}. To encode variants + * use the appropriate variant-specific {@link VariantLayout#encode} + * method. */ + encode(src2, b2, offset2 = 0) { + const vlo = this.getSourceVariant(src2); + if (void 0 === vlo) { + const dlo = this.discriminator; + const clo = this.defaultLayout; + let contentOffset = 0; + if (this.usesPrefixDiscriminator) { + contentOffset = dlo.layout.span; + } + dlo.encode(src2[dlo.property], b2, offset2); + return contentOffset + clo.encode(src2[clo.property], b2, offset2 + contentOffset); + } + return vlo.encode(src2, b2, offset2); + } + /** Register a new variant structure within a union. The newly + * created variant is returned. + * + * @param {Number} variant - initializer for {@link + * VariantLayout#variant|variant}. + * + * @param {Layout} layout - initializer for {@link + * VariantLayout#layout|layout}. + * + * @param {String} property - initializer for {@link + * Layout#property|property}. + * + * @return {VariantLayout} */ + addVariant(variant, layout, property) { + const rv2 = new VariantLayout(this, variant, layout, property); + this.registry[variant] = rv2; + return rv2; + } + /** + * Get the layout associated with a registered variant. + * + * If `vb` does not produce a registered variant the function returns + * `undefined`. + * + * @param {(Number|Uint8Array)} vb - either the variant number, or a + * buffer from which the discriminator is to be read. + * + * @param {Number} offset - offset into `vb` for the start of the + * union. Used only when `vb` is an instance of {Uint8Array}. + * + * @return {({VariantLayout}|undefined)} + */ + getVariant(vb2, offset2 = 0) { + let variant; + if (vb2 instanceof Uint8Array) { + variant = this.discriminator.decode(vb2, offset2); + } else { + variant = vb2; + } + return this.registry[variant]; + } +} +Layout$1.Union = Union; +class VariantLayout extends Layout { + constructor(union2, variant, layout, property) { + if (!(union2 instanceof Union)) { + throw new TypeError("union must be a Union"); + } + if (!Number.isInteger(variant) || 0 > variant) { + throw new TypeError("variant must be a (non-negative) integer"); + } + if ("string" === typeof layout && void 0 === property) { + property = layout; + layout = null; + } + if (layout) { + if (!(layout instanceof Layout)) { + throw new TypeError("layout must be a Layout"); + } + if (null !== union2.defaultLayout && 0 <= layout.span && layout.span > union2.defaultLayout.span) { + throw new Error("variant span exceeds span of containing union"); + } + if ("string" !== typeof property) { + throw new TypeError("variant must have a String property"); + } + } + let span = union2.span; + if (0 > union2.span) { + span = layout ? layout.span : 0; + if (0 <= span && union2.usesPrefixDiscriminator) { + span += union2.discriminator.layout.span; + } + } + super(span, property); + this.union = union2; + this.variant = variant; + this.layout = layout || null; + } + /** @override */ + getSpan(b2, offset2 = 0) { + if (0 <= this.span) { + return this.span; + } + let contentOffset = 0; + if (this.union.usesPrefixDiscriminator) { + contentOffset = this.union.discriminator.layout.span; + } + let span = 0; + if (this.layout) { + span = this.layout.getSpan(b2, offset2 + contentOffset); + } + return contentOffset + span; + } + /** @override */ + decode(b2, offset2 = 0) { + const dest = this.makeDestinationObject(); + if (this !== this.union.getVariant(b2, offset2)) { + throw new Error("variant mismatch"); + } + let contentOffset = 0; + if (this.union.usesPrefixDiscriminator) { + contentOffset = this.union.discriminator.layout.span; + } + if (this.layout) { + dest[this.property] = this.layout.decode(b2, offset2 + contentOffset); + } else if (this.property) { + dest[this.property] = true; + } else if (this.union.usesPrefixDiscriminator) { + dest[this.union.discriminator.property] = this.variant; + } + return dest; + } + /** @override */ + encode(src2, b2, offset2 = 0) { + let contentOffset = 0; + if (this.union.usesPrefixDiscriminator) { + contentOffset = this.union.discriminator.layout.span; + } + if (this.layout && !Object.prototype.hasOwnProperty.call(src2, this.property)) { + throw new TypeError("variant lacks property " + this.property); + } + this.union.discriminator.encode(this.variant, b2, offset2); + let span = contentOffset; + if (this.layout) { + this.layout.encode(src2[this.property], b2, offset2 + contentOffset); + span += this.layout.getSpan(b2, offset2 + contentOffset); + if (0 <= this.union.span && span > this.union.span) { + throw new Error("encoded variant overruns containing union"); + } + } + return span; + } + /** Delegate {@link Layout#fromArray|fromArray} to {@link + * VariantLayout#layout|layout}. */ + fromArray(values) { + if (this.layout) { + return this.layout.fromArray(values); + } + return void 0; + } +} +Layout$1.VariantLayout = VariantLayout; +function fixBitwiseResult(v6) { + if (0 > v6) { + v6 += 4294967296; + } + return v6; +} +class BitStructure extends Layout { + constructor(word, msb, property) { + if (!(word instanceof UInt || word instanceof UIntBE)) { + throw new TypeError("word must be a UInt or UIntBE layout"); + } + if ("string" === typeof msb && void 0 === property) { + property = msb; + msb = false; + } + if (4 < word.span) { + throw new RangeError("word cannot exceed 32 bits"); + } + super(word.span, property); + this.word = word; + this.msb = !!msb; + this.fields = []; + let value = 0; + this._packedSetValue = function(v6) { + value = fixBitwiseResult(v6); + return this; + }; + this._packedGetValue = function() { + return value; + }; + } + /** @override */ + decode(b2, offset2 = 0) { + const dest = this.makeDestinationObject(); + const value = this.word.decode(b2, offset2); + this._packedSetValue(value); + for (const fd2 of this.fields) { + if (void 0 !== fd2.property) { + dest[fd2.property] = fd2.decode(b2); + } + } + return dest; + } + /** Implement {@link Layout#encode|encode} for {@link BitStructure}. + * + * If `src` is missing a property for a member with a defined {@link + * Layout#property|property} the corresponding region of the packed + * value is left unmodified. Unused bits are also left unmodified. */ + encode(src2, b2, offset2 = 0) { + const value = this.word.decode(b2, offset2); + this._packedSetValue(value); + for (const fd2 of this.fields) { + if (void 0 !== fd2.property) { + const fv2 = src2[fd2.property]; + if (void 0 !== fv2) { + fd2.encode(fv2); + } + } + } + return this.word.encode(this._packedGetValue(), b2, offset2); + } + /** Register a new bitfield with a containing bit structure. The + * resulting bitfield is returned. + * + * @param {Number} bits - initializer for {@link BitField#bits|bits}. + * + * @param {string} property - initializer for {@link + * Layout#property|property}. + * + * @return {BitField} */ + addField(bits, property) { + const bf2 = new BitField(this, bits, property); + this.fields.push(bf2); + return bf2; + } + /** As with {@link BitStructure#addField|addField} for single-bit + * fields with `boolean` value representation. + * + * @param {string} property - initializer for {@link + * Layout#property|property}. + * + * @return {Boolean} */ + // `Boolean` conflicts with the native primitive type + // eslint-disable-next-line @typescript-eslint/ban-types + addBoolean(property) { + const bf2 = new Boolean$1(this, property); + this.fields.push(bf2); + return bf2; + } + /** + * Get access to the bit field for a given property. + * + * @param {String} property - the bit field of interest. + * + * @return {BitField} - the field associated with `property`, or + * undefined if there is no such property. + */ + fieldFor(property) { + if ("string" !== typeof property) { + throw new TypeError("property must be string"); + } + for (const fd2 of this.fields) { + if (fd2.property === property) { + return fd2; + } + } + return void 0; + } +} +Layout$1.BitStructure = BitStructure; +class BitField { + constructor(container, bits, property) { + if (!(container instanceof BitStructure)) { + throw new TypeError("container must be a BitStructure"); + } + if (!Number.isInteger(bits) || 0 >= bits) { + throw new TypeError("bits must be positive integer"); + } + const totalBits = 8 * container.span; + const usedBits = container.fields.reduce((sum, fd2) => sum + fd2.bits, 0); + if (bits + usedBits > totalBits) { + throw new Error("bits too long for span remainder (" + (totalBits - usedBits) + " of " + totalBits + " remain)"); + } + this.container = container; + this.bits = bits; + this.valueMask = (1 << bits) - 1; + if (32 === bits) { + this.valueMask = 4294967295; + } + this.start = usedBits; + if (this.container.msb) { + this.start = totalBits - usedBits - bits; + } + this.wordMask = fixBitwiseResult(this.valueMask << this.start); + this.property = property; + } + /** Store a value into the corresponding subsequence of the containing + * bit field. */ + decode(b2, offset2) { + const word = this.container._packedGetValue(); + const wordValue = fixBitwiseResult(word & this.wordMask); + const value = wordValue >>> this.start; + return value; + } + /** Store a value into the corresponding subsequence of the containing + * bit field. + * + * **NOTE** This is not a specialization of {@link + * Layout#encode|Layout.encode} and there is no return value. */ + encode(value) { + if ("number" !== typeof value || !Number.isInteger(value) || value !== fixBitwiseResult(value & this.valueMask)) { + throw new TypeError(nameWithProperty("BitField.encode", this) + " value must be integer not exceeding " + this.valueMask); + } + const word = this.container._packedGetValue(); + const wordValue = fixBitwiseResult(value << this.start); + this.container._packedSetValue(fixBitwiseResult(word & ~this.wordMask) | wordValue); + } +} +Layout$1.BitField = BitField; +let Boolean$1 = class Boolean2 extends BitField { + constructor(container, property) { + super(container, 1, property); + } + /** Override {@link BitField#decode|decode} for {@link Boolean|Boolean}. + * + * @returns {boolean} */ + decode(b2, offset2) { + return !!super.decode(b2, offset2); + } + /** @override */ + encode(value) { + if ("boolean" === typeof value) { + value = +value; + } + super.encode(value); + } +}; +Layout$1.Boolean = Boolean$1; +let Blob$2 = class Blob2 extends Layout { + constructor(length, property) { + if (!(length instanceof ExternalLayout && length.isCount() || Number.isInteger(length) && 0 <= length)) { + throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout"); + } + let span = -1; + if (!(length instanceof ExternalLayout)) { + span = length; + } + super(span, property); + this.length = length; + } + /** @override */ + getSpan(b2, offset2) { + let span = this.span; + if (0 > span) { + span = this.length.decode(b2, offset2); + } + return span; + } + /** @override */ + decode(b2, offset2 = 0) { + let span = this.span; + if (0 > span) { + span = this.length.decode(b2, offset2); + } + return uint8ArrayToBuffer(b2).slice(offset2, offset2 + span); + } + /** Implement {@link Layout#encode|encode} for {@link Blob}. + * + * **NOTE** If {@link Layout#count|count} is an instance of {@link + * ExternalLayout} then the length of `src` will be encoded as the + * count after `src` is encoded. */ + encode(src2, b2, offset2) { + let span = this.length; + if (this.length instanceof ExternalLayout) { + span = src2.length; + } + if (!(src2 instanceof Uint8Array && span === src2.length)) { + throw new TypeError(nameWithProperty("Blob.encode", this) + " requires (length " + span + ") Uint8Array as src"); + } + if (offset2 + span > b2.length) { + throw new RangeError("encoding overruns Uint8Array"); + } + const srcBuffer = uint8ArrayToBuffer(src2); + uint8ArrayToBuffer(b2).write(srcBuffer.toString("hex"), offset2, span, "hex"); + if (this.length instanceof ExternalLayout) { + this.length.encode(span, b2, offset2); + } + return span; + } +}; +Layout$1.Blob = Blob$2; +class CString extends Layout { + constructor(property) { + super(-1, property); + } + /** @override */ + getSpan(b2, offset2 = 0) { + checkUint8Array(b2); + let idx = offset2; + while (idx < b2.length && 0 !== b2[idx]) { + idx += 1; + } + return 1 + idx - offset2; + } + /** @override */ + decode(b2, offset2 = 0) { + const span = this.getSpan(b2, offset2); + return uint8ArrayToBuffer(b2).slice(offset2, offset2 + span - 1).toString("utf-8"); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + if ("string" !== typeof src2) { + src2 = String(src2); + } + const srcb = buffer_1.Buffer.from(src2, "utf8"); + const span = srcb.length; + if (offset2 + span > b2.length) { + throw new RangeError("encoding overruns Buffer"); + } + const buffer2 = uint8ArrayToBuffer(b2); + srcb.copy(buffer2, offset2); + buffer2[offset2 + span] = 0; + return span + 1; + } +} +Layout$1.CString = CString; +class UTF8 extends Layout { + constructor(maxSpan, property) { + if ("string" === typeof maxSpan && void 0 === property) { + property = maxSpan; + maxSpan = void 0; + } + if (void 0 === maxSpan) { + maxSpan = -1; + } else if (!Number.isInteger(maxSpan)) { + throw new TypeError("maxSpan must be an integer"); + } + super(-1, property); + this.maxSpan = maxSpan; + } + /** @override */ + getSpan(b2, offset2 = 0) { + checkUint8Array(b2); + return b2.length - offset2; + } + /** @override */ + decode(b2, offset2 = 0) { + const span = this.getSpan(b2, offset2); + if (0 <= this.maxSpan && this.maxSpan < span) { + throw new RangeError("text length exceeds maxSpan"); + } + return uint8ArrayToBuffer(b2).slice(offset2, offset2 + span).toString("utf-8"); + } + /** @override */ + encode(src2, b2, offset2 = 0) { + if ("string" !== typeof src2) { + src2 = String(src2); + } + const srcb = buffer_1.Buffer.from(src2, "utf8"); + const span = srcb.length; + if (0 <= this.maxSpan && this.maxSpan < span) { + throw new RangeError("text length exceeds maxSpan"); + } + if (offset2 + span > b2.length) { + throw new RangeError("encoding overruns Buffer"); + } + srcb.copy(uint8ArrayToBuffer(b2), offset2); + return span; + } +} +Layout$1.UTF8 = UTF8; +class Constant extends Layout { + constructor(value, property) { + super(0, property); + this.value = value; + } + /** @override */ + decode(b2, offset2) { + return this.value; + } + /** @override */ + encode(src2, b2, offset2) { + return 0; + } +} +Layout$1.Constant = Constant; +Layout$1.greedy = (elementSpan, property) => new GreedyCount(elementSpan, property); +var offset = Layout$1.offset = (layout, offset2, property) => new OffsetLayout(layout, offset2, property); +var u8 = Layout$1.u8 = (property) => new UInt(1, property); +var u16 = Layout$1.u16 = (property) => new UInt(2, property); +Layout$1.u24 = (property) => new UInt(3, property); +var u32$1 = Layout$1.u32 = (property) => new UInt(4, property); +Layout$1.u40 = (property) => new UInt(5, property); +Layout$1.u48 = (property) => new UInt(6, property); +var nu64 = Layout$1.nu64 = (property) => new NearUInt64(property); +Layout$1.u16be = (property) => new UIntBE(2, property); +Layout$1.u24be = (property) => new UIntBE(3, property); +Layout$1.u32be = (property) => new UIntBE(4, property); +Layout$1.u40be = (property) => new UIntBE(5, property); +Layout$1.u48be = (property) => new UIntBE(6, property); +Layout$1.nu64be = (property) => new NearUInt64BE(property); +Layout$1.s8 = (property) => new Int(1, property); +Layout$1.s16 = (property) => new Int(2, property); +Layout$1.s24 = (property) => new Int(3, property); +Layout$1.s32 = (property) => new Int(4, property); +Layout$1.s40 = (property) => new Int(5, property); +Layout$1.s48 = (property) => new Int(6, property); +var ns64 = Layout$1.ns64 = (property) => new NearInt64(property); +Layout$1.s16be = (property) => new IntBE(2, property); +Layout$1.s24be = (property) => new IntBE(3, property); +Layout$1.s32be = (property) => new IntBE(4, property); +Layout$1.s40be = (property) => new IntBE(5, property); +Layout$1.s48be = (property) => new IntBE(6, property); +Layout$1.ns64be = (property) => new NearInt64BE(property); +Layout$1.f32 = (property) => new Float(property); +Layout$1.f32be = (property) => new FloatBE(property); +Layout$1.f64 = (property) => new Double(property); +Layout$1.f64be = (property) => new DoubleBE(property); +var struct = Layout$1.struct = (fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes); +Layout$1.bits = (word, msb, property) => new BitStructure(word, msb, property); +var seq = Layout$1.seq = (elementLayout, count, property) => new Sequence(elementLayout, count, property); +Layout$1.union = (discr, defaultLayout, property) => new Union(discr, defaultLayout, property); +Layout$1.unionLayoutDiscriminator = (layout, property) => new UnionLayoutDiscriminator(layout, property); +var blob = Layout$1.blob = (length, property) => new Blob$2(length, property); +Layout$1.cstr = (property) => new CString(property); +Layout$1.utf8 = (maxSpan, property) => new UTF8(maxSpan, property); +Layout$1.constant = (value, property) => new Constant(value, property); +var browser$2 = {}; +Object.defineProperty(browser$2, "__esModule", { value: true }); +function toBigIntLE(buf) { + { + const reversed = Buffer.from(buf); + reversed.reverse(); + const hex = reversed.toString("hex"); + if (hex.length === 0) { + return BigInt(0); + } + return BigInt(`0x${hex}`); + } +} +var toBigIntLE_1 = browser$2.toBigIntLE = toBigIntLE; +function toBigIntBE(buf) { + { + const hex = buf.toString("hex"); + if (hex.length === 0) { + return BigInt(0); + } + return BigInt(`0x${hex}`); + } +} +browser$2.toBigIntBE = toBigIntBE; +function toBufferLE(num, width) { + { + const hex = num.toString(16); + const buffer2 = Buffer.from(hex.padStart(width * 2, "0").slice(0, width * 2), "hex"); + buffer2.reverse(); + return buffer2; + } +} +var toBufferLE_1 = browser$2.toBufferLE = toBufferLE; +function toBufferBE(num, width) { + { + const hex = num.toString(16); + return Buffer.from(hex.padStart(width * 2, "0").slice(0, width * 2), "hex"); + } +} +browser$2.toBufferBE = toBufferBE; +class StructError extends TypeError { + constructor(failure, failures) { + let cached; + const { message: message2, explanation, ...rest } = failure; + const { path } = failure; + const msg = path.length === 0 ? message2 : `At path: ${path.join(".")} -- ${message2}`; + super(explanation ?? msg); + if (explanation != null) + this.cause = msg; + Object.assign(this, rest); + this.name = this.constructor.name; + this.failures = () => { + return cached ?? (cached = [failure, ...failures()]); + }; + } +} +function isIterable(x3) { + return isObject$3(x3) && typeof x3[Symbol.iterator] === "function"; +} +function isObject$3(x3) { + return typeof x3 === "object" && x3 != null; +} +function isNonArrayObject(x3) { + return isObject$3(x3) && !Array.isArray(x3); +} +function print(value) { + if (typeof value === "symbol") { + return value.toString(); + } + return typeof value === "string" ? JSON.stringify(value) : `${value}`; +} +function shiftIterator(input) { + const { done, value } = input.next(); + return done ? void 0 : value; +} +function toFailure(result, context, struct2, value) { + if (result === true) { + return; + } else if (result === false) { + result = {}; + } else if (typeof result === "string") { + result = { message: result }; + } + const { path, branch } = context; + const { type: type2 } = struct2; + const { refinement, message: message2 = `Expected a value of type \`${type2}\`${refinement ? ` with refinement \`${refinement}\`` : ""}, but received: \`${print(value)}\`` } = result; + return { + value, + type: type2, + refinement, + key: path[path.length - 1], + path, + branch, + ...result, + message: message2 + }; +} +function* toFailures(result, context, struct2, value) { + if (!isIterable(result)) { + result = [result]; + } + for (const r2 of result) { + const failure = toFailure(r2, context, struct2, value); + if (failure) { + yield failure; + } + } +} +function* run(value, struct2, options = {}) { + const { path = [], branch = [value], coerce: coerce2 = false, mask: mask2 = false } = options; + const ctx = { path, branch, mask: mask2 }; + if (coerce2) { + value = struct2.coercer(value, ctx); + } + let status = "valid"; + for (const failure of struct2.validator(value, ctx)) { + failure.explanation = options.message; + status = "not_valid"; + yield [failure, void 0]; + } + for (let [k2, v6, s2] of struct2.entries(value, ctx)) { + const ts2 = run(v6, s2, { + path: k2 === void 0 ? path : [...path, k2], + branch: k2 === void 0 ? branch : [...branch, v6], + coerce: coerce2, + mask: mask2, + message: options.message + }); + for (const t2 of ts2) { + if (t2[0]) { + status = t2[0].refinement != null ? "not_refined" : "not_valid"; + yield [t2[0], void 0]; + } else if (coerce2) { + v6 = t2[1]; + if (k2 === void 0) { + value = v6; + } else if (value instanceof Map) { + value.set(k2, v6); + } else if (value instanceof Set) { + value.add(v6); + } else if (isObject$3(value)) { + if (v6 !== void 0 || k2 in value) + value[k2] = v6; + } + } + } + } + if (status !== "not_valid") { + for (const failure of struct2.refiner(value, ctx)) { + failure.explanation = options.message; + status = "not_refined"; + yield [failure, void 0]; + } + } + if (status === "valid") { + yield [void 0, value]; + } +} +let Struct$1 = class Struct { + constructor(props) { + const { type: type2, schema, validator: validator2, refiner, coercer = (value) => value, entries = function* () { + } } = props; + this.type = type2; + this.schema = schema; + this.entries = entries; + this.coercer = coercer; + if (validator2) { + this.validator = (value, context) => { + const result = validator2(value, context); + return toFailures(result, context, this, value); + }; + } else { + this.validator = () => []; + } + if (refiner) { + this.refiner = (value, context) => { + const result = refiner(value, context); + return toFailures(result, context, this, value); + }; + } else { + this.refiner = () => []; + } + } + /** + * Assert that a value passes the struct's validation, throwing if it doesn't. + */ + assert(value, message2) { + return assert$2(value, this, message2); + } + /** + * Create a value with the struct's coercion logic, then validate it. + */ + create(value, message2) { + return create(value, this, message2); + } + /** + * Check if a value passes the struct's validation. + */ + is(value) { + return is(value, this); + } + /** + * Mask a value, coercing and validating it, but returning only the subset of + * properties defined by the struct's schema. Masking applies recursively to + * props of `object` structs only. + */ + mask(value, message2) { + return mask$1(value, this, message2); + } + /** + * Validate a value with the struct's validation logic, returning a tuple + * representing the result. + * + * You may optionally pass `true` for the `coerce` argument to coerce + * the value before attempting to validate it. If you do, the result will + * contain the coerced result when successful. Also, `mask` will turn on + * masking of the unknown `object` props recursively if passed. + */ + validate(value, options = {}) { + return validate$1(value, this, options); + } +}; +function assert$2(value, struct2, message2) { + const result = validate$1(value, struct2, { message: message2 }); + if (result[0]) { + throw result[0]; + } +} +function create(value, struct2, message2) { + const result = validate$1(value, struct2, { coerce: true, message: message2 }); + if (result[0]) { + throw result[0]; + } else { + return result[1]; + } +} +function mask$1(value, struct2, message2) { + const result = validate$1(value, struct2, { coerce: true, mask: true, message: message2 }); + if (result[0]) { + throw result[0]; + } else { + return result[1]; + } +} +function is(value, struct2) { + const result = validate$1(value, struct2); + return !result[0]; +} +function validate$1(value, struct2, options = {}) { + const tuples = run(value, struct2, options); + const tuple2 = shiftIterator(tuples); + if (tuple2[0]) { + const error = new StructError(tuple2[0], function* () { + for (const t2 of tuples) { + if (t2[0]) { + yield t2[0]; + } + } + }); + return [error, void 0]; + } else { + const v6 = tuple2[1]; + return [void 0, v6]; + } +} +function define(name2, validator2) { + return new Struct$1({ type: name2, schema: null, validator: validator2 }); +} +function any() { + return define("any", () => true); +} +function array(Element) { + return new Struct$1({ + type: "array", + schema: Element, + *entries(value) { + if (Element && Array.isArray(value)) { + for (const [i2, v6] of value.entries()) { + yield [i2, v6, Element]; + } + } + }, + coercer(value) { + return Array.isArray(value) ? value.slice() : value; + }, + validator(value) { + return Array.isArray(value) || `Expected an array value, but received: ${print(value)}`; + } + }); +} +function boolean() { + return define("boolean", (value) => { + return typeof value === "boolean"; + }); +} +function instance(Class) { + return define("instance", (value) => { + return value instanceof Class || `Expected a \`${Class.name}\` instance, but received: ${print(value)}`; + }); +} +function literal(constant) { + const description2 = print(constant); + const t2 = typeof constant; + return new Struct$1({ + type: "literal", + schema: t2 === "string" || t2 === "number" || t2 === "boolean" ? constant : null, + validator(value) { + return value === constant || `Expected the literal \`${description2}\`, but received: ${print(value)}`; + } + }); +} +function never() { + return define("never", () => false); +} +function nullable(struct2) { + return new Struct$1({ + ...struct2, + validator: (value, ctx) => value === null || struct2.validator(value, ctx), + refiner: (value, ctx) => value === null || struct2.refiner(value, ctx) + }); +} +function number$1() { + return define("number", (value) => { + return typeof value === "number" && !isNaN(value) || `Expected a number, but received: ${print(value)}`; + }); +} +function optional(struct2) { + return new Struct$1({ + ...struct2, + validator: (value, ctx) => value === void 0 || struct2.validator(value, ctx), + refiner: (value, ctx) => value === void 0 || struct2.refiner(value, ctx) + }); +} +function record(Key2, Value) { + return new Struct$1({ + type: "record", + schema: null, + *entries(value) { + if (isObject$3(value)) { + for (const k2 in value) { + const v6 = value[k2]; + yield [k2, k2, Key2]; + yield [k2, v6, Value]; + } + } + }, + validator(value) { + return isNonArrayObject(value) || `Expected an object, but received: ${print(value)}`; + }, + coercer(value) { + return isNonArrayObject(value) ? { ...value } : value; + } + }); +} +function string() { + return define("string", (value) => { + return typeof value === "string" || `Expected a string, but received: ${print(value)}`; + }); +} +function tuple(Structs) { + const Never = never(); + return new Struct$1({ + type: "tuple", + schema: null, + *entries(value) { + if (Array.isArray(value)) { + const length = Math.max(Structs.length, value.length); + for (let i2 = 0; i2 < length; i2++) { + yield [i2, value[i2], Structs[i2] || Never]; + } + } + }, + validator(value) { + return Array.isArray(value) || `Expected an array, but received: ${print(value)}`; + }, + coercer(value) { + return Array.isArray(value) ? value.slice() : value; + } + }); +} +function type(schema) { + const keys2 = Object.keys(schema); + return new Struct$1({ + type: "type", + schema, + *entries(value) { + if (isObject$3(value)) { + for (const k2 of keys2) { + yield [k2, value[k2], schema[k2]]; + } + } + }, + validator(value) { + return isNonArrayObject(value) || `Expected an object, but received: ${print(value)}`; + }, + coercer(value) { + return isNonArrayObject(value) ? { ...value } : value; + } + }); +} +function union(Structs) { + const description2 = Structs.map((s2) => s2.type).join(" | "); + return new Struct$1({ + type: "union", + schema: null, + coercer(value, ctx) { + for (const S4 of Structs) { + const [error, coerced] = S4.validate(value, { + coerce: true, + mask: ctx.mask + }); + if (!error) { + return coerced; + } + } + return value; + }, + validator(value, ctx) { + const failures = []; + for (const S4 of Structs) { + const [...tuples] = run(value, S4, ctx); + const [first] = tuples; + if (!first[0]) { + return []; + } else { + for (const [failure] of tuples) { + if (failure) { + failures.push(failure); + } + } + } + } + return [ + `Expected the value to satisfy a union of \`${description2}\`, but received: ${print(value)}`, + ...failures + ]; + } + }); +} +function unknown() { + return define("unknown", () => true); +} +function coerce(struct2, condition, coercer) { + return new Struct$1({ + ...struct2, + coercer: (value, ctx) => { + return is(value, condition) ? struct2.coercer(coercer(value, ctx), ctx) : struct2.coercer(value, ctx); + } + }); +} +var getRandomValues; +var rnds8 = new Uint8Array(16); +function rng() { + if (!getRandomValues) { + getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto); + if (!getRandomValues) { + throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); + } + } + return getRandomValues(rnds8); +} +const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; +function validate7(uuid2) { + return typeof uuid2 === "string" && REGEX.test(uuid2); +} +var byteToHex = []; +for (var i$1 = 0; i$1 < 256; ++i$1) { + byteToHex.push((i$1 + 256).toString(16).substr(1)); +} +function stringify$1(arr) { + var offset2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var uuid2 = (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase(); + if (!validate7(uuid2)) { + throw TypeError("Stringified UUID is invalid"); + } + return uuid2; +} +var _nodeId; +var _clockseq; +var _lastMSecs = 0; +var _lastNSecs = 0; +function v1(options, buf, offset2) { + var i2 = buf && offset2 || 0; + var b2 = buf || new Array(16); + options = options || {}; + var node2 = options.node || _nodeId; + var clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq; + if (node2 == null || clockseq == null) { + var seedBytes = options.random || (options.rng || rng)(); + if (node2 == null) { + node2 = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + if (clockseq == null) { + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383; + } + } + var msecs = options.msecs !== void 0 ? options.msecs : Date.now(); + var nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1; + var dt2 = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; + if (dt2 < 0 && options.clockseq === void 0) { + clockseq = clockseq + 1 & 16383; + } + if ((dt2 < 0 || msecs > _lastMSecs) && options.nsecs === void 0) { + nsecs = 0; + } + if (nsecs >= 1e4) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + msecs += 122192928e5; + var tl2 = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; + b2[i2++] = tl2 >>> 24 & 255; + b2[i2++] = tl2 >>> 16 & 255; + b2[i2++] = tl2 >>> 8 & 255; + b2[i2++] = tl2 & 255; + var tmh = msecs / 4294967296 * 1e4 & 268435455; + b2[i2++] = tmh >>> 8 & 255; + b2[i2++] = tmh & 255; + b2[i2++] = tmh >>> 24 & 15 | 16; + b2[i2++] = tmh >>> 16 & 255; + b2[i2++] = clockseq >>> 8 | 128; + b2[i2++] = clockseq & 255; + for (var n5 = 0; n5 < 6; ++n5) { + b2[i2 + n5] = node2[n5]; + } + return buf || stringify$1(b2); +} +function parse(uuid2) { + if (!validate7(uuid2)) { + throw TypeError("Invalid UUID"); + } + var v6; + var arr = new Uint8Array(16); + arr[0] = (v6 = parseInt(uuid2.slice(0, 8), 16)) >>> 24; + arr[1] = v6 >>> 16 & 255; + arr[2] = v6 >>> 8 & 255; + arr[3] = v6 & 255; + arr[4] = (v6 = parseInt(uuid2.slice(9, 13), 16)) >>> 8; + arr[5] = v6 & 255; + arr[6] = (v6 = parseInt(uuid2.slice(14, 18), 16)) >>> 8; + arr[7] = v6 & 255; + arr[8] = (v6 = parseInt(uuid2.slice(19, 23), 16)) >>> 8; + arr[9] = v6 & 255; + arr[10] = (v6 = parseInt(uuid2.slice(24, 36), 16)) / 1099511627776 & 255; + arr[11] = v6 / 4294967296 & 255; + arr[12] = v6 >>> 24 & 255; + arr[13] = v6 >>> 16 & 255; + arr[14] = v6 >>> 8 & 255; + arr[15] = v6 & 255; + return arr; +} +function stringToBytes$1(str) { + str = unescape(encodeURIComponent(str)); + var bytes2 = []; + for (var i2 = 0; i2 < str.length; ++i2) { + bytes2.push(str.charCodeAt(i2)); + } + return bytes2; +} +var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +var URL$1 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +function v35(name2, version2, hashfunc) { + function generateUUID(value, namespace, buf, offset2) { + if (typeof value === "string") { + value = stringToBytes$1(value); + } + if (typeof namespace === "string") { + namespace = parse(namespace); + } + if (namespace.length !== 16) { + throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); + } + var bytes2 = new Uint8Array(16 + value.length); + bytes2.set(namespace); + bytes2.set(value, namespace.length); + bytes2 = hashfunc(bytes2); + bytes2[6] = bytes2[6] & 15 | version2; + bytes2[8] = bytes2[8] & 63 | 128; + if (buf) { + offset2 = offset2 || 0; + for (var i2 = 0; i2 < 16; ++i2) { + buf[offset2 + i2] = bytes2[i2]; + } + return buf; + } + return stringify$1(bytes2); + } + try { + generateUUID.name = name2; + } catch (err) { + } + generateUUID.DNS = DNS; + generateUUID.URL = URL$1; + return generateUUID; +} +function md5(bytes2) { + if (typeof bytes2 === "string") { + var msg = unescape(encodeURIComponent(bytes2)); + bytes2 = new Uint8Array(msg.length); + for (var i2 = 0; i2 < msg.length; ++i2) { + bytes2[i2] = msg.charCodeAt(i2); + } + } + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes2), bytes2.length * 8)); +} +function md5ToHexEncodedArray(input) { + var output2 = []; + var length32 = input.length * 32; + var hexTab = "0123456789abcdef"; + for (var i2 = 0; i2 < length32; i2 += 8) { + var x3 = input[i2 >> 5] >>> i2 % 32 & 255; + var hex = parseInt(hexTab.charAt(x3 >>> 4 & 15) + hexTab.charAt(x3 & 15), 16); + output2.push(hex); + } + return output2; +} +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +function wordsToMd5(x3, len) { + x3[len >> 5] |= 128 << len % 32; + x3[getOutputLength(len) - 1] = len; + var a3 = 1732584193; + var b2 = -271733879; + var c2 = -1732584194; + var d4 = 271733878; + for (var i2 = 0; i2 < x3.length; i2 += 16) { + var olda = a3; + var oldb = b2; + var oldc = c2; + var oldd = d4; + a3 = md5ff(a3, b2, c2, d4, x3[i2], 7, -680876936); + d4 = md5ff(d4, a3, b2, c2, x3[i2 + 1], 12, -389564586); + c2 = md5ff(c2, d4, a3, b2, x3[i2 + 2], 17, 606105819); + b2 = md5ff(b2, c2, d4, a3, x3[i2 + 3], 22, -1044525330); + a3 = md5ff(a3, b2, c2, d4, x3[i2 + 4], 7, -176418897); + d4 = md5ff(d4, a3, b2, c2, x3[i2 + 5], 12, 1200080426); + c2 = md5ff(c2, d4, a3, b2, x3[i2 + 6], 17, -1473231341); + b2 = md5ff(b2, c2, d4, a3, x3[i2 + 7], 22, -45705983); + a3 = md5ff(a3, b2, c2, d4, x3[i2 + 8], 7, 1770035416); + d4 = md5ff(d4, a3, b2, c2, x3[i2 + 9], 12, -1958414417); + c2 = md5ff(c2, d4, a3, b2, x3[i2 + 10], 17, -42063); + b2 = md5ff(b2, c2, d4, a3, x3[i2 + 11], 22, -1990404162); + a3 = md5ff(a3, b2, c2, d4, x3[i2 + 12], 7, 1804603682); + d4 = md5ff(d4, a3, b2, c2, x3[i2 + 13], 12, -40341101); + c2 = md5ff(c2, d4, a3, b2, x3[i2 + 14], 17, -1502002290); + b2 = md5ff(b2, c2, d4, a3, x3[i2 + 15], 22, 1236535329); + a3 = md5gg(a3, b2, c2, d4, x3[i2 + 1], 5, -165796510); + d4 = md5gg(d4, a3, b2, c2, x3[i2 + 6], 9, -1069501632); + c2 = md5gg(c2, d4, a3, b2, x3[i2 + 11], 14, 643717713); + b2 = md5gg(b2, c2, d4, a3, x3[i2], 20, -373897302); + a3 = md5gg(a3, b2, c2, d4, x3[i2 + 5], 5, -701558691); + d4 = md5gg(d4, a3, b2, c2, x3[i2 + 10], 9, 38016083); + c2 = md5gg(c2, d4, a3, b2, x3[i2 + 15], 14, -660478335); + b2 = md5gg(b2, c2, d4, a3, x3[i2 + 4], 20, -405537848); + a3 = md5gg(a3, b2, c2, d4, x3[i2 + 9], 5, 568446438); + d4 = md5gg(d4, a3, b2, c2, x3[i2 + 14], 9, -1019803690); + c2 = md5gg(c2, d4, a3, b2, x3[i2 + 3], 14, -187363961); + b2 = md5gg(b2, c2, d4, a3, x3[i2 + 8], 20, 1163531501); + a3 = md5gg(a3, b2, c2, d4, x3[i2 + 13], 5, -1444681467); + d4 = md5gg(d4, a3, b2, c2, x3[i2 + 2], 9, -51403784); + c2 = md5gg(c2, d4, a3, b2, x3[i2 + 7], 14, 1735328473); + b2 = md5gg(b2, c2, d4, a3, x3[i2 + 12], 20, -1926607734); + a3 = md5hh(a3, b2, c2, d4, x3[i2 + 5], 4, -378558); + d4 = md5hh(d4, a3, b2, c2, x3[i2 + 8], 11, -2022574463); + c2 = md5hh(c2, d4, a3, b2, x3[i2 + 11], 16, 1839030562); + b2 = md5hh(b2, c2, d4, a3, x3[i2 + 14], 23, -35309556); + a3 = md5hh(a3, b2, c2, d4, x3[i2 + 1], 4, -1530992060); + d4 = md5hh(d4, a3, b2, c2, x3[i2 + 4], 11, 1272893353); + c2 = md5hh(c2, d4, a3, b2, x3[i2 + 7], 16, -155497632); + b2 = md5hh(b2, c2, d4, a3, x3[i2 + 10], 23, -1094730640); + a3 = md5hh(a3, b2, c2, d4, x3[i2 + 13], 4, 681279174); + d4 = md5hh(d4, a3, b2, c2, x3[i2], 11, -358537222); + c2 = md5hh(c2, d4, a3, b2, x3[i2 + 3], 16, -722521979); + b2 = md5hh(b2, c2, d4, a3, x3[i2 + 6], 23, 76029189); + a3 = md5hh(a3, b2, c2, d4, x3[i2 + 9], 4, -640364487); + d4 = md5hh(d4, a3, b2, c2, x3[i2 + 12], 11, -421815835); + c2 = md5hh(c2, d4, a3, b2, x3[i2 + 15], 16, 530742520); + b2 = md5hh(b2, c2, d4, a3, x3[i2 + 2], 23, -995338651); + a3 = md5ii(a3, b2, c2, d4, x3[i2], 6, -198630844); + d4 = md5ii(d4, a3, b2, c2, x3[i2 + 7], 10, 1126891415); + c2 = md5ii(c2, d4, a3, b2, x3[i2 + 14], 15, -1416354905); + b2 = md5ii(b2, c2, d4, a3, x3[i2 + 5], 21, -57434055); + a3 = md5ii(a3, b2, c2, d4, x3[i2 + 12], 6, 1700485571); + d4 = md5ii(d4, a3, b2, c2, x3[i2 + 3], 10, -1894986606); + c2 = md5ii(c2, d4, a3, b2, x3[i2 + 10], 15, -1051523); + b2 = md5ii(b2, c2, d4, a3, x3[i2 + 1], 21, -2054922799); + a3 = md5ii(a3, b2, c2, d4, x3[i2 + 8], 6, 1873313359); + d4 = md5ii(d4, a3, b2, c2, x3[i2 + 15], 10, -30611744); + c2 = md5ii(c2, d4, a3, b2, x3[i2 + 6], 15, -1560198380); + b2 = md5ii(b2, c2, d4, a3, x3[i2 + 13], 21, 1309151649); + a3 = md5ii(a3, b2, c2, d4, x3[i2 + 4], 6, -145523070); + d4 = md5ii(d4, a3, b2, c2, x3[i2 + 11], 10, -1120210379); + c2 = md5ii(c2, d4, a3, b2, x3[i2 + 2], 15, 718787259); + b2 = md5ii(b2, c2, d4, a3, x3[i2 + 9], 21, -343485551); + a3 = safeAdd(a3, olda); + b2 = safeAdd(b2, oldb); + c2 = safeAdd(c2, oldc); + d4 = safeAdd(d4, oldd); + } + return [a3, b2, c2, d4]; +} +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + var length8 = input.length * 8; + var output2 = new Uint32Array(getOutputLength(length8)); + for (var i2 = 0; i2 < length8; i2 += 8) { + output2[i2 >> 5] |= (input[i2 / 8] & 255) << i2 % 32; + } + return output2; +} +function safeAdd(x3, y3) { + var lsw = (x3 & 65535) + (y3 & 65535); + var msw = (x3 >> 16) + (y3 >> 16) + (lsw >> 16); + return msw << 16 | lsw & 65535; +} +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +function md5cmn(q2, a3, b2, x3, s2, t2) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a3, q2), safeAdd(x3, t2)), s2), b2); +} +function md5ff(a3, b2, c2, d4, x3, s2, t2) { + return md5cmn(b2 & c2 | ~b2 & d4, a3, b2, x3, s2, t2); +} +function md5gg(a3, b2, c2, d4, x3, s2, t2) { + return md5cmn(b2 & d4 | c2 & ~d4, a3, b2, x3, s2, t2); +} +function md5hh(a3, b2, c2, d4, x3, s2, t2) { + return md5cmn(b2 ^ c2 ^ d4, a3, b2, x3, s2, t2); +} +function md5ii(a3, b2, c2, d4, x3, s2, t2) { + return md5cmn(c2 ^ (b2 | ~d4), a3, b2, x3, s2, t2); +} +var v3 = v35("v3", 48, md5); +const v3$1 = v3; +function v4(options, buf, offset2) { + options = options || {}; + var rnds = options.random || (options.rng || rng)(); + rnds[6] = rnds[6] & 15 | 64; + rnds[8] = rnds[8] & 63 | 128; + if (buf) { + offset2 = offset2 || 0; + for (var i2 = 0; i2 < 16; ++i2) { + buf[offset2 + i2] = rnds[i2]; + } + return buf; + } + return stringify$1(rnds); +} +function f$1(s2, x3, y3, z3) { + switch (s2) { + case 0: + return x3 & y3 ^ ~x3 & z3; + case 1: + return x3 ^ y3 ^ z3; + case 2: + return x3 & y3 ^ x3 & z3 ^ y3 & z3; + case 3: + return x3 ^ y3 ^ z3; + } +} +function ROTL(x3, n5) { + return x3 << n5 | x3 >>> 32 - n5; +} +function sha1(bytes2) { + var K3 = [1518500249, 1859775393, 2400959708, 3395469782]; + var H2 = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + if (typeof bytes2 === "string") { + var msg = unescape(encodeURIComponent(bytes2)); + bytes2 = []; + for (var i2 = 0; i2 < msg.length; ++i2) { + bytes2.push(msg.charCodeAt(i2)); + } + } else if (!Array.isArray(bytes2)) { + bytes2 = Array.prototype.slice.call(bytes2); + } + bytes2.push(128); + var l2 = bytes2.length / 4 + 2; + var N2 = Math.ceil(l2 / 16); + var M3 = new Array(N2); + for (var _i2 = 0; _i2 < N2; ++_i2) { + var arr = new Uint32Array(16); + for (var j2 = 0; j2 < 16; ++j2) { + arr[j2] = bytes2[_i2 * 64 + j2 * 4] << 24 | bytes2[_i2 * 64 + j2 * 4 + 1] << 16 | bytes2[_i2 * 64 + j2 * 4 + 2] << 8 | bytes2[_i2 * 64 + j2 * 4 + 3]; + } + M3[_i2] = arr; + } + M3[N2 - 1][14] = (bytes2.length - 1) * 8 / Math.pow(2, 32); + M3[N2 - 1][14] = Math.floor(M3[N2 - 1][14]); + M3[N2 - 1][15] = (bytes2.length - 1) * 8 & 4294967295; + for (var _i22 = 0; _i22 < N2; ++_i22) { + var W2 = new Uint32Array(80); + for (var t2 = 0; t2 < 16; ++t2) { + W2[t2] = M3[_i22][t2]; + } + for (var _t2 = 16; _t2 < 80; ++_t2) { + W2[_t2] = ROTL(W2[_t2 - 3] ^ W2[_t2 - 8] ^ W2[_t2 - 14] ^ W2[_t2 - 16], 1); + } + var a3 = H2[0]; + var b2 = H2[1]; + var c2 = H2[2]; + var d4 = H2[3]; + var e18 = H2[4]; + for (var _t22 = 0; _t22 < 80; ++_t22) { + var s2 = Math.floor(_t22 / 20); + var T9 = ROTL(a3, 5) + f$1(s2, b2, c2, d4) + e18 + K3[s2] + W2[_t22] >>> 0; + e18 = d4; + d4 = c2; + c2 = ROTL(b2, 30) >>> 0; + b2 = a3; + a3 = T9; + } + H2[0] = H2[0] + a3 >>> 0; + H2[1] = H2[1] + b2 >>> 0; + H2[2] = H2[2] + c2 >>> 0; + H2[3] = H2[3] + d4 >>> 0; + H2[4] = H2[4] + e18 >>> 0; + } + return [H2[0] >> 24 & 255, H2[0] >> 16 & 255, H2[0] >> 8 & 255, H2[0] & 255, H2[1] >> 24 & 255, H2[1] >> 16 & 255, H2[1] >> 8 & 255, H2[1] & 255, H2[2] >> 24 & 255, H2[2] >> 16 & 255, H2[2] >> 8 & 255, H2[2] & 255, H2[3] >> 24 & 255, H2[3] >> 16 & 255, H2[3] >> 8 & 255, H2[3] & 255, H2[4] >> 24 & 255, H2[4] >> 16 & 255, H2[4] >> 8 & 255, H2[4] & 255]; +} +var v5 = v35("v5", 80, sha1); +const v5$1 = v5; +const nil = "00000000-0000-0000-0000-000000000000"; +function version$3(uuid2) { + if (!validate7(uuid2)) { + throw TypeError("Invalid UUID"); + } + return parseInt(uuid2.substr(14, 1), 16); +} +const esmBrowser = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + NIL: nil, + parse, + stringify: stringify$1, + v1, + v3: v3$1, + v4, + v5: v5$1, + validate: validate7, + version: version$3 +}, Symbol.toStringTag, { value: "Module" })); +const require$$0 = /* @__PURE__ */ getAugmentedNamespace(esmBrowser); +const uuid$1 = require$$0.v4; +const generateRequest$1 = function(method, params, id2, options) { + if (typeof method !== "string") { + throw new TypeError(method + " must be a string"); + } + options = options || {}; + const version2 = typeof options.version === "number" ? options.version : 2; + if (version2 !== 1 && version2 !== 2) { + throw new TypeError(version2 + " must be 1 or 2"); + } + const request = { + method + }; + if (version2 === 2) { + request.jsonrpc = "2.0"; + } + if (params) { + if (typeof params !== "object" && !Array.isArray(params)) { + throw new TypeError(params + " must be an object, array or omitted"); + } + request.params = params; + } + if (typeof id2 === "undefined") { + const generator = typeof options.generator === "function" ? options.generator : function() { + return uuid$1(); + }; + request.id = generator(request, options); + } else if (version2 === 2 && id2 === null) { + if (options.notificationIdNull) { + request.id = null; + } + } else { + request.id = id2; + } + return request; +}; +var generateRequest_1 = generateRequest$1; +const uuid = require$$0.v4; +const generateRequest = generateRequest_1; +const ClientBrowser = function(callServer, options) { + if (!(this instanceof ClientBrowser)) { + return new ClientBrowser(callServer, options); + } + if (!options) { + options = {}; + } + this.options = { + reviver: typeof options.reviver !== "undefined" ? options.reviver : null, + replacer: typeof options.replacer !== "undefined" ? options.replacer : null, + generator: typeof options.generator !== "undefined" ? options.generator : function() { + return uuid(); + }, + version: typeof options.version !== "undefined" ? options.version : 2, + notificationIdNull: typeof options.notificationIdNull === "boolean" ? options.notificationIdNull : false + }; + this.callServer = callServer; +}; +var browser$1 = ClientBrowser; +ClientBrowser.prototype.request = function(method, params, id2, callback) { + const self2 = this; + let request = null; + const isBatch = Array.isArray(method) && typeof params === "function"; + if (this.options.version === 1 && isBatch) { + throw new TypeError("JSON-RPC 1.0 does not support batching"); + } + const isRaw = !isBatch && method && typeof method === "object" && typeof params === "function"; + if (isBatch || isRaw) { + callback = params; + request = method; + } else { + if (typeof id2 === "function") { + callback = id2; + id2 = void 0; + } + const hasCallback = typeof callback === "function"; + try { + request = generateRequest(method, params, id2, { + generator: this.options.generator, + version: this.options.version, + notificationIdNull: this.options.notificationIdNull + }); + } catch (err) { + if (hasCallback) { + return callback(err); + } + throw err; + } + if (!hasCallback) { + return request; + } + } + let message2; + try { + message2 = JSON.stringify(request, this.options.replacer); + } catch (err) { + return callback(err); + } + this.callServer(message2, function(err, response) { + self2._parseResponse(err, response, callback); + }); + return request; +}; +ClientBrowser.prototype._parseResponse = function(err, responseText, callback) { + if (err) { + callback(err); + return; + } + if (!responseText) { + return callback(); + } + let response; + try { + response = JSON.parse(responseText, this.options.reviver); + } catch (err2) { + return callback(err2); + } + if (callback.length === 3) { + if (Array.isArray(response)) { + const isError2 = function(res) { + return typeof res.error !== "undefined"; + }; + const isNotError = function(res) { + return !isError2(res); + }; + return callback(null, response.filter(isError2), response.filter(isNotError)); + } else { + return callback(null, response.error, response.result); + } + } + callback(null, response); +}; +const RpcClient = /* @__PURE__ */ getDefaultExportFromCjs$1(browser$1); +var WebSocketBrowserImpl = class extends O$5 { + /** Instantiate a WebSocket class + * @constructor + * @param {String} address - url to a websocket server + * @param {(Object)} options - websocket options + * @param {(String|Array)} protocols - a list of protocols + * @return {WebSocketBrowserImpl} - returns a WebSocket instance + */ + constructor(address2, options, protocols) { + super(); + __publicField(this, "socket"); + this.socket = new window.WebSocket(address2, protocols); + this.socket.onopen = () => this.emit("open"); + this.socket.onmessage = (event) => this.emit("message", event.data); + this.socket.onerror = (error) => this.emit("error", error); + this.socket.onclose = (event) => { + this.emit("close", event.code, event.reason); + }; + } + /** + * Sends data through a websocket connection + * @method + * @param {(String|Object)} data - data to be sent via websocket + * @param {Object} optionsOrCallback - ws options + * @param {Function} callback - a callback called once the data is sent + * @return {Undefined} + */ + send(data, optionsOrCallback, callback) { + const cb2 = callback || optionsOrCallback; + try { + this.socket.send(data); + cb2(); + } catch (error) { + cb2(error); + } + } + /** + * Closes an underlying socket + * @method + * @param {Number} code - status code explaining why the connection is being closed + * @param {String} reason - a description why the connection is closing + * @return {Undefined} + * @throws {Error} + */ + close(code2, reason) { + this.socket.close(code2, reason); + } + addEventListener(type2, listener, options) { + this.socket.addEventListener(type2, listener, options); + } +}; +function WebSocket$1(address2, options) { + return new WebSocketBrowserImpl(address2, options); +} +var DefaultDataPack = class { + encode(value) { + return JSON.stringify(value); + } + decode(value) { + return JSON.parse(value); + } +}; +var CommonClient = class extends O$5 { + /** + * Instantiate a Client class. + * @constructor + * @param {webSocketFactory} webSocketFactory - factory method for WebSocket + * @param {String} address - url to a websocket server + * @param {Object} options - ws options object with reconnect parameters + * @param {Function} generate_request_id - custom generation request Id + * @param {DataPack} dataPack - data pack contains encoder and decoder + * @return {CommonClient} + */ + constructor(webSocketFactory, address2 = "ws://localhost:8080", { + autoconnect = true, + reconnect: reconnect2 = true, + reconnect_interval = 1e3, + max_reconnects = 5, + ...rest_options + } = {}, generate_request_id, dataPack) { + super(); + __publicField(this, "address"); + __publicField(this, "rpc_id"); + __publicField(this, "queue"); + __publicField(this, "options"); + __publicField(this, "autoconnect"); + __publicField(this, "ready"); + __publicField(this, "reconnect"); + __publicField(this, "reconnect_timer_id"); + __publicField(this, "reconnect_interval"); + __publicField(this, "max_reconnects"); + __publicField(this, "rest_options"); + __publicField(this, "current_reconnects"); + __publicField(this, "generate_request_id"); + __publicField(this, "socket"); + __publicField(this, "webSocketFactory"); + __publicField(this, "dataPack"); + this.webSocketFactory = webSocketFactory; + this.queue = {}; + this.rpc_id = 0; + this.address = address2; + this.autoconnect = autoconnect; + this.ready = false; + this.reconnect = reconnect2; + this.reconnect_timer_id = void 0; + this.reconnect_interval = reconnect_interval; + this.max_reconnects = max_reconnects; + this.rest_options = rest_options; + this.current_reconnects = 0; + this.generate_request_id = generate_request_id || (() => ++this.rpc_id); + if (!dataPack) + this.dataPack = new DefaultDataPack(); + else + this.dataPack = dataPack; + if (this.autoconnect) + this._connect(this.address, { + autoconnect: this.autoconnect, + reconnect: this.reconnect, + reconnect_interval: this.reconnect_interval, + max_reconnects: this.max_reconnects, + ...this.rest_options + }); + } + /** + * Connects to a defined server if not connected already. + * @method + * @return {Undefined} + */ + connect() { + if (this.socket) + return; + this._connect(this.address, { + autoconnect: this.autoconnect, + reconnect: this.reconnect, + reconnect_interval: this.reconnect_interval, + max_reconnects: this.max_reconnects, + ...this.rest_options + }); + } + /** + * Calls a registered RPC method on server. + * @method + * @param {String} method - RPC method name + * @param {Object|Array} params - optional method parameters + * @param {Number} timeout - RPC reply timeout value + * @param {Object} ws_opts - options passed to ws + * @return {Promise} + */ + call(method, params, timeout, ws_opts) { + if (!ws_opts && "object" === typeof timeout) { + ws_opts = timeout; + timeout = null; + } + return new Promise((resolve, reject) => { + if (!this.ready) + return reject(new Error("socket not ready")); + const rpc_id = this.generate_request_id(method, params); + const message2 = { + jsonrpc: "2.0", + method, + params: params || void 0, + id: rpc_id + }; + this.socket.send(this.dataPack.encode(message2), ws_opts, (error) => { + if (error) + return reject(error); + this.queue[rpc_id] = { promise: [resolve, reject] }; + if (timeout) { + this.queue[rpc_id].timeout = setTimeout(() => { + delete this.queue[rpc_id]; + reject(new Error("reply timeout")); + }, timeout); + } + }); + }); + } + /** + * Logins with the other side of the connection. + * @method + * @param {Object} params - Login credentials object + * @return {Promise} + */ + async login(params) { + const resp = await this.call("rpc.login", params); + if (!resp) + throw new Error("authentication failed"); + return resp; + } + /** + * Fetches a list of client's methods registered on server. + * @method + * @return {Array} + */ + async listMethods() { + return await this.call("__listMethods"); + } + /** + * Sends a JSON-RPC 2.0 notification to server. + * @method + * @param {String} method - RPC method name + * @param {Object} params - optional method parameters + * @return {Promise} + */ + notify(method, params) { + return new Promise((resolve, reject) => { + if (!this.ready) + return reject(new Error("socket not ready")); + const message2 = { + jsonrpc: "2.0", + method, + params + }; + this.socket.send(this.dataPack.encode(message2), (error) => { + if (error) + return reject(error); + resolve(); + }); + }); + } + /** + * Subscribes for a defined event. + * @method + * @param {String|Array} event - event name + * @return {Undefined} + * @throws {Error} + */ + async subscribe(event) { + if (typeof event === "string") + event = [event]; + const result = await this.call("rpc.on", event); + if (typeof event === "string" && result[event] !== "ok") + throw new Error( + "Failed subscribing to an event '" + event + "' with: " + result[event] + ); + return result; + } + /** + * Unsubscribes from a defined event. + * @method + * @param {String|Array} event - event name + * @return {Undefined} + * @throws {Error} + */ + async unsubscribe(event) { + if (typeof event === "string") + event = [event]; + const result = await this.call("rpc.off", event); + if (typeof event === "string" && result[event] !== "ok") + throw new Error("Failed unsubscribing from an event with: " + result); + return result; + } + /** + * Closes a WebSocket connection gracefully. + * @method + * @param {Number} code - socket close code + * @param {String} data - optional data to be sent before closing + * @return {Undefined} + */ + close(code2, data) { + this.socket.close(code2 || 1e3, data); + } + /** + * Enable / disable automatic reconnection. + * @method + * @param {Boolean} reconnect - enable / disable reconnection + * @return {Undefined} + */ + setAutoReconnect(reconnect2) { + this.reconnect = reconnect2; + } + /** + * Set the interval between reconnection attempts. + * @method + * @param {Number} interval - reconnection interval in milliseconds + * @return {Undefined} + */ + setReconnectInterval(interval) { + this.reconnect_interval = interval; + } + /** + * Set the maximum number of reconnection attempts. + * @method + * @param {Number} max_reconnects - maximum reconnection attempts + * @return {Undefined} + */ + setMaxReconnects(max_reconnects) { + this.max_reconnects = max_reconnects; + } + /** + * Connection/Message handler. + * @method + * @private + * @param {String} address - WebSocket API address + * @param {Object} options - ws options object + * @return {Undefined} + */ + _connect(address2, options) { + clearTimeout(this.reconnect_timer_id); + this.socket = this.webSocketFactory(address2, options); + this.socket.addEventListener("open", () => { + this.ready = true; + this.emit("open"); + this.current_reconnects = 0; + }); + this.socket.addEventListener("message", ({ data: message2 }) => { + if (message2 instanceof ArrayBuffer) + message2 = buffer.Buffer.from(message2).toString(); + try { + message2 = this.dataPack.decode(message2); + } catch (error) { + return; + } + if (message2.notification && this.listeners(message2.notification).length) { + if (!Object.keys(message2.params).length) + return this.emit(message2.notification); + const args = [message2.notification]; + if (message2.params.constructor === Object) + args.push(message2.params); + else + for (let i2 = 0; i2 < message2.params.length; i2++) + args.push(message2.params[i2]); + return Promise.resolve().then(() => { + this.emit.apply(this, args); + }); + } + if (!this.queue[message2.id]) { + if (message2.method) { + return Promise.resolve().then(() => { + this.emit(message2.method, message2 == null ? void 0 : message2.params); + }); + } + return; + } + if ("error" in message2 === "result" in message2) + this.queue[message2.id].promise[1]( + new Error( + 'Server response malformed. Response must include either "result" or "error", but not both.' + ) + ); + if (this.queue[message2.id].timeout) + clearTimeout(this.queue[message2.id].timeout); + if (message2.error) + this.queue[message2.id].promise[1](message2.error); + else + this.queue[message2.id].promise[0](message2.result); + delete this.queue[message2.id]; + }); + this.socket.addEventListener("error", (error) => this.emit("error", error)); + this.socket.addEventListener("close", ({ code: code2, reason }) => { + if (this.ready) + setTimeout(() => this.emit("close", code2, reason), 0); + this.ready = false; + this.socket = void 0; + if (code2 === 1e3) + return; + this.current_reconnects++; + if (this.reconnect && (this.max_reconnects > this.current_reconnects || this.max_reconnects === 0)) + this.reconnect_timer_id = setTimeout( + () => this._connect(address2, options), + this.reconnect_interval + ); + }); + } +}; +let HMAC$1 = class HMAC extends Hash$1 { + constructor(hash3, _key) { + super(); + this.finished = false; + this.destroyed = false; + hash$1(hash3); + const key2 = toBytes$1(_key); + this.iHash = hash3.create(); + if (typeof this.iHash.update !== "function") + throw new Error("Expected instance of class which extends utils.Hash"); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad3 = new Uint8Array(blockLen); + pad3.set(key2.length > blockLen ? hash3.create().update(key2).digest() : key2); + for (let i2 = 0; i2 < pad3.length; i2++) + pad3[i2] ^= 54; + this.iHash.update(pad3); + this.oHash = hash3.create(); + for (let i2 = 0; i2 < pad3.length; i2++) + pad3[i2] ^= 54 ^ 92; + this.oHash.update(pad3); + pad3.fill(0); + } + update(buf) { + exists$1(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + exists$1(this); + bytes$2(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to2) { + to2 || (to2 = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished: finished2, destroyed, blockLen, outputLen } = this; + to2 = to2; + to2.finished = finished2; + to2.destroyed = destroyed; + to2.blockLen = blockLen; + to2.outputLen = outputLen; + to2.oHash = oHash._cloneInto(to2.oHash); + to2.iHash = iHash._cloneInto(to2.iHash); + return to2; + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } +}; +const hmac$1 = (hash3, key2, message2) => new HMAC$1(hash3, key2).update(message2).digest(); +hmac$1.create = (hash3, key2) => new HMAC$1(hash3, key2); +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +function validatePointOpts$1(curve2) { + const opts = validateBasic$1(curve2); + validateObject$1(opts, { + a: "field", + b: "field" + }, { + allowedPrivateKeyLengths: "array", + wrapPrivateKey: "boolean", + isTorsionFree: "function", + clearCofactor: "function", + allowInfinityPoint: "boolean", + fromBytes: "function", + toBytes: "function" + }); + const { endo, Fp: Fp2, a: a3 } = opts; + if (endo) { + if (!Fp2.eql(a3, Fp2.ZERO)) { + throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0"); + } + if (typeof endo !== "object" || typeof endo.beta !== "bigint" || typeof endo.splitScalar !== "function") { + throw new Error("Expected endomorphism with beta: bigint and splitScalar: function"); + } + } + return Object.freeze({ ...opts }); +} +const { bytesToNumberBE: b2n$1, hexToBytes: h2b$1 } = ut$1; +const DER$1 = { + // asn.1 DER encoding utils + Err: class DERErr extends Error { + constructor(m3 = "") { + super(m3); + } + }, + _parseInt(data) { + const { Err: E2 } = DER$1; + if (data.length < 2 || data[0] !== 2) + throw new E2("Invalid signature integer tag"); + const len = data[1]; + const res = data.subarray(2, len + 2); + if (!len || res.length !== len) + throw new E2("Invalid signature integer: wrong length"); + if (res[0] & 128) + throw new E2("Invalid signature integer: negative"); + if (res[0] === 0 && !(res[1] & 128)) + throw new E2("Invalid signature integer: unnecessary leading zero"); + return { d: b2n$1(res), l: data.subarray(len + 2) }; + }, + toSig(hex) { + const { Err: E2 } = DER$1; + const data = typeof hex === "string" ? h2b$1(hex) : hex; + abytes(data); + let l2 = data.length; + if (l2 < 2 || data[0] != 48) + throw new E2("Invalid signature tag"); + if (data[1] !== l2 - 2) + throw new E2("Invalid signature: incorrect length"); + const { d: r2, l: sBytes } = DER$1._parseInt(data.subarray(2)); + const { d: s2, l: rBytesLeft } = DER$1._parseInt(sBytes); + if (rBytesLeft.length) + throw new E2("Invalid signature: left bytes after parsing"); + return { r: r2, s: s2 }; + }, + hexFromSig(sig) { + const slice = (s3) => Number.parseInt(s3[0], 16) & 8 ? "00" + s3 : s3; + const h4 = (num) => { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; + }; + const s2 = slice(h4(sig.s)); + const r2 = slice(h4(sig.r)); + const shl = s2.length / 2; + const rhl = r2.length / 2; + const sl2 = h4(shl); + const rl2 = h4(rhl); + return `30${h4(rhl + shl + 4)}02${rl2}${r2}02${sl2}${s2}`; + } +}; +const _0n$5 = BigInt(0), _1n$7 = BigInt(1); +BigInt(2); +const _3n$2 = BigInt(3); +BigInt(4); +function weierstrassPoints$1(opts) { + const CURVE = validatePointOpts$1(opts); + const { Fp: Fp2 } = CURVE; + const toBytes3 = CURVE.toBytes || ((_c2, point5, _isCompressed) => { + const a3 = point5.toAffine(); + return concatBytes$2(Uint8Array.from([4]), Fp2.toBytes(a3.x), Fp2.toBytes(a3.y)); + }); + const fromBytes = CURVE.fromBytes || ((bytes2) => { + const tail = bytes2.subarray(1); + const x3 = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); + const y3 = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); + return { x: x3, y: y3 }; + }); + function weierstrassEquation(x3) { + const { a: a3, b: b2 } = CURVE; + const x22 = Fp2.sqr(x3); + const x32 = Fp2.mul(x22, x3); + return Fp2.add(Fp2.add(x32, Fp2.mul(x3, a3)), b2); + } + if (!Fp2.eql(Fp2.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) + throw new Error("bad generator point: equation left != right"); + function isWithinCurveOrder(num) { + return typeof num === "bigint" && _0n$5 < num && num < CURVE.n; + } + function assertGE(num) { + if (!isWithinCurveOrder(num)) + throw new Error("Expected valid bigint: 0 < bigint < curve.n"); + } + function normPrivateKeyToScalar(key2) { + const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n: n5 } = CURVE; + if (lengths && typeof key2 !== "bigint") { + if (isBytes(key2)) + key2 = bytesToHex$1(key2); + if (typeof key2 !== "string" || !lengths.includes(key2.length)) + throw new Error("Invalid key"); + key2 = key2.padStart(nByteLength * 2, "0"); + } + let num; + try { + num = typeof key2 === "bigint" ? key2 : bytesToNumberBE$1(ensureBytes$1("private key", key2, nByteLength)); + } catch (error) { + throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key2}`); + } + if (wrapPrivateKey) + num = mod$1(num, n5); + assertGE(num); + return num; + } + const pointPrecomputes = /* @__PURE__ */ new Map(); + function assertPrjPoint(other) { + if (!(other instanceof Point2)) + throw new Error("ProjectivePoint expected"); + } + class Point2 { + constructor(px, py, pz) { + this.px = px; + this.py = py; + this.pz = pz; + if (px == null || !Fp2.isValid(px)) + throw new Error("x required"); + if (py == null || !Fp2.isValid(py)) + throw new Error("y required"); + if (pz == null || !Fp2.isValid(pz)) + throw new Error("z required"); + } + // Does not validate if the point is on-curve. + // Use fromHex instead, or call assertValidity() later. + static fromAffine(p3) { + const { x: x3, y: y3 } = p3 || {}; + if (!p3 || !Fp2.isValid(x3) || !Fp2.isValid(y3)) + throw new Error("invalid affine point"); + if (p3 instanceof Point2) + throw new Error("projective point not allowed"); + const is0 = (i2) => Fp2.eql(i2, Fp2.ZERO); + if (is0(x3) && is0(y3)) + return Point2.ZERO; + return new Point2(x3, y3, Fp2.ONE); + } + get x() { + return this.toAffine().x; + } + get y() { + return this.toAffine().y; + } + /** + * Takes a bunch of Projective Points but executes only one + * inversion on all of them. Inversion is very slow operation, + * so this improves performance massively. + * Optimization: converts a list of projective points to a list of identical points with Z=1. + */ + static normalizeZ(points) { + const toInv = Fp2.invertBatch(points.map((p3) => p3.pz)); + return points.map((p3, i2) => p3.toAffine(toInv[i2])).map(Point2.fromAffine); + } + /** + * Converts hash string or Uint8Array to Point. + * @param hex short/long ECDSA hex + */ + static fromHex(hex) { + const P2 = Point2.fromAffine(fromBytes(ensureBytes$1("pointHex", hex))); + P2.assertValidity(); + return P2; + } + // Multiplies generator point by privateKey. + static fromPrivateKey(privateKey) { + return Point2.BASE.multiply(normPrivateKeyToScalar(privateKey)); + } + // "Private method", don't use it directly + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); + } + // A point on curve is valid if it conforms to equation. + assertValidity() { + if (this.is0()) { + if (CURVE.allowInfinityPoint && !Fp2.is0(this.py)) + return; + throw new Error("bad point: ZERO"); + } + const { x: x3, y: y3 } = this.toAffine(); + if (!Fp2.isValid(x3) || !Fp2.isValid(y3)) + throw new Error("bad point: x or y not FE"); + const left = Fp2.sqr(y3); + const right = weierstrassEquation(x3); + if (!Fp2.eql(left, right)) + throw new Error("bad point: equation left != right"); + if (!this.isTorsionFree()) + throw new Error("bad point: not in prime-order subgroup"); + } + hasEvenY() { + const { y: y3 } = this.toAffine(); + if (Fp2.isOdd) + return !Fp2.isOdd(y3); + throw new Error("Field doesn't support isOdd"); + } + /** + * Compare one point to another. + */ + equals(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + const U12 = Fp2.eql(Fp2.mul(X1, Z2), Fp2.mul(X2, Z1)); + const U22 = Fp2.eql(Fp2.mul(Y1, Z2), Fp2.mul(Y2, Z1)); + return U12 && U22; + } + /** + * Flips point to one corresponding to (x, -y) in Affine coordinates. + */ + negate() { + return new Point2(this.px, Fp2.neg(this.py), this.pz); + } + // Renes-Costello-Batina exception-free doubling formula. + // There is 30% faster Jacobian formula, but it is not complete. + // https://eprint.iacr.org/2015/1060, algorithm 3 + // Cost: 8M + 3S + 3*a + 2*b3 + 15add. + double() { + const { a: a3, b: b2 } = CURVE; + const b3 = Fp2.mul(b2, _3n$2); + const { px: X1, py: Y1, pz: Z1 } = this; + let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; + let t02 = Fp2.mul(X1, X1); + let t1 = Fp2.mul(Y1, Y1); + let t2 = Fp2.mul(Z1, Z1); + let t3 = Fp2.mul(X1, Y1); + t3 = Fp2.add(t3, t3); + Z3 = Fp2.mul(X1, Z1); + Z3 = Fp2.add(Z3, Z3); + X3 = Fp2.mul(a3, Z3); + Y3 = Fp2.mul(b3, t2); + Y3 = Fp2.add(X3, Y3); + X3 = Fp2.sub(t1, Y3); + Y3 = Fp2.add(t1, Y3); + Y3 = Fp2.mul(X3, Y3); + X3 = Fp2.mul(t3, X3); + Z3 = Fp2.mul(b3, Z3); + t2 = Fp2.mul(a3, t2); + t3 = Fp2.sub(t02, t2); + t3 = Fp2.mul(a3, t3); + t3 = Fp2.add(t3, Z3); + Z3 = Fp2.add(t02, t02); + t02 = Fp2.add(Z3, t02); + t02 = Fp2.add(t02, t2); + t02 = Fp2.mul(t02, t3); + Y3 = Fp2.add(Y3, t02); + t2 = Fp2.mul(Y1, Z1); + t2 = Fp2.add(t2, t2); + t02 = Fp2.mul(t2, t3); + X3 = Fp2.sub(X3, t02); + Z3 = Fp2.mul(t2, t1); + Z3 = Fp2.add(Z3, Z3); + Z3 = Fp2.add(Z3, Z3); + return new Point2(X3, Y3, Z3); + } + // Renes-Costello-Batina exception-free addition formula. + // There is 30% faster Jacobian formula, but it is not complete. + // https://eprint.iacr.org/2015/1060, algorithm 1 + // Cost: 12M + 0S + 3*a + 3*b3 + 23add. + add(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; + const a3 = CURVE.a; + const b3 = Fp2.mul(CURVE.b, _3n$2); + let t02 = Fp2.mul(X1, X2); + let t1 = Fp2.mul(Y1, Y2); + let t2 = Fp2.mul(Z1, Z2); + let t3 = Fp2.add(X1, Y1); + let t4 = Fp2.add(X2, Y2); + t3 = Fp2.mul(t3, t4); + t4 = Fp2.add(t02, t1); + t3 = Fp2.sub(t3, t4); + t4 = Fp2.add(X1, Z1); + let t5 = Fp2.add(X2, Z2); + t4 = Fp2.mul(t4, t5); + t5 = Fp2.add(t02, t2); + t4 = Fp2.sub(t4, t5); + t5 = Fp2.add(Y1, Z1); + X3 = Fp2.add(Y2, Z2); + t5 = Fp2.mul(t5, X3); + X3 = Fp2.add(t1, t2); + t5 = Fp2.sub(t5, X3); + Z3 = Fp2.mul(a3, t4); + X3 = Fp2.mul(b3, t2); + Z3 = Fp2.add(X3, Z3); + X3 = Fp2.sub(t1, Z3); + Z3 = Fp2.add(t1, Z3); + Y3 = Fp2.mul(X3, Z3); + t1 = Fp2.add(t02, t02); + t1 = Fp2.add(t1, t02); + t2 = Fp2.mul(a3, t2); + t4 = Fp2.mul(b3, t4); + t1 = Fp2.add(t1, t2); + t2 = Fp2.sub(t02, t2); + t2 = Fp2.mul(a3, t2); + t4 = Fp2.add(t4, t2); + t02 = Fp2.mul(t1, t4); + Y3 = Fp2.add(Y3, t02); + t02 = Fp2.mul(t5, t4); + X3 = Fp2.mul(t3, X3); + X3 = Fp2.sub(X3, t02); + t02 = Fp2.mul(t3, t1); + Z3 = Fp2.mul(t5, Z3); + Z3 = Fp2.add(Z3, t02); + return new Point2(X3, Y3, Z3); + } + subtract(other) { + return this.add(other.negate()); + } + is0() { + return this.equals(Point2.ZERO); + } + wNAF(n5) { + return wnaf.wNAFCached(this, pointPrecomputes, n5, (comp) => { + const toInv = Fp2.invertBatch(comp.map((p3) => p3.pz)); + return comp.map((p3, i2) => p3.toAffine(toInv[i2])).map(Point2.fromAffine); + }); + } + /** + * Non-constant-time multiplication. Uses double-and-add algorithm. + * It's faster, but should only be used when you don't care about + * an exposed private key e.g. sig verification, which works over *public* keys. + */ + multiplyUnsafe(n5) { + const I2 = Point2.ZERO; + if (n5 === _0n$5) + return I2; + assertGE(n5); + if (n5 === _1n$7) + return this; + const { endo } = CURVE; + if (!endo) + return wnaf.unsafeLadder(this, n5); + let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n5); + let k1p = I2; + let k2p = I2; + let d4 = this; + while (k1 > _0n$5 || k2 > _0n$5) { + if (k1 & _1n$7) + k1p = k1p.add(d4); + if (k2 & _1n$7) + k2p = k2p.add(d4); + d4 = d4.double(); + k1 >>= _1n$7; + k2 >>= _1n$7; + } + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new Point2(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + return k1p.add(k2p); + } + /** + * Constant time multiplication. + * Uses wNAF method. Windowed method may be 10% faster, + * but takes 2x longer to generate and consumes 2x memory. + * Uses precomputes when available. + * Uses endomorphism for Koblitz curves. + * @param scalar by which the point would be multiplied + * @returns New point + */ + multiply(scalar) { + assertGE(scalar); + let n5 = scalar; + let point5, fake; + const { endo } = CURVE; + if (endo) { + const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n5); + let { p: k1p, f: f1p } = this.wNAF(k1); + let { p: k2p, f: f2p } = this.wNAF(k2); + k1p = wnaf.constTimeNegate(k1neg, k1p); + k2p = wnaf.constTimeNegate(k2neg, k2p); + k2p = new Point2(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + point5 = k1p.add(k2p); + fake = f1p.add(f2p); + } else { + const { p: p3, f: f4 } = this.wNAF(n5); + point5 = p3; + fake = f4; + } + return Point2.normalizeZ([point5, fake])[0]; + } + /** + * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. + * Not using Strauss-Shamir trick: precomputation tables are faster. + * The trick could be useful if both P and Q are not G (not in our case). + * @returns non-zero affine point + */ + multiplyAndAddUnsafe(Q2, a3, b2) { + const G2 = Point2.BASE; + const mul6 = (P2, a4) => a4 === _0n$5 || a4 === _1n$7 || !P2.equals(G2) ? P2.multiplyUnsafe(a4) : P2.multiply(a4); + const sum = mul6(this, a3).add(mul6(Q2, b2)); + return sum.is0() ? void 0 : sum; + } + // Converts Projective point to affine (x, y) coordinates. + // Can accept precomputed Z^-1 - for example, from invertBatch. + // (x, y, z) ∋ (x=x/z, y=y/z) + toAffine(iz) { + const { px: x3, py: y3, pz: z3 } = this; + const is0 = this.is0(); + if (iz == null) + iz = is0 ? Fp2.ONE : Fp2.inv(z3); + const ax = Fp2.mul(x3, iz); + const ay = Fp2.mul(y3, iz); + const zz = Fp2.mul(z3, iz); + if (is0) + return { x: Fp2.ZERO, y: Fp2.ZERO }; + if (!Fp2.eql(zz, Fp2.ONE)) + throw new Error("invZ was invalid"); + return { x: ax, y: ay }; + } + isTorsionFree() { + const { h: cofactor, isTorsionFree } = CURVE; + if (cofactor === _1n$7) + return true; + if (isTorsionFree) + return isTorsionFree(Point2, this); + throw new Error("isTorsionFree() has not been declared for the elliptic curve"); + } + clearCofactor() { + const { h: cofactor, clearCofactor } = CURVE; + if (cofactor === _1n$7) + return this; + if (clearCofactor) + return clearCofactor(Point2, this); + return this.multiplyUnsafe(CURVE.h); + } + toRawBytes(isCompressed = true) { + this.assertValidity(); + return toBytes3(Point2, this, isCompressed); + } + toHex(isCompressed = true) { + return bytesToHex$1(this.toRawBytes(isCompressed)); + } + } + Point2.BASE = new Point2(CURVE.Gx, CURVE.Gy, Fp2.ONE); + Point2.ZERO = new Point2(Fp2.ZERO, Fp2.ONE, Fp2.ZERO); + const _bits = CURVE.nBitLength; + const wnaf = wNAF$1(Point2, CURVE.endo ? Math.ceil(_bits / 2) : _bits); + return { + CURVE, + ProjectivePoint: Point2, + normPrivateKeyToScalar, + weierstrassEquation, + isWithinCurveOrder + }; +} +function validateOpts$1(curve2) { + const opts = validateBasic$1(curve2); + validateObject$1(opts, { + hash: "hash", + hmac: "function", + randomBytes: "function" + }, { + bits2int: "function", + bits2int_modN: "function", + lowS: "boolean" + }); + return Object.freeze({ lowS: true, ...opts }); +} +function weierstrass$1(curveDef) { + const CURVE = validateOpts$1(curveDef); + const { Fp: Fp2, n: CURVE_ORDER } = CURVE; + const compressedLen = Fp2.BYTES + 1; + const uncompressedLen = 2 * Fp2.BYTES + 1; + function isValidFieldElement(num) { + return _0n$5 < num && num < Fp2.ORDER; + } + function modN(a3) { + return mod$1(a3, CURVE_ORDER); + } + function invN(a3) { + return invert$1(a3, CURVE_ORDER); + } + const { ProjectivePoint: Point2, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder } = weierstrassPoints$1({ + ...CURVE, + toBytes(_c2, point5, isCompressed) { + const a3 = point5.toAffine(); + const x3 = Fp2.toBytes(a3.x); + const cat = concatBytes$2; + if (isCompressed) { + return cat(Uint8Array.from([point5.hasEvenY() ? 2 : 3]), x3); + } else { + return cat(Uint8Array.from([4]), x3, Fp2.toBytes(a3.y)); + } + }, + fromBytes(bytes2) { + const len = bytes2.length; + const head = bytes2[0]; + const tail = bytes2.subarray(1); + if (len === compressedLen && (head === 2 || head === 3)) { + const x3 = bytesToNumberBE$1(tail); + if (!isValidFieldElement(x3)) + throw new Error("Point is not on curve"); + const y22 = weierstrassEquation(x3); + let y3; + try { + y3 = Fp2.sqrt(y22); + } catch (sqrtError) { + const suffix = sqrtError instanceof Error ? ": " + sqrtError.message : ""; + throw new Error("Point is not on curve" + suffix); + } + const isYOdd = (y3 & _1n$7) === _1n$7; + const isHeadOdd = (head & 1) === 1; + if (isHeadOdd !== isYOdd) + y3 = Fp2.neg(y3); + return { x: x3, y: y3 }; + } else if (len === uncompressedLen && head === 4) { + const x3 = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); + const y3 = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); + return { x: x3, y: y3 }; + } else { + throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); + } + } + }); + const numToNByteStr = (num) => bytesToHex$1(numberToBytesBE$1(num, CURVE.nByteLength)); + function isBiggerThanHalfOrder(number2) { + const HALF = CURVE_ORDER >> _1n$7; + return number2 > HALF; + } + function normalizeS(s2) { + return isBiggerThanHalfOrder(s2) ? modN(-s2) : s2; + } + const slcNum = (b2, from2, to2) => bytesToNumberBE$1(b2.slice(from2, to2)); + class Signature2 { + constructor(r2, s2, recovery) { + this.r = r2; + this.s = s2; + this.recovery = recovery; + this.assertValidity(); + } + // pair (bytes of r, bytes of s) + static fromCompact(hex) { + const l2 = CURVE.nByteLength; + hex = ensureBytes$1("compactSignature", hex, l2 * 2); + return new Signature2(slcNum(hex, 0, l2), slcNum(hex, l2, 2 * l2)); + } + // DER encoded ECDSA signature + // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script + static fromDER(hex) { + const { r: r2, s: s2 } = DER$1.toSig(ensureBytes$1("DER", hex)); + return new Signature2(r2, s2); + } + assertValidity() { + if (!isWithinCurveOrder(this.r)) + throw new Error("r must be 0 < r < CURVE.n"); + if (!isWithinCurveOrder(this.s)) + throw new Error("s must be 0 < s < CURVE.n"); + } + addRecoveryBit(recovery) { + return new Signature2(this.r, this.s, recovery); + } + recoverPublicKey(msgHash) { + const { r: r2, s: s2, recovery: rec } = this; + const h4 = bits2int_modN(ensureBytes$1("msgHash", msgHash)); + if (rec == null || ![0, 1, 2, 3].includes(rec)) + throw new Error("recovery id invalid"); + const radj = rec === 2 || rec === 3 ? r2 + CURVE.n : r2; + if (radj >= Fp2.ORDER) + throw new Error("recovery id 2 or 3 invalid"); + const prefix = (rec & 1) === 0 ? "02" : "03"; + const R3 = Point2.fromHex(prefix + numToNByteStr(radj)); + const ir2 = invN(radj); + const u1 = modN(-h4 * ir2); + const u2 = modN(s2 * ir2); + const Q2 = Point2.BASE.multiplyAndAddUnsafe(R3, u1, u2); + if (!Q2) + throw new Error("point at infinify"); + Q2.assertValidity(); + return Q2; + } + // Signatures should be low-s, to prevent malleability. + hasHighS() { + return isBiggerThanHalfOrder(this.s); + } + normalizeS() { + return this.hasHighS() ? new Signature2(this.r, modN(-this.s), this.recovery) : this; + } + // DER-encoded + toDERRawBytes() { + return hexToBytes$1(this.toDERHex()); + } + toDERHex() { + return DER$1.hexFromSig({ r: this.r, s: this.s }); + } + // padded bytes of r, then padded bytes of s + toCompactRawBytes() { + return hexToBytes$1(this.toCompactHex()); + } + toCompactHex() { + return numToNByteStr(this.r) + numToNByteStr(this.s); + } + } + const utils2 = { + isValidPrivateKey(privateKey) { + try { + normPrivateKeyToScalar(privateKey); + return true; + } catch (error) { + return false; + } + }, + normPrivateKeyToScalar, + /** + * Produces cryptographically secure private key from random of size + * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. + */ + randomPrivateKey: () => { + const length = getMinHashLength$1(CURVE.n); + return mapHashToField$1(CURVE.randomBytes(length), CURVE.n); + }, + /** + * Creates precompute table for an arbitrary EC point. Makes point "cached". + * Allows to massively speed-up `point.multiply(scalar)`. + * @returns cached point + * @example + * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); + * fast.multiply(privKey); // much faster ECDH now + */ + precompute(windowSize = 8, point5 = Point2.BASE) { + point5._setWindowSize(windowSize); + point5.multiply(BigInt(3)); + return point5; + } + }; + function getPublicKey(privateKey, isCompressed = true) { + return Point2.fromPrivateKey(privateKey).toRawBytes(isCompressed); + } + function isProbPub(item) { + const arr = isBytes(item); + const str = typeof item === "string"; + const len = (arr || str) && item.length; + if (arr) + return len === compressedLen || len === uncompressedLen; + if (str) + return len === 2 * compressedLen || len === 2 * uncompressedLen; + if (item instanceof Point2) + return true; + return false; + } + function getSharedSecret(privateA, publicB, isCompressed = true) { + if (isProbPub(privateA)) + throw new Error("first arg must be private key"); + if (!isProbPub(publicB)) + throw new Error("second arg must be public key"); + const b2 = Point2.fromHex(publicB); + return b2.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); + } + const bits2int = CURVE.bits2int || function(bytes2) { + const num = bytesToNumberBE$1(bytes2); + const delta = bytes2.length * 8 - CURVE.nBitLength; + return delta > 0 ? num >> BigInt(delta) : num; + }; + const bits2int_modN = CURVE.bits2int_modN || function(bytes2) { + return modN(bits2int(bytes2)); + }; + const ORDER_MASK = bitMask$1(CURVE.nBitLength); + function int2octets(num) { + if (typeof num !== "bigint") + throw new Error("bigint expected"); + if (!(_0n$5 <= num && num < ORDER_MASK)) + throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); + return numberToBytesBE$1(num, CURVE.nByteLength); + } + function prepSig(msgHash, privateKey, opts = defaultSigOpts) { + if (["recovered", "canonical"].some((k2) => k2 in opts)) + throw new Error("sign() legacy options not supported"); + const { hash: hash3, randomBytes: randomBytes2 } = CURVE; + let { lowS, prehash, extraEntropy: ent } = opts; + if (lowS == null) + lowS = true; + msgHash = ensureBytes$1("msgHash", msgHash); + if (prehash) + msgHash = ensureBytes$1("prehashed msgHash", hash3(msgHash)); + const h1int = bits2int_modN(msgHash); + const d4 = normPrivateKeyToScalar(privateKey); + const seedArgs = [int2octets(d4), int2octets(h1int)]; + if (ent != null && ent !== false) { + const e18 = ent === true ? randomBytes2(Fp2.BYTES) : ent; + seedArgs.push(ensureBytes$1("extraEntropy", e18)); + } + const seed = concatBytes$2(...seedArgs); + const m3 = h1int; + function k2sig(kBytes) { + const k2 = bits2int(kBytes); + if (!isWithinCurveOrder(k2)) + return; + const ik2 = invN(k2); + const q2 = Point2.BASE.multiply(k2).toAffine(); + const r2 = modN(q2.x); + if (r2 === _0n$5) + return; + const s2 = modN(ik2 * modN(m3 + r2 * d4)); + if (s2 === _0n$5) + return; + let recovery = (q2.x === r2 ? 0 : 2) | Number(q2.y & _1n$7); + let normS = s2; + if (lowS && isBiggerThanHalfOrder(s2)) { + normS = normalizeS(s2); + recovery ^= 1; + } + return new Signature2(r2, normS, recovery); + } + return { seed, k2sig }; + } + const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; + const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; + function sign6(msgHash, privKey, opts = defaultSigOpts) { + const { seed, k2sig } = prepSig(msgHash, privKey, opts); + const C3 = CURVE; + const drbg = createHmacDrbg$1(C3.hash.outputLen, C3.nByteLength, C3.hmac); + return drbg(seed, k2sig); + } + Point2.BASE._setWindowSize(8); + function verify6(signature2, msgHash, publicKey2, opts = defaultVerOpts) { + var _a3; + const sg2 = signature2; + msgHash = ensureBytes$1("msgHash", msgHash); + publicKey2 = ensureBytes$1("publicKey", publicKey2); + if ("strict" in opts) + throw new Error("options.strict was renamed to lowS"); + const { lowS, prehash } = opts; + let _sig2 = void 0; + let P2; + try { + if (typeof sg2 === "string" || isBytes(sg2)) { + try { + _sig2 = Signature2.fromDER(sg2); + } catch (derError) { + if (!(derError instanceof DER$1.Err)) + throw derError; + _sig2 = Signature2.fromCompact(sg2); + } + } else if (typeof sg2 === "object" && typeof sg2.r === "bigint" && typeof sg2.s === "bigint") { + const { r: r3, s: s3 } = sg2; + _sig2 = new Signature2(r3, s3); + } else { + throw new Error("PARSE"); + } + P2 = Point2.fromHex(publicKey2); + } catch (error) { + if (error.message === "PARSE") + throw new Error(`signature must be Signature instance, Uint8Array or hex string`); + return false; + } + if (lowS && _sig2.hasHighS()) + return false; + if (prehash) + msgHash = CURVE.hash(msgHash); + const { r: r2, s: s2 } = _sig2; + const h4 = bits2int_modN(msgHash); + const is2 = invN(s2); + const u1 = modN(h4 * is2); + const u2 = modN(r2 * is2); + const R3 = (_a3 = Point2.BASE.multiplyAndAddUnsafe(P2, u1, u2)) == null ? void 0 : _a3.toAffine(); + if (!R3) + return false; + const v6 = modN(R3.x); + return v6 === r2; + } + return { + CURVE, + getPublicKey, + getSharedSecret, + sign: sign6, + verify: verify6, + ProjectivePoint: Point2, + Signature: Signature2, + utils: utils2 + }; +} +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +function getHash$1(hash3) { + return { + hash: hash3, + hmac: (key2, ...msgs) => hmac$1(hash3, key2, concatBytes$3(...msgs)), + randomBytes: randomBytes$3 + }; +} +function createCurve$1(curveDef, defHash) { + const create3 = (hash3) => weierstrass$1({ ...curveDef, ...getHash$1(hash3) }); + return Object.freeze({ ...create3(defHash), create: create3 }); +} +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const secp256k1P$1 = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"); +const secp256k1N$1 = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); +const _1n$6 = BigInt(1); +const _2n$4 = BigInt(2); +const divNearest$1 = (a3, b2) => (a3 + b2 / _2n$4) / b2; +function sqrtMod$1(y3) { + const P2 = secp256k1P$1; + const _3n2 = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); + const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); + const b2 = y3 * y3 * y3 % P2; + const b3 = b2 * b2 * y3 % P2; + const b6 = pow2$1(b3, _3n2, P2) * b3 % P2; + const b9 = pow2$1(b6, _3n2, P2) * b3 % P2; + const b11 = pow2$1(b9, _2n$4, P2) * b2 % P2; + const b22 = pow2$1(b11, _11n, P2) * b11 % P2; + const b44 = pow2$1(b22, _22n, P2) * b22 % P2; + const b88 = pow2$1(b44, _44n, P2) * b44 % P2; + const b176 = pow2$1(b88, _88n, P2) * b88 % P2; + const b220 = pow2$1(b176, _44n, P2) * b44 % P2; + const b223 = pow2$1(b220, _3n2, P2) * b3 % P2; + const t1 = pow2$1(b223, _23n, P2) * b22 % P2; + const t2 = pow2$1(t1, _6n, P2) * b2 % P2; + const root = pow2$1(t2, _2n$4, P2); + if (!Fp$1.eql(Fp$1.sqr(root), y3)) + throw new Error("Cannot find square root"); + return root; +} +const Fp$1 = Field$1(secp256k1P$1, void 0, void 0, { sqrt: sqrtMod$1 }); +const secp256k1$1 = createCurve$1({ + a: BigInt(0), + // equation params: a, b + b: BigInt(7), + // Seem to be rigid: bitcointalk.org/index.php?topic=289795.msg3183975#msg3183975 + Fp: Fp$1, + // Field's prime: 2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n + n: secp256k1N$1, + // Curve order, total count of valid points in the field + // Base point (x, y) aka generator point + Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"), + Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"), + h: BigInt(1), + // Cofactor + lowS: true, + // Allow only low-S signatures by default in sign() and verify() + /** + * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. + * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. + * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. + * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 + */ + endo: { + beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"), + splitScalar: (k2) => { + const n5 = secp256k1N$1; + const a1 = BigInt("0x3086d221a7d46bcde86c90e49284eb15"); + const b1 = -_1n$6 * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"); + const a22 = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"); + const b2 = a1; + const POW_2_128 = BigInt("0x100000000000000000000000000000000"); + const c1 = divNearest$1(b2 * k2, n5); + const c2 = divNearest$1(-b1 * k2, n5); + let k1 = mod$1(k2 - c1 * a1 - c2 * a22, n5); + let k22 = mod$1(-c1 * b1 - c2 * b2, n5); + const k1neg = k1 > POW_2_128; + const k2neg = k22 > POW_2_128; + if (k1neg) + k1 = n5 - k1; + if (k2neg) + k22 = n5 - k22; + if (k1 > POW_2_128 || k22 > POW_2_128) { + throw new Error("splitScalar: Endomorphism failed, k=" + k2); + } + return { k1neg, k1, k2neg, k2: k22 }; + } + } +}, sha256$2); +BigInt(0); +secp256k1$1.ProjectivePoint; +ed25519.utils.randomPrivateKey; +function isOnCurve(publicKey2) { + try { + ed25519.ExtendedPoint.fromHex(publicKey2); + return true; + } catch { + return false; + } +} +const sign5 = (message2, secretKey) => ed25519.sign(message2, secretKey.slice(0, 32)); +const verify5 = ed25519.verify; +const toBuffer = (arr) => { + if (buffer.Buffer.isBuffer(arr)) { + return arr; + } else if (arr instanceof Uint8Array) { + return buffer.Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength); + } else { + return buffer.Buffer.from(arr); + } +}; +class Struct2 { + constructor(properties) { + Object.assign(this, properties); + } + encode() { + return buffer.Buffer.from(serialize_1(SOLANA_SCHEMA, this)); + } + static decode(data) { + return deserialize_1(SOLANA_SCHEMA, this, data); + } + static decodeUnchecked(data) { + return deserializeUnchecked_1(SOLANA_SCHEMA, this, data); + } +} +const SOLANA_SCHEMA = /* @__PURE__ */ new Map(); +var _PublicKey; +const MAX_SEED_LENGTH = 32; +const PUBLIC_KEY_LENGTH = 32; +function isPublicKeyData(value) { + return value._bn !== void 0; +} +let uniquePublicKeyCounter = 1; +class PublicKey extends Struct2 { + /** + * Create a new PublicKey object + * @param value ed25519 public key as buffer or base-58 encoded string + */ + constructor(value) { + super({}); + this._bn = void 0; + if (isPublicKeyData(value)) { + this._bn = value._bn; + } else { + if (typeof value === "string") { + const decoded = bs58$3.decode(value); + if (decoded.length != PUBLIC_KEY_LENGTH) { + throw new Error(`Invalid public key input`); + } + this._bn = new _BN(decoded); + } else { + this._bn = new _BN(value); + } + if (this._bn.byteLength() > PUBLIC_KEY_LENGTH) { + throw new Error(`Invalid public key input`); + } + } + } + /** + * Returns a unique PublicKey for tests and benchmarks using a counter + */ + static unique() { + const key2 = new PublicKey(uniquePublicKeyCounter); + uniquePublicKeyCounter += 1; + return new PublicKey(key2.toBuffer()); + } + /** + * Default public key value. The base58-encoded string representation is all ones (as seen below) + * The underlying BN number is 32 bytes that are all zeros + */ + /** + * Checks if two publicKeys are equal + */ + equals(publicKey2) { + return this._bn.eq(publicKey2._bn); + } + /** + * Return the base-58 representation of the public key + */ + toBase58() { + return bs58$3.encode(this.toBytes()); + } + toJSON() { + return this.toBase58(); + } + /** + * Return the byte array representation of the public key in big endian + */ + toBytes() { + const buf = this.toBuffer(); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + } + /** + * Return the Buffer representation of the public key in big endian + */ + toBuffer() { + const b2 = this._bn.toArrayLike(buffer.Buffer); + if (b2.length === PUBLIC_KEY_LENGTH) { + return b2; + } + const zeroPad2 = buffer.Buffer.alloc(32); + b2.copy(zeroPad2, 32 - b2.length); + return zeroPad2; + } + get [Symbol.toStringTag]() { + return `PublicKey(${this.toString()})`; + } + /** + * Return the base-58 representation of the public key + */ + toString() { + return this.toBase58(); + } + /** + * Derive a public key from another key, a seed, and a program ID. + * The program ID will also serve as the owner of the public key, giving + * it permission to write data to the account. + */ + /* eslint-disable require-await */ + static async createWithSeed(fromPublicKey, seed, programId) { + const buffer$12 = buffer.Buffer.concat([fromPublicKey.toBuffer(), buffer.Buffer.from(seed), programId.toBuffer()]); + const publicKeyBytes = sha256$2(buffer$12); + return new PublicKey(publicKeyBytes); + } + /** + * Derive a program address from seeds and a program ID. + */ + /* eslint-disable require-await */ + static createProgramAddressSync(seeds, programId) { + let buffer$12 = buffer.Buffer.alloc(0); + seeds.forEach(function(seed) { + if (seed.length > MAX_SEED_LENGTH) { + throw new TypeError(`Max seed length exceeded`); + } + buffer$12 = buffer.Buffer.concat([buffer$12, toBuffer(seed)]); + }); + buffer$12 = buffer.Buffer.concat([buffer$12, programId.toBuffer(), buffer.Buffer.from("ProgramDerivedAddress")]); + const publicKeyBytes = sha256$2(buffer$12); + if (isOnCurve(publicKeyBytes)) { + throw new Error(`Invalid seeds, address must fall off the curve`); + } + return new PublicKey(publicKeyBytes); + } + /** + * Async version of createProgramAddressSync + * For backwards compatibility + * + * @deprecated Use {@link createProgramAddressSync} instead + */ + /* eslint-disable require-await */ + static async createProgramAddress(seeds, programId) { + return this.createProgramAddressSync(seeds, programId); + } + /** + * Find a valid program address + * + * Valid program addresses must fall off the ed25519 curve. This function + * iterates a nonce until it finds one that when combined with the seeds + * results in a valid program address. + */ + static findProgramAddressSync(seeds, programId) { + let nonce = 255; + let address2; + while (nonce != 0) { + try { + const seedsWithNonce = seeds.concat(buffer.Buffer.from([nonce])); + address2 = this.createProgramAddressSync(seedsWithNonce, programId); + } catch (err) { + if (err instanceof TypeError) { + throw err; + } + nonce--; + continue; + } + return [address2, nonce]; + } + throw new Error(`Unable to find a viable program address nonce`); + } + /** + * Async version of findProgramAddressSync + * For backwards compatibility + * + * @deprecated Use {@link findProgramAddressSync} instead + */ + static async findProgramAddress(seeds, programId) { + return this.findProgramAddressSync(seeds, programId); + } + /** + * Check that a pubkey is on the ed25519 curve. + */ + static isOnCurve(pubkeyData) { + const pubkey = new PublicKey(pubkeyData); + return isOnCurve(pubkey.toBytes()); + } +} +_PublicKey = PublicKey; +PublicKey.default = new _PublicKey("11111111111111111111111111111111"); +SOLANA_SCHEMA.set(PublicKey, { + kind: "struct", + fields: [["_bn", "u256"]] +}); +new PublicKey("BPFLoader1111111111111111111111111111111111"); +const PACKET_DATA_SIZE = 1280 - 40 - 8; +const VERSION_PREFIX_MASK = 127; +const SIGNATURE_LENGTH_IN_BYTES$1 = 64; +class TransactionExpiredBlockheightExceededError extends Error { + constructor(signature2) { + super(`Signature ${signature2} has expired: block height exceeded.`); + this.signature = void 0; + this.signature = signature2; + } +} +Object.defineProperty(TransactionExpiredBlockheightExceededError.prototype, "name", { + value: "TransactionExpiredBlockheightExceededError" +}); +class TransactionExpiredTimeoutError extends Error { + constructor(signature2, timeoutSeconds) { + super(`Transaction was not confirmed in ${timeoutSeconds.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${signature2} using the Solana Explorer or CLI tools.`); + this.signature = void 0; + this.signature = signature2; + } +} +Object.defineProperty(TransactionExpiredTimeoutError.prototype, "name", { + value: "TransactionExpiredTimeoutError" +}); +class TransactionExpiredNonceInvalidError extends Error { + constructor(signature2) { + super(`Signature ${signature2} has expired: the nonce is no longer valid.`); + this.signature = void 0; + this.signature = signature2; + } +} +Object.defineProperty(TransactionExpiredNonceInvalidError.prototype, "name", { + value: "TransactionExpiredNonceInvalidError" +}); +class MessageAccountKeys { + constructor(staticAccountKeys, accountKeysFromLookups) { + this.staticAccountKeys = void 0; + this.accountKeysFromLookups = void 0; + this.staticAccountKeys = staticAccountKeys; + this.accountKeysFromLookups = accountKeysFromLookups; + } + keySegments() { + const keySegments = [this.staticAccountKeys]; + if (this.accountKeysFromLookups) { + keySegments.push(this.accountKeysFromLookups.writable); + keySegments.push(this.accountKeysFromLookups.readonly); + } + return keySegments; + } + get(index2) { + for (const keySegment of this.keySegments()) { + if (index2 < keySegment.length) { + return keySegment[index2]; + } else { + index2 -= keySegment.length; + } + } + return; + } + get length() { + return this.keySegments().flat().length; + } + compileInstructions(instructions) { + const U8_MAX = 255; + if (this.length > U8_MAX + 1) { + throw new Error("Account index overflow encountered during compilation"); + } + const keyIndexMap = /* @__PURE__ */ new Map(); + this.keySegments().flat().forEach((key2, index2) => { + keyIndexMap.set(key2.toBase58(), index2); + }); + const findKeyIndex = (key2) => { + const keyIndex = keyIndexMap.get(key2.toBase58()); + if (keyIndex === void 0) + throw new Error("Encountered an unknown instruction account key during compilation"); + return keyIndex; + }; + return instructions.map((instruction) => { + return { + programIdIndex: findKeyIndex(instruction.programId), + accountKeyIndexes: instruction.keys.map((meta) => findKeyIndex(meta.pubkey)), + data: instruction.data + }; + }); + } +} +const publicKey = (property = "publicKey") => { + return blob(32, property); +}; +const signature = (property = "signature") => { + return blob(64, property); +}; +const rustString = (property = "string") => { + const rsl = struct([u32$1("length"), u32$1("lengthPadding"), blob(offset(u32$1(), -8), "chars")], property); + const _decode2 = rsl.decode.bind(rsl); + const _encode4 = rsl.encode.bind(rsl); + const rslShim = rsl; + rslShim.decode = (b2, offset2) => { + const data = _decode2(b2, offset2); + return data["chars"].toString(); + }; + rslShim.encode = (str, b2, offset2) => { + const data = { + chars: buffer.Buffer.from(str, "utf8") + }; + return _encode4(data, b2, offset2); + }; + rslShim.alloc = (str) => { + return u32$1().span + u32$1().span + buffer.Buffer.from(str, "utf8").length; + }; + return rslShim; +}; +const authorized = (property = "authorized") => { + return struct([publicKey("staker"), publicKey("withdrawer")], property); +}; +const lockup = (property = "lockup") => { + return struct([ns64("unixTimestamp"), ns64("epoch"), publicKey("custodian")], property); +}; +const voteInit = (property = "voteInit") => { + return struct([publicKey("nodePubkey"), publicKey("authorizedVoter"), publicKey("authorizedWithdrawer"), u8("commission")], property); +}; +const voteAuthorizeWithSeedArgs = (property = "voteAuthorizeWithSeedArgs") => { + return struct([u32$1("voteAuthorizationType"), publicKey("currentAuthorityDerivedKeyOwnerPubkey"), rustString("currentAuthorityDerivedKeySeed"), publicKey("newAuthorized")], property); +}; +function decodeLength(bytes2) { + let len = 0; + let size2 = 0; + for (; ; ) { + let elem = bytes2.shift(); + len |= (elem & 127) << size2 * 7; + size2 += 1; + if ((elem & 128) === 0) { + break; + } + } + return len; +} +function encodeLength(bytes2, len) { + let rem_len = len; + for (; ; ) { + let elem = rem_len & 127; + rem_len >>= 7; + if (rem_len == 0) { + bytes2.push(elem); + break; + } else { + elem |= 128; + bytes2.push(elem); + } + } +} +function assert$1(condition, message2) { + if (!condition) { + throw new Error(message2 || "Assertion failed"); + } +} +class CompiledKeys { + constructor(payer, keyMetaMap) { + this.payer = void 0; + this.keyMetaMap = void 0; + this.payer = payer; + this.keyMetaMap = keyMetaMap; + } + static compile(instructions, payer) { + const keyMetaMap = /* @__PURE__ */ new Map(); + const getOrInsertDefault = (pubkey) => { + const address2 = pubkey.toBase58(); + let keyMeta = keyMetaMap.get(address2); + if (keyMeta === void 0) { + keyMeta = { + isSigner: false, + isWritable: false, + isInvoked: false + }; + keyMetaMap.set(address2, keyMeta); + } + return keyMeta; + }; + const payerKeyMeta = getOrInsertDefault(payer); + payerKeyMeta.isSigner = true; + payerKeyMeta.isWritable = true; + for (const ix of instructions) { + getOrInsertDefault(ix.programId).isInvoked = true; + for (const accountMeta of ix.keys) { + const keyMeta = getOrInsertDefault(accountMeta.pubkey); + keyMeta.isSigner || (keyMeta.isSigner = accountMeta.isSigner); + keyMeta.isWritable || (keyMeta.isWritable = accountMeta.isWritable); + } + } + return new CompiledKeys(payer, keyMetaMap); + } + getMessageComponents() { + const mapEntries = [...this.keyMetaMap.entries()]; + assert$1(mapEntries.length <= 256, "Max static account keys length exceeded"); + const writableSigners = mapEntries.filter(([, meta]) => meta.isSigner && meta.isWritable); + const readonlySigners = mapEntries.filter(([, meta]) => meta.isSigner && !meta.isWritable); + const writableNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && meta.isWritable); + const readonlyNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && !meta.isWritable); + const header = { + numRequiredSignatures: writableSigners.length + readonlySigners.length, + numReadonlySignedAccounts: readonlySigners.length, + numReadonlyUnsignedAccounts: readonlyNonSigners.length + }; + { + assert$1(writableSigners.length > 0, "Expected at least one writable signer key"); + const [payerAddress] = writableSigners[0]; + assert$1(payerAddress === this.payer.toBase58(), "Expected first writable signer key to be the fee payer"); + } + const staticAccountKeys = [...writableSigners.map(([address2]) => new PublicKey(address2)), ...readonlySigners.map(([address2]) => new PublicKey(address2)), ...writableNonSigners.map(([address2]) => new PublicKey(address2)), ...readonlyNonSigners.map(([address2]) => new PublicKey(address2))]; + return [header, staticAccountKeys]; + } + extractTableLookup(lookupTable) { + const [writableIndexes, drainedWritableKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, (keyMeta) => !keyMeta.isSigner && !keyMeta.isInvoked && keyMeta.isWritable); + const [readonlyIndexes, drainedReadonlyKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, (keyMeta) => !keyMeta.isSigner && !keyMeta.isInvoked && !keyMeta.isWritable); + if (writableIndexes.length === 0 && readonlyIndexes.length === 0) { + return; + } + return [{ + accountKey: lookupTable.key, + writableIndexes, + readonlyIndexes + }, { + writable: drainedWritableKeys, + readonly: drainedReadonlyKeys + }]; + } + /** @internal */ + drainKeysFoundInLookupTable(lookupTableEntries, keyMetaFilter) { + const lookupTableIndexes = new Array(); + const drainedKeys = new Array(); + for (const [address2, keyMeta] of this.keyMetaMap.entries()) { + if (keyMetaFilter(keyMeta)) { + const key2 = new PublicKey(address2); + const lookupTableIndex = lookupTableEntries.findIndex((entry) => entry.equals(key2)); + if (lookupTableIndex >= 0) { + assert$1(lookupTableIndex < 256, "Max lookup table index exceeded"); + lookupTableIndexes.push(lookupTableIndex); + drainedKeys.push(key2); + this.keyMetaMap.delete(address2); + } + } + } + return [lookupTableIndexes, drainedKeys]; + } +} +const END_OF_BUFFER_ERROR_MESSAGE = "Reached end of buffer unexpectedly"; +function guardedShift(byteArray) { + if (byteArray.length === 0) { + throw new Error(END_OF_BUFFER_ERROR_MESSAGE); + } + return byteArray.shift(); +} +function guardedSplice(byteArray, ...args) { + const [start] = args; + if (args.length === 2 ? start + (args[1] ?? 0) > byteArray.length : start >= byteArray.length) { + throw new Error(END_OF_BUFFER_ERROR_MESSAGE); + } + return byteArray.splice(...args); +} +class Message { + constructor(args) { + this.header = void 0; + this.accountKeys = void 0; + this.recentBlockhash = void 0; + this.instructions = void 0; + this.indexToProgramIds = /* @__PURE__ */ new Map(); + this.header = args.header; + this.accountKeys = args.accountKeys.map((account) => new PublicKey(account)); + this.recentBlockhash = args.recentBlockhash; + this.instructions = args.instructions; + this.instructions.forEach((ix) => this.indexToProgramIds.set(ix.programIdIndex, this.accountKeys[ix.programIdIndex])); + } + get version() { + return "legacy"; + } + get staticAccountKeys() { + return this.accountKeys; + } + get compiledInstructions() { + return this.instructions.map((ix) => ({ + programIdIndex: ix.programIdIndex, + accountKeyIndexes: ix.accounts, + data: bs58$3.decode(ix.data) + })); + } + get addressTableLookups() { + return []; + } + getAccountKeys() { + return new MessageAccountKeys(this.staticAccountKeys); + } + static compile(args) { + const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey); + const [header, staticAccountKeys] = compiledKeys.getMessageComponents(); + const accountKeys = new MessageAccountKeys(staticAccountKeys); + const instructions = accountKeys.compileInstructions(args.instructions).map((ix) => ({ + programIdIndex: ix.programIdIndex, + accounts: ix.accountKeyIndexes, + data: bs58$3.encode(ix.data) + })); + return new Message({ + header, + accountKeys: staticAccountKeys, + recentBlockhash: args.recentBlockhash, + instructions + }); + } + isAccountSigner(index2) { + return index2 < this.header.numRequiredSignatures; + } + isAccountWritable(index2) { + const numSignedAccounts = this.header.numRequiredSignatures; + if (index2 >= this.header.numRequiredSignatures) { + const unsignedAccountIndex = index2 - numSignedAccounts; + const numUnsignedAccounts = this.accountKeys.length - numSignedAccounts; + const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts; + return unsignedAccountIndex < numWritableUnsignedAccounts; + } else { + const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts; + return index2 < numWritableSignedAccounts; + } + } + isProgramId(index2) { + return this.indexToProgramIds.has(index2); + } + programIds() { + return [...this.indexToProgramIds.values()]; + } + nonProgramIds() { + return this.accountKeys.filter((_3, index2) => !this.isProgramId(index2)); + } + serialize() { + const numKeys = this.accountKeys.length; + let keyCount = []; + encodeLength(keyCount, numKeys); + const instructions = this.instructions.map((instruction) => { + const { + accounts: accounts2, + programIdIndex + } = instruction; + const data = Array.from(bs58$3.decode(instruction.data)); + let keyIndicesCount = []; + encodeLength(keyIndicesCount, accounts2.length); + let dataCount = []; + encodeLength(dataCount, data.length); + return { + programIdIndex, + keyIndicesCount: buffer.Buffer.from(keyIndicesCount), + keyIndices: accounts2, + dataLength: buffer.Buffer.from(dataCount), + data + }; + }); + let instructionCount = []; + encodeLength(instructionCount, instructions.length); + let instructionBuffer = buffer.Buffer.alloc(PACKET_DATA_SIZE); + buffer.Buffer.from(instructionCount).copy(instructionBuffer); + let instructionBufferLength = instructionCount.length; + instructions.forEach((instruction) => { + const instructionLayout = struct([u8("programIdIndex"), blob(instruction.keyIndicesCount.length, "keyIndicesCount"), seq(u8("keyIndex"), instruction.keyIndices.length, "keyIndices"), blob(instruction.dataLength.length, "dataLength"), seq(u8("userdatum"), instruction.data.length, "data")]); + const length2 = instructionLayout.encode(instruction, instructionBuffer, instructionBufferLength); + instructionBufferLength += length2; + }); + instructionBuffer = instructionBuffer.slice(0, instructionBufferLength); + const signDataLayout = struct([blob(1, "numRequiredSignatures"), blob(1, "numReadonlySignedAccounts"), blob(1, "numReadonlyUnsignedAccounts"), blob(keyCount.length, "keyCount"), seq(publicKey("key"), numKeys, "keys"), publicKey("recentBlockhash")]); + const transaction2 = { + numRequiredSignatures: buffer.Buffer.from([this.header.numRequiredSignatures]), + numReadonlySignedAccounts: buffer.Buffer.from([this.header.numReadonlySignedAccounts]), + numReadonlyUnsignedAccounts: buffer.Buffer.from([this.header.numReadonlyUnsignedAccounts]), + keyCount: buffer.Buffer.from(keyCount), + keys: this.accountKeys.map((key2) => toBuffer(key2.toBytes())), + recentBlockhash: bs58$3.decode(this.recentBlockhash) + }; + let signData = buffer.Buffer.alloc(2048); + const length = signDataLayout.encode(transaction2, signData); + instructionBuffer.copy(signData, length); + return signData.slice(0, length + instructionBuffer.length); + } + /** + * Decode a compiled message into a Message object. + */ + static from(buffer$12) { + let byteArray = [...buffer$12]; + const numRequiredSignatures = guardedShift(byteArray); + if (numRequiredSignatures !== (numRequiredSignatures & VERSION_PREFIX_MASK)) { + throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()"); + } + const numReadonlySignedAccounts = guardedShift(byteArray); + const numReadonlyUnsignedAccounts = guardedShift(byteArray); + const accountCount = decodeLength(byteArray); + let accountKeys = []; + for (let i2 = 0; i2 < accountCount; i2++) { + const account = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH); + accountKeys.push(new PublicKey(buffer.Buffer.from(account))); + } + const recentBlockhash = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH); + const instructionCount = decodeLength(byteArray); + let instructions = []; + for (let i2 = 0; i2 < instructionCount; i2++) { + const programIdIndex = guardedShift(byteArray); + const accountCount2 = decodeLength(byteArray); + const accounts2 = guardedSplice(byteArray, 0, accountCount2); + const dataLength2 = decodeLength(byteArray); + const dataSlice2 = guardedSplice(byteArray, 0, dataLength2); + const data = bs58$3.encode(buffer.Buffer.from(dataSlice2)); + instructions.push({ + programIdIndex, + accounts: accounts2, + data + }); + } + const messageArgs = { + header: { + numRequiredSignatures, + numReadonlySignedAccounts, + numReadonlyUnsignedAccounts + }, + recentBlockhash: bs58$3.encode(buffer.Buffer.from(recentBlockhash)), + accountKeys, + instructions + }; + return new Message(messageArgs); + } +} +class MessageV0 { + constructor(args) { + this.header = void 0; + this.staticAccountKeys = void 0; + this.recentBlockhash = void 0; + this.compiledInstructions = void 0; + this.addressTableLookups = void 0; + this.header = args.header; + this.staticAccountKeys = args.staticAccountKeys; + this.recentBlockhash = args.recentBlockhash; + this.compiledInstructions = args.compiledInstructions; + this.addressTableLookups = args.addressTableLookups; + } + get version() { + return 0; + } + get numAccountKeysFromLookups() { + let count = 0; + for (const lookup2 of this.addressTableLookups) { + count += lookup2.readonlyIndexes.length + lookup2.writableIndexes.length; + } + return count; + } + getAccountKeys(args) { + let accountKeysFromLookups; + if (args && "accountKeysFromLookups" in args && args.accountKeysFromLookups) { + if (this.numAccountKeysFromLookups != args.accountKeysFromLookups.writable.length + args.accountKeysFromLookups.readonly.length) { + throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups"); + } + accountKeysFromLookups = args.accountKeysFromLookups; + } else if (args && "addressLookupTableAccounts" in args && args.addressLookupTableAccounts) { + accountKeysFromLookups = this.resolveAddressTableLookups(args.addressLookupTableAccounts); + } else if (this.addressTableLookups.length > 0) { + throw new Error("Failed to get account keys because address table lookups were not resolved"); + } + return new MessageAccountKeys(this.staticAccountKeys, accountKeysFromLookups); + } + isAccountSigner(index2) { + return index2 < this.header.numRequiredSignatures; + } + isAccountWritable(index2) { + const numSignedAccounts = this.header.numRequiredSignatures; + const numStaticAccountKeys = this.staticAccountKeys.length; + if (index2 >= numStaticAccountKeys) { + const lookupAccountKeysIndex = index2 - numStaticAccountKeys; + const numWritableLookupAccountKeys = this.addressTableLookups.reduce((count, lookup2) => count + lookup2.writableIndexes.length, 0); + return lookupAccountKeysIndex < numWritableLookupAccountKeys; + } else if (index2 >= this.header.numRequiredSignatures) { + const unsignedAccountIndex = index2 - numSignedAccounts; + const numUnsignedAccounts = numStaticAccountKeys - numSignedAccounts; + const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts; + return unsignedAccountIndex < numWritableUnsignedAccounts; + } else { + const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts; + return index2 < numWritableSignedAccounts; + } + } + resolveAddressTableLookups(addressLookupTableAccounts) { + const accountKeysFromLookups = { + writable: [], + readonly: [] + }; + for (const tableLookup of this.addressTableLookups) { + const tableAccount = addressLookupTableAccounts.find((account) => account.key.equals(tableLookup.accountKey)); + if (!tableAccount) { + throw new Error(`Failed to find address lookup table account for table key ${tableLookup.accountKey.toBase58()}`); + } + for (const index2 of tableLookup.writableIndexes) { + if (index2 < tableAccount.state.addresses.length) { + accountKeysFromLookups.writable.push(tableAccount.state.addresses[index2]); + } else { + throw new Error(`Failed to find address for index ${index2} in address lookup table ${tableLookup.accountKey.toBase58()}`); + } + } + for (const index2 of tableLookup.readonlyIndexes) { + if (index2 < tableAccount.state.addresses.length) { + accountKeysFromLookups.readonly.push(tableAccount.state.addresses[index2]); + } else { + throw new Error(`Failed to find address for index ${index2} in address lookup table ${tableLookup.accountKey.toBase58()}`); + } + } + } + return accountKeysFromLookups; + } + static compile(args) { + const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey); + const addressTableLookups = new Array(); + const accountKeysFromLookups = { + writable: new Array(), + readonly: new Array() + }; + const lookupTableAccounts = args.addressLookupTableAccounts || []; + for (const lookupTable of lookupTableAccounts) { + const extractResult = compiledKeys.extractTableLookup(lookupTable); + if (extractResult !== void 0) { + const [addressTableLookup, { + writable, + readonly + }] = extractResult; + addressTableLookups.push(addressTableLookup); + accountKeysFromLookups.writable.push(...writable); + accountKeysFromLookups.readonly.push(...readonly); + } + } + const [header, staticAccountKeys] = compiledKeys.getMessageComponents(); + const accountKeys = new MessageAccountKeys(staticAccountKeys, accountKeysFromLookups); + const compiledInstructions = accountKeys.compileInstructions(args.instructions); + return new MessageV0({ + header, + staticAccountKeys, + recentBlockhash: args.recentBlockhash, + compiledInstructions, + addressTableLookups + }); + } + serialize() { + const encodedStaticAccountKeysLength = Array(); + encodeLength(encodedStaticAccountKeysLength, this.staticAccountKeys.length); + const serializedInstructions = this.serializeInstructions(); + const encodedInstructionsLength = Array(); + encodeLength(encodedInstructionsLength, this.compiledInstructions.length); + const serializedAddressTableLookups = this.serializeAddressTableLookups(); + const encodedAddressTableLookupsLength = Array(); + encodeLength(encodedAddressTableLookupsLength, this.addressTableLookups.length); + const messageLayout = struct([u8("prefix"), struct([u8("numRequiredSignatures"), u8("numReadonlySignedAccounts"), u8("numReadonlyUnsignedAccounts")], "header"), blob(encodedStaticAccountKeysLength.length, "staticAccountKeysLength"), seq(publicKey(), this.staticAccountKeys.length, "staticAccountKeys"), publicKey("recentBlockhash"), blob(encodedInstructionsLength.length, "instructionsLength"), blob(serializedInstructions.length, "serializedInstructions"), blob(encodedAddressTableLookupsLength.length, "addressTableLookupsLength"), blob(serializedAddressTableLookups.length, "serializedAddressTableLookups")]); + const serializedMessage = new Uint8Array(PACKET_DATA_SIZE); + const MESSAGE_VERSION_0_PREFIX = 1 << 7; + const serializedMessageLength = messageLayout.encode({ + prefix: MESSAGE_VERSION_0_PREFIX, + header: this.header, + staticAccountKeysLength: new Uint8Array(encodedStaticAccountKeysLength), + staticAccountKeys: this.staticAccountKeys.map((key2) => key2.toBytes()), + recentBlockhash: bs58$3.decode(this.recentBlockhash), + instructionsLength: new Uint8Array(encodedInstructionsLength), + serializedInstructions, + addressTableLookupsLength: new Uint8Array(encodedAddressTableLookupsLength), + serializedAddressTableLookups + }, serializedMessage); + return serializedMessage.slice(0, serializedMessageLength); + } + serializeInstructions() { + let serializedLength = 0; + const serializedInstructions = new Uint8Array(PACKET_DATA_SIZE); + for (const instruction of this.compiledInstructions) { + const encodedAccountKeyIndexesLength = Array(); + encodeLength(encodedAccountKeyIndexesLength, instruction.accountKeyIndexes.length); + const encodedDataLength = Array(); + encodeLength(encodedDataLength, instruction.data.length); + const instructionLayout = struct([u8("programIdIndex"), blob(encodedAccountKeyIndexesLength.length, "encodedAccountKeyIndexesLength"), seq(u8(), instruction.accountKeyIndexes.length, "accountKeyIndexes"), blob(encodedDataLength.length, "encodedDataLength"), blob(instruction.data.length, "data")]); + serializedLength += instructionLayout.encode({ + programIdIndex: instruction.programIdIndex, + encodedAccountKeyIndexesLength: new Uint8Array(encodedAccountKeyIndexesLength), + accountKeyIndexes: instruction.accountKeyIndexes, + encodedDataLength: new Uint8Array(encodedDataLength), + data: instruction.data + }, serializedInstructions, serializedLength); + } + return serializedInstructions.slice(0, serializedLength); + } + serializeAddressTableLookups() { + let serializedLength = 0; + const serializedAddressTableLookups = new Uint8Array(PACKET_DATA_SIZE); + for (const lookup2 of this.addressTableLookups) { + const encodedWritableIndexesLength = Array(); + encodeLength(encodedWritableIndexesLength, lookup2.writableIndexes.length); + const encodedReadonlyIndexesLength = Array(); + encodeLength(encodedReadonlyIndexesLength, lookup2.readonlyIndexes.length); + const addressTableLookupLayout = struct([publicKey("accountKey"), blob(encodedWritableIndexesLength.length, "encodedWritableIndexesLength"), seq(u8(), lookup2.writableIndexes.length, "writableIndexes"), blob(encodedReadonlyIndexesLength.length, "encodedReadonlyIndexesLength"), seq(u8(), lookup2.readonlyIndexes.length, "readonlyIndexes")]); + serializedLength += addressTableLookupLayout.encode({ + accountKey: lookup2.accountKey.toBytes(), + encodedWritableIndexesLength: new Uint8Array(encodedWritableIndexesLength), + writableIndexes: lookup2.writableIndexes, + encodedReadonlyIndexesLength: new Uint8Array(encodedReadonlyIndexesLength), + readonlyIndexes: lookup2.readonlyIndexes + }, serializedAddressTableLookups, serializedLength); + } + return serializedAddressTableLookups.slice(0, serializedLength); + } + static deserialize(serializedMessage) { + let byteArray = [...serializedMessage]; + const prefix = guardedShift(byteArray); + const maskedPrefix = prefix & VERSION_PREFIX_MASK; + assert$1(prefix !== maskedPrefix, `Expected versioned message but received legacy message`); + const version2 = maskedPrefix; + assert$1(version2 === 0, `Expected versioned message with version 0 but found version ${version2}`); + const header = { + numRequiredSignatures: guardedShift(byteArray), + numReadonlySignedAccounts: guardedShift(byteArray), + numReadonlyUnsignedAccounts: guardedShift(byteArray) + }; + const staticAccountKeys = []; + const staticAccountKeysLength = decodeLength(byteArray); + for (let i2 = 0; i2 < staticAccountKeysLength; i2++) { + staticAccountKeys.push(new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH))); + } + const recentBlockhash = bs58$3.encode(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH)); + const instructionCount = decodeLength(byteArray); + const compiledInstructions = []; + for (let i2 = 0; i2 < instructionCount; i2++) { + const programIdIndex = guardedShift(byteArray); + const accountKeyIndexesLength = decodeLength(byteArray); + const accountKeyIndexes = guardedSplice(byteArray, 0, accountKeyIndexesLength); + const dataLength2 = decodeLength(byteArray); + const data = new Uint8Array(guardedSplice(byteArray, 0, dataLength2)); + compiledInstructions.push({ + programIdIndex, + accountKeyIndexes, + data + }); + } + const addressTableLookupsCount = decodeLength(byteArray); + const addressTableLookups = []; + for (let i2 = 0; i2 < addressTableLookupsCount; i2++) { + const accountKey = new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH)); + const writableIndexesLength = decodeLength(byteArray); + const writableIndexes = guardedSplice(byteArray, 0, writableIndexesLength); + const readonlyIndexesLength = decodeLength(byteArray); + const readonlyIndexes = guardedSplice(byteArray, 0, readonlyIndexesLength); + addressTableLookups.push({ + accountKey, + writableIndexes, + readonlyIndexes + }); + } + return new MessageV0({ + header, + staticAccountKeys, + recentBlockhash, + compiledInstructions, + addressTableLookups + }); + } +} +const VersionedMessage = { + deserializeMessageVersion(serializedMessage) { + const prefix = serializedMessage[0]; + const maskedPrefix = prefix & VERSION_PREFIX_MASK; + if (maskedPrefix === prefix) { + return "legacy"; + } + return maskedPrefix; + }, + deserialize: (serializedMessage) => { + const version2 = VersionedMessage.deserializeMessageVersion(serializedMessage); + if (version2 === "legacy") { + return Message.from(serializedMessage); + } + if (version2 === 0) { + return MessageV0.deserialize(serializedMessage); + } else { + throw new Error(`Transaction message version ${version2} deserialization is not supported`); + } + } +}; +let TransactionStatus = /* @__PURE__ */ function(TransactionStatus2) { + TransactionStatus2[TransactionStatus2["BLOCKHEIGHT_EXCEEDED"] = 0] = "BLOCKHEIGHT_EXCEEDED"; + TransactionStatus2[TransactionStatus2["PROCESSED"] = 1] = "PROCESSED"; + TransactionStatus2[TransactionStatus2["TIMED_OUT"] = 2] = "TIMED_OUT"; + TransactionStatus2[TransactionStatus2["NONCE_INVALID"] = 3] = "NONCE_INVALID"; + return TransactionStatus2; +}({}); +const DEFAULT_SIGNATURE = buffer.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES$1).fill(0); +class TransactionInstruction { + constructor(opts) { + this.keys = void 0; + this.programId = void 0; + this.data = buffer.Buffer.alloc(0); + this.programId = opts.programId; + this.keys = opts.keys; + if (opts.data) { + this.data = opts.data; + } + } + /** + * @internal + */ + toJSON() { + return { + keys: this.keys.map(({ + pubkey, + isSigner, + isWritable + }) => ({ + pubkey: pubkey.toJSON(), + isSigner, + isWritable + })), + programId: this.programId.toJSON(), + data: [...this.data] + }; + } +} +let Transaction$2 = class Transaction { + /** + * The first (payer) Transaction signature + * + * @returns {Buffer | null} Buffer of payer's signature + */ + get signature() { + if (this.signatures.length > 0) { + return this.signatures[0].signature; + } + return null; + } + /** + * The transaction fee payer + */ + // Construct a transaction with a blockhash and lastValidBlockHeight + // Construct a transaction using a durable nonce + /** + * @deprecated `TransactionCtorFields` has been deprecated and will be removed in a future version. + * Please supply a `TransactionBlockhashCtor` instead. + */ + /** + * Construct an empty Transaction + */ + constructor(opts) { + this.signatures = []; + this.feePayer = void 0; + this.instructions = []; + this.recentBlockhash = void 0; + this.lastValidBlockHeight = void 0; + this.nonceInfo = void 0; + this.minNonceContextSlot = void 0; + this._message = void 0; + this._json = void 0; + if (!opts) { + return; + } + if (opts.feePayer) { + this.feePayer = opts.feePayer; + } + if (opts.signatures) { + this.signatures = opts.signatures; + } + if (Object.prototype.hasOwnProperty.call(opts, "nonceInfo")) { + const { + minContextSlot, + nonceInfo + } = opts; + this.minNonceContextSlot = minContextSlot; + this.nonceInfo = nonceInfo; + } else if (Object.prototype.hasOwnProperty.call(opts, "lastValidBlockHeight")) { + const { + blockhash, + lastValidBlockHeight + } = opts; + this.recentBlockhash = blockhash; + this.lastValidBlockHeight = lastValidBlockHeight; + } else { + const { + recentBlockhash, + nonceInfo + } = opts; + if (nonceInfo) { + this.nonceInfo = nonceInfo; + } + this.recentBlockhash = recentBlockhash; + } + } + /** + * @internal + */ + toJSON() { + return { + recentBlockhash: this.recentBlockhash || null, + feePayer: this.feePayer ? this.feePayer.toJSON() : null, + nonceInfo: this.nonceInfo ? { + nonce: this.nonceInfo.nonce, + nonceInstruction: this.nonceInfo.nonceInstruction.toJSON() + } : null, + instructions: this.instructions.map((instruction) => instruction.toJSON()), + signers: this.signatures.map(({ + publicKey: publicKey2 + }) => { + return publicKey2.toJSON(); + }) + }; + } + /** + * Add one or more instructions to this Transaction + * + * @param {Array< Transaction | TransactionInstruction | TransactionInstructionCtorFields >} items - Instructions to add to the Transaction + */ + add(...items) { + if (items.length === 0) { + throw new Error("No instructions"); + } + items.forEach((item) => { + if ("instructions" in item) { + this.instructions = this.instructions.concat(item.instructions); + } else if ("data" in item && "programId" in item && "keys" in item) { + this.instructions.push(item); + } else { + this.instructions.push(new TransactionInstruction(item)); + } + }); + return this; + } + /** + * Compile transaction data + */ + compileMessage() { + if (this._message && JSON.stringify(this.toJSON()) === JSON.stringify(this._json)) { + return this._message; + } + let recentBlockhash; + let instructions; + if (this.nonceInfo) { + recentBlockhash = this.nonceInfo.nonce; + if (this.instructions[0] != this.nonceInfo.nonceInstruction) { + instructions = [this.nonceInfo.nonceInstruction, ...this.instructions]; + } else { + instructions = this.instructions; + } + } else { + recentBlockhash = this.recentBlockhash; + instructions = this.instructions; + } + if (!recentBlockhash) { + throw new Error("Transaction recentBlockhash required"); + } + if (instructions.length < 1) { + console.warn("No instructions provided"); + } + let feePayer; + if (this.feePayer) { + feePayer = this.feePayer; + } else if (this.signatures.length > 0 && this.signatures[0].publicKey) { + feePayer = this.signatures[0].publicKey; + } else { + throw new Error("Transaction fee payer required"); + } + for (let i2 = 0; i2 < instructions.length; i2++) { + if (instructions[i2].programId === void 0) { + throw new Error(`Transaction instruction index ${i2} has undefined program id`); + } + } + const programIds = []; + const accountMetas = []; + instructions.forEach((instruction) => { + instruction.keys.forEach((accountMeta) => { + accountMetas.push({ + ...accountMeta + }); + }); + const programId = instruction.programId.toString(); + if (!programIds.includes(programId)) { + programIds.push(programId); + } + }); + programIds.forEach((programId) => { + accountMetas.push({ + pubkey: new PublicKey(programId), + isSigner: false, + isWritable: false + }); + }); + const uniqueMetas = []; + accountMetas.forEach((accountMeta) => { + const pubkeyString = accountMeta.pubkey.toString(); + const uniqueIndex = uniqueMetas.findIndex((x3) => { + return x3.pubkey.toString() === pubkeyString; + }); + if (uniqueIndex > -1) { + uniqueMetas[uniqueIndex].isWritable = uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable; + uniqueMetas[uniqueIndex].isSigner = uniqueMetas[uniqueIndex].isSigner || accountMeta.isSigner; + } else { + uniqueMetas.push(accountMeta); + } + }); + uniqueMetas.sort(function(x3, y3) { + if (x3.isSigner !== y3.isSigner) { + return x3.isSigner ? -1 : 1; + } + if (x3.isWritable !== y3.isWritable) { + return x3.isWritable ? -1 : 1; + } + const options = { + localeMatcher: "best fit", + usage: "sort", + sensitivity: "variant", + ignorePunctuation: false, + numeric: false, + caseFirst: "lower" + }; + return x3.pubkey.toBase58().localeCompare(y3.pubkey.toBase58(), "en", options); + }); + const feePayerIndex = uniqueMetas.findIndex((x3) => { + return x3.pubkey.equals(feePayer); + }); + if (feePayerIndex > -1) { + const [payerMeta] = uniqueMetas.splice(feePayerIndex, 1); + payerMeta.isSigner = true; + payerMeta.isWritable = true; + uniqueMetas.unshift(payerMeta); + } else { + uniqueMetas.unshift({ + pubkey: feePayer, + isSigner: true, + isWritable: true + }); + } + for (const signature2 of this.signatures) { + const uniqueIndex = uniqueMetas.findIndex((x3) => { + return x3.pubkey.equals(signature2.publicKey); + }); + if (uniqueIndex > -1) { + if (!uniqueMetas[uniqueIndex].isSigner) { + uniqueMetas[uniqueIndex].isSigner = true; + console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."); + } + } else { + throw new Error(`unknown signer: ${signature2.publicKey.toString()}`); + } + } + let numRequiredSignatures = 0; + let numReadonlySignedAccounts = 0; + let numReadonlyUnsignedAccounts = 0; + const signedKeys = []; + const unsignedKeys = []; + uniqueMetas.forEach(({ + pubkey, + isSigner, + isWritable + }) => { + if (isSigner) { + signedKeys.push(pubkey.toString()); + numRequiredSignatures += 1; + if (!isWritable) { + numReadonlySignedAccounts += 1; + } + } else { + unsignedKeys.push(pubkey.toString()); + if (!isWritable) { + numReadonlyUnsignedAccounts += 1; + } + } + }); + const accountKeys = signedKeys.concat(unsignedKeys); + const compiledInstructions = instructions.map((instruction) => { + const { + data, + programId + } = instruction; + return { + programIdIndex: accountKeys.indexOf(programId.toString()), + accounts: instruction.keys.map((meta) => accountKeys.indexOf(meta.pubkey.toString())), + data: bs58$3.encode(data) + }; + }); + compiledInstructions.forEach((instruction) => { + assert$1(instruction.programIdIndex >= 0); + instruction.accounts.forEach((keyIndex) => assert$1(keyIndex >= 0)); + }); + return new Message({ + header: { + numRequiredSignatures, + numReadonlySignedAccounts, + numReadonlyUnsignedAccounts + }, + accountKeys, + recentBlockhash, + instructions: compiledInstructions + }); + } + /** + * @internal + */ + _compile() { + const message2 = this.compileMessage(); + const signedKeys = message2.accountKeys.slice(0, message2.header.numRequiredSignatures); + if (this.signatures.length === signedKeys.length) { + const valid = this.signatures.every((pair, index2) => { + return signedKeys[index2].equals(pair.publicKey); + }); + if (valid) + return message2; + } + this.signatures = signedKeys.map((publicKey2) => ({ + signature: null, + publicKey: publicKey2 + })); + return message2; + } + /** + * Get a buffer of the Transaction data that need to be covered by signatures + */ + serializeMessage() { + return this._compile().serialize(); + } + /** + * Get the estimated fee associated with a transaction + * + * @param {Connection} connection Connection to RPC Endpoint. + * + * @returns {Promise} The estimated fee for the transaction + */ + async getEstimatedFee(connection) { + return (await connection.getFeeForMessage(this.compileMessage())).value; + } + /** + * Specify the public keys which will be used to sign the Transaction. + * The first signer will be used as the transaction fee payer account. + * + * Signatures can be added with either `partialSign` or `addSignature` + * + * @deprecated Deprecated since v0.84.0. Only the fee payer needs to be + * specified and it can be set in the Transaction constructor or with the + * `feePayer` property. + */ + setSigners(...signers) { + if (signers.length === 0) { + throw new Error("No signers"); + } + const seen2 = /* @__PURE__ */ new Set(); + this.signatures = signers.filter((publicKey2) => { + const key2 = publicKey2.toString(); + if (seen2.has(key2)) { + return false; + } else { + seen2.add(key2); + return true; + } + }).map((publicKey2) => ({ + signature: null, + publicKey: publicKey2 + })); + } + /** + * Sign the Transaction with the specified signers. Multiple signatures may + * be applied to a Transaction. The first signature is considered "primary" + * and is used identify and confirm transactions. + * + * If the Transaction `feePayer` is not set, the first signer will be used + * as the transaction fee payer account. + * + * Transaction fields should not be modified after the first call to `sign`, + * as doing so may invalidate the signature and cause the Transaction to be + * rejected. + * + * The Transaction must be assigned a valid `recentBlockhash` before invoking this method + * + * @param {Array} signers Array of signers that will sign the transaction + */ + sign(...signers) { + if (signers.length === 0) { + throw new Error("No signers"); + } + const seen2 = /* @__PURE__ */ new Set(); + const uniqueSigners = []; + for (const signer of signers) { + const key2 = signer.publicKey.toString(); + if (seen2.has(key2)) { + continue; + } else { + seen2.add(key2); + uniqueSigners.push(signer); + } + } + this.signatures = uniqueSigners.map((signer) => ({ + signature: null, + publicKey: signer.publicKey + })); + const message2 = this._compile(); + this._partialSign(message2, ...uniqueSigners); + } + /** + * Partially sign a transaction with the specified accounts. All accounts must + * correspond to either the fee payer or a signer account in the transaction + * instructions. + * + * All the caveats from the `sign` method apply to `partialSign` + * + * @param {Array} signers Array of signers that will sign the transaction + */ + partialSign(...signers) { + if (signers.length === 0) { + throw new Error("No signers"); + } + const seen2 = /* @__PURE__ */ new Set(); + const uniqueSigners = []; + for (const signer of signers) { + const key2 = signer.publicKey.toString(); + if (seen2.has(key2)) { + continue; + } else { + seen2.add(key2); + uniqueSigners.push(signer); + } + } + const message2 = this._compile(); + this._partialSign(message2, ...uniqueSigners); + } + /** + * @internal + */ + _partialSign(message2, ...signers) { + const signData = message2.serialize(); + signers.forEach((signer) => { + const signature2 = sign5(signData, signer.secretKey); + this._addSignature(signer.publicKey, toBuffer(signature2)); + }); + } + /** + * Add an externally created signature to a transaction. The public key + * must correspond to either the fee payer or a signer account in the transaction + * instructions. + * + * @param {PublicKey} pubkey Public key that will be added to the transaction. + * @param {Buffer} signature An externally created signature to add to the transaction. + */ + addSignature(pubkey, signature2) { + this._compile(); + this._addSignature(pubkey, signature2); + } + /** + * @internal + */ + _addSignature(pubkey, signature2) { + assert$1(signature2.length === 64); + const index2 = this.signatures.findIndex((sigpair) => pubkey.equals(sigpair.publicKey)); + if (index2 < 0) { + throw new Error(`unknown signer: ${pubkey.toString()}`); + } + this.signatures[index2].signature = buffer.Buffer.from(signature2); + } + /** + * Verify signatures of a Transaction + * Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one. + * If no boolean is provided, we expect a fully signed Transaction by default. + * + * @param {boolean} [requireAllSignatures=true] Require a fully signed Transaction + */ + verifySignatures(requireAllSignatures = true) { + const signatureErrors = this._getMessageSignednessErrors(this.serializeMessage(), requireAllSignatures); + return !signatureErrors; + } + /** + * @internal + */ + _getMessageSignednessErrors(message2, requireAllSignatures) { + const errors = {}; + for (const { + signature: signature2, + publicKey: publicKey2 + } of this.signatures) { + if (signature2 === null) { + if (requireAllSignatures) { + (errors.missing || (errors.missing = [])).push(publicKey2); + } + } else { + if (!verify5(signature2, message2, publicKey2.toBytes())) { + (errors.invalid || (errors.invalid = [])).push(publicKey2); + } + } + } + return errors.invalid || errors.missing ? errors : void 0; + } + /** + * Serialize the Transaction in the wire format. + * + * @param {Buffer} [config] Config of transaction. + * + * @returns {Buffer} Signature of transaction in wire format. + */ + serialize(config2) { + const { + requireAllSignatures, + verifySignatures + } = Object.assign({ + requireAllSignatures: true, + verifySignatures: true + }, config2); + const signData = this.serializeMessage(); + if (verifySignatures) { + const sigErrors = this._getMessageSignednessErrors(signData, requireAllSignatures); + if (sigErrors) { + let errorMessage = "Signature verification failed."; + if (sigErrors.invalid) { + errorMessage += ` +Invalid signature for public key${sigErrors.invalid.length === 1 ? "" : "(s)"} [\`${sigErrors.invalid.map((p3) => p3.toBase58()).join("`, `")}\`].`; + } + if (sigErrors.missing) { + errorMessage += ` +Missing signature for public key${sigErrors.missing.length === 1 ? "" : "(s)"} [\`${sigErrors.missing.map((p3) => p3.toBase58()).join("`, `")}\`].`; + } + throw new Error(errorMessage); + } + } + return this._serialize(signData); + } + /** + * @internal + */ + _serialize(signData) { + const { + signatures + } = this; + const signatureCount = []; + encodeLength(signatureCount, signatures.length); + const transactionLength = signatureCount.length + signatures.length * 64 + signData.length; + const wireTransaction = buffer.Buffer.alloc(transactionLength); + assert$1(signatures.length < 256); + buffer.Buffer.from(signatureCount).copy(wireTransaction, 0); + signatures.forEach(({ + signature: signature2 + }, index2) => { + if (signature2 !== null) { + assert$1(signature2.length === 64, `signature has invalid length`); + buffer.Buffer.from(signature2).copy(wireTransaction, signatureCount.length + index2 * 64); + } + }); + signData.copy(wireTransaction, signatureCount.length + signatures.length * 64); + assert$1(wireTransaction.length <= PACKET_DATA_SIZE, `Transaction too large: ${wireTransaction.length} > ${PACKET_DATA_SIZE}`); + return wireTransaction; + } + /** + * Deprecated method + * @internal + */ + get keys() { + assert$1(this.instructions.length === 1); + return this.instructions[0].keys.map((keyObj) => keyObj.pubkey); + } + /** + * Deprecated method + * @internal + */ + get programId() { + assert$1(this.instructions.length === 1); + return this.instructions[0].programId; + } + /** + * Deprecated method + * @internal + */ + get data() { + assert$1(this.instructions.length === 1); + return this.instructions[0].data; + } + /** + * Parse a wire transaction into a Transaction object. + * + * @param {Buffer | Uint8Array | Array} buffer Signature of wire Transaction + * + * @returns {Transaction} Transaction associated with the signature + */ + static from(buffer$12) { + let byteArray = [...buffer$12]; + const signatureCount = decodeLength(byteArray); + let signatures = []; + for (let i2 = 0; i2 < signatureCount; i2++) { + const signature2 = guardedSplice(byteArray, 0, SIGNATURE_LENGTH_IN_BYTES$1); + signatures.push(bs58$3.encode(buffer.Buffer.from(signature2))); + } + return Transaction.populate(Message.from(byteArray), signatures); + } + /** + * Populate Transaction object from message and signatures + * + * @param {Message} message Message of transaction + * @param {Array} signatures List of signatures to assign to the transaction + * + * @returns {Transaction} The populated Transaction + */ + static populate(message2, signatures = []) { + const transaction2 = new Transaction(); + transaction2.recentBlockhash = message2.recentBlockhash; + if (message2.header.numRequiredSignatures > 0) { + transaction2.feePayer = message2.accountKeys[0]; + } + signatures.forEach((signature2, index2) => { + const sigPubkeyPair = { + signature: signature2 == bs58$3.encode(DEFAULT_SIGNATURE) ? null : bs58$3.decode(signature2), + publicKey: message2.accountKeys[index2] + }; + transaction2.signatures.push(sigPubkeyPair); + }); + message2.instructions.forEach((instruction) => { + const keys2 = instruction.accounts.map((account) => { + const pubkey = message2.accountKeys[account]; + return { + pubkey, + isSigner: transaction2.signatures.some((keyObj) => keyObj.publicKey.toString() === pubkey.toString()) || message2.isAccountSigner(account), + isWritable: message2.isAccountWritable(account) + }; + }); + transaction2.instructions.push(new TransactionInstruction({ + keys: keys2, + programId: message2.accountKeys[instruction.programIdIndex], + data: bs58$3.decode(instruction.data) + })); + }); + transaction2._message = message2; + transaction2._json = transaction2.toJSON(); + return transaction2; + } +}; +class VersionedTransaction { + get version() { + return this.message.version; + } + constructor(message2, signatures) { + this.signatures = void 0; + this.message = void 0; + if (signatures !== void 0) { + assert$1(signatures.length === message2.header.numRequiredSignatures, "Expected signatures length to be equal to the number of required signatures"); + this.signatures = signatures; + } else { + const defaultSignatures = []; + for (let i2 = 0; i2 < message2.header.numRequiredSignatures; i2++) { + defaultSignatures.push(new Uint8Array(SIGNATURE_LENGTH_IN_BYTES$1)); + } + this.signatures = defaultSignatures; + } + this.message = message2; + } + serialize() { + const serializedMessage = this.message.serialize(); + const encodedSignaturesLength = Array(); + encodeLength(encodedSignaturesLength, this.signatures.length); + const transactionLayout = struct([blob(encodedSignaturesLength.length, "encodedSignaturesLength"), seq(signature(), this.signatures.length, "signatures"), blob(serializedMessage.length, "serializedMessage")]); + const serializedTransaction = new Uint8Array(2048); + const serializedTransactionLength = transactionLayout.encode({ + encodedSignaturesLength: new Uint8Array(encodedSignaturesLength), + signatures: this.signatures, + serializedMessage + }, serializedTransaction); + return serializedTransaction.slice(0, serializedTransactionLength); + } + static deserialize(serializedTransaction) { + let byteArray = [...serializedTransaction]; + const signatures = []; + const signaturesLength = decodeLength(byteArray); + for (let i2 = 0; i2 < signaturesLength; i2++) { + signatures.push(new Uint8Array(guardedSplice(byteArray, 0, SIGNATURE_LENGTH_IN_BYTES$1))); + } + const message2 = VersionedMessage.deserialize(new Uint8Array(byteArray)); + return new VersionedTransaction(message2, signatures); + } + sign(signers) { + const messageData = this.message.serialize(); + const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures); + for (const signer of signers) { + const signerIndex = signerPubkeys.findIndex((pubkey) => pubkey.equals(signer.publicKey)); + assert$1(signerIndex >= 0, `Cannot sign with non signer key ${signer.publicKey.toBase58()}`); + this.signatures[signerIndex] = sign5(messageData, signer.secretKey); + } + } + addSignature(publicKey2, signature2) { + assert$1(signature2.byteLength === 64, "Signature must be 64 bytes long"); + const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures); + const signerIndex = signerPubkeys.findIndex((pubkey) => pubkey.equals(publicKey2)); + assert$1(signerIndex >= 0, `Can not add signature; \`${publicKey2.toBase58()}\` is not required to sign this transaction`); + this.signatures[signerIndex] = signature2; + } +} +const NUM_TICKS_PER_SECOND = 160; +const DEFAULT_TICKS_PER_SLOT = 64; +const NUM_SLOTS_PER_SECOND = NUM_TICKS_PER_SECOND / DEFAULT_TICKS_PER_SLOT; +const MS_PER_SLOT = 1e3 / NUM_SLOTS_PER_SECOND; +new PublicKey("SysvarC1ock11111111111111111111111111111111"); +new PublicKey("SysvarEpochSchedu1e111111111111111111111111"); +new PublicKey("Sysvar1nstructions1111111111111111111111111"); +new PublicKey("SysvarRecentB1ockHashes11111111111111111111"); +new PublicKey("SysvarRent111111111111111111111111111111111"); +new PublicKey("SysvarRewards111111111111111111111111111111"); +new PublicKey("SysvarS1otHashes111111111111111111111111111"); +new PublicKey("SysvarS1otHistory11111111111111111111111111"); +new PublicKey("SysvarStakeHistory1111111111111111111111111"); +class SendTransactionError extends Error { + constructor({ + action, + signature: signature2, + transactionMessage, + logs + }) { + const maybeLogsOutput = logs ? `Logs: +${JSON.stringify(logs.slice(-10), null, 2)}. ` : ""; + const guideText = "\nCatch the `SendTransactionError` and call `getLogs()` on it for full details."; + let message2; + switch (action) { + case "send": + message2 = `Transaction ${signature2} resulted in an error. +${transactionMessage}. ` + maybeLogsOutput + guideText; + break; + case "simulate": + message2 = `Simulation failed. +Message: ${transactionMessage}. +` + maybeLogsOutput + guideText; + break; + default: { + message2 = `Unknown action '${((a3) => a3)(action)}'`; + } + } + super(message2); + this.signature = void 0; + this.transactionMessage = void 0; + this.transactionLogs = void 0; + this.signature = signature2; + this.transactionMessage = transactionMessage; + this.transactionLogs = logs ? logs : void 0; + } + get transactionError() { + return { + message: this.transactionMessage, + logs: Array.isArray(this.transactionLogs) ? this.transactionLogs : void 0 + }; + } + /* @deprecated Use `await getLogs()` instead */ + get logs() { + const cachedLogs = this.transactionLogs; + if (cachedLogs != null && typeof cachedLogs === "object" && "then" in cachedLogs) { + return void 0; + } + return cachedLogs; + } + async getLogs(connection) { + if (!Array.isArray(this.transactionLogs)) { + this.transactionLogs = new Promise((resolve, reject) => { + connection.getTransaction(this.signature).then((tx) => { + if (tx && tx.meta && tx.meta.logMessages) { + const logs = tx.meta.logMessages; + this.transactionLogs = logs; + resolve(logs); + } else { + reject(new Error("Log messages not found")); + } + }).catch(reject); + }); + } + return await this.transactionLogs; + } +} +class SolanaJSONRPCError extends Error { + constructor({ + code: code2, + message: message2, + data + }, customMessage) { + super(customMessage != null ? `${customMessage}: ${message2}` : message2); + this.code = void 0; + this.data = void 0; + this.code = code2; + this.data = data; + this.name = "SolanaJSONRPCError"; + } +} +function sleep$1(ms2) { + return new Promise((resolve) => setTimeout(resolve, ms2)); +} +const FeeCalculatorLayout = nu64("lamportsPerSignature"); +const NonceAccountLayout = struct([u32$1("version"), u32$1("state"), publicKey("authorizedPubkey"), publicKey("nonce"), struct([FeeCalculatorLayout], "feeCalculator")]); +NonceAccountLayout.span; +class NonceAccount { + /** + * @internal + */ + constructor(args) { + this.authorizedPubkey = void 0; + this.nonce = void 0; + this.feeCalculator = void 0; + this.authorizedPubkey = args.authorizedPubkey; + this.nonce = args.nonce; + this.feeCalculator = args.feeCalculator; + } + /** + * Deserialize NonceAccount from the account data. + * + * @param buffer account data + * @return NonceAccount + */ + static fromAccountData(buffer2) { + const nonceAccount = NonceAccountLayout.decode(toBuffer(buffer2), 0); + return new NonceAccount({ + authorizedPubkey: new PublicKey(nonceAccount.authorizedPubkey), + nonce: new PublicKey(nonceAccount.nonce).toString(), + feeCalculator: nonceAccount.feeCalculator + }); + } +} +const encodeDecode = (layout) => { + const decode3 = layout.decode.bind(layout); + const encode5 = layout.encode.bind(layout); + return { + decode: decode3, + encode: encode5 + }; +}; +const bigInt = (length) => (property) => { + const layout = blob(length, property); + const { + encode: encode5, + decode: decode3 + } = encodeDecode(layout); + const bigIntLayout = layout; + bigIntLayout.decode = (buffer$12, offset2) => { + const src2 = decode3(buffer$12, offset2); + return toBigIntLE_1(buffer.Buffer.from(src2)); + }; + bigIntLayout.encode = (bigInt2, buffer2, offset2) => { + const src2 = toBufferLE_1(bigInt2, length); + return encode5(src2, buffer2, offset2); + }; + return bigIntLayout; +}; +const u64$2 = bigInt(8); +Object.freeze({ + Create: { + index: 0, + layout: struct([u32$1("instruction"), ns64("lamports"), ns64("space"), publicKey("programId")]) + }, + Assign: { + index: 1, + layout: struct([u32$1("instruction"), publicKey("programId")]) + }, + Transfer: { + index: 2, + layout: struct([u32$1("instruction"), u64$2("lamports")]) + }, + CreateWithSeed: { + index: 3, + layout: struct([u32$1("instruction"), publicKey("base"), rustString("seed"), ns64("lamports"), ns64("space"), publicKey("programId")]) + }, + AdvanceNonceAccount: { + index: 4, + layout: struct([u32$1("instruction")]) + }, + WithdrawNonceAccount: { + index: 5, + layout: struct([u32$1("instruction"), ns64("lamports")]) + }, + InitializeNonceAccount: { + index: 6, + layout: struct([u32$1("instruction"), publicKey("authorized")]) + }, + AuthorizeNonceAccount: { + index: 7, + layout: struct([u32$1("instruction"), publicKey("authorized")]) + }, + Allocate: { + index: 8, + layout: struct([u32$1("instruction"), ns64("space")]) + }, + AllocateWithSeed: { + index: 9, + layout: struct([u32$1("instruction"), publicKey("base"), rustString("seed"), ns64("space"), publicKey("programId")]) + }, + AssignWithSeed: { + index: 10, + layout: struct([u32$1("instruction"), publicKey("base"), rustString("seed"), publicKey("programId")]) + }, + TransferWithSeed: { + index: 11, + layout: struct([u32$1("instruction"), u64$2("lamports"), rustString("seed"), publicKey("programId")]) + }, + UpgradeNonceAccount: { + index: 12, + layout: struct([u32$1("instruction")]) + } +}); +new PublicKey("11111111111111111111111111111111"); +new PublicKey("BPFLoader2111111111111111111111111111111111"); +function getDefaultExportFromCjs(x3) { + return x3 && x3.__esModule && Object.prototype.hasOwnProperty.call(x3, "default") ? x3["default"] : x3; +} +var fastStableStringify$1; +var hasRequiredFastStableStringify; +function requireFastStableStringify() { + if (hasRequiredFastStableStringify) + return fastStableStringify$1; + hasRequiredFastStableStringify = 1; + var objToString = Object.prototype.toString; + var objKeys = Object.keys || function(obj) { + var keys2 = []; + for (var name2 in obj) { + keys2.push(name2); + } + return keys2; + }; + function stringify2(val, isArrayProp) { + var i2, max, str, keys2, key2, propVal, toStr2; + if (val === true) { + return "true"; + } + if (val === false) { + return "false"; + } + switch (typeof val) { + case "object": + if (val === null) { + return null; + } else if (val.toJSON && typeof val.toJSON === "function") { + return stringify2(val.toJSON(), isArrayProp); + } else { + toStr2 = objToString.call(val); + if (toStr2 === "[object Array]") { + str = "["; + max = val.length - 1; + for (i2 = 0; i2 < max; i2++) { + str += stringify2(val[i2], true) + ","; + } + if (max > -1) { + str += stringify2(val[i2], true); + } + return str + "]"; + } else if (toStr2 === "[object Object]") { + keys2 = objKeys(val).sort(); + max = keys2.length; + str = ""; + i2 = 0; + while (i2 < max) { + key2 = keys2[i2]; + propVal = stringify2(val[key2], false); + if (propVal !== void 0) { + if (str) { + str += ","; + } + str += JSON.stringify(key2) + ":" + propVal; + } + i2++; + } + return "{" + str + "}"; + } else { + return JSON.stringify(val); + } + } + case "function": + case "undefined": + return isArrayProp ? null : void 0; + case "string": + return JSON.stringify(val); + default: + return isFinite(val) ? val : null; + } + } + fastStableStringify$1 = function(val) { + var returnVal = stringify2(val, false); + if (returnVal !== void 0) { + return "" + returnVal; + } + }; + return fastStableStringify$1; +} +var fastStableStringifyExports = /* @__PURE__ */ requireFastStableStringify(); +var fastStableStringify = /* @__PURE__ */ getDefaultExportFromCjs(fastStableStringifyExports); +const MINIMUM_SLOT_PER_EPOCH = 32; +function trailingZeros(n5) { + let trailingZeros2 = 0; + while (n5 > 1) { + n5 /= 2; + trailingZeros2++; + } + return trailingZeros2; +} +function nextPowerOfTwo(n5) { + if (n5 === 0) + return 1; + n5--; + n5 |= n5 >> 1; + n5 |= n5 >> 2; + n5 |= n5 >> 4; + n5 |= n5 >> 8; + n5 |= n5 >> 16; + n5 |= n5 >> 32; + return n5 + 1; +} +class EpochSchedule { + constructor(slotsPerEpoch, leaderScheduleSlotOffset, warmup, firstNormalEpoch, firstNormalSlot) { + this.slotsPerEpoch = void 0; + this.leaderScheduleSlotOffset = void 0; + this.warmup = void 0; + this.firstNormalEpoch = void 0; + this.firstNormalSlot = void 0; + this.slotsPerEpoch = slotsPerEpoch; + this.leaderScheduleSlotOffset = leaderScheduleSlotOffset; + this.warmup = warmup; + this.firstNormalEpoch = firstNormalEpoch; + this.firstNormalSlot = firstNormalSlot; + } + getEpoch(slot) { + return this.getEpochAndSlotIndex(slot)[0]; + } + getEpochAndSlotIndex(slot) { + if (slot < this.firstNormalSlot) { + const epoch = trailingZeros(nextPowerOfTwo(slot + MINIMUM_SLOT_PER_EPOCH + 1)) - trailingZeros(MINIMUM_SLOT_PER_EPOCH) - 1; + const epochLen = this.getSlotsInEpoch(epoch); + const slotIndex = slot - (epochLen - MINIMUM_SLOT_PER_EPOCH); + return [epoch, slotIndex]; + } else { + const normalSlotIndex = slot - this.firstNormalSlot; + const normalEpochIndex = Math.floor(normalSlotIndex / this.slotsPerEpoch); + const epoch = this.firstNormalEpoch + normalEpochIndex; + const slotIndex = normalSlotIndex % this.slotsPerEpoch; + return [epoch, slotIndex]; + } + } + getFirstSlotInEpoch(epoch) { + if (epoch <= this.firstNormalEpoch) { + return (Math.pow(2, epoch) - 1) * MINIMUM_SLOT_PER_EPOCH; + } else { + return (epoch - this.firstNormalEpoch) * this.slotsPerEpoch + this.firstNormalSlot; + } + } + getLastSlotInEpoch(epoch) { + return this.getFirstSlotInEpoch(epoch) + this.getSlotsInEpoch(epoch) - 1; + } + getSlotsInEpoch(epoch) { + if (epoch < this.firstNormalEpoch) { + return Math.pow(2, epoch + trailingZeros(MINIMUM_SLOT_PER_EPOCH)); + } else { + return this.slotsPerEpoch; + } + } +} +var fetchImpl = globalThis.fetch; +class RpcWebSocketClient extends CommonClient { + constructor(address2, options, generate_request_id) { + const webSocketFactory = (url) => { + const rpc = WebSocket$1(url, { + autoconnect: true, + max_reconnects: 5, + reconnect: true, + reconnect_interval: 1e3, + ...options + }); + if ("socket" in rpc) { + this.underlyingSocket = rpc.socket; + } else { + this.underlyingSocket = rpc; + } + return rpc; + }; + super(webSocketFactory, address2, options, generate_request_id); + this.underlyingSocket = void 0; + } + call(...args) { + var _a3; + const readyState = (_a3 = this.underlyingSocket) == null ? void 0 : _a3.readyState; + if (readyState === 1) { + return super.call(...args); + } + return Promise.reject(new Error("Tried to call a JSON-RPC method `" + args[0] + "` but the socket was not `CONNECTING` or `OPEN` (`readyState` was " + readyState + ")")); + } + notify(...args) { + var _a3; + const readyState = (_a3 = this.underlyingSocket) == null ? void 0 : _a3.readyState; + if (readyState === 1) { + return super.notify(...args); + } + return Promise.reject(new Error("Tried to send a JSON-RPC notification `" + args[0] + "` but the socket was not `CONNECTING` or `OPEN` (`readyState` was " + readyState + ")")); + } +} +function decodeData(type2, data) { + let decoded; + try { + decoded = type2.layout.decode(data); + } catch (err) { + throw new Error("invalid instruction; " + err); + } + if (decoded.typeIndex !== type2.index) { + throw new Error(`invalid account data; account type mismatch ${decoded.typeIndex} != ${type2.index}`); + } + return decoded; +} +const LOOKUP_TABLE_META_SIZE = 56; +class AddressLookupTableAccount { + constructor(args) { + this.key = void 0; + this.state = void 0; + this.key = args.key; + this.state = args.state; + } + isActive() { + const U64_MAX = BigInt("0xffffffffffffffff"); + return this.state.deactivationSlot === U64_MAX; + } + static deserialize(accountData) { + const meta = decodeData(LookupTableMetaLayout, accountData); + const serializedAddressesLen = accountData.length - LOOKUP_TABLE_META_SIZE; + assert$1(serializedAddressesLen >= 0, "lookup table is invalid"); + assert$1(serializedAddressesLen % 32 === 0, "lookup table is invalid"); + const numSerializedAddresses = serializedAddressesLen / 32; + const { + addresses + } = struct([seq(publicKey(), numSerializedAddresses, "addresses")]).decode(accountData.slice(LOOKUP_TABLE_META_SIZE)); + return { + deactivationSlot: meta.deactivationSlot, + lastExtendedSlot: meta.lastExtendedSlot, + lastExtendedSlotStartIndex: meta.lastExtendedStartIndex, + authority: meta.authority.length !== 0 ? new PublicKey(meta.authority[0]) : void 0, + addresses: addresses.map((address2) => new PublicKey(address2)) + }; + } +} +const LookupTableMetaLayout = { + index: 1, + layout: struct([ + u32$1("typeIndex"), + u64$2("deactivationSlot"), + nu64("lastExtendedSlot"), + u8("lastExtendedStartIndex"), + u8(), + // option + seq(publicKey(), offset(u8(), -1), "authority") + ]) +}; +const URL_RE = /^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i; +function makeWebsocketUrl(endpoint) { + const matches2 = endpoint.match(URL_RE); + if (matches2 == null) { + throw TypeError(`Failed to validate endpoint URL \`${endpoint}\``); + } + const [ + _3, + // eslint-disable-line @typescript-eslint/no-unused-vars + hostish, + portWithColon, + rest + ] = matches2; + const protocol = endpoint.startsWith("https:") ? "wss:" : "ws:"; + const startPort = portWithColon == null ? null : parseInt(portWithColon.slice(1), 10); + const websocketPort = ( + // Only shift the port by +1 as a convention for ws(s) only if given endpoint + // is explicitly specifying the endpoint port (HTTP-based RPC), assuming + // we're directly trying to connect to agave-validator's ws listening port. + // When the endpoint omits the port, we're connecting to the protocol + // default ports: http(80) or https(443) and it's assumed we're behind a reverse + // proxy which manages WebSocket upgrade and backend port redirection. + startPort == null ? "" : `:${startPort + 1}` + ); + return `${protocol}//${hostish}${websocketPort}${rest}`; +} +const PublicKeyFromString = coerce(instance(PublicKey), string(), (value) => new PublicKey(value)); +const RawAccountDataResult = tuple([string(), literal("base64")]); +const BufferFromRawAccountData = coerce(instance(buffer.Buffer), RawAccountDataResult, (value) => buffer.Buffer.from(value[0], "base64")); +const BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1e3; +function assertEndpointUrl(putativeUrl) { + if (/^https?:/.test(putativeUrl) === false) { + throw new TypeError("Endpoint URL must start with `http:` or `https:`."); + } + return putativeUrl; +} +function extractCommitmentFromConfig(commitmentOrConfig) { + let commitment; + let config2; + if (typeof commitmentOrConfig === "string") { + commitment = commitmentOrConfig; + } else if (commitmentOrConfig) { + const { + commitment: specifiedCommitment, + ...specifiedConfig + } = commitmentOrConfig; + commitment = specifiedCommitment; + config2 = specifiedConfig; + } + return { + commitment, + config: config2 + }; +} +function applyDefaultMemcmpEncodingToFilters(filters) { + return filters.map((filter2) => "memcmp" in filter2 ? { + ...filter2, + memcmp: { + ...filter2.memcmp, + encoding: filter2.memcmp.encoding ?? "base58" + } + } : filter2); +} +function createRpcResult(result) { + return union([type({ + jsonrpc: literal("2.0"), + id: string(), + result + }), type({ + jsonrpc: literal("2.0"), + id: string(), + error: type({ + code: unknown(), + message: string(), + data: optional(any()) + }) + })]); +} +const UnknownRpcResult = createRpcResult(unknown()); +function jsonRpcResult(schema) { + return coerce(createRpcResult(schema), UnknownRpcResult, (value) => { + if ("error" in value) { + return value; + } else { + return { + ...value, + result: create(value.result, schema) + }; + } + }); +} +function jsonRpcResultAndContext(value) { + return jsonRpcResult(type({ + context: type({ + slot: number$1() + }), + value + })); +} +function notificationResultAndContext(value) { + return type({ + context: type({ + slot: number$1() + }), + value + }); +} +function versionedMessageFromResponse(version2, response) { + if (version2 === 0) { + return new MessageV0({ + header: response.header, + staticAccountKeys: response.accountKeys.map((accountKey) => new PublicKey(accountKey)), + recentBlockhash: response.recentBlockhash, + compiledInstructions: response.instructions.map((ix) => ({ + programIdIndex: ix.programIdIndex, + accountKeyIndexes: ix.accounts, + data: bs58$3.decode(ix.data) + })), + addressTableLookups: response.addressTableLookups + }); + } else { + return new Message(response); + } +} +const GetInflationGovernorResult = type({ + foundation: number$1(), + foundationTerm: number$1(), + initial: number$1(), + taper: number$1(), + terminal: number$1() +}); +const GetInflationRewardResult = jsonRpcResult(array(nullable(type({ + epoch: number$1(), + effectiveSlot: number$1(), + amount: number$1(), + postBalance: number$1(), + commission: optional(nullable(number$1())) +})))); +const GetRecentPrioritizationFeesResult = array(type({ + slot: number$1(), + prioritizationFee: number$1() +})); +const GetInflationRateResult = type({ + total: number$1(), + validator: number$1(), + foundation: number$1(), + epoch: number$1() +}); +const GetEpochInfoResult = type({ + epoch: number$1(), + slotIndex: number$1(), + slotsInEpoch: number$1(), + absoluteSlot: number$1(), + blockHeight: optional(number$1()), + transactionCount: optional(number$1()) +}); +const GetEpochScheduleResult = type({ + slotsPerEpoch: number$1(), + leaderScheduleSlotOffset: number$1(), + warmup: boolean(), + firstNormalEpoch: number$1(), + firstNormalSlot: number$1() +}); +const GetLeaderScheduleResult = record(string(), array(number$1())); +const TransactionErrorResult = nullable(union([type({}), string()])); +const SignatureStatusResult = type({ + err: TransactionErrorResult +}); +const SignatureReceivedResult = literal("receivedSignature"); +const VersionResult = type({ + "solana-core": string(), + "feature-set": optional(number$1()) +}); +const ParsedInstructionStruct = type({ + program: string(), + programId: PublicKeyFromString, + parsed: unknown() +}); +const PartiallyDecodedInstructionStruct = type({ + programId: PublicKeyFromString, + accounts: array(PublicKeyFromString), + data: string() +}); +const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({ + err: nullable(union([type({}), string()])), + logs: nullable(array(string())), + accounts: optional(nullable(array(nullable(type({ + executable: boolean(), + owner: string(), + lamports: number$1(), + data: array(string()), + rentEpoch: optional(number$1()) + }))))), + unitsConsumed: optional(number$1()), + returnData: optional(nullable(type({ + programId: string(), + data: tuple([string(), literal("base64")]) + }))), + innerInstructions: optional(nullable(array(type({ + index: number$1(), + instructions: array(union([ParsedInstructionStruct, PartiallyDecodedInstructionStruct])) + })))) +})); +const BlockProductionResponseStruct = jsonRpcResultAndContext(type({ + byIdentity: record(string(), array(number$1())), + range: type({ + firstSlot: number$1(), + lastSlot: number$1() + }) +})); +function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent) { + const fetch2 = customFetch ? customFetch : fetchImpl; + let agent; + { + if (httpAgent != null) { + console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."); + } + } + let fetchWithMiddleware; + if (fetchMiddleware) { + fetchWithMiddleware = async (info, init3) => { + const modifiedFetchArgs = await new Promise((resolve, reject) => { + try { + fetchMiddleware(info, init3, (modifiedInfo, modifiedInit) => resolve([modifiedInfo, modifiedInit])); + } catch (error) { + reject(error); + } + }); + return await fetch2(...modifiedFetchArgs); + }; + } + const clientBrowser = new RpcClient(async (request, callback) => { + const options = { + method: "POST", + body: request, + agent, + headers: Object.assign({ + "Content-Type": "application/json" + }, httpHeaders || {}, COMMON_HTTP_HEADERS) + }; + try { + let too_many_requests_retries = 5; + let res; + let waitTime = 500; + for (; ; ) { + if (fetchWithMiddleware) { + res = await fetchWithMiddleware(url, options); + } else { + res = await fetch2(url, options); + } + if (res.status !== 429) { + break; + } + if (disableRetryOnRateLimit === true) { + break; + } + too_many_requests_retries -= 1; + if (too_many_requests_retries === 0) { + break; + } + console.error(`Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`); + await sleep$1(waitTime); + waitTime *= 2; + } + const text = await res.text(); + if (res.ok) { + callback(null, text); + } else { + callback(new Error(`${res.status} ${res.statusText}: ${text}`)); + } + } catch (err) { + if (err instanceof Error) + callback(err); + } + }, {}); + return clientBrowser; +} +function createRpcRequest(client2) { + return (method, args) => { + return new Promise((resolve, reject) => { + client2.request(method, args, (err, response) => { + if (err) { + reject(err); + return; + } + resolve(response); + }); + }); + }; +} +function createRpcBatchRequest(client2) { + return (requests) => { + return new Promise((resolve, reject) => { + if (requests.length === 0) + resolve([]); + const batch = requests.map((params) => { + return client2.request(params.methodName, params.args); + }); + client2.request(batch, (err, response) => { + if (err) { + reject(err); + return; + } + resolve(response); + }); + }); + }; +} +const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult); +const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult); +const GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult); +const GetEpochInfoRpcResult = jsonRpcResult(GetEpochInfoResult); +const GetEpochScheduleRpcResult = jsonRpcResult(GetEpochScheduleResult); +const GetLeaderScheduleRpcResult = jsonRpcResult(GetLeaderScheduleResult); +const SlotRpcResult = jsonRpcResult(number$1()); +const GetSupplyRpcResult = jsonRpcResultAndContext(type({ + total: number$1(), + circulating: number$1(), + nonCirculating: number$1(), + nonCirculatingAccounts: array(PublicKeyFromString) +})); +const TokenAmountResult = type({ + amount: string(), + uiAmount: nullable(number$1()), + decimals: number$1(), + uiAmountString: optional(string()) +}); +const GetTokenLargestAccountsResult = jsonRpcResultAndContext(array(type({ + address: PublicKeyFromString, + amount: string(), + uiAmount: nullable(number$1()), + decimals: number$1(), + uiAmountString: optional(string()) +}))); +const GetTokenAccountsByOwner = jsonRpcResultAndContext(array(type({ + pubkey: PublicKeyFromString, + account: type({ + executable: boolean(), + owner: PublicKeyFromString, + lamports: number$1(), + data: BufferFromRawAccountData, + rentEpoch: number$1() + }) +}))); +const ParsedAccountDataResult = type({ + program: string(), + parsed: unknown(), + space: number$1() +}); +const GetParsedTokenAccountsByOwner = jsonRpcResultAndContext(array(type({ + pubkey: PublicKeyFromString, + account: type({ + executable: boolean(), + owner: PublicKeyFromString, + lamports: number$1(), + data: ParsedAccountDataResult, + rentEpoch: number$1() + }) +}))); +const GetLargestAccountsRpcResult = jsonRpcResultAndContext(array(type({ + lamports: number$1(), + address: PublicKeyFromString +}))); +const AccountInfoResult = type({ + executable: boolean(), + owner: PublicKeyFromString, + lamports: number$1(), + data: BufferFromRawAccountData, + rentEpoch: number$1() +}); +const KeyedAccountInfoResult = type({ + pubkey: PublicKeyFromString, + account: AccountInfoResult +}); +const ParsedOrRawAccountData = coerce(union([instance(buffer.Buffer), ParsedAccountDataResult]), union([RawAccountDataResult, ParsedAccountDataResult]), (value) => { + if (Array.isArray(value)) { + return create(value, BufferFromRawAccountData); + } else { + return value; + } +}); +const ParsedAccountInfoResult = type({ + executable: boolean(), + owner: PublicKeyFromString, + lamports: number$1(), + data: ParsedOrRawAccountData, + rentEpoch: number$1() +}); +const KeyedParsedAccountInfoResult = type({ + pubkey: PublicKeyFromString, + account: ParsedAccountInfoResult +}); +const StakeActivationResult = type({ + state: union([literal("active"), literal("inactive"), literal("activating"), literal("deactivating")]), + active: number$1(), + inactive: number$1() +}); +const GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(array(type({ + signature: string(), + slot: number$1(), + err: TransactionErrorResult, + memo: nullable(string()), + blockTime: optional(nullable(number$1())) +}))); +const GetSignaturesForAddressRpcResult = jsonRpcResult(array(type({ + signature: string(), + slot: number$1(), + err: TransactionErrorResult, + memo: nullable(string()), + blockTime: optional(nullable(number$1())) +}))); +const AccountNotificationResult = type({ + subscription: number$1(), + result: notificationResultAndContext(AccountInfoResult) +}); +const ProgramAccountInfoResult = type({ + pubkey: PublicKeyFromString, + account: AccountInfoResult +}); +const ProgramAccountNotificationResult = type({ + subscription: number$1(), + result: notificationResultAndContext(ProgramAccountInfoResult) +}); +const SlotInfoResult = type({ + parent: number$1(), + slot: number$1(), + root: number$1() +}); +const SlotNotificationResult = type({ + subscription: number$1(), + result: SlotInfoResult +}); +const SlotUpdateResult = union([type({ + type: union([literal("firstShredReceived"), literal("completed"), literal("optimisticConfirmation"), literal("root")]), + slot: number$1(), + timestamp: number$1() +}), type({ + type: literal("createdBank"), + parent: number$1(), + slot: number$1(), + timestamp: number$1() +}), type({ + type: literal("frozen"), + slot: number$1(), + timestamp: number$1(), + stats: type({ + numTransactionEntries: number$1(), + numSuccessfulTransactions: number$1(), + numFailedTransactions: number$1(), + maxTransactionsPerEntry: number$1() + }) +}), type({ + type: literal("dead"), + slot: number$1(), + timestamp: number$1(), + err: string() +})]); +const SlotUpdateNotificationResult = type({ + subscription: number$1(), + result: SlotUpdateResult +}); +const SignatureNotificationResult = type({ + subscription: number$1(), + result: notificationResultAndContext(union([SignatureStatusResult, SignatureReceivedResult])) +}); +const RootNotificationResult = type({ + subscription: number$1(), + result: number$1() +}); +const ContactInfoResult = type({ + pubkey: string(), + gossip: nullable(string()), + tpu: nullable(string()), + rpc: nullable(string()), + version: nullable(string()) +}); +const VoteAccountInfoResult = type({ + votePubkey: string(), + nodePubkey: string(), + activatedStake: number$1(), + epochVoteAccount: boolean(), + epochCredits: array(tuple([number$1(), number$1(), number$1()])), + commission: number$1(), + lastVote: number$1(), + rootSlot: nullable(number$1()) +}); +const GetVoteAccounts = jsonRpcResult(type({ + current: array(VoteAccountInfoResult), + delinquent: array(VoteAccountInfoResult) +})); +const ConfirmationStatus = union([literal("processed"), literal("confirmed"), literal("finalized")]); +const SignatureStatusResponse = type({ + slot: number$1(), + confirmations: nullable(number$1()), + err: TransactionErrorResult, + confirmationStatus: optional(ConfirmationStatus) +}); +const GetSignatureStatusesRpcResult = jsonRpcResultAndContext(array(nullable(SignatureStatusResponse))); +const GetMinimumBalanceForRentExemptionRpcResult = jsonRpcResult(number$1()); +const AddressTableLookupStruct = type({ + accountKey: PublicKeyFromString, + writableIndexes: array(number$1()), + readonlyIndexes: array(number$1()) +}); +const ConfirmedTransactionResult = type({ + signatures: array(string()), + message: type({ + accountKeys: array(string()), + header: type({ + numRequiredSignatures: number$1(), + numReadonlySignedAccounts: number$1(), + numReadonlyUnsignedAccounts: number$1() + }), + instructions: array(type({ + accounts: array(number$1()), + data: string(), + programIdIndex: number$1() + })), + recentBlockhash: string(), + addressTableLookups: optional(array(AddressTableLookupStruct)) + }) +}); +const AnnotatedAccountKey = type({ + pubkey: PublicKeyFromString, + signer: boolean(), + writable: boolean(), + source: optional(union([literal("transaction"), literal("lookupTable")])) +}); +const ConfirmedTransactionAccountsModeResult = type({ + accountKeys: array(AnnotatedAccountKey), + signatures: array(string()) +}); +const ParsedInstructionResult = type({ + parsed: unknown(), + program: string(), + programId: PublicKeyFromString +}); +const RawInstructionResult = type({ + accounts: array(PublicKeyFromString), + data: string(), + programId: PublicKeyFromString +}); +const InstructionResult = union([RawInstructionResult, ParsedInstructionResult]); +const UnknownInstructionResult = union([type({ + parsed: unknown(), + program: string(), + programId: string() +}), type({ + accounts: array(string()), + data: string(), + programId: string() +})]); +const ParsedOrRawInstruction = coerce(InstructionResult, UnknownInstructionResult, (value) => { + if ("accounts" in value) { + return create(value, RawInstructionResult); + } else { + return create(value, ParsedInstructionResult); + } +}); +const ParsedConfirmedTransactionResult = type({ + signatures: array(string()), + message: type({ + accountKeys: array(AnnotatedAccountKey), + instructions: array(ParsedOrRawInstruction), + recentBlockhash: string(), + addressTableLookups: optional(nullable(array(AddressTableLookupStruct))) + }) +}); +const TokenBalanceResult = type({ + accountIndex: number$1(), + mint: string(), + owner: optional(string()), + uiTokenAmount: TokenAmountResult +}); +const LoadedAddressesResult = type({ + writable: array(PublicKeyFromString), + readonly: array(PublicKeyFromString) +}); +const ConfirmedTransactionMetaResult = type({ + err: TransactionErrorResult, + fee: number$1(), + innerInstructions: optional(nullable(array(type({ + index: number$1(), + instructions: array(type({ + accounts: array(number$1()), + data: string(), + programIdIndex: number$1() + })) + })))), + preBalances: array(number$1()), + postBalances: array(number$1()), + logMessages: optional(nullable(array(string()))), + preTokenBalances: optional(nullable(array(TokenBalanceResult))), + postTokenBalances: optional(nullable(array(TokenBalanceResult))), + loadedAddresses: optional(LoadedAddressesResult), + computeUnitsConsumed: optional(number$1()) +}); +const ParsedConfirmedTransactionMetaResult = type({ + err: TransactionErrorResult, + fee: number$1(), + innerInstructions: optional(nullable(array(type({ + index: number$1(), + instructions: array(ParsedOrRawInstruction) + })))), + preBalances: array(number$1()), + postBalances: array(number$1()), + logMessages: optional(nullable(array(string()))), + preTokenBalances: optional(nullable(array(TokenBalanceResult))), + postTokenBalances: optional(nullable(array(TokenBalanceResult))), + loadedAddresses: optional(LoadedAddressesResult), + computeUnitsConsumed: optional(number$1()) +}); +const TransactionVersionStruct = union([literal(0), literal("legacy")]); +const RewardsResult = type({ + pubkey: string(), + lamports: number$1(), + postBalance: nullable(number$1()), + rewardType: nullable(string()), + commission: optional(nullable(number$1())) +}); +const GetBlockRpcResult = jsonRpcResult(nullable(type({ + blockhash: string(), + previousBlockhash: string(), + parentSlot: number$1(), + transactions: array(type({ + transaction: ConfirmedTransactionResult, + meta: nullable(ConfirmedTransactionMetaResult), + version: optional(TransactionVersionStruct) + })), + rewards: optional(array(RewardsResult)), + blockTime: nullable(number$1()), + blockHeight: nullable(number$1()) +}))); +const GetNoneModeBlockRpcResult = jsonRpcResult(nullable(type({ + blockhash: string(), + previousBlockhash: string(), + parentSlot: number$1(), + rewards: optional(array(RewardsResult)), + blockTime: nullable(number$1()), + blockHeight: nullable(number$1()) +}))); +const GetAccountsModeBlockRpcResult = jsonRpcResult(nullable(type({ + blockhash: string(), + previousBlockhash: string(), + parentSlot: number$1(), + transactions: array(type({ + transaction: ConfirmedTransactionAccountsModeResult, + meta: nullable(ConfirmedTransactionMetaResult), + version: optional(TransactionVersionStruct) + })), + rewards: optional(array(RewardsResult)), + blockTime: nullable(number$1()), + blockHeight: nullable(number$1()) +}))); +const GetParsedBlockRpcResult = jsonRpcResult(nullable(type({ + blockhash: string(), + previousBlockhash: string(), + parentSlot: number$1(), + transactions: array(type({ + transaction: ParsedConfirmedTransactionResult, + meta: nullable(ParsedConfirmedTransactionMetaResult), + version: optional(TransactionVersionStruct) + })), + rewards: optional(array(RewardsResult)), + blockTime: nullable(number$1()), + blockHeight: nullable(number$1()) +}))); +const GetParsedAccountsModeBlockRpcResult = jsonRpcResult(nullable(type({ + blockhash: string(), + previousBlockhash: string(), + parentSlot: number$1(), + transactions: array(type({ + transaction: ConfirmedTransactionAccountsModeResult, + meta: nullable(ParsedConfirmedTransactionMetaResult), + version: optional(TransactionVersionStruct) + })), + rewards: optional(array(RewardsResult)), + blockTime: nullable(number$1()), + blockHeight: nullable(number$1()) +}))); +const GetParsedNoneModeBlockRpcResult = jsonRpcResult(nullable(type({ + blockhash: string(), + previousBlockhash: string(), + parentSlot: number$1(), + rewards: optional(array(RewardsResult)), + blockTime: nullable(number$1()), + blockHeight: nullable(number$1()) +}))); +const GetConfirmedBlockRpcResult = jsonRpcResult(nullable(type({ + blockhash: string(), + previousBlockhash: string(), + parentSlot: number$1(), + transactions: array(type({ + transaction: ConfirmedTransactionResult, + meta: nullable(ConfirmedTransactionMetaResult) + })), + rewards: optional(array(RewardsResult)), + blockTime: nullable(number$1()) +}))); +const GetBlockSignaturesRpcResult = jsonRpcResult(nullable(type({ + blockhash: string(), + previousBlockhash: string(), + parentSlot: number$1(), + signatures: array(string()), + blockTime: nullable(number$1()) +}))); +const GetTransactionRpcResult = jsonRpcResult(nullable(type({ + slot: number$1(), + meta: nullable(ConfirmedTransactionMetaResult), + blockTime: optional(nullable(number$1())), + transaction: ConfirmedTransactionResult, + version: optional(TransactionVersionStruct) +}))); +const GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({ + slot: number$1(), + transaction: ParsedConfirmedTransactionResult, + meta: nullable(ParsedConfirmedTransactionMetaResult), + blockTime: optional(nullable(number$1())), + version: optional(TransactionVersionStruct) +}))); +const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({ + blockhash: string(), + feeCalculator: type({ + lamportsPerSignature: number$1() + }) +})); +const GetLatestBlockhashRpcResult = jsonRpcResultAndContext(type({ + blockhash: string(), + lastValidBlockHeight: number$1() +})); +const IsBlockhashValidRpcResult = jsonRpcResultAndContext(boolean()); +const PerfSampleResult = type({ + slot: number$1(), + numTransactions: number$1(), + numSlots: number$1(), + samplePeriodSecs: number$1() +}); +const GetRecentPerformanceSamplesRpcResult = jsonRpcResult(array(PerfSampleResult)); +const GetFeeCalculatorRpcResult = jsonRpcResultAndContext(nullable(type({ + feeCalculator: type({ + lamportsPerSignature: number$1() + }) +}))); +const RequestAirdropRpcResult = jsonRpcResult(string()); +const SendTransactionRpcResult = jsonRpcResult(string()); +const LogsResult = type({ + err: TransactionErrorResult, + logs: array(string()), + signature: string() +}); +const LogsNotificationResult = type({ + result: notificationResultAndContext(LogsResult), + subscription: number$1() +}); +const COMMON_HTTP_HEADERS = { + "solana-client": `js/${"1.0.0-maintenance"}` +}; +class Connection { + /** + * Establish a JSON RPC connection + * + * @param endpoint URL to the fullnode JSON RPC endpoint + * @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object + */ + constructor(endpoint, _commitmentOrConfig) { + this._commitment = void 0; + this._confirmTransactionInitialTimeout = void 0; + this._rpcEndpoint = void 0; + this._rpcWsEndpoint = void 0; + this._rpcClient = void 0; + this._rpcRequest = void 0; + this._rpcBatchRequest = void 0; + this._rpcWebSocket = void 0; + this._rpcWebSocketConnected = false; + this._rpcWebSocketHeartbeat = null; + this._rpcWebSocketIdleTimeout = null; + this._rpcWebSocketGeneration = 0; + this._disableBlockhashCaching = false; + this._pollingBlockhash = false; + this._blockhashInfo = { + latestBlockhash: null, + lastFetch: 0, + transactionSignatures: [], + simulatedSignatures: [] + }; + this._nextClientSubscriptionId = 0; + this._subscriptionDisposeFunctionsByClientSubscriptionId = {}; + this._subscriptionHashByClientSubscriptionId = {}; + this._subscriptionStateChangeCallbacksByHash = {}; + this._subscriptionCallbacksByServerSubscriptionId = {}; + this._subscriptionsByHash = {}; + this._subscriptionsAutoDisposedByRpc = /* @__PURE__ */ new Set(); + this.getBlockHeight = (() => { + const requestPromises = {}; + return async (commitmentOrConfig) => { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([], commitment, void 0, config2); + const requestHash = fastStableStringify(args); + requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => { + try { + const unsafeRes = await this._rpcRequest("getBlockHeight", args); + const res = create(unsafeRes, jsonRpcResult(number$1())); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get block height information"); + } + return res.result; + } finally { + delete requestPromises[requestHash]; + } + })(); + return await requestPromises[requestHash]; + }; + })(); + let wsEndpoint; + let httpHeaders; + let fetch2; + let fetchMiddleware; + let disableRetryOnRateLimit; + let httpAgent; + if (_commitmentOrConfig && typeof _commitmentOrConfig === "string") { + this._commitment = _commitmentOrConfig; + } else if (_commitmentOrConfig) { + this._commitment = _commitmentOrConfig.commitment; + this._confirmTransactionInitialTimeout = _commitmentOrConfig.confirmTransactionInitialTimeout; + wsEndpoint = _commitmentOrConfig.wsEndpoint; + httpHeaders = _commitmentOrConfig.httpHeaders; + fetch2 = _commitmentOrConfig.fetch; + fetchMiddleware = _commitmentOrConfig.fetchMiddleware; + disableRetryOnRateLimit = _commitmentOrConfig.disableRetryOnRateLimit; + httpAgent = _commitmentOrConfig.httpAgent; + } + this._rpcEndpoint = assertEndpointUrl(endpoint); + this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint); + this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch2, fetchMiddleware, disableRetryOnRateLimit, httpAgent); + this._rpcRequest = createRpcRequest(this._rpcClient); + this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient); + this._rpcWebSocket = new RpcWebSocketClient(this._rpcWsEndpoint, { + autoconnect: false, + max_reconnects: Infinity + }); + this._rpcWebSocket.on("open", this._wsOnOpen.bind(this)); + this._rpcWebSocket.on("error", this._wsOnError.bind(this)); + this._rpcWebSocket.on("close", this._wsOnClose.bind(this)); + this._rpcWebSocket.on("accountNotification", this._wsOnAccountNotification.bind(this)); + this._rpcWebSocket.on("programNotification", this._wsOnProgramAccountNotification.bind(this)); + this._rpcWebSocket.on("slotNotification", this._wsOnSlotNotification.bind(this)); + this._rpcWebSocket.on("slotsUpdatesNotification", this._wsOnSlotUpdatesNotification.bind(this)); + this._rpcWebSocket.on("signatureNotification", this._wsOnSignatureNotification.bind(this)); + this._rpcWebSocket.on("rootNotification", this._wsOnRootNotification.bind(this)); + this._rpcWebSocket.on("logsNotification", this._wsOnLogsNotification.bind(this)); + } + /** + * The default commitment used for requests + */ + get commitment() { + return this._commitment; + } + /** + * The RPC endpoint + */ + get rpcEndpoint() { + return this._rpcEndpoint; + } + /** + * Fetch the balance for the specified public key, return with context + */ + async getBalanceAndContext(publicKey2, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([publicKey2.toBase58()], commitment, void 0, config2); + const unsafeRes = await this._rpcRequest("getBalance", args); + const res = create(unsafeRes, jsonRpcResultAndContext(number$1())); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get balance for ${publicKey2.toBase58()}`); + } + return res.result; + } + /** + * Fetch the balance for the specified public key + */ + async getBalance(publicKey2, commitmentOrConfig) { + return await this.getBalanceAndContext(publicKey2, commitmentOrConfig).then((x3) => x3.value).catch((e18) => { + throw new Error("failed to get balance of account " + publicKey2.toBase58() + ": " + e18); + }); + } + /** + * Fetch the estimated production time of a block + */ + async getBlockTime(slot) { + const unsafeRes = await this._rpcRequest("getBlockTime", [slot]); + const res = create(unsafeRes, jsonRpcResult(nullable(number$1()))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get block time for slot ${slot}`); + } + return res.result; + } + /** + * Fetch the lowest slot that the node has information about in its ledger. + * This value may increase over time if the node is configured to purge older ledger data + */ + async getMinimumLedgerSlot() { + const unsafeRes = await this._rpcRequest("minimumLedgerSlot", []); + const res = create(unsafeRes, jsonRpcResult(number$1())); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get minimum ledger slot"); + } + return res.result; + } + /** + * Fetch the slot of the lowest confirmed block that has not been purged from the ledger + */ + async getFirstAvailableBlock() { + const unsafeRes = await this._rpcRequest("getFirstAvailableBlock", []); + const res = create(unsafeRes, SlotRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get first available block"); + } + return res.result; + } + /** + * Fetch information about the current supply + */ + async getSupply(config2) { + let configArg = {}; + if (typeof config2 === "string") { + configArg = { + commitment: config2 + }; + } else if (config2) { + configArg = { + ...config2, + commitment: config2 && config2.commitment || this.commitment + }; + } else { + configArg = { + commitment: this.commitment + }; + } + const unsafeRes = await this._rpcRequest("getSupply", [configArg]); + const res = create(unsafeRes, GetSupplyRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get supply"); + } + return res.result; + } + /** + * Fetch the current supply of a token mint + */ + async getTokenSupply(tokenMintAddress, commitment) { + const args = this._buildArgs([tokenMintAddress.toBase58()], commitment); + const unsafeRes = await this._rpcRequest("getTokenSupply", args); + const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult)); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get token supply"); + } + return res.result; + } + /** + * Fetch the current balance of a token account + */ + async getTokenAccountBalance(tokenAddress, commitment) { + const args = this._buildArgs([tokenAddress.toBase58()], commitment); + const unsafeRes = await this._rpcRequest("getTokenAccountBalance", args); + const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult)); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get token account balance"); + } + return res.result; + } + /** + * Fetch all the token accounts owned by the specified account + * + * @return {Promise} + */ + async getTokenAccountsByOwner(ownerAddress, filter2, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + let _args = [ownerAddress.toBase58()]; + if ("mint" in filter2) { + _args.push({ + mint: filter2.mint.toBase58() + }); + } else { + _args.push({ + programId: filter2.programId.toBase58() + }); + } + const args = this._buildArgs(_args, commitment, "base64", config2); + const unsafeRes = await this._rpcRequest("getTokenAccountsByOwner", args); + const res = create(unsafeRes, GetTokenAccountsByOwner); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`); + } + return res.result; + } + /** + * Fetch parsed token accounts owned by the specified account + * + * @return {Promise}>>>} + */ + async getParsedTokenAccountsByOwner(ownerAddress, filter2, commitment) { + let _args = [ownerAddress.toBase58()]; + if ("mint" in filter2) { + _args.push({ + mint: filter2.mint.toBase58() + }); + } else { + _args.push({ + programId: filter2.programId.toBase58() + }); + } + const args = this._buildArgs(_args, commitment, "jsonParsed"); + const unsafeRes = await this._rpcRequest("getTokenAccountsByOwner", args); + const res = create(unsafeRes, GetParsedTokenAccountsByOwner); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`); + } + return res.result; + } + /** + * Fetch the 20 largest accounts with their current balances + */ + async getLargestAccounts(config2) { + const arg = { + ...config2, + commitment: config2 && config2.commitment || this.commitment + }; + const args = arg.filter || arg.commitment ? [arg] : []; + const unsafeRes = await this._rpcRequest("getLargestAccounts", args); + const res = create(unsafeRes, GetLargestAccountsRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get largest accounts"); + } + return res.result; + } + /** + * Fetch the 20 largest token accounts with their current balances + * for a given mint. + */ + async getTokenLargestAccounts(mintAddress, commitment) { + const args = this._buildArgs([mintAddress.toBase58()], commitment); + const unsafeRes = await this._rpcRequest("getTokenLargestAccounts", args); + const res = create(unsafeRes, GetTokenLargestAccountsResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get token largest accounts"); + } + return res.result; + } + /** + * Fetch all the account info for the specified public key, return with context + */ + async getAccountInfoAndContext(publicKey2, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([publicKey2.toBase58()], commitment, "base64", config2); + const unsafeRes = await this._rpcRequest("getAccountInfo", args); + const res = create(unsafeRes, jsonRpcResultAndContext(nullable(AccountInfoResult))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey2.toBase58()}`); + } + return res.result; + } + /** + * Fetch parsed account info for the specified public key + */ + async getParsedAccountInfo(publicKey2, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([publicKey2.toBase58()], commitment, "jsonParsed", config2); + const unsafeRes = await this._rpcRequest("getAccountInfo", args); + const res = create(unsafeRes, jsonRpcResultAndContext(nullable(ParsedAccountInfoResult))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey2.toBase58()}`); + } + return res.result; + } + /** + * Fetch all the account info for the specified public key + */ + async getAccountInfo(publicKey2, commitmentOrConfig) { + try { + const res = await this.getAccountInfoAndContext(publicKey2, commitmentOrConfig); + return res.value; + } catch (e18) { + throw new Error("failed to get info about account " + publicKey2.toBase58() + ": " + e18); + } + } + /** + * Fetch all the account info for multiple accounts specified by an array of public keys, return with context + */ + async getMultipleParsedAccounts(publicKeys, rawConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(rawConfig); + const keys2 = publicKeys.map((key2) => key2.toBase58()); + const args = this._buildArgs([keys2], commitment, "jsonParsed", config2); + const unsafeRes = await this._rpcRequest("getMultipleAccounts", args); + const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(ParsedAccountInfoResult)))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys2}`); + } + return res.result; + } + /** + * Fetch all the account info for multiple accounts specified by an array of public keys, return with context + */ + async getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const keys2 = publicKeys.map((key2) => key2.toBase58()); + const args = this._buildArgs([keys2], commitment, "base64", config2); + const unsafeRes = await this._rpcRequest("getMultipleAccounts", args); + const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(AccountInfoResult)))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys2}`); + } + return res.result; + } + /** + * Fetch all the account info for multiple accounts specified by an array of public keys + */ + async getMultipleAccountsInfo(publicKeys, commitmentOrConfig) { + const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig); + return res.value; + } + /** + * Returns epoch activation information for a stake account that has been delegated + * + * @deprecated Deprecated since RPC v1.18; will be removed in a future version. + */ + async getStakeActivation(publicKey2, commitmentOrConfig, epoch) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([publicKey2.toBase58()], commitment, void 0, { + ...config2, + epoch: epoch != null ? epoch : config2 == null ? void 0 : config2.epoch + }); + const unsafeRes = await this._rpcRequest("getStakeActivation", args); + const res = create(unsafeRes, jsonRpcResult(StakeActivationResult)); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get Stake Activation ${publicKey2.toBase58()}`); + } + return res.result; + } + /** + * Fetch all the accounts owned by the specified program id + * + * @return {Promise}>>} + */ + // eslint-disable-next-line no-dupe-class-members + // eslint-disable-next-line no-dupe-class-members + async getProgramAccounts(programId, configOrCommitment) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(configOrCommitment); + const { + encoding: encoding2, + ...configWithoutEncoding + } = config2 || {}; + const args = this._buildArgs([programId.toBase58()], commitment, encoding2 || "base64", { + ...configWithoutEncoding, + ...configWithoutEncoding.filters ? { + filters: applyDefaultMemcmpEncodingToFilters(configWithoutEncoding.filters) + } : null + }); + const unsafeRes = await this._rpcRequest("getProgramAccounts", args); + const baseSchema = array(KeyedAccountInfoResult); + const res = configWithoutEncoding.withContext === true ? create(unsafeRes, jsonRpcResultAndContext(baseSchema)) : create(unsafeRes, jsonRpcResult(baseSchema)); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`); + } + return res.result; + } + /** + * Fetch and parse all the accounts owned by the specified program id + * + * @return {Promise}>>} + */ + async getParsedProgramAccounts(programId, configOrCommitment) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(configOrCommitment); + const args = this._buildArgs([programId.toBase58()], commitment, "jsonParsed", config2); + const unsafeRes = await this._rpcRequest("getProgramAccounts", args); + const res = create(unsafeRes, jsonRpcResult(array(KeyedParsedAccountInfoResult))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`); + } + return res.result; + } + /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */ + // eslint-disable-next-line no-dupe-class-members + // eslint-disable-next-line no-dupe-class-members + async confirmTransaction(strategy, commitment) { + var _a3; + let rawSignature; + if (typeof strategy == "string") { + rawSignature = strategy; + } else { + const config2 = strategy; + if ((_a3 = config2.abortSignal) == null ? void 0 : _a3.aborted) { + return Promise.reject(config2.abortSignal.reason); + } + rawSignature = config2.signature; + } + let decodedSignature; + try { + decodedSignature = bs58$3.decode(rawSignature); + } catch (err) { + throw new Error("signature must be base58 encoded: " + rawSignature); + } + assert$1(decodedSignature.length === 64, "signature has invalid length"); + if (typeof strategy === "string") { + return await this.confirmTransactionUsingLegacyTimeoutStrategy({ + commitment: commitment || this.commitment, + signature: rawSignature + }); + } else if ("lastValidBlockHeight" in strategy) { + return await this.confirmTransactionUsingBlockHeightExceedanceStrategy({ + commitment: commitment || this.commitment, + strategy + }); + } else { + return await this.confirmTransactionUsingDurableNonceStrategy({ + commitment: commitment || this.commitment, + strategy + }); + } + } + getCancellationPromise(signal) { + return new Promise((_3, reject) => { + if (signal == null) { + return; + } + if (signal.aborted) { + reject(signal.reason); + } else { + signal.addEventListener("abort", () => { + reject(signal.reason); + }); + } + }); + } + getTransactionConfirmationPromise({ + commitment, + signature: signature2 + }) { + let signatureSubscriptionId; + let disposeSignatureSubscriptionStateChangeObserver; + let done = false; + const confirmationPromise = new Promise((resolve, reject) => { + try { + signatureSubscriptionId = this.onSignature(signature2, (result, context) => { + signatureSubscriptionId = void 0; + const response = { + context, + value: result + }; + resolve({ + __type: TransactionStatus.PROCESSED, + response + }); + }, commitment); + const subscriptionSetupPromise = new Promise((resolveSubscriptionSetup) => { + if (signatureSubscriptionId == null) { + resolveSubscriptionSetup(); + } else { + disposeSignatureSubscriptionStateChangeObserver = this._onSubscriptionStateChange(signatureSubscriptionId, (nextState) => { + if (nextState === "subscribed") { + resolveSubscriptionSetup(); + } + }); + } + }); + (async () => { + await subscriptionSetupPromise; + if (done) + return; + const response = await this.getSignatureStatus(signature2); + if (done) + return; + if (response == null) { + return; + } + const { + context, + value + } = response; + if (value == null) { + return; + } + if (value == null ? void 0 : value.err) { + reject(value.err); + } else { + switch (commitment) { + case "confirmed": + case "single": + case "singleGossip": { + if (value.confirmationStatus === "processed") { + return; + } + break; + } + case "finalized": + case "max": + case "root": { + if (value.confirmationStatus === "processed" || value.confirmationStatus === "confirmed") { + return; + } + break; + } + case "processed": + case "recent": + } + done = true; + resolve({ + __type: TransactionStatus.PROCESSED, + response: { + context, + value + } + }); + } + })(); + } catch (err) { + reject(err); + } + }); + const abortConfirmation = () => { + if (disposeSignatureSubscriptionStateChangeObserver) { + disposeSignatureSubscriptionStateChangeObserver(); + disposeSignatureSubscriptionStateChangeObserver = void 0; + } + if (signatureSubscriptionId != null) { + this.removeSignatureListener(signatureSubscriptionId); + signatureSubscriptionId = void 0; + } + }; + return { + abortConfirmation, + confirmationPromise + }; + } + async confirmTransactionUsingBlockHeightExceedanceStrategy({ + commitment, + strategy: { + abortSignal, + lastValidBlockHeight, + signature: signature2 + } + }) { + let done = false; + const expiryPromise = new Promise((resolve) => { + const checkBlockHeight = async () => { + try { + const blockHeight = await this.getBlockHeight(commitment); + return blockHeight; + } catch (_e3) { + return -1; + } + }; + (async () => { + let currentBlockHeight = await checkBlockHeight(); + if (done) + return; + while (currentBlockHeight <= lastValidBlockHeight) { + await sleep$1(1e3); + if (done) + return; + currentBlockHeight = await checkBlockHeight(); + if (done) + return; + } + resolve({ + __type: TransactionStatus.BLOCKHEIGHT_EXCEEDED + }); + })(); + }); + const { + abortConfirmation, + confirmationPromise + } = this.getTransactionConfirmationPromise({ + commitment, + signature: signature2 + }); + const cancellationPromise = this.getCancellationPromise(abortSignal); + let result; + try { + const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]); + if (outcome.__type === TransactionStatus.PROCESSED) { + result = outcome.response; + } else { + throw new TransactionExpiredBlockheightExceededError(signature2); + } + } finally { + done = true; + abortConfirmation(); + } + return result; + } + async confirmTransactionUsingDurableNonceStrategy({ + commitment, + strategy: { + abortSignal, + minContextSlot, + nonceAccountPubkey, + nonceValue, + signature: signature2 + } + }) { + let done = false; + const expiryPromise = new Promise((resolve) => { + let currentNonceValue = nonceValue; + let lastCheckedSlot = null; + const getCurrentNonceValue = async () => { + try { + const { + context, + value: nonceAccount + } = await this.getNonceAndContext(nonceAccountPubkey, { + commitment, + minContextSlot + }); + lastCheckedSlot = context.slot; + return nonceAccount == null ? void 0 : nonceAccount.nonce; + } catch (e18) { + return currentNonceValue; + } + }; + (async () => { + currentNonceValue = await getCurrentNonceValue(); + if (done) + return; + while (true) { + if (nonceValue !== currentNonceValue) { + resolve({ + __type: TransactionStatus.NONCE_INVALID, + slotInWhichNonceDidAdvance: lastCheckedSlot + }); + return; + } + await sleep$1(2e3); + if (done) + return; + currentNonceValue = await getCurrentNonceValue(); + if (done) + return; + } + })(); + }); + const { + abortConfirmation, + confirmationPromise + } = this.getTransactionConfirmationPromise({ + commitment, + signature: signature2 + }); + const cancellationPromise = this.getCancellationPromise(abortSignal); + let result; + try { + const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]); + if (outcome.__type === TransactionStatus.PROCESSED) { + result = outcome.response; + } else { + let signatureStatus; + while (true) { + const status = await this.getSignatureStatus(signature2); + if (status == null) { + break; + } + if (status.context.slot < (outcome.slotInWhichNonceDidAdvance ?? minContextSlot)) { + await sleep$1(400); + continue; + } + signatureStatus = status; + break; + } + if (signatureStatus == null ? void 0 : signatureStatus.value) { + const commitmentForStatus = commitment || "finalized"; + const { + confirmationStatus + } = signatureStatus.value; + switch (commitmentForStatus) { + case "processed": + case "recent": + if (confirmationStatus !== "processed" && confirmationStatus !== "confirmed" && confirmationStatus !== "finalized") { + throw new TransactionExpiredNonceInvalidError(signature2); + } + break; + case "confirmed": + case "single": + case "singleGossip": + if (confirmationStatus !== "confirmed" && confirmationStatus !== "finalized") { + throw new TransactionExpiredNonceInvalidError(signature2); + } + break; + case "finalized": + case "max": + case "root": + if (confirmationStatus !== "finalized") { + throw new TransactionExpiredNonceInvalidError(signature2); + } + break; + default: + /* @__PURE__ */ ((_3) => { + })(commitmentForStatus); + } + result = { + context: signatureStatus.context, + value: { + err: signatureStatus.value.err + } + }; + } else { + throw new TransactionExpiredNonceInvalidError(signature2); + } + } + } finally { + done = true; + abortConfirmation(); + } + return result; + } + async confirmTransactionUsingLegacyTimeoutStrategy({ + commitment, + signature: signature2 + }) { + let timeoutId; + const expiryPromise = new Promise((resolve) => { + let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1e3; + switch (commitment) { + case "processed": + case "recent": + case "single": + case "confirmed": + case "singleGossip": { + timeoutMs = this._confirmTransactionInitialTimeout || 30 * 1e3; + break; + } + } + timeoutId = setTimeout(() => resolve({ + __type: TransactionStatus.TIMED_OUT, + timeoutMs + }), timeoutMs); + }); + const { + abortConfirmation, + confirmationPromise + } = this.getTransactionConfirmationPromise({ + commitment, + signature: signature2 + }); + let result; + try { + const outcome = await Promise.race([confirmationPromise, expiryPromise]); + if (outcome.__type === TransactionStatus.PROCESSED) { + result = outcome.response; + } else { + throw new TransactionExpiredTimeoutError(signature2, outcome.timeoutMs / 1e3); + } + } finally { + clearTimeout(timeoutId); + abortConfirmation(); + } + return result; + } + /** + * Return the list of nodes that are currently participating in the cluster + */ + async getClusterNodes() { + const unsafeRes = await this._rpcRequest("getClusterNodes", []); + const res = create(unsafeRes, jsonRpcResult(array(ContactInfoResult))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get cluster nodes"); + } + return res.result; + } + /** + * Return the list of nodes that are currently participating in the cluster + */ + async getVoteAccounts(commitment) { + const args = this._buildArgs([], commitment); + const unsafeRes = await this._rpcRequest("getVoteAccounts", args); + const res = create(unsafeRes, GetVoteAccounts); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get vote accounts"); + } + return res.result; + } + /** + * Fetch the current slot that the node is processing + */ + async getSlot(commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([], commitment, void 0, config2); + const unsafeRes = await this._rpcRequest("getSlot", args); + const res = create(unsafeRes, jsonRpcResult(number$1())); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get slot"); + } + return res.result; + } + /** + * Fetch the current slot leader of the cluster + */ + async getSlotLeader(commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([], commitment, void 0, config2); + const unsafeRes = await this._rpcRequest("getSlotLeader", args); + const res = create(unsafeRes, jsonRpcResult(string())); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get slot leader"); + } + return res.result; + } + /** + * Fetch `limit` number of slot leaders starting from `startSlot` + * + * @param startSlot fetch slot leaders starting from this slot + * @param limit number of slot leaders to return + */ + async getSlotLeaders(startSlot, limit) { + const args = [startSlot, limit]; + const unsafeRes = await this._rpcRequest("getSlotLeaders", args); + const res = create(unsafeRes, jsonRpcResult(array(PublicKeyFromString))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get slot leaders"); + } + return res.result; + } + /** + * Fetch the current status of a signature + */ + async getSignatureStatus(signature2, config2) { + const { + context, + value: values + } = await this.getSignatureStatuses([signature2], config2); + assert$1(values.length === 1); + const value = values[0]; + return { + context, + value + }; + } + /** + * Fetch the current statuses of a batch of signatures + */ + async getSignatureStatuses(signatures, config2) { + const params = [signatures]; + if (config2) { + params.push(config2); + } + const unsafeRes = await this._rpcRequest("getSignatureStatuses", params); + const res = create(unsafeRes, GetSignatureStatusesRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get signature status"); + } + return res.result; + } + /** + * Fetch the current transaction count of the cluster + */ + async getTransactionCount(commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([], commitment, void 0, config2); + const unsafeRes = await this._rpcRequest("getTransactionCount", args); + const res = create(unsafeRes, jsonRpcResult(number$1())); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get transaction count"); + } + return res.result; + } + /** + * Fetch the current total currency supply of the cluster in lamports + * + * @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead. + */ + async getTotalSupply(commitment) { + const result = await this.getSupply({ + commitment, + excludeNonCirculatingAccountsList: true + }); + return result.value.total; + } + /** + * Fetch the cluster InflationGovernor parameters + */ + async getInflationGovernor(commitment) { + const args = this._buildArgs([], commitment); + const unsafeRes = await this._rpcRequest("getInflationGovernor", args); + const res = create(unsafeRes, GetInflationGovernorRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get inflation"); + } + return res.result; + } + /** + * Fetch the inflation reward for a list of addresses for an epoch + */ + async getInflationReward(addresses, epoch, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([addresses.map((pubkey) => pubkey.toBase58())], commitment, void 0, { + ...config2, + epoch: epoch != null ? epoch : config2 == null ? void 0 : config2.epoch + }); + const unsafeRes = await this._rpcRequest("getInflationReward", args); + const res = create(unsafeRes, GetInflationRewardResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get inflation reward"); + } + return res.result; + } + /** + * Fetch the specific inflation values for the current epoch + */ + async getInflationRate() { + const unsafeRes = await this._rpcRequest("getInflationRate", []); + const res = create(unsafeRes, GetInflationRateRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get inflation rate"); + } + return res.result; + } + /** + * Fetch the Epoch Info parameters + */ + async getEpochInfo(commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([], commitment, void 0, config2); + const unsafeRes = await this._rpcRequest("getEpochInfo", args); + const res = create(unsafeRes, GetEpochInfoRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get epoch info"); + } + return res.result; + } + /** + * Fetch the Epoch Schedule parameters + */ + async getEpochSchedule() { + const unsafeRes = await this._rpcRequest("getEpochSchedule", []); + const res = create(unsafeRes, GetEpochScheduleRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get epoch schedule"); + } + const epochSchedule = res.result; + return new EpochSchedule(epochSchedule.slotsPerEpoch, epochSchedule.leaderScheduleSlotOffset, epochSchedule.warmup, epochSchedule.firstNormalEpoch, epochSchedule.firstNormalSlot); + } + /** + * Fetch the leader schedule for the current epoch + * @return {Promise>} + */ + async getLeaderSchedule() { + const unsafeRes = await this._rpcRequest("getLeaderSchedule", []); + const res = create(unsafeRes, GetLeaderScheduleRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get leader schedule"); + } + return res.result; + } + /** + * Fetch the minimum balance needed to exempt an account of `dataLength` + * size from rent + */ + async getMinimumBalanceForRentExemption(dataLength2, commitment) { + const args = this._buildArgs([dataLength2], commitment); + const unsafeRes = await this._rpcRequest("getMinimumBalanceForRentExemption", args); + const res = create(unsafeRes, GetMinimumBalanceForRentExemptionRpcResult); + if ("error" in res) { + console.warn("Unable to fetch minimum balance for rent exemption"); + return 0; + } + return res.result; + } + /** + * Fetch a recent blockhash from the cluster, return with context + * @return {Promise>} + * + * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead. + */ + async getRecentBlockhashAndContext(commitment) { + const args = this._buildArgs([], commitment); + const unsafeRes = await this._rpcRequest("getRecentBlockhash", args); + const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get recent blockhash"); + } + return res.result; + } + /** + * Fetch recent performance samples + * @return {Promise>} + */ + async getRecentPerformanceSamples(limit) { + const unsafeRes = await this._rpcRequest("getRecentPerformanceSamples", limit ? [limit] : []); + const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get recent performance samples"); + } + return res.result; + } + /** + * Fetch the fee calculator for a recent blockhash from the cluster, return with context + * + * @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead. + */ + async getFeeCalculatorForBlockhash(blockhash, commitment) { + const args = this._buildArgs([blockhash], commitment); + const unsafeRes = await this._rpcRequest("getFeeCalculatorForBlockhash", args); + const res = create(unsafeRes, GetFeeCalculatorRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get fee calculator"); + } + const { + context, + value + } = res.result; + return { + context, + value: value !== null ? value.feeCalculator : null + }; + } + /** + * Fetch the fee for a message from the cluster, return with context + */ + async getFeeForMessage(message2, commitment) { + const wireMessage = toBuffer(message2.serialize()).toString("base64"); + const args = this._buildArgs([wireMessage], commitment); + const unsafeRes = await this._rpcRequest("getFeeForMessage", args); + const res = create(unsafeRes, jsonRpcResultAndContext(nullable(number$1()))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get fee for message"); + } + if (res.result === null) { + throw new Error("invalid blockhash"); + } + return res.result; + } + /** + * Fetch a list of prioritization fees from recent blocks. + */ + async getRecentPrioritizationFees(config2) { + var _a3; + const accounts2 = (_a3 = config2 == null ? void 0 : config2.lockedWritableAccounts) == null ? void 0 : _a3.map((key2) => key2.toBase58()); + const args = (accounts2 == null ? void 0 : accounts2.length) ? [accounts2] : []; + const unsafeRes = await this._rpcRequest("getRecentPrioritizationFees", args); + const res = create(unsafeRes, GetRecentPrioritizationFeesRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get recent prioritization fees"); + } + return res.result; + } + /** + * Fetch a recent blockhash from the cluster + * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>} + * + * @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead. + */ + async getRecentBlockhash(commitment) { + try { + const res = await this.getRecentBlockhashAndContext(commitment); + return res.value; + } catch (e18) { + throw new Error("failed to get recent blockhash: " + e18); + } + } + /** + * Fetch the latest blockhash from the cluster + * @return {Promise} + */ + async getLatestBlockhash(commitmentOrConfig) { + try { + const res = await this.getLatestBlockhashAndContext(commitmentOrConfig); + return res.value; + } catch (e18) { + throw new Error("failed to get recent blockhash: " + e18); + } + } + /** + * Fetch the latest blockhash from the cluster + * @return {Promise} + */ + async getLatestBlockhashAndContext(commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs([], commitment, void 0, config2); + const unsafeRes = await this._rpcRequest("getLatestBlockhash", args); + const res = create(unsafeRes, GetLatestBlockhashRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get latest blockhash"); + } + return res.result; + } + /** + * Returns whether a blockhash is still valid or not + */ + async isBlockhashValid(blockhash, rawConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(rawConfig); + const args = this._buildArgs([blockhash], commitment, void 0, config2); + const unsafeRes = await this._rpcRequest("isBlockhashValid", args); + const res = create(unsafeRes, IsBlockhashValidRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to determine if the blockhash `" + blockhash + "`is valid"); + } + return res.result; + } + /** + * Fetch the node version + */ + async getVersion() { + const unsafeRes = await this._rpcRequest("getVersion", []); + const res = create(unsafeRes, jsonRpcResult(VersionResult)); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get version"); + } + return res.result; + } + /** + * Fetch the genesis hash + */ + async getGenesisHash() { + const unsafeRes = await this._rpcRequest("getGenesisHash", []); + const res = create(unsafeRes, jsonRpcResult(string())); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get genesis hash"); + } + return res.result; + } + /** + * Fetch a processed block from the cluster. + * + * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by + * setting the `maxSupportedTransactionVersion` property. + */ + /** + * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by + * setting the `maxSupportedTransactionVersion` property. + */ + // eslint-disable-next-line no-dupe-class-members + /** + * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by + * setting the `maxSupportedTransactionVersion` property. + */ + // eslint-disable-next-line no-dupe-class-members + /** + * Fetch a processed block from the cluster. + */ + // eslint-disable-next-line no-dupe-class-members + // eslint-disable-next-line no-dupe-class-members + // eslint-disable-next-line no-dupe-class-members + /** + * Fetch a processed block from the cluster. + */ + // eslint-disable-next-line no-dupe-class-members + async getBlock(slot, rawConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(rawConfig); + const args = this._buildArgsAtLeastConfirmed([slot], commitment, void 0, config2); + const unsafeRes = await this._rpcRequest("getBlock", args); + try { + switch (config2 == null ? void 0 : config2.transactionDetails) { + case "accounts": { + const res = create(unsafeRes, GetAccountsModeBlockRpcResult); + if ("error" in res) { + throw res.error; + } + return res.result; + } + case "none": { + const res = create(unsafeRes, GetNoneModeBlockRpcResult); + if ("error" in res) { + throw res.error; + } + return res.result; + } + default: { + const res = create(unsafeRes, GetBlockRpcResult); + if ("error" in res) { + throw res.error; + } + const { + result + } = res; + return result ? { + ...result, + transactions: result.transactions.map(({ + transaction: transaction2, + meta, + version: version2 + }) => ({ + meta, + transaction: { + ...transaction2, + message: versionedMessageFromResponse(version2, transaction2.message) + }, + version: version2 + })) + } : null; + } + } + } catch (e18) { + throw new SolanaJSONRPCError(e18, "failed to get confirmed block"); + } + } + /** + * Fetch parsed transaction details for a confirmed or finalized block + */ + // eslint-disable-next-line no-dupe-class-members + // eslint-disable-next-line no-dupe-class-members + // eslint-disable-next-line no-dupe-class-members + async getParsedBlock(slot, rawConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(rawConfig); + const args = this._buildArgsAtLeastConfirmed([slot], commitment, "jsonParsed", config2); + const unsafeRes = await this._rpcRequest("getBlock", args); + try { + switch (config2 == null ? void 0 : config2.transactionDetails) { + case "accounts": { + const res = create(unsafeRes, GetParsedAccountsModeBlockRpcResult); + if ("error" in res) { + throw res.error; + } + return res.result; + } + case "none": { + const res = create(unsafeRes, GetParsedNoneModeBlockRpcResult); + if ("error" in res) { + throw res.error; + } + return res.result; + } + default: { + const res = create(unsafeRes, GetParsedBlockRpcResult); + if ("error" in res) { + throw res.error; + } + return res.result; + } + } + } catch (e18) { + throw new SolanaJSONRPCError(e18, "failed to get block"); + } + } + /* + * Returns recent block production information from the current or previous epoch + */ + async getBlockProduction(configOrCommitment) { + let extra; + let commitment; + if (typeof configOrCommitment === "string") { + commitment = configOrCommitment; + } else if (configOrCommitment) { + const { + commitment: c2, + ...rest + } = configOrCommitment; + commitment = c2; + extra = rest; + } + const args = this._buildArgs([], commitment, "base64", extra); + const unsafeRes = await this._rpcRequest("getBlockProduction", args); + const res = create(unsafeRes, BlockProductionResponseStruct); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get block production information"); + } + return res.result; + } + /** + * Fetch a confirmed or finalized transaction from the cluster. + * + * @deprecated Instead, call `getTransaction` using a + * `GetVersionedTransactionConfig` by setting the + * `maxSupportedTransactionVersion` property. + */ + /** + * Fetch a confirmed or finalized transaction from the cluster. + */ + // eslint-disable-next-line no-dupe-class-members + /** + * Fetch a confirmed or finalized transaction from the cluster. + */ + // eslint-disable-next-line no-dupe-class-members + async getTransaction(signature2, rawConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(rawConfig); + const args = this._buildArgsAtLeastConfirmed([signature2], commitment, void 0, config2); + const unsafeRes = await this._rpcRequest("getTransaction", args); + const res = create(unsafeRes, GetTransactionRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get transaction"); + } + const result = res.result; + if (!result) + return result; + return { + ...result, + transaction: { + ...result.transaction, + message: versionedMessageFromResponse(result.version, result.transaction.message) + } + }; + } + /** + * Fetch parsed transaction details for a confirmed or finalized transaction + */ + async getParsedTransaction(signature2, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed", config2); + const unsafeRes = await this._rpcRequest("getTransaction", args); + const res = create(unsafeRes, GetParsedTransactionRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get transaction"); + } + return res.result; + } + /** + * Fetch parsed transaction details for a batch of confirmed transactions + */ + async getParsedTransactions(signatures, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const batch = signatures.map((signature2) => { + const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed", config2); + return { + methodName: "getTransaction", + args + }; + }); + const unsafeRes = await this._rpcBatchRequest(batch); + const res = unsafeRes.map((unsafeRes2) => { + const res2 = create(unsafeRes2, GetParsedTransactionRpcResult); + if ("error" in res2) { + throw new SolanaJSONRPCError(res2.error, "failed to get transactions"); + } + return res2.result; + }); + return res; + } + /** + * Fetch transaction details for a batch of confirmed transactions. + * Similar to {@link getParsedTransactions} but returns a {@link TransactionResponse}. + * + * @deprecated Instead, call `getTransactions` using a + * `GetVersionedTransactionConfig` by setting the + * `maxSupportedTransactionVersion` property. + */ + /** + * Fetch transaction details for a batch of confirmed transactions. + * Similar to {@link getParsedTransactions} but returns a {@link + * VersionedTransactionResponse}. + */ + // eslint-disable-next-line no-dupe-class-members + /** + * Fetch transaction details for a batch of confirmed transactions. + * Similar to {@link getParsedTransactions} but returns a {@link + * VersionedTransactionResponse}. + */ + // eslint-disable-next-line no-dupe-class-members + async getTransactions(signatures, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const batch = signatures.map((signature2) => { + const args = this._buildArgsAtLeastConfirmed([signature2], commitment, void 0, config2); + return { + methodName: "getTransaction", + args + }; + }); + const unsafeRes = await this._rpcBatchRequest(batch); + const res = unsafeRes.map((unsafeRes2) => { + const res2 = create(unsafeRes2, GetTransactionRpcResult); + if ("error" in res2) { + throw new SolanaJSONRPCError(res2.error, "failed to get transactions"); + } + const result = res2.result; + if (!result) + return result; + return { + ...result, + transaction: { + ...result.transaction, + message: versionedMessageFromResponse(result.version, result.transaction.message) + } + }; + }); + return res; + } + /** + * Fetch a list of Transactions and transaction statuses from the cluster + * for a confirmed block. + * + * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead. + */ + async getConfirmedBlock(slot, commitment) { + const args = this._buildArgsAtLeastConfirmed([slot], commitment); + const unsafeRes = await this._rpcRequest("getConfirmedBlock", args); + const res = create(unsafeRes, GetConfirmedBlockRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get confirmed block"); + } + const result = res.result; + if (!result) { + throw new Error("Confirmed block " + slot + " not found"); + } + const block = { + ...result, + transactions: result.transactions.map(({ + transaction: transaction2, + meta + }) => { + const message2 = new Message(transaction2.message); + return { + meta, + transaction: { + ...transaction2, + message: message2 + } + }; + }) + }; + return { + ...block, + transactions: block.transactions.map(({ + transaction: transaction2, + meta + }) => { + return { + meta, + transaction: Transaction$2.populate(transaction2.message, transaction2.signatures) + }; + }) + }; + } + /** + * Fetch confirmed blocks between two slots + */ + async getBlocks(startSlot, endSlot, commitment) { + const args = this._buildArgsAtLeastConfirmed(endSlot !== void 0 ? [startSlot, endSlot] : [startSlot], commitment); + const unsafeRes = await this._rpcRequest("getBlocks", args); + const res = create(unsafeRes, jsonRpcResult(array(number$1()))); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get blocks"); + } + return res.result; + } + /** + * Fetch a list of Signatures from the cluster for a block, excluding rewards + */ + async getBlockSignatures(slot, commitment) { + const args = this._buildArgsAtLeastConfirmed([slot], commitment, void 0, { + transactionDetails: "signatures", + rewards: false + }); + const unsafeRes = await this._rpcRequest("getBlock", args); + const res = create(unsafeRes, GetBlockSignaturesRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get block"); + } + const result = res.result; + if (!result) { + throw new Error("Block " + slot + " not found"); + } + return result; + } + /** + * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards + * + * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead. + */ + async getConfirmedBlockSignatures(slot, commitment) { + const args = this._buildArgsAtLeastConfirmed([slot], commitment, void 0, { + transactionDetails: "signatures", + rewards: false + }); + const unsafeRes = await this._rpcRequest("getConfirmedBlock", args); + const res = create(unsafeRes, GetBlockSignaturesRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get confirmed block"); + } + const result = res.result; + if (!result) { + throw new Error("Confirmed block " + slot + " not found"); + } + return result; + } + /** + * Fetch a transaction details for a confirmed transaction + * + * @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead. + */ + async getConfirmedTransaction(signature2, commitment) { + const args = this._buildArgsAtLeastConfirmed([signature2], commitment); + const unsafeRes = await this._rpcRequest("getConfirmedTransaction", args); + const res = create(unsafeRes, GetTransactionRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get transaction"); + } + const result = res.result; + if (!result) + return result; + const message2 = new Message(result.transaction.message); + const signatures = result.transaction.signatures; + return { + ...result, + transaction: Transaction$2.populate(message2, signatures) + }; + } + /** + * Fetch parsed transaction details for a confirmed transaction + * + * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead. + */ + async getParsedConfirmedTransaction(signature2, commitment) { + const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed"); + const unsafeRes = await this._rpcRequest("getConfirmedTransaction", args); + const res = create(unsafeRes, GetParsedTransactionRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get confirmed transaction"); + } + return res.result; + } + /** + * Fetch parsed transaction details for a batch of confirmed transactions + * + * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead. + */ + async getParsedConfirmedTransactions(signatures, commitment) { + const batch = signatures.map((signature2) => { + const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed"); + return { + methodName: "getConfirmedTransaction", + args + }; + }); + const unsafeRes = await this._rpcBatchRequest(batch); + const res = unsafeRes.map((unsafeRes2) => { + const res2 = create(unsafeRes2, GetParsedTransactionRpcResult); + if ("error" in res2) { + throw new SolanaJSONRPCError(res2.error, "failed to get confirmed transactions"); + } + return res2.result; + }); + return res; + } + /** + * Fetch a list of all the confirmed signatures for transactions involving an address + * within a specified slot range. Max range allowed is 10,000 slots. + * + * @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead. + * + * @param address queried address + * @param startSlot start slot, inclusive + * @param endSlot end slot, inclusive + */ + async getConfirmedSignaturesForAddress(address2, startSlot, endSlot) { + let options = {}; + let firstAvailableBlock = await this.getFirstAvailableBlock(); + while (!("until" in options)) { + startSlot--; + if (startSlot <= 0 || startSlot < firstAvailableBlock) { + break; + } + try { + const block = await this.getConfirmedBlockSignatures(startSlot, "finalized"); + if (block.signatures.length > 0) { + options.until = block.signatures[block.signatures.length - 1].toString(); + } + } catch (err) { + if (err instanceof Error && err.message.includes("skipped")) { + continue; + } else { + throw err; + } + } + } + let highestConfirmedRoot = await this.getSlot("finalized"); + while (!("before" in options)) { + endSlot++; + if (endSlot > highestConfirmedRoot) { + break; + } + try { + const block = await this.getConfirmedBlockSignatures(endSlot); + if (block.signatures.length > 0) { + options.before = block.signatures[block.signatures.length - 1].toString(); + } + } catch (err) { + if (err instanceof Error && err.message.includes("skipped")) { + continue; + } else { + throw err; + } + } + } + const confirmedSignatureInfo = await this.getConfirmedSignaturesForAddress2(address2, options); + return confirmedSignatureInfo.map((info) => info.signature); + } + /** + * Returns confirmed signatures for transactions involving an + * address backwards in time from the provided signature or most recent confirmed block + * + * @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead. + */ + async getConfirmedSignaturesForAddress2(address2, options, commitment) { + const args = this._buildArgsAtLeastConfirmed([address2.toBase58()], commitment, void 0, options); + const unsafeRes = await this._rpcRequest("getConfirmedSignaturesForAddress2", args); + const res = create(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get confirmed signatures for address"); + } + return res.result; + } + /** + * Returns confirmed signatures for transactions involving an + * address backwards in time from the provided signature or most recent confirmed block + * + * + * @param address queried address + * @param options + */ + async getSignaturesForAddress(address2, options, commitment) { + const args = this._buildArgsAtLeastConfirmed([address2.toBase58()], commitment, void 0, options); + const unsafeRes = await this._rpcRequest("getSignaturesForAddress", args); + const res = create(unsafeRes, GetSignaturesForAddressRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, "failed to get signatures for address"); + } + return res.result; + } + async getAddressLookupTable(accountKey, config2) { + const { + context, + value: accountInfo + } = await this.getAccountInfoAndContext(accountKey, config2); + let value = null; + if (accountInfo !== null) { + value = new AddressLookupTableAccount({ + key: accountKey, + state: AddressLookupTableAccount.deserialize(accountInfo.data) + }); + } + return { + context, + value + }; + } + /** + * Fetch the contents of a Nonce account from the cluster, return with context + */ + async getNonceAndContext(nonceAccount, commitmentOrConfig) { + const { + context, + value: accountInfo + } = await this.getAccountInfoAndContext(nonceAccount, commitmentOrConfig); + let value = null; + if (accountInfo !== null) { + value = NonceAccount.fromAccountData(accountInfo.data); + } + return { + context, + value + }; + } + /** + * Fetch the contents of a Nonce account from the cluster + */ + async getNonce(nonceAccount, commitmentOrConfig) { + return await this.getNonceAndContext(nonceAccount, commitmentOrConfig).then((x3) => x3.value).catch((e18) => { + throw new Error("failed to get nonce for account " + nonceAccount.toBase58() + ": " + e18); + }); + } + /** + * Request an allocation of lamports to the specified address + * + * ```typescript + * import { Connection, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js"; + * + * (async () => { + * const connection = new Connection("https://api.testnet.solana.com", "confirmed"); + * const myAddress = new PublicKey("2nr1bHFT86W9tGnyvmYW4vcHKsQB3sVQfnddasz4kExM"); + * const signature = await connection.requestAirdrop(myAddress, LAMPORTS_PER_SOL); + * await connection.confirmTransaction(signature); + * })(); + * ``` + */ + async requestAirdrop(to2, lamports) { + const unsafeRes = await this._rpcRequest("requestAirdrop", [to2.toBase58(), lamports]); + const res = create(unsafeRes, RequestAirdropRpcResult); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `airdrop to ${to2.toBase58()} failed`); + } + return res.result; + } + /** + * @internal + */ + async _blockhashWithExpiryBlockHeight(disableCache) { + if (!disableCache) { + while (this._pollingBlockhash) { + await sleep$1(100); + } + const timeSinceFetch = Date.now() - this._blockhashInfo.lastFetch; + const expired = timeSinceFetch >= BLOCKHASH_CACHE_TIMEOUT_MS; + if (this._blockhashInfo.latestBlockhash !== null && !expired) { + return this._blockhashInfo.latestBlockhash; + } + } + return await this._pollNewBlockhash(); + } + /** + * @internal + */ + async _pollNewBlockhash() { + this._pollingBlockhash = true; + try { + const startTime = Date.now(); + const cachedLatestBlockhash = this._blockhashInfo.latestBlockhash; + const cachedBlockhash = cachedLatestBlockhash ? cachedLatestBlockhash.blockhash : null; + for (let i2 = 0; i2 < 50; i2++) { + const latestBlockhash = await this.getLatestBlockhash("finalized"); + if (cachedBlockhash !== latestBlockhash.blockhash) { + this._blockhashInfo = { + latestBlockhash, + lastFetch: Date.now(), + transactionSignatures: [], + simulatedSignatures: [] + }; + return latestBlockhash; + } + await sleep$1(MS_PER_SLOT / 2); + } + throw new Error(`Unable to obtain a new blockhash after ${Date.now() - startTime}ms`); + } finally { + this._pollingBlockhash = false; + } + } + /** + * get the stake minimum delegation + */ + async getStakeMinimumDelegation(config2) { + const { + commitment, + config: configArg + } = extractCommitmentFromConfig(config2); + const args = this._buildArgs([], commitment, "base64", configArg); + const unsafeRes = await this._rpcRequest("getStakeMinimumDelegation", args); + const res = create(unsafeRes, jsonRpcResultAndContext(number$1())); + if ("error" in res) { + throw new SolanaJSONRPCError(res.error, `failed to get stake minimum delegation`); + } + return res.result; + } + /** + * Simulate a transaction + * + * @deprecated Instead, call {@link simulateTransaction} with {@link + * VersionedTransaction} and {@link SimulateTransactionConfig} parameters + */ + /** + * Simulate a transaction + */ + // eslint-disable-next-line no-dupe-class-members + /** + * Simulate a transaction + */ + // eslint-disable-next-line no-dupe-class-members + async simulateTransaction(transactionOrMessage, configOrSigners, includeAccounts) { + if ("message" in transactionOrMessage) { + const versionedTx = transactionOrMessage; + const wireTransaction2 = versionedTx.serialize(); + const encodedTransaction2 = buffer.Buffer.from(wireTransaction2).toString("base64"); + if (Array.isArray(configOrSigners) || includeAccounts !== void 0) { + throw new Error("Invalid arguments"); + } + const config3 = configOrSigners || {}; + config3.encoding = "base64"; + if (!("commitment" in config3)) { + config3.commitment = this.commitment; + } + if (configOrSigners && typeof configOrSigners === "object" && "innerInstructions" in configOrSigners) { + config3.innerInstructions = configOrSigners.innerInstructions; + } + const args2 = [encodedTransaction2, config3]; + const unsafeRes2 = await this._rpcRequest("simulateTransaction", args2); + const res2 = create(unsafeRes2, SimulatedTransactionResponseStruct); + if ("error" in res2) { + throw new Error("failed to simulate transaction: " + res2.error.message); + } + return res2.result; + } + let transaction2; + if (transactionOrMessage instanceof Transaction$2) { + let originalTx = transactionOrMessage; + transaction2 = new Transaction$2(); + transaction2.feePayer = originalTx.feePayer; + transaction2.instructions = transactionOrMessage.instructions; + transaction2.nonceInfo = originalTx.nonceInfo; + transaction2.signatures = originalTx.signatures; + } else { + transaction2 = Transaction$2.populate(transactionOrMessage); + transaction2._message = transaction2._json = void 0; + } + if (configOrSigners !== void 0 && !Array.isArray(configOrSigners)) { + throw new Error("Invalid arguments"); + } + const signers = configOrSigners; + if (transaction2.nonceInfo && signers) { + transaction2.sign(...signers); + } else { + let disableCache = this._disableBlockhashCaching; + for (; ; ) { + const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache); + transaction2.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight; + transaction2.recentBlockhash = latestBlockhash.blockhash; + if (!signers) + break; + transaction2.sign(...signers); + if (!transaction2.signature) { + throw new Error("!signature"); + } + const signature2 = transaction2.signature.toString("base64"); + if (!this._blockhashInfo.simulatedSignatures.includes(signature2) && !this._blockhashInfo.transactionSignatures.includes(signature2)) { + this._blockhashInfo.simulatedSignatures.push(signature2); + break; + } else { + disableCache = true; + } + } + } + const message2 = transaction2._compile(); + const signData = message2.serialize(); + const wireTransaction = transaction2._serialize(signData); + const encodedTransaction = wireTransaction.toString("base64"); + const config2 = { + encoding: "base64", + commitment: this.commitment + }; + if (includeAccounts) { + const addresses = (Array.isArray(includeAccounts) ? includeAccounts : message2.nonProgramIds()).map((key2) => key2.toBase58()); + config2["accounts"] = { + encoding: "base64", + addresses + }; + } + if (signers) { + config2.sigVerify = true; + } + if (configOrSigners && typeof configOrSigners === "object" && "innerInstructions" in configOrSigners) { + config2.innerInstructions = configOrSigners.innerInstructions; + } + const args = [encodedTransaction, config2]; + const unsafeRes = await this._rpcRequest("simulateTransaction", args); + const res = create(unsafeRes, SimulatedTransactionResponseStruct); + if ("error" in res) { + let logs; + if ("data" in res.error) { + logs = res.error.data.logs; + if (logs && Array.isArray(logs)) { + const traceIndent = "\n "; + const logTrace = traceIndent + logs.join(traceIndent); + console.error(res.error.message, logTrace); + } + } + throw new SendTransactionError({ + action: "simulate", + signature: "", + transactionMessage: res.error.message, + logs + }); + } + return res.result; + } + /** + * Sign and send a transaction + * + * @deprecated Instead, call {@link sendTransaction} with a {@link + * VersionedTransaction} + */ + /** + * Send a signed transaction + */ + // eslint-disable-next-line no-dupe-class-members + /** + * Sign and send a transaction + */ + // eslint-disable-next-line no-dupe-class-members + async sendTransaction(transaction2, signersOrOptions, options) { + if ("version" in transaction2) { + if (signersOrOptions && Array.isArray(signersOrOptions)) { + throw new Error("Invalid arguments"); + } + const wireTransaction2 = transaction2.serialize(); + return await this.sendRawTransaction(wireTransaction2, signersOrOptions); + } + if (signersOrOptions === void 0 || !Array.isArray(signersOrOptions)) { + throw new Error("Invalid arguments"); + } + const signers = signersOrOptions; + if (transaction2.nonceInfo) { + transaction2.sign(...signers); + } else { + let disableCache = this._disableBlockhashCaching; + for (; ; ) { + const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache); + transaction2.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight; + transaction2.recentBlockhash = latestBlockhash.blockhash; + transaction2.sign(...signers); + if (!transaction2.signature) { + throw new Error("!signature"); + } + const signature2 = transaction2.signature.toString("base64"); + if (!this._blockhashInfo.transactionSignatures.includes(signature2)) { + this._blockhashInfo.transactionSignatures.push(signature2); + break; + } else { + disableCache = true; + } + } + } + const wireTransaction = transaction2.serialize(); + return await this.sendRawTransaction(wireTransaction, options); + } + /** + * Send a transaction that has already been signed and serialized into the + * wire format + */ + async sendRawTransaction(rawTransaction, options) { + const encodedTransaction = toBuffer(rawTransaction).toString("base64"); + const result = await this.sendEncodedTransaction(encodedTransaction, options); + return result; + } + /** + * Send a transaction that has already been signed, serialized into the + * wire format, and encoded as a base64 string + */ + async sendEncodedTransaction(encodedTransaction, options) { + const config2 = { + encoding: "base64" + }; + const skipPreflight = options && options.skipPreflight; + const preflightCommitment = skipPreflight === true ? "processed" : options && options.preflightCommitment || this.commitment; + if (options && options.maxRetries != null) { + config2.maxRetries = options.maxRetries; + } + if (options && options.minContextSlot != null) { + config2.minContextSlot = options.minContextSlot; + } + if (skipPreflight) { + config2.skipPreflight = skipPreflight; + } + if (preflightCommitment) { + config2.preflightCommitment = preflightCommitment; + } + const args = [encodedTransaction, config2]; + const unsafeRes = await this._rpcRequest("sendTransaction", args); + const res = create(unsafeRes, SendTransactionRpcResult); + if ("error" in res) { + let logs = void 0; + if ("data" in res.error) { + logs = res.error.data.logs; + } + throw new SendTransactionError({ + action: skipPreflight ? "send" : "simulate", + signature: "", + transactionMessage: res.error.message, + logs + }); + } + return res.result; + } + /** + * @internal + */ + _wsOnOpen() { + this._rpcWebSocketConnected = true; + this._rpcWebSocketHeartbeat = setInterval(() => { + (async () => { + try { + await this._rpcWebSocket.notify("ping"); + } catch { + } + })(); + }, 5e3); + this._updateSubscriptions(); + } + /** + * @internal + */ + _wsOnError(err) { + this._rpcWebSocketConnected = false; + console.error("ws error:", err.message); + } + /** + * @internal + */ + _wsOnClose(code2) { + this._rpcWebSocketConnected = false; + this._rpcWebSocketGeneration = (this._rpcWebSocketGeneration + 1) % Number.MAX_SAFE_INTEGER; + if (this._rpcWebSocketIdleTimeout) { + clearTimeout(this._rpcWebSocketIdleTimeout); + this._rpcWebSocketIdleTimeout = null; + } + if (this._rpcWebSocketHeartbeat) { + clearInterval(this._rpcWebSocketHeartbeat); + this._rpcWebSocketHeartbeat = null; + } + if (code2 === 1e3) { + this._updateSubscriptions(); + return; + } + this._subscriptionCallbacksByServerSubscriptionId = {}; + Object.entries(this._subscriptionsByHash).forEach(([hash3, subscription]) => { + this._setSubscription(hash3, { + ...subscription, + state: "pending" + }); + }); + } + /** + * @internal + */ + _setSubscription(hash3, nextSubscription) { + var _a3; + const prevState = (_a3 = this._subscriptionsByHash[hash3]) == null ? void 0 : _a3.state; + this._subscriptionsByHash[hash3] = nextSubscription; + if (prevState !== nextSubscription.state) { + const stateChangeCallbacks = this._subscriptionStateChangeCallbacksByHash[hash3]; + if (stateChangeCallbacks) { + stateChangeCallbacks.forEach((cb2) => { + try { + cb2(nextSubscription.state); + } catch { + } + }); + } + } + } + /** + * @internal + */ + _onSubscriptionStateChange(clientSubscriptionId, callback) { + var _a3; + const hash3 = this._subscriptionHashByClientSubscriptionId[clientSubscriptionId]; + if (hash3 == null) { + return () => { + }; + } + const stateChangeCallbacks = (_a3 = this._subscriptionStateChangeCallbacksByHash)[hash3] || (_a3[hash3] = /* @__PURE__ */ new Set()); + stateChangeCallbacks.add(callback); + return () => { + stateChangeCallbacks.delete(callback); + if (stateChangeCallbacks.size === 0) { + delete this._subscriptionStateChangeCallbacksByHash[hash3]; + } + }; + } + /** + * @internal + */ + async _updateSubscriptions() { + if (Object.keys(this._subscriptionsByHash).length === 0) { + if (this._rpcWebSocketConnected) { + this._rpcWebSocketConnected = false; + this._rpcWebSocketIdleTimeout = setTimeout(() => { + this._rpcWebSocketIdleTimeout = null; + try { + this._rpcWebSocket.close(); + } catch (err) { + if (err instanceof Error) { + console.log(`Error when closing socket connection: ${err.message}`); + } + } + }, 500); + } + return; + } + if (this._rpcWebSocketIdleTimeout !== null) { + clearTimeout(this._rpcWebSocketIdleTimeout); + this._rpcWebSocketIdleTimeout = null; + this._rpcWebSocketConnected = true; + } + if (!this._rpcWebSocketConnected) { + this._rpcWebSocket.connect(); + return; + } + const activeWebSocketGeneration = this._rpcWebSocketGeneration; + const isCurrentConnectionStillActive = () => { + return activeWebSocketGeneration === this._rpcWebSocketGeneration; + }; + await Promise.all( + // Don't be tempted to change this to `Object.entries`. We call + // `_updateSubscriptions` recursively when processing the state, + // so it's important that we look up the *current* version of + // each subscription, every time we process a hash. + Object.keys(this._subscriptionsByHash).map(async (hash3) => { + const subscription = this._subscriptionsByHash[hash3]; + if (subscription === void 0) { + return; + } + switch (subscription.state) { + case "pending": + case "unsubscribed": + if (subscription.callbacks.size === 0) { + delete this._subscriptionsByHash[hash3]; + if (subscription.state === "unsubscribed") { + delete this._subscriptionCallbacksByServerSubscriptionId[subscription.serverSubscriptionId]; + } + await this._updateSubscriptions(); + return; + } + await (async () => { + const { + args, + method + } = subscription; + try { + this._setSubscription(hash3, { + ...subscription, + state: "subscribing" + }); + const serverSubscriptionId = await this._rpcWebSocket.call(method, args); + this._setSubscription(hash3, { + ...subscription, + serverSubscriptionId, + state: "subscribed" + }); + this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId] = subscription.callbacks; + await this._updateSubscriptions(); + } catch (e18) { + console.error(`Received ${e18 instanceof Error ? "" : "JSON-RPC "}error calling \`${method}\``, { + args, + error: e18 + }); + if (!isCurrentConnectionStillActive()) { + return; + } + this._setSubscription(hash3, { + ...subscription, + state: "pending" + }); + await this._updateSubscriptions(); + } + })(); + break; + case "subscribed": + if (subscription.callbacks.size === 0) { + await (async () => { + const { + serverSubscriptionId, + unsubscribeMethod + } = subscription; + if (this._subscriptionsAutoDisposedByRpc.has(serverSubscriptionId)) { + this._subscriptionsAutoDisposedByRpc.delete(serverSubscriptionId); + } else { + this._setSubscription(hash3, { + ...subscription, + state: "unsubscribing" + }); + this._setSubscription(hash3, { + ...subscription, + state: "unsubscribing" + }); + try { + await this._rpcWebSocket.call(unsubscribeMethod, [serverSubscriptionId]); + } catch (e18) { + if (e18 instanceof Error) { + console.error(`${unsubscribeMethod} error:`, e18.message); + } + if (!isCurrentConnectionStillActive()) { + return; + } + this._setSubscription(hash3, { + ...subscription, + state: "subscribed" + }); + await this._updateSubscriptions(); + return; + } + } + this._setSubscription(hash3, { + ...subscription, + state: "unsubscribed" + }); + await this._updateSubscriptions(); + })(); + } + break; + } + }) + ); + } + /** + * @internal + */ + _handleServerNotification(serverSubscriptionId, callbackArgs) { + const callbacks = this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId]; + if (callbacks === void 0) { + return; + } + callbacks.forEach((cb2) => { + try { + cb2( + ...callbackArgs + ); + } catch (e18) { + console.error(e18); + } + }); + } + /** + * @internal + */ + _wsOnAccountNotification(notification) { + const { + result, + subscription + } = create(notification, AccountNotificationResult); + this._handleServerNotification(subscription, [result.value, result.context]); + } + /** + * @internal + */ + _makeSubscription(subscriptionConfig, args) { + const clientSubscriptionId = this._nextClientSubscriptionId++; + const hash3 = fastStableStringify([subscriptionConfig.method, args]); + const existingSubscription = this._subscriptionsByHash[hash3]; + if (existingSubscription === void 0) { + this._subscriptionsByHash[hash3] = { + ...subscriptionConfig, + args, + callbacks: /* @__PURE__ */ new Set([subscriptionConfig.callback]), + state: "pending" + }; + } else { + existingSubscription.callbacks.add(subscriptionConfig.callback); + } + this._subscriptionHashByClientSubscriptionId[clientSubscriptionId] = hash3; + this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId] = async () => { + delete this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId]; + delete this._subscriptionHashByClientSubscriptionId[clientSubscriptionId]; + const subscription = this._subscriptionsByHash[hash3]; + assert$1(subscription !== void 0, `Could not find a \`Subscription\` when tearing down client subscription #${clientSubscriptionId}`); + subscription.callbacks.delete(subscriptionConfig.callback); + await this._updateSubscriptions(); + }; + this._updateSubscriptions(); + return clientSubscriptionId; + } + /** + * Register a callback to be invoked whenever the specified account changes + * + * @param publicKey Public key of the account to monitor + * @param callback Function to invoke whenever the account is changed + * @param config + * @return subscription id + */ + /** @deprecated Instead, pass in an {@link AccountSubscriptionConfig} */ + // eslint-disable-next-line no-dupe-class-members + // eslint-disable-next-line no-dupe-class-members + onAccountChange(publicKey2, callback, commitmentOrConfig) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs( + [publicKey2.toBase58()], + commitment || this._commitment || "finalized", + // Apply connection/server default. + "base64", + config2 + ); + return this._makeSubscription({ + callback, + method: "accountSubscribe", + unsubscribeMethod: "accountUnsubscribe" + }, args); + } + /** + * Deregister an account notification callback + * + * @param clientSubscriptionId client subscription id to deregister + */ + async removeAccountChangeListener(clientSubscriptionId) { + await this._unsubscribeClientSubscription(clientSubscriptionId, "account change"); + } + /** + * @internal + */ + _wsOnProgramAccountNotification(notification) { + const { + result, + subscription + } = create(notification, ProgramAccountNotificationResult); + this._handleServerNotification(subscription, [{ + accountId: result.value.pubkey, + accountInfo: result.value.account + }, result.context]); + } + /** + * Register a callback to be invoked whenever accounts owned by the + * specified program change + * + * @param programId Public key of the program to monitor + * @param callback Function to invoke whenever the account is changed + * @param config + * @return subscription id + */ + /** @deprecated Instead, pass in a {@link ProgramAccountSubscriptionConfig} */ + // eslint-disable-next-line no-dupe-class-members + // eslint-disable-next-line no-dupe-class-members + onProgramAccountChange(programId, callback, commitmentOrConfig, maybeFilters) { + const { + commitment, + config: config2 + } = extractCommitmentFromConfig(commitmentOrConfig); + const args = this._buildArgs( + [programId.toBase58()], + commitment || this._commitment || "finalized", + // Apply connection/server default. + "base64", + config2 ? config2 : maybeFilters ? { + filters: applyDefaultMemcmpEncodingToFilters(maybeFilters) + } : void 0 + /* extra */ + ); + return this._makeSubscription({ + callback, + method: "programSubscribe", + unsubscribeMethod: "programUnsubscribe" + }, args); + } + /** + * Deregister an account notification callback + * + * @param clientSubscriptionId client subscription id to deregister + */ + async removeProgramAccountChangeListener(clientSubscriptionId) { + await this._unsubscribeClientSubscription(clientSubscriptionId, "program account change"); + } + /** + * Registers a callback to be invoked whenever logs are emitted. + */ + onLogs(filter2, callback, commitment) { + const args = this._buildArgs( + [typeof filter2 === "object" ? { + mentions: [filter2.toString()] + } : filter2], + commitment || this._commitment || "finalized" + // Apply connection/server default. + ); + return this._makeSubscription({ + callback, + method: "logsSubscribe", + unsubscribeMethod: "logsUnsubscribe" + }, args); + } + /** + * Deregister a logs callback. + * + * @param clientSubscriptionId client subscription id to deregister. + */ + async removeOnLogsListener(clientSubscriptionId) { + await this._unsubscribeClientSubscription(clientSubscriptionId, "logs"); + } + /** + * @internal + */ + _wsOnLogsNotification(notification) { + const { + result, + subscription + } = create(notification, LogsNotificationResult); + this._handleServerNotification(subscription, [result.value, result.context]); + } + /** + * @internal + */ + _wsOnSlotNotification(notification) { + const { + result, + subscription + } = create(notification, SlotNotificationResult); + this._handleServerNotification(subscription, [result]); + } + /** + * Register a callback to be invoked upon slot changes + * + * @param callback Function to invoke whenever the slot changes + * @return subscription id + */ + onSlotChange(callback) { + return this._makeSubscription( + { + callback, + method: "slotSubscribe", + unsubscribeMethod: "slotUnsubscribe" + }, + [] + /* args */ + ); + } + /** + * Deregister a slot notification callback + * + * @param clientSubscriptionId client subscription id to deregister + */ + async removeSlotChangeListener(clientSubscriptionId) { + await this._unsubscribeClientSubscription(clientSubscriptionId, "slot change"); + } + /** + * @internal + */ + _wsOnSlotUpdatesNotification(notification) { + const { + result, + subscription + } = create(notification, SlotUpdateNotificationResult); + this._handleServerNotification(subscription, [result]); + } + /** + * Register a callback to be invoked upon slot updates. {@link SlotUpdate}'s + * may be useful to track live progress of a cluster. + * + * @param callback Function to invoke whenever the slot updates + * @return subscription id + */ + onSlotUpdate(callback) { + return this._makeSubscription( + { + callback, + method: "slotsUpdatesSubscribe", + unsubscribeMethod: "slotsUpdatesUnsubscribe" + }, + [] + /* args */ + ); + } + /** + * Deregister a slot update notification callback + * + * @param clientSubscriptionId client subscription id to deregister + */ + async removeSlotUpdateListener(clientSubscriptionId) { + await this._unsubscribeClientSubscription(clientSubscriptionId, "slot update"); + } + /** + * @internal + */ + async _unsubscribeClientSubscription(clientSubscriptionId, subscriptionName) { + const dispose2 = this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId]; + if (dispose2) { + await dispose2(); + } else { + console.warn(`Ignored unsubscribe request because an active subscription with id \`${clientSubscriptionId}\` for '${subscriptionName}' events could not be found.`); + } + } + _buildArgs(args, override, encoding2, extra) { + const commitment = override || this._commitment; + if (commitment || encoding2 || extra) { + let options = {}; + if (encoding2) { + options.encoding = encoding2; + } + if (commitment) { + options.commitment = commitment; + } + if (extra) { + options = Object.assign(options, extra); + } + args.push(options); + } + return args; + } + /** + * @internal + */ + _buildArgsAtLeastConfirmed(args, override, encoding2, extra) { + const commitment = override || this._commitment; + if (commitment && !["confirmed", "finalized"].includes(commitment)) { + throw new Error("Using Connection with default commitment: `" + this._commitment + "`, but method requires at least `confirmed`"); + } + return this._buildArgs(args, override, encoding2, extra); + } + /** + * @internal + */ + _wsOnSignatureNotification(notification) { + const { + result, + subscription + } = create(notification, SignatureNotificationResult); + if (result.value !== "receivedSignature") { + this._subscriptionsAutoDisposedByRpc.add(subscription); + } + this._handleServerNotification(subscription, result.value === "receivedSignature" ? [{ + type: "received" + }, result.context] : [{ + type: "status", + result: result.value + }, result.context]); + } + /** + * Register a callback to be invoked upon signature updates + * + * @param signature Transaction signature string in base 58 + * @param callback Function to invoke on signature notifications + * @param commitment Specify the commitment level signature must reach before notification + * @return subscription id + */ + onSignature(signature2, callback, commitment) { + const args = this._buildArgs( + [signature2], + commitment || this._commitment || "finalized" + // Apply connection/server default. + ); + const clientSubscriptionId = this._makeSubscription({ + callback: (notification, context) => { + if (notification.type === "status") { + callback(notification.result, context); + try { + this.removeSignatureListener(clientSubscriptionId); + } catch (_err) { + } + } + }, + method: "signatureSubscribe", + unsubscribeMethod: "signatureUnsubscribe" + }, args); + return clientSubscriptionId; + } + /** + * Register a callback to be invoked when a transaction is + * received and/or processed. + * + * @param signature Transaction signature string in base 58 + * @param callback Function to invoke on signature notifications + * @param options Enable received notifications and set the commitment + * level that signature must reach before notification + * @return subscription id + */ + onSignatureWithOptions(signature2, callback, options) { + const { + commitment, + ...extra + } = { + ...options, + commitment: options && options.commitment || this._commitment || "finalized" + // Apply connection/server default. + }; + const args = this._buildArgs([signature2], commitment, void 0, extra); + const clientSubscriptionId = this._makeSubscription({ + callback: (notification, context) => { + callback(notification, context); + try { + this.removeSignatureListener(clientSubscriptionId); + } catch (_err) { + } + }, + method: "signatureSubscribe", + unsubscribeMethod: "signatureUnsubscribe" + }, args); + return clientSubscriptionId; + } + /** + * Deregister a signature notification callback + * + * @param clientSubscriptionId client subscription id to deregister + */ + async removeSignatureListener(clientSubscriptionId) { + await this._unsubscribeClientSubscription(clientSubscriptionId, "signature result"); + } + /** + * @internal + */ + _wsOnRootNotification(notification) { + const { + result, + subscription + } = create(notification, RootNotificationResult); + this._handleServerNotification(subscription, [result]); + } + /** + * Register a callback to be invoked upon root changes + * + * @param callback Function to invoke whenever the root changes + * @return subscription id + */ + onRootChange(callback) { + return this._makeSubscription( + { + callback, + method: "rootSubscribe", + unsubscribeMethod: "rootUnsubscribe" + }, + [] + /* args */ + ); + } + /** + * Deregister a root notification callback + * + * @param clientSubscriptionId client subscription id to deregister + */ + async removeRootChangeListener(clientSubscriptionId) { + await this._unsubscribeClientSubscription(clientSubscriptionId, "root change"); + } +} +Object.freeze({ + CreateLookupTable: { + index: 0, + layout: struct([u32$1("instruction"), u64$2("recentSlot"), u8("bumpSeed")]) + }, + FreezeLookupTable: { + index: 1, + layout: struct([u32$1("instruction")]) + }, + ExtendLookupTable: { + index: 2, + layout: struct([u32$1("instruction"), u64$2(), seq(publicKey(), offset(u32$1(), -8), "addresses")]) + }, + DeactivateLookupTable: { + index: 3, + layout: struct([u32$1("instruction")]) + }, + CloseLookupTable: { + index: 4, + layout: struct([u32$1("instruction")]) + } +}); +new PublicKey("AddressLookupTab1e1111111111111111111111111"); +Object.freeze({ + RequestUnits: { + index: 0, + layout: struct([u8("instruction"), u32$1("units"), u32$1("additionalFee")]) + }, + RequestHeapFrame: { + index: 1, + layout: struct([u8("instruction"), u32$1("bytes")]) + }, + SetComputeUnitLimit: { + index: 2, + layout: struct([u8("instruction"), u32$1("units")]) + }, + SetComputeUnitPrice: { + index: 3, + layout: struct([u8("instruction"), u64$2("microLamports")]) + } +}); +new PublicKey("ComputeBudget111111111111111111111111111111"); +struct([u8("numSignatures"), u8("padding"), u16("signatureOffset"), u16("signatureInstructionIndex"), u16("publicKeyOffset"), u16("publicKeyInstructionIndex"), u16("messageDataOffset"), u16("messageDataSize"), u16("messageInstructionIndex")]); +new PublicKey("Ed25519SigVerify111111111111111111111111111"); +secp256k1$1.utils.isValidPrivateKey; +secp256k1$1.getPublicKey; +struct([u8("numSignatures"), u16("signatureOffset"), u8("signatureInstructionIndex"), u16("ethAddressOffset"), u8("ethAddressInstructionIndex"), u16("messageDataOffset"), u16("messageDataSize"), u8("messageInstructionIndex"), blob(20, "ethAddress"), blob(64, "signature"), u8("recoveryId")]); +new PublicKey("KeccakSecp256k11111111111111111111111111111"); +var _Lockup; +new PublicKey("StakeConfig11111111111111111111111111111111"); +class Lockup { + /** + * Create a new Lockup object + */ + constructor(unixTimestamp, epoch, custodian) { + this.unixTimestamp = void 0; + this.epoch = void 0; + this.custodian = void 0; + this.unixTimestamp = unixTimestamp; + this.epoch = epoch; + this.custodian = custodian; + } + /** + * Default, inactive Lockup value + */ +} +_Lockup = Lockup; +Lockup.default = new _Lockup(0, 0, PublicKey.default); +Object.freeze({ + Initialize: { + index: 0, + layout: struct([u32$1("instruction"), authorized(), lockup()]) + }, + Authorize: { + index: 1, + layout: struct([u32$1("instruction"), publicKey("newAuthorized"), u32$1("stakeAuthorizationType")]) + }, + Delegate: { + index: 2, + layout: struct([u32$1("instruction")]) + }, + Split: { + index: 3, + layout: struct([u32$1("instruction"), ns64("lamports")]) + }, + Withdraw: { + index: 4, + layout: struct([u32$1("instruction"), ns64("lamports")]) + }, + Deactivate: { + index: 5, + layout: struct([u32$1("instruction")]) + }, + Merge: { + index: 7, + layout: struct([u32$1("instruction")]) + }, + AuthorizeWithSeed: { + index: 8, + layout: struct([u32$1("instruction"), publicKey("newAuthorized"), u32$1("stakeAuthorizationType"), rustString("authoritySeed"), publicKey("authorityOwner")]) + } +}); +new PublicKey("Stake11111111111111111111111111111111111111"); +Object.freeze({ + InitializeAccount: { + index: 0, + layout: struct([u32$1("instruction"), voteInit()]) + }, + Authorize: { + index: 1, + layout: struct([u32$1("instruction"), publicKey("newAuthorized"), u32$1("voteAuthorizationType")]) + }, + Withdraw: { + index: 3, + layout: struct([u32$1("instruction"), ns64("lamports")]) + }, + UpdateValidatorIdentity: { + index: 4, + layout: struct([u32$1("instruction")]) + }, + AuthorizeWithSeed: { + index: 10, + layout: struct([u32$1("instruction"), voteAuthorizeWithSeedArgs()]) + } +}); +new PublicKey("Vote111111111111111111111111111111111111111"); +new PublicKey("Va1idator1nfo111111111111111111111111111111"); +type({ + name: string(), + website: optional(string()), + details: optional(string()), + iconUrl: optional(string()), + keybaseUsername: optional(string()) +}); +new PublicKey("Vote111111111111111111111111111111111111111"); +struct([ + publicKey("nodePubkey"), + publicKey("authorizedWithdrawer"), + u8("commission"), + nu64(), + // votes.length + seq(struct([nu64("slot"), u32$1("confirmationCount")]), offset(u32$1(), -8), "votes"), + u8("rootSlotValid"), + nu64("rootSlot"), + nu64(), + // authorizedVoters.length + seq(struct([nu64("epoch"), publicKey("authorizedVoter")]), offset(u32$1(), -8), "authorizedVoters"), + struct([seq(struct([publicKey("authorizedPubkey"), nu64("epochOfLastAuthorizedSwitch"), nu64("targetEpoch")]), 32, "buf"), nu64("idx"), u8("isEmpty")], "priorVoters"), + nu64(), + // epochCredits.length + seq(struct([nu64("epoch"), nu64("credits"), nu64("prevCredits")]), offset(u32$1(), -8), "epochCredits"), + struct([nu64("slot"), nu64("timestamp")], "lastTimestamp") +]); +const ConnectionContext = reactExports.createContext({}); +function useConnection() { + return reactExports.useContext(ConnectionContext); +} +const ConnectionProvider = ({ children, endpoint, config: config2 = { commitment: "confirmed" } }) => { + const connection = reactExports.useMemo(() => new Connection(endpoint, config2), [endpoint, config2]); + return W$2.createElement(ConnectionContext.Provider, { value: { connection } }, children); +}; +var eventemitter3$1 = { exports: {} }; +(function(module) { + var has = Object.prototype.hasOwnProperty, prefix = "~"; + function Events() { + } + if (Object.create) { + Events.prototype = /* @__PURE__ */ Object.create(null); + if (!new Events().__proto__) + prefix = false; + } + function EE2(fn2, context, once3) { + this.fn = fn2; + this.context = context; + this.once = once3 || false; + } + function addListener2(emitter, event, fn2, context, once3) { + if (typeof fn2 !== "function") { + throw new TypeError("The listener must be a function"); + } + var listener = new EE2(fn2, context || emitter, once3), evt = prefix ? prefix + event : event; + if (!emitter._events[evt]) + emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) + emitter._events[evt].push(listener); + else + emitter._events[evt] = [emitter._events[evt], listener]; + return emitter; + } + function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) + emitter._events = new Events(); + else + delete emitter._events[evt]; + } + function EventEmitter2() { + this._events = new Events(); + this._eventsCount = 0; + } + EventEmitter2.prototype.eventNames = function eventNames2() { + var names = [], events2, name2; + if (this._eventsCount === 0) + return names; + for (name2 in events2 = this._events) { + if (has.call(events2, name2)) + names.push(prefix ? name2.slice(1) : name2); + } + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events2)); + } + return names; + }; + EventEmitter2.prototype.listeners = function listeners3(event) { + var evt = prefix ? prefix + event : event, handlers = this._events[evt]; + if (!handlers) + return []; + if (handlers.fn) + return [handlers.fn]; + for (var i2 = 0, l2 = handlers.length, ee2 = new Array(l2); i2 < l2; i2++) { + ee2[i2] = handlers[i2].fn; + } + return ee2; + }; + EventEmitter2.prototype.listenerCount = function listenerCount2(event) { + var evt = prefix ? prefix + event : event, listeners3 = this._events[evt]; + if (!listeners3) + return 0; + if (listeners3.fn) + return 1; + return listeners3.length; + }; + EventEmitter2.prototype.emit = function emit2(event, a1, a22, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + if (!this._events[evt]) + return false; + var listeners3 = this._events[evt], len = arguments.length, args, i2; + if (listeners3.fn) { + if (listeners3.once) + this.removeListener(event, listeners3.fn, void 0, true); + switch (len) { + case 1: + return listeners3.fn.call(listeners3.context), true; + case 2: + return listeners3.fn.call(listeners3.context, a1), true; + case 3: + return listeners3.fn.call(listeners3.context, a1, a22), true; + case 4: + return listeners3.fn.call(listeners3.context, a1, a22, a3), true; + case 5: + return listeners3.fn.call(listeners3.context, a1, a22, a3, a4), true; + case 6: + return listeners3.fn.call(listeners3.context, a1, a22, a3, a4, a5), true; + } + for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) { + args[i2 - 1] = arguments[i2]; + } + listeners3.fn.apply(listeners3.context, args); + } else { + var length = listeners3.length, j2; + for (i2 = 0; i2 < length; i2++) { + if (listeners3[i2].once) + this.removeListener(event, listeners3[i2].fn, void 0, true); + switch (len) { + case 1: + listeners3[i2].fn.call(listeners3[i2].context); + break; + case 2: + listeners3[i2].fn.call(listeners3[i2].context, a1); + break; + case 3: + listeners3[i2].fn.call(listeners3[i2].context, a1, a22); + break; + case 4: + listeners3[i2].fn.call(listeners3[i2].context, a1, a22, a3); + break; + default: + if (!args) + for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) { + args[j2 - 1] = arguments[j2]; + } + listeners3[i2].fn.apply(listeners3[i2].context, args); + } + } + } + return true; + }; + EventEmitter2.prototype.on = function on2(event, fn2, context) { + return addListener2(this, event, fn2, context, false); + }; + EventEmitter2.prototype.once = function once3(event, fn2, context) { + return addListener2(this, event, fn2, context, true); + }; + EventEmitter2.prototype.removeListener = function removeListener2(event, fn2, context, once3) { + var evt = prefix ? prefix + event : event; + if (!this._events[evt]) + return this; + if (!fn2) { + clearEvent(this, evt); + return this; + } + var listeners3 = this._events[evt]; + if (listeners3.fn) { + if (listeners3.fn === fn2 && (!once3 || listeners3.once) && (!context || listeners3.context === context)) { + clearEvent(this, evt); + } + } else { + for (var i2 = 0, events2 = [], length = listeners3.length; i2 < length; i2++) { + if (listeners3[i2].fn !== fn2 || once3 && !listeners3[i2].once || context && listeners3[i2].context !== context) { + events2.push(listeners3[i2]); + } + } + if (events2.length) + this._events[evt] = events2.length === 1 ? events2[0] : events2; + else + clearEvent(this, evt); + } + return this; + }; + EventEmitter2.prototype.removeAllListeners = function removeAllListeners2(event) { + var evt; + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) + clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + return this; + }; + EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; + EventEmitter2.prototype.addListener = EventEmitter2.prototype.on; + EventEmitter2.prefixed = prefix; + EventEmitter2.EventEmitter = EventEmitter2; + { + module.exports = EventEmitter2; + } +})(eventemitter3$1); +var eventemitter3Exports$1 = eventemitter3$1.exports; +const EventEmitter$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(eventemitter3Exports$1); +let WalletError$2 = class WalletError extends Error { + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + constructor(message2, error) { + super(message2); + this.error = error; + } +}; +class WalletNotReadyError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletNotReadyError"; + } +} +class WalletConfigError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletConfigError"; + } +} +let WalletConnectionError$1 = class WalletConnectionError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletConnectionError"; + } +}; +let WalletDisconnectedError$1 = class WalletDisconnectedError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletDisconnectedError"; + } +}; +class WalletDisconnectionError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletDisconnectionError"; + } +} +class WalletAccountError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletAccountError"; + } +} +class WalletPublicKeyError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletPublicKeyError"; + } +} +class WalletNotConnectedError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletNotConnectedError"; + } +} +class WalletSendTransactionError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletSendTransactionError"; + } +} +let WalletSignTransactionError$1 = class WalletSignTransactionError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletSignTransactionError"; + } +}; +let WalletSignMessageError$1 = class WalletSignMessageError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletSignMessageError"; + } +}; +class WalletSignInError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletSignInError"; + } +} +var WalletReadyState$2; +(function(WalletReadyState2) { + WalletReadyState2["Installed"] = "Installed"; + WalletReadyState2["NotDetected"] = "NotDetected"; + WalletReadyState2["Loadable"] = "Loadable"; + WalletReadyState2["Unsupported"] = "Unsupported"; +})(WalletReadyState$2 || (WalletReadyState$2 = {})); +class BaseWalletAdapter extends EventEmitter$2 { + get connected() { + return !!this.publicKey; + } + async autoConnect() { + await this.connect(); + } + async prepareTransaction(transaction2, connection, options = {}) { + const publicKey2 = this.publicKey; + if (!publicKey2) + throw new WalletNotConnectedError(); + transaction2.feePayer = transaction2.feePayer || publicKey2; + transaction2.recentBlockhash = transaction2.recentBlockhash || (await connection.getLatestBlockhash({ + commitment: options.preflightCommitment, + minContextSlot: options.minContextSlot + })).blockhash; + return transaction2; + } +} +function isVersionedTransaction$1(transaction2) { + return "version" in transaction2; +} +class BaseSignerWalletAdapter extends BaseWalletAdapter { + async sendTransaction(transaction2, connection, options = {}) { + let emit2 = true; + try { + if (isVersionedTransaction$1(transaction2)) { + if (!this.supportedTransactionVersions) + throw new WalletSendTransactionError(`Sending versioned transactions isn't supported by this wallet`); + if (!this.supportedTransactionVersions.has(transaction2.version)) + throw new WalletSendTransactionError(`Sending transaction version ${transaction2.version} isn't supported by this wallet`); + try { + transaction2 = await this.signTransaction(transaction2); + const rawTransaction = transaction2.serialize(); + return await connection.sendRawTransaction(rawTransaction, options); + } catch (error) { + if (error instanceof WalletSignTransactionError$1) { + emit2 = false; + throw error; + } + throw new WalletSendTransactionError(error == null ? void 0 : error.message, error); + } + } else { + try { + const { signers, ...sendOptions } = options; + transaction2 = await this.prepareTransaction(transaction2, connection, sendOptions); + (signers == null ? void 0 : signers.length) && transaction2.partialSign(...signers); + transaction2 = await this.signTransaction(transaction2); + const rawTransaction = transaction2.serialize(); + return await connection.sendRawTransaction(rawTransaction, sendOptions); + } catch (error) { + if (error instanceof WalletSignTransactionError$1) { + emit2 = false; + throw error; + } + throw new WalletSendTransactionError(error == null ? void 0 : error.message, error); + } + } + } catch (error) { + if (emit2) { + this.emit("error", error); + } + throw error; + } + } + async signAllTransactions(transactions) { + for (const transaction2 of transactions) { + if (isVersionedTransaction$1(transaction2)) { + if (!this.supportedTransactionVersions) + throw new WalletSignTransactionError$1(`Signing versioned transactions isn't supported by this wallet`); + if (!this.supportedTransactionVersions.has(transaction2.version)) + throw new WalletSignTransactionError$1(`Signing transaction version ${transaction2.version} isn't supported by this wallet`); + } + } + const signedTransactions = []; + for (const transaction2 of transactions) { + signedTransactions.push(await this.signTransaction(transaction2)); + } + return signedTransactions; + } +} +class BaseMessageSignerWalletAdapter extends BaseSignerWalletAdapter { +} +class BaseSignInMessageSignerWalletAdapter extends BaseMessageSignerWalletAdapter { +} +const SolanaSignAndSendTransaction = "solana:signAndSendTransaction"; +const SolanaSignIn = "solana:signIn"; +const SolanaSignMessage = "solana:signMessage"; +const SolanaSignTransaction = "solana:signTransaction"; +const StandardConnect = "standard:connect"; +const StandardDisconnect = "standard:disconnect"; +const StandardEvents = "standard:events"; +function isWalletAdapterCompatibleStandardWallet(wallet) { + return StandardConnect in wallet.features && StandardEvents in wallet.features && (SolanaSignAndSendTransaction in wallet.features || SolanaSignTransaction in wallet.features); +} +let WalletNotSelectedError$1 = class WalletNotSelectedError extends WalletError$2 { + constructor() { + super(...arguments); + this.name = "WalletNotSelectedError"; + } +}; +const EMPTY_ARRAY = []; +const DEFAULT_CONTEXT$1 = { + autoConnect: false, + connecting: false, + connected: false, + disconnecting: false, + select() { + logMissingProviderError("call", "select"); + }, + connect() { + return Promise.reject(logMissingProviderError("call", "connect")); + }, + disconnect() { + return Promise.reject(logMissingProviderError("call", "disconnect")); + }, + sendTransaction() { + return Promise.reject(logMissingProviderError("call", "sendTransaction")); + }, + signTransaction() { + return Promise.reject(logMissingProviderError("call", "signTransaction")); + }, + signAllTransactions() { + return Promise.reject(logMissingProviderError("call", "signAllTransactions")); + }, + signMessage() { + return Promise.reject(logMissingProviderError("call", "signMessage")); + }, + signIn() { + return Promise.reject(logMissingProviderError("call", "signIn")); + } +}; +Object.defineProperty(DEFAULT_CONTEXT$1, "wallets", { + get() { + logMissingProviderError("read", "wallets"); + return EMPTY_ARRAY; + } +}); +Object.defineProperty(DEFAULT_CONTEXT$1, "wallet", { + get() { + logMissingProviderError("read", "wallet"); + return null; + } +}); +Object.defineProperty(DEFAULT_CONTEXT$1, "publicKey", { + get() { + logMissingProviderError("read", "publicKey"); + return null; + } +}); +function logMissingProviderError(action, property) { + const error = new Error(`You have tried to ${action} "${property}" on a WalletContext without providing one. Make sure to render a WalletProvider as an ancestor of the component that uses WalletContext.`); + console.error(error); + return error; +} +const WalletContext$1 = reactExports.createContext(DEFAULT_CONTEXT$1); +function useWallet$1() { + return reactExports.useContext(WalletContext$1); +} +function useLocalStorage$1(key2, defaultState) { + const state = reactExports.useState(() => { + try { + const value2 = localStorage.getItem(key2); + if (value2) + return JSON.parse(value2); + } catch (error) { + if (typeof window !== "undefined") { + console.error(error); + } + } + return defaultState; + }); + const value = state[0]; + const isFirstRenderRef = reactExports.useRef(true); + reactExports.useEffect(() => { + if (isFirstRenderRef.current) { + isFirstRenderRef.current = false; + return; + } + try { + if (value === null) { + localStorage.removeItem(key2); + } else { + localStorage.setItem(key2, JSON.stringify(value)); + } + } catch (error) { + if (typeof window !== "undefined") { + console.error(error); + } + } + }, [value, key2]); + return state; +} +function getCommitment(commitment) { + switch (commitment) { + case "processed": + case "confirmed": + case "finalized": + case void 0: + return commitment; + case "recent": + return "processed"; + case "single": + case "singleGossip": + return "confirmed"; + case "max": + case "root": + return "finalized"; + default: + return void 0; + } +} +const SOLANA_MAINNET_CHAIN = "solana:mainnet"; +const SOLANA_DEVNET_CHAIN = "solana:devnet"; +const SOLANA_TESTNET_CHAIN = "solana:testnet"; +const SOLANA_LOCALNET_CHAIN = "solana:localnet"; +const MAINNET_ENDPOINT = "https://api.mainnet-beta.solana.com"; +function getChainForEndpoint(endpoint) { + if (endpoint.includes(MAINNET_ENDPOINT)) + return SOLANA_MAINNET_CHAIN; + if (/\bdevnet\b/i.test(endpoint)) + return SOLANA_DEVNET_CHAIN; + if (/\btestnet\b/i.test(endpoint)) + return SOLANA_TESTNET_CHAIN; + if (/\blocalhost\b/i.test(endpoint) || /\b127\.0\.0\.1\b/.test(endpoint)) + return SOLANA_LOCALNET_CHAIN; + return SOLANA_MAINNET_CHAIN; +} +function createSignInMessageText(input) { + let message2 = `${input.domain} wants you to sign in with your Solana account: +`; + message2 += `${input.address}`; + if (input.statement) { + message2 += ` + +${input.statement}`; + } + const fields = []; + if (input.uri) { + fields.push(`URI: ${input.uri}`); + } + if (input.version) { + fields.push(`Version: ${input.version}`); + } + if (input.chainId) { + fields.push(`Chain ID: ${input.chainId}`); + } + if (input.nonce) { + fields.push(`Nonce: ${input.nonce}`); + } + if (input.issuedAt) { + fields.push(`Issued At: ${input.issuedAt}`); + } + if (input.expirationTime) { + fields.push(`Expiration Time: ${input.expirationTime}`); + } + if (input.notBefore) { + fields.push(`Not Before: ${input.notBefore}`); + } + if (input.requestId) { + fields.push(`Request ID: ${input.requestId}`); + } + if (input.resources) { + fields.push(`Resources:`); + for (const resource of input.resources) { + fields.push(`- ${resource}`); + } + } + if (fields.length) { + message2 += ` + +${fields.join("\n")}`; + } + return message2; +} +const SolanaMobileWalletAdapterErrorCode = { + ERROR_ASSOCIATION_PORT_OUT_OF_RANGE: "ERROR_ASSOCIATION_PORT_OUT_OF_RANGE", + ERROR_FORBIDDEN_WALLET_BASE_URL: "ERROR_FORBIDDEN_WALLET_BASE_URL", + ERROR_SECURE_CONTEXT_REQUIRED: "ERROR_SECURE_CONTEXT_REQUIRED", + ERROR_SESSION_CLOSED: "ERROR_SESSION_CLOSED", + ERROR_SESSION_TIMEOUT: "ERROR_SESSION_TIMEOUT", + ERROR_WALLET_NOT_FOUND: "ERROR_WALLET_NOT_FOUND", + ERROR_INVALID_PROTOCOL_VERSION: "ERROR_INVALID_PROTOCOL_VERSION" +}; +class SolanaMobileWalletAdapterError extends Error { + constructor(...args) { + const [code2, message2, data] = args; + super(message2); + this.code = code2; + this.data = data; + this.name = "SolanaMobileWalletAdapterError"; + } +} +class SolanaMobileWalletAdapterProtocolError extends Error { + constructor(...args) { + const [jsonRpcMessageId, code2, message2, data] = args; + super(message2); + this.code = code2; + this.data = data; + this.jsonRpcMessageId = jsonRpcMessageId; + this.name = "SolanaMobileWalletAdapterProtocolError"; + } +} +function __awaiter$5(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve) { + resolve(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e18) { + reject(e18); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e18) { + reject(e18); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function createHelloReq(ecdhPublicKey, associationKeypairPrivateKey) { + return __awaiter$5(this, void 0, void 0, function* () { + const publicKeyBuffer = yield crypto.subtle.exportKey("raw", ecdhPublicKey); + const signatureBuffer = yield crypto.subtle.sign({ hash: "SHA-256", name: "ECDSA" }, associationKeypairPrivateKey, publicKeyBuffer); + const response = new Uint8Array(publicKeyBuffer.byteLength + signatureBuffer.byteLength); + response.set(new Uint8Array(publicKeyBuffer), 0); + response.set(new Uint8Array(signatureBuffer), publicKeyBuffer.byteLength); + return response; + }); +} +function encode$2(input) { + return window.btoa(input); +} +function createSIWSMessage(payload) { + return createSignInMessageText(payload); +} +function createSIWSMessageBase64(payload) { + return encode$2(createSIWSMessage(payload)); +} +const SolanaSignTransactions = "solana:signTransactions"; +const SolanaCloneAuthorization = "solana:cloneAuthorization"; +function createMobileWalletProxy(protocolVersion, protocolRequestHandler) { + return new Proxy({}, { + get(target, p3) { + if (target[p3] == null) { + target[p3] = function(inputParams) { + return __awaiter$5(this, void 0, void 0, function* () { + const { method, params } = handleMobileWalletRequest(p3, inputParams, protocolVersion); + const result = yield protocolRequestHandler(method, params); + if (method === "authorize" && params.sign_in_payload && !result.sign_in_result) { + result["sign_in_result"] = yield signInFallback(params.sign_in_payload, result, protocolRequestHandler); + } + return handleMobileWalletResponse(p3, result, protocolVersion); + }); + }; + } + return target[p3]; + }, + defineProperty() { + return false; + }, + deleteProperty() { + return false; + } + }); +} +function handleMobileWalletRequest(methodName, methodParams, protocolVersion) { + let params = methodParams; + let method = methodName.toString().replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`).toLowerCase(); + switch (methodName) { + case "authorize": { + let { chain } = params; + if (protocolVersion === "legacy") { + switch (chain) { + case "solana:testnet": { + chain = "testnet"; + break; + } + case "solana:devnet": { + chain = "devnet"; + break; + } + case "solana:mainnet": { + chain = "mainnet-beta"; + break; + } + default: { + chain = params.cluster; + } + } + params.cluster = chain; + } else { + switch (chain) { + case "testnet": + case "devnet": { + chain = `solana:${chain}`; + break; + } + case "mainnet-beta": { + chain = "solana:mainnet"; + break; + } + } + params.chain = chain; + } + } + case "reauthorize": { + const { auth_token, identity: identity2 } = params; + if (auth_token) { + switch (protocolVersion) { + case "legacy": { + method = "reauthorize"; + params = { auth_token, identity: identity2 }; + break; + } + default: { + method = "authorize"; + break; + } + } + } + break; + } + } + return { method, params }; +} +function handleMobileWalletResponse(method, response, protocolVersion) { + switch (method) { + case "getCapabilities": { + const capabilities = response; + switch (protocolVersion) { + case "legacy": { + const features = [SolanaSignTransactions]; + if (capabilities.supports_clone_authorization === true) { + features.push(SolanaCloneAuthorization); + } + return Object.assign(Object.assign({}, capabilities), { features }); + } + case "v1": { + return Object.assign(Object.assign({}, capabilities), { supports_sign_and_send_transactions: true, supports_clone_authorization: capabilities.features.includes(SolanaCloneAuthorization) }); + } + } + } + } + return response; +} +function signInFallback(signInPayload, authorizationResult, protocolRequestHandler) { + var _a3; + return __awaiter$5(this, void 0, void 0, function* () { + const domain = (_a3 = signInPayload.domain) !== null && _a3 !== void 0 ? _a3 : window.location.host; + const address2 = authorizationResult.accounts[0].address; + const siwsMessage = createSIWSMessageBase64(Object.assign(Object.assign({}, signInPayload), { domain, address: address2 })); + const signMessageResult = yield protocolRequestHandler("sign_messages", { + addresses: [address2], + payloads: [siwsMessage] + }); + const signInResult = { + address: address2, + signed_message: siwsMessage, + signature: signMessageResult.signed_payloads[0].slice(siwsMessage.length) + }; + return signInResult; + }); +} +const SEQUENCE_NUMBER_BYTES = 4; +function createSequenceNumberVector(sequenceNumber) { + if (sequenceNumber >= 4294967296) { + throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes."); + } + const byteArray = new ArrayBuffer(SEQUENCE_NUMBER_BYTES); + const view = new DataView(byteArray); + view.setUint32( + 0, + sequenceNumber, + /* littleEndian */ + false + ); + return new Uint8Array(byteArray); +} +const INITIALIZATION_VECTOR_BYTES = 12; +const ENCODED_PUBLIC_KEY_LENGTH_BYTES = 65; +function encryptMessage(plaintext, sequenceNumber, sharedSecret) { + return __awaiter$5(this, void 0, void 0, function* () { + const sequenceNumberVector = createSequenceNumberVector(sequenceNumber); + const initializationVector = new Uint8Array(INITIALIZATION_VECTOR_BYTES); + crypto.getRandomValues(initializationVector); + const ciphertext = yield crypto.subtle.encrypt(getAlgorithmParams(sequenceNumberVector, initializationVector), sharedSecret, new TextEncoder().encode(plaintext)); + const response = new Uint8Array(sequenceNumberVector.byteLength + initializationVector.byteLength + ciphertext.byteLength); + response.set(new Uint8Array(sequenceNumberVector), 0); + response.set(new Uint8Array(initializationVector), sequenceNumberVector.byteLength); + response.set(new Uint8Array(ciphertext), sequenceNumberVector.byteLength + initializationVector.byteLength); + return response; + }); +} +function decryptMessage(message2, sharedSecret) { + return __awaiter$5(this, void 0, void 0, function* () { + const sequenceNumberVector = message2.slice(0, SEQUENCE_NUMBER_BYTES); + const initializationVector = message2.slice(SEQUENCE_NUMBER_BYTES, SEQUENCE_NUMBER_BYTES + INITIALIZATION_VECTOR_BYTES); + const ciphertext = message2.slice(SEQUENCE_NUMBER_BYTES + INITIALIZATION_VECTOR_BYTES); + const plaintextBuffer = yield crypto.subtle.decrypt(getAlgorithmParams(sequenceNumberVector, initializationVector), sharedSecret, ciphertext); + const plaintext = getUtf8Decoder().decode(plaintextBuffer); + return plaintext; + }); +} +function getAlgorithmParams(sequenceNumber, initializationVector) { + return { + additionalData: sequenceNumber, + iv: initializationVector, + name: "AES-GCM", + tagLength: 128 + // 16 byte tag => 128 bits + }; +} +let _utf8Decoder; +function getUtf8Decoder() { + if (_utf8Decoder === void 0) { + _utf8Decoder = new TextDecoder("utf-8"); + } + return _utf8Decoder; +} +function generateAssociationKeypair() { + return __awaiter$5(this, void 0, void 0, function* () { + return yield crypto.subtle.generateKey( + { + name: "ECDSA", + namedCurve: "P-256" + }, + false, + ["sign"] + /* keyUsages */ + ); + }); +} +function generateECDHKeypair() { + return __awaiter$5(this, void 0, void 0, function* () { + return yield crypto.subtle.generateKey( + { + name: "ECDH", + namedCurve: "P-256" + }, + false, + ["deriveKey", "deriveBits"] + /* keyUsages */ + ); + }); +} +function encryptJsonRpcMessage(jsonRpcMessage, sharedSecret) { + return __awaiter$5(this, void 0, void 0, function* () { + const plaintext = JSON.stringify(jsonRpcMessage); + const sequenceNumber = jsonRpcMessage.id; + return encryptMessage(plaintext, sequenceNumber, sharedSecret); + }); +} +function decryptJsonRpcMessage(message2, sharedSecret) { + return __awaiter$5(this, void 0, void 0, function* () { + const plaintext = yield decryptMessage(message2, sharedSecret); + const jsonRpcMessage = JSON.parse(plaintext); + if (Object.hasOwnProperty.call(jsonRpcMessage, "error")) { + throw new SolanaMobileWalletAdapterProtocolError(jsonRpcMessage.id, jsonRpcMessage.error.code, jsonRpcMessage.error.message); + } + return jsonRpcMessage; + }); +} +function parseHelloRsp(payloadBuffer, associationPublicKey, ecdhPrivateKey) { + return __awaiter$5(this, void 0, void 0, function* () { + const [associationPublicKeyBuffer, walletPublicKey] = yield Promise.all([ + crypto.subtle.exportKey("raw", associationPublicKey), + crypto.subtle.importKey( + "raw", + payloadBuffer.slice(0, ENCODED_PUBLIC_KEY_LENGTH_BYTES), + { name: "ECDH", namedCurve: "P-256" }, + false, + [] + /* keyUsages */ + ) + ]); + const sharedSecret = yield crypto.subtle.deriveBits({ name: "ECDH", public: walletPublicKey }, ecdhPrivateKey, 256); + const ecdhSecretKey = yield crypto.subtle.importKey( + "raw", + sharedSecret, + "HKDF", + false, + ["deriveKey"] + /* keyUsages */ + ); + const aesKeyMaterialVal = yield crypto.subtle.deriveKey({ + name: "HKDF", + hash: "SHA-256", + salt: new Uint8Array(associationPublicKeyBuffer), + info: new Uint8Array() + }, ecdhSecretKey, { name: "AES-GCM", length: 128 }, false, ["encrypt", "decrypt"]); + return aesKeyMaterialVal; + }); +} +function parseSessionProps(message2, sharedSecret) { + return __awaiter$5(this, void 0, void 0, function* () { + const plaintext = yield decryptMessage(message2, sharedSecret); + const jsonProperties = JSON.parse(plaintext); + let protocolVersion = "legacy"; + if (Object.hasOwnProperty.call(jsonProperties, "v")) { + switch (jsonProperties.v) { + case 1: + case "1": + case "v1": + protocolVersion = "v1"; + break; + case "legacy": + protocolVersion = "legacy"; + break; + default: + throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_INVALID_PROTOCOL_VERSION, `Unknown/unsupported protocol version: ${jsonProperties.v}`); + } + } + return { + protocol_version: protocolVersion + }; + }); +} +function getRandomAssociationPort() { + return assertAssociationPort(49152 + Math.floor(Math.random() * (65535 - 49152 + 1))); +} +function assertAssociationPort(port) { + if (port < 49152 || port > 65535) { + throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE, `Association port number must be between 49152 and 65535. ${port} given.`, { port }); + } + return port; +} +function arrayBufferToBase64String(buffer2) { + let binary2 = ""; + const bytes2 = new Uint8Array(buffer2); + const len = bytes2.byteLength; + for (let ii2 = 0; ii2 < len; ii2++) { + binary2 += String.fromCharCode(bytes2[ii2]); + } + return window.btoa(binary2); +} +function getStringWithURLUnsafeCharactersReplaced(unsafeBase64EncodedString) { + return unsafeBase64EncodedString.replace(/[/+=]/g, (m3) => ({ + "/": "_", + "+": "-", + "=": "." + })[m3]); +} +const INTENT_NAME = "solana-wallet"; +function getPathParts(pathString) { + return pathString.replace(/(^\/+|\/+$)/g, "").split("/"); +} +function getIntentURL(methodPathname, intentUrlBase) { + let baseUrl = null; + if (intentUrlBase) { + try { + baseUrl = new URL(intentUrlBase); + } catch (_a3) { + } + if ((baseUrl === null || baseUrl === void 0 ? void 0 : baseUrl.protocol) !== "https:") { + throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_FORBIDDEN_WALLET_BASE_URL, "Base URLs supplied by wallets must be valid `https` URLs"); + } + } + baseUrl || (baseUrl = new URL(`${INTENT_NAME}:/`)); + const pathname = methodPathname.startsWith("/") ? ( + // Method is an absolute path. Replace it wholesale. + methodPathname + ) : ( + // Method is a relative path. Merge it with the existing one. + [...getPathParts(baseUrl.pathname), ...getPathParts(methodPathname)].join("/") + ); + return new URL(pathname, baseUrl); +} +function getAssociateAndroidIntentURL(associationPublicKey, putativePort, associationURLBase, protocolVersions = ["v1"]) { + return __awaiter$5(this, void 0, void 0, function* () { + const associationPort = assertAssociationPort(putativePort); + const exportedKey = yield crypto.subtle.exportKey("raw", associationPublicKey); + const encodedKey = arrayBufferToBase64String(exportedKey); + const url = getIntentURL("v1/associate/local", associationURLBase); + url.searchParams.set("association", getStringWithURLUnsafeCharactersReplaced(encodedKey)); + url.searchParams.set("port", `${associationPort}`); + protocolVersions.forEach((version2) => { + url.searchParams.set("v", version2); + }); + return url; + }); +} +const Browser = { + Firefox: 0, + Other: 1 +}; +function assertUnreachable(x3) { + return x3; +} +function getBrowser() { + return navigator.userAgent.indexOf("Firefox/") !== -1 ? Browser.Firefox : Browser.Other; +} +function getDetectionPromise() { + return new Promise((resolve, reject) => { + function cleanup() { + clearTimeout(timeoutId); + window.removeEventListener("blur", handleBlur); + } + function handleBlur() { + cleanup(); + resolve(); + } + window.addEventListener("blur", handleBlur); + const timeoutId = setTimeout(() => { + cleanup(); + reject(); + }, 2e3); + }); +} +let _frame = null; +function launchUrlThroughHiddenFrame(url) { + if (_frame == null) { + _frame = document.createElement("iframe"); + _frame.style.display = "none"; + document.body.appendChild(_frame); + } + _frame.contentWindow.location.href = url.toString(); +} +function startSession(associationPublicKey, associationURLBase) { + return __awaiter$5(this, void 0, void 0, function* () { + const randomAssociationPort = getRandomAssociationPort(); + const associationUrl = yield getAssociateAndroidIntentURL(associationPublicKey, randomAssociationPort, associationURLBase); + if (associationUrl.protocol === "https:") { + window.location.assign(associationUrl); + } else { + try { + const browser2 = getBrowser(); + switch (browser2) { + case Browser.Firefox: + launchUrlThroughHiddenFrame(associationUrl); + break; + case Browser.Other: { + const detectionPromise = getDetectionPromise(); + window.location.assign(associationUrl); + yield detectionPromise; + break; + } + default: + assertUnreachable(browser2); + } + } catch (e18) { + throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND, "Found no installed wallet that supports the mobile wallet protocol."); + } + } + return randomAssociationPort; + }); +} +const WEBSOCKET_CONNECTION_CONFIG = { + /** + * 300 milliseconds is a generally accepted threshold for what someone + * would consider an acceptable response time for a user interface + * after having performed a low-attention tapping task. We set the initial + * interval at which we wait for the wallet to set up the websocket at + * half this, as per the Nyquist frequency, with a progressive backoff + * sequence from there. The total wait time is 30s, which allows for the + * user to be presented with a disambiguation dialog, select a wallet, and + * for the wallet app to subsequently start. + */ + retryDelayScheduleMs: [150, 150, 200, 500, 500, 750, 750, 1e3], + timeoutMs: 3e4 +}; +const WEBSOCKET_PROTOCOL = "com.solana.mobilewalletadapter.v1"; +function assertSecureContext() { + if (typeof window === "undefined" || window.isSecureContext !== true) { + throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SECURE_CONTEXT_REQUIRED, "The mobile wallet adapter protocol must be used in a secure context (`https`)."); + } +} +function assertSecureEndpointSpecificURI(walletUriBase) { + let url; + try { + url = new URL(walletUriBase); + } catch (_a3) { + throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_FORBIDDEN_WALLET_BASE_URL, "Invalid base URL supplied by wallet"); + } + if (url.protocol !== "https:") { + throw new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_FORBIDDEN_WALLET_BASE_URL, "Base URLs supplied by wallets must be valid `https` URLs"); + } +} +function getSequenceNumberFromByteArray(byteArray) { + const view = new DataView(byteArray); + return view.getUint32( + 0, + /* littleEndian */ + false + ); +} +function transact$1(callback, config2) { + return __awaiter$5(this, void 0, void 0, function* () { + assertSecureContext(); + const associationKeypair = yield generateAssociationKeypair(); + const sessionPort = yield startSession(associationKeypair.publicKey, config2 === null || config2 === void 0 ? void 0 : config2.baseUri); + const websocketURL = `ws://localhost:${sessionPort}/solana-wallet`; + let connectionStartTime; + const getNextRetryDelayMs = (() => { + const schedule = [...WEBSOCKET_CONNECTION_CONFIG.retryDelayScheduleMs]; + return () => schedule.length > 1 ? schedule.shift() : schedule[0]; + })(); + let nextJsonRpcMessageId = 1; + let lastKnownInboundSequenceNumber = 0; + let state = { __type: "disconnected" }; + return new Promise((resolve, reject) => { + let socket; + const jsonRpcResponsePromises = {}; + const handleOpen = () => __awaiter$5(this, void 0, void 0, function* () { + if (state.__type !== "connecting") { + console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${state.__type}\`.`); + return; + } + const { associationKeypair: associationKeypair2 } = state; + socket.removeEventListener("open", handleOpen); + const ecdhKeypair = yield generateECDHKeypair(); + socket.send(yield createHelloReq(ecdhKeypair.publicKey, associationKeypair2.privateKey)); + state = { + __type: "hello_req_sent", + associationPublicKey: associationKeypair2.publicKey, + ecdhPrivateKey: ecdhKeypair.privateKey + }; + }); + const handleClose = (evt) => { + if (evt.wasClean) { + state = { __type: "disconnected" }; + } else { + reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_CLOSED, `The wallet session dropped unexpectedly (${evt.code}: ${evt.reason}).`, { closeEvent: evt })); + } + disposeSocket(); + }; + const handleError = (_evt) => __awaiter$5(this, void 0, void 0, function* () { + disposeSocket(); + if (Date.now() - connectionStartTime >= WEBSOCKET_CONNECTION_CONFIG.timeoutMs) { + reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT, `Failed to connect to the wallet websocket on port ${sessionPort}.`)); + } else { + yield new Promise((resolve2) => { + const retryDelayMs = getNextRetryDelayMs(); + retryWaitTimeoutId = window.setTimeout(resolve2, retryDelayMs); + }); + attemptSocketConnection(); + } + }); + const handleMessage = (evt) => __awaiter$5(this, void 0, void 0, function* () { + const responseBuffer = yield evt.data.arrayBuffer(); + switch (state.__type) { + case "connected": + try { + const sequenceNumberVector = responseBuffer.slice(0, SEQUENCE_NUMBER_BYTES); + const sequenceNumber = getSequenceNumberFromByteArray(sequenceNumberVector); + if (sequenceNumber !== lastKnownInboundSequenceNumber + 1) { + throw new Error("Encrypted message has invalid sequence number"); + } + lastKnownInboundSequenceNumber = sequenceNumber; + const jsonRpcMessage = yield decryptJsonRpcMessage(responseBuffer, state.sharedSecret); + const responsePromise = jsonRpcResponsePromises[jsonRpcMessage.id]; + delete jsonRpcResponsePromises[jsonRpcMessage.id]; + responsePromise.resolve(jsonRpcMessage.result); + } catch (e18) { + if (e18 instanceof SolanaMobileWalletAdapterProtocolError) { + const responsePromise = jsonRpcResponsePromises[e18.jsonRpcMessageId]; + delete jsonRpcResponsePromises[e18.jsonRpcMessageId]; + responsePromise.reject(e18); + } else { + throw e18; + } + } + break; + case "hello_req_sent": { + const sharedSecret = yield parseHelloRsp(responseBuffer, state.associationPublicKey, state.ecdhPrivateKey); + const sessionPropertiesBuffer = responseBuffer.slice(ENCODED_PUBLIC_KEY_LENGTH_BYTES); + const sessionProperties = sessionPropertiesBuffer.byteLength !== 0 ? yield (() => __awaiter$5(this, void 0, void 0, function* () { + const sequenceNumberVector = sessionPropertiesBuffer.slice(0, SEQUENCE_NUMBER_BYTES); + const sequenceNumber = getSequenceNumberFromByteArray(sequenceNumberVector); + if (sequenceNumber !== lastKnownInboundSequenceNumber + 1) { + throw new Error("Encrypted message has invalid sequence number"); + } + lastKnownInboundSequenceNumber = sequenceNumber; + return parseSessionProps(sessionPropertiesBuffer, sharedSecret); + }))() : { protocol_version: "legacy" }; + state = { __type: "connected", sharedSecret, sessionProperties }; + const wallet = createMobileWalletProxy(sessionProperties.protocol_version, (method, params) => __awaiter$5(this, void 0, void 0, function* () { + const id2 = nextJsonRpcMessageId++; + socket.send(yield encryptJsonRpcMessage({ + id: id2, + jsonrpc: "2.0", + method, + params: params !== null && params !== void 0 ? params : {} + }, sharedSecret)); + return new Promise((resolve2, reject2) => { + jsonRpcResponsePromises[id2] = { + resolve(result) { + switch (method) { + case "authorize": + case "reauthorize": { + const { wallet_uri_base } = result; + if (wallet_uri_base != null) { + try { + assertSecureEndpointSpecificURI(wallet_uri_base); + } catch (e18) { + reject2(e18); + return; + } + } + break; + } + } + resolve2(result); + }, + reject: reject2 + }; + }); + })); + try { + resolve(yield callback(wallet)); + } catch (e18) { + reject(e18); + } finally { + disposeSocket(); + socket.close(); + } + break; + } + } + }); + let disposeSocket; + let retryWaitTimeoutId; + const attemptSocketConnection = () => { + if (disposeSocket) { + disposeSocket(); + } + state = { __type: "connecting", associationKeypair }; + if (connectionStartTime === void 0) { + connectionStartTime = Date.now(); + } + socket = new WebSocket(websocketURL, [WEBSOCKET_PROTOCOL]); + socket.addEventListener("open", handleOpen); + socket.addEventListener("close", handleClose); + socket.addEventListener("error", handleError); + socket.addEventListener("message", handleMessage); + disposeSocket = () => { + window.clearTimeout(retryWaitTimeoutId); + socket.removeEventListener("open", handleOpen); + socket.removeEventListener("close", handleClose); + socket.removeEventListener("error", handleError); + socket.removeEventListener("message", handleMessage); + }; + }; + attemptSocketConnection(); + }); + }); +} +function base$1(ALPHABET2) { + if (ALPHABET2.length >= 255) { + throw new TypeError("Alphabet too long"); + } + var BASE_MAP = new Uint8Array(256); + for (var j2 = 0; j2 < BASE_MAP.length; j2++) { + BASE_MAP[j2] = 255; + } + for (var i2 = 0; i2 < ALPHABET2.length; i2++) { + var x3 = ALPHABET2.charAt(i2); + var xc2 = x3.charCodeAt(0); + if (BASE_MAP[xc2] !== 255) { + throw new TypeError(x3 + " is ambiguous"); + } + BASE_MAP[xc2] = i2; + } + var BASE2 = ALPHABET2.length; + var LEADER = ALPHABET2.charAt(0); + var FACTOR = Math.log(BASE2) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE2); + function encode5(source) { + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError("Expected Uint8Array"); + } + if (source.length === 0) { + return ""; + } + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size2 = (pend - pbegin) * iFACTOR + 1 >>> 0; + var b58 = new Uint8Array(size2); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i3 = 0; + for (var it1 = size2 - 1; (carry !== 0 || i3 < length) && it1 !== -1; it1--, i3++) { + carry += 256 * b58[it1] >>> 0; + b58[it1] = carry % BASE2 >>> 0; + carry = carry / BASE2 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length = i3; + pbegin++; + } + var it2 = size2 - length; + while (it2 !== size2 && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size2; ++it2) { + str += ALPHABET2.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== "string") { + throw new TypeError("Expected String"); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size2 = (source.length - psz) * FACTOR + 1 >>> 0; + var b256 = new Uint8Array(size2); + while (source[psz]) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i3 = 0; + for (var it3 = size2 - 1; (carry !== 0 || i3 < length) && it3 !== -1; it3--, i3++) { + carry += BASE2 * b256[it3] >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = carry / 256 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length = i3; + psz++; + } + var it4 = size2 - length; + while (it4 !== size2 && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size2 - it4)); + var j3 = zeroes; + while (it4 !== size2) { + vch[j3++] = b256[it4++]; + } + return vch; + } + function decode3(string2) { + var buffer2 = decodeUnsafe(string2); + if (buffer2) { + return buffer2; + } + throw new Error("Non-base" + BASE2 + " character"); + } + return { + encode: encode5, + decodeUnsafe, + decode: decode3 + }; +} +var src = base$1; +const basex = src; +const ALPHABET$2 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; +var bs58 = basex(ALPHABET$2); +const bs58$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(bs58); +function __rest(s2, e18) { + var t2 = {}; + for (var p3 in s2) + if (Object.prototype.hasOwnProperty.call(s2, p3) && e18.indexOf(p3) < 0) + t2[p3] = s2[p3]; + if (s2 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i2 = 0, p3 = Object.getOwnPropertySymbols(s2); i2 < p3.length; i2++) { + if (e18.indexOf(p3[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p3[i2])) + t2[p3[i2]] = s2[p3[i2]]; + } + return t2; +} +function __awaiter$4(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve) { + resolve(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e18) { + reject(e18); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e18) { + reject(e18); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function fromUint8Array(byteArray) { + return window.btoa(String.fromCharCode.call(null, ...byteArray)); +} +function toUint8Array$1(base64EncodedByteArray) { + return new Uint8Array(window.atob(base64EncodedByteArray).split("").map((c2) => c2.charCodeAt(0))); +} +function getPayloadFromTransaction(transaction2) { + const serializedTransaction = "version" in transaction2 ? transaction2.serialize() : transaction2.serialize({ + requireAllSignatures: false, + verifySignatures: false + }); + const payload = fromUint8Array(serializedTransaction); + return payload; +} +function getTransactionFromWireMessage(byteArray) { + const numSignatures = byteArray[0]; + const messageOffset = numSignatures * SIGNATURE_LENGTH_IN_BYTES$1 + 1; + const version2 = VersionedMessage.deserializeMessageVersion(byteArray.slice(messageOffset, byteArray.length)); + if (version2 === "legacy") { + return Transaction$2.from(byteArray); + } else { + return VersionedTransaction.deserialize(byteArray); + } +} +function transact(callback, config2) { + return __awaiter$4(this, void 0, void 0, function* () { + const augmentedCallback = (wallet) => { + const augmentedAPI = new Proxy({}, { + get(target, p3) { + if (target[p3] == null) { + switch (p3) { + case "signAndSendTransactions": + target[p3] = function(_a3) { + var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a3, rest = __rest(_a3, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]); + return __awaiter$4(this, void 0, void 0, function* () { + const payloads = transactions.map(getPayloadFromTransaction); + const options = { + min_context_slot: minContextSlot, + commitment, + skip_preflight: skipPreflight, + max_retries: maxRetries, + wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction + }; + const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), Object.values(options).some((element) => element != null) ? { options } : null), { payloads })); + const signatures = base64EncodedSignatures.map(toUint8Array$1).map(bs58$1.encode); + return signatures; + }); + }; + break; + case "signMessages": + target[p3] = function(_a3) { + var { payloads } = _a3, rest = __rest(_a3, ["payloads"]); + return __awaiter$4(this, void 0, void 0, function* () { + const base64EncodedPayloads = payloads.map(fromUint8Array); + const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads })); + const signedMessages = base64EncodedSignedMessages.map(toUint8Array$1); + return signedMessages; + }); + }; + break; + case "signTransactions": + target[p3] = function(_a3) { + var { transactions } = _a3, rest = __rest(_a3, ["transactions"]); + return __awaiter$4(this, void 0, void 0, function* () { + const payloads = transactions.map(getPayloadFromTransaction); + const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads })); + const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array$1); + const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage); + return signedTransactions; + }); + }; + break; + default: { + target[p3] = wallet[p3]; + break; + } + } + } + return target[p3]; + }, + defineProperty() { + return false; + }, + deleteProperty() { + return false; + } + }); + return callback(augmentedAPI); + }; + return yield transact$1(augmentedCallback, config2); + }); +} +function __awaiter$3(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve) { + resolve(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e18) { + reject(e18); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e18) { + reject(e18); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function toUint8Array(base64EncodedByteArray) { + return new Uint8Array(window.atob(base64EncodedByteArray).split("").map((c2) => c2.charCodeAt(0))); +} +function getIsSupported() { + return typeof window !== "undefined" && window.isSecureContext && typeof document !== "undefined" && /android/i.test(navigator.userAgent); +} +const SolanaMobileWalletAdapterWalletName = "Mobile Wallet Adapter"; +const SIGNATURE_LENGTH_IN_BYTES = 64; +function getPublicKeyFromAddress(address2) { + const publicKeyByteArray = toUint8Array(address2); + return new PublicKey(publicKeyByteArray); +} +function isVersionedTransaction(transaction2) { + return "version" in transaction2; +} +class SolanaMobileWalletAdapter extends BaseSignInMessageSignerWalletAdapter { + constructor(config2) { + var _a3; + super(); + this.supportedTransactionVersions = /* @__PURE__ */ new Set( + // FIXME(#244): We can't actually know what versions are supported until we know which wallet we're talking to. + ["legacy", 0] + ); + this.name = SolanaMobileWalletAdapterWalletName; + this.url = "https://solanamobile.com/wallets"; + this.icon = "data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI4IiB3aWR0aD0iMjgiIHZpZXdCb3g9Ii0zIDAgMjggMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0RDQjhGRiI+PHBhdGggZD0iTTE3LjQgMTcuNEgxNXYyLjRoMi40di0yLjRabTEuMi05LjZoLTIuNHYyLjRoMi40VjcuOFoiLz48cGF0aCBkPSJNMjEuNiAzVjBoLTIuNHYzaC0zLjZWMGgtMi40djNoLTIuNHY2LjZINC41YTIuMSAyLjEgMCAxIDEgMC00LjJoMi43VjNINC41QTQuNSA0LjUgMCAwIDAgMCA3LjVWMjRoMjEuNnYtNi42aC0yLjR2NC4ySDIuNFYxMS41Yy41LjMgMS4yLjQgMS44LjVoNy41QTYuNiA2LjYgMCAwIDAgMjQgOVYzaC0yLjRabTAgNS43YTQuMiA0LjIgMCAxIDEtOC40IDBWNS40aDguNHYzLjNaIi8+PC9nPjwvc3ZnPg=="; + this._connecting = false; + this._connectionGeneration = 0; + this._readyState = getIsSupported() ? WalletReadyState$2.Loadable : WalletReadyState$2.Unsupported; + this._authorizationResultCache = config2.authorizationResultCache; + this._addressSelector = config2.addressSelector; + this._appIdentity = config2.appIdentity; + this._chain = (_a3 = config2.chain) !== null && _a3 !== void 0 ? _a3 : config2.cluster; + this._onWalletNotFound = config2.onWalletNotFound; + if (this._readyState !== WalletReadyState$2.Unsupported) { + this._authorizationResultCache.get().then((authorizationResult) => { + if (authorizationResult) { + this.declareWalletAsInstalled(); + } + }); + } + } + get publicKey() { + if (this._publicKey == null && this._selectedAddress != null) { + try { + this._publicKey = getPublicKeyFromAddress(this._selectedAddress); + } catch (e18) { + throw new WalletPublicKeyError(e18 instanceof Error && (e18 === null || e18 === void 0 ? void 0 : e18.message) || "Unknown error", e18); + } + } + return this._publicKey ? this._publicKey : null; + } + get connected() { + return !!this._authorizationResult; + } + get connecting() { + return this._connecting; + } + get readyState() { + return this._readyState; + } + declareWalletAsInstalled() { + if (this._readyState !== WalletReadyState$2.Installed) { + this.emit("readyStateChange", this._readyState = WalletReadyState$2.Installed); + } + } + runWithGuard(callback) { + return __awaiter$3(this, void 0, void 0, function* () { + try { + return yield callback(); + } catch (e18) { + this.emit("error", e18); + throw e18; + } + }); + } + /** @deprecated Use `autoConnect()` instead. */ + autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED() { + return __awaiter$3(this, void 0, void 0, function* () { + return yield this.autoConnect(); + }); + } + autoConnect() { + return __awaiter$3(this, void 0, void 0, function* () { + if (this.connecting || this.connected) { + return; + } + return yield this.runWithGuard(() => __awaiter$3(this, void 0, void 0, function* () { + if (this._readyState !== WalletReadyState$2.Installed && this._readyState !== WalletReadyState$2.Loadable) { + throw new WalletNotReadyError(); + } + this._connecting = true; + try { + const cachedAuthorizationResult = yield this._authorizationResultCache.get(); + if (cachedAuthorizationResult) { + this.handleAuthorizationResult(cachedAuthorizationResult); + } + } catch (e18) { + throw new WalletConnectionError$1(e18 instanceof Error && e18.message || "Unknown error", e18); + } finally { + this._connecting = false; + } + })); + }); + } + connect() { + return __awaiter$3(this, void 0, void 0, function* () { + if (this.connecting || this.connected) { + return; + } + return yield this.runWithGuard(() => __awaiter$3(this, void 0, void 0, function* () { + if (this._readyState !== WalletReadyState$2.Installed && this._readyState !== WalletReadyState$2.Loadable) { + throw new WalletNotReadyError(); + } + this._connecting = true; + try { + yield this.performAuthorization(); + } catch (e18) { + throw new WalletConnectionError$1(e18 instanceof Error && e18.message || "Unknown error", e18); + } finally { + this._connecting = false; + } + })); + }); + } + performAuthorization(signInPayload) { + return __awaiter$3(this, void 0, void 0, function* () { + try { + const cachedAuthorizationResult = yield this._authorizationResultCache.get(); + if (cachedAuthorizationResult) { + this.handleAuthorizationResult(cachedAuthorizationResult); + return cachedAuthorizationResult; + } + return yield this.transact((wallet) => __awaiter$3(this, void 0, void 0, function* () { + const authorizationResult = yield wallet.authorize({ + chain: this._chain, + identity: this._appIdentity, + sign_in_payload: signInPayload + }); + Promise.all([ + this._authorizationResultCache.set(authorizationResult), + this.handleAuthorizationResult(authorizationResult) + ]); + return authorizationResult; + })); + } catch (e18) { + throw new WalletConnectionError$1(e18 instanceof Error && e18.message || "Unknown error", e18); + } + }); + } + handleAuthorizationResult(authorizationResult) { + var _a3; + return __awaiter$3(this, void 0, void 0, function* () { + const didPublicKeysChange = ( + // Case 1: We started from having no authorization. + this._authorizationResult == null || // Case 2: The number of authorized accounts changed. + ((_a3 = this._authorizationResult) === null || _a3 === void 0 ? void 0 : _a3.accounts.length) !== authorizationResult.accounts.length || // Case 3: The new list of addresses isn't exactly the same as the old list, in the same order. + this._authorizationResult.accounts.some((account, ii2) => account.address !== authorizationResult.accounts[ii2].address) + ); + this._authorizationResult = authorizationResult; + this.declareWalletAsInstalled(); + if (didPublicKeysChange) { + const nextSelectedAddress = yield this._addressSelector.select(authorizationResult.accounts.map(({ address: address2 }) => address2)); + if (nextSelectedAddress !== this._selectedAddress) { + this._selectedAddress = nextSelectedAddress; + delete this._publicKey; + this.emit( + "connect", + // Having just set `this._selectedAddress`, `this.publicKey` is definitely non-null + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.publicKey + ); + } + } + }); + } + performReauthorization(wallet, authToken) { + return __awaiter$3(this, void 0, void 0, function* () { + try { + const authorizationResult = yield wallet.authorize({ + auth_token: authToken, + identity: this._appIdentity + }); + Promise.all([ + this._authorizationResultCache.set(authorizationResult), + this.handleAuthorizationResult(authorizationResult) + ]); + } catch (e18) { + this.disconnect(); + throw new WalletDisconnectedError$1(e18 instanceof Error && (e18 === null || e18 === void 0 ? void 0 : e18.message) || "Unknown error", e18); + } + }); + } + disconnect() { + return __awaiter$3(this, void 0, void 0, function* () { + this._authorizationResultCache.clear(); + this._connecting = false; + this._connectionGeneration++; + delete this._authorizationResult; + delete this._publicKey; + delete this._selectedAddress; + this.emit("disconnect"); + }); + } + transact(callback) { + var _a3; + return __awaiter$3(this, void 0, void 0, function* () { + const walletUriBase = (_a3 = this._authorizationResult) === null || _a3 === void 0 ? void 0 : _a3.wallet_uri_base; + const config2 = walletUriBase ? { baseUri: walletUriBase } : void 0; + const currentConnectionGeneration = this._connectionGeneration; + try { + return yield transact(callback, config2); + } catch (e18) { + if (this._connectionGeneration !== currentConnectionGeneration) { + yield new Promise(() => { + }); + } + if (e18 instanceof Error && e18.name === "SolanaMobileWalletAdapterError" && e18.code === "ERROR_WALLET_NOT_FOUND") { + yield this._onWalletNotFound(this); + } + throw e18; + } + }); + } + assertIsAuthorized() { + if (!this._authorizationResult || !this._selectedAddress) + throw new WalletNotConnectedError(); + return { + authToken: this._authorizationResult.auth_token, + selectedAddress: this._selectedAddress + }; + } + performSignTransactions(transactions) { + return __awaiter$3(this, void 0, void 0, function* () { + const { authToken } = this.assertIsAuthorized(); + try { + return yield this.transact((wallet) => __awaiter$3(this, void 0, void 0, function* () { + yield this.performReauthorization(wallet, authToken); + const signedTransactions = yield wallet.signTransactions({ + transactions + }); + return signedTransactions; + })); + } catch (error) { + throw new WalletSignTransactionError$1(error === null || error === void 0 ? void 0 : error.message, error); + } + }); + } + sendTransaction(transaction2, connection, options) { + return __awaiter$3(this, void 0, void 0, function* () { + return yield this.runWithGuard(() => __awaiter$3(this, void 0, void 0, function* () { + const { authToken } = this.assertIsAuthorized(); + const minContextSlot = options === null || options === void 0 ? void 0 : options.minContextSlot; + try { + return yield this.transact((wallet) => __awaiter$3(this, void 0, void 0, function* () { + function getTargetCommitment() { + let targetCommitment; + switch (connection.commitment) { + case "confirmed": + case "finalized": + case "processed": + targetCommitment = connection.commitment; + break; + default: + targetCommitment = "finalized"; + } + let targetPreflightCommitment; + switch (options === null || options === void 0 ? void 0 : options.preflightCommitment) { + case "confirmed": + case "finalized": + case "processed": + targetPreflightCommitment = options.preflightCommitment; + break; + case void 0: + targetPreflightCommitment = targetCommitment; + break; + default: + targetPreflightCommitment = "finalized"; + } + const preflightCommitmentScore = targetPreflightCommitment === "finalized" ? 2 : targetPreflightCommitment === "confirmed" ? 1 : 0; + const targetCommitmentScore = targetCommitment === "finalized" ? 2 : targetCommitment === "confirmed" ? 1 : 0; + return preflightCommitmentScore < targetCommitmentScore ? targetPreflightCommitment : targetCommitment; + } + const [capabilities, _12, _22] = yield Promise.all([ + wallet.getCapabilities(), + this.performReauthorization(wallet, authToken), + isVersionedTransaction(transaction2) ? null : ( + /** + * Unlike versioned transactions, legacy `Transaction` objects + * may not have an associated `feePayer` or `recentBlockhash`. + * This code exists to patch them up in case they are missing. + */ + (() => __awaiter$3(this, void 0, void 0, function* () { + var _a3; + transaction2.feePayer || (transaction2.feePayer = (_a3 = this.publicKey) !== null && _a3 !== void 0 ? _a3 : void 0); + if (transaction2.recentBlockhash == null) { + const { blockhash } = yield connection.getLatestBlockhash({ + commitment: getTargetCommitment() + }); + transaction2.recentBlockhash = blockhash; + } + }))() + ) + ]); + if (capabilities.supports_sign_and_send_transactions) { + const signatures = yield wallet.signAndSendTransactions({ + minContextSlot, + transactions: [transaction2] + }); + return signatures[0]; + } else { + const [signedTransaction] = yield wallet.signTransactions({ + transactions: [transaction2] + }); + if (isVersionedTransaction(signedTransaction)) { + return yield connection.sendTransaction(signedTransaction); + } else { + const serializedTransaction = signedTransaction.serialize(); + return yield connection.sendRawTransaction(serializedTransaction, Object.assign(Object.assign({}, options), { preflightCommitment: getTargetCommitment() })); + } + } + })); + } catch (error) { + throw new WalletSendTransactionError(error === null || error === void 0 ? void 0 : error.message, error); + } + })); + }); + } + signTransaction(transaction2) { + return __awaiter$3(this, void 0, void 0, function* () { + return yield this.runWithGuard(() => __awaiter$3(this, void 0, void 0, function* () { + const [signedTransaction] = yield this.performSignTransactions([transaction2]); + return signedTransaction; + })); + }); + } + signAllTransactions(transactions) { + return __awaiter$3(this, void 0, void 0, function* () { + return yield this.runWithGuard(() => __awaiter$3(this, void 0, void 0, function* () { + const signedTransactions = yield this.performSignTransactions(transactions); + return signedTransactions; + })); + }); + } + signMessage(message2) { + return __awaiter$3(this, void 0, void 0, function* () { + return yield this.runWithGuard(() => __awaiter$3(this, void 0, void 0, function* () { + const { authToken, selectedAddress } = this.assertIsAuthorized(); + try { + return yield this.transact((wallet) => __awaiter$3(this, void 0, void 0, function* () { + yield this.performReauthorization(wallet, authToken); + const [signedMessage] = yield wallet.signMessages({ + addresses: [selectedAddress], + payloads: [message2] + }); + const signature2 = signedMessage.slice(-SIGNATURE_LENGTH_IN_BYTES); + return signature2; + })); + } catch (error) { + throw new WalletSignMessageError$1(error === null || error === void 0 ? void 0 : error.message, error); + } + })); + }); + } + signIn(input) { + return __awaiter$3(this, void 0, void 0, function* () { + return yield this.runWithGuard(() => __awaiter$3(this, void 0, void 0, function* () { + var _a3, _b2; + if (this._readyState !== WalletReadyState$2.Installed && this._readyState !== WalletReadyState$2.Loadable) { + throw new WalletNotReadyError(); + } + this._connecting = true; + try { + const authorizationResult = yield this.performAuthorization(Object.assign(Object.assign({}, input), { domain: (_a3 = input === null || input === void 0 ? void 0 : input.domain) !== null && _a3 !== void 0 ? _a3 : window.location.host })); + if (!authorizationResult.sign_in_result) { + throw new Error("Sign in failed, no sign in result returned by wallet"); + } + const signedInAddress = authorizationResult.sign_in_result.address; + const signedInAccount = Object.assign(Object.assign({}, (_b2 = authorizationResult.accounts.find((acc) => acc.address == signedInAddress)) !== null && _b2 !== void 0 ? _b2 : { + address: signedInAddress + }), { publicKey: toUint8Array(signedInAddress) }); + return { + account: signedInAccount, + signedMessage: toUint8Array(authorizationResult.sign_in_result.signed_message), + signature: toUint8Array(authorizationResult.sign_in_result.signature) + }; + } catch (e18) { + throw new WalletConnectionError$1(e18 instanceof Error && e18.message || "Unknown error", e18); + } finally { + this._connecting = false; + } + })); + }); + } +} +function createDefaultAddressSelector() { + return { + select(addresses) { + return __awaiter$3(this, void 0, void 0, function* () { + return addresses[0]; + }); + } + }; +} +const CACHE_KEY = "SolanaMobileWalletAdapterDefaultAuthorizationCache"; +function createDefaultAuthorizationResultCache() { + let storage; + try { + storage = window.localStorage; + } catch (_a3) { + } + return { + clear() { + return __awaiter$3(this, void 0, void 0, function* () { + if (!storage) { + return; + } + try { + storage.removeItem(CACHE_KEY); + } catch (_a3) { + } + }); + }, + get() { + return __awaiter$3(this, void 0, void 0, function* () { + if (!storage) { + return; + } + try { + return JSON.parse(storage.getItem(CACHE_KEY)) || void 0; + } catch (_a3) { + } + }); + }, + set(authorizationResult) { + return __awaiter$3(this, void 0, void 0, function* () { + if (!storage) { + return; + } + try { + storage.setItem(CACHE_KEY, JSON.stringify(authorizationResult)); + } catch (_a3) { + } + }); + } + }; +} +function defaultWalletNotFoundHandler(mobileWalletAdapter) { + return __awaiter$3(this, void 0, void 0, function* () { + if (typeof window !== "undefined") { + window.location.assign(mobileWalletAdapter.url); + } + }); +} +function createDefaultWalletNotFoundHandler() { + return defaultWalletNotFoundHandler; +} +globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f4) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state.set(receiver, value), value; +}; +globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f4) { + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver); +}; +function arraysEqual(a3, b2) { + if (a3 === b2) + return true; + const length = a3.length; + if (length !== b2.length) + return false; + for (let i2 = 0; i2 < length; i2++) { + if (a3[i2] !== b2[i2]) + return false; + } + return true; +} +var __classPrivateFieldSet$3 = globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f4) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state.set(receiver, value), value; +}; +var __classPrivateFieldGet$3 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f4) { + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver); +}; +var _StandardWalletAdapter_instances, _StandardWalletAdapter_account, _StandardWalletAdapter_publicKey, _StandardWalletAdapter_connecting, _StandardWalletAdapter_disconnecting, _StandardWalletAdapter_off, _StandardWalletAdapter_supportedTransactionVersions, _StandardWalletAdapter_wallet, _StandardWalletAdapter_readyState, _StandardWalletAdapter_connect, _StandardWalletAdapter_connected, _StandardWalletAdapter_disconnected, _StandardWalletAdapter_reset, _StandardWalletAdapter_changed, _StandardWalletAdapter_signTransaction, _StandardWalletAdapter_signAllTransactions, _StandardWalletAdapter_signMessage, _StandardWalletAdapter_signIn; +class StandardWalletAdapter extends BaseWalletAdapter { + constructor({ wallet }) { + super(); + _StandardWalletAdapter_instances.add(this); + _StandardWalletAdapter_account.set(this, void 0); + _StandardWalletAdapter_publicKey.set(this, void 0); + _StandardWalletAdapter_connecting.set(this, void 0); + _StandardWalletAdapter_disconnecting.set(this, void 0); + _StandardWalletAdapter_off.set(this, void 0); + _StandardWalletAdapter_supportedTransactionVersions.set(this, void 0); + _StandardWalletAdapter_wallet.set(this, void 0); + _StandardWalletAdapter_readyState.set(this, typeof window === "undefined" || typeof document === "undefined" ? WalletReadyState$2.Unsupported : WalletReadyState$2.Installed); + _StandardWalletAdapter_changed.set(this, (properties) => { + if ("accounts" in properties) { + const account = __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").accounts[0]; + if (__classPrivateFieldGet$3(this, _StandardWalletAdapter_account, "f") && !__classPrivateFieldGet$3(this, _StandardWalletAdapter_disconnecting, "f") && account !== __classPrivateFieldGet$3(this, _StandardWalletAdapter_account, "f")) { + if (account) { + __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connected).call(this, account); + } else { + this.emit("error", new WalletDisconnectedError$1()); + __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_disconnected).call(this); + } + } + } + if ("features" in properties) { + __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_reset).call(this); + } + }); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_wallet, wallet, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_account, null, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_publicKey, null, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_connecting, false, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_disconnecting, false, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_off, __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[StandardEvents].on("change", __classPrivateFieldGet$3(this, _StandardWalletAdapter_changed, "f")), "f"); + __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_reset).call(this); + } + get name() { + return __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").name; + } + get url() { + return "https://github.com/solana-labs/wallet-standard"; + } + get icon() { + return __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").icon; + } + get readyState() { + return __classPrivateFieldGet$3(this, _StandardWalletAdapter_readyState, "f"); + } + get publicKey() { + return __classPrivateFieldGet$3(this, _StandardWalletAdapter_publicKey, "f"); + } + get connecting() { + return __classPrivateFieldGet$3(this, _StandardWalletAdapter_connecting, "f"); + } + get supportedTransactionVersions() { + return __classPrivateFieldGet$3(this, _StandardWalletAdapter_supportedTransactionVersions, "f"); + } + get wallet() { + return __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f"); + } + get standard() { + return true; + } + destroy() { + __classPrivateFieldSet$3(this, _StandardWalletAdapter_account, null, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_publicKey, null, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_connecting, false, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_disconnecting, false, "f"); + const off = __classPrivateFieldGet$3(this, _StandardWalletAdapter_off, "f"); + if (off) { + __classPrivateFieldSet$3(this, _StandardWalletAdapter_off, null, "f"); + off(); + } + } + async autoConnect() { + return __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connect).call(this, { silent: true }); + } + async connect() { + return __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connect).call(this); + } + async disconnect() { + if (StandardDisconnect in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features) { + try { + __classPrivateFieldSet$3(this, _StandardWalletAdapter_disconnecting, true, "f"); + await __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[StandardDisconnect].disconnect(); + } catch (error) { + this.emit("error", new WalletDisconnectionError(error == null ? void 0 : error.message, error)); + } finally { + __classPrivateFieldSet$3(this, _StandardWalletAdapter_disconnecting, false, "f"); + } + } + __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_disconnected).call(this); + } + async sendTransaction(transaction2, connection, options = {}) { + try { + const account = __classPrivateFieldGet$3(this, _StandardWalletAdapter_account, "f"); + if (!account) + throw new WalletNotConnectedError(); + let feature; + if (SolanaSignAndSendTransaction in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features) { + if (account.features.includes(SolanaSignAndSendTransaction)) { + feature = SolanaSignAndSendTransaction; + } else if (SolanaSignTransaction in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features && account.features.includes(SolanaSignTransaction)) { + feature = SolanaSignTransaction; + } else { + throw new WalletAccountError(); + } + } else if (SolanaSignTransaction in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features) { + if (!account.features.includes(SolanaSignTransaction)) + throw new WalletAccountError(); + feature = SolanaSignTransaction; + } else { + throw new WalletConfigError(); + } + const chain = getChainForEndpoint(connection.rpcEndpoint); + if (!account.chains.includes(chain)) + throw new WalletSendTransactionError(); + try { + const { signers, ...sendOptions } = options; + let serializedTransaction; + if (isVersionedTransaction$1(transaction2)) { + (signers == null ? void 0 : signers.length) && transaction2.sign(signers); + serializedTransaction = transaction2.serialize(); + } else { + transaction2 = await this.prepareTransaction(transaction2, connection, sendOptions); + (signers == null ? void 0 : signers.length) && transaction2.partialSign(...signers); + serializedTransaction = new Uint8Array(transaction2.serialize({ + requireAllSignatures: false, + verifySignatures: false + })); + } + if (feature === SolanaSignAndSendTransaction) { + const [output2] = await __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignAndSendTransaction].signAndSendTransaction({ + account, + chain, + transaction: serializedTransaction, + options: { + preflightCommitment: getCommitment(sendOptions.preflightCommitment || connection.commitment), + skipPreflight: sendOptions.skipPreflight, + maxRetries: sendOptions.maxRetries, + minContextSlot: sendOptions.minContextSlot + } + }); + return bs58$1.encode(output2.signature); + } else { + const [output2] = await __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignTransaction].signTransaction({ + account, + chain, + transaction: serializedTransaction, + options: { + preflightCommitment: getCommitment(sendOptions.preflightCommitment || connection.commitment), + minContextSlot: sendOptions.minContextSlot + } + }); + return await connection.sendRawTransaction(output2.signedTransaction, { + ...sendOptions, + preflightCommitment: getCommitment(sendOptions.preflightCommitment || connection.commitment) + }); + } + } catch (error) { + if (error instanceof WalletError$2) + throw error; + throw new WalletSendTransactionError(error == null ? void 0 : error.message, error); + } + } catch (error) { + this.emit("error", error); + throw error; + } + } +} +_StandardWalletAdapter_account = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_publicKey = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_connecting = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_disconnecting = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_off = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_supportedTransactionVersions = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_wallet = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_readyState = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_changed = /* @__PURE__ */ new WeakMap(), _StandardWalletAdapter_instances = /* @__PURE__ */ new WeakSet(), _StandardWalletAdapter_connect = async function _StandardWalletAdapter_connect2(input) { + try { + if (this.connected || this.connecting) + return; + if (__classPrivateFieldGet$3(this, _StandardWalletAdapter_readyState, "f") !== WalletReadyState$2.Installed) + throw new WalletNotReadyError(); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_connecting, true, "f"); + if (!__classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").accounts.length) { + try { + await __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[StandardConnect].connect(input); + } catch (error) { + throw new WalletConnectionError$1(error == null ? void 0 : error.message, error); + } + } + const account = __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").accounts[0]; + if (!account) + throw new WalletAccountError(); + __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connected).call(this, account); + } catch (error) { + this.emit("error", error); + throw error; + } finally { + __classPrivateFieldSet$3(this, _StandardWalletAdapter_connecting, false, "f"); + } +}, _StandardWalletAdapter_connected = function _StandardWalletAdapter_connected2(account) { + let publicKey2; + try { + publicKey2 = new PublicKey(account.address); + } catch (error) { + throw new WalletPublicKeyError(error == null ? void 0 : error.message, error); + } + __classPrivateFieldSet$3(this, _StandardWalletAdapter_account, account, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_publicKey, publicKey2, "f"); + __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_reset).call(this); + this.emit("connect", publicKey2); +}, _StandardWalletAdapter_disconnected = function _StandardWalletAdapter_disconnected2() { + __classPrivateFieldSet$3(this, _StandardWalletAdapter_account, null, "f"); + __classPrivateFieldSet$3(this, _StandardWalletAdapter_publicKey, null, "f"); + __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_reset).call(this); + this.emit("disconnect"); +}, _StandardWalletAdapter_reset = function _StandardWalletAdapter_reset2() { + var _a3, _b2; + const supportedTransactionVersions = SolanaSignAndSendTransaction in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features ? __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignAndSendTransaction].supportedTransactionVersions : __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignTransaction].supportedTransactionVersions; + __classPrivateFieldSet$3(this, _StandardWalletAdapter_supportedTransactionVersions, arraysEqual(supportedTransactionVersions, ["legacy"]) ? null : new Set(supportedTransactionVersions), "f"); + if (SolanaSignTransaction in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features && ((_a3 = __classPrivateFieldGet$3(this, _StandardWalletAdapter_account, "f")) == null ? void 0 : _a3.features.includes(SolanaSignTransaction))) { + this.signTransaction = __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_signTransaction); + this.signAllTransactions = __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_signAllTransactions); + } else { + delete this.signTransaction; + delete this.signAllTransactions; + } + if (SolanaSignMessage in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features && ((_b2 = __classPrivateFieldGet$3(this, _StandardWalletAdapter_account, "f")) == null ? void 0 : _b2.features.includes(SolanaSignMessage))) { + this.signMessage = __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_signMessage); + } else { + delete this.signMessage; + } + if (SolanaSignIn in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features) { + this.signIn = __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_signIn); + } else { + delete this.signIn; + } +}, _StandardWalletAdapter_signTransaction = async function _StandardWalletAdapter_signTransaction2(transaction2) { + try { + const account = __classPrivateFieldGet$3(this, _StandardWalletAdapter_account, "f"); + if (!account) + throw new WalletNotConnectedError(); + if (!(SolanaSignTransaction in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features)) + throw new WalletConfigError(); + if (!account.features.includes(SolanaSignTransaction)) + throw new WalletAccountError(); + try { + const signedTransactions = await __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignTransaction].signTransaction({ + account, + transaction: isVersionedTransaction$1(transaction2) ? transaction2.serialize() : new Uint8Array(transaction2.serialize({ + requireAllSignatures: false, + verifySignatures: false + })) + }); + const serializedTransaction = signedTransactions[0].signedTransaction; + return isVersionedTransaction$1(transaction2) ? VersionedTransaction.deserialize(serializedTransaction) : Transaction$2.from(serializedTransaction); + } catch (error) { + if (error instanceof WalletError$2) + throw error; + throw new WalletSignTransactionError$1(error == null ? void 0 : error.message, error); + } + } catch (error) { + this.emit("error", error); + throw error; + } +}, _StandardWalletAdapter_signAllTransactions = async function _StandardWalletAdapter_signAllTransactions2(transactions) { + try { + const account = __classPrivateFieldGet$3(this, _StandardWalletAdapter_account, "f"); + if (!account) + throw new WalletNotConnectedError(); + if (!(SolanaSignTransaction in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features)) + throw new WalletConfigError(); + if (!account.features.includes(SolanaSignTransaction)) + throw new WalletAccountError(); + try { + const signedTransactions = await __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignTransaction].signTransaction(...transactions.map((transaction2) => ({ + account, + transaction: isVersionedTransaction$1(transaction2) ? transaction2.serialize() : new Uint8Array(transaction2.serialize({ + requireAllSignatures: false, + verifySignatures: false + })) + }))); + return transactions.map((transaction2, index2) => { + const signedTransaction = signedTransactions[index2].signedTransaction; + return isVersionedTransaction$1(transaction2) ? VersionedTransaction.deserialize(signedTransaction) : Transaction$2.from(signedTransaction); + }); + } catch (error) { + throw new WalletSignTransactionError$1(error == null ? void 0 : error.message, error); + } + } catch (error) { + this.emit("error", error); + throw error; + } +}, _StandardWalletAdapter_signMessage = async function _StandardWalletAdapter_signMessage2(message2) { + try { + const account = __classPrivateFieldGet$3(this, _StandardWalletAdapter_account, "f"); + if (!account) + throw new WalletNotConnectedError(); + if (!(SolanaSignMessage in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features)) + throw new WalletConfigError(); + if (!account.features.includes(SolanaSignMessage)) + throw new WalletAccountError(); + try { + const signedMessages = await __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignMessage].signMessage({ + account, + message: message2 + }); + return signedMessages[0].signature; + } catch (error) { + throw new WalletSignMessageError$1(error == null ? void 0 : error.message, error); + } + } catch (error) { + this.emit("error", error); + throw error; + } +}, _StandardWalletAdapter_signIn = async function _StandardWalletAdapter_signIn2(input = {}) { + try { + if (!(SolanaSignIn in __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features)) + throw new WalletConfigError(); + let output2; + try { + [output2] = await __classPrivateFieldGet$3(this, _StandardWalletAdapter_wallet, "f").features[SolanaSignIn].signIn(input); + } catch (error) { + throw new WalletSignInError(error == null ? void 0 : error.message, error); + } + if (!output2) + throw new WalletSignInError(); + __classPrivateFieldGet$3(this, _StandardWalletAdapter_instances, "m", _StandardWalletAdapter_connected).call(this, output2.account); + return output2; + } catch (error) { + this.emit("error", error); + throw error; + } +}; +const isWalletAdapterCompatibleWallet = isWalletAdapterCompatibleStandardWallet; +var __classPrivateFieldSet$2 = globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f4) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state.set(receiver, value), value; +}; +var __classPrivateFieldGet$2 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f4) { + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver); +}; +var _AppReadyEvent_detail; +let wallets = void 0; +const registered = /* @__PURE__ */ new Set(); +const listeners2 = {}; +function getWallets() { + if (wallets) + return wallets; + wallets = Object.freeze({ register, get, on }); + if (typeof window === "undefined") + return wallets; + const api = Object.freeze({ register }); + try { + window.addEventListener("wallet-standard:register-wallet", ({ detail: callback }) => callback(api)); + } catch (error) { + console.error("wallet-standard:register-wallet event listener could not be added\n", error); + } + try { + window.dispatchEvent(new AppReadyEvent(api)); + } catch (error) { + console.error("wallet-standard:app-ready event could not be dispatched\n", error); + } + return wallets; +} +function register(...wallets2) { + var _a3; + wallets2 = wallets2.filter((wallet) => !registered.has(wallet)); + if (!wallets2.length) + return () => { + }; + wallets2.forEach((wallet) => registered.add(wallet)); + (_a3 = listeners2["register"]) == null ? void 0 : _a3.forEach((listener) => guard(() => listener(...wallets2))); + return function unregister() { + var _a4; + wallets2.forEach((wallet) => registered.delete(wallet)); + (_a4 = listeners2["unregister"]) == null ? void 0 : _a4.forEach((listener) => guard(() => listener(...wallets2))); + }; +} +function get() { + return [...registered]; +} +function on(event, listener) { + var _a3; + ((_a3 = listeners2[event]) == null ? void 0 : _a3.push(listener)) || (listeners2[event] = [listener]); + return function off() { + var _a4; + listeners2[event] = (_a4 = listeners2[event]) == null ? void 0 : _a4.filter((existingListener) => listener !== existingListener); + }; +} +function guard(callback) { + try { + callback(); + } catch (error) { + console.error(error); + } +} +class AppReadyEvent extends Event { + constructor(api) { + super("wallet-standard:app-ready", { + bubbles: false, + cancelable: false, + composed: false + }); + _AppReadyEvent_detail.set(this, void 0); + __classPrivateFieldSet$2(this, _AppReadyEvent_detail, api, "f"); + } + get detail() { + return __classPrivateFieldGet$2(this, _AppReadyEvent_detail, "f"); + } + get type() { + return "wallet-standard:app-ready"; + } + /** @deprecated */ + preventDefault() { + throw new Error("preventDefault cannot be called"); + } + /** @deprecated */ + stopImmediatePropagation() { + throw new Error("stopImmediatePropagation cannot be called"); + } + /** @deprecated */ + stopPropagation() { + throw new Error("stopPropagation cannot be called"); + } +} +_AppReadyEvent_detail = /* @__PURE__ */ new WeakMap(); +function DEPRECATED_getWallets() { + if (wallets) + return wallets; + wallets = getWallets(); + if (typeof window === "undefined") + return wallets; + const callbacks = window.navigator.wallets || []; + if (!Array.isArray(callbacks)) { + console.error("window.navigator.wallets is not an array"); + return wallets; + } + const { register: register2 } = wallets; + const push = (...callbacks2) => callbacks2.forEach((callback) => guard(() => callback({ register: register2 }))); + try { + Object.defineProperty(window.navigator, "wallets", { + value: Object.freeze({ push }) + }); + } catch (error) { + console.error("window.navigator.wallets could not be set"); + return wallets; + } + push(...callbacks); + return wallets; +} +function useStandardWalletAdapters(adapters2) { + const warnings = useConstant(() => /* @__PURE__ */ new Set()); + const { get: get2, on: on2 } = useConstant(() => DEPRECATED_getWallets()); + const [standardAdapters, setStandardAdapters] = reactExports.useState(() => wrapWalletsWithAdapters(get2())); + reactExports.useEffect(() => { + const listeners3 = [ + on2("register", (...wallets2) => setStandardAdapters((standardAdapters2) => [...standardAdapters2, ...wrapWalletsWithAdapters(wallets2)])), + on2("unregister", (...wallets2) => setStandardAdapters((standardAdapters2) => standardAdapters2.filter((standardAdapter) => wallets2.some((wallet) => wallet === standardAdapter.wallet)))) + ]; + return () => listeners3.forEach((off) => off()); + }, [on2]); + const prevStandardAdapters = usePrevious(standardAdapters); + reactExports.useEffect(() => { + if (!prevStandardAdapters) + return; + const currentAdapters = new Set(standardAdapters); + const removedAdapters = new Set(prevStandardAdapters.filter((previousAdapter) => !currentAdapters.has(previousAdapter))); + removedAdapters.forEach((adapter) => adapter.destroy()); + }, [prevStandardAdapters, standardAdapters]); + reactExports.useEffect(() => () => standardAdapters.forEach((adapter) => adapter.destroy()), []); + return reactExports.useMemo(() => [ + ...standardAdapters, + ...adapters2.filter(({ name: name2 }) => { + if (standardAdapters.some((standardAdapter) => standardAdapter.name === name2)) { + if (!warnings.has(name2)) { + warnings.add(name2); + console.warn(`${name2} was registered as a Standard Wallet. The Wallet Adapter for ${name2} can be removed from your app.`); + } + return false; + } + return true; + }) + ], [standardAdapters, adapters2, warnings]); +} +function useConstant(fn2) { + const ref = reactExports.useRef(); + if (!ref.current) { + ref.current = { value: fn2() }; + } + return ref.current.value; +} +function usePrevious(state) { + const ref = reactExports.useRef(); + reactExports.useEffect(() => { + ref.current = state; + }); + return ref.current; +} +function wrapWalletsWithAdapters(wallets2) { + return wallets2.filter(isWalletAdapterCompatibleWallet).map((wallet) => new StandardWalletAdapter({ wallet })); +} +var Environment; +(function(Environment2) { + Environment2[Environment2["DESKTOP_WEB"] = 0] = "DESKTOP_WEB"; + Environment2[Environment2["MOBILE_WEB"] = 1] = "MOBILE_WEB"; +})(Environment || (Environment = {})); +function isWebView(userAgentString) { + return /(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(userAgentString); +} +function getEnvironment({ adapters: adapters2, userAgentString }) { + if (adapters2.some((adapter) => adapter.name !== SolanaMobileWalletAdapterWalletName && adapter.readyState === WalletReadyState$2.Installed)) { + return Environment.DESKTOP_WEB; + } + if (userAgentString && // Step 1: Check whether we're on a platform that supports MWA at all. + /android/i.test(userAgentString) && // Step 2: Determine that we are *not* running in a WebView. + !isWebView(userAgentString)) { + return Environment.MOBILE_WEB; + } else { + return Environment.DESKTOP_WEB; + } +} +function getInferredClusterFromEndpoint(endpoint) { + if (!endpoint) { + return "mainnet-beta"; + } + if (/devnet/i.test(endpoint)) { + return "devnet"; + } else if (/testnet/i.test(endpoint)) { + return "testnet"; + } else { + return "mainnet-beta"; + } +} +function WalletProviderBase({ children, wallets: adapters2, adapter, isUnloadingRef, onAutoConnectRequest, onConnectError, onError, onSelectWallet }) { + const isConnectingRef = reactExports.useRef(false); + const [connecting, setConnecting] = reactExports.useState(false); + const isDisconnectingRef = reactExports.useRef(false); + const [disconnecting, setDisconnecting] = reactExports.useState(false); + const [publicKey2, setPublicKey] = reactExports.useState(() => (adapter == null ? void 0 : adapter.publicKey) ?? null); + const [connected, setConnected] = reactExports.useState(() => (adapter == null ? void 0 : adapter.connected) ?? false); + const onErrorRef = reactExports.useRef(onError); + reactExports.useEffect(() => { + onErrorRef.current = onError; + return () => { + onErrorRef.current = void 0; + }; + }, [onError]); + const handleErrorRef = reactExports.useRef((error, adapter2) => { + if (!isUnloadingRef.current) { + if (onErrorRef.current) { + onErrorRef.current(error, adapter2); + } else { + console.error(error, adapter2); + if (error instanceof WalletNotReadyError && typeof window !== "undefined" && adapter2) { + window.open(adapter2.url, "_blank"); + } + } + } + return error; + }); + const [wallets2, setWallets] = reactExports.useState(() => adapters2.map((adapter2) => ({ + adapter: adapter2, + readyState: adapter2.readyState + })).filter(({ readyState }) => readyState !== WalletReadyState$2.Unsupported)); + reactExports.useEffect(() => { + setWallets((wallets3) => adapters2.map((adapter2, index2) => { + const wallet2 = wallets3[index2]; + return wallet2 && wallet2.adapter === adapter2 && wallet2.readyState === adapter2.readyState ? wallet2 : { + adapter: adapter2, + readyState: adapter2.readyState + }; + }).filter(({ readyState }) => readyState !== WalletReadyState$2.Unsupported)); + function handleReadyStateChange(readyState) { + setWallets((prevWallets) => { + const index2 = prevWallets.findIndex(({ adapter: adapter3 }) => adapter3 === this); + if (index2 === -1) + return prevWallets; + const { adapter: adapter2 } = prevWallets[index2]; + return [ + ...prevWallets.slice(0, index2), + { adapter: adapter2, readyState }, + ...prevWallets.slice(index2 + 1) + ].filter(({ readyState: readyState2 }) => readyState2 !== WalletReadyState$2.Unsupported); + }); + } + adapters2.forEach((adapter2) => adapter2.on("readyStateChange", handleReadyStateChange, adapter2)); + return () => { + adapters2.forEach((adapter2) => adapter2.off("readyStateChange", handleReadyStateChange, adapter2)); + }; + }, [adapter, adapters2]); + const wallet = reactExports.useMemo(() => wallets2.find((wallet2) => wallet2.adapter === adapter) ?? null, [adapter, wallets2]); + reactExports.useEffect(() => { + if (!adapter) + return; + const handleConnect2 = (publicKey3) => { + setPublicKey(publicKey3); + isConnectingRef.current = false; + setConnecting(false); + setConnected(true); + isDisconnectingRef.current = false; + setDisconnecting(false); + }; + const handleDisconnect2 = () => { + if (isUnloadingRef.current) + return; + setPublicKey(null); + isConnectingRef.current = false; + setConnecting(false); + setConnected(false); + isDisconnectingRef.current = false; + setDisconnecting(false); + }; + const handleError = (error) => { + handleErrorRef.current(error, adapter); + }; + adapter.on("connect", handleConnect2); + adapter.on("disconnect", handleDisconnect2); + adapter.on("error", handleError); + return () => { + adapter.off("connect", handleConnect2); + adapter.off("disconnect", handleDisconnect2); + adapter.off("error", handleError); + handleDisconnect2(); + }; + }, [adapter, isUnloadingRef]); + const didAttemptAutoConnectRef = reactExports.useRef(false); + reactExports.useEffect(() => { + return () => { + didAttemptAutoConnectRef.current = false; + }; + }, [adapter]); + reactExports.useEffect(() => { + if (didAttemptAutoConnectRef.current || isConnectingRef.current || connected || !onAutoConnectRequest || !((wallet == null ? void 0 : wallet.readyState) === WalletReadyState$2.Installed || (wallet == null ? void 0 : wallet.readyState) === WalletReadyState$2.Loadable)) + return; + isConnectingRef.current = true; + setConnecting(true); + didAttemptAutoConnectRef.current = true; + (async function() { + try { + await onAutoConnectRequest(); + } catch { + onConnectError(); + } finally { + setConnecting(false); + isConnectingRef.current = false; + } + })(); + }, [connected, onAutoConnectRequest, onConnectError, wallet]); + const sendTransaction = reactExports.useCallback(async (transaction2, connection, options) => { + if (!adapter) + throw handleErrorRef.current(new WalletNotSelectedError$1()); + if (!connected) + throw handleErrorRef.current(new WalletNotConnectedError(), adapter); + return await adapter.sendTransaction(transaction2, connection, options); + }, [adapter, connected]); + const signTransaction2 = reactExports.useMemo(() => adapter && "signTransaction" in adapter ? async (transaction2) => { + if (!connected) + throw handleErrorRef.current(new WalletNotConnectedError(), adapter); + return await adapter.signTransaction(transaction2); + } : void 0, [adapter, connected]); + const signAllTransactions = reactExports.useMemo(() => adapter && "signAllTransactions" in adapter ? async (transactions) => { + if (!connected) + throw handleErrorRef.current(new WalletNotConnectedError(), adapter); + return await adapter.signAllTransactions(transactions); + } : void 0, [adapter, connected]); + const signMessage2 = reactExports.useMemo(() => adapter && "signMessage" in adapter ? async (message2) => { + if (!connected) + throw handleErrorRef.current(new WalletNotConnectedError(), adapter); + return await adapter.signMessage(message2); + } : void 0, [adapter, connected]); + const signIn = reactExports.useMemo(() => adapter && "signIn" in adapter ? async (input) => { + return await adapter.signIn(input); + } : void 0, [adapter]); + const handleConnect = reactExports.useCallback(async () => { + if (isConnectingRef.current || isDisconnectingRef.current || (wallet == null ? void 0 : wallet.adapter.connected)) + return; + if (!wallet) + throw handleErrorRef.current(new WalletNotSelectedError$1()); + const { adapter: adapter2, readyState } = wallet; + if (!(readyState === WalletReadyState$2.Installed || readyState === WalletReadyState$2.Loadable)) + throw handleErrorRef.current(new WalletNotReadyError(), adapter2); + isConnectingRef.current = true; + setConnecting(true); + try { + await adapter2.connect(); + } catch (e18) { + onConnectError(); + throw e18; + } finally { + setConnecting(false); + isConnectingRef.current = false; + } + }, [onConnectError, wallet]); + const handleDisconnect = reactExports.useCallback(async () => { + if (isDisconnectingRef.current) + return; + if (!adapter) + return; + isDisconnectingRef.current = true; + setDisconnecting(true); + try { + await adapter.disconnect(); + } finally { + setDisconnecting(false); + isDisconnectingRef.current = false; + } + }, [adapter]); + return W$2.createElement(WalletContext$1.Provider, { value: { + autoConnect: !!onAutoConnectRequest, + wallets: wallets2, + wallet, + publicKey: publicKey2, + connected, + connecting, + disconnecting, + select: onSelectWallet, + connect: handleConnect, + disconnect: handleDisconnect, + sendTransaction, + signTransaction: signTransaction2, + signAllTransactions, + signMessage: signMessage2, + signIn + } }, children); +} +let _userAgent; +function getUserAgent() { + var _a3; + if (_userAgent === void 0) { + _userAgent = ((_a3 = globalThis.navigator) == null ? void 0 : _a3.userAgent) ?? null; + } + return _userAgent; +} +function getIsMobile(adapters2) { + const userAgentString = getUserAgent(); + return getEnvironment({ adapters: adapters2, userAgentString }) === Environment.MOBILE_WEB; +} +function getUriForAppIdentity() { + const location2 = globalThis.location; + if (!location2) + return; + return `${location2.protocol}//${location2.host}`; +} +function WalletProvider$1({ children, wallets: adapters2, autoConnect, localStorageKey = "walletName", onError }) { + const { connection } = useConnection(); + const adaptersWithStandardAdapters = useStandardWalletAdapters(adapters2); + const mobileWalletAdapter = reactExports.useMemo(() => { + if (!getIsMobile(adaptersWithStandardAdapters)) { + return null; + } + const existingMobileWalletAdapter = adaptersWithStandardAdapters.find((adapter2) => adapter2.name === SolanaMobileWalletAdapterWalletName); + if (existingMobileWalletAdapter) { + return existingMobileWalletAdapter; + } + return new SolanaMobileWalletAdapter({ + addressSelector: createDefaultAddressSelector(), + appIdentity: { + uri: getUriForAppIdentity() + }, + authorizationResultCache: createDefaultAuthorizationResultCache(), + cluster: getInferredClusterFromEndpoint(connection == null ? void 0 : connection.rpcEndpoint), + onWalletNotFound: createDefaultWalletNotFoundHandler() + }); + }, [adaptersWithStandardAdapters, connection == null ? void 0 : connection.rpcEndpoint]); + const adaptersWithMobileWalletAdapter = reactExports.useMemo(() => { + if (mobileWalletAdapter == null || adaptersWithStandardAdapters.indexOf(mobileWalletAdapter) !== -1) { + return adaptersWithStandardAdapters; + } + return [mobileWalletAdapter, ...adaptersWithStandardAdapters]; + }, [adaptersWithStandardAdapters, mobileWalletAdapter]); + const [walletName, setWalletName] = useLocalStorage$1(localStorageKey, getIsMobile(adaptersWithStandardAdapters) ? SolanaMobileWalletAdapterWalletName : null); + const adapter = reactExports.useMemo(() => adaptersWithMobileWalletAdapter.find((a3) => a3.name === walletName) ?? null, [adaptersWithMobileWalletAdapter, walletName]); + const changeWallet = reactExports.useCallback((nextWalletName) => { + if (walletName === nextWalletName) + return; + if (adapter && // Selecting a wallet other than the mobile wallet adapter is not + // sufficient reason to call `disconnect` on the mobile wallet adapter. + // Calling `disconnect` on the mobile wallet adapter causes the entire + // authorization store to be wiped. + adapter.name !== SolanaMobileWalletAdapterWalletName) { + adapter.disconnect(); + } + setWalletName(nextWalletName); + }, [adapter, setWalletName, walletName]); + reactExports.useEffect(() => { + if (!adapter) + return; + function handleDisconnect() { + if (isUnloadingRef.current) + return; + if (walletName === SolanaMobileWalletAdapterWalletName && getIsMobile(adaptersWithStandardAdapters)) + return; + setWalletName(null); + } + adapter.on("disconnect", handleDisconnect); + return () => { + adapter.off("disconnect", handleDisconnect); + }; + }, [adapter, adaptersWithStandardAdapters, setWalletName, walletName]); + const hasUserSelectedAWallet = reactExports.useRef(false); + const handleAutoConnectRequest = reactExports.useMemo(() => { + if (!autoConnect || !adapter) + return; + return async () => { + if (autoConnect === true || await autoConnect(adapter)) { + if (hasUserSelectedAWallet.current) { + await adapter.connect(); + } else { + await adapter.autoConnect(); + } + } + }; + }, [autoConnect, adapter]); + const isUnloadingRef = reactExports.useRef(false); + reactExports.useEffect(() => { + if (walletName === SolanaMobileWalletAdapterWalletName && getIsMobile(adaptersWithStandardAdapters)) { + isUnloadingRef.current = false; + return; + } + function handleBeforeUnload() { + isUnloadingRef.current = true; + } + window.addEventListener("beforeunload", handleBeforeUnload); + return () => { + window.removeEventListener("beforeunload", handleBeforeUnload); + }; + }, [adaptersWithStandardAdapters, walletName]); + const handleConnectError = reactExports.useCallback(() => { + if (adapter && adapter.name !== SolanaMobileWalletAdapterWalletName) { + changeWallet(null); + } + }, [adapter, changeWallet]); + const selectWallet = reactExports.useCallback((walletName2) => { + hasUserSelectedAWallet.current = true; + changeWallet(walletName2); + }, [changeWallet]); + return W$2.createElement(WalletProviderBase, { wallets: adaptersWithMobileWalletAdapter, adapter, isUnloadingRef, onAutoConnectRequest: handleAutoConnectRequest, onConnectError: handleConnectError, onError, onSelectWallet: selectWallet }, children); +} +var WalletReadyState$1; +(function(WalletReadyState2) { + WalletReadyState2["Loading"] = "Loading"; + WalletReadyState2["NotFound"] = "NotFound"; + WalletReadyState2["Found"] = "Found"; +})(WalletReadyState$1 || (WalletReadyState$1 = {})); +var AdapterState$1; +(function(AdapterState2) { + AdapterState2["Loading"] = "Loading"; + AdapterState2["NotFound"] = "NotFound"; + AdapterState2["Disconnect"] = "Disconnected"; + AdapterState2["Connected"] = "Connected"; +})(AdapterState$1 || (AdapterState$1 = {})); +let WalletError$1 = class WalletError2 extends Error { + constructor(message2, error) { + super(message2); + this.error = error; + } +}; +class WalletNotSelectedError2 extends WalletError$1 { + constructor() { + super(...arguments); + this.name = "WalletNotSelectedError"; + this.message = "No wallet is selected. Please select a wallet."; + } +} +function isInBrowser$1() { + return typeof window !== "undefined" && typeof document !== "undefined" && typeof navigator !== "undefined"; +} +function useLocalStorage(key2, defaultState) { + const [state, setState] = reactExports.useState(() => { + try { + const value = localStorage.getItem(key2); + if (value) + return JSON.parse(value); + } catch (error) { + if (isInBrowser$1()) { + console.error(error); + } + } + return defaultState; + }); + const isFirstRender = reactExports.useRef(true); + reactExports.useEffect(() => { + if (isFirstRender.current) { + isFirstRender.current = false; + return; + } + try { + if (state === null) { + localStorage.removeItem(key2); + } else { + localStorage.setItem(key2, JSON.stringify(state)); + } + } catch (error) { + if (isInBrowser$1()) { + console.error(error); + } + } + }, [state, key2]); + return [state, setState]; +} +function printError() { + console.error(` +You are using WalletContext without provide the WalletContext.Provider. +Please wrap your sub-components with a WalletProvider and provide required values. +`); +} +const DEFAULT_CONTEXT = { + autoConnect: false, + connecting: false, + connected: false, + disconnecting: false, + /* eslint-disable */ + select(_name) { + printError(); + }, + connect() { + printError(); + return Promise.reject(); + }, + disconnect() { + printError(); + return Promise.reject(); + }, + signTransaction(_transaction) { + printError(); + return Promise.reject(); + }, + signMessage(_message) { + printError(); + return Promise.reject(); + } + /* eslint-enable */ +}; +Object.defineProperty(DEFAULT_CONTEXT, "wallets", { + get() { + printError(); + return []; + } +}); +Object.defineProperty(DEFAULT_CONTEXT, "wallet", { + get() { + printError(); + return null; + } +}); +Object.defineProperty(DEFAULT_CONTEXT, "address", { + get() { + printError(); + return null; + } +}); +const WalletContext = reactExports.createContext(DEFAULT_CONTEXT); +function useWallet() { + return reactExports.useContext(WalletContext); +} +var WalletReadyState; +(function(WalletReadyState2) { + WalletReadyState2["Loading"] = "Loading"; + WalletReadyState2["NotFound"] = "NotFound"; + WalletReadyState2["Found"] = "Found"; +})(WalletReadyState || (WalletReadyState = {})); +var AdapterState; +(function(AdapterState2) { + AdapterState2["Loading"] = "Loading"; + AdapterState2["NotFound"] = "NotFound"; + AdapterState2["Disconnect"] = "Disconnected"; + AdapterState2["Connected"] = "Connected"; +})(AdapterState || (AdapterState = {})); +class Adapter extends EventEmitter$2 { + get connected() { + return this.state === AdapterState.Connected; + } + /** + * Some wallets such as TronLink don't support disconnect() method. + */ + disconnect() { + console.info("The current adapter doesn't support disconnect by DApp."); + return Promise.resolve(); + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + multiSign(...args) { + return Promise.reject("The current wallet doesn't support multiSign."); + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + switchChain(_chainId2) { + return Promise.reject("The current wallet doesn't support switch chain."); + } +} +class WalletError3 extends Error { + constructor(message2, error) { + super(message2); + this.error = error; + } +} +class WalletNotFoundError extends WalletError3 { + constructor() { + super(...arguments); + this.name = "WalletNotFoundError"; + this.message = "The wallet is not found."; + } +} +class WalletDisconnectedError2 extends WalletError3 { + constructor() { + super(...arguments); + this.name = "WalletDisconnectedError"; + this.message = "The wallet is disconnected. Please connect first."; + } +} +class WalletConnectionError2 extends WalletError3 { + constructor() { + super(...arguments); + this.name = "WalletConnectionError"; + } +} +class WalletSignMessageError2 extends WalletError3 { + constructor() { + super(...arguments); + this.name = "WalletSignMessageError"; + } +} +class WalletSignTransactionError2 extends WalletError3 { + constructor() { + super(...arguments); + this.name = "WalletSignTransactionError"; + } +} +class WalletSwitchChainError extends WalletError3 { + constructor() { + super(...arguments); + this.name = "WalletSwitchChainError"; + } +} +class WalletGetNetworkError extends WalletError3 { + constructor() { + super(...arguments); + this.name = "WalletGetNetworkError"; + } +} +const _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; +class Base64 { + encode(input) { + let output2 = ""; + let chr1; + let chr2; + let chr3; + let enc1; + let enc2; + let enc3; + let enc4; + let i2 = 0; + while (i2 < input.length) { + chr1 = input.charCodeAt(i2++); + chr2 = input.charCodeAt(i2++); + chr3 = input.charCodeAt(i2++); + enc1 = chr1 >> 2; + enc2 = (chr1 & 3) << 4 | chr2 >> 4; + enc3 = (chr2 & 15) << 2 | chr3 >> 6; + enc4 = chr3 & 63; + if (isNaN(chr2)) + enc3 = enc4 = 64; + else if (isNaN(chr3)) + enc4 = 64; + output2 = output2 + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4); + } + return output2; + } + encodeIgnoreUtf8(inputBytes) { + let output2 = ""; + let chr1; + let chr2; + let chr3; + let enc1; + let enc2; + let enc3; + let enc4; + let i2 = 0; + while (i2 < inputBytes.length) { + chr1 = inputBytes[i2++]; + chr2 = inputBytes[i2++]; + chr3 = inputBytes[i2++]; + enc1 = chr1 >> 2; + enc2 = (chr1 & 3) << 4 | chr2 >> 4; + enc3 = (chr2 & 15) << 2 | chr3 >> 6; + enc4 = chr3 & 63; + if (isNaN(chr2)) + enc3 = enc4 = 64; + else if (isNaN(chr3)) + enc4 = 64; + output2 = output2 + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4); + } + return output2; + } + decode(input) { + let output2 = ""; + let chr1; + let chr2; + let chr3; + let enc1; + let enc2; + let enc3; + let enc4; + let i2 = 0; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + while (i2 < input.length) { + enc1 = _keyStr.indexOf(input.charAt(i2++)); + enc2 = _keyStr.indexOf(input.charAt(i2++)); + enc3 = _keyStr.indexOf(input.charAt(i2++)); + enc4 = _keyStr.indexOf(input.charAt(i2++)); + chr1 = enc1 << 2 | enc2 >> 4; + chr2 = (enc2 & 15) << 4 | enc3 >> 2; + chr3 = (enc3 & 3) << 6 | enc4; + output2 = output2 + String.fromCharCode(chr1); + if (enc3 != 64) + output2 = output2 + String.fromCharCode(chr2); + if (enc4 != 64) + output2 = output2 + String.fromCharCode(chr3); + } + return this._utf8_decode(output2); + } + decodeToByteArray(input) { + let output2 = ""; + let chr1; + let chr2; + let chr3; + let enc1; + let enc2; + let enc3; + let enc4; + let i2 = 0; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + while (i2 < input.length) { + enc1 = _keyStr.indexOf(input.charAt(i2++)); + enc2 = _keyStr.indexOf(input.charAt(i2++)); + enc3 = _keyStr.indexOf(input.charAt(i2++)); + enc4 = _keyStr.indexOf(input.charAt(i2++)); + chr1 = enc1 << 2 | enc2 >> 4; + chr2 = (enc2 & 15) << 4 | enc3 >> 2; + chr3 = (enc3 & 3) << 6 | enc4; + output2 = output2 + String.fromCharCode(chr1); + if (enc3 != 64) + output2 = output2 + String.fromCharCode(chr2); + if (enc4 != 64) + output2 = output2 + String.fromCharCode(chr3); + } + return this._out2ByteArray(output2); + } + _out2ByteArray(utftext) { + const byteArray = new Array(utftext.length); + let i2 = 0; + let c2 = 0; + while (i2 < utftext.length) { + c2 = utftext.charCodeAt(i2); + byteArray[i2] = c2; + i2++; + } + return byteArray; + } + _utf8_encode(string2) { + string2 = string2.replace(/\r\n/g, "\n"); + let utftext = ""; + for (let n5 = 0; n5 < string2.length; n5++) { + const c2 = string2.charCodeAt(n5); + if (c2 < 128) { + utftext += String.fromCharCode(c2); + } else if (c2 > 127 && c2 < 2048) { + utftext += String.fromCharCode(c2 >> 6 | 192); + utftext += String.fromCharCode(c2 & 63 | 128); + } else { + utftext += String.fromCharCode(c2 >> 12 | 224); + utftext += String.fromCharCode(c2 >> 6 & 63 | 128); + utftext += String.fromCharCode(c2 & 63 | 128); + } + } + return utftext; + } + _utf8_decode(utftext) { + let string2 = ""; + let i2 = 0; + let c2 = 0; + let c22 = 0; + let c3 = 0; + while (i2 < utftext.length) { + c2 = utftext.charCodeAt(i2); + if (c2 < 128) { + string2 += String.fromCharCode(c2); + i2++; + } else if (c2 > 191 && c2 < 224) { + c22 = utftext.charCodeAt(i2 + 1); + string2 += String.fromCharCode((c2 & 31) << 6 | c22 & 63); + i2 += 2; + } else { + c22 = utftext.charCodeAt(i2 + 1); + c3 = utftext.charCodeAt(i2 + 2); + string2 += String.fromCharCode((c2 & 15) << 12 | (c22 & 63) << 6 | c3 & 63); + i2 += 3; + } + } + return string2; + } +} +function byte2hexStr(byte2) { + if (byte2 < 0 || byte2 > 255) + throw new Error("Input must be a byte"); + const hexByteMap = "0123456789ABCDEF"; + let str = ""; + str += hexByteMap.charAt(byte2 >> 4); + str += hexByteMap.charAt(byte2 & 15); + return str; +} +function bytesToString(arr) { + let str = ""; + for (let i2 = 0; i2 < arr.length; i2++) { + const one = arr[i2].toString(2); + const v6 = one.match(/^1+?(?=0)/); + if (v6 && one.length === 8) { + const bytesLength = v6[0].length; + let store = arr[i2].toString(2).slice(7 - bytesLength); + for (let st2 = 1; st2 < bytesLength; st2++) + store += arr[st2 + i2].toString(2).slice(2); + str += String.fromCharCode(parseInt(store, 2)); + i2 += bytesLength - 1; + } else { + str += String.fromCharCode(arr[i2]); + } + } + return str; +} +function hextoString(hex) { + const arr = hex.replace(/^0x/, "").split(""); + let out = ""; + for (let i2 = 0; i2 < arr.length / 2; i2++) { + const tmp = `0x${arr[i2 * 2]}${arr[i2 * 2 + 1]}`; + out += String.fromCharCode(parseInt(tmp)); + } + return out; +} +function byteArray2hexStr(byteArray) { + let str = ""; + for (let i2 = 0; i2 < byteArray.length; i2++) + str += byte2hexStr(byteArray[i2]); + return str; +} +function base64DecodeFromString(string64) { + return new Base64().decodeToByteArray(string64); +} +function base64EncodeToString(bytes2) { + const b2 = new Base64(); + const string64 = b2.encodeIgnoreUtf8(bytes2); + return string64; +} +const bytes$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + base64DecodeFromString, + base64EncodeToString, + byte2hexStr, + byteArray2hexStr, + bytesToString, + hextoString +}, Symbol.toStringTag, { value: "Module" })); +function bin2String(array2) { + return bytesToString(array2); +} +function arrayEquals(array1, array2, strict = false) { + if (array1.length != array2.length) + return false; + for (let i2 = 0; i2 < array1.length; i2++) { + if (strict) { + if (array1[i2] != array2[i2]) + return false; + } else if (JSON.stringify(array1[i2]) != JSON.stringify(array2[i2])) + return false; + } + return true; +} +function stringToBytes(str) { + const bytes2 = []; + const len = str.length; + let c2; + for (let i2 = 0; i2 < len; i2++) { + c2 = str.charCodeAt(i2); + if (c2 >= 65536 && c2 <= 1114111) { + bytes2.push(c2 >> 18 & 7 | 240); + bytes2.push(c2 >> 12 & 63 | 128); + bytes2.push(c2 >> 6 & 63 | 128); + bytes2.push(c2 & 63 | 128); + } else if (c2 >= 2048 && c2 <= 65535) { + bytes2.push(c2 >> 12 & 15 | 224); + bytes2.push(c2 >> 6 & 63 | 128); + bytes2.push(c2 & 63 | 128); + } else if (c2 >= 128 && c2 <= 2047) { + bytes2.push(c2 >> 6 & 31 | 192); + bytes2.push(c2 & 63 | 128); + } else + bytes2.push(c2 & 255); + } + return bytes2; +} +function hexChar2byte(c2) { + let d4; + if (c2 >= "A" && c2 <= "F") + d4 = c2.charCodeAt(0) - "A".charCodeAt(0) + 10; + else if (c2 >= "a" && c2 <= "f") + d4 = c2.charCodeAt(0) - "a".charCodeAt(0) + 10; + else if (c2 >= "0" && c2 <= "9") + d4 = c2.charCodeAt(0) - "0".charCodeAt(0); + if (typeof d4 === "number") + return d4; + else + throw new Error("The passed hex char is not a valid hex char"); +} +function isHexChar(c2) { + if (c2 >= "A" && c2 <= "F" || c2 >= "a" && c2 <= "f" || c2 >= "0" && c2 <= "9") { + return 1; + } + return 0; +} +function hexStr2byteArray(str, strict = false) { + let len = str.length; + if (strict) { + if (len % 2) { + str = `0${str}`; + len++; + } + } + const byteArray = []; + let d4 = 0; + let j2 = 0; + let k2 = 0; + for (let i2 = 0; i2 < len; i2++) { + const c2 = str.charAt(i2); + if (isHexChar(c2)) { + d4 <<= 4; + d4 += hexChar2byte(c2); + j2++; + if (0 === j2 % 2) { + byteArray[k2++] = d4; + d4 = 0; + } + } else + throw new Error("The passed hex char is not a valid hex string"); + } + return byteArray; +} +function strToDate(str) { + if (!/^\d{4}-\d{2}-\d{2}( \d{2}-\d{2}-\d{2}|)/.test(str)) + throw new Error("The passed date string is not valid"); + const tempStrs = str.split(" "); + const dateStrs = tempStrs[0].split("-"); + const year = parseInt(dateStrs[0], 10); + const month = parseInt(dateStrs[1], 10) - 1; + const day = parseInt(dateStrs[2], 10); + if (tempStrs.length > 1) { + const timeStrs = tempStrs[1].split("-"); + const hour = parseInt(timeStrs[0], 10); + const minute = parseInt(timeStrs[1], 10); + const second = parseInt(timeStrs[2], 10); + return new Date(year, month, day, hour, minute, second); + } + return new Date(year, month, day); +} +function isNumber$1(c2) { + if (c2 >= "0" && c2 <= "9") + return 1; + return 0; +} +function getStringType(str) { + if (null == str) + return -1; + if (str.length == 0 || str == "") + return -1; + let i2 = 0; + if (str.length == 40) { + for (; i2 < 40; i2++) { + const c2 = str.charAt(i2); + if (!isHexChar(c2)) + break; + } + } + if (i2 == 40) + return 1; + for (i2 = 0; i2 < str.length; i2++) { + const c2 = str.charAt(i2); + if (!isNumber$1(c2)) + break; + } + if (i2 == str.length) + return 2; + for (i2 = 0; i2 < str.length; i2++) { + const c2 = str.charAt(i2); + if (c2 > " ") + return 3; + } + return -1; +} +const code = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + arrayEquals, + base64DecodeFromString, + base64EncodeToString, + bin2String, + byte2hexStr, + byteArray2hexStr, + bytesToString, + getStringType, + hexChar2byte, + hexStr2byteArray, + hextoString, + isHexChar, + isNumber: isNumber$1, + strToDate, + stringToBytes +}, Symbol.toStringTag, { value: "Module" })); +var isNumeric$1 = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE$1 = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9; +function clone(configObject) { + var div, convertBase, parseNumeric, P2 = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = { + prefix: "", + groupSize: 3, + secondaryGroupSize: 0, + groupSeparator: ",", + decimalSeparator: ".", + fractionGroupSize: 0, + fractionGroupSeparator: " ", + // non-breaking space + suffix: "" + }, ALPHABET2 = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true; + function BigNumber2(v6, b2) { + var alphabet2, c2, caseChanged, e18, i2, isNum, len, str, x3 = this; + if (!(x3 instanceof BigNumber2)) + return new BigNumber2(v6, b2); + if (b2 == null) { + if (v6 && v6._isBigNumber === true) { + x3.s = v6.s; + if (!v6.c || v6.e > MAX_EXP) { + x3.c = x3.e = null; + } else if (v6.e < MIN_EXP) { + x3.c = [x3.e = 0]; + } else { + x3.e = v6.e; + x3.c = v6.c.slice(); + } + return; + } + if ((isNum = typeof v6 == "number") && v6 * 0 == 0) { + x3.s = 1 / v6 < 0 ? (v6 = -v6, -1) : 1; + if (v6 === ~~v6) { + for (e18 = 0, i2 = v6; i2 >= 10; i2 /= 10, e18++) + ; + if (e18 > MAX_EXP) { + x3.c = x3.e = null; + } else { + x3.e = e18; + x3.c = [v6]; + } + return; + } + str = String(v6); + } else { + if (!isNumeric$1.test(str = String(v6))) + return parseNumeric(x3, str, isNum); + x3.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; + } + if ((e18 = str.indexOf(".")) > -1) + str = str.replace(".", ""); + if ((i2 = str.search(/e/i)) > 0) { + if (e18 < 0) + e18 = i2; + e18 += +str.slice(i2 + 1); + str = str.substring(0, i2); + } else if (e18 < 0) { + e18 = str.length; + } + } else { + intCheck(b2, 2, ALPHABET2.length, "Base"); + if (b2 == 10 && alphabetHasNormalDecimalDigits) { + x3 = new BigNumber2(v6); + return round(x3, DECIMAL_PLACES + x3.e + 1, ROUNDING_MODE); + } + str = String(v6); + if (isNum = typeof v6 == "number") { + if (v6 * 0 != 0) + return parseNumeric(x3, str, isNum, b2); + x3.s = 1 / v6 < 0 ? (str = str.slice(1), -1) : 1; + if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) { + throw Error(tooManyDigits + v6); + } + } else { + x3.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; + } + alphabet2 = ALPHABET2.slice(0, b2); + e18 = i2 = 0; + for (len = str.length; i2 < len; i2++) { + if (alphabet2.indexOf(c2 = str.charAt(i2)) < 0) { + if (c2 == ".") { + if (i2 > e18) { + e18 = len; + continue; + } + } else if (!caseChanged) { + if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) { + caseChanged = true; + i2 = -1; + e18 = 0; + continue; + } + } + return parseNumeric(x3, String(v6), isNum, b2); + } + } + isNum = false; + str = convertBase(str, b2, 10, x3.s); + if ((e18 = str.indexOf(".")) > -1) + str = str.replace(".", ""); + else + e18 = str.length; + } + for (i2 = 0; str.charCodeAt(i2) === 48; i2++) + ; + for (len = str.length; str.charCodeAt(--len) === 48; ) + ; + if (str = str.slice(i2, ++len)) { + len -= i2; + if (isNum && BigNumber2.DEBUG && len > 15 && (v6 > MAX_SAFE_INTEGER || v6 !== mathfloor(v6))) { + throw Error(tooManyDigits + x3.s * v6); + } + if ((e18 = e18 - i2 - 1) > MAX_EXP) { + x3.c = x3.e = null; + } else if (e18 < MIN_EXP) { + x3.c = [x3.e = 0]; + } else { + x3.e = e18; + x3.c = []; + i2 = (e18 + 1) % LOG_BASE; + if (e18 < 0) + i2 += LOG_BASE; + if (i2 < len) { + if (i2) + x3.c.push(+str.slice(0, i2)); + for (len -= LOG_BASE; i2 < len; ) { + x3.c.push(+str.slice(i2, i2 += LOG_BASE)); + } + i2 = LOG_BASE - (str = str.slice(i2)).length; + } else { + i2 -= len; + } + for (; i2--; str += "0") + ; + x3.c.push(+str); + } + } else { + x3.c = [x3.e = 0]; + } + } + BigNumber2.clone = clone; + BigNumber2.ROUND_UP = 0; + BigNumber2.ROUND_DOWN = 1; + BigNumber2.ROUND_CEIL = 2; + BigNumber2.ROUND_FLOOR = 3; + BigNumber2.ROUND_HALF_UP = 4; + BigNumber2.ROUND_HALF_DOWN = 5; + BigNumber2.ROUND_HALF_EVEN = 6; + BigNumber2.ROUND_HALF_CEIL = 7; + BigNumber2.ROUND_HALF_FLOOR = 8; + BigNumber2.EUCLID = 9; + BigNumber2.config = BigNumber2.set = function(obj) { + var p3, v6; + if (obj != null) { + if (typeof obj == "object") { + if (obj.hasOwnProperty(p3 = "DECIMAL_PLACES")) { + v6 = obj[p3]; + intCheck(v6, 0, MAX, p3); + DECIMAL_PLACES = v6; + } + if (obj.hasOwnProperty(p3 = "ROUNDING_MODE")) { + v6 = obj[p3]; + intCheck(v6, 0, 8, p3); + ROUNDING_MODE = v6; + } + if (obj.hasOwnProperty(p3 = "EXPONENTIAL_AT")) { + v6 = obj[p3]; + if (v6 && v6.pop) { + intCheck(v6[0], -MAX, 0, p3); + intCheck(v6[1], 0, MAX, p3); + TO_EXP_NEG = v6[0]; + TO_EXP_POS = v6[1]; + } else { + intCheck(v6, -MAX, MAX, p3); + TO_EXP_NEG = -(TO_EXP_POS = v6 < 0 ? -v6 : v6); + } + } + if (obj.hasOwnProperty(p3 = "RANGE")) { + v6 = obj[p3]; + if (v6 && v6.pop) { + intCheck(v6[0], -MAX, -1, p3); + intCheck(v6[1], 1, MAX, p3); + MIN_EXP = v6[0]; + MAX_EXP = v6[1]; + } else { + intCheck(v6, -MAX, MAX, p3); + if (v6) { + MIN_EXP = -(MAX_EXP = v6 < 0 ? -v6 : v6); + } else { + throw Error(bignumberError + p3 + " cannot be zero: " + v6); + } + } + } + if (obj.hasOwnProperty(p3 = "CRYPTO")) { + v6 = obj[p3]; + if (v6 === !!v6) { + if (v6) { + if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) { + CRYPTO = v6; + } else { + CRYPTO = !v6; + throw Error(bignumberError + "crypto unavailable"); + } + } else { + CRYPTO = v6; + } + } else { + throw Error(bignumberError + p3 + " not true or false: " + v6); + } + } + if (obj.hasOwnProperty(p3 = "MODULO_MODE")) { + v6 = obj[p3]; + intCheck(v6, 0, 9, p3); + MODULO_MODE = v6; + } + if (obj.hasOwnProperty(p3 = "POW_PRECISION")) { + v6 = obj[p3]; + intCheck(v6, 0, MAX, p3); + POW_PRECISION = v6; + } + if (obj.hasOwnProperty(p3 = "FORMAT")) { + v6 = obj[p3]; + if (typeof v6 == "object") + FORMAT = v6; + else + throw Error(bignumberError + p3 + " not an object: " + v6); + } + if (obj.hasOwnProperty(p3 = "ALPHABET")) { + v6 = obj[p3]; + if (typeof v6 == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v6)) { + alphabetHasNormalDecimalDigits = v6.slice(0, 10) == "0123456789"; + ALPHABET2 = v6; + } else { + throw Error(bignumberError + p3 + " invalid: " + v6); + } + } + } else { + throw Error(bignumberError + "Object expected: " + obj); + } + } + return { + DECIMAL_PLACES, + ROUNDING_MODE, + EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], + RANGE: [MIN_EXP, MAX_EXP], + CRYPTO, + MODULO_MODE, + POW_PRECISION, + FORMAT, + ALPHABET: ALPHABET2 + }; + }; + BigNumber2.isBigNumber = function(v6) { + if (!v6 || v6._isBigNumber !== true) + return false; + if (!BigNumber2.DEBUG) + return true; + var i2, n5, c2 = v6.c, e18 = v6.e, s2 = v6.s; + out: + if ({}.toString.call(c2) == "[object Array]") { + if ((s2 === 1 || s2 === -1) && e18 >= -MAX && e18 <= MAX && e18 === mathfloor(e18)) { + if (c2[0] === 0) { + if (e18 === 0 && c2.length === 1) + return true; + break out; + } + i2 = (e18 + 1) % LOG_BASE; + if (i2 < 1) + i2 += LOG_BASE; + if (String(c2[0]).length == i2) { + for (i2 = 0; i2 < c2.length; i2++) { + n5 = c2[i2]; + if (n5 < 0 || n5 >= BASE$1 || n5 !== mathfloor(n5)) + break out; + } + if (n5 !== 0) + return true; + } + } + } else if (c2 === null && e18 === null && (s2 === null || s2 === 1 || s2 === -1)) { + return true; + } + throw Error(bignumberError + "Invalid BigNumber: " + v6); + }; + BigNumber2.maximum = BigNumber2.max = function() { + return maxOrMin(arguments, -1); + }; + BigNumber2.minimum = BigNumber2.min = function() { + return maxOrMin(arguments, 1); + }; + BigNumber2.random = function() { + var pow2_53 = 9007199254740992; + var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() { + return mathfloor(Math.random() * pow2_53); + } : function() { + return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0); + }; + return function(dp) { + var a3, b2, e18, k2, v6, i2 = 0, c2 = [], rand3 = new BigNumber2(ONE); + if (dp == null) + dp = DECIMAL_PLACES; + else + intCheck(dp, 0, MAX); + k2 = mathceil(dp / LOG_BASE); + if (CRYPTO) { + if (crypto.getRandomValues) { + a3 = crypto.getRandomValues(new Uint32Array(k2 *= 2)); + for (; i2 < k2; ) { + v6 = a3[i2] * 131072 + (a3[i2 + 1] >>> 11); + if (v6 >= 9e15) { + b2 = crypto.getRandomValues(new Uint32Array(2)); + a3[i2] = b2[0]; + a3[i2 + 1] = b2[1]; + } else { + c2.push(v6 % 1e14); + i2 += 2; + } + } + i2 = k2 / 2; + } else if (crypto.randomBytes) { + a3 = crypto.randomBytes(k2 *= 7); + for (; i2 < k2; ) { + v6 = (a3[i2] & 31) * 281474976710656 + a3[i2 + 1] * 1099511627776 + a3[i2 + 2] * 4294967296 + a3[i2 + 3] * 16777216 + (a3[i2 + 4] << 16) + (a3[i2 + 5] << 8) + a3[i2 + 6]; + if (v6 >= 9e15) { + crypto.randomBytes(7).copy(a3, i2); + } else { + c2.push(v6 % 1e14); + i2 += 7; + } + } + i2 = k2 / 7; + } else { + CRYPTO = false; + throw Error(bignumberError + "crypto unavailable"); + } + } + if (!CRYPTO) { + for (; i2 < k2; ) { + v6 = random53bitInt(); + if (v6 < 9e15) + c2[i2++] = v6 % 1e14; + } + } + k2 = c2[--i2]; + dp %= LOG_BASE; + if (k2 && dp) { + v6 = POWS_TEN[LOG_BASE - dp]; + c2[i2] = mathfloor(k2 / v6) * v6; + } + for (; c2[i2] === 0; c2.pop(), i2--) + ; + if (i2 < 0) { + c2 = [e18 = 0]; + } else { + for (e18 = -1; c2[0] === 0; c2.splice(0, 1), e18 -= LOG_BASE) + ; + for (i2 = 1, v6 = c2[0]; v6 >= 10; v6 /= 10, i2++) + ; + if (i2 < LOG_BASE) + e18 -= LOG_BASE - i2; + } + rand3.e = e18; + rand3.c = c2; + return rand3; + }; + }(); + BigNumber2.sum = function() { + var i2 = 1, args = arguments, sum = new BigNumber2(args[0]); + for (; i2 < args.length; ) + sum = sum.plus(args[i2++]); + return sum; + }; + convertBase = function() { + var decimal2 = "0123456789"; + function toBaseOut(str, baseIn, baseOut, alphabet2) { + var j2, arr = [0], arrL, i2 = 0, len = str.length; + for (; i2 < len; ) { + for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) + ; + arr[0] += alphabet2.indexOf(str.charAt(i2++)); + for (j2 = 0; j2 < arr.length; j2++) { + if (arr[j2] > baseOut - 1) { + if (arr[j2 + 1] == null) + arr[j2 + 1] = 0; + arr[j2 + 1] += arr[j2] / baseOut | 0; + arr[j2] %= baseOut; + } + } + } + return arr.reverse(); + } + return function(str, baseIn, baseOut, sign6, callerIsToString) { + var alphabet2, d4, e18, k2, r2, x3, xc2, y3, i2 = str.indexOf("."), dp = DECIMAL_PLACES, rm2 = ROUNDING_MODE; + if (i2 >= 0) { + k2 = POW_PRECISION; + POW_PRECISION = 0; + str = str.replace(".", ""); + y3 = new BigNumber2(baseIn); + x3 = y3.pow(str.length - i2); + POW_PRECISION = k2; + y3.c = toBaseOut( + toFixedPoint(coeffToString(x3.c), x3.e, "0"), + 10, + baseOut, + decimal2 + ); + y3.e = y3.c.length; + } + xc2 = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet2 = ALPHABET2, decimal2) : (alphabet2 = decimal2, ALPHABET2)); + e18 = k2 = xc2.length; + for (; xc2[--k2] == 0; xc2.pop()) + ; + if (!xc2[0]) + return alphabet2.charAt(0); + if (i2 < 0) { + --e18; + } else { + x3.c = xc2; + x3.e = e18; + x3.s = sign6; + x3 = div(x3, y3, dp, rm2, baseOut); + xc2 = x3.c; + r2 = x3.r; + e18 = x3.e; + } + d4 = e18 + dp + 1; + i2 = xc2[d4]; + k2 = baseOut / 2; + r2 = r2 || d4 < 0 || xc2[d4 + 1] != null; + r2 = rm2 < 4 ? (i2 != null || r2) && (rm2 == 0 || rm2 == (x3.s < 0 ? 3 : 2)) : i2 > k2 || i2 == k2 && (rm2 == 4 || r2 || rm2 == 6 && xc2[d4 - 1] & 1 || rm2 == (x3.s < 0 ? 8 : 7)); + if (d4 < 1 || !xc2[0]) { + str = r2 ? toFixedPoint(alphabet2.charAt(1), -dp, alphabet2.charAt(0)) : alphabet2.charAt(0); + } else { + xc2.length = d4; + if (r2) { + for (--baseOut; ++xc2[--d4] > baseOut; ) { + xc2[d4] = 0; + if (!d4) { + ++e18; + xc2 = [1].concat(xc2); + } + } + } + for (k2 = xc2.length; !xc2[--k2]; ) + ; + for (i2 = 0, str = ""; i2 <= k2; str += alphabet2.charAt(xc2[i2++])) + ; + str = toFixedPoint(str, e18, alphabet2.charAt(0)); + } + return str; + }; + }(); + div = function() { + function multiply(x3, k2, base3) { + var m3, temp, xlo, xhi, carry = 0, i2 = x3.length, klo = k2 % SQRT_BASE, khi = k2 / SQRT_BASE | 0; + for (x3 = x3.slice(); i2--; ) { + xlo = x3[i2] % SQRT_BASE; + xhi = x3[i2] / SQRT_BASE | 0; + m3 = khi * xlo + xhi * klo; + temp = klo * xlo + m3 % SQRT_BASE * SQRT_BASE + carry; + carry = (temp / base3 | 0) + (m3 / SQRT_BASE | 0) + khi * xhi; + x3[i2] = temp % base3; + } + if (carry) + x3 = [carry].concat(x3); + return x3; + } + function compare2(a3, b2, aL, bL) { + var i2, cmp; + if (aL != bL) { + cmp = aL > bL ? 1 : -1; + } else { + for (i2 = cmp = 0; i2 < aL; i2++) { + if (a3[i2] != b2[i2]) { + cmp = a3[i2] > b2[i2] ? 1 : -1; + break; + } + } + } + return cmp; + } + function subtract(a3, b2, aL, base3) { + var i2 = 0; + for (; aL--; ) { + a3[aL] -= i2; + i2 = a3[aL] < b2[aL] ? 1 : 0; + a3[aL] = i2 * base3 + a3[aL] - b2[aL]; + } + for (; !a3[0] && a3.length > 1; a3.splice(0, 1)) + ; + } + return function(x3, y3, dp, rm2, base3) { + var cmp, e18, i2, more, n5, prod, prodL, q2, qc2, rem, remL, rem0, xi2, xL, yc0, yL, yz, s2 = x3.s == y3.s ? 1 : -1, xc2 = x3.c, yc2 = y3.c; + if (!xc2 || !xc2[0] || !yc2 || !yc2[0]) { + return new BigNumber2( + // Return NaN if either NaN, or both Infinity or 0. + !x3.s || !y3.s || (xc2 ? yc2 && xc2[0] == yc2[0] : !yc2) ? NaN : ( + // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. + xc2 && xc2[0] == 0 || !yc2 ? s2 * 0 : s2 / 0 + ) + ); + } + q2 = new BigNumber2(s2); + qc2 = q2.c = []; + e18 = x3.e - y3.e; + s2 = dp + e18 + 1; + if (!base3) { + base3 = BASE$1; + e18 = bitFloor(x3.e / LOG_BASE) - bitFloor(y3.e / LOG_BASE); + s2 = s2 / LOG_BASE | 0; + } + for (i2 = 0; yc2[i2] == (xc2[i2] || 0); i2++) + ; + if (yc2[i2] > (xc2[i2] || 0)) + e18--; + if (s2 < 0) { + qc2.push(1); + more = true; + } else { + xL = xc2.length; + yL = yc2.length; + i2 = 0; + s2 += 2; + n5 = mathfloor(base3 / (yc2[0] + 1)); + if (n5 > 1) { + yc2 = multiply(yc2, n5, base3); + xc2 = multiply(xc2, n5, base3); + yL = yc2.length; + xL = xc2.length; + } + xi2 = yL; + rem = xc2.slice(0, yL); + remL = rem.length; + for (; remL < yL; rem[remL++] = 0) + ; + yz = yc2.slice(); + yz = [0].concat(yz); + yc0 = yc2[0]; + if (yc2[1] >= base3 / 2) + yc0++; + do { + n5 = 0; + cmp = compare2(yc2, rem, yL, remL); + if (cmp < 0) { + rem0 = rem[0]; + if (yL != remL) + rem0 = rem0 * base3 + (rem[1] || 0); + n5 = mathfloor(rem0 / yc0); + if (n5 > 1) { + if (n5 >= base3) + n5 = base3 - 1; + prod = multiply(yc2, n5, base3); + prodL = prod.length; + remL = rem.length; + while (compare2(prod, rem, prodL, remL) == 1) { + n5--; + subtract(prod, yL < prodL ? yz : yc2, prodL, base3); + prodL = prod.length; + cmp = 1; + } + } else { + if (n5 == 0) { + cmp = n5 = 1; + } + prod = yc2.slice(); + prodL = prod.length; + } + if (prodL < remL) + prod = [0].concat(prod); + subtract(rem, prod, remL, base3); + remL = rem.length; + if (cmp == -1) { + while (compare2(yc2, rem, yL, remL) < 1) { + n5++; + subtract(rem, yL < remL ? yz : yc2, remL, base3); + remL = rem.length; + } + } + } else if (cmp === 0) { + n5++; + rem = [0]; + } + qc2[i2++] = n5; + if (rem[0]) { + rem[remL++] = xc2[xi2] || 0; + } else { + rem = [xc2[xi2]]; + remL = 1; + } + } while ((xi2++ < xL || rem[0] != null) && s2--); + more = rem[0] != null; + if (!qc2[0]) + qc2.splice(0, 1); + } + if (base3 == BASE$1) { + for (i2 = 1, s2 = qc2[0]; s2 >= 10; s2 /= 10, i2++) + ; + round(q2, dp + (q2.e = i2 + e18 * LOG_BASE - 1) + 1, rm2, more); + } else { + q2.e = e18; + q2.r = +more; + } + return q2; + }; + }(); + function format2(n5, i2, rm2, id2) { + var c02, e18, ne2, len, str; + if (rm2 == null) + rm2 = ROUNDING_MODE; + else + intCheck(rm2, 0, 8); + if (!n5.c) + return n5.toString(); + c02 = n5.c[0]; + ne2 = n5.e; + if (i2 == null) { + str = coeffToString(n5.c); + str = id2 == 1 || id2 == 2 && (ne2 <= TO_EXP_NEG || ne2 >= TO_EXP_POS) ? toExponential(str, ne2) : toFixedPoint(str, ne2, "0"); + } else { + n5 = round(new BigNumber2(n5), i2, rm2); + e18 = n5.e; + str = coeffToString(n5.c); + len = str.length; + if (id2 == 1 || id2 == 2 && (i2 <= e18 || e18 <= TO_EXP_NEG)) { + for (; len < i2; str += "0", len++) + ; + str = toExponential(str, e18); + } else { + i2 -= ne2; + str = toFixedPoint(str, e18, "0"); + if (e18 + 1 > len) { + if (--i2 > 0) + for (str += "."; i2--; str += "0") + ; + } else { + i2 += e18 - len; + if (i2 > 0) { + if (e18 + 1 == len) + str += "."; + for (; i2--; str += "0") + ; + } + } + } + } + return n5.s < 0 && c02 ? "-" + str : str; + } + function maxOrMin(args, n5) { + var k2, y3, i2 = 1, x3 = new BigNumber2(args[0]); + for (; i2 < args.length; i2++) { + y3 = new BigNumber2(args[i2]); + if (!y3.s || (k2 = compare(x3, y3)) === n5 || k2 === 0 && x3.s === n5) { + x3 = y3; + } + } + return x3; + } + function normalise(n5, c2, e18) { + var i2 = 1, j2 = c2.length; + for (; !c2[--j2]; c2.pop()) + ; + for (j2 = c2[0]; j2 >= 10; j2 /= 10, i2++) + ; + if ((e18 = i2 + e18 * LOG_BASE - 1) > MAX_EXP) { + n5.c = n5.e = null; + } else if (e18 < MIN_EXP) { + n5.c = [n5.e = 0]; + } else { + n5.e = e18; + n5.c = c2; + } + return n5; + } + parseNumeric = function() { + var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + return function(x3, str, isNum, b2) { + var base3, s2 = isNum ? str : str.replace(whitespaceOrPlus, ""); + if (isInfinityOrNaN.test(s2)) { + x3.s = isNaN(s2) ? null : s2 < 0 ? -1 : 1; + } else { + if (!isNum) { + s2 = s2.replace(basePrefix, function(m3, p1, p22) { + base3 = (p22 = p22.toLowerCase()) == "x" ? 16 : p22 == "b" ? 2 : 8; + return !b2 || b2 == base3 ? p1 : m3; + }); + if (b2) { + base3 = b2; + s2 = s2.replace(dotAfter, "$1").replace(dotBefore, "0.$1"); + } + if (str != s2) + return new BigNumber2(s2, base3); + } + if (BigNumber2.DEBUG) { + throw Error(bignumberError + "Not a" + (b2 ? " base " + b2 : "") + " number: " + str); + } + x3.s = null; + } + x3.c = x3.e = null; + }; + }(); + function round(x3, sd2, rm2, r2) { + var d4, i2, j2, k2, n5, ni2, rd2, xc2 = x3.c, pows10 = POWS_TEN; + if (xc2) { + out: { + for (d4 = 1, k2 = xc2[0]; k2 >= 10; k2 /= 10, d4++) + ; + i2 = sd2 - d4; + if (i2 < 0) { + i2 += LOG_BASE; + j2 = sd2; + n5 = xc2[ni2 = 0]; + rd2 = mathfloor(n5 / pows10[d4 - j2 - 1] % 10); + } else { + ni2 = mathceil((i2 + 1) / LOG_BASE); + if (ni2 >= xc2.length) { + if (r2) { + for (; xc2.length <= ni2; xc2.push(0)) + ; + n5 = rd2 = 0; + d4 = 1; + i2 %= LOG_BASE; + j2 = i2 - LOG_BASE + 1; + } else { + break out; + } + } else { + n5 = k2 = xc2[ni2]; + for (d4 = 1; k2 >= 10; k2 /= 10, d4++) + ; + i2 %= LOG_BASE; + j2 = i2 - LOG_BASE + d4; + rd2 = j2 < 0 ? 0 : mathfloor(n5 / pows10[d4 - j2 - 1] % 10); + } + } + r2 = r2 || sd2 < 0 || // Are there any non-zero digits after the rounding digit? + // The expression n % pows10[d - j - 1] returns all digits of n to the right + // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. + xc2[ni2 + 1] != null || (j2 < 0 ? n5 : n5 % pows10[d4 - j2 - 1]); + r2 = rm2 < 4 ? (rd2 || r2) && (rm2 == 0 || rm2 == (x3.s < 0 ? 3 : 2)) : rd2 > 5 || rd2 == 5 && (rm2 == 4 || r2 || rm2 == 6 && // Check whether the digit to the left of the rounding digit is odd. + (i2 > 0 ? j2 > 0 ? n5 / pows10[d4 - j2] : 0 : xc2[ni2 - 1]) % 10 & 1 || rm2 == (x3.s < 0 ? 8 : 7)); + if (sd2 < 1 || !xc2[0]) { + xc2.length = 0; + if (r2) { + sd2 -= x3.e + 1; + xc2[0] = pows10[(LOG_BASE - sd2 % LOG_BASE) % LOG_BASE]; + x3.e = -sd2 || 0; + } else { + xc2[0] = x3.e = 0; + } + return x3; + } + if (i2 == 0) { + xc2.length = ni2; + k2 = 1; + ni2--; + } else { + xc2.length = ni2 + 1; + k2 = pows10[LOG_BASE - i2]; + xc2[ni2] = j2 > 0 ? mathfloor(n5 / pows10[d4 - j2] % pows10[j2]) * k2 : 0; + } + if (r2) { + for (; ; ) { + if (ni2 == 0) { + for (i2 = 1, j2 = xc2[0]; j2 >= 10; j2 /= 10, i2++) + ; + j2 = xc2[0] += k2; + for (k2 = 1; j2 >= 10; j2 /= 10, k2++) + ; + if (i2 != k2) { + x3.e++; + if (xc2[0] == BASE$1) + xc2[0] = 1; + } + break; + } else { + xc2[ni2] += k2; + if (xc2[ni2] != BASE$1) + break; + xc2[ni2--] = 0; + k2 = 1; + } + } + } + for (i2 = xc2.length; xc2[--i2] === 0; xc2.pop()) + ; + } + if (x3.e > MAX_EXP) { + x3.c = x3.e = null; + } else if (x3.e < MIN_EXP) { + x3.c = [x3.e = 0]; + } + } + return x3; + } + function valueOf(n5) { + var str, e18 = n5.e; + if (e18 === null) + return n5.toString(); + str = coeffToString(n5.c); + str = e18 <= TO_EXP_NEG || e18 >= TO_EXP_POS ? toExponential(str, e18) : toFixedPoint(str, e18, "0"); + return n5.s < 0 ? "-" + str : str; + } + P2.absoluteValue = P2.abs = function() { + var x3 = new BigNumber2(this); + if (x3.s < 0) + x3.s = 1; + return x3; + }; + P2.comparedTo = function(y3, b2) { + return compare(this, new BigNumber2(y3, b2)); + }; + P2.decimalPlaces = P2.dp = function(dp, rm2) { + var c2, n5, v6, x3 = this; + if (dp != null) { + intCheck(dp, 0, MAX); + if (rm2 == null) + rm2 = ROUNDING_MODE; + else + intCheck(rm2, 0, 8); + return round(new BigNumber2(x3), dp + x3.e + 1, rm2); + } + if (!(c2 = x3.c)) + return null; + n5 = ((v6 = c2.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; + if (v6 = c2[v6]) + for (; v6 % 10 == 0; v6 /= 10, n5--) + ; + if (n5 < 0) + n5 = 0; + return n5; + }; + P2.dividedBy = P2.div = function(y3, b2) { + return div(this, new BigNumber2(y3, b2), DECIMAL_PLACES, ROUNDING_MODE); + }; + P2.dividedToIntegerBy = P2.idiv = function(y3, b2) { + return div(this, new BigNumber2(y3, b2), 0, 1); + }; + P2.exponentiatedBy = P2.pow = function(n5, m3) { + var half, isModExp, i2, k2, more, nIsBig, nIsNeg, nIsOdd, y3, x3 = this; + n5 = new BigNumber2(n5); + if (n5.c && !n5.isInteger()) { + throw Error(bignumberError + "Exponent not an integer: " + valueOf(n5)); + } + if (m3 != null) + m3 = new BigNumber2(m3); + nIsBig = n5.e > 14; + if (!x3.c || !x3.c[0] || x3.c[0] == 1 && !x3.e && x3.c.length == 1 || !n5.c || !n5.c[0]) { + y3 = new BigNumber2(Math.pow(+valueOf(x3), nIsBig ? n5.s * (2 - isOdd(n5)) : +valueOf(n5))); + return m3 ? y3.mod(m3) : y3; + } + nIsNeg = n5.s < 0; + if (m3) { + if (m3.c ? !m3.c[0] : !m3.s) + return new BigNumber2(NaN); + isModExp = !nIsNeg && x3.isInteger() && m3.isInteger(); + if (isModExp) + x3 = x3.mod(m3); + } else if (n5.e > 9 && (x3.e > 0 || x3.e < -1 || (x3.e == 0 ? x3.c[0] > 1 || nIsBig && x3.c[1] >= 24e7 : x3.c[0] < 8e13 || nIsBig && x3.c[0] <= 9999975e7))) { + k2 = x3.s < 0 && isOdd(n5) ? -0 : 0; + if (x3.e > -1) + k2 = 1 / k2; + return new BigNumber2(nIsNeg ? 1 / k2 : k2); + } else if (POW_PRECISION) { + k2 = mathceil(POW_PRECISION / LOG_BASE + 2); + } + if (nIsBig) { + half = new BigNumber2(0.5); + if (nIsNeg) + n5.s = 1; + nIsOdd = isOdd(n5); + } else { + i2 = Math.abs(+valueOf(n5)); + nIsOdd = i2 % 2; + } + y3 = new BigNumber2(ONE); + for (; ; ) { + if (nIsOdd) { + y3 = y3.times(x3); + if (!y3.c) + break; + if (k2) { + if (y3.c.length > k2) + y3.c.length = k2; + } else if (isModExp) { + y3 = y3.mod(m3); + } + } + if (i2) { + i2 = mathfloor(i2 / 2); + if (i2 === 0) + break; + nIsOdd = i2 % 2; + } else { + n5 = n5.times(half); + round(n5, n5.e + 1, 1); + if (n5.e > 14) { + nIsOdd = isOdd(n5); + } else { + i2 = +valueOf(n5); + if (i2 === 0) + break; + nIsOdd = i2 % 2; + } + } + x3 = x3.times(x3); + if (k2) { + if (x3.c && x3.c.length > k2) + x3.c.length = k2; + } else if (isModExp) { + x3 = x3.mod(m3); + } + } + if (isModExp) + return y3; + if (nIsNeg) + y3 = ONE.div(y3); + return m3 ? y3.mod(m3) : k2 ? round(y3, POW_PRECISION, ROUNDING_MODE, more) : y3; + }; + P2.integerValue = function(rm2) { + var n5 = new BigNumber2(this); + if (rm2 == null) + rm2 = ROUNDING_MODE; + else + intCheck(rm2, 0, 8); + return round(n5, n5.e + 1, rm2); + }; + P2.isEqualTo = P2.eq = function(y3, b2) { + return compare(this, new BigNumber2(y3, b2)) === 0; + }; + P2.isFinite = function() { + return !!this.c; + }; + P2.isGreaterThan = P2.gt = function(y3, b2) { + return compare(this, new BigNumber2(y3, b2)) > 0; + }; + P2.isGreaterThanOrEqualTo = P2.gte = function(y3, b2) { + return (b2 = compare(this, new BigNumber2(y3, b2))) === 1 || b2 === 0; + }; + P2.isInteger = function() { + return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; + }; + P2.isLessThan = P2.lt = function(y3, b2) { + return compare(this, new BigNumber2(y3, b2)) < 0; + }; + P2.isLessThanOrEqualTo = P2.lte = function(y3, b2) { + return (b2 = compare(this, new BigNumber2(y3, b2))) === -1 || b2 === 0; + }; + P2.isNaN = function() { + return !this.s; + }; + P2.isNegative = function() { + return this.s < 0; + }; + P2.isPositive = function() { + return this.s > 0; + }; + P2.isZero = function() { + return !!this.c && this.c[0] == 0; + }; + P2.minus = function(y3, b2) { + var i2, j2, t2, xLTy, x3 = this, a3 = x3.s; + y3 = new BigNumber2(y3, b2); + b2 = y3.s; + if (!a3 || !b2) + return new BigNumber2(NaN); + if (a3 != b2) { + y3.s = -b2; + return x3.plus(y3); + } + var xe2 = x3.e / LOG_BASE, ye2 = y3.e / LOG_BASE, xc2 = x3.c, yc2 = y3.c; + if (!xe2 || !ye2) { + if (!xc2 || !yc2) + return xc2 ? (y3.s = -b2, y3) : new BigNumber2(yc2 ? x3 : NaN); + if (!xc2[0] || !yc2[0]) { + return yc2[0] ? (y3.s = -b2, y3) : new BigNumber2(xc2[0] ? x3 : ( + // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity + ROUNDING_MODE == 3 ? -0 : 0 + )); + } + } + xe2 = bitFloor(xe2); + ye2 = bitFloor(ye2); + xc2 = xc2.slice(); + if (a3 = xe2 - ye2) { + if (xLTy = a3 < 0) { + a3 = -a3; + t2 = xc2; + } else { + ye2 = xe2; + t2 = yc2; + } + t2.reverse(); + for (b2 = a3; b2--; t2.push(0)) + ; + t2.reverse(); + } else { + j2 = (xLTy = (a3 = xc2.length) < (b2 = yc2.length)) ? a3 : b2; + for (a3 = b2 = 0; b2 < j2; b2++) { + if (xc2[b2] != yc2[b2]) { + xLTy = xc2[b2] < yc2[b2]; + break; + } + } + } + if (xLTy) { + t2 = xc2; + xc2 = yc2; + yc2 = t2; + y3.s = -y3.s; + } + b2 = (j2 = yc2.length) - (i2 = xc2.length); + if (b2 > 0) + for (; b2--; xc2[i2++] = 0) + ; + b2 = BASE$1 - 1; + for (; j2 > a3; ) { + if (xc2[--j2] < yc2[j2]) { + for (i2 = j2; i2 && !xc2[--i2]; xc2[i2] = b2) + ; + --xc2[i2]; + xc2[j2] += BASE$1; + } + xc2[j2] -= yc2[j2]; + } + for (; xc2[0] == 0; xc2.splice(0, 1), --ye2) + ; + if (!xc2[0]) { + y3.s = ROUNDING_MODE == 3 ? -1 : 1; + y3.c = [y3.e = 0]; + return y3; + } + return normalise(y3, xc2, ye2); + }; + P2.modulo = P2.mod = function(y3, b2) { + var q2, s2, x3 = this; + y3 = new BigNumber2(y3, b2); + if (!x3.c || !y3.s || y3.c && !y3.c[0]) { + return new BigNumber2(NaN); + } else if (!y3.c || x3.c && !x3.c[0]) { + return new BigNumber2(x3); + } + if (MODULO_MODE == 9) { + s2 = y3.s; + y3.s = 1; + q2 = div(x3, y3, 0, 3); + y3.s = s2; + q2.s *= s2; + } else { + q2 = div(x3, y3, 0, MODULO_MODE); + } + y3 = x3.minus(q2.times(y3)); + if (!y3.c[0] && MODULO_MODE == 1) + y3.s = x3.s; + return y3; + }; + P2.multipliedBy = P2.times = function(y3, b2) { + var c2, e18, i2, j2, k2, m3, xcL, xlo, xhi, ycL, ylo, yhi, zc2, base3, sqrtBase, x3 = this, xc2 = x3.c, yc2 = (y3 = new BigNumber2(y3, b2)).c; + if (!xc2 || !yc2 || !xc2[0] || !yc2[0]) { + if (!x3.s || !y3.s || xc2 && !xc2[0] && !yc2 || yc2 && !yc2[0] && !xc2) { + y3.c = y3.e = y3.s = null; + } else { + y3.s *= x3.s; + if (!xc2 || !yc2) { + y3.c = y3.e = null; + } else { + y3.c = [0]; + y3.e = 0; + } + } + return y3; + } + e18 = bitFloor(x3.e / LOG_BASE) + bitFloor(y3.e / LOG_BASE); + y3.s *= x3.s; + xcL = xc2.length; + ycL = yc2.length; + if (xcL < ycL) { + zc2 = xc2; + xc2 = yc2; + yc2 = zc2; + i2 = xcL; + xcL = ycL; + ycL = i2; + } + for (i2 = xcL + ycL, zc2 = []; i2--; zc2.push(0)) + ; + base3 = BASE$1; + sqrtBase = SQRT_BASE; + for (i2 = ycL; --i2 >= 0; ) { + c2 = 0; + ylo = yc2[i2] % sqrtBase; + yhi = yc2[i2] / sqrtBase | 0; + for (k2 = xcL, j2 = i2 + k2; j2 > i2; ) { + xlo = xc2[--k2] % sqrtBase; + xhi = xc2[k2] / sqrtBase | 0; + m3 = yhi * xlo + xhi * ylo; + xlo = ylo * xlo + m3 % sqrtBase * sqrtBase + zc2[j2] + c2; + c2 = (xlo / base3 | 0) + (m3 / sqrtBase | 0) + yhi * xhi; + zc2[j2--] = xlo % base3; + } + zc2[j2] = c2; + } + if (c2) { + ++e18; + } else { + zc2.splice(0, 1); + } + return normalise(y3, zc2, e18); + }; + P2.negated = function() { + var x3 = new BigNumber2(this); + x3.s = -x3.s || null; + return x3; + }; + P2.plus = function(y3, b2) { + var t2, x3 = this, a3 = x3.s; + y3 = new BigNumber2(y3, b2); + b2 = y3.s; + if (!a3 || !b2) + return new BigNumber2(NaN); + if (a3 != b2) { + y3.s = -b2; + return x3.minus(y3); + } + var xe2 = x3.e / LOG_BASE, ye2 = y3.e / LOG_BASE, xc2 = x3.c, yc2 = y3.c; + if (!xe2 || !ye2) { + if (!xc2 || !yc2) + return new BigNumber2(a3 / 0); + if (!xc2[0] || !yc2[0]) + return yc2[0] ? y3 : new BigNumber2(xc2[0] ? x3 : a3 * 0); + } + xe2 = bitFloor(xe2); + ye2 = bitFloor(ye2); + xc2 = xc2.slice(); + if (a3 = xe2 - ye2) { + if (a3 > 0) { + ye2 = xe2; + t2 = yc2; + } else { + a3 = -a3; + t2 = xc2; + } + t2.reverse(); + for (; a3--; t2.push(0)) + ; + t2.reverse(); + } + a3 = xc2.length; + b2 = yc2.length; + if (a3 - b2 < 0) { + t2 = yc2; + yc2 = xc2; + xc2 = t2; + b2 = a3; + } + for (a3 = 0; b2; ) { + a3 = (xc2[--b2] = xc2[b2] + yc2[b2] + a3) / BASE$1 | 0; + xc2[b2] = BASE$1 === xc2[b2] ? 0 : xc2[b2] % BASE$1; + } + if (a3) { + xc2 = [a3].concat(xc2); + ++ye2; + } + return normalise(y3, xc2, ye2); + }; + P2.precision = P2.sd = function(sd2, rm2) { + var c2, n5, v6, x3 = this; + if (sd2 != null && sd2 !== !!sd2) { + intCheck(sd2, 1, MAX); + if (rm2 == null) + rm2 = ROUNDING_MODE; + else + intCheck(rm2, 0, 8); + return round(new BigNumber2(x3), sd2, rm2); + } + if (!(c2 = x3.c)) + return null; + v6 = c2.length - 1; + n5 = v6 * LOG_BASE + 1; + if (v6 = c2[v6]) { + for (; v6 % 10 == 0; v6 /= 10, n5--) + ; + for (v6 = c2[0]; v6 >= 10; v6 /= 10, n5++) + ; + } + if (sd2 && x3.e + 1 > n5) + n5 = x3.e + 1; + return n5; + }; + P2.shiftedBy = function(k2) { + intCheck(k2, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + return this.times("1e" + k2); + }; + P2.squareRoot = P2.sqrt = function() { + var m3, n5, r2, rep, t2, x3 = this, c2 = x3.c, s2 = x3.s, e18 = x3.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5"); + if (s2 !== 1 || !c2 || !c2[0]) { + return new BigNumber2(!s2 || s2 < 0 && (!c2 || c2[0]) ? NaN : c2 ? x3 : 1 / 0); + } + s2 = Math.sqrt(+valueOf(x3)); + if (s2 == 0 || s2 == 1 / 0) { + n5 = coeffToString(c2); + if ((n5.length + e18) % 2 == 0) + n5 += "0"; + s2 = Math.sqrt(+n5); + e18 = bitFloor((e18 + 1) / 2) - (e18 < 0 || e18 % 2); + if (s2 == 1 / 0) { + n5 = "5e" + e18; + } else { + n5 = s2.toExponential(); + n5 = n5.slice(0, n5.indexOf("e") + 1) + e18; + } + r2 = new BigNumber2(n5); + } else { + r2 = new BigNumber2(s2 + ""); + } + if (r2.c[0]) { + e18 = r2.e; + s2 = e18 + dp; + if (s2 < 3) + s2 = 0; + for (; ; ) { + t2 = r2; + r2 = half.times(t2.plus(div(x3, t2, dp, 1))); + if (coeffToString(t2.c).slice(0, s2) === (n5 = coeffToString(r2.c)).slice(0, s2)) { + if (r2.e < e18) + --s2; + n5 = n5.slice(s2 - 3, s2 + 1); + if (n5 == "9999" || !rep && n5 == "4999") { + if (!rep) { + round(t2, t2.e + DECIMAL_PLACES + 2, 0); + if (t2.times(t2).eq(x3)) { + r2 = t2; + break; + } + } + dp += 4; + s2 += 4; + rep = 1; + } else { + if (!+n5 || !+n5.slice(1) && n5.charAt(0) == "5") { + round(r2, r2.e + DECIMAL_PLACES + 2, 1); + m3 = !r2.times(r2).eq(x3); + } + break; + } + } + } + } + return round(r2, r2.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m3); + }; + P2.toExponential = function(dp, rm2) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp++; + } + return format2(this, dp, rm2, 1); + }; + P2.toFixed = function(dp, rm2) { + if (dp != null) { + intCheck(dp, 0, MAX); + dp = dp + this.e + 1; + } + return format2(this, dp, rm2); + }; + P2.toFormat = function(dp, rm2, format3) { + var str, x3 = this; + if (format3 == null) { + if (dp != null && rm2 && typeof rm2 == "object") { + format3 = rm2; + rm2 = null; + } else if (dp && typeof dp == "object") { + format3 = dp; + dp = rm2 = null; + } else { + format3 = FORMAT; + } + } else if (typeof format3 != "object") { + throw Error(bignumberError + "Argument not an object: " + format3); + } + str = x3.toFixed(dp, rm2); + if (x3.c) { + var i2, arr = str.split("."), g1 = +format3.groupSize, g22 = +format3.secondaryGroupSize, groupSeparator = format3.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x3.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length; + if (g22) { + i2 = g1; + g1 = g22; + g22 = i2; + len -= i2; + } + if (g1 > 0 && len > 0) { + i2 = len % g1 || g1; + intPart = intDigits.substr(0, i2); + for (; i2 < len; i2 += g1) + intPart += groupSeparator + intDigits.substr(i2, g1); + if (g22 > 0) + intPart += groupSeparator + intDigits.slice(i2); + if (isNeg) + intPart = "-" + intPart; + } + str = fractionPart ? intPart + (format3.decimalSeparator || "") + ((g22 = +format3.fractionGroupSize) ? fractionPart.replace( + new RegExp("\\d{" + g22 + "}\\B", "g"), + "$&" + (format3.fractionGroupSeparator || "") + ) : fractionPart) : intPart; + } + return (format3.prefix || "") + str + (format3.suffix || ""); + }; + P2.toFraction = function(md2) { + var d4, d02, d1, d22, e18, exp2, n5, n02, n1, q2, r2, s2, x3 = this, xc2 = x3.c; + if (md2 != null) { + n5 = new BigNumber2(md2); + if (!n5.isInteger() && (n5.c || n5.s !== 1) || n5.lt(ONE)) { + throw Error(bignumberError + "Argument " + (n5.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n5)); + } + } + if (!xc2) + return new BigNumber2(x3); + d4 = new BigNumber2(ONE); + n1 = d02 = new BigNumber2(ONE); + d1 = n02 = new BigNumber2(ONE); + s2 = coeffToString(xc2); + e18 = d4.e = s2.length - x3.e - 1; + d4.c[0] = POWS_TEN[(exp2 = e18 % LOG_BASE) < 0 ? LOG_BASE + exp2 : exp2]; + md2 = !md2 || n5.comparedTo(d4) > 0 ? e18 > 0 ? d4 : n1 : n5; + exp2 = MAX_EXP; + MAX_EXP = 1 / 0; + n5 = new BigNumber2(s2); + n02.c[0] = 0; + for (; ; ) { + q2 = div(n5, d4, 0, 1); + d22 = d02.plus(q2.times(d1)); + if (d22.comparedTo(md2) == 1) + break; + d02 = d1; + d1 = d22; + n1 = n02.plus(q2.times(d22 = n1)); + n02 = d22; + d4 = n5.minus(q2.times(d22 = d4)); + n5 = d22; + } + d22 = div(md2.minus(d02), d1, 0, 1); + n02 = n02.plus(d22.times(n1)); + d02 = d02.plus(d22.times(d1)); + n02.s = n1.s = x3.s; + e18 = e18 * 2; + r2 = div(n1, d1, e18, ROUNDING_MODE).minus(x3).abs().comparedTo( + div(n02, d02, e18, ROUNDING_MODE).minus(x3).abs() + ) < 1 ? [n1, d1] : [n02, d02]; + MAX_EXP = exp2; + return r2; + }; + P2.toNumber = function() { + return +valueOf(this); + }; + P2.toPrecision = function(sd2, rm2) { + if (sd2 != null) + intCheck(sd2, 1, MAX); + return format2(this, sd2, rm2, 2); + }; + P2.toString = function(b2) { + var str, n5 = this, s2 = n5.s, e18 = n5.e; + if (e18 === null) { + if (s2) { + str = "Infinity"; + if (s2 < 0) + str = "-" + str; + } else { + str = "NaN"; + } + } else { + if (b2 == null) { + str = e18 <= TO_EXP_NEG || e18 >= TO_EXP_POS ? toExponential(coeffToString(n5.c), e18) : toFixedPoint(coeffToString(n5.c), e18, "0"); + } else if (b2 === 10 && alphabetHasNormalDecimalDigits) { + n5 = round(new BigNumber2(n5), DECIMAL_PLACES + e18 + 1, ROUNDING_MODE); + str = toFixedPoint(coeffToString(n5.c), n5.e, "0"); + } else { + intCheck(b2, 2, ALPHABET2.length, "Base"); + str = convertBase(toFixedPoint(coeffToString(n5.c), e18, "0"), 10, b2, s2, true); + } + if (s2 < 0 && n5.c[0]) + str = "-" + str; + } + return str; + }; + P2.valueOf = P2.toJSON = function() { + return valueOf(this); + }; + P2._isBigNumber = true; + P2[Symbol.toStringTag] = "BigNumber"; + P2[Symbol.for("nodejs.util.inspect.custom")] = P2.valueOf; + if (configObject != null) + BigNumber2.set(configObject); + return BigNumber2; +} +function bitFloor(n5) { + var i2 = n5 | 0; + return n5 > 0 || n5 === i2 ? i2 : i2 - 1; +} +function coeffToString(a3) { + var s2, z3, i2 = 1, j2 = a3.length, r2 = a3[0] + ""; + for (; i2 < j2; ) { + s2 = a3[i2++] + ""; + z3 = LOG_BASE - s2.length; + for (; z3--; s2 = "0" + s2) + ; + r2 += s2; + } + for (j2 = r2.length; r2.charCodeAt(--j2) === 48; ) + ; + return r2.slice(0, j2 + 1 || 1); +} +function compare(x3, y3) { + var a3, b2, xc2 = x3.c, yc2 = y3.c, i2 = x3.s, j2 = y3.s, k2 = x3.e, l2 = y3.e; + if (!i2 || !j2) + return null; + a3 = xc2 && !xc2[0]; + b2 = yc2 && !yc2[0]; + if (a3 || b2) + return a3 ? b2 ? 0 : -j2 : i2; + if (i2 != j2) + return i2; + a3 = i2 < 0; + b2 = k2 == l2; + if (!xc2 || !yc2) + return b2 ? 0 : !xc2 ^ a3 ? 1 : -1; + if (!b2) + return k2 > l2 ^ a3 ? 1 : -1; + j2 = (k2 = xc2.length) < (l2 = yc2.length) ? k2 : l2; + for (i2 = 0; i2 < j2; i2++) + if (xc2[i2] != yc2[i2]) + return xc2[i2] > yc2[i2] ^ a3 ? 1 : -1; + return k2 == l2 ? 0 : k2 > l2 ^ a3 ? 1 : -1; +} +function intCheck(n5, min, max, name2) { + if (n5 < min || n5 > max || n5 !== mathfloor(n5)) { + throw Error(bignumberError + (name2 || "Argument") + (typeof n5 == "number" ? n5 < min || n5 > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n5)); + } +} +function isOdd(n5) { + var k2 = n5.c.length - 1; + return bitFloor(n5.e / LOG_BASE) == k2 && n5.c[k2] % 2 != 0; +} +function toExponential(str, e18) { + return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e18 < 0 ? "e" : "e+") + e18; +} +function toFixedPoint(str, e18, z3) { + var len, zs2; + if (e18 < 0) { + for (zs2 = z3 + "."; ++e18; zs2 += z3) + ; + str = zs2 + str; + } else { + len = str.length; + if (++e18 > len) { + for (zs2 = z3, e18 -= len; --e18; zs2 += z3) + ; + str += zs2; + } else if (e18 < len) { + str = str.slice(0, e18) + "." + str.slice(e18); + } + } + return str; +} +var BigNumber = clone(); +var validator$2 = { exports: {} }; +var toDate = { exports: {} }; +var assertString = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = assertString2; + function _typeof2(o2) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { + return typeof o3; + } : function(o3) { + return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; + }, _typeof2(o2); + } + function assertString2(input) { + var isString2 = typeof input === "string" || input instanceof String; + if (!isString2) { + var invalidType = _typeof2(input); + if (input === null) + invalidType = "null"; + else if (invalidType === "object") + invalidType = input.constructor.name; + throw new TypeError("Expected a string but received a ".concat(invalidType)); + } + } + module.exports = exports.default; + module.exports.default = exports.default; +})(assertString, assertString.exports); +var assertStringExports = assertString.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = toDate2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function toDate2(date) { + (0, _assertString2.default)(date); + date = Date.parse(date); + return !isNaN(date) ? new Date(date) : null; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(toDate, toDate.exports); +var toDateExports = toDate.exports; +var toFloat = { exports: {} }; +var isFloat$1 = {}; +var alpha$1 = {}; +Object.defineProperty(alpha$1, "__esModule", { + value: true +}); +alpha$1.farsiLocales = alpha$1.englishLocales = alpha$1.dotDecimal = alpha$1.decimal = alpha$1.commaDecimal = alpha$1.bengaliLocales = alpha$1.arabicLocales = alpha$1.alphanumeric = alpha$1.alpha = void 0; +var alpha = alpha$1.alpha = { + "en-US": /^[A-Z]+$/i, + "az-AZ": /^[A-VXYZÇƏĞİıÖŞÜ]+$/i, + "bg-BG": /^[А-Я]+$/i, + "cs-CZ": /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i, + "da-DK": /^[A-ZÆØÅ]+$/i, + "de-DE": /^[A-ZÄÖÜß]+$/i, + "el-GR": /^[Α-ώ]+$/i, + "es-ES": /^[A-ZÁÉÍÑÓÚÜ]+$/i, + "fa-IR": /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i, + "fi-FI": /^[A-ZÅÄÖ]+$/i, + "fr-FR": /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i, + "it-IT": /^[A-ZÀÉÈÌÎÓÒÙ]+$/i, + "ja-JP": /^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i, + "nb-NO": /^[A-ZÆØÅ]+$/i, + "nl-NL": /^[A-ZÁÉËÏÓÖÜÚ]+$/i, + "nn-NO": /^[A-ZÆØÅ]+$/i, + "hu-HU": /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i, + "pl-PL": /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i, + "pt-PT": /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i, + "ru-RU": /^[А-ЯЁ]+$/i, + "kk-KZ": /^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i, + "sl-SI": /^[A-ZČĆĐŠŽ]+$/i, + "sk-SK": /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i, + "sr-RS@latin": /^[A-ZČĆŽŠĐ]+$/i, + "sr-RS": /^[А-ЯЂЈЉЊЋЏ]+$/i, + "sv-SE": /^[A-ZÅÄÖ]+$/i, + "th-TH": /^[ก-๐\s]+$/i, + "tr-TR": /^[A-ZÇĞİıÖŞÜ]+$/i, + "uk-UA": /^[А-ЩЬЮЯЄIЇҐі]+$/i, + "vi-VN": /^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i, + "ko-KR": /^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/, + "ku-IQ": /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i, + ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/, + he: /^[א-ת]+$/, + fa: /^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i, + bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/, + eo: /^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i, + "hi-IN": /^[\u0900-\u0961]+[\u0972-\u097F]*$/i, + "si-LK": /^[\u0D80-\u0DFF]+$/ +}; +var alphanumeric$1 = alpha$1.alphanumeric = { + "en-US": /^[0-9A-Z]+$/i, + "az-AZ": /^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i, + "bg-BG": /^[0-9А-Я]+$/i, + "cs-CZ": /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i, + "da-DK": /^[0-9A-ZÆØÅ]+$/i, + "de-DE": /^[0-9A-ZÄÖÜß]+$/i, + "el-GR": /^[0-9Α-ω]+$/i, + "es-ES": /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i, + "fi-FI": /^[0-9A-ZÅÄÖ]+$/i, + "fr-FR": /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i, + "it-IT": /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i, + "ja-JP": /^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i, + "hu-HU": /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i, + "nb-NO": /^[0-9A-ZÆØÅ]+$/i, + "nl-NL": /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i, + "nn-NO": /^[0-9A-ZÆØÅ]+$/i, + "pl-PL": /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i, + "pt-PT": /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i, + "ru-RU": /^[0-9А-ЯЁ]+$/i, + "kk-KZ": /^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i, + "sl-SI": /^[0-9A-ZČĆĐŠŽ]+$/i, + "sk-SK": /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i, + "sr-RS@latin": /^[0-9A-ZČĆŽŠĐ]+$/i, + "sr-RS": /^[0-9А-ЯЂЈЉЊЋЏ]+$/i, + "sv-SE": /^[0-9A-ZÅÄÖ]+$/i, + "th-TH": /^[ก-๙\s]+$/i, + "tr-TR": /^[0-9A-ZÇĞİıÖŞÜ]+$/i, + "uk-UA": /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i, + "ko-KR": /^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/, + "ku-IQ": /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i, + "vi-VN": /^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i, + ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/, + he: /^[0-9א-ת]+$/, + fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i, + bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/, + eo: /^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i, + "hi-IN": /^[\u0900-\u0963]+[\u0966-\u097F]*$/i, + "si-LK": /^[0-9\u0D80-\u0DFF]+$/ +}; +var decimal = alpha$1.decimal = { + "en-US": ".", + ar: "٫" +}; +var englishLocales = alpha$1.englishLocales = ["AU", "GB", "HK", "IN", "NZ", "ZA", "ZM"]; +for (var locale, i2 = 0; i2 < englishLocales.length; i2++) { + locale = "en-".concat(englishLocales[i2]); + alpha[locale] = alpha["en-US"]; + alphanumeric$1[locale] = alphanumeric$1["en-US"]; + decimal[locale] = decimal["en-US"]; +} +var arabicLocales = alpha$1.arabicLocales = ["AE", "BH", "DZ", "EG", "IQ", "JO", "KW", "LB", "LY", "MA", "QM", "QA", "SA", "SD", "SY", "TN", "YE"]; +for (var _locale, _i2 = 0; _i2 < arabicLocales.length; _i2++) { + _locale = "ar-".concat(arabicLocales[_i2]); + alpha[_locale] = alpha.ar; + alphanumeric$1[_locale] = alphanumeric$1.ar; + decimal[_locale] = decimal.ar; +} +var farsiLocales = alpha$1.farsiLocales = ["IR", "AF"]; +for (var _locale2, _i2 = 0; _i2 < farsiLocales.length; _i2++) { + _locale2 = "fa-".concat(farsiLocales[_i2]); + alphanumeric$1[_locale2] = alphanumeric$1.fa; + decimal[_locale2] = decimal.ar; +} +var bengaliLocales = alpha$1.bengaliLocales = ["BD", "IN"]; +for (var _locale3, _i3 = 0; _i3 < bengaliLocales.length; _i3++) { + _locale3 = "bn-".concat(bengaliLocales[_i3]); + alpha[_locale3] = alpha.bn; + alphanumeric$1[_locale3] = alphanumeric$1.bn; + decimal[_locale3] = decimal["en-US"]; +} +var dotDecimal = alpha$1.dotDecimal = ["ar-EG", "ar-LB", "ar-LY"]; +var commaDecimal = alpha$1.commaDecimal = ["bg-BG", "cs-CZ", "da-DK", "de-DE", "el-GR", "en-ZM", "eo", "es-ES", "fr-CA", "fr-FR", "id-ID", "it-IT", "ku-IQ", "hi-IN", "hu-HU", "nb-NO", "nn-NO", "nl-NL", "pl-PL", "pt-PT", "ru-RU", "kk-KZ", "si-LK", "sl-SI", "sr-RS@latin", "sr-RS", "sv-SE", "tr-TR", "uk-UA", "vi-VN"]; +for (var _i4 = 0; _i4 < dotDecimal.length; _i4++) { + decimal[dotDecimal[_i4]] = decimal["en-US"]; +} +for (var _i5 = 0; _i5 < commaDecimal.length; _i5++) { + decimal[commaDecimal[_i5]] = ","; +} +alpha["fr-CA"] = alpha["fr-FR"]; +alphanumeric$1["fr-CA"] = alphanumeric$1["fr-FR"]; +alpha["pt-BR"] = alpha["pt-PT"]; +alphanumeric$1["pt-BR"] = alphanumeric$1["pt-PT"]; +decimal["pt-BR"] = decimal["pt-PT"]; +alpha["pl-Pl"] = alpha["pl-PL"]; +alphanumeric$1["pl-Pl"] = alphanumeric$1["pl-PL"]; +decimal["pl-Pl"] = decimal["pl-PL"]; +alpha["fa-AF"] = alpha.fa; +Object.defineProperty(isFloat$1, "__esModule", { + value: true +}); +isFloat$1.default = isFloat; +isFloat$1.locales = void 0; +var _assertString$b = _interopRequireDefault$b(assertStringExports); +var _alpha$2 = alpha$1; +function _interopRequireDefault$b(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +function isFloat(str, options) { + (0, _assertString$b.default)(str); + options = options || {}; + var float = new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(options.locale ? _alpha$2.decimal[options.locale] : ".", "[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$")); + if (str === "" || str === "." || str === "," || str === "-" || str === "+") { + return false; + } + var value = parseFloat(str.replace(",", ".")); + return float.test(str) && (!options.hasOwnProperty("min") || value >= options.min) && (!options.hasOwnProperty("max") || value <= options.max) && (!options.hasOwnProperty("lt") || value < options.lt) && (!options.hasOwnProperty("gt") || value > options.gt); +} +isFloat$1.locales = Object.keys(_alpha$2.decimal); +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = toFloat2; + var _isFloat = _interopRequireDefault2(isFloat$1); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function toFloat2(str) { + if (!(0, _isFloat.default)(str)) + return NaN; + return parseFloat(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(toFloat, toFloat.exports); +var toFloatExports = toFloat.exports; +var toInt = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = toInt2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function toInt2(str, radix) { + (0, _assertString2.default)(str); + return parseInt(str, radix || 10); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(toInt, toInt.exports); +var toIntExports = toInt.exports; +var toBoolean = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = toBoolean2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function toBoolean2(str, strict) { + (0, _assertString2.default)(str); + if (strict) { + return str === "1" || /^true$/i.test(str); + } + return str !== "0" && !/^false$/i.test(str) && str !== ""; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(toBoolean, toBoolean.exports); +var toBooleanExports = toBoolean.exports; +var equals = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = equals2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function equals2(str, comparison) { + (0, _assertString2.default)(str); + return str === comparison; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(equals, equals.exports); +var equalsExports = equals.exports; +var contains = { exports: {} }; +var toString$2 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = toString3; + function _typeof2(o2) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { + return typeof o3; + } : function(o3) { + return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; + }, _typeof2(o2); + } + function toString3(input) { + if (_typeof2(input) === "object" && input !== null) { + if (typeof input.toString === "function") { + input = input.toString(); + } else { + input = "[object Object]"; + } + } else if (input === null || typeof input === "undefined" || isNaN(input) && !input.length) { + input = ""; + } + return String(input); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(toString$2, toString$2.exports); +var toStringExports = toString$2.exports; +var merge$1 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = merge2; + function merge2() { + var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + var defaults2 = arguments.length > 1 ? arguments[1] : void 0; + for (var key2 in defaults2) { + if (typeof obj[key2] === "undefined") { + obj[key2] = defaults2[key2]; + } + } + return obj; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(merge$1, merge$1.exports); +var mergeExports = merge$1.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = contains2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _toString = _interopRequireDefault2(toStringExports); + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var defaulContainsOptions = { + ignoreCase: false, + minOccurrences: 1 + }; + function contains2(str, elem, options) { + (0, _assertString2.default)(str); + options = (0, _merge.default)(options, defaulContainsOptions); + if (options.ignoreCase) { + return str.toLowerCase().split((0, _toString.default)(elem).toLowerCase()).length > options.minOccurrences; + } + return str.split((0, _toString.default)(elem)).length > options.minOccurrences; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(contains, contains.exports); +var containsExports = contains.exports; +var matches = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = matches2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function matches2(str, pattern, modifiers) { + (0, _assertString2.default)(str); + if (Object.prototype.toString.call(pattern) !== "[object RegExp]") { + pattern = new RegExp(pattern, modifiers); + } + return !!str.match(pattern); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(matches, matches.exports); +var matchesExports = matches.exports; +var isEmail = { exports: {} }; +var isByteLength = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isByteLength2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _typeof2(o2) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { + return typeof o3; + } : function(o3) { + return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; + }, _typeof2(o2); + } + function isByteLength2(str, options) { + (0, _assertString2.default)(str); + var min; + var max; + if (_typeof2(options) === "object") { + min = options.min || 0; + max = options.max; + } else { + min = arguments[1]; + max = arguments[2]; + } + var len = encodeURI(str).split(/%..|./).length - 1; + return len >= min && (typeof max === "undefined" || len <= max); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isByteLength, isByteLength.exports); +var isByteLengthExports = isByteLength.exports; +var isFQDN = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isFQDN2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var default_fqdn_options = { + require_tld: true, + allow_underscores: false, + allow_trailing_dot: false, + allow_numeric_tld: false, + allow_wildcard: false, + ignore_max_length: false + }; + function isFQDN2(str, options) { + (0, _assertString2.default)(str); + options = (0, _merge.default)(options, default_fqdn_options); + if (options.allow_trailing_dot && str[str.length - 1] === ".") { + str = str.substring(0, str.length - 1); + } + if (options.allow_wildcard === true && str.indexOf("*.") === 0) { + str = str.substring(2); + } + var parts = str.split("."); + var tld = parts[parts.length - 1]; + if (options.require_tld) { + if (parts.length < 2) { + return false; + } + if (!options.allow_numeric_tld && !/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) { + return false; + } + if (/\s/.test(tld)) { + return false; + } + } + if (!options.allow_numeric_tld && /^\d+$/.test(tld)) { + return false; + } + return parts.every(function(part) { + if (part.length > 63 && !options.ignore_max_length) { + return false; + } + if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) { + return false; + } + if (/[\uff01-\uff5e]/.test(part)) { + return false; + } + if (/^-|-$/.test(part)) { + return false; + } + if (!options.allow_underscores && /_/.test(part)) { + return false; + } + return true; + }); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isFQDN, isFQDN.exports); +var isFQDNExports = isFQDN.exports; +var isIP = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isIP2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var IPv4SegmentFormat = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"; + var IPv4AddressFormat = "(".concat(IPv4SegmentFormat, "[.]){3}").concat(IPv4SegmentFormat); + var IPv4AddressRegExp = new RegExp("^".concat(IPv4AddressFormat, "$")); + var IPv6SegmentFormat = "(?:[0-9a-fA-F]{1,4})"; + var IPv6AddressRegExp = new RegExp("^(" + "(?:".concat(IPv6SegmentFormat, ":){7}(?:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){6}(?:").concat(IPv4AddressFormat, "|:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){5}(?::").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,2}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){4}(?:(:").concat(IPv6SegmentFormat, "){0,1}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,3}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){3}(?:(:").concat(IPv6SegmentFormat, "){0,2}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,4}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){2}(?:(:").concat(IPv6SegmentFormat, "){0,3}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,5}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){1}(?:(:").concat(IPv6SegmentFormat, "){0,4}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,6}|:)|") + "(?::((?::".concat(IPv6SegmentFormat, "){0,5}:").concat(IPv4AddressFormat, "|(?::").concat(IPv6SegmentFormat, "){1,7}|:))") + ")(%[0-9a-zA-Z-.:]{1,})?$"); + function isIP2(str) { + var version2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; + (0, _assertString2.default)(str); + version2 = String(version2); + if (!version2) { + return isIP2(str, 4) || isIP2(str, 6); + } + if (version2 === "4") { + return IPv4AddressRegExp.test(str); + } + if (version2 === "6") { + return IPv6AddressRegExp.test(str); + } + return false; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isIP, isIP.exports); +var isIPExports = isIP.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isEmail2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _isByteLength = _interopRequireDefault2(isByteLengthExports); + var _isFQDN = _interopRequireDefault2(isFQDNExports); + var _isIP = _interopRequireDefault2(isIPExports); + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var default_email_options = { + allow_display_name: false, + allow_underscores: false, + require_display_name: false, + allow_utf8_local_part: true, + require_tld: true, + blacklisted_chars: "", + ignore_max_length: false, + host_blacklist: [], + host_whitelist: [] + }; + var splitNameAddress = /^([^\x00-\x1F\x7F-\x9F\cX]+)]/.test(display_name_without_quotes); + if (contains_illegal) { + if (display_name_without_quotes === display_name) { + return false; + } + var all_start_with_back_slash = display_name_without_quotes.split('"').length === display_name_without_quotes.split('\\"').length; + if (!all_start_with_back_slash) { + return false; + } + } + return true; + } + function isEmail2(str, options) { + (0, _assertString2.default)(str); + options = (0, _merge.default)(options, default_email_options); + if (options.require_display_name || options.allow_display_name) { + var display_email = str.match(splitNameAddress); + if (display_email) { + var display_name = display_email[1]; + str = str.replace(display_name, "").replace(/(^<|>$)/g, ""); + if (display_name.endsWith(" ")) { + display_name = display_name.slice(0, -1); + } + if (!validateDisplayName(display_name)) { + return false; + } + } else if (options.require_display_name) { + return false; + } + } + if (!options.ignore_max_length && str.length > defaultMaxEmailLength) { + return false; + } + var parts = str.split("@"); + var domain = parts.pop(); + var lower_domain = domain.toLowerCase(); + if (options.host_blacklist.includes(lower_domain)) { + return false; + } + if (options.host_whitelist.length > 0 && !options.host_whitelist.includes(lower_domain)) { + return false; + } + var user = parts.join("@"); + if (options.domain_specific_validation && (lower_domain === "gmail.com" || lower_domain === "googlemail.com")) { + user = user.toLowerCase(); + var username = user.split("+")[0]; + if (!(0, _isByteLength.default)(username.replace(/\./g, ""), { + min: 6, + max: 30 + })) { + return false; + } + var _user_parts = username.split("."); + for (var i2 = 0; i2 < _user_parts.length; i2++) { + if (!gmailUserPart.test(_user_parts[i2])) { + return false; + } + } + } + if (options.ignore_max_length === false && (!(0, _isByteLength.default)(user, { + max: 64 + }) || !(0, _isByteLength.default)(domain, { + max: 254 + }))) { + return false; + } + if (!(0, _isFQDN.default)(domain, { + require_tld: options.require_tld, + ignore_max_length: options.ignore_max_length, + allow_underscores: options.allow_underscores + })) { + if (!options.allow_ip_domain) { + return false; + } + if (!(0, _isIP.default)(domain)) { + if (!domain.startsWith("[") || !domain.endsWith("]")) { + return false; + } + var noBracketdomain = domain.slice(1, -1); + if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) { + return false; + } + } + } + if (user[0] === '"') { + user = user.slice(1, user.length - 1); + return options.allow_utf8_local_part ? quotedEmailUserUtf8.test(user) : quotedEmailUser.test(user); + } + var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart; + var user_parts = user.split("."); + for (var _i2 = 0; _i2 < user_parts.length; _i2++) { + if (!pattern.test(user_parts[_i2])) { + return false; + } + } + if (options.blacklisted_chars) { + if (user.search(new RegExp("[".concat(options.blacklisted_chars, "]+"), "g")) !== -1) + return false; + } + return true; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isEmail, isEmail.exports); +var isEmailExports = isEmail.exports; +var isURL = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isURL2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _isFQDN = _interopRequireDefault2(isFQDNExports); + var _isIP = _interopRequireDefault2(isIPExports); + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _slicedToArray(arr, i2) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest(); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _unsupportedIterableToArray(o2, minLen) { + if (!o2) + return; + if (typeof o2 === "string") + return _arrayLikeToArray(o2, minLen); + var n5 = Object.prototype.toString.call(o2).slice(8, -1); + if (n5 === "Object" && o2.constructor) + n5 = o2.constructor.name; + if (n5 === "Map" || n5 === "Set") + return Array.from(o2); + if (n5 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n5)) + return _arrayLikeToArray(o2, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) + arr2[i2] = arr[i2]; + return arr2; + } + function _iterableToArrayLimit(r2, l2) { + var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"]; + if (null != t2) { + var e18, n5, i2, u2, a3 = [], f4 = true, o2 = false; + try { + if (i2 = (t2 = t2.call(r2)).next, 0 === l2) { + if (Object(t2) !== t2) + return; + f4 = false; + } else + for (; !(f4 = (e18 = i2.call(t2)).done) && (a3.push(e18.value), a3.length !== l2); f4 = true) + ; + } catch (r3) { + o2 = true, n5 = r3; + } finally { + try { + if (!f4 && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) + return; + } finally { + if (o2) + throw n5; + } + } + return a3; + } + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) + return arr; + } + var default_url_options = { + protocols: ["http", "https", "ftp"], + require_tld: true, + require_protocol: false, + require_host: true, + require_port: false, + require_valid_protocol: true, + allow_underscores: false, + allow_trailing_dot: false, + allow_protocol_relative_urls: false, + allow_fragments: true, + allow_query_components: true, + validate_length: true + }; + var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/; + function isRegExp2(obj) { + return Object.prototype.toString.call(obj) === "[object RegExp]"; + } + function checkHost(host, matches2) { + for (var i2 = 0; i2 < matches2.length; i2++) { + var match = matches2[i2]; + if (host === match || isRegExp2(match) && match.test(host)) { + return true; + } + } + return false; + } + function isURL2(url, options) { + (0, _assertString2.default)(url); + if (!url || /[\s<>]/.test(url)) { + return false; + } + if (url.indexOf("mailto:") === 0) { + return false; + } + options = (0, _merge.default)(options, default_url_options); + if (options.validate_length && url.length >= 2083) { + return false; + } + if (!options.allow_fragments && url.includes("#")) { + return false; + } + if (!options.allow_query_components && (url.includes("?") || url.includes("&"))) { + return false; + } + var protocol, auth, host, hostname, port, port_str, split2, ipv6; + split2 = url.split("#"); + url = split2.shift(); + split2 = url.split("?"); + url = split2.shift(); + split2 = url.split("://"); + if (split2.length > 1) { + protocol = split2.shift().toLowerCase(); + if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) { + return false; + } + } else if (options.require_protocol) { + return false; + } else if (url.slice(0, 2) === "//") { + if (!options.allow_protocol_relative_urls) { + return false; + } + split2[0] = url.slice(2); + } + url = split2.join("://"); + if (url === "") { + return false; + } + split2 = url.split("/"); + url = split2.shift(); + if (url === "" && !options.require_host) { + return true; + } + split2 = url.split("@"); + if (split2.length > 1) { + if (options.disallow_auth) { + return false; + } + if (split2[0] === "") { + return false; + } + auth = split2.shift(); + if (auth.indexOf(":") >= 0 && auth.split(":").length > 2) { + return false; + } + var _auth$split = auth.split(":"), _auth$split2 = _slicedToArray(_auth$split, 2), user = _auth$split2[0], password = _auth$split2[1]; + if (user === "" && password === "") { + return false; + } + } + hostname = split2.join("@"); + port_str = null; + ipv6 = null; + var ipv6_match = hostname.match(wrapped_ipv6); + if (ipv6_match) { + host = ""; + ipv6 = ipv6_match[1]; + port_str = ipv6_match[2] || null; + } else { + split2 = hostname.split(":"); + host = split2.shift(); + if (split2.length) { + port_str = split2.join(":"); + } + } + if (port_str !== null && port_str.length > 0) { + port = parseInt(port_str, 10); + if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) { + return false; + } + } else if (options.require_port) { + return false; + } + if (options.host_whitelist) { + return checkHost(host, options.host_whitelist); + } + if (host === "" && !options.require_host) { + return true; + } + if (!(0, _isIP.default)(host) && !(0, _isFQDN.default)(host, options) && (!ipv6 || !(0, _isIP.default)(ipv6, 6))) { + return false; + } + host = host || ipv6; + if (options.host_blacklist && checkHost(host, options.host_blacklist)) { + return false; + } + return true; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isURL, isURL.exports); +var isURLExports = isURL.exports; +var isMACAddress = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isMACAddress2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var macAddress48 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/; + var macAddress48NoSeparators = /^([0-9a-fA-F]){12}$/; + var macAddress48WithDots = /^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/; + var macAddress64 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/; + var macAddress64NoSeparators = /^([0-9a-fA-F]){16}$/; + var macAddress64WithDots = /^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/; + function isMACAddress2(str, options) { + (0, _assertString2.default)(str); + if (options !== null && options !== void 0 && options.eui) { + options.eui = String(options.eui); + } + if (options !== null && options !== void 0 && options.no_colons || options !== null && options !== void 0 && options.no_separators) { + if (options.eui === "48") { + return macAddress48NoSeparators.test(str); + } + if (options.eui === "64") { + return macAddress64NoSeparators.test(str); + } + return macAddress48NoSeparators.test(str) || macAddress64NoSeparators.test(str); + } + if ((options === null || options === void 0 ? void 0 : options.eui) === "48") { + return macAddress48.test(str) || macAddress48WithDots.test(str); + } + if ((options === null || options === void 0 ? void 0 : options.eui) === "64") { + return macAddress64.test(str) || macAddress64WithDots.test(str); + } + return isMACAddress2(str, { + eui: "48" + }) || isMACAddress2(str, { + eui: "64" + }); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isMACAddress, isMACAddress.exports); +var isMACAddressExports = isMACAddress.exports; +var isIPRange = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isIPRange2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _isIP = _interopRequireDefault2(isIPExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var subnetMaybe = /^\d{1,3}$/; + var v4Subnet = 32; + var v6Subnet = 128; + function isIPRange2(str) { + var version2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; + (0, _assertString2.default)(str); + var parts = str.split("/"); + if (parts.length !== 2) { + return false; + } + if (!subnetMaybe.test(parts[1])) { + return false; + } + if (parts[1].length > 1 && parts[1].startsWith("0")) { + return false; + } + var isValidIP = (0, _isIP.default)(parts[0], version2); + if (!isValidIP) { + return false; + } + var expectedSubnet = null; + switch (String(version2)) { + case "4": + expectedSubnet = v4Subnet; + break; + case "6": + expectedSubnet = v6Subnet; + break; + default: + expectedSubnet = (0, _isIP.default)(parts[0], "6") ? v6Subnet : v4Subnet; + } + return parts[1] <= expectedSubnet && parts[1] >= 0; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isIPRange, isIPRange.exports); +var isIPRangeExports = isIPRange.exports; +var isDate$1 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isDate2; + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _slicedToArray(arr, i2) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest(); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _iterableToArrayLimit(r2, l2) { + var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"]; + if (null != t2) { + var e18, n5, i2, u2, a3 = [], f4 = true, o2 = false; + try { + if (i2 = (t2 = t2.call(r2)).next, 0 === l2) { + if (Object(t2) !== t2) + return; + f4 = false; + } else + for (; !(f4 = (e18 = i2.call(t2)).done) && (a3.push(e18.value), a3.length !== l2); f4 = true) + ; + } catch (r3) { + o2 = true, n5 = r3; + } finally { + try { + if (!f4 && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) + return; + } finally { + if (o2) + throw n5; + } + } + return a3; + } + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) + return arr; + } + function _createForOfIteratorHelper(o2, allowArrayLike) { + var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"]; + if (!it2) { + if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray(o2)) || allowArrayLike && o2 && typeof o2.length === "number") { + if (it2) + o2 = it2; + var i2 = 0; + var F2 = function F3() { + }; + return { s: F2, n: function n5() { + if (i2 >= o2.length) + return { done: true }; + return { done: false, value: o2[i2++] }; + }, e: function e18(_e3) { + throw _e3; + }, f: F2 }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, didErr = false, err; + return { s: function s2() { + it2 = it2.call(o2); + }, n: function n5() { + var step = it2.next(); + normalCompletion = step.done; + return step; + }, e: function e18(_e22) { + didErr = true; + err = _e22; + }, f: function f4() { + try { + if (!normalCompletion && it2.return != null) + it2.return(); + } finally { + if (didErr) + throw err; + } + } }; + } + function _unsupportedIterableToArray(o2, minLen) { + if (!o2) + return; + if (typeof o2 === "string") + return _arrayLikeToArray(o2, minLen); + var n5 = Object.prototype.toString.call(o2).slice(8, -1); + if (n5 === "Object" && o2.constructor) + n5 = o2.constructor.name; + if (n5 === "Map" || n5 === "Set") + return Array.from(o2); + if (n5 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n5)) + return _arrayLikeToArray(o2, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) + arr2[i2] = arr[i2]; + return arr2; + } + var default_date_options = { + format: "YYYY/MM/DD", + delimiters: ["/", "-"], + strictMode: false + }; + function isValidFormat(format2) { + return /(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(format2); + } + function zip(date, format2) { + var zippedArr = [], len = Math.min(date.length, format2.length); + for (var i2 = 0; i2 < len; i2++) { + zippedArr.push([date[i2], format2[i2]]); + } + return zippedArr; + } + function isDate2(input, options) { + if (typeof options === "string") { + options = (0, _merge.default)({ + format: options + }, default_date_options); + } else { + options = (0, _merge.default)(options, default_date_options); + } + if (typeof input === "string" && isValidFormat(options.format)) { + var formatDelimiter = options.delimiters.find(function(delimiter) { + return options.format.indexOf(delimiter) !== -1; + }); + var dateDelimiter = options.strictMode ? formatDelimiter : options.delimiters.find(function(delimiter) { + return input.indexOf(delimiter) !== -1; + }); + var dateAndFormat = zip(input.split(dateDelimiter), options.format.toLowerCase().split(formatDelimiter)); + var dateObj = {}; + var _iterator = _createForOfIteratorHelper(dateAndFormat), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var _step$value = _slicedToArray(_step.value, 2), dateWord = _step$value[0], formatWord = _step$value[1]; + if (dateWord.length !== formatWord.length) { + return false; + } + dateObj[formatWord.charAt(0)] = dateWord; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + var fullYear = dateObj.y; + if (fullYear.startsWith("-")) { + return false; + } + if (dateObj.y.length === 2) { + var parsedYear = parseInt(dateObj.y, 10); + if (isNaN(parsedYear)) { + return false; + } + var currentYearLastTwoDigits = (/* @__PURE__ */ new Date()).getFullYear() % 100; + if (parsedYear < currentYearLastTwoDigits) { + fullYear = "20".concat(dateObj.y); + } else { + fullYear = "19".concat(dateObj.y); + } + } + var month = dateObj.m; + if (dateObj.m.length === 1) { + month = "0".concat(dateObj.m); + } + var day = dateObj.d; + if (dateObj.d.length === 1) { + day = "0".concat(dateObj.d); + } + return new Date("".concat(fullYear, "-").concat(month, "-").concat(day, "T00:00:00.000Z")).getUTCDate() === +dateObj.d; + } + if (!options.strictMode) { + return Object.prototype.toString.call(input) === "[object Date]" && isFinite(input); + } + return false; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isDate$1, isDate$1.exports); +var isDateExports = isDate$1.exports; +var isTime = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isTime2; + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var default_time_options = { + hourFormat: "hour24", + mode: "default" + }; + var formats = { + hour24: { + default: /^([01]?[0-9]|2[0-3]):([0-5][0-9])$/, + withSeconds: /^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/ + }, + hour12: { + default: /^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/, + withSeconds: /^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/ + } + }; + function isTime2(input, options) { + options = (0, _merge.default)(options, default_time_options); + if (typeof input !== "string") + return false; + return formats[options.hourFormat][options.mode].test(input); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isTime, isTime.exports); +var isTimeExports = isTime.exports; +var isBoolean$2 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isBoolean2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var defaultOptions = { + loose: false + }; + var strictBooleans = ["true", "false", "1", "0"]; + var looseBooleans = [].concat(strictBooleans, ["yes", "no"]); + function isBoolean2(str) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultOptions; + (0, _assertString2.default)(str); + if (options.loose) { + return looseBooleans.includes(str.toLowerCase()); + } + return strictBooleans.includes(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isBoolean$2, isBoolean$2.exports); +var isBooleanExports = isBoolean$2.exports; +var isLocale = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isLocale2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var extlang = "([A-Za-z]{3}(-[A-Za-z]{3}){0,2})"; + var language = "(([a-zA-Z]{2,3}(-".concat(extlang, ")?)|([a-zA-Z]{5,8}))"); + var script = "([A-Za-z]{4})"; + var region = "([A-Za-z]{2}|\\d{3})"; + var variant = "([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))"; + var singleton = "(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])"; + var extension = "(".concat(singleton, "(-[A-Za-z0-9]{2,8})+)"); + var privateuse = "(x(-[A-Za-z0-9]{1,8})+)"; + var irregular = "((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))"; + var regular = "((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))"; + var grandfathered = "(".concat(irregular, "|").concat(regular, ")"); + var delimiter = "(-|_)"; + var langtag = "".concat(language, "(").concat(delimiter).concat(script, ")?(").concat(delimiter).concat(region, ")?(").concat(delimiter).concat(variant, ")*(").concat(delimiter).concat(extension, ")*(").concat(delimiter).concat(privateuse, ")?"); + var languageTagRegex = new RegExp("(^".concat(privateuse, "$)|(^").concat(grandfathered, "$)|(^").concat(langtag, "$)")); + function isLocale2(str) { + (0, _assertString2.default)(str); + return languageTagRegex.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isLocale, isLocale.exports); +var isLocaleExports = isLocale.exports; +var isAbaRouting = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isAbaRouting2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var isRoutingReg = /^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/; + function isAbaRouting2(str) { + (0, _assertString2.default)(str); + if (!isRoutingReg.test(str)) + return false; + var checkSumVal = 0; + for (var i2 = 0; i2 < str.length; i2++) { + if (i2 % 3 === 0) + checkSumVal += str[i2] * 3; + else if (i2 % 3 === 1) + checkSumVal += str[i2] * 7; + else + checkSumVal += str[i2] * 1; + } + return checkSumVal % 10 === 0; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isAbaRouting, isAbaRouting.exports); +var isAbaRoutingExports = isAbaRouting.exports; +var isAlpha$1 = {}; +Object.defineProperty(isAlpha$1, "__esModule", { + value: true +}); +isAlpha$1.default = isAlpha; +isAlpha$1.locales = void 0; +var _assertString$a = _interopRequireDefault$a(assertStringExports); +var _alpha$1 = alpha$1; +function _interopRequireDefault$a(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +function isAlpha(_str) { + var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en-US"; + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + (0, _assertString$a.default)(_str); + var str = _str; + var ignore = options.ignore; + if (ignore) { + if (ignore instanceof RegExp) { + str = str.replace(ignore, ""); + } else if (typeof ignore === "string") { + str = str.replace(new RegExp("[".concat(ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, "\\$&"), "]"), "g"), ""); + } else { + throw new Error("ignore should be instance of a String or RegExp"); + } + } + if (locale in _alpha$1.alpha) { + return _alpha$1.alpha[locale].test(str); + } + throw new Error("Invalid locale '".concat(locale, "'")); +} +isAlpha$1.locales = Object.keys(_alpha$1.alpha); +var isAlphanumeric$1 = {}; +Object.defineProperty(isAlphanumeric$1, "__esModule", { + value: true +}); +isAlphanumeric$1.default = isAlphanumeric; +isAlphanumeric$1.locales = void 0; +var _assertString$9 = _interopRequireDefault$9(assertStringExports); +var _alpha = alpha$1; +function _interopRequireDefault$9(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +function isAlphanumeric(_str) { + var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en-US"; + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + (0, _assertString$9.default)(_str); + var str = _str; + var ignore = options.ignore; + if (ignore) { + if (ignore instanceof RegExp) { + str = str.replace(ignore, ""); + } else if (typeof ignore === "string") { + str = str.replace(new RegExp("[".concat(ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, "\\$&"), "]"), "g"), ""); + } else { + throw new Error("ignore should be instance of a String or RegExp"); + } + } + if (locale in _alpha.alphanumeric) { + return _alpha.alphanumeric[locale].test(str); + } + throw new Error("Invalid locale '".concat(locale, "'")); +} +isAlphanumeric$1.locales = Object.keys(_alpha.alphanumeric); +var isNumeric = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isNumeric2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _alpha2 = alpha$1; + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var numericNoSymbols = /^[0-9]+$/; + function isNumeric2(str, options) { + (0, _assertString2.default)(str); + if (options && options.no_symbols) { + return numericNoSymbols.test(str); + } + return new RegExp("^[+-]?([0-9]*[".concat((options || {}).locale ? _alpha2.decimal[options.locale] : ".", "])?[0-9]+$")).test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isNumeric, isNumeric.exports); +var isNumericExports = isNumeric.exports; +var isPassportNumber = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isPassportNumber2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var passportRegexByCountryCode = { + AM: /^[A-Z]{2}\d{7}$/, + // ARMENIA + AR: /^[A-Z]{3}\d{6}$/, + // ARGENTINA + AT: /^[A-Z]\d{7}$/, + // AUSTRIA + AU: /^[A-Z]\d{7}$/, + // AUSTRALIA + AZ: /^[A-Z]{1}\d{8}$/, + // AZERBAIJAN + BE: /^[A-Z]{2}\d{6}$/, + // BELGIUM + BG: /^\d{9}$/, + // BULGARIA + BR: /^[A-Z]{2}\d{6}$/, + // BRAZIL + BY: /^[A-Z]{2}\d{7}$/, + // BELARUS + CA: /^[A-Z]{2}\d{6}$/, + // CANADA + CH: /^[A-Z]\d{7}$/, + // SWITZERLAND + CN: /^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/, + // CHINA [G=Ordinary, E=Electronic] followed by 8-digits, or E followed by any UPPERCASE letter (except I and O) followed by 7 digits + CY: /^[A-Z](\d{6}|\d{8})$/, + // CYPRUS + CZ: /^\d{8}$/, + // CZECH REPUBLIC + DE: /^[CFGHJKLMNPRTVWXYZ0-9]{9}$/, + // GERMANY + DK: /^\d{9}$/, + // DENMARK + DZ: /^\d{9}$/, + // ALGERIA + EE: /^([A-Z]\d{7}|[A-Z]{2}\d{7})$/, + // ESTONIA (K followed by 7-digits), e-passports have 2 UPPERCASE followed by 7 digits + ES: /^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/, + // SPAIN + FI: /^[A-Z]{2}\d{7}$/, + // FINLAND + FR: /^\d{2}[A-Z]{2}\d{5}$/, + // FRANCE + GB: /^\d{9}$/, + // UNITED KINGDOM + GR: /^[A-Z]{2}\d{7}$/, + // GREECE + HR: /^\d{9}$/, + // CROATIA + HU: /^[A-Z]{2}(\d{6}|\d{7})$/, + // HUNGARY + IE: /^[A-Z0-9]{2}\d{7}$/, + // IRELAND + IN: /^[A-Z]{1}-?\d{7}$/, + // INDIA + ID: /^[A-C]\d{7}$/, + // INDONESIA + IR: /^[A-Z]\d{8}$/, + // IRAN + IS: /^(A)\d{7}$/, + // ICELAND + IT: /^[A-Z0-9]{2}\d{7}$/, + // ITALY + JM: /^[Aa]\d{7}$/, + // JAMAICA + JP: /^[A-Z]{2}\d{7}$/, + // JAPAN + KR: /^[MS]\d{8}$/, + // SOUTH KOREA, REPUBLIC OF KOREA, [S=PS Passports, M=PM Passports] + KZ: /^[a-zA-Z]\d{7}$/, + // KAZAKHSTAN + LI: /^[a-zA-Z]\d{5}$/, + // LIECHTENSTEIN + LT: /^[A-Z0-9]{8}$/, + // LITHUANIA + LU: /^[A-Z0-9]{8}$/, + // LUXEMBURG + LV: /^[A-Z0-9]{2}\d{7}$/, + // LATVIA + LY: /^[A-Z0-9]{8}$/, + // LIBYA + MT: /^\d{7}$/, + // MALTA + MZ: /^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/, + // MOZAMBIQUE + MY: /^[AHK]\d{8}$/, + // MALAYSIA + MX: /^\d{10,11}$/, + // MEXICO + NL: /^[A-Z]{2}[A-Z0-9]{6}\d$/, + // NETHERLANDS + NZ: /^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/, + // NEW ZEALAND + PH: /^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/, + // PHILIPPINES + PK: /^[A-Z]{2}\d{7}$/, + // PAKISTAN + PL: /^[A-Z]{2}\d{7}$/, + // POLAND + PT: /^[A-Z]\d{6}$/, + // PORTUGAL + RO: /^\d{8,9}$/, + // ROMANIA + RU: /^\d{9}$/, + // RUSSIAN FEDERATION + SE: /^\d{8}$/, + // SWEDEN + SL: /^(P)[A-Z]\d{7}$/, + // SLOVENIA + SK: /^[0-9A-Z]\d{7}$/, + // SLOVAKIA + TH: /^[A-Z]{1,2}\d{6,7}$/, + // THAILAND + TR: /^[A-Z]\d{8}$/, + // TURKEY + UA: /^[A-Z]{2}\d{6}$/, + // UKRAINE + US: /^\d{9}$/, + // UNITED STATES + ZA: /^[TAMD]\d{8}$/ + // SOUTH AFRICA + }; + function isPassportNumber2(str, countryCode) { + (0, _assertString2.default)(str); + var normalizedStr = str.replace(/\s/g, "").toUpperCase(); + return countryCode.toUpperCase() in passportRegexByCountryCode && passportRegexByCountryCode[countryCode].test(normalizedStr); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isPassportNumber, isPassportNumber.exports); +var isPassportNumberExports = isPassportNumber.exports; +var isPort = { exports: {} }; +var isInt = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isInt2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var int2 = /^(?:[-+]?(?:0|[1-9][0-9]*))$/; + var intLeadingZeroes = /^[-+]?[0-9]+$/; + function isInt2(str, options) { + (0, _assertString2.default)(str); + options = options || {}; + var regex2 = options.allow_leading_zeroes === false ? int2 : intLeadingZeroes; + var minCheckPassed = !options.hasOwnProperty("min") || str >= options.min; + var maxCheckPassed = !options.hasOwnProperty("max") || str <= options.max; + var ltCheckPassed = !options.hasOwnProperty("lt") || str < options.lt; + var gtCheckPassed = !options.hasOwnProperty("gt") || str > options.gt; + return regex2.test(str) && minCheckPassed && maxCheckPassed && ltCheckPassed && gtCheckPassed; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isInt, isInt.exports); +var isIntExports = isInt.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isPort2; + var _isInt = _interopRequireDefault2(isIntExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isPort2(str) { + return (0, _isInt.default)(str, { + allow_leading_zeroes: false, + min: 0, + max: 65535 + }); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isPort, isPort.exports); +var isPortExports = isPort.exports; +var isLowercase = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isLowercase2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isLowercase2(str) { + (0, _assertString2.default)(str); + return str === str.toLowerCase(); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isLowercase, isLowercase.exports); +var isLowercaseExports = isLowercase.exports; +var isUppercase = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isUppercase2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isUppercase2(str) { + (0, _assertString2.default)(str); + return str === str.toUpperCase(); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isUppercase, isUppercase.exports); +var isUppercaseExports = isUppercase.exports; +var isIMEI = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isIMEI2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var imeiRegexWithoutHypens = /^[0-9]{15}$/; + var imeiRegexWithHypens = /^\d{2}-\d{6}-\d{6}-\d{1}$/; + function isIMEI2(str, options) { + (0, _assertString2.default)(str); + options = options || {}; + var imeiRegex = imeiRegexWithoutHypens; + if (options.allow_hyphens) { + imeiRegex = imeiRegexWithHypens; + } + if (!imeiRegex.test(str)) { + return false; + } + str = str.replace(/-/g, ""); + var sum = 0, mul6 = 2, l2 = 14; + for (var i2 = 0; i2 < l2; i2++) { + var digit = str.substring(l2 - i2 - 1, l2 - i2); + var tp = parseInt(digit, 10) * mul6; + if (tp >= 10) { + sum += tp % 10 + 1; + } else { + sum += tp; + } + if (mul6 === 1) { + mul6 += 1; + } else { + mul6 -= 1; + } + } + var chk = (10 - sum % 10) % 10; + if (chk !== parseInt(str.substring(14, 15), 10)) { + return false; + } + return true; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isIMEI, isIMEI.exports); +var isIMEIExports = isIMEI.exports; +var isAscii = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isAscii2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var ascii2 = /^[\x00-\x7F]+$/; + function isAscii2(str) { + (0, _assertString2.default)(str); + return ascii2.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isAscii, isAscii.exports); +var isAsciiExports = isAscii.exports; +var isFullWidth$1 = {}; +Object.defineProperty(isFullWidth$1, "__esModule", { + value: true +}); +isFullWidth$1.default = isFullWidth; +isFullWidth$1.fullWidth = void 0; +var _assertString$8 = _interopRequireDefault$8(assertStringExports); +function _interopRequireDefault$8(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +var fullWidth = isFullWidth$1.fullWidth = /[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/; +function isFullWidth(str) { + (0, _assertString$8.default)(str); + return fullWidth.test(str); +} +var isHalfWidth$1 = {}; +Object.defineProperty(isHalfWidth$1, "__esModule", { + value: true +}); +isHalfWidth$1.default = isHalfWidth; +isHalfWidth$1.halfWidth = void 0; +var _assertString$7 = _interopRequireDefault$7(assertStringExports); +function _interopRequireDefault$7(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +var halfWidth = isHalfWidth$1.halfWidth = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/; +function isHalfWidth(str) { + (0, _assertString$7.default)(str); + return halfWidth.test(str); +} +var isVariableWidth = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isVariableWidth2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _isFullWidth = isFullWidth$1; + var _isHalfWidth = isHalfWidth$1; + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isVariableWidth2(str) { + (0, _assertString2.default)(str); + return _isFullWidth.fullWidth.test(str) && _isHalfWidth.halfWidth.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isVariableWidth, isVariableWidth.exports); +var isVariableWidthExports = isVariableWidth.exports; +var isMultibyte = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isMultibyte2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var multibyte = /[^\x00-\x7F]/; + function isMultibyte2(str) { + (0, _assertString2.default)(str); + return multibyte.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isMultibyte, isMultibyte.exports); +var isMultibyteExports = isMultibyte.exports; +var isSemVer = { exports: {} }; +var multilineRegex = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = multilineRegexp; + function multilineRegexp(parts, flags) { + var regexpAsStringLiteral = parts.join(""); + return new RegExp(regexpAsStringLiteral, flags); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(multilineRegex, multilineRegex.exports); +var multilineRegexExports = multilineRegex.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isSemVer2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _multilineRegex = _interopRequireDefault2(multilineRegexExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var semanticVersioningRegex = (0, _multilineRegex.default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)", "(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))", "?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"], "i"); + function isSemVer2(str) { + (0, _assertString2.default)(str); + return semanticVersioningRegex.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isSemVer, isSemVer.exports); +var isSemVerExports = isSemVer.exports; +var isSurrogatePair = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isSurrogatePair2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var surrogatePair = /[\uD800-\uDBFF][\uDC00-\uDFFF]/; + function isSurrogatePair2(str) { + (0, _assertString2.default)(str); + return surrogatePair.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isSurrogatePair, isSurrogatePair.exports); +var isSurrogatePairExports = isSurrogatePair.exports; +var isDecimal = { exports: {} }; +var includes = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var includes2 = function includes3(arr, val) { + return arr.some(function(arrVal) { + return val === arrVal; + }); + }; + exports.default = includes2; + module.exports = exports.default; + module.exports.default = exports.default; +})(includes, includes.exports); +var includesExports = includes.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isDecimal2; + var _merge = _interopRequireDefault2(mergeExports); + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _includes = _interopRequireDefault2(includesExports); + var _alpha2 = alpha$1; + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function decimalRegExp(options) { + var regExp = new RegExp("^[-+]?([0-9]+)?(\\".concat(_alpha2.decimal[options.locale], "[0-9]{").concat(options.decimal_digits, "})").concat(options.force_decimal ? "" : "?", "$")); + return regExp; + } + var default_decimal_options = { + force_decimal: false, + decimal_digits: "1,", + locale: "en-US" + }; + var blacklist2 = ["", "-", "+"]; + function isDecimal2(str, options) { + (0, _assertString2.default)(str); + options = (0, _merge.default)(options, default_decimal_options); + if (options.locale in _alpha2.decimal) { + return !(0, _includes.default)(blacklist2, str.replace(/ /g, "")) && decimalRegExp(options).test(str); + } + throw new Error("Invalid locale '".concat(options.locale, "'")); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isDecimal, isDecimal.exports); +var isDecimalExports = isDecimal.exports; +var isHexadecimal = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isHexadecimal2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var hexadecimal = /^(0x|0h)?[0-9A-F]+$/i; + function isHexadecimal2(str) { + (0, _assertString2.default)(str); + return hexadecimal.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isHexadecimal, isHexadecimal.exports); +var isHexadecimalExports = isHexadecimal.exports; +var isOctal = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isOctal2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var octal = /^(0o)?[0-7]+$/i; + function isOctal2(str) { + (0, _assertString2.default)(str); + return octal.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isOctal, isOctal.exports); +var isOctalExports = isOctal.exports; +var isDivisibleBy = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isDivisibleBy2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _toFloat = _interopRequireDefault2(toFloatExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isDivisibleBy2(str, num) { + (0, _assertString2.default)(str); + return (0, _toFloat.default)(str) % parseInt(num, 10) === 0; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isDivisibleBy, isDivisibleBy.exports); +var isDivisibleByExports = isDivisibleBy.exports; +var isHexColor = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isHexColor2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i; + function isHexColor2(str) { + (0, _assertString2.default)(str); + return hexcolor.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isHexColor, isHexColor.exports); +var isHexColorExports = isHexColor.exports; +var isRgbColor = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isRgbColor2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var rgbColor = /^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/; + var rgbaColor = /^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/; + var rgbColorPercent = /^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/; + var rgbaColorPercent = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/; + function isRgbColor2(str) { + var includePercentValues = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + (0, _assertString2.default)(str); + if (!includePercentValues) { + return rgbColor.test(str) || rgbaColor.test(str); + } + return rgbColor.test(str) || rgbaColor.test(str) || rgbColorPercent.test(str) || rgbaColorPercent.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isRgbColor, isRgbColor.exports); +var isRgbColorExports = isRgbColor.exports; +var isHSL = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isHSL2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var hslComma = /^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i; + var hslSpace = /^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i; + function isHSL2(str) { + (0, _assertString2.default)(str); + var strippedStr = str.replace(/\s+/g, " ").replace(/\s?(hsla?\(|\)|,)\s?/ig, "$1"); + if (strippedStr.indexOf(",") !== -1) { + return hslComma.test(strippedStr); + } + return hslSpace.test(strippedStr); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isHSL, isHSL.exports); +var isHSLExports = isHSL.exports; +var isISRC = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isISRC2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var isrc = /^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/; + function isISRC2(str) { + (0, _assertString2.default)(str); + return isrc.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isISRC, isISRC.exports); +var isISRCExports = isISRC.exports; +var isIBAN$1 = {}; +Object.defineProperty(isIBAN$1, "__esModule", { + value: true +}); +isIBAN$1.default = isIBAN; +isIBAN$1.locales = void 0; +var _assertString$6 = _interopRequireDefault$6(assertStringExports); +function _interopRequireDefault$6(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +var ibanRegexThroughCountryCode = { + AD: /^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/, + AE: /^(AE[0-9]{2})\d{3}\d{16}$/, + AL: /^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/, + AT: /^(AT[0-9]{2})\d{16}$/, + AZ: /^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/, + BA: /^(BA[0-9]{2})\d{16}$/, + BE: /^(BE[0-9]{2})\d{12}$/, + BG: /^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/, + BH: /^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/, + BR: /^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/, + BY: /^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/, + CH: /^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/, + CR: /^(CR[0-9]{2})\d{18}$/, + CY: /^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/, + CZ: /^(CZ[0-9]{2})\d{20}$/, + DE: /^(DE[0-9]{2})\d{18}$/, + DK: /^(DK[0-9]{2})\d{14}$/, + DO: /^(DO[0-9]{2})[A-Z]{4}\d{20}$/, + DZ: /^(DZ\d{24})$/, + EE: /^(EE[0-9]{2})\d{16}$/, + EG: /^(EG[0-9]{2})\d{25}$/, + ES: /^(ES[0-9]{2})\d{20}$/, + FI: /^(FI[0-9]{2})\d{14}$/, + FO: /^(FO[0-9]{2})\d{14}$/, + FR: /^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/, + GB: /^(GB[0-9]{2})[A-Z]{4}\d{14}$/, + GE: /^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/, + GI: /^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/, + GL: /^(GL[0-9]{2})\d{14}$/, + GR: /^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/, + GT: /^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/, + HR: /^(HR[0-9]{2})\d{17}$/, + HU: /^(HU[0-9]{2})\d{24}$/, + IE: /^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/, + IL: /^(IL[0-9]{2})\d{19}$/, + IQ: /^(IQ[0-9]{2})[A-Z]{4}\d{15}$/, + IR: /^(IR[0-9]{2})0\d{2}0\d{18}$/, + IS: /^(IS[0-9]{2})\d{22}$/, + IT: /^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/, + JO: /^(JO[0-9]{2})[A-Z]{4}\d{22}$/, + KW: /^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/, + KZ: /^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/, + LB: /^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/, + LC: /^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/, + LI: /^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/, + LT: /^(LT[0-9]{2})\d{16}$/, + LU: /^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/, + LV: /^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/, + MA: /^(MA[0-9]{26})$/, + MC: /^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/, + MD: /^(MD[0-9]{2})[A-Z0-9]{20}$/, + ME: /^(ME[0-9]{2})\d{18}$/, + MK: /^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/, + MR: /^(MR[0-9]{2})\d{23}$/, + MT: /^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/, + MU: /^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/, + MZ: /^(MZ[0-9]{2})\d{21}$/, + NL: /^(NL[0-9]{2})[A-Z]{4}\d{10}$/, + NO: /^(NO[0-9]{2})\d{11}$/, + PK: /^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/, + PL: /^(PL[0-9]{2})\d{24}$/, + PS: /^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/, + PT: /^(PT[0-9]{2})\d{21}$/, + QA: /^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/, + RO: /^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/, + RS: /^(RS[0-9]{2})\d{18}$/, + SA: /^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/, + SC: /^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/, + SE: /^(SE[0-9]{2})\d{20}$/, + SI: /^(SI[0-9]{2})\d{15}$/, + SK: /^(SK[0-9]{2})\d{20}$/, + SM: /^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/, + SV: /^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/, + TL: /^(TL[0-9]{2})\d{19}$/, + TN: /^(TN[0-9]{2})\d{20}$/, + TR: /^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/, + UA: /^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/, + VA: /^(VA[0-9]{2})\d{18}$/, + VG: /^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/, + XK: /^(XK[0-9]{2})\d{16}$/ +}; +function hasOnlyValidCountryCodes(countryCodeArray) { + var countryCodeArrayFilteredWithObjectIbanCode = countryCodeArray.filter(function(countryCode) { + return !(countryCode in ibanRegexThroughCountryCode); + }); + if (countryCodeArrayFilteredWithObjectIbanCode.length > 0) { + return false; + } + return true; +} +function hasValidIbanFormat(str, options) { + var strippedStr = str.replace(/[\s\-]+/gi, "").toUpperCase(); + var isoCountryCode = strippedStr.slice(0, 2).toUpperCase(); + var isoCountryCodeInIbanRegexCodeObject = isoCountryCode in ibanRegexThroughCountryCode; + if (options.whitelist) { + if (!hasOnlyValidCountryCodes(options.whitelist)) { + return false; + } + var isoCountryCodeInWhiteList = options.whitelist.includes(isoCountryCode); + if (!isoCountryCodeInWhiteList) { + return false; + } + } + if (options.blacklist) { + var isoCountryCodeInBlackList = options.blacklist.includes(isoCountryCode); + if (isoCountryCodeInBlackList) { + return false; + } + } + return isoCountryCodeInIbanRegexCodeObject && ibanRegexThroughCountryCode[isoCountryCode].test(strippedStr); +} +function hasValidIbanChecksum(str) { + var strippedStr = str.replace(/[^A-Z0-9]+/gi, "").toUpperCase(); + var rearranged = strippedStr.slice(4) + strippedStr.slice(0, 4); + var alphaCapsReplacedWithDigits = rearranged.replace(/[A-Z]/g, function(char) { + return char.charCodeAt(0) - 55; + }); + var remainder = alphaCapsReplacedWithDigits.match(/\d{1,7}/g).reduce(function(acc, value) { + return Number(acc + value) % 97; + }, ""); + return remainder === 1; +} +function isIBAN(str) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + (0, _assertString$6.default)(str); + return hasValidIbanFormat(str, options) && hasValidIbanChecksum(str); +} +isIBAN$1.locales = Object.keys(ibanRegexThroughCountryCode); +var isBIC = { exports: {} }; +var isISO31661Alpha2$1 = {}; +Object.defineProperty(isISO31661Alpha2$1, "__esModule", { + value: true +}); +isISO31661Alpha2$1.CountryCodes = void 0; +isISO31661Alpha2$1.default = isISO31661Alpha2; +var _assertString$5 = _interopRequireDefault$5(assertStringExports); +function _interopRequireDefault$5(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +var validISO31661Alpha2CountriesCodes = /* @__PURE__ */ new Set(["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"]); +function isISO31661Alpha2(str) { + (0, _assertString$5.default)(str); + return validISO31661Alpha2CountriesCodes.has(str.toUpperCase()); +} +isISO31661Alpha2$1.CountryCodes = validISO31661Alpha2CountriesCodes; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isBIC2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _isISO31661Alpha = isISO31661Alpha2$1; + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var isBICReg = /^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/; + function isBIC2(str) { + (0, _assertString2.default)(str); + var countryCode = str.slice(4, 6).toUpperCase(); + if (!_isISO31661Alpha.CountryCodes.has(countryCode) && countryCode !== "XK") { + return false; + } + return isBICReg.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isBIC, isBIC.exports); +var isBICExports = isBIC.exports; +var isMD5 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isMD52; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var md52 = /^[a-f0-9]{32}$/; + function isMD52(str) { + (0, _assertString2.default)(str); + return md52.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isMD5, isMD5.exports); +var isMD5Exports = isMD5.exports; +var isHash = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isHash2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var lengths = { + md5: 32, + md4: 32, + sha1: 40, + sha256: 64, + sha384: 96, + sha512: 128, + ripemd128: 32, + ripemd160: 40, + tiger128: 32, + tiger160: 40, + tiger192: 48, + crc32: 8, + crc32b: 8 + }; + function isHash2(str, algorithm) { + (0, _assertString2.default)(str); + var hash3 = new RegExp("^[a-fA-F0-9]{".concat(lengths[algorithm], "}$")); + return hash3.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isHash, isHash.exports); +var isHashExports = isHash.exports; +var isJWT = { exports: {} }; +var isBase64 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isBase642; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var notBase64 = /[^A-Z0-9+\/=]/i; + var urlSafeBase64 = /^[A-Z0-9_\-]*$/i; + var defaultBase64Options = { + urlSafe: false + }; + function isBase642(str, options) { + (0, _assertString2.default)(str); + options = (0, _merge.default)(options, defaultBase64Options); + var len = str.length; + if (options.urlSafe) { + return urlSafeBase64.test(str); + } + if (len % 4 !== 0 || notBase64.test(str)) { + return false; + } + var firstPaddingChar = str.indexOf("="); + return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === "="; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isBase64, isBase64.exports); +var isBase64Exports = isBase64.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isJWT2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _isBase = _interopRequireDefault2(isBase64Exports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isJWT2(str) { + (0, _assertString2.default)(str); + var dotSplit = str.split("."); + var len = dotSplit.length; + if (len !== 3) { + return false; + } + return dotSplit.reduce(function(acc, currElem) { + return acc && (0, _isBase.default)(currElem, { + urlSafe: true + }); + }, true); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isJWT, isJWT.exports); +var isJWTExports = isJWT.exports; +var isJSON = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isJSON2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _typeof2(o2) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { + return typeof o3; + } : function(o3) { + return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; + }, _typeof2(o2); + } + var default_json_options = { + allow_primitives: false + }; + function isJSON2(str, options) { + (0, _assertString2.default)(str); + try { + options = (0, _merge.default)(options, default_json_options); + var primitives = []; + if (options.allow_primitives) { + primitives = [null, false, true]; + } + var obj = JSON.parse(str); + return primitives.includes(obj) || !!obj && _typeof2(obj) === "object"; + } catch (e18) { + } + return false; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isJSON, isJSON.exports); +var isJSONExports = isJSON.exports; +var isEmpty = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isEmpty2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var default_is_empty_options = { + ignore_whitespace: false + }; + function isEmpty2(str, options) { + (0, _assertString2.default)(str); + options = (0, _merge.default)(options, default_is_empty_options); + return (options.ignore_whitespace ? str.trim().length : str.length) === 0; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isEmpty, isEmpty.exports); +var isEmptyExports = isEmpty.exports; +var isLength = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isLength2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _typeof2(o2) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { + return typeof o3; + } : function(o3) { + return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; + }, _typeof2(o2); + } + function isLength2(str, options) { + (0, _assertString2.default)(str); + var min; + var max; + if (_typeof2(options) === "object") { + min = options.min || 0; + max = options.max; + } else { + min = arguments[1] || 0; + max = arguments[2]; + } + var presentationSequences = str.match(/(\uFE0F|\uFE0E)/g) || []; + var surrogatePairs = str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g) || []; + var len = str.length - presentationSequences.length - surrogatePairs.length; + return len >= min && (typeof max === "undefined" || len <= max); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isLength, isLength.exports); +var isLengthExports = isLength.exports; +var isUUID = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isUUID2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var uuid2 = { + 1: /^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i, + 2: /^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i, + 3: /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i, + 4: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, + 5: /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, + 7: /^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, + all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i + }; + function isUUID2(str, version2) { + (0, _assertString2.default)(str); + var pattern = uuid2[![void 0, null].includes(version2) ? version2 : "all"]; + return !!pattern && pattern.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isUUID, isUUID.exports); +var isUUIDExports = isUUID.exports; +var isMongoId = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isMongoId2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _isHexadecimal = _interopRequireDefault2(isHexadecimalExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isMongoId2(str) { + (0, _assertString2.default)(str); + return (0, _isHexadecimal.default)(str) && str.length === 24; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isMongoId, isMongoId.exports); +var isMongoIdExports = isMongoId.exports; +var isAfter = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isAfter2; + var _toDate = _interopRequireDefault2(toDateExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isAfter2(date, options) { + var comparisonDate = (options === null || options === void 0 ? void 0 : options.comparisonDate) || options || Date().toString(); + var comparison = (0, _toDate.default)(comparisonDate); + var original = (0, _toDate.default)(date); + return !!(original && comparison && original > comparison); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isAfter, isAfter.exports); +var isAfterExports = isAfter.exports; +var isBefore = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isBefore2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _toDate = _interopRequireDefault2(toDateExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isBefore2(str) { + var date = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : String(/* @__PURE__ */ new Date()); + (0, _assertString2.default)(str); + var comparison = (0, _toDate.default)(date); + var original = (0, _toDate.default)(str); + return !!(original && comparison && original < comparison); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isBefore, isBefore.exports); +var isBeforeExports = isBefore.exports; +var isIn = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isIn2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _toString = _interopRequireDefault2(toStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _typeof2(o2) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { + return typeof o3; + } : function(o3) { + return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; + }, _typeof2(o2); + } + function isIn2(str, options) { + (0, _assertString2.default)(str); + var i2; + if (Object.prototype.toString.call(options) === "[object Array]") { + var array2 = []; + for (i2 in options) { + if ({}.hasOwnProperty.call(options, i2)) { + array2[i2] = (0, _toString.default)(options[i2]); + } + } + return array2.indexOf(str) >= 0; + } else if (_typeof2(options) === "object") { + return options.hasOwnProperty(str); + } else if (options && typeof options.indexOf === "function") { + return options.indexOf(str) >= 0; + } + return false; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isIn, isIn.exports); +var isInExports = isIn.exports; +var isLuhnNumber = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isLuhnNumber2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isLuhnNumber2(str) { + (0, _assertString2.default)(str); + var sanitized = str.replace(/[- ]+/g, ""); + var sum = 0; + var digit; + var tmpNum; + var shouldDouble; + for (var i2 = sanitized.length - 1; i2 >= 0; i2--) { + digit = sanitized.substring(i2, i2 + 1); + tmpNum = parseInt(digit, 10); + if (shouldDouble) { + tmpNum *= 2; + if (tmpNum >= 10) { + sum += tmpNum % 10 + 1; + } else { + sum += tmpNum; + } + } else { + sum += tmpNum; + } + shouldDouble = !shouldDouble; + } + return !!(sum % 10 === 0 ? sanitized : false); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isLuhnNumber, isLuhnNumber.exports); +var isLuhnNumberExports = isLuhnNumber.exports; +var isCreditCard = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isCreditCard2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _isLuhnNumber = _interopRequireDefault2(isLuhnNumberExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var cards = { + amex: /^3[47][0-9]{13}$/, + dinersclub: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/, + discover: /^6(?:011|5[0-9][0-9])[0-9]{12,15}$/, + jcb: /^(?:2131|1800|35\d{3})\d{11}$/, + mastercard: /^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/, + // /^[25][1-7][0-9]{14}$/; + unionpay: /^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/, + visa: /^(?:4[0-9]{12})(?:[0-9]{3,6})?$/ + }; + var allCards = function() { + var tmpCardsArray = []; + for (var cardProvider in cards) { + if (cards.hasOwnProperty(cardProvider)) { + tmpCardsArray.push(cards[cardProvider]); + } + } + return tmpCardsArray; + }(); + function isCreditCard2(card) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + (0, _assertString2.default)(card); + var provider = options.provider; + var sanitized = card.replace(/[- ]+/g, ""); + if (provider && provider.toLowerCase() in cards) { + if (!cards[provider.toLowerCase()].test(sanitized)) { + return false; + } + } else if (provider && !(provider.toLowerCase() in cards)) { + throw new Error("".concat(provider, " is not a valid credit card provider.")); + } else if (!allCards.some(function(cardProvider) { + return cardProvider.test(sanitized); + })) { + return false; + } + return (0, _isLuhnNumber.default)(card); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isCreditCard, isCreditCard.exports); +var isCreditCardExports = isCreditCard.exports; +var isIdentityCard = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isIdentityCard2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _isInt = _interopRequireDefault2(isIntExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var validators2 = { + PL: function PL2(str) { + (0, _assertString2.default)(str); + var weightOfDigits = { + 1: 1, + 2: 3, + 3: 7, + 4: 9, + 5: 1, + 6: 3, + 7: 7, + 8: 9, + 9: 1, + 10: 3, + 11: 0 + }; + if (str != null && str.length === 11 && (0, _isInt.default)(str, { + allow_leading_zeroes: true + })) { + var digits = str.split("").slice(0, -1); + var sum = digits.reduce(function(acc, digit, index2) { + return acc + Number(digit) * weightOfDigits[index2 + 1]; + }, 0); + var modulo = sum % 10; + var lastDigit = Number(str.charAt(str.length - 1)); + if (modulo === 0 && lastDigit === 0 || lastDigit === 10 - modulo) { + return true; + } + } + return false; + }, + ES: function ES2(str) { + (0, _assertString2.default)(str); + var DNI = /^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/; + var charsValue = { + X: 0, + Y: 1, + Z: 2 + }; + var controlDigits = ["T", "R", "W", "A", "G", "M", "Y", "F", "P", "D", "X", "B", "N", "J", "Z", "S", "Q", "V", "H", "L", "C", "K", "E"]; + var sanitized = str.trim().toUpperCase(); + if (!DNI.test(sanitized)) { + return false; + } + var number2 = sanitized.slice(0, -1).replace(/[X,Y,Z]/g, function(char) { + return charsValue[char]; + }); + return sanitized.endsWith(controlDigits[number2 % 23]); + }, + FI: function FI2(str) { + (0, _assertString2.default)(str); + if (str.length !== 11) { + return false; + } + if (!str.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/)) { + return false; + } + var checkDigits = "0123456789ABCDEFHJKLMNPRSTUVWXY"; + var idAsNumber = parseInt(str.slice(0, 6), 10) * 1e3 + parseInt(str.slice(7, 10), 10); + var remainder = idAsNumber % 31; + var checkDigit = checkDigits[remainder]; + return checkDigit === str.slice(10, 11); + }, + IN: function IN2(str) { + var DNI = /^[1-9]\d{3}\s?\d{4}\s?\d{4}$/; + var d4 = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]]; + var p3 = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2], [8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0], [4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5], [7, 0, 4, 6, 9, 1, 3, 2, 5, 8]]; + var sanitized = str.trim(); + if (!DNI.test(sanitized)) { + return false; + } + var c2 = 0; + var invertedArray = sanitized.replace(/\s/g, "").split("").map(Number).reverse(); + invertedArray.forEach(function(val, i2) { + c2 = d4[c2][p3[i2 % 8][val]]; + }); + return c2 === 0; + }, + IR: function IR(str) { + if (!str.match(/^\d{10}$/)) + return false; + str = "0000".concat(str).slice(str.length - 6); + if (parseInt(str.slice(3, 9), 10) === 0) + return false; + var lastNumber = parseInt(str.slice(9, 10), 10); + var sum = 0; + for (var i2 = 0; i2 < 9; i2++) { + sum += parseInt(str.slice(i2, i2 + 1), 10) * (10 - i2); + } + sum %= 11; + return sum < 2 && lastNumber === sum || sum >= 2 && lastNumber === 11 - sum; + }, + IT: function IT2(str) { + if (str.length !== 9) + return false; + if (str === "CA00000AA") + return false; + return str.search(/C[A-Z]\d{5}[A-Z]{2}/i) > -1; + }, + NO: function NO2(str) { + var sanitized = str.trim(); + if (isNaN(Number(sanitized))) + return false; + if (sanitized.length !== 11) + return false; + if (sanitized === "00000000000") + return false; + var f4 = sanitized.split("").map(Number); + var k1 = (11 - (3 * f4[0] + 7 * f4[1] + 6 * f4[2] + 1 * f4[3] + 8 * f4[4] + 9 * f4[5] + 4 * f4[6] + 5 * f4[7] + 2 * f4[8]) % 11) % 11; + var k2 = (11 - (5 * f4[0] + 4 * f4[1] + 3 * f4[2] + 2 * f4[3] + 7 * f4[4] + 6 * f4[5] + 5 * f4[6] + 4 * f4[7] + 3 * f4[8] + 2 * k1) % 11) % 11; + if (k1 !== f4[9] || k2 !== f4[10]) + return false; + return true; + }, + TH: function TH(str) { + if (!str.match(/^[1-8]\d{12}$/)) + return false; + var sum = 0; + for (var i2 = 0; i2 < 12; i2++) { + sum += parseInt(str[i2], 10) * (13 - i2); + } + return str[12] === ((11 - sum % 11) % 10).toString(); + }, + LK: function LK(str) { + var old_nic = /^[1-9]\d{8}[vx]$/i; + var new_nic = /^[1-9]\d{11}$/i; + if (str.length === 10 && old_nic.test(str)) + return true; + else if (str.length === 12 && new_nic.test(str)) + return true; + return false; + }, + "he-IL": function heIL(str) { + var DNI = /^\d{9}$/; + var sanitized = str.trim(); + if (!DNI.test(sanitized)) { + return false; + } + var id2 = sanitized; + var sum = 0, incNum; + for (var i2 = 0; i2 < id2.length; i2++) { + incNum = Number(id2[i2]) * (i2 % 2 + 1); + sum += incNum > 9 ? incNum - 9 : incNum; + } + return sum % 10 === 0; + }, + "ar-LY": function arLY(str) { + var NIN = /^(1|2)\d{11}$/; + var sanitized = str.trim(); + if (!NIN.test(sanitized)) { + return false; + } + return true; + }, + "ar-TN": function arTN(str) { + var DNI = /^\d{8}$/; + var sanitized = str.trim(); + if (!DNI.test(sanitized)) { + return false; + } + return true; + }, + "zh-CN": function zhCN(str) { + var provincesAndCities = [ + "11", + // 北京 + "12", + // 天津 + "13", + // 河北 + "14", + // 山西 + "15", + // 内蒙古 + "21", + // 辽宁 + "22", + // 吉林 + "23", + // 黑龙江 + "31", + // 上海 + "32", + // 江苏 + "33", + // 浙江 + "34", + // 安徽 + "35", + // 福建 + "36", + // 江西 + "37", + // 山东 + "41", + // 河南 + "42", + // 湖北 + "43", + // 湖南 + "44", + // 广东 + "45", + // 广西 + "46", + // 海南 + "50", + // 重庆 + "51", + // 四川 + "52", + // 贵州 + "53", + // 云南 + "54", + // 西藏 + "61", + // 陕西 + "62", + // 甘肃 + "63", + // 青海 + "64", + // 宁夏 + "65", + // 新疆 + "71", + // 台湾 + "81", + // 香港 + "82", + // 澳门 + "91" + // 国外 + ]; + var powers = ["7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2"]; + var parityBit = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]; + var checkAddressCode = function checkAddressCode2(addressCode) { + return provincesAndCities.includes(addressCode); + }; + var checkBirthDayCode = function checkBirthDayCode2(birDayCode) { + var yyyy = parseInt(birDayCode.substring(0, 4), 10); + var mm = parseInt(birDayCode.substring(4, 6), 10); + var dd2 = parseInt(birDayCode.substring(6), 10); + var xdata = new Date(yyyy, mm - 1, dd2); + if (xdata > /* @__PURE__ */ new Date()) { + return false; + } else if (xdata.getFullYear() === yyyy && xdata.getMonth() === mm - 1 && xdata.getDate() === dd2) { + return true; + } + return false; + }; + var getParityBit = function getParityBit2(idCardNo) { + var id17 = idCardNo.substring(0, 17); + var power = 0; + for (var i2 = 0; i2 < 17; i2++) { + power += parseInt(id17.charAt(i2), 10) * parseInt(powers[i2], 10); + } + var mod2 = power % 11; + return parityBit[mod2]; + }; + var checkParityBit = function checkParityBit2(idCardNo) { + return getParityBit(idCardNo) === idCardNo.charAt(17).toUpperCase(); + }; + var check15IdCardNo = function check15IdCardNo2(idCardNo) { + var check = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(idCardNo); + if (!check) + return false; + var addressCode = idCardNo.substring(0, 2); + check = checkAddressCode(addressCode); + if (!check) + return false; + var birDayCode = "19".concat(idCardNo.substring(6, 12)); + check = checkBirthDayCode(birDayCode); + if (!check) + return false; + return true; + }; + var check18IdCardNo = function check18IdCardNo2(idCardNo) { + var check = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(idCardNo); + if (!check) + return false; + var addressCode = idCardNo.substring(0, 2); + check = checkAddressCode(addressCode); + if (!check) + return false; + var birDayCode = idCardNo.substring(6, 14); + check = checkBirthDayCode(birDayCode); + if (!check) + return false; + return checkParityBit(idCardNo); + }; + var checkIdCardNo = function checkIdCardNo2(idCardNo) { + var check = /^\d{15}|(\d{17}(\d|x|X))$/.test(idCardNo); + if (!check) + return false; + if (idCardNo.length === 15) { + return check15IdCardNo(idCardNo); + } + return check18IdCardNo(idCardNo); + }; + return checkIdCardNo(str); + }, + "zh-HK": function zhHK(str) { + str = str.trim(); + var regexHKID = /^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/; + var regexIsDigit = /^[0-9]$/; + str = str.toUpperCase(); + if (!regexHKID.test(str)) + return false; + str = str.replace(/\[|\]|\(|\)/g, ""); + if (str.length === 8) + str = "3".concat(str); + var checkSumVal = 0; + for (var i2 = 0; i2 <= 7; i2++) { + var convertedChar = void 0; + if (!regexIsDigit.test(str[i2])) + convertedChar = (str[i2].charCodeAt(0) - 55) % 11; + else + convertedChar = str[i2]; + checkSumVal += convertedChar * (9 - i2); + } + checkSumVal %= 11; + var checkSumConverted; + if (checkSumVal === 0) + checkSumConverted = "0"; + else if (checkSumVal === 1) + checkSumConverted = "A"; + else + checkSumConverted = String(11 - checkSumVal); + if (checkSumConverted === str[str.length - 1]) + return true; + return false; + }, + "zh-TW": function zhTW(str) { + var ALPHABET_CODES = { + A: 10, + B: 11, + C: 12, + D: 13, + E: 14, + F: 15, + G: 16, + H: 17, + I: 34, + J: 18, + K: 19, + L: 20, + M: 21, + N: 22, + O: 35, + P: 23, + Q: 24, + R: 25, + S: 26, + T: 27, + U: 28, + V: 29, + W: 32, + X: 30, + Y: 31, + Z: 33 + }; + var sanitized = str.trim().toUpperCase(); + if (!/^[A-Z][0-9]{9}$/.test(sanitized)) + return false; + return Array.from(sanitized).reduce(function(sum, number2, index2) { + if (index2 === 0) { + var code2 = ALPHABET_CODES[number2]; + return code2 % 10 * 9 + Math.floor(code2 / 10); + } + if (index2 === 9) { + return (10 - sum % 10 - Number(number2)) % 10 === 0; + } + return sum + Number(number2) * (9 - index2); + }, 0); + } + }; + function isIdentityCard2(str, locale) { + (0, _assertString2.default)(str); + if (locale in validators2) { + return validators2[locale](str); + } else if (locale === "any") { + for (var key2 in validators2) { + if (validators2.hasOwnProperty(key2)) { + var validator2 = validators2[key2]; + if (validator2(str)) { + return true; + } + } + } + return false; + } + throw new Error("Invalid locale '".concat(locale, "'")); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isIdentityCard, isIdentityCard.exports); +var isIdentityCardExports = isIdentityCard.exports; +var isEAN = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isEAN2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var LENGTH_EAN_8 = 8; + var LENGTH_EAN_14 = 14; + var validEanRegex = /^(\d{8}|\d{13}|\d{14})$/; + function getPositionWeightThroughLengthAndIndex(length, index2) { + if (length === LENGTH_EAN_8 || length === LENGTH_EAN_14) { + return index2 % 2 === 0 ? 3 : 1; + } + return index2 % 2 === 0 ? 1 : 3; + } + function calculateCheckDigit(ean) { + var checksum2 = ean.slice(0, -1).split("").map(function(char, index2) { + return Number(char) * getPositionWeightThroughLengthAndIndex(ean.length, index2); + }).reduce(function(acc, partialSum) { + return acc + partialSum; + }, 0); + var remainder = 10 - checksum2 % 10; + return remainder < 10 ? remainder : 0; + } + function isEAN2(str) { + (0, _assertString2.default)(str); + var actualCheckDigit = Number(str.slice(-1)); + return validEanRegex.test(str) && actualCheckDigit === calculateCheckDigit(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isEAN, isEAN.exports); +var isEANExports = isEAN.exports; +var isISIN = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isISIN2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var isin = /^[A-Z]{2}[0-9A-Z]{9}[0-9]$/; + function isISIN2(str) { + (0, _assertString2.default)(str); + if (!isin.test(str)) { + return false; + } + var double = true; + var sum = 0; + for (var i2 = str.length - 2; i2 >= 0; i2--) { + if (str[i2] >= "A" && str[i2] <= "Z") { + var value = str[i2].charCodeAt(0) - 55; + var lo2 = value % 10; + var hi2 = Math.trunc(value / 10); + for (var _i2 = 0, _arr = [lo2, hi2]; _i2 < _arr.length; _i2++) { + var digit = _arr[_i2]; + if (double) { + if (digit >= 5) { + sum += 1 + (digit - 5) * 2; + } else { + sum += digit * 2; + } + } else { + sum += digit; + } + double = !double; + } + } else { + var _digit = str[i2].charCodeAt(0) - "0".charCodeAt(0); + if (double) { + if (_digit >= 5) { + sum += 1 + (_digit - 5) * 2; + } else { + sum += _digit * 2; + } + } else { + sum += _digit; + } + double = !double; + } + } + var check = Math.trunc((sum + 9) / 10) * 10 - sum; + return +str[str.length - 1] === check; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isISIN, isISIN.exports); +var isISINExports = isISIN.exports; +var isISBN = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isISBN2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var possibleIsbn10 = /^(?:[0-9]{9}X|[0-9]{10})$/; + var possibleIsbn13 = /^(?:[0-9]{13})$/; + var factor = [1, 3]; + function isISBN2(isbn, options) { + (0, _assertString2.default)(isbn); + var version2 = String((options === null || options === void 0 ? void 0 : options.version) || options); + if (!(options !== null && options !== void 0 && options.version || options)) { + return isISBN2(isbn, { + version: 10 + }) || isISBN2(isbn, { + version: 13 + }); + } + var sanitizedIsbn = isbn.replace(/[\s-]+/g, ""); + var checksum2 = 0; + if (version2 === "10") { + if (!possibleIsbn10.test(sanitizedIsbn)) { + return false; + } + for (var i2 = 0; i2 < version2 - 1; i2++) { + checksum2 += (i2 + 1) * sanitizedIsbn.charAt(i2); + } + if (sanitizedIsbn.charAt(9) === "X") { + checksum2 += 10 * 10; + } else { + checksum2 += 10 * sanitizedIsbn.charAt(9); + } + if (checksum2 % 11 === 0) { + return true; + } + } else if (version2 === "13") { + if (!possibleIsbn13.test(sanitizedIsbn)) { + return false; + } + for (var _i2 = 0; _i2 < 12; _i2++) { + checksum2 += factor[_i2 % 2] * sanitizedIsbn.charAt(_i2); + } + if (sanitizedIsbn.charAt(12) - (10 - checksum2 % 10) % 10 === 0) { + return true; + } + } + return false; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isISBN, isISBN.exports); +var isISBNExports = isISBN.exports; +var isISSN = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isISSN2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var issn = "^\\d{4}-?\\d{3}[\\dX]$"; + function isISSN2(str) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + (0, _assertString2.default)(str); + var testIssn = issn; + testIssn = options.require_hyphen ? testIssn.replace("?", "") : testIssn; + testIssn = options.case_sensitive ? new RegExp(testIssn) : new RegExp(testIssn, "i"); + if (!testIssn.test(str)) { + return false; + } + var digits = str.replace("-", "").toUpperCase(); + var checksum2 = 0; + for (var i2 = 0; i2 < digits.length; i2++) { + var digit = digits[i2]; + checksum2 += (digit === "X" ? 10 : +digit) * (8 - i2); + } + return checksum2 % 11 === 0; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isISSN, isISSN.exports); +var isISSNExports = isISSN.exports; +var isTaxID = { exports: {} }; +var algorithms$1 = {}; +Object.defineProperty(algorithms$1, "__esModule", { + value: true +}); +algorithms$1.iso7064Check = iso7064Check; +algorithms$1.luhnCheck = luhnCheck; +algorithms$1.reverseMultiplyAndSum = reverseMultiplyAndSum; +algorithms$1.verhoeffCheck = verhoeffCheck; +function iso7064Check(str) { + var checkvalue = 10; + for (var i2 = 0; i2 < str.length - 1; i2++) { + checkvalue = (parseInt(str[i2], 10) + checkvalue) % 10 === 0 ? 10 * 2 % 11 : (parseInt(str[i2], 10) + checkvalue) % 10 * 2 % 11; + } + checkvalue = checkvalue === 1 ? 0 : 11 - checkvalue; + return checkvalue === parseInt(str[10], 10); +} +function luhnCheck(str) { + var checksum2 = 0; + var second = false; + for (var i2 = str.length - 1; i2 >= 0; i2--) { + if (second) { + var product = parseInt(str[i2], 10) * 2; + if (product > 9) { + checksum2 += product.toString().split("").map(function(a3) { + return parseInt(a3, 10); + }).reduce(function(a3, b2) { + return a3 + b2; + }, 0); + } else { + checksum2 += product; + } + } else { + checksum2 += parseInt(str[i2], 10); + } + second = !second; + } + return checksum2 % 10 === 0; +} +function reverseMultiplyAndSum(digits, base3) { + var total = 0; + for (var i2 = 0; i2 < digits.length; i2++) { + total += digits[i2] * (base3 - i2); + } + return total; +} +function verhoeffCheck(str) { + var d_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]]; + var p_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2], [8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0], [4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5], [7, 0, 4, 6, 9, 1, 3, 2, 5, 8]]; + var str_copy = str.split("").reverse().join(""); + var checksum2 = 0; + for (var i2 = 0; i2 < str_copy.length; i2++) { + checksum2 = d_table[checksum2][p_table[i2 % 8][parseInt(str_copy[i2], 10)]]; + } + return checksum2 === 0; +} +(function(module, exports) { + function _typeof2(o2) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { + return typeof o3; + } : function(o3) { + return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; + }, _typeof2(o2); + } + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isTaxID2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var algorithms2 = _interopRequireWildcard2(algorithms$1); + var _isDate = _interopRequireDefault2(isDateExports); + function _getRequireWildcardCache2(e18) { + if ("function" != typeof WeakMap) + return null; + var r2 = /* @__PURE__ */ new WeakMap(), t2 = /* @__PURE__ */ new WeakMap(); + return (_getRequireWildcardCache2 = function _getRequireWildcardCache3(e19) { + return e19 ? t2 : r2; + })(e18); + } + function _interopRequireWildcard2(e18, r2) { + if (!r2 && e18 && e18.__esModule) + return e18; + if (null === e18 || "object" != _typeof2(e18) && "function" != typeof e18) + return { default: e18 }; + var t2 = _getRequireWildcardCache2(r2); + if (t2 && t2.has(e18)) + return t2.get(e18); + var n5 = { __proto__: null }, a3 = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var u2 in e18) + if ("default" !== u2 && {}.hasOwnProperty.call(e18, u2)) { + var i2 = a3 ? Object.getOwnPropertyDescriptor(e18, u2) : null; + i2 && (i2.get || i2.set) ? Object.defineProperty(n5, u2, i2) : n5[u2] = e18[u2]; + } + return n5.default = e18, t2 && t2.set(e18, n5), n5; + } + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _unsupportedIterableToArray(o2, minLen) { + if (!o2) + return; + if (typeof o2 === "string") + return _arrayLikeToArray(o2, minLen); + var n5 = Object.prototype.toString.call(o2).slice(8, -1); + if (n5 === "Object" && o2.constructor) + n5 = o2.constructor.name; + if (n5 === "Map" || n5 === "Set") + return Array.from(o2); + if (n5 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n5)) + return _arrayLikeToArray(o2, minLen); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray(arr); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) + arr2[i2] = arr[i2]; + return arr2; + } + function bgBgCheck(tin) { + var century_year = tin.slice(0, 2); + var month = parseInt(tin.slice(2, 4), 10); + if (month > 40) { + month -= 40; + century_year = "20".concat(century_year); + } else if (month > 20) { + month -= 20; + century_year = "18".concat(century_year); + } else { + century_year = "19".concat(century_year); + } + if (month < 10) { + month = "0".concat(month); + } + var date = "".concat(century_year, "/").concat(month, "/").concat(tin.slice(4, 6)); + if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + var digits = tin.split("").map(function(a3) { + return parseInt(a3, 10); + }); + var multip_lookup = [2, 4, 8, 5, 10, 9, 7, 3, 6]; + var checksum2 = 0; + for (var i2 = 0; i2 < multip_lookup.length; i2++) { + checksum2 += digits[i2] * multip_lookup[i2]; + } + checksum2 = checksum2 % 11 === 10 ? 0 : checksum2 % 11; + return checksum2 === digits[9]; + } + function isCanadianSIN(input) { + var digitsArray = input.split(""); + var even = digitsArray.filter(function(_3, idx) { + return idx % 2; + }).map(function(i2) { + return Number(i2) * 2; + }).join("").split(""); + var total = digitsArray.filter(function(_3, idx) { + return !(idx % 2); + }).concat(even).map(function(i2) { + return Number(i2); + }).reduce(function(acc, cur) { + return acc + cur; + }); + return total % 10 === 0; + } + function csCzCheck(tin) { + tin = tin.replace(/\W/, ""); + var full_year = parseInt(tin.slice(0, 2), 10); + if (tin.length === 10) { + if (full_year < 54) { + full_year = "20".concat(full_year); + } else { + full_year = "19".concat(full_year); + } + } else { + if (tin.slice(6) === "000") { + return false; + } + if (full_year < 54) { + full_year = "19".concat(full_year); + } else { + return false; + } + } + if (full_year.length === 3) { + full_year = [full_year.slice(0, 2), "0", full_year.slice(2)].join(""); + } + var month = parseInt(tin.slice(2, 4), 10); + if (month > 50) { + month -= 50; + } + if (month > 20) { + if (parseInt(full_year, 10) < 2004) { + return false; + } + month -= 20; + } + if (month < 10) { + month = "0".concat(month); + } + var date = "".concat(full_year, "/").concat(month, "/").concat(tin.slice(4, 6)); + if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + if (tin.length === 10) { + if (parseInt(tin, 10) % 11 !== 0) { + var checkdigit = parseInt(tin.slice(0, 9), 10) % 11; + if (parseInt(full_year, 10) < 1986 && checkdigit === 10) { + if (parseInt(tin.slice(9), 10) !== 0) { + return false; + } + } else { + return false; + } + } + } + return true; + } + function deAtCheck(tin) { + return algorithms2.luhnCheck(tin); + } + function deDeCheck(tin) { + var digits = tin.split("").map(function(a3) { + return parseInt(a3, 10); + }); + var occurences = []; + for (var i2 = 0; i2 < digits.length - 1; i2++) { + occurences.push(""); + for (var j2 = 0; j2 < digits.length - 1; j2++) { + if (digits[i2] === digits[j2]) { + occurences[i2] += j2; + } + } + } + occurences = occurences.filter(function(a3) { + return a3.length > 1; + }); + if (occurences.length !== 2 && occurences.length !== 3) { + return false; + } + if (occurences[0].length === 3) { + var trip_locations = occurences[0].split("").map(function(a3) { + return parseInt(a3, 10); + }); + var recurrent = 0; + for (var _i2 = 0; _i2 < trip_locations.length - 1; _i2++) { + if (trip_locations[_i2] + 1 === trip_locations[_i2 + 1]) { + recurrent += 1; + } + } + if (recurrent === 2) { + return false; + } + } + return algorithms2.iso7064Check(tin); + } + function dkDkCheck(tin) { + tin = tin.replace(/\W/, ""); + var year = parseInt(tin.slice(4, 6), 10); + var century_digit = tin.slice(6, 7); + switch (century_digit) { + case "0": + case "1": + case "2": + case "3": + year = "19".concat(year); + break; + case "4": + case "9": + if (year < 37) { + year = "20".concat(year); + } else { + year = "19".concat(year); + } + break; + default: + if (year < 37) { + year = "20".concat(year); + } else if (year > 58) { + year = "18".concat(year); + } else { + return false; + } + break; + } + if (year.length === 3) { + year = [year.slice(0, 2), "0", year.slice(2)].join(""); + } + var date = "".concat(year, "/").concat(tin.slice(2, 4), "/").concat(tin.slice(0, 2)); + if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + var digits = tin.split("").map(function(a3) { + return parseInt(a3, 10); + }); + var checksum2 = 0; + var weight = 4; + for (var i2 = 0; i2 < 9; i2++) { + checksum2 += digits[i2] * weight; + weight -= 1; + if (weight === 1) { + weight = 7; + } + } + checksum2 %= 11; + if (checksum2 === 1) { + return false; + } + return checksum2 === 0 ? digits[9] === 0 : digits[9] === 11 - checksum2; + } + function elCyCheck(tin) { + var digits = tin.slice(0, 8).split("").map(function(a3) { + return parseInt(a3, 10); + }); + var checksum2 = 0; + for (var i2 = 1; i2 < digits.length; i2 += 2) { + checksum2 += digits[i2]; + } + for (var _i2 = 0; _i2 < digits.length; _i2 += 2) { + if (digits[_i2] < 2) { + checksum2 += 1 - digits[_i2]; + } else { + checksum2 += 2 * (digits[_i2] - 2) + 5; + if (digits[_i2] > 4) { + checksum2 += 2; + } + } + } + return String.fromCharCode(checksum2 % 26 + 65) === tin.charAt(8); + } + function elGrCheck(tin) { + var digits = tin.split("").map(function(a3) { + return parseInt(a3, 10); + }); + var checksum2 = 0; + for (var i2 = 0; i2 < 8; i2++) { + checksum2 += digits[i2] * Math.pow(2, 8 - i2); + } + return checksum2 % 11 % 10 === digits[8]; + } + function enIeCheck(tin) { + var checksum2 = algorithms2.reverseMultiplyAndSum(tin.split("").slice(0, 7).map(function(a3) { + return parseInt(a3, 10); + }), 8); + if (tin.length === 9 && tin[8] !== "W") { + checksum2 += (tin[8].charCodeAt(0) - 64) * 9; + } + checksum2 %= 23; + if (checksum2 === 0) { + return tin[7].toUpperCase() === "W"; + } + return tin[7].toUpperCase() === String.fromCharCode(64 + checksum2); + } + var enUsCampusPrefix = { + andover: ["10", "12"], + atlanta: ["60", "67"], + austin: ["50", "53"], + brookhaven: ["01", "02", "03", "04", "05", "06", "11", "13", "14", "16", "21", "22", "23", "25", "34", "51", "52", "54", "55", "56", "57", "58", "59", "65"], + cincinnati: ["30", "32", "35", "36", "37", "38", "61"], + fresno: ["15", "24"], + internet: ["20", "26", "27", "45", "46", "47"], + kansas: ["40", "44"], + memphis: ["94", "95"], + ogden: ["80", "90"], + philadelphia: ["33", "39", "41", "42", "43", "46", "48", "62", "63", "64", "66", "68", "71", "72", "73", "74", "75", "76", "77", "81", "82", "83", "84", "85", "86", "87", "88", "91", "92", "93", "98", "99"], + sba: ["31"] + }; + function enUsGetPrefixes() { + var prefixes = []; + for (var location2 in enUsCampusPrefix) { + if (enUsCampusPrefix.hasOwnProperty(location2)) { + prefixes.push.apply(prefixes, _toConsumableArray(enUsCampusPrefix[location2])); + } + } + return prefixes; + } + function enUsCheck(tin) { + return enUsGetPrefixes().indexOf(tin.slice(0, 2)) !== -1; + } + function esArCheck(tin) { + var accum = 0; + var digits = tin.split(""); + var digit = parseInt(digits.pop(), 10); + for (var i2 = 0; i2 < digits.length; i2++) { + accum += digits[9 - i2] * (2 + i2 % 6); + } + var verif = 11 - accum % 11; + if (verif === 11) { + verif = 0; + } else if (verif === 10) { + verif = 9; + } + return digit === verif; + } + function esEsCheck(tin) { + var chars = tin.toUpperCase().split(""); + if (isNaN(parseInt(chars[0], 10)) && chars.length > 1) { + var lead_replace = 0; + switch (chars[0]) { + case "Y": + lead_replace = 1; + break; + case "Z": + lead_replace = 2; + break; + } + chars.splice(0, 1, lead_replace); + } else { + while (chars.length < 9) { + chars.unshift(0); + } + } + var lookup2 = ["T", "R", "W", "A", "G", "M", "Y", "F", "P", "D", "X", "B", "N", "J", "Z", "S", "Q", "V", "H", "L", "C", "K", "E"]; + chars = chars.join(""); + var checksum2 = parseInt(chars.slice(0, 8), 10) % 23; + return chars[8] === lookup2[checksum2]; + } + function etEeCheck(tin) { + var full_year = tin.slice(1, 3); + var century_digit = tin.slice(0, 1); + switch (century_digit) { + case "1": + case "2": + full_year = "18".concat(full_year); + break; + case "3": + case "4": + full_year = "19".concat(full_year); + break; + default: + full_year = "20".concat(full_year); + break; + } + var date = "".concat(full_year, "/").concat(tin.slice(3, 5), "/").concat(tin.slice(5, 7)); + if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + var digits = tin.split("").map(function(a3) { + return parseInt(a3, 10); + }); + var checksum2 = 0; + var weight = 1; + for (var i2 = 0; i2 < 10; i2++) { + checksum2 += digits[i2] * weight; + weight += 1; + if (weight === 10) { + weight = 1; + } + } + if (checksum2 % 11 === 10) { + checksum2 = 0; + weight = 3; + for (var _i3 = 0; _i3 < 10; _i3++) { + checksum2 += digits[_i3] * weight; + weight += 1; + if (weight === 10) { + weight = 1; + } + } + if (checksum2 % 11 === 10) { + return digits[10] === 0; + } + } + return checksum2 % 11 === digits[10]; + } + function fiFiCheck(tin) { + var full_year = tin.slice(4, 6); + var century_symbol = tin.slice(6, 7); + switch (century_symbol) { + case "+": + full_year = "18".concat(full_year); + break; + case "-": + full_year = "19".concat(full_year); + break; + default: + full_year = "20".concat(full_year); + break; + } + var date = "".concat(full_year, "/").concat(tin.slice(2, 4), "/").concat(tin.slice(0, 2)); + if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + var checksum2 = parseInt(tin.slice(0, 6) + tin.slice(7, 10), 10) % 31; + if (checksum2 < 10) { + return checksum2 === parseInt(tin.slice(10), 10); + } + checksum2 -= 10; + var letters_lookup = ["A", "B", "C", "D", "E", "F", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y"]; + return letters_lookup[checksum2] === tin.slice(10); + } + function frBeCheck(tin) { + if (tin.slice(2, 4) !== "00" || tin.slice(4, 6) !== "00") { + var date = "".concat(tin.slice(0, 2), "/").concat(tin.slice(2, 4), "/").concat(tin.slice(4, 6)); + if (!(0, _isDate.default)(date, "YY/MM/DD")) { + return false; + } + } + var checksum2 = 97 - parseInt(tin.slice(0, 9), 10) % 97; + var checkdigits = parseInt(tin.slice(9, 11), 10); + if (checksum2 !== checkdigits) { + checksum2 = 97 - parseInt("2".concat(tin.slice(0, 9)), 10) % 97; + if (checksum2 !== checkdigits) { + return false; + } + } + return true; + } + function frFrCheck(tin) { + tin = tin.replace(/\s/g, ""); + var checksum2 = parseInt(tin.slice(0, 10), 10) % 511; + var checkdigits = parseInt(tin.slice(10, 13), 10); + return checksum2 === checkdigits; + } + function frLuCheck(tin) { + var date = "".concat(tin.slice(0, 4), "/").concat(tin.slice(4, 6), "/").concat(tin.slice(6, 8)); + if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + if (!algorithms2.luhnCheck(tin.slice(0, 12))) { + return false; + } + return algorithms2.verhoeffCheck("".concat(tin.slice(0, 11)).concat(tin[12])); + } + function hrHrCheck(tin) { + return algorithms2.iso7064Check(tin); + } + function huHuCheck(tin) { + var digits = tin.split("").map(function(a3) { + return parseInt(a3, 10); + }); + var checksum2 = 8; + for (var i2 = 1; i2 < 9; i2++) { + checksum2 += digits[i2] * (i2 + 1); + } + return checksum2 % 11 === digits[9]; + } + function itItNameCheck(name2) { + var vowelflag = false; + var xflag = false; + for (var i2 = 0; i2 < 3; i2++) { + if (!vowelflag && /[AEIOU]/.test(name2[i2])) { + vowelflag = true; + } else if (!xflag && vowelflag && name2[i2] === "X") { + xflag = true; + } else if (i2 > 0) { + if (vowelflag && !xflag) { + if (!/[AEIOU]/.test(name2[i2])) { + return false; + } + } + if (xflag) { + if (!/X/.test(name2[i2])) { + return false; + } + } + } + } + return true; + } + function itItCheck(tin) { + var chars = tin.toUpperCase().split(""); + if (!itItNameCheck(chars.slice(0, 3))) { + return false; + } + if (!itItNameCheck(chars.slice(3, 6))) { + return false; + } + var number_locations = [6, 7, 9, 10, 12, 13, 14]; + var number_replace = { + L: "0", + M: "1", + N: "2", + P: "3", + Q: "4", + R: "5", + S: "6", + T: "7", + U: "8", + V: "9" + }; + for (var _i4 = 0, _number_locations = number_locations; _i4 < _number_locations.length; _i4++) { + var i2 = _number_locations[_i4]; + if (chars[i2] in number_replace) { + chars.splice(i2, 1, number_replace[chars[i2]]); + } + } + var month_replace = { + A: "01", + B: "02", + C: "03", + D: "04", + E: "05", + H: "06", + L: "07", + M: "08", + P: "09", + R: "10", + S: "11", + T: "12" + }; + var month = month_replace[chars[8]]; + var day = parseInt(chars[9] + chars[10], 10); + if (day > 40) { + day -= 40; + } + if (day < 10) { + day = "0".concat(day); + } + var date = "".concat(chars[6]).concat(chars[7], "/").concat(month, "/").concat(day); + if (!(0, _isDate.default)(date, "YY/MM/DD")) { + return false; + } + var checksum2 = 0; + for (var _i5 = 1; _i5 < chars.length - 1; _i5 += 2) { + var char_to_int = parseInt(chars[_i5], 10); + if (isNaN(char_to_int)) { + char_to_int = chars[_i5].charCodeAt(0) - 65; + } + checksum2 += char_to_int; + } + var odd_convert = { + // Maps of characters at odd places + A: 1, + B: 0, + C: 5, + D: 7, + E: 9, + F: 13, + G: 15, + H: 17, + I: 19, + J: 21, + K: 2, + L: 4, + M: 18, + N: 20, + O: 11, + P: 3, + Q: 6, + R: 8, + S: 12, + T: 14, + U: 16, + V: 10, + W: 22, + X: 25, + Y: 24, + Z: 23, + 0: 1, + 1: 0 + }; + for (var _i6 = 0; _i6 < chars.length - 1; _i6 += 2) { + var _char_to_int = 0; + if (chars[_i6] in odd_convert) { + _char_to_int = odd_convert[chars[_i6]]; + } else { + var multiplier = parseInt(chars[_i6], 10); + _char_to_int = 2 * multiplier + 1; + if (multiplier > 4) { + _char_to_int += 2; + } + } + checksum2 += _char_to_int; + } + if (String.fromCharCode(65 + checksum2 % 26) !== chars[15]) { + return false; + } + return true; + } + function lvLvCheck(tin) { + tin = tin.replace(/\W/, ""); + var day = tin.slice(0, 2); + if (day !== "32") { + var month = tin.slice(2, 4); + if (month !== "00") { + var full_year = tin.slice(4, 6); + switch (tin[6]) { + case "0": + full_year = "18".concat(full_year); + break; + case "1": + full_year = "19".concat(full_year); + break; + default: + full_year = "20".concat(full_year); + break; + } + var date = "".concat(full_year, "/").concat(tin.slice(2, 4), "/").concat(day); + if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + } + var checksum2 = 1101; + var multip_lookup = [1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; + for (var i2 = 0; i2 < tin.length - 1; i2++) { + checksum2 -= parseInt(tin[i2], 10) * multip_lookup[i2]; + } + return parseInt(tin[10], 10) === checksum2 % 11; + } + return true; + } + function mtMtCheck(tin) { + if (tin.length !== 9) { + var chars = tin.toUpperCase().split(""); + while (chars.length < 8) { + chars.unshift(0); + } + switch (tin[7]) { + case "A": + case "P": + if (parseInt(chars[6], 10) === 0) { + return false; + } + break; + default: { + var first_part = parseInt(chars.join("").slice(0, 5), 10); + if (first_part > 32e3) { + return false; + } + var second_part = parseInt(chars.join("").slice(5, 7), 10); + if (first_part === second_part) { + return false; + } + } + } + } + return true; + } + function nlNlCheck(tin) { + return algorithms2.reverseMultiplyAndSum(tin.split("").slice(0, 8).map(function(a3) { + return parseInt(a3, 10); + }), 9) % 11 === parseInt(tin[8], 10); + } + function plPlCheck(tin) { + if (tin.length === 10) { + var lookup2 = [6, 5, 7, 2, 3, 4, 5, 6, 7]; + var _checksum2 = 0; + for (var i2 = 0; i2 < lookup2.length; i2++) { + _checksum2 += parseInt(tin[i2], 10) * lookup2[i2]; + } + _checksum2 %= 11; + if (_checksum2 === 10) { + return false; + } + return _checksum2 === parseInt(tin[9], 10); + } + var full_year = tin.slice(0, 2); + var month = parseInt(tin.slice(2, 4), 10); + if (month > 80) { + full_year = "18".concat(full_year); + month -= 80; + } else if (month > 60) { + full_year = "22".concat(full_year); + month -= 60; + } else if (month > 40) { + full_year = "21".concat(full_year); + month -= 40; + } else if (month > 20) { + full_year = "20".concat(full_year); + month -= 20; + } else { + full_year = "19".concat(full_year); + } + if (month < 10) { + month = "0".concat(month); + } + var date = "".concat(full_year, "/").concat(month, "/").concat(tin.slice(4, 6)); + if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + var checksum2 = 0; + var multiplier = 1; + for (var _i7 = 0; _i7 < tin.length - 1; _i7++) { + checksum2 += parseInt(tin[_i7], 10) * multiplier % 10; + multiplier += 2; + if (multiplier > 10) { + multiplier = 1; + } else if (multiplier === 5) { + multiplier += 2; + } + } + checksum2 = 10 - checksum2 % 10; + return checksum2 === parseInt(tin[10], 10); + } + function ptBrCheck(tin) { + if (tin.length === 11) { + var _sum; + var remainder; + _sum = 0; + if ( + // Reject known invalid CPFs + tin === "11111111111" || tin === "22222222222" || tin === "33333333333" || tin === "44444444444" || tin === "55555555555" || tin === "66666666666" || tin === "77777777777" || tin === "88888888888" || tin === "99999999999" || tin === "00000000000" + ) + return false; + for (var i2 = 1; i2 <= 9; i2++) + _sum += parseInt(tin.substring(i2 - 1, i2), 10) * (11 - i2); + remainder = _sum * 10 % 11; + if (remainder === 10) + remainder = 0; + if (remainder !== parseInt(tin.substring(9, 10), 10)) + return false; + _sum = 0; + for (var _i8 = 1; _i8 <= 10; _i8++) + _sum += parseInt(tin.substring(_i8 - 1, _i8), 10) * (12 - _i8); + remainder = _sum * 10 % 11; + if (remainder === 10) + remainder = 0; + if (remainder !== parseInt(tin.substring(10, 11), 10)) + return false; + return true; + } + if ( + // Reject know invalid CNPJs + tin === "00000000000000" || tin === "11111111111111" || tin === "22222222222222" || tin === "33333333333333" || tin === "44444444444444" || tin === "55555555555555" || tin === "66666666666666" || tin === "77777777777777" || tin === "88888888888888" || tin === "99999999999999" + ) { + return false; + } + var length = tin.length - 2; + var identifiers = tin.substring(0, length); + var verificators = tin.substring(length); + var sum = 0; + var pos = length - 7; + for (var _i9 = length; _i9 >= 1; _i9--) { + sum += identifiers.charAt(length - _i9) * pos; + pos -= 1; + if (pos < 2) { + pos = 9; + } + } + var result = sum % 11 < 2 ? 0 : 11 - sum % 11; + if (result !== parseInt(verificators.charAt(0), 10)) { + return false; + } + length += 1; + identifiers = tin.substring(0, length); + sum = 0; + pos = length - 7; + for (var _i10 = length; _i10 >= 1; _i10--) { + sum += identifiers.charAt(length - _i10) * pos; + pos -= 1; + if (pos < 2) { + pos = 9; + } + } + result = sum % 11 < 2 ? 0 : 11 - sum % 11; + if (result !== parseInt(verificators.charAt(1), 10)) { + return false; + } + return true; + } + function ptPtCheck(tin) { + var checksum2 = 11 - algorithms2.reverseMultiplyAndSum(tin.split("").slice(0, 8).map(function(a3) { + return parseInt(a3, 10); + }), 9) % 11; + if (checksum2 > 9) { + return parseInt(tin[8], 10) === 0; + } + return checksum2 === parseInt(tin[8], 10); + } + function roRoCheck(tin) { + if (tin.slice(0, 4) !== "9000") { + var full_year = tin.slice(1, 3); + switch (tin[0]) { + case "1": + case "2": + full_year = "19".concat(full_year); + break; + case "3": + case "4": + full_year = "18".concat(full_year); + break; + case "5": + case "6": + full_year = "20".concat(full_year); + break; + } + var date = "".concat(full_year, "/").concat(tin.slice(3, 5), "/").concat(tin.slice(5, 7)); + if (date.length === 8) { + if (!(0, _isDate.default)(date, "YY/MM/DD")) { + return false; + } + } else if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + var digits = tin.split("").map(function(a3) { + return parseInt(a3, 10); + }); + var multipliers = [2, 7, 9, 1, 4, 6, 3, 5, 8, 2, 7, 9]; + var checksum2 = 0; + for (var i2 = 0; i2 < multipliers.length; i2++) { + checksum2 += digits[i2] * multipliers[i2]; + } + if (checksum2 % 11 === 10) { + return digits[12] === 1; + } + return digits[12] === checksum2 % 11; + } + return true; + } + function skSkCheck(tin) { + if (tin.length === 9) { + tin = tin.replace(/\W/, ""); + if (tin.slice(6) === "000") { + return false; + } + var full_year = parseInt(tin.slice(0, 2), 10); + if (full_year > 53) { + return false; + } + if (full_year < 10) { + full_year = "190".concat(full_year); + } else { + full_year = "19".concat(full_year); + } + var month = parseInt(tin.slice(2, 4), 10); + if (month > 50) { + month -= 50; + } + if (month < 10) { + month = "0".concat(month); + } + var date = "".concat(full_year, "/").concat(month, "/").concat(tin.slice(4, 6)); + if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + } + return true; + } + function slSiCheck(tin) { + var checksum2 = 11 - algorithms2.reverseMultiplyAndSum(tin.split("").slice(0, 7).map(function(a3) { + return parseInt(a3, 10); + }), 8) % 11; + if (checksum2 === 10) { + return parseInt(tin[7], 10) === 0; + } + return checksum2 === parseInt(tin[7], 10); + } + function svSeCheck(tin) { + var tin_copy = tin.slice(0); + if (tin.length > 11) { + tin_copy = tin_copy.slice(2); + } + var full_year = ""; + var month = tin_copy.slice(2, 4); + var day = parseInt(tin_copy.slice(4, 6), 10); + if (tin.length > 11) { + full_year = tin.slice(0, 4); + } else { + full_year = tin.slice(0, 2); + if (tin.length === 11 && day < 60) { + var current_year = (/* @__PURE__ */ new Date()).getFullYear().toString(); + var current_century = parseInt(current_year.slice(0, 2), 10); + current_year = parseInt(current_year, 10); + if (tin[6] === "-") { + if (parseInt("".concat(current_century).concat(full_year), 10) > current_year) { + full_year = "".concat(current_century - 1).concat(full_year); + } else { + full_year = "".concat(current_century).concat(full_year); + } + } else { + full_year = "".concat(current_century - 1).concat(full_year); + if (current_year - parseInt(full_year, 10) < 100) { + return false; + } + } + } + } + if (day > 60) { + day -= 60; + } + if (day < 10) { + day = "0".concat(day); + } + var date = "".concat(full_year, "/").concat(month, "/").concat(day); + if (date.length === 8) { + if (!(0, _isDate.default)(date, "YY/MM/DD")) { + return false; + } + } else if (!(0, _isDate.default)(date, "YYYY/MM/DD")) { + return false; + } + return algorithms2.luhnCheck(tin.replace(/\W/, "")); + } + function ukUaCheck(tin) { + var digits = tin.split("").map(function(a3) { + return parseInt(a3, 10); + }); + var multipliers = [-1, 5, 7, 9, 4, 6, 10, 5, 7]; + var checksum2 = 0; + for (var i2 = 0; i2 < multipliers.length; i2++) { + checksum2 += digits[i2] * multipliers[i2]; + } + return checksum2 % 11 === 10 ? digits[9] === 0 : digits[9] === checksum2 % 11; + } + var taxIdFormat = { + "bg-BG": /^\d{10}$/, + "cs-CZ": /^\d{6}\/{0,1}\d{3,4}$/, + "de-AT": /^\d{9}$/, + "de-DE": /^[1-9]\d{10}$/, + "dk-DK": /^\d{6}-{0,1}\d{4}$/, + "el-CY": /^[09]\d{7}[A-Z]$/, + "el-GR": /^([0-4]|[7-9])\d{8}$/, + "en-CA": /^\d{9}$/, + "en-GB": /^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i, + "en-IE": /^\d{7}[A-W][A-IW]{0,1}$/i, + "en-US": /^\d{2}[- ]{0,1}\d{7}$/, + "es-AR": /(20|23|24|27|30|33|34)[0-9]{8}[0-9]/, + "es-ES": /^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i, + "et-EE": /^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/, + "fi-FI": /^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i, + "fr-BE": /^\d{11}$/, + "fr-FR": /^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/, + // Conforms both to official spec and provided example + "fr-LU": /^\d{13}$/, + "hr-HR": /^\d{11}$/, + "hu-HU": /^8\d{9}$/, + "it-IT": /^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i, + "lv-LV": /^\d{6}-{0,1}\d{5}$/, + // Conforms both to DG TAXUD spec and original research + "mt-MT": /^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i, + "nl-NL": /^\d{9}$/, + "pl-PL": /^\d{10,11}$/, + "pt-BR": /(?:^\d{11}$)|(?:^\d{14}$)/, + "pt-PT": /^\d{9}$/, + "ro-RO": /^\d{13}$/, + "sk-SK": /^\d{6}\/{0,1}\d{3,4}$/, + "sl-SI": /^[1-9]\d{7}$/, + "sv-SE": /^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/, + "uk-UA": /^\d{10}$/ + }; + taxIdFormat["lb-LU"] = taxIdFormat["fr-LU"]; + taxIdFormat["lt-LT"] = taxIdFormat["et-EE"]; + taxIdFormat["nl-BE"] = taxIdFormat["fr-BE"]; + taxIdFormat["fr-CA"] = taxIdFormat["en-CA"]; + var taxIdCheck = { + "bg-BG": bgBgCheck, + "cs-CZ": csCzCheck, + "de-AT": deAtCheck, + "de-DE": deDeCheck, + "dk-DK": dkDkCheck, + "el-CY": elCyCheck, + "el-GR": elGrCheck, + "en-CA": isCanadianSIN, + "en-IE": enIeCheck, + "en-US": enUsCheck, + "es-AR": esArCheck, + "es-ES": esEsCheck, + "et-EE": etEeCheck, + "fi-FI": fiFiCheck, + "fr-BE": frBeCheck, + "fr-FR": frFrCheck, + "fr-LU": frLuCheck, + "hr-HR": hrHrCheck, + "hu-HU": huHuCheck, + "it-IT": itItCheck, + "lv-LV": lvLvCheck, + "mt-MT": mtMtCheck, + "nl-NL": nlNlCheck, + "pl-PL": plPlCheck, + "pt-BR": ptBrCheck, + "pt-PT": ptPtCheck, + "ro-RO": roRoCheck, + "sk-SK": skSkCheck, + "sl-SI": slSiCheck, + "sv-SE": svSeCheck, + "uk-UA": ukUaCheck + }; + taxIdCheck["lb-LU"] = taxIdCheck["fr-LU"]; + taxIdCheck["lt-LT"] = taxIdCheck["et-EE"]; + taxIdCheck["nl-BE"] = taxIdCheck["fr-BE"]; + taxIdCheck["fr-CA"] = taxIdCheck["en-CA"]; + var allsymbols = /[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g; + var sanitizeRegexes = { + "de-AT": allsymbols, + "de-DE": /[\/\\]/g, + "fr-BE": allsymbols + }; + sanitizeRegexes["nl-BE"] = sanitizeRegexes["fr-BE"]; + function isTaxID2(str) { + var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en-US"; + (0, _assertString2.default)(str); + var strcopy = str.slice(0); + if (locale in taxIdFormat) { + if (locale in sanitizeRegexes) { + strcopy = strcopy.replace(sanitizeRegexes[locale], ""); + } + if (!taxIdFormat[locale].test(strcopy)) { + return false; + } + if (locale in taxIdCheck) { + return taxIdCheck[locale](strcopy); + } + return true; + } + throw new Error("Invalid locale '".concat(locale, "'")); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isTaxID, isTaxID.exports); +var isTaxIDExports = isTaxID.exports; +var isMobilePhone$1 = {}; +Object.defineProperty(isMobilePhone$1, "__esModule", { + value: true +}); +isMobilePhone$1.default = isMobilePhone; +isMobilePhone$1.locales = void 0; +var _assertString$4 = _interopRequireDefault$4(assertStringExports); +function _interopRequireDefault$4(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +var phones = { + "am-AM": /^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/, + "ar-AE": /^((\+?971)|0)?5[024568]\d{7}$/, + "ar-BH": /^(\+?973)?(3|6)\d{7}$/, + "ar-DZ": /^(\+?213|0)(5|6|7)\d{8}$/, + "ar-LB": /^(\+?961)?((3|81)\d{6}|7\d{7})$/, + "ar-EG": /^((\+?20)|0)?1[0125]\d{8}$/, + "ar-IQ": /^(\+?964|0)?7[0-9]\d{8}$/, + "ar-JO": /^(\+?962|0)?7[789]\d{7}$/, + "ar-KW": /^(\+?965)([569]\d{7}|41\d{6})$/, + "ar-LY": /^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/, + "ar-MA": /^(?:(?:\+|00)212|0)[5-7]\d{8}$/, + "ar-OM": /^((\+|00)968)?(9[1-9])\d{6}$/, + "ar-PS": /^(\+?970|0)5[6|9](\d{7})$/, + "ar-SA": /^(!?(\+?966)|0)?5\d{8}$/, + "ar-SD": /^((\+?249)|0)?(9[012369]|1[012])\d{7}$/, + "ar-SY": /^(!?(\+?963)|0)?9\d{8}$/, + "ar-TN": /^(\+?216)?[2459]\d{7}$/, + "az-AZ": /^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/, + "bs-BA": /^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/, + "be-BY": /^(\+?375)?(24|25|29|33|44)\d{7}$/, + "bg-BG": /^(\+?359|0)?8[789]\d{7}$/, + "bn-BD": /^(\+?880|0)1[13456789][0-9]{8}$/, + "ca-AD": /^(\+376)?[346]\d{5}$/, + "cs-CZ": /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/, + "da-DK": /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/, + "de-DE": /^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/, + "de-AT": /^(\+43|0)\d{1,4}\d{3,12}$/, + "de-CH": /^(\+41|0)([1-9])\d{1,9}$/, + "de-LU": /^(\+352)?((6\d1)\d{6})$/, + "dv-MV": /^(\+?960)?(7[2-9]|9[1-9])\d{5}$/, + "el-GR": /^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/, + "el-CY": /^(\+?357?)?(9(9|6)\d{6})$/, + "en-AI": /^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/, + "en-AU": /^(\+?61|0)4\d{8}$/, + "en-AG": /^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/, + "en-BM": /^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/, + "en-BS": /^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/, + "en-GB": /^(\+?44|0)7\d{9}$/, + "en-GG": /^(\+?44|0)1481\d{6}$/, + "en-GH": /^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/, + "en-GY": /^(\+592|0)6\d{6}$/, + "en-HK": /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/, + "en-MO": /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/, + "en-IE": /^(\+?353|0)8[356789]\d{7}$/, + "en-IN": /^(\+?91|0)?[6789]\d{9}$/, + "en-JM": /^(\+?876)?\d{7}$/, + "en-KE": /^(\+?254|0)(7|1)\d{8}$/, + "fr-CF": /^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/, + "en-SS": /^(\+?211|0)(9[1257])\d{7}$/, + "en-KI": /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/, + "en-KN": /^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/, + "en-LS": /^(\+?266)(22|28|57|58|59|27|52)\d{6}$/, + "en-MT": /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/, + "en-MU": /^(\+?230|0)?\d{8}$/, + "en-MW": /^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/, + "en-NA": /^(\+?264|0)(6|8)\d{7}$/, + "en-NG": /^(\+?234|0)?[789]\d{9}$/, + "en-NZ": /^(\+?64|0)[28]\d{7,9}$/, + "en-PG": /^(\+?675|0)?(7\d|8[18])\d{6}$/, + "en-PK": /^((00|\+)?92|0)3[0-6]\d{8}$/, + "en-PH": /^(09|\+639)\d{9}$/, + "en-RW": /^(\+?250|0)?[7]\d{8}$/, + "en-SG": /^(\+65)?[3689]\d{7}$/, + "en-SL": /^(\+?232|0)\d{8}$/, + "en-TZ": /^(\+?255|0)?[67]\d{8}$/, + "en-UG": /^(\+?256|0)?[7]\d{8}$/, + "en-US": /^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/, + "en-ZA": /^(\+?27|0)\d{9}$/, + "en-ZM": /^(\+?26)?09[567]\d{7}$/, + "en-ZW": /^(\+263)[0-9]{9}$/, + "en-BW": /^(\+?267)?(7[1-8]{1})\d{6}$/, + "es-AR": /^\+?549(11|[2368]\d)\d{8}$/, + "es-BO": /^(\+?591)?(6|7)\d{7}$/, + "es-CO": /^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/, + "es-CL": /^(\+?56|0)[2-9]\d{1}\d{7}$/, + "es-CR": /^(\+506)?[2-8]\d{7}$/, + "es-CU": /^(\+53|0053)?5\d{7}$/, + "es-DO": /^(\+?1)?8[024]9\d{7}$/, + "es-HN": /^(\+?504)?[9|8|3|2]\d{7}$/, + "es-EC": /^(\+?593|0)([2-7]|9[2-9])\d{7}$/, + "es-ES": /^(\+?34)?[6|7]\d{8}$/, + "es-PE": /^(\+?51)?9\d{8}$/, + "es-MX": /^(\+?52)?(1|01)?\d{10,11}$/, + "es-NI": /^(\+?505)\d{7,8}$/, + "es-PA": /^(\+?507)\d{7,8}$/, + "es-PY": /^(\+?595|0)9[9876]\d{7}$/, + "es-SV": /^(\+?503)?[67]\d{7}$/, + "es-UY": /^(\+598|0)9[1-9][\d]{6}$/, + "es-VE": /^(\+?58)?(2|4)\d{9}$/, + "et-EE": /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/, + "fa-IR": /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/, + "fi-FI": /^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/, + "fj-FJ": /^(\+?679)?\s?\d{3}\s?\d{4}$/, + "fo-FO": /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/, + "fr-BF": /^(\+226|0)[67]\d{7}$/, + "fr-BJ": /^(\+229)\d{8}$/, + "fr-CD": /^(\+?243|0)?(8|9)\d{8}$/, + "fr-CM": /^(\+?237)6[0-9]{8}$/, + "fr-FR": /^(\+?33|0)[67]\d{8}$/, + "fr-GF": /^(\+?594|0|00594)[67]\d{8}$/, + "fr-GP": /^(\+?590|0|00590)[67]\d{8}$/, + "fr-MQ": /^(\+?596|0|00596)[67]\d{8}$/, + "fr-PF": /^(\+?689)?8[789]\d{6}$/, + "fr-RE": /^(\+?262|0|00262)[67]\d{8}$/, + "fr-WF": /^(\+681)?\d{6}$/, + "he-IL": /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/, + "hu-HU": /^(\+?36|06)(20|30|31|50|70)\d{7}$/, + "id-ID": /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/, + "ir-IR": /^(\+98|0)?9\d{9}$/, + "it-IT": /^(\+?39)?\s?3\d{2} ?\d{6,7}$/, + "it-SM": /^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/, + "ja-JP": /^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/, + "ka-GE": /^(\+?995)?(79\d{7}|5\d{8})$/, + "kk-KZ": /^(\+?7|8)?7\d{9}$/, + "kl-GL": /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/, + "ko-KR": /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/, + "ky-KG": /^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/, + "lt-LT": /^(\+370|8)\d{8}$/, + "lv-LV": /^(\+?371)2\d{7}$/, + "mg-MG": /^((\+?261|0)(2|3)\d)?\d{7}$/, + "mn-MN": /^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/, + "my-MM": /^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/, + "ms-MY": /^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/, + "mz-MZ": /^(\+?258)?8[234567]\d{7}$/, + "nb-NO": /^(\+?47)?[49]\d{7}$/, + "ne-NP": /^(\+?977)?9[78]\d{8}$/, + "nl-BE": /^(\+?32|0)4\d{8}$/, + "nl-NL": /^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/, + "nl-AW": /^(\+)?297(56|59|64|73|74|99)\d{5}$/, + "nn-NO": /^(\+?47)?[49]\d{7}$/, + "pl-PL": /^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/, + "pt-BR": /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/, + "pt-PT": /^(\+?351)?9[1236]\d{7}$/, + "pt-AO": /^(\+244)\d{9}$/, + "ro-MD": /^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/, + "ro-RO": /^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/, + "ru-RU": /^(\+?7|8)?9\d{9}$/, + "si-LK": /^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/, + "sl-SI": /^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/, + "sk-SK": /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/, + "so-SO": /^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/, + "sq-AL": /^(\+355|0)6[789]\d{6}$/, + "sr-RS": /^(\+3816|06)[- \d]{5,9}$/, + "sv-SE": /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/, + "tg-TJ": /^(\+?992)?[5][5]\d{7}$/, + "th-TH": /^(\+66|66|0)\d{9}$/, + "tr-TR": /^(\+?90|0)?5\d{9}$/, + "tk-TM": /^(\+993|993|8)\d{8}$/, + "uk-UA": /^(\+?38|8)?0\d{9}$/, + "uz-UZ": /^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/, + "vi-VN": /^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/, + "zh-CN": /^((\+|00)86)?(1[3-9]|9[28])\d{9}$/, + "zh-TW": /^(\+?886\-?|0)?9\d{8}$/, + "dz-BT": /^(\+?975|0)?(17|16|77|02)\d{6}$/, + "ar-YE": /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/, + "ar-EH": /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/, + "fa-AF": /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/ +}; +phones["en-CA"] = phones["en-US"]; +phones["fr-CA"] = phones["en-CA"]; +phones["fr-BE"] = phones["nl-BE"]; +phones["zh-HK"] = phones["en-HK"]; +phones["zh-MO"] = phones["en-MO"]; +phones["ga-IE"] = phones["en-IE"]; +phones["fr-CH"] = phones["de-CH"]; +phones["it-CH"] = phones["fr-CH"]; +function isMobilePhone(str, locale, options) { + (0, _assertString$4.default)(str); + if (options && options.strictMode && !str.startsWith("+")) { + return false; + } + if (Array.isArray(locale)) { + return locale.some(function(key3) { + if (phones.hasOwnProperty(key3)) { + var phone2 = phones[key3]; + if (phone2.test(str)) { + return true; + } + } + return false; + }); + } else if (locale in phones) { + return phones[locale].test(str); + } else if (!locale || locale === "any") { + for (var key2 in phones) { + if (phones.hasOwnProperty(key2)) { + var phone = phones[key2]; + if (phone.test(str)) { + return true; + } + } + } + return false; + } + throw new Error("Invalid locale '".concat(locale, "'")); +} +isMobilePhone$1.locales = Object.keys(phones); +var isEthereumAddress = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isEthereumAddress2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var eth = /^(0x)[0-9a-f]{40}$/i; + function isEthereumAddress2(str) { + (0, _assertString2.default)(str); + return eth.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isEthereumAddress, isEthereumAddress.exports); +var isEthereumAddressExports = isEthereumAddress.exports; +var isCurrency = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isCurrency2; + var _merge = _interopRequireDefault2(mergeExports); + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function currencyRegex(options) { + var decimal_digits = "\\d{".concat(options.digits_after_decimal[0], "}"); + options.digits_after_decimal.forEach(function(digit, index2) { + if (index2 !== 0) + decimal_digits = "".concat(decimal_digits, "|\\d{").concat(digit, "}"); + }); + var symbol = "(".concat(options.symbol.replace(/\W/, function(m3) { + return "\\".concat(m3); + }), ")").concat(options.require_symbol ? "" : "?"), negative = "-?", whole_dollar_amount_without_sep = "[1-9]\\d*", whole_dollar_amount_with_sep = "[1-9]\\d{0,2}(\\".concat(options.thousands_separator, "\\d{3})*"), valid_whole_dollar_amounts = ["0", whole_dollar_amount_without_sep, whole_dollar_amount_with_sep], whole_dollar_amount = "(".concat(valid_whole_dollar_amounts.join("|"), ")?"), decimal_amount = "(\\".concat(options.decimal_separator, "(").concat(decimal_digits, "))").concat(options.require_decimal ? "" : "?"); + var pattern = whole_dollar_amount + (options.allow_decimal || options.require_decimal ? decimal_amount : ""); + if (options.allow_negatives && !options.parens_for_negatives) { + if (options.negative_sign_after_digits) { + pattern += negative; + } else if (options.negative_sign_before_digits) { + pattern = negative + pattern; + } + } + if (options.allow_negative_sign_placeholder) { + pattern = "( (?!\\-))?".concat(pattern); + } else if (options.allow_space_after_symbol) { + pattern = " ?".concat(pattern); + } else if (options.allow_space_after_digits) { + pattern += "( (?!$))?"; + } + if (options.symbol_after_digits) { + pattern += symbol; + } else { + pattern = symbol + pattern; + } + if (options.allow_negatives) { + if (options.parens_for_negatives) { + pattern = "(\\(".concat(pattern, "\\)|").concat(pattern, ")"); + } else if (!(options.negative_sign_before_digits || options.negative_sign_after_digits)) { + pattern = negative + pattern; + } + } + return new RegExp("^(?!-? )(?=.*\\d)".concat(pattern, "$")); + } + var default_currency_options = { + symbol: "$", + require_symbol: false, + allow_space_after_symbol: false, + symbol_after_digits: false, + allow_negatives: true, + parens_for_negatives: false, + negative_sign_before_digits: false, + negative_sign_after_digits: false, + allow_negative_sign_placeholder: false, + thousands_separator: ",", + decimal_separator: ".", + allow_decimal: true, + require_decimal: false, + digits_after_decimal: [2], + allow_space_after_digits: false + }; + function isCurrency2(str, options) { + (0, _assertString2.default)(str); + options = (0, _merge.default)(options, default_currency_options); + return currencyRegex(options).test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isCurrency, isCurrency.exports); +var isCurrencyExports = isCurrency.exports; +var isBtcAddress = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isBtcAddress2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var bech32 = /^(bc1)[a-z0-9]{25,39}$/; + var base582 = /^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/; + function isBtcAddress2(str) { + (0, _assertString2.default)(str); + return bech32.test(str) || base582.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isBtcAddress, isBtcAddress.exports); +var isBtcAddressExports = isBtcAddress.exports; +var isISO6346$1 = {}; +Object.defineProperty(isISO6346$1, "__esModule", { + value: true +}); +isISO6346$1.isFreightContainerID = void 0; +isISO6346$1.isISO6346 = isISO6346; +var _assertString$3 = _interopRequireDefault$3(assertStringExports); +function _interopRequireDefault$3(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +var isISO6346Str = /^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/; +var isDigit = /^[0-9]$/; +function isISO6346(str) { + (0, _assertString$3.default)(str); + str = str.toUpperCase(); + if (!isISO6346Str.test(str)) + return false; + if (str.length === 11) { + var sum = 0; + for (var i2 = 0; i2 < str.length - 1; i2++) { + if (!isDigit.test(str[i2])) { + var convertedCode = void 0; + var letterCode = str.charCodeAt(i2) - 55; + if (letterCode < 11) + convertedCode = letterCode; + else if (letterCode >= 11 && letterCode <= 20) + convertedCode = 12 + letterCode % 11; + else if (letterCode >= 21 && letterCode <= 30) + convertedCode = 23 + letterCode % 21; + else + convertedCode = 34 + letterCode % 31; + sum += convertedCode * Math.pow(2, i2); + } else + sum += str[i2] * Math.pow(2, i2); + } + var checkSumDigit = sum % 11; + return Number(str[str.length - 1]) === checkSumDigit; + } + return true; +} +isISO6346$1.isFreightContainerID = isISO6346; +var isISO6391 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isISO63912; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var isISO6391Set = /* @__PURE__ */ new Set(["aa", "ab", "ae", "af", "ak", "am", "an", "ar", "as", "av", "ay", "az", "az", "ba", "be", "bg", "bh", "bi", "bm", "bn", "bo", "br", "bs", "ca", "ce", "ch", "co", "cr", "cs", "cu", "cv", "cy", "da", "de", "dv", "dz", "ee", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fj", "fo", "fr", "fy", "ga", "gd", "gl", "gn", "gu", "gv", "ha", "he", "hi", "ho", "hr", "ht", "hu", "hy", "hz", "ia", "id", "ie", "ig", "ii", "ik", "io", "is", "it", "iu", "ja", "jv", "ka", "kg", "ki", "kj", "kk", "kl", "km", "kn", "ko", "kr", "ks", "ku", "kv", "kw", "ky", "la", "lb", "lg", "li", "ln", "lo", "lt", "lu", "lv", "mg", "mh", "mi", "mk", "ml", "mn", "mr", "ms", "mt", "my", "na", "nb", "nd", "ne", "ng", "nl", "nn", "no", "nr", "nv", "ny", "oc", "oj", "om", "or", "os", "pa", "pi", "pl", "ps", "pt", "qu", "rm", "rn", "ro", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm", "sn", "so", "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", "tg", "th", "ti", "tk", "tl", "tn", "to", "tr", "ts", "tt", "tw", "ty", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "wo", "xh", "yi", "yo", "za", "zh", "zu"]); + function isISO63912(str) { + (0, _assertString2.default)(str); + return isISO6391Set.has(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isISO6391, isISO6391.exports); +var isISO6391Exports = isISO6391.exports; +var isISO8601 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isISO86012; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var iso8601 = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; + var iso8601StrictSeparator = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; + var isValidDate = function isValidDate2(str) { + var ordinalMatch = str.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/); + if (ordinalMatch) { + var oYear = Number(ordinalMatch[1]); + var oDay = Number(ordinalMatch[2]); + if (oYear % 4 === 0 && oYear % 100 !== 0 || oYear % 400 === 0) + return oDay <= 366; + return oDay <= 365; + } + var match = str.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number); + var year = match[1]; + var month = match[2]; + var day = match[3]; + var monthString = month ? "0".concat(month).slice(-2) : month; + var dayString = day ? "0".concat(day).slice(-2) : day; + var d4 = new Date("".concat(year, "-").concat(monthString || "01", "-").concat(dayString || "01")); + if (month && day) { + return d4.getUTCFullYear() === year && d4.getUTCMonth() + 1 === month && d4.getUTCDate() === day; + } + return true; + }; + function isISO86012(str) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + (0, _assertString2.default)(str); + var check = options.strictSeparator ? iso8601StrictSeparator.test(str) : iso8601.test(str); + if (check && options.strict) + return isValidDate(str); + return check; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isISO8601, isISO8601.exports); +var isISO8601Exports = isISO8601.exports; +var isRFC3339 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isRFC33392; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var dateFullYear = /[0-9]{4}/; + var dateMonth = /(0[1-9]|1[0-2])/; + var dateMDay = /([12]\d|0[1-9]|3[01])/; + var timeHour = /([01][0-9]|2[0-3])/; + var timeMinute = /[0-5][0-9]/; + var timeSecond = /([0-5][0-9]|60)/; + var timeSecFrac = /(\.[0-9]+)?/; + var timeNumOffset = new RegExp("[-+]".concat(timeHour.source, ":").concat(timeMinute.source)); + var timeOffset = new RegExp("([zZ]|".concat(timeNumOffset.source, ")")); + var partialTime = new RegExp("".concat(timeHour.source, ":").concat(timeMinute.source, ":").concat(timeSecond.source).concat(timeSecFrac.source)); + var fullDate = new RegExp("".concat(dateFullYear.source, "-").concat(dateMonth.source, "-").concat(dateMDay.source)); + var fullTime = new RegExp("".concat(partialTime.source).concat(timeOffset.source)); + var rfc3339 = new RegExp("^".concat(fullDate.source, "[ tT]").concat(fullTime.source, "$")); + function isRFC33392(str) { + (0, _assertString2.default)(str); + return rfc3339.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isRFC3339, isRFC3339.exports); +var isRFC3339Exports = isRFC3339.exports; +var isISO31661Alpha3 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isISO31661Alpha32; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var validISO31661Alpha3CountriesCodes = /* @__PURE__ */ new Set(["AFG", "ALA", "ALB", "DZA", "ASM", "AND", "AGO", "AIA", "ATA", "ATG", "ARG", "ARM", "ABW", "AUS", "AUT", "AZE", "BHS", "BHR", "BGD", "BRB", "BLR", "BEL", "BLZ", "BEN", "BMU", "BTN", "BOL", "BES", "BIH", "BWA", "BVT", "BRA", "IOT", "BRN", "BGR", "BFA", "BDI", "KHM", "CMR", "CAN", "CPV", "CYM", "CAF", "TCD", "CHL", "CHN", "CXR", "CCK", "COL", "COM", "COG", "COD", "COK", "CRI", "CIV", "HRV", "CUB", "CUW", "CYP", "CZE", "DNK", "DJI", "DMA", "DOM", "ECU", "EGY", "SLV", "GNQ", "ERI", "EST", "ETH", "FLK", "FRO", "FJI", "FIN", "FRA", "GUF", "PYF", "ATF", "GAB", "GMB", "GEO", "DEU", "GHA", "GIB", "GRC", "GRL", "GRD", "GLP", "GUM", "GTM", "GGY", "GIN", "GNB", "GUY", "HTI", "HMD", "VAT", "HND", "HKG", "HUN", "ISL", "IND", "IDN", "IRN", "IRQ", "IRL", "IMN", "ISR", "ITA", "JAM", "JPN", "JEY", "JOR", "KAZ", "KEN", "KIR", "PRK", "KOR", "KWT", "KGZ", "LAO", "LVA", "LBN", "LSO", "LBR", "LBY", "LIE", "LTU", "LUX", "MAC", "MKD", "MDG", "MWI", "MYS", "MDV", "MLI", "MLT", "MHL", "MTQ", "MRT", "MUS", "MYT", "MEX", "FSM", "MDA", "MCO", "MNG", "MNE", "MSR", "MAR", "MOZ", "MMR", "NAM", "NRU", "NPL", "NLD", "NCL", "NZL", "NIC", "NER", "NGA", "NIU", "NFK", "MNP", "NOR", "OMN", "PAK", "PLW", "PSE", "PAN", "PNG", "PRY", "PER", "PHL", "PCN", "POL", "PRT", "PRI", "QAT", "REU", "ROU", "RUS", "RWA", "BLM", "SHN", "KNA", "LCA", "MAF", "SPM", "VCT", "WSM", "SMR", "STP", "SAU", "SEN", "SRB", "SYC", "SLE", "SGP", "SXM", "SVK", "SVN", "SLB", "SOM", "ZAF", "SGS", "SSD", "ESP", "LKA", "SDN", "SUR", "SJM", "SWZ", "SWE", "CHE", "SYR", "TWN", "TJK", "TZA", "THA", "TLS", "TGO", "TKL", "TON", "TTO", "TUN", "TUR", "TKM", "TCA", "TUV", "UGA", "UKR", "ARE", "GBR", "USA", "UMI", "URY", "UZB", "VUT", "VEN", "VNM", "VGB", "VIR", "WLF", "ESH", "YEM", "ZMB", "ZWE"]); + function isISO31661Alpha32(str) { + (0, _assertString2.default)(str); + return validISO31661Alpha3CountriesCodes.has(str.toUpperCase()); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isISO31661Alpha3, isISO31661Alpha3.exports); +var isISO31661Alpha3Exports = isISO31661Alpha3.exports; +var isISO4217$1 = {}; +Object.defineProperty(isISO4217$1, "__esModule", { + value: true +}); +isISO4217$1.CurrencyCodes = void 0; +isISO4217$1.default = isISO4217; +var _assertString$2 = _interopRequireDefault$2(assertStringExports); +function _interopRequireDefault$2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +var validISO4217CurrencyCodes = /* @__PURE__ */ new Set(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLE", "SLL", "SOS", "SRD", "SSP", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", "YER", "ZAR", "ZMW", "ZWL"]); +function isISO4217(str) { + (0, _assertString$2.default)(str); + return validISO4217CurrencyCodes.has(str.toUpperCase()); +} +isISO4217$1.CurrencyCodes = validISO4217CurrencyCodes; +var isBase32 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isBase322; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var base322 = /^[A-Z2-7]+=*$/; + var crockfordBase32 = /^[A-HJKMNP-TV-Z0-9]+$/; + var defaultBase32Options = { + crockford: false + }; + function isBase322(str, options) { + (0, _assertString2.default)(str); + options = (0, _merge.default)(options, defaultBase32Options); + if (options.crockford) { + return crockfordBase32.test(str); + } + var len = str.length; + if (len % 8 === 0 && base322.test(str)) { + return true; + } + return false; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isBase32, isBase32.exports); +var isBase32Exports = isBase32.exports; +var isBase58 = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isBase582; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var base58Reg = /^[A-HJ-NP-Za-km-z1-9]*$/; + function isBase582(str) { + (0, _assertString2.default)(str); + if (base58Reg.test(str)) { + return true; + } + return false; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isBase58, isBase58.exports); +var isBase58Exports = isBase58.exports; +var isDataURI = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isDataURI2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var validMediaType = /^[a-z]+\/[a-z0-9\-\+\._]+$/i; + var validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i; + var validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i; + function isDataURI2(str) { + (0, _assertString2.default)(str); + var data = str.split(","); + if (data.length < 2) { + return false; + } + var attributes = data.shift().trim().split(";"); + var schemeAndMediaType = attributes.shift(); + if (schemeAndMediaType.slice(0, 5) !== "data:") { + return false; + } + var mediaType = schemeAndMediaType.slice(5); + if (mediaType !== "" && !validMediaType.test(mediaType)) { + return false; + } + for (var i2 = 0; i2 < attributes.length; i2++) { + if (!(i2 === attributes.length - 1 && attributes[i2].toLowerCase() === "base64") && !validAttribute.test(attributes[i2])) { + return false; + } + } + for (var _i2 = 0; _i2 < data.length; _i2++) { + if (!validData.test(data[_i2])) { + return false; + } + } + return true; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isDataURI, isDataURI.exports); +var isDataURIExports = isDataURI.exports; +var isMagnetURI = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isMagnetURI2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var magnetURIComponent = /(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i; + function isMagnetURI2(url) { + (0, _assertString2.default)(url); + if (url.indexOf("magnet:?") !== 0) { + return false; + } + return magnetURIComponent.test(url); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isMagnetURI, isMagnetURI.exports); +var isMagnetURIExports = isMagnetURI.exports; +var isMailtoURI = { exports: {} }; +var trim$1 = { exports: {} }; +var rtrim = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = rtrim2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function rtrim2(str, chars) { + (0, _assertString2.default)(str); + if (chars) { + var pattern = new RegExp("[".concat(chars.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "]+$"), "g"); + return str.replace(pattern, ""); + } + var strIndex = str.length - 1; + while (/\s/.test(str.charAt(strIndex))) { + strIndex -= 1; + } + return str.slice(0, strIndex + 1); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(rtrim, rtrim.exports); +var rtrimExports = rtrim.exports; +var ltrim = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = ltrim2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function ltrim2(str, chars) { + (0, _assertString2.default)(str); + var pattern = chars ? new RegExp("^[".concat(chars.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "]+"), "g") : /^\s+/g; + return str.replace(pattern, ""); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(ltrim, ltrim.exports); +var ltrimExports = ltrim.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = trim2; + var _rtrim = _interopRequireDefault2(rtrimExports); + var _ltrim = _interopRequireDefault2(ltrimExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function trim2(str, chars) { + return (0, _rtrim.default)((0, _ltrim.default)(str, chars), chars); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(trim$1, trim$1.exports); +var trimExports = trim$1.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isMailtoURI2; + var _trim = _interopRequireDefault2(trimExports); + var _isEmail = _interopRequireDefault2(isEmailExports); + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _slicedToArray(arr, i2) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest(); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _iterableToArrayLimit(r2, l2) { + var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"]; + if (null != t2) { + var e18, n5, i2, u2, a3 = [], f4 = true, o2 = false; + try { + if (i2 = (t2 = t2.call(r2)).next, 0 === l2) { + if (Object(t2) !== t2) + return; + f4 = false; + } else + for (; !(f4 = (e18 = i2.call(t2)).done) && (a3.push(e18.value), a3.length !== l2); f4 = true) + ; + } catch (r3) { + o2 = true, n5 = r3; + } finally { + try { + if (!f4 && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) + return; + } finally { + if (o2) + throw n5; + } + } + return a3; + } + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) + return arr; + } + function _createForOfIteratorHelper(o2, allowArrayLike) { + var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"]; + if (!it2) { + if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray(o2)) || allowArrayLike && o2 && typeof o2.length === "number") { + if (it2) + o2 = it2; + var i2 = 0; + var F2 = function F3() { + }; + return { s: F2, n: function n5() { + if (i2 >= o2.length) + return { done: true }; + return { done: false, value: o2[i2++] }; + }, e: function e18(_e3) { + throw _e3; + }, f: F2 }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, didErr = false, err; + return { s: function s2() { + it2 = it2.call(o2); + }, n: function n5() { + var step = it2.next(); + normalCompletion = step.done; + return step; + }, e: function e18(_e22) { + didErr = true; + err = _e22; + }, f: function f4() { + try { + if (!normalCompletion && it2.return != null) + it2.return(); + } finally { + if (didErr) + throw err; + } + } }; + } + function _unsupportedIterableToArray(o2, minLen) { + if (!o2) + return; + if (typeof o2 === "string") + return _arrayLikeToArray(o2, minLen); + var n5 = Object.prototype.toString.call(o2).slice(8, -1); + if (n5 === "Object" && o2.constructor) + n5 = o2.constructor.name; + if (n5 === "Map" || n5 === "Set") + return Array.from(o2); + if (n5 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n5)) + return _arrayLikeToArray(o2, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) + arr2[i2] = arr[i2]; + return arr2; + } + function parseMailtoQueryString(queryString2) { + var allowedParams = /* @__PURE__ */ new Set(["subject", "body", "cc", "bcc"]), query = { + cc: "", + bcc: "" + }; + var isParseFailed = false; + var queryParams = queryString2.split("&"); + if (queryParams.length > 4) { + return false; + } + var _iterator = _createForOfIteratorHelper(queryParams), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var q2 = _step.value; + var _q$split = q2.split("="), _q$split2 = _slicedToArray(_q$split, 2), key2 = _q$split2[0], value = _q$split2[1]; + if (key2 && !allowedParams.has(key2)) { + isParseFailed = true; + break; + } + if (value && (key2 === "cc" || key2 === "bcc")) { + query[key2] = value; + } + if (key2) { + allowedParams.delete(key2); + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + return isParseFailed ? false : query; + } + function isMailtoURI2(url, options) { + (0, _assertString2.default)(url); + if (url.indexOf("mailto:") !== 0) { + return false; + } + var _url$replace$split = url.replace("mailto:", "").split("?"), _url$replace$split2 = _slicedToArray(_url$replace$split, 2), to2 = _url$replace$split2[0], _url$replace$split2$ = _url$replace$split2[1], queryString2 = _url$replace$split2$ === void 0 ? "" : _url$replace$split2$; + if (!to2 && !queryString2) { + return true; + } + var query = parseMailtoQueryString(queryString2); + if (!query) { + return false; + } + return "".concat(to2, ",").concat(query.cc, ",").concat(query.bcc).split(",").every(function(email) { + email = (0, _trim.default)(email, " "); + if (email) { + return (0, _isEmail.default)(email, options); + } + return true; + }); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isMailtoURI, isMailtoURI.exports); +var isMailtoURIExports = isMailtoURI.exports; +var isMimeType = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isMimeType2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var mimeTypeSimple = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i; + var mimeTypeText = /^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i; + var mimeTypeMultipart = /^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i; + function isMimeType2(str) { + (0, _assertString2.default)(str); + return mimeTypeSimple.test(str) || mimeTypeText.test(str) || mimeTypeMultipart.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isMimeType, isMimeType.exports); +var isMimeTypeExports = isMimeType.exports; +var isLatLong = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isLatLong2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var lat = /^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/; + var long = /^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/; + var latDMS = /^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i; + var longDMS = /^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i; + var defaultLatLongOptions = { + checkDMS: false + }; + function isLatLong2(str, options) { + (0, _assertString2.default)(str); + options = (0, _merge.default)(options, defaultLatLongOptions); + if (!str.includes(",")) + return false; + var pair = str.split(","); + if (pair[0].startsWith("(") && !pair[1].endsWith(")") || pair[1].endsWith(")") && !pair[0].startsWith("(")) + return false; + if (options.checkDMS) { + return latDMS.test(pair[0]) && longDMS.test(pair[1]); + } + return lat.test(pair[0]) && long.test(pair[1]); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isLatLong, isLatLong.exports); +var isLatLongExports = isLatLong.exports; +var isPostalCode$1 = {}; +Object.defineProperty(isPostalCode$1, "__esModule", { + value: true +}); +isPostalCode$1.default = isPostalCode; +isPostalCode$1.locales = void 0; +var _assertString$1 = _interopRequireDefault$1(assertStringExports); +function _interopRequireDefault$1(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +var threeDigit = /^\d{3}$/; +var fourDigit = /^\d{4}$/; +var fiveDigit = /^\d{5}$/; +var sixDigit = /^\d{6}$/; +var patterns = { + AD: /^AD\d{3}$/, + AT: fourDigit, + AU: fourDigit, + AZ: /^AZ\d{4}$/, + BA: /^([7-8]\d{4}$)/, + BE: fourDigit, + BG: fourDigit, + BR: /^\d{5}-\d{3}$/, + BY: /^2[1-4]\d{4}$/, + CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i, + CH: fourDigit, + CN: /^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/, + CZ: /^\d{3}\s?\d{2}$/, + DE: fiveDigit, + DK: fourDigit, + DO: fiveDigit, + DZ: fiveDigit, + EE: fiveDigit, + ES: /^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/, + FI: fiveDigit, + FR: /^\d{2}\s?\d{3}$/, + GB: /^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i, + GR: /^\d{3}\s?\d{2}$/, + HR: /^([1-5]\d{4}$)/, + HT: /^HT\d{4}$/, + HU: fourDigit, + ID: fiveDigit, + IE: /^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i, + IL: /^(\d{5}|\d{7})$/, + IN: /^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/, + IR: /^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/, + IS: threeDigit, + IT: fiveDigit, + JP: /^\d{3}\-\d{4}$/, + KE: fiveDigit, + KR: /^(\d{5}|\d{6})$/, + LI: /^(948[5-9]|949[0-7])$/, + LT: /^LT\-\d{5}$/, + LU: fourDigit, + LV: /^LV\-\d{4}$/, + LK: fiveDigit, + MG: threeDigit, + MX: fiveDigit, + MT: /^[A-Za-z]{3}\s{0,1}\d{4}$/, + MY: fiveDigit, + NL: /^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i, + NO: fourDigit, + NP: /^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i, + NZ: fourDigit, + PL: /^\d{2}\-\d{3}$/, + PR: /^00[679]\d{2}([ -]\d{4})?$/, + PT: /^\d{4}\-\d{3}?$/, + RO: sixDigit, + RU: sixDigit, + SA: fiveDigit, + SE: /^[1-9]\d{2}\s?\d{2}$/, + SG: sixDigit, + SI: fourDigit, + SK: /^\d{3}\s?\d{2}$/, + TH: fiveDigit, + TN: fourDigit, + TW: /^\d{3}(\d{2})?$/, + UA: fiveDigit, + US: /^\d{5}(-\d{4})?$/, + ZA: fourDigit, + ZM: fiveDigit +}; +isPostalCode$1.locales = Object.keys(patterns); +function isPostalCode(str, locale) { + (0, _assertString$1.default)(str); + if (locale in patterns) { + return patterns[locale].test(str); + } else if (locale === "any") { + for (var key2 in patterns) { + if (patterns.hasOwnProperty(key2)) { + var pattern = patterns[key2]; + if (pattern.test(str)) { + return true; + } + } + } + return false; + } + throw new Error("Invalid locale '".concat(locale, "'")); +} +var _escape = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = escape2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function escape2(str) { + (0, _assertString2.default)(str); + return str.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(//g, ">").replace(/\//g, "/").replace(/\\/g, "\").replace(/`/g, "`"); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(_escape, _escape.exports); +var _escapeExports = _escape.exports; +var _unescape = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = unescape2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function unescape2(str) { + (0, _assertString2.default)(str); + return str.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(///g, "/").replace(/\/g, "\\").replace(/`/g, "`").replace(/&/g, "&"); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(_unescape, _unescape.exports); +var _unescapeExports = _unescape.exports; +var stripLow = { exports: {} }; +var blacklist = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = blacklist2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function blacklist2(str, chars) { + (0, _assertString2.default)(str); + return str.replace(new RegExp("[".concat(chars, "]+"), "g"), ""); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(blacklist, blacklist.exports); +var blacklistExports = blacklist.exports; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = stripLow2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + var _blacklist = _interopRequireDefault2(blacklistExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function stripLow2(str, keep_new_lines) { + (0, _assertString2.default)(str); + var chars = keep_new_lines ? "\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F" : "\\x00-\\x1F\\x7F"; + return (0, _blacklist.default)(str, chars); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(stripLow, stripLow.exports); +var stripLowExports = stripLow.exports; +var whitelist = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = whitelist2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function whitelist2(str, chars) { + (0, _assertString2.default)(str); + return str.replace(new RegExp("[^".concat(chars, "]+"), "g"), ""); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(whitelist, whitelist.exports); +var whitelistExports = whitelist.exports; +var isWhitelisted = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isWhitelisted2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isWhitelisted2(str, chars) { + (0, _assertString2.default)(str); + for (var i2 = str.length - 1; i2 >= 0; i2--) { + if (chars.indexOf(str[i2]) === -1) { + return false; + } + } + return true; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isWhitelisted, isWhitelisted.exports); +var isWhitelistedExports = isWhitelisted.exports; +var normalizeEmail = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = normalizeEmail2; + var _merge = _interopRequireDefault2(mergeExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var default_normalize_email_options = { + // The following options apply to all email addresses + // Lowercases the local part of the email address. + // Please note this may violate RFC 5321 as per http://stackoverflow.com/a/9808332/192024). + // The domain is always lowercased, as per RFC 1035 + all_lowercase: true, + // The following conversions are specific to GMail + // Lowercases the local part of the GMail address (known to be case-insensitive) + gmail_lowercase: true, + // Removes dots from the local part of the email address, as that's ignored by GMail + gmail_remove_dots: true, + // Removes the subaddress (e.g. "+foo") from the email address + gmail_remove_subaddress: true, + // Conversts the googlemail.com domain to gmail.com + gmail_convert_googlemaildotcom: true, + // The following conversions are specific to Outlook.com / Windows Live / Hotmail + // Lowercases the local part of the Outlook.com address (known to be case-insensitive) + outlookdotcom_lowercase: true, + // Removes the subaddress (e.g. "+foo") from the email address + outlookdotcom_remove_subaddress: true, + // The following conversions are specific to Yahoo + // Lowercases the local part of the Yahoo address (known to be case-insensitive) + yahoo_lowercase: true, + // Removes the subaddress (e.g. "-foo") from the email address + yahoo_remove_subaddress: true, + // The following conversions are specific to Yandex + // Lowercases the local part of the Yandex address (known to be case-insensitive) + yandex_lowercase: true, + // The following conversions are specific to iCloud + // Lowercases the local part of the iCloud address (known to be case-insensitive) + icloud_lowercase: true, + // Removes the subaddress (e.g. "+foo") from the email address + icloud_remove_subaddress: true + }; + var icloud_domains = ["icloud.com", "me.com"]; + var outlookdotcom_domains = ["hotmail.at", "hotmail.be", "hotmail.ca", "hotmail.cl", "hotmail.co.il", "hotmail.co.nz", "hotmail.co.th", "hotmail.co.uk", "hotmail.com", "hotmail.com.ar", "hotmail.com.au", "hotmail.com.br", "hotmail.com.gr", "hotmail.com.mx", "hotmail.com.pe", "hotmail.com.tr", "hotmail.com.vn", "hotmail.cz", "hotmail.de", "hotmail.dk", "hotmail.es", "hotmail.fr", "hotmail.hu", "hotmail.id", "hotmail.ie", "hotmail.in", "hotmail.it", "hotmail.jp", "hotmail.kr", "hotmail.lv", "hotmail.my", "hotmail.ph", "hotmail.pt", "hotmail.sa", "hotmail.sg", "hotmail.sk", "live.be", "live.co.uk", "live.com", "live.com.ar", "live.com.mx", "live.de", "live.es", "live.eu", "live.fr", "live.it", "live.nl", "msn.com", "outlook.at", "outlook.be", "outlook.cl", "outlook.co.il", "outlook.co.nz", "outlook.co.th", "outlook.com", "outlook.com.ar", "outlook.com.au", "outlook.com.br", "outlook.com.gr", "outlook.com.pe", "outlook.com.tr", "outlook.com.vn", "outlook.cz", "outlook.de", "outlook.dk", "outlook.es", "outlook.fr", "outlook.hu", "outlook.id", "outlook.ie", "outlook.in", "outlook.it", "outlook.jp", "outlook.kr", "outlook.lv", "outlook.my", "outlook.ph", "outlook.pt", "outlook.sa", "outlook.sg", "outlook.sk", "passport.com"]; + var yahoo_domains = ["rocketmail.com", "yahoo.ca", "yahoo.co.uk", "yahoo.com", "yahoo.de", "yahoo.fr", "yahoo.in", "yahoo.it", "ymail.com"]; + var yandex_domains = ["yandex.ru", "yandex.ua", "yandex.kz", "yandex.com", "yandex.by", "ya.ru"]; + function dotsReplacer(match) { + if (match.length > 1) { + return match; + } + return ""; + } + function normalizeEmail2(email, options) { + options = (0, _merge.default)(options, default_normalize_email_options); + var raw_parts = email.split("@"); + var domain = raw_parts.pop(); + var user = raw_parts.join("@"); + var parts = [user, domain]; + parts[1] = parts[1].toLowerCase(); + if (parts[1] === "gmail.com" || parts[1] === "googlemail.com") { + if (options.gmail_remove_subaddress) { + parts[0] = parts[0].split("+")[0]; + } + if (options.gmail_remove_dots) { + parts[0] = parts[0].replace(/\.+/g, dotsReplacer); + } + if (!parts[0].length) { + return false; + } + if (options.all_lowercase || options.gmail_lowercase) { + parts[0] = parts[0].toLowerCase(); + } + parts[1] = options.gmail_convert_googlemaildotcom ? "gmail.com" : parts[1]; + } else if (icloud_domains.indexOf(parts[1]) >= 0) { + if (options.icloud_remove_subaddress) { + parts[0] = parts[0].split("+")[0]; + } + if (!parts[0].length) { + return false; + } + if (options.all_lowercase || options.icloud_lowercase) { + parts[0] = parts[0].toLowerCase(); + } + } else if (outlookdotcom_domains.indexOf(parts[1]) >= 0) { + if (options.outlookdotcom_remove_subaddress) { + parts[0] = parts[0].split("+")[0]; + } + if (!parts[0].length) { + return false; + } + if (options.all_lowercase || options.outlookdotcom_lowercase) { + parts[0] = parts[0].toLowerCase(); + } + } else if (yahoo_domains.indexOf(parts[1]) >= 0) { + if (options.yahoo_remove_subaddress) { + var components = parts[0].split("-"); + parts[0] = components.length > 1 ? components.slice(0, -1).join("-") : components[0]; + } + if (!parts[0].length) { + return false; + } + if (options.all_lowercase || options.yahoo_lowercase) { + parts[0] = parts[0].toLowerCase(); + } + } else if (yandex_domains.indexOf(parts[1]) >= 0) { + if (options.all_lowercase || options.yandex_lowercase) { + parts[0] = parts[0].toLowerCase(); + } + parts[1] = "yandex.ru"; + } else if (options.all_lowercase) { + parts[0] = parts[0].toLowerCase(); + } + return parts.join("@"); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(normalizeEmail, normalizeEmail.exports); +var normalizeEmailExports = normalizeEmail.exports; +var isSlug = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isSlug2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var charsetRegex = /^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/; + function isSlug2(str) { + (0, _assertString2.default)(str); + return charsetRegex.test(str); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isSlug, isSlug.exports); +var isSlugExports = isSlug.exports; +var isLicensePlate = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isLicensePlate2; + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var validators2 = { + "cs-CZ": function csCZ(str) { + return /^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(str); + }, + "de-DE": function deDE(str) { + return /^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS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LI(str) { + return /^FL[- ]?\d{1,5}[UZ]?$/.test(str); + }, + "en-IN": function enIN(str) { + return /^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(str); + }, + "es-AR": function esAR(str) { + return /^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(str); + }, + "fi-FI": function fiFI(str) { + return /^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(str); + }, + "hu-HU": function huHU(str) { + return /^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(str); + }, + "pt-BR": function ptBR(str) { + return /^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(str); + }, + "pt-PT": function ptPT(str) { + return /^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(str); + }, + "sq-AL": function sqAL(str) { + return /^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(str); + }, + "sv-SE": function svSE(str) { + return /^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(str.trim()); + }, + "en-PK": function enPK(str) { + return /(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(str.trim()); + } + }; + function isLicensePlate2(str, locale) { + (0, _assertString2.default)(str); + if (locale in validators2) { + return validators2[locale](str); + } else if (locale === "any") { + for (var key2 in validators2) { + var validator2 = validators2[key2]; + if (validator2(str)) { + return true; + } + } + return false; + } + throw new Error("Invalid locale '".concat(locale, "'")); + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isLicensePlate, isLicensePlate.exports); +var isLicensePlateExports = isLicensePlate.exports; +var isStrongPassword = { exports: {} }; +(function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = isStrongPassword2; + var _merge = _interopRequireDefault2(mergeExports); + var _assertString2 = _interopRequireDefault2(assertStringExports); + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var upperCaseRegex = /^[A-Z]$/; + var lowerCaseRegex = /^[a-z]$/; + var numberRegex = /^[0-9]$/; + var symbolRegex = /^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/; + var defaultOptions = { + minLength: 8, + minLowercase: 1, + minUppercase: 1, + minNumbers: 1, + minSymbols: 1, + returnScore: false, + pointsPerUnique: 1, + pointsPerRepeat: 0.5, + pointsForContainingLower: 10, + pointsForContainingUpper: 10, + pointsForContainingNumber: 10, + pointsForContainingSymbol: 10 + }; + function countChars(str) { + var result = {}; + Array.from(str).forEach(function(char) { + var curVal = result[char]; + if (curVal) { + result[char] += 1; + } else { + result[char] = 1; + } + }); + return result; + } + function analyzePassword(password) { + var charMap = countChars(password); + var analysis = { + length: password.length, + uniqueChars: Object.keys(charMap).length, + uppercaseCount: 0, + lowercaseCount: 0, + numberCount: 0, + symbolCount: 0 + }; + Object.keys(charMap).forEach(function(char) { + if (upperCaseRegex.test(char)) { + analysis.uppercaseCount += charMap[char]; + } else if (lowerCaseRegex.test(char)) { + analysis.lowercaseCount += charMap[char]; + } else if (numberRegex.test(char)) { + analysis.numberCount += charMap[char]; + } else if (symbolRegex.test(char)) { + analysis.symbolCount += charMap[char]; + } + }); + return analysis; + } + function scorePassword(analysis, scoringOptions) { + var points = 0; + points += analysis.uniqueChars * scoringOptions.pointsPerUnique; + points += (analysis.length - analysis.uniqueChars) * scoringOptions.pointsPerRepeat; + if (analysis.lowercaseCount > 0) { + points += scoringOptions.pointsForContainingLower; + } + if (analysis.uppercaseCount > 0) { + points += scoringOptions.pointsForContainingUpper; + } + if (analysis.numberCount > 0) { + points += scoringOptions.pointsForContainingNumber; + } + if (analysis.symbolCount > 0) { + points += scoringOptions.pointsForContainingSymbol; + } + return points; + } + function isStrongPassword2(str) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; + (0, _assertString2.default)(str); + var analysis = analyzePassword(str); + options = (0, _merge.default)(options || {}, defaultOptions); + if (options.returnScore) { + return scorePassword(analysis, options); + } + return analysis.length >= options.minLength && analysis.lowercaseCount >= options.minLowercase && analysis.uppercaseCount >= options.minUppercase && analysis.numberCount >= options.minNumbers && analysis.symbolCount >= options.minSymbols; + } + module.exports = exports.default; + module.exports.default = exports.default; +})(isStrongPassword, isStrongPassword.exports); +var isStrongPasswordExports = isStrongPassword.exports; +var isVAT$1 = {}; +function _typeof(o2) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { + return typeof o3; + } : function(o3) { + return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; + }, _typeof(o2); +} +Object.defineProperty(isVAT$1, "__esModule", { + value: true +}); +isVAT$1.default = isVAT; +isVAT$1.vatMatchers = void 0; +var _assertString = _interopRequireDefault(assertStringExports); +var algorithms = _interopRequireWildcard(algorithms$1); +function _getRequireWildcardCache(e18) { + if ("function" != typeof WeakMap) + return null; + var r2 = /* @__PURE__ */ new WeakMap(), t2 = /* @__PURE__ */ new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache2(e19) { + return e19 ? t2 : r2; + })(e18); +} +function _interopRequireWildcard(e18, r2) { + if (!r2 && e18 && e18.__esModule) + return e18; + if (null === e18 || "object" != _typeof(e18) && "function" != typeof e18) + return { default: e18 }; + var t2 = _getRequireWildcardCache(r2); + if (t2 && t2.has(e18)) + return t2.get(e18); + var n5 = { __proto__: null }, a3 = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var u2 in e18) + if ("default" !== u2 && {}.hasOwnProperty.call(e18, u2)) { + var i2 = a3 ? Object.getOwnPropertyDescriptor(e18, u2) : null; + i2 && (i2.get || i2.set) ? Object.defineProperty(n5, u2, i2) : n5[u2] = e18[u2]; + } + return n5.default = e18, t2 && t2.set(e18, n5), n5; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} +var AU = function AU2(str) { + var match = str.match(/^(AU)?(\d{11})$/); + if (!match) { + return false; + } + var weights = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19]; + str = str.replace(/^AU/, ""); + var ABN = (parseInt(str.slice(0, 1), 10) - 1).toString() + str.slice(1); + var total = 0; + for (var i2 = 0; i2 < 11; i2++) { + total += weights[i2] * ABN.charAt(i2); + } + return total !== 0 && total % 89 === 0; +}; +var CH = function CH2(str) { + var hasValidCheckNumber = function hasValidCheckNumber2(digits) { + var lastDigit = digits.pop(); + var weights = [5, 4, 3, 2, 7, 6, 5, 4]; + var calculatedCheckNumber = (11 - digits.reduce(function(acc, el2, idx) { + return acc + el2 * weights[idx]; + }, 0) % 11) % 11; + return lastDigit === calculatedCheckNumber; + }; + return /^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(str) && hasValidCheckNumber(str.match(/\d/g).map(function(el2) { + return +el2; + })); +}; +var PT = function PT2(str) { + var match = str.match(/^(PT)?(\d{9})$/); + if (!match) { + return false; + } + var tin = match[2]; + var checksum2 = 11 - algorithms.reverseMultiplyAndSum(tin.split("").slice(0, 8).map(function(a3) { + return parseInt(a3, 10); + }), 9) % 11; + if (checksum2 > 9) { + return parseInt(tin[8], 10) === 0; + } + return checksum2 === parseInt(tin[8], 10); +}; +var vatMatchers = isVAT$1.vatMatchers = { + /** + * European Union VAT identification numbers + */ + AT: function AT(str) { + return /^(AT)?U\d{8}$/.test(str); + }, + BE: function BE(str) { + return /^(BE)?\d{10}$/.test(str); + }, + BG: function BG(str) { + return /^(BG)?\d{9,10}$/.test(str); + }, + HR: function HR(str) { + return /^(HR)?\d{11}$/.test(str); + }, + CY: function CY(str) { + return /^(CY)?\w{9}$/.test(str); + }, + CZ: function CZ(str) { + return /^(CZ)?\d{8,10}$/.test(str); + }, + DK: function DK(str) { + return /^(DK)?\d{8}$/.test(str); + }, + EE: function EE(str) { + return /^(EE)?\d{9}$/.test(str); + }, + FI: function FI(str) { + return /^(FI)?\d{8}$/.test(str); + }, + FR: function FR(str) { + return /^(FR)?\w{2}\d{9}$/.test(str); + }, + DE: function DE(str) { + return /^(DE)?\d{9}$/.test(str); + }, + EL: function EL(str) { + return /^(EL)?\d{9}$/.test(str); + }, + HU: function HU(str) { + return /^(HU)?\d{8}$/.test(str); + }, + IE: function IE(str) { + return /^(IE)?\d{7}\w{1}(W)?$/.test(str); + }, + IT: function IT(str) { + return /^(IT)?\d{11}$/.test(str); + }, + LV: function LV(str) { + return /^(LV)?\d{11}$/.test(str); + }, + LT: function LT(str) { + return /^(LT)?\d{9,12}$/.test(str); + }, + LU: function LU(str) { + return /^(LU)?\d{8}$/.test(str); + }, + MT: function MT(str) { + return /^(MT)?\d{8}$/.test(str); + }, + NL: function NL(str) { + return /^(NL)?\d{9}B\d{2}$/.test(str); + }, + PL: function PL(str) { + return /^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(str); + }, + PT, + RO: function RO(str) { + return /^(RO)?\d{2,10}$/.test(str); + }, + SK: function SK(str) { + return /^(SK)?\d{10}$/.test(str); + }, + SI: function SI(str) { + return /^(SI)?\d{8}$/.test(str); + }, + ES: function ES(str) { + return /^(ES)?\w\d{7}[A-Z]$/.test(str); + }, + SE: function SE(str) { + return /^(SE)?\d{12}$/.test(str); + }, + /** + * VAT numbers of non-EU countries + */ + AL: function AL(str) { + return /^(AL)?\w{9}[A-Z]$/.test(str); + }, + MK: function MK(str) { + return /^(MK)?\d{13}$/.test(str); + }, + AU, + BY: function BY(str) { + return /^(УНП )?\d{9}$/.test(str); + }, + CA: function CA(str) { + return /^(CA)?\d{9}$/.test(str); + }, + IS: function IS(str) { + return /^(IS)?\d{5,6}$/.test(str); + }, + IN: function IN(str) { + return /^(IN)?\d{15}$/.test(str); + }, + ID: function ID(str) { + return /^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(str); + }, + IL: function IL(str) { + return /^(IL)?\d{9}$/.test(str); + }, + KZ: function KZ(str) { + return /^(KZ)?\d{12}$/.test(str); + }, + NZ: function NZ(str) { + return /^(NZ)?\d{9}$/.test(str); + }, + NG: function NG(str) { + return /^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(str); + }, + NO: function NO(str) { + return /^(NO)?\d{9}MVA$/.test(str); + }, + PH: function PH(str) { + return /^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(str); + }, + RU: function RU(str) { + return /^(RU)?(\d{10}|\d{12})$/.test(str); + }, + SM: function SM(str) { + return /^(SM)?\d{5}$/.test(str); + }, + SA: function SA(str) { + return /^(SA)?\d{15}$/.test(str); + }, + RS: function RS(str) { + return /^(RS)?\d{9}$/.test(str); + }, + CH, + TR: function TR(str) { + return /^(TR)?\d{10}$/.test(str); + }, + UA: function UA(str) { + return /^(UA)?\d{12}$/.test(str); + }, + GB: function GB(str) { + return /^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(str); + }, + UZ: function UZ(str) { + return /^(UZ)?\d{9}$/.test(str); + }, + /** + * VAT numbers of Latin American countries + */ + AR: function AR(str) { + return /^(AR)?\d{11}$/.test(str); + }, + BO: function BO(str) { + return /^(BO)?\d{7}$/.test(str); + }, + BR: function BR(str) { + return /^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(str); + }, + CL: function CL(str) { + return /^(CL)?\d{8}-\d{1}$/.test(str); + }, + CO: function CO(str) { + return /^(CO)?\d{10}$/.test(str); + }, + CR: function CR(str) { + return /^(CR)?\d{9,12}$/.test(str); + }, + EC: function EC2(str) { + return /^(EC)?\d{13}$/.test(str); + }, + SV: function SV(str) { + return /^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(str); + }, + GT: function GT(str) { + return /^(GT)?\d{7}-\d{1}$/.test(str); + }, + HN: function HN(str) { + return /^(HN)?$/.test(str); + }, + MX: function MX(str) { + return /^(MX)?\w{3,4}\d{6}\w{3}$/.test(str); + }, + NI: function NI(str) { + return /^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(str); + }, + PA: function PA(str) { + return /^(PA)?$/.test(str); + }, + PY: function PY(str) { + return /^(PY)?\d{6,8}-\d{1}$/.test(str); + }, + PE: function PE(str) { + return /^(PE)?\d{11}$/.test(str); + }, + DO: function DO(str) { + return /^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(str); + }, + UY: function UY(str) { + return /^(UY)?\d{12}$/.test(str); + }, + VE: function VE(str) { + return /^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(str); + } +}; +function isVAT(str, countryCode) { + (0, _assertString.default)(str); + (0, _assertString.default)(countryCode); + if (countryCode in vatMatchers) { + return vatMatchers[countryCode](str); + } + throw new Error("Invalid country code: '".concat(countryCode, "'")); +} +(function(module, exports) { + function _typeof2(o2) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { + return typeof o3; + } : function(o3) { + return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; + }, _typeof2(o2); + } + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _toDate = _interopRequireDefault2(toDateExports); + var _toFloat = _interopRequireDefault2(toFloatExports); + var _toInt = _interopRequireDefault2(toIntExports); + var _toBoolean = _interopRequireDefault2(toBooleanExports); + var _equals = _interopRequireDefault2(equalsExports); + var _contains = _interopRequireDefault2(containsExports); + var _matches = _interopRequireDefault2(matchesExports); + var _isEmail = _interopRequireDefault2(isEmailExports); + var _isURL = _interopRequireDefault2(isURLExports); + var _isMACAddress = _interopRequireDefault2(isMACAddressExports); + var _isIP = _interopRequireDefault2(isIPExports); + var _isIPRange = _interopRequireDefault2(isIPRangeExports); + var _isFQDN = _interopRequireDefault2(isFQDNExports); + var _isDate = _interopRequireDefault2(isDateExports); + var _isTime = _interopRequireDefault2(isTimeExports); + var _isBoolean = _interopRequireDefault2(isBooleanExports); + var _isLocale = _interopRequireDefault2(isLocaleExports); + var _isAbaRouting = _interopRequireDefault2(isAbaRoutingExports); + var _isAlpha = _interopRequireWildcard2(isAlpha$1); + var _isAlphanumeric = _interopRequireWildcard2(isAlphanumeric$1); + var _isNumeric = _interopRequireDefault2(isNumericExports); + var _isPassportNumber = _interopRequireDefault2(isPassportNumberExports); + var _isPort = _interopRequireDefault2(isPortExports); + var _isLowercase = _interopRequireDefault2(isLowercaseExports); + var _isUppercase = _interopRequireDefault2(isUppercaseExports); + var _isIMEI = _interopRequireDefault2(isIMEIExports); + var _isAscii = _interopRequireDefault2(isAsciiExports); + var _isFullWidth = _interopRequireDefault2(isFullWidth$1); + var _isHalfWidth = _interopRequireDefault2(isHalfWidth$1); + var _isVariableWidth = _interopRequireDefault2(isVariableWidthExports); + var _isMultibyte = _interopRequireDefault2(isMultibyteExports); + var _isSemVer = _interopRequireDefault2(isSemVerExports); + var _isSurrogatePair = _interopRequireDefault2(isSurrogatePairExports); + var _isInt = _interopRequireDefault2(isIntExports); + var _isFloat = _interopRequireWildcard2(isFloat$1); + var _isDecimal = _interopRequireDefault2(isDecimalExports); + var _isHexadecimal = _interopRequireDefault2(isHexadecimalExports); + var _isOctal = _interopRequireDefault2(isOctalExports); + var _isDivisibleBy = _interopRequireDefault2(isDivisibleByExports); + var _isHexColor = _interopRequireDefault2(isHexColorExports); + var _isRgbColor = _interopRequireDefault2(isRgbColorExports); + var _isHSL = _interopRequireDefault2(isHSLExports); + var _isISRC = _interopRequireDefault2(isISRCExports); + var _isIBAN = _interopRequireWildcard2(isIBAN$1); + var _isBIC = _interopRequireDefault2(isBICExports); + var _isMD = _interopRequireDefault2(isMD5Exports); + var _isHash = _interopRequireDefault2(isHashExports); + var _isJWT = _interopRequireDefault2(isJWTExports); + var _isJSON = _interopRequireDefault2(isJSONExports); + var _isEmpty = _interopRequireDefault2(isEmptyExports); + var _isLength = _interopRequireDefault2(isLengthExports); + var _isByteLength = _interopRequireDefault2(isByteLengthExports); + var _isUUID = _interopRequireDefault2(isUUIDExports); + var _isMongoId = _interopRequireDefault2(isMongoIdExports); + var _isAfter = _interopRequireDefault2(isAfterExports); + var _isBefore = _interopRequireDefault2(isBeforeExports); + var _isIn = _interopRequireDefault2(isInExports); + var _isLuhnNumber = _interopRequireDefault2(isLuhnNumberExports); + var _isCreditCard = _interopRequireDefault2(isCreditCardExports); + var _isIdentityCard = _interopRequireDefault2(isIdentityCardExports); + var _isEAN = _interopRequireDefault2(isEANExports); + var _isISIN = _interopRequireDefault2(isISINExports); + var _isISBN = _interopRequireDefault2(isISBNExports); + var _isISSN = _interopRequireDefault2(isISSNExports); + var _isTaxID = _interopRequireDefault2(isTaxIDExports); + var _isMobilePhone = _interopRequireWildcard2(isMobilePhone$1); + var _isEthereumAddress = _interopRequireDefault2(isEthereumAddressExports); + var _isCurrency = _interopRequireDefault2(isCurrencyExports); + var _isBtcAddress = _interopRequireDefault2(isBtcAddressExports); + var _isISO = isISO6346$1; + var _isISO2 = _interopRequireDefault2(isISO6391Exports); + var _isISO3 = _interopRequireDefault2(isISO8601Exports); + var _isRFC = _interopRequireDefault2(isRFC3339Exports); + var _isISO31661Alpha = _interopRequireDefault2(isISO31661Alpha2$1); + var _isISO31661Alpha2 = _interopRequireDefault2(isISO31661Alpha3Exports); + var _isISO4 = _interopRequireDefault2(isISO4217$1); + var _isBase = _interopRequireDefault2(isBase32Exports); + var _isBase2 = _interopRequireDefault2(isBase58Exports); + var _isBase3 = _interopRequireDefault2(isBase64Exports); + var _isDataURI = _interopRequireDefault2(isDataURIExports); + var _isMagnetURI = _interopRequireDefault2(isMagnetURIExports); + var _isMailtoURI = _interopRequireDefault2(isMailtoURIExports); + var _isMimeType = _interopRequireDefault2(isMimeTypeExports); + var _isLatLong = _interopRequireDefault2(isLatLongExports); + var _isPostalCode = _interopRequireWildcard2(isPostalCode$1); + var _ltrim = _interopRequireDefault2(ltrimExports); + var _rtrim = _interopRequireDefault2(rtrimExports); + var _trim = _interopRequireDefault2(trimExports); + var _escape2 = _interopRequireDefault2(_escapeExports); + var _unescape2 = _interopRequireDefault2(_unescapeExports); + var _stripLow = _interopRequireDefault2(stripLowExports); + var _whitelist = _interopRequireDefault2(whitelistExports); + var _blacklist = _interopRequireDefault2(blacklistExports); + var _isWhitelisted = _interopRequireDefault2(isWhitelistedExports); + var _normalizeEmail = _interopRequireDefault2(normalizeEmailExports); + var _isSlug = _interopRequireDefault2(isSlugExports); + var _isLicensePlate = _interopRequireDefault2(isLicensePlateExports); + var _isStrongPassword = _interopRequireDefault2(isStrongPasswordExports); + var _isVAT = _interopRequireDefault2(isVAT$1); + function _getRequireWildcardCache2(e18) { + if ("function" != typeof WeakMap) + return null; + var r2 = /* @__PURE__ */ new WeakMap(), t2 = /* @__PURE__ */ new WeakMap(); + return (_getRequireWildcardCache2 = function _getRequireWildcardCache3(e19) { + return e19 ? t2 : r2; + })(e18); + } + function _interopRequireWildcard2(e18, r2) { + if (!r2 && e18 && e18.__esModule) + return e18; + if (null === e18 || "object" != _typeof2(e18) && "function" != typeof e18) + return { default: e18 }; + var t2 = _getRequireWildcardCache2(r2); + if (t2 && t2.has(e18)) + return t2.get(e18); + var n5 = { __proto__: null }, a3 = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var u2 in e18) + if ("default" !== u2 && {}.hasOwnProperty.call(e18, u2)) { + var i2 = a3 ? Object.getOwnPropertyDescriptor(e18, u2) : null; + i2 && (i2.get || i2.set) ? Object.defineProperty(n5, u2, i2) : n5[u2] = e18[u2]; + } + return n5.default = e18, t2 && t2.set(e18, n5), n5; + } + function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var version2 = "13.12.0"; + var validator2 = { + version: version2, + toDate: _toDate.default, + toFloat: _toFloat.default, + toInt: _toInt.default, + toBoolean: _toBoolean.default, + equals: _equals.default, + contains: _contains.default, + matches: _matches.default, + isEmail: _isEmail.default, + isURL: _isURL.default, + isMACAddress: _isMACAddress.default, + isIP: _isIP.default, + isIPRange: _isIPRange.default, + isFQDN: _isFQDN.default, + isBoolean: _isBoolean.default, + isIBAN: _isIBAN.default, + isBIC: _isBIC.default, + isAbaRouting: _isAbaRouting.default, + isAlpha: _isAlpha.default, + isAlphaLocales: _isAlpha.locales, + isAlphanumeric: _isAlphanumeric.default, + isAlphanumericLocales: _isAlphanumeric.locales, + isNumeric: _isNumeric.default, + isPassportNumber: _isPassportNumber.default, + isPort: _isPort.default, + isLowercase: _isLowercase.default, + isUppercase: _isUppercase.default, + isAscii: _isAscii.default, + isFullWidth: _isFullWidth.default, + isHalfWidth: _isHalfWidth.default, + isVariableWidth: _isVariableWidth.default, + isMultibyte: _isMultibyte.default, + isSemVer: _isSemVer.default, + isSurrogatePair: _isSurrogatePair.default, + isInt: _isInt.default, + isIMEI: _isIMEI.default, + isFloat: _isFloat.default, + isFloatLocales: _isFloat.locales, + isDecimal: _isDecimal.default, + isHexadecimal: _isHexadecimal.default, + isOctal: _isOctal.default, + isDivisibleBy: _isDivisibleBy.default, + isHexColor: _isHexColor.default, + isRgbColor: _isRgbColor.default, + isHSL: _isHSL.default, + isISRC: _isISRC.default, + isMD5: _isMD.default, + isHash: _isHash.default, + isJWT: _isJWT.default, + isJSON: _isJSON.default, + isEmpty: _isEmpty.default, + isLength: _isLength.default, + isLocale: _isLocale.default, + isByteLength: _isByteLength.default, + isUUID: _isUUID.default, + isMongoId: _isMongoId.default, + isAfter: _isAfter.default, + isBefore: _isBefore.default, + isIn: _isIn.default, + isLuhnNumber: _isLuhnNumber.default, + isCreditCard: _isCreditCard.default, + isIdentityCard: _isIdentityCard.default, + isEAN: _isEAN.default, + isISIN: _isISIN.default, + isISBN: _isISBN.default, + isISSN: _isISSN.default, + isMobilePhone: _isMobilePhone.default, + isMobilePhoneLocales: _isMobilePhone.locales, + isPostalCode: _isPostalCode.default, + isPostalCodeLocales: _isPostalCode.locales, + isEthereumAddress: _isEthereumAddress.default, + isCurrency: _isCurrency.default, + isBtcAddress: _isBtcAddress.default, + isISO6346: _isISO.isISO6346, + isFreightContainerID: _isISO.isFreightContainerID, + isISO6391: _isISO2.default, + isISO8601: _isISO3.default, + isRFC3339: _isRFC.default, + isISO31661Alpha2: _isISO31661Alpha.default, + isISO31661Alpha3: _isISO31661Alpha2.default, + isISO4217: _isISO4.default, + isBase32: _isBase.default, + isBase58: _isBase2.default, + isBase64: _isBase3.default, + isDataURI: _isDataURI.default, + isMagnetURI: _isMagnetURI.default, + isMailtoURI: _isMailtoURI.default, + isMimeType: _isMimeType.default, + isLatLong: _isLatLong.default, + ltrim: _ltrim.default, + rtrim: _rtrim.default, + trim: _trim.default, + escape: _escape2.default, + unescape: _unescape2.default, + stripLow: _stripLow.default, + whitelist: _whitelist.default, + blacklist: _blacklist.default, + isWhitelisted: _isWhitelisted.default, + normalizeEmail: _normalizeEmail.default, + toString, + isSlug: _isSlug.default, + isStrongPassword: _isStrongPassword.default, + isTaxID: _isTaxID.default, + isDate: _isDate.default, + isTime: _isTime.default, + isLicensePlate: _isLicensePlate.default, + isVAT: _isVAT.default, + ibanLocales: _isIBAN.locales + }; + exports.default = validator2; + module.exports = exports.default; + module.exports.default = exports.default; +})(validator$2, validator$2.exports); +var validatorExports = validator$2.exports; +const validator$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(validatorExports); +function isValidURL(url) { + if (typeof url !== "string") + return false; + return validator$1.isURL(url.toString(), { + protocols: ["http", "https"], + require_tld: false + }); +} +function isObject$2(obj) { + return obj === Object(obj) && Object.prototype.toString.call(obj) !== "[object Array]"; +} +function isArray$1(array2) { + return Array.isArray(array2); +} +function isJson(string2) { + try { + return !!JSON.parse(string2); + } catch (ex2) { + return false; + } +} +function isBoolean$1(bool) { + return typeof bool === "boolean"; +} +function isBigNumber(number2) { + return !!number2 && (number2 instanceof BigNumber || number2.constructor && number2.constructor.name === "BigNumber"); +} +function isString$1(string2) { + return typeof string2 === "string" || !!string2 && string2.constructor && string2.constructor.name === "String"; +} +function isFunction$1(obj) { + return typeof obj === "function"; +} +function isHex(string2) { + return typeof string2 === "string" && !isNaN(parseInt(string2, 16)) && /^(0x|)[a-fA-F0-9]+$/.test(string2); +} +function isInteger(number2) { + if (number2 === null) + return false; + return Number.isInteger(Number(number2)); +} +function hasProperty(obj, property) { + return Object.prototype.hasOwnProperty.call(obj, property); +} +function hasProperties(obj, ...properties) { + return properties.length && !properties.map((property) => { + return hasProperty(obj, property); + }).includes(false); +} +function mapEvent(event) { + const data = { + block: event.block_number, + timestamp: event.block_timestamp, + contract: event.contract_address, + name: event.event_name, + transaction: event.transaction_id, + result: event.result, + resourceNode: event.resource_Node || (event._unconfirmed ? "fullNode" : "solidityNode") + }; + if (event._unconfirmed) { + data.unconfirmed = event._unconfirmed; + } + if (event._fingerprint) { + data.fingerprint = event._fingerprint; + } + return data; +} +function parseEvent(event, { inputs: abi2 }) { + if (!event.result) + return event; + if (isObject$2(event.result)) { + for (let i2 = 0; i2 < abi2.length; i2++) { + const obj = abi2[i2]; + if (obj.type == "address" && obj.name in event.result) + event.result[obj.name] = ADDRESS_PREFIX + event.result[obj.name].substr(2).toLowerCase(); + } + } else if (isArray$1(event.result)) { + event.result = event.result.reduce((obj, result, index2) => { + const { name: name2, type: type2 } = abi2[index2]; + if (type2 == "address") + result = ADDRESS_PREFIX + result.substr(2).toLowerCase(); + obj[name2] = result; + return obj; + }, {}); + } + return event; +} +function padLeft(input, padding2, amount) { + let res = input.toString(); + while (res.length < amount) + res = padding2 + res; + return res; +} +function isNotNullOrUndefined(val) { + return val !== null && typeof val !== "undefined"; +} +async function sleep(millis = 1e3) { + return new Promise((resolve) => setTimeout(resolve, millis)); +} +const validations = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + hasProperties, + hasProperty, + isArray: isArray$1, + isBigNumber, + isBoolean: isBoolean$1, + isFunction: isFunction$1, + isHex, + isInteger, + isJson, + isNotNullOrUndefined, + isObject: isObject$2, + isString: isString$1, + isValidURL, + mapEvent, + padLeft, + parseEvent, + sleep +}, Symbol.toStringTag, { value: "Module" })); +const version$2 = "6.13.4"; +function checkType(value, type2, name2) { + const types2 = type2.split("|").map((t2) => t2.trim()); + for (let i2 = 0; i2 < types2.length; i2++) { + switch (type2) { + case "any": + return; + case "bigint": + case "boolean": + case "number": + case "string": + if (typeof value === type2) { + return; + } + } + } + const error = new Error(`invalid value for type ${type2}`); + error.code = "INVALID_ARGUMENT"; + error.argument = `value.${name2}`; + error.value = value; + throw error; +} +async function resolveProperties(value) { + const keys2 = Object.keys(value); + const results = await Promise.all(keys2.map((k2) => Promise.resolve(value[k2]))); + return results.reduce((accum, v6, index2) => { + accum[keys2[index2]] = v6; + return accum; + }, {}); +} +function defineProperties(target, values, types2) { + for (let key2 in values) { + let value = values[key2]; + const type2 = types2 ? types2[key2] : null; + if (type2) { + checkType(value, type2, key2); + } + Object.defineProperty(target, key2, { enumerable: true, value, writable: false }); + } +} +function stringify(value) { + if (value == null) { + return "null"; + } + if (Array.isArray(value)) { + return "[ " + value.map(stringify).join(", ") + " ]"; + } + if (value instanceof Uint8Array) { + const HEX = "0123456789abcdef"; + let result = "0x"; + for (let i2 = 0; i2 < value.length; i2++) { + result += HEX[value[i2] >> 4]; + result += HEX[value[i2] & 15]; + } + return result; + } + if (typeof value === "object" && typeof value.toJSON === "function") { + return stringify(value.toJSON()); + } + switch (typeof value) { + case "boolean": + case "symbol": + return value.toString(); + case "bigint": + return BigInt(value).toString(); + case "number": + return value.toString(); + case "string": + return JSON.stringify(value); + case "object": { + const keys2 = Object.keys(value); + keys2.sort(); + return "{ " + keys2.map((k2) => `${stringify(k2)}: ${stringify(value[k2])}`).join(", ") + " }"; + } + } + return `[ COULD NOT SERIALIZE ]`; +} +function isError(error, code2) { + return error && error.code === code2; +} +function makeError(message2, code2, info) { + let shortMessage = message2; + { + const details = []; + if (info) { + if ("message" in info || "code" in info || "name" in info) { + throw new Error(`value will overwrite populated values: ${stringify(info)}`); + } + for (const key2 in info) { + if (key2 === "shortMessage") { + continue; + } + const value = info[key2]; + details.push(key2 + "=" + stringify(value)); + } + } + details.push(`code=${code2}`); + details.push(`version=${version$2}`); + if (details.length) { + message2 += " (" + details.join(", ") + ")"; + } + } + let error; + switch (code2) { + case "INVALID_ARGUMENT": + error = new TypeError(message2); + break; + case "NUMERIC_FAULT": + case "BUFFER_OVERRUN": + error = new RangeError(message2); + break; + default: + error = new Error(message2); + } + defineProperties(error, { code: code2 }); + if (info) { + Object.assign(error, info); + } + if (error.shortMessage == null) { + defineProperties(error, { shortMessage }); + } + return error; +} +function assert(check, message2, code2, info) { + if (!check) { + throw makeError(message2, code2, info); + } +} +function assertArgument(check, message2, name2, value) { + assert(check, message2, "INVALID_ARGUMENT", { argument: name2, value }); +} +function assertArgumentCount(count, expectedCount, message2) { + if (message2 == null) { + message2 = ""; + } + if (message2) { + message2 = ": " + message2; + } + assert(count >= expectedCount, "missing arguemnt" + message2, "MISSING_ARGUMENT", { + count, + expectedCount + }); + assert(count <= expectedCount, "too many arguments" + message2, "UNEXPECTED_ARGUMENT", { + count, + expectedCount + }); +} +const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { + try { + if ("test".normalize(form) !== "test") { + throw new Error("bad"); + } + ; + if (form === "NFD") { + const check = String.fromCharCode(233).normalize("NFD"); + const expected = String.fromCharCode(101, 769); + if (check !== expected) { + throw new Error("broken"); + } + } + accum.push(form); + } catch (error) { + } + return accum; +}, []); +function assertNormalize(form) { + assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { + operation: "String.prototype.normalize", + info: { form } + }); +} +function assertPrivate(givenGuard, guard2, className) { + if (className == null) { + className = ""; + } + if (givenGuard !== guard2) { + let method = className, operation = "new"; + if (className) { + method += "."; + operation += " " + className; + } + assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { + operation + }); + } +} +function _getBytes(value, name2, copy) { + if (value instanceof Uint8Array) { + if (copy) { + return new Uint8Array(value); + } + return value; + } + if (typeof value === "string" && value.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) { + const result = new Uint8Array((value.length - 2) / 2); + let offset2 = 2; + for (let i2 = 0; i2 < result.length; i2++) { + result[i2] = parseInt(value.substring(offset2, offset2 + 2), 16); + offset2 += 2; + } + return result; + } + assertArgument(false, "invalid BytesLike value", name2 || "value", value); +} +function getBytes(value, name2) { + return _getBytes(value, name2, false); +} +function getBytesCopy(value, name2) { + return _getBytes(value, name2, true); +} +function isHexString(value, length) { + if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { + return false; + } + if (typeof length === "number" && value.length !== 2 + 2 * length) { + return false; + } + if (length === true && value.length % 2 !== 0) { + return false; + } + return true; +} +function isBytesLike(value) { + return isHexString(value, true) || value instanceof Uint8Array; +} +const HexCharacters = "0123456789abcdef"; +function hexlify(data) { + const bytes2 = getBytes(data); + let result = "0x"; + for (let i2 = 0; i2 < bytes2.length; i2++) { + const v6 = bytes2[i2]; + result += HexCharacters[(v6 & 240) >> 4] + HexCharacters[v6 & 15]; + } + return result; +} +function concat(datas) { + return "0x" + datas.map((d4) => hexlify(d4).substring(2)).join(""); +} +function dataLength(data) { + if (isHexString(data, true)) { + return (data.length - 2) / 2; + } + return getBytes(data).length; +} +function dataSlice(data, start, end) { + const bytes2 = getBytes(data); + if (end != null && end > bytes2.length) { + assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { + buffer: bytes2, + length: bytes2.length, + offset: end + }); + } + return hexlify(bytes2.slice(start == null ? 0 : start, end == null ? bytes2.length : end)); +} +function zeroPad(data, length, left) { + const bytes2 = getBytes(data); + assert(length >= bytes2.length, "padding exceeds data length", "BUFFER_OVERRUN", { + buffer: new Uint8Array(bytes2), + length, + offset: length + 1 + }); + const result = new Uint8Array(length); + result.fill(0); + if (left) { + result.set(bytes2, length - bytes2.length); + } else { + result.set(bytes2, 0); + } + return hexlify(result); +} +function zeroPadValue(data, length) { + return zeroPad(data, length, true); +} +const BN_0$7 = BigInt(0); +const BN_1$4 = BigInt(1); +const maxValue = 9007199254740991; +function fromTwos(_value2, _width) { + const value = getUint(_value2, "value"); + const width = BigInt(getNumber(_width, "width")); + assert(value >> width === BN_0$7, "overflow", "NUMERIC_FAULT", { + operation: "fromTwos", + fault: "overflow", + value: _value2 + }); + if (value >> width - BN_1$4) { + const mask2 = (BN_1$4 << width) - BN_1$4; + return -((~value & mask2) + BN_1$4); + } + return value; +} +function toTwos(_value2, _width) { + let value = getBigInt(_value2, "value"); + const width = BigInt(getNumber(_width, "width")); + const limit = BN_1$4 << width - BN_1$4; + if (value < BN_0$7) { + value = -value; + assert(value <= limit, "too low", "NUMERIC_FAULT", { + operation: "toTwos", + fault: "overflow", + value: _value2 + }); + const mask2 = (BN_1$4 << width) - BN_1$4; + return (~value & mask2) + BN_1$4; + } else { + assert(value < limit, "too high", "NUMERIC_FAULT", { + operation: "toTwos", + fault: "overflow", + value: _value2 + }); + } + return value; +} +function mask(_value2, _bits) { + const value = getUint(_value2, "value"); + const bits = BigInt(getNumber(_bits, "bits")); + return value & (BN_1$4 << bits) - BN_1$4; +} +function getBigInt(value, name2) { + switch (typeof value) { + case "bigint": + return value; + case "number": + assertArgument(Number.isInteger(value), "underflow", name2 || "value", value); + assertArgument(value >= -maxValue && value <= maxValue, "overflow", name2 || "value", value); + return BigInt(value); + case "string": + try { + if (value === "") { + throw new Error("empty string"); + } + if (value[0] === "-" && value[1] !== "-") { + return -BigInt(value.substring(1)); + } + return BigInt(value); + } catch (e18) { + assertArgument(false, `invalid BigNumberish string: ${e18.message}`, name2 || "value", value); + } + } + assertArgument(false, "invalid BigNumberish value", name2 || "value", value); +} +function getUint(value, name2) { + const result = getBigInt(value, name2); + assert(result >= BN_0$7, "unsigned value cannot be negative", "NUMERIC_FAULT", { + fault: "overflow", + operation: "getUint", + value + }); + return result; +} +const Nibbles$1 = "0123456789abcdef"; +function toBigInt(value) { + if (value instanceof Uint8Array) { + let result = "0x0"; + for (const v6 of value) { + result += Nibbles$1[v6 >> 4]; + result += Nibbles$1[v6 & 15]; + } + return BigInt(result); + } + return getBigInt(value); +} +function getNumber(value, name2) { + switch (typeof value) { + case "bigint": + assertArgument(value >= -maxValue && value <= maxValue, "overflow", name2 || "value", value); + return Number(value); + case "number": + assertArgument(Number.isInteger(value), "underflow", name2 || "value", value); + assertArgument(value >= -maxValue && value <= maxValue, "overflow", name2 || "value", value); + return value; + case "string": + try { + if (value === "") { + throw new Error("empty string"); + } + return getNumber(BigInt(value), name2); + } catch (e18) { + assertArgument(false, `invalid numeric string: ${e18.message}`, name2 || "value", value); + } + } + assertArgument(false, "invalid numeric value", name2 || "value", value); +} +function toNumber(value) { + return getNumber(toBigInt(value)); +} +function toBeHex(_value2, _width) { + const value = getUint(_value2, "value"); + let result = value.toString(16); + if (_width == null) { + if (result.length % 2) { + result = "0" + result; + } + } else { + const width = getNumber(_width, "width"); + assert(width * 2 >= result.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { + operation: "toBeHex", + fault: "overflow", + value: _value2 + }); + while (result.length < width * 2) { + result = "0" + result; + } + } + return "0x" + result; +} +function toBeArray(_value2) { + const value = getUint(_value2, "value"); + if (value === BN_0$7) { + return new Uint8Array([]); + } + let hex = value.toString(16); + if (hex.length % 2) { + hex = "0" + hex; + } + const result = new Uint8Array(hex.length / 2); + for (let i2 = 0; i2 < result.length; i2++) { + const offset2 = i2 * 2; + result[i2] = parseInt(hex.substring(offset2, offset2 + 2), 16); + } + return result; +} +function toQuantity(value) { + let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); + while (result.startsWith("0")) { + result = result.substring(1); + } + if (result === "") { + result = "0"; + } + return "0x" + result; +} +const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; +let Lookup = null; +function getAlpha(letter) { + if (Lookup == null) { + Lookup = {}; + for (let i2 = 0; i2 < Alphabet.length; i2++) { + Lookup[Alphabet[i2]] = BigInt(i2); + } + } + const result = Lookup[letter]; + assertArgument(result != null, `invalid base58 value`, "letter", letter); + return result; +} +const BN_0$6 = BigInt(0); +const BN_58 = BigInt(58); +function encodeBase58(_value2) { + const bytes2 = getBytes(_value2); + let value = toBigInt(bytes2); + let result = ""; + while (value) { + result = Alphabet[Number(value % BN_58)] + result; + value /= BN_58; + } + for (let i2 = 0; i2 < bytes2.length; i2++) { + if (bytes2[i2]) { + break; + } + result = Alphabet[0] + result; + } + return result; +} +function decodeBase58(value) { + let result = BN_0$6; + for (let i2 = 0; i2 < value.length; i2++) { + result *= BN_58; + result += getAlpha(value[i2]); + } + return result; +} +function errorFunc(reason, offset2, bytes2, output2, badCodepoint) { + assertArgument(false, `invalid codepoint at offset ${offset2}; ${reason}`, "bytes", bytes2); +} +function ignoreFunc(reason, offset2, bytes2, output2, badCodepoint) { + if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { + let i2 = 0; + for (let o2 = offset2 + 1; o2 < bytes2.length; o2++) { + if (bytes2[o2] >> 6 !== 2) { + break; + } + i2++; + } + return i2; + } + if (reason === "OVERRUN") { + return bytes2.length - offset2 - 1; + } + return 0; +} +function replaceFunc(reason, offset2, bytes2, output2, badCodepoint) { + if (reason === "OVERLONG") { + assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); + output2.push(badCodepoint); + return 0; + } + output2.push(65533); + return ignoreFunc(reason, offset2, bytes2); +} +const Utf8ErrorFuncs = Object.freeze({ + error: errorFunc, + ignore: ignoreFunc, + replace: replaceFunc +}); +function getUtf8CodePoints(_bytes, onError) { + if (onError == null) { + onError = Utf8ErrorFuncs.error; + } + const bytes2 = getBytes(_bytes, "bytes"); + const result = []; + let i2 = 0; + while (i2 < bytes2.length) { + const c2 = bytes2[i2++]; + if (c2 >> 7 === 0) { + result.push(c2); + continue; + } + let extraLength = null; + let overlongMask = null; + if ((c2 & 224) === 192) { + extraLength = 1; + overlongMask = 127; + } else if ((c2 & 240) === 224) { + extraLength = 2; + overlongMask = 2047; + } else if ((c2 & 248) === 240) { + extraLength = 3; + overlongMask = 65535; + } else { + if ((c2 & 192) === 128) { + i2 += onError("UNEXPECTED_CONTINUE", i2 - 1, bytes2, result); + } else { + i2 += onError("BAD_PREFIX", i2 - 1, bytes2, result); + } + continue; + } + if (i2 - 1 + extraLength >= bytes2.length) { + i2 += onError("OVERRUN", i2 - 1, bytes2, result); + continue; + } + let res = c2 & (1 << 8 - extraLength - 1) - 1; + for (let j2 = 0; j2 < extraLength; j2++) { + let nextChar = bytes2[i2]; + if ((nextChar & 192) != 128) { + i2 += onError("MISSING_CONTINUE", i2, bytes2, result); + res = null; + break; + } + res = res << 6 | nextChar & 63; + i2++; + } + if (res === null) { + continue; + } + if (res > 1114111) { + i2 += onError("OUT_OF_RANGE", i2 - 1 - extraLength, bytes2, result, res); + continue; + } + if (res >= 55296 && res <= 57343) { + i2 += onError("UTF16_SURROGATE", i2 - 1 - extraLength, bytes2, result, res); + continue; + } + if (res <= overlongMask) { + i2 += onError("OVERLONG", i2 - 1 - extraLength, bytes2, result, res); + continue; + } + result.push(res); + } + return result; +} +function toUtf8Bytes(str, form) { + assertArgument(typeof str === "string", "invalid string value", "str", str); + if (form != null) { + assertNormalize(form); + str = str.normalize(form); + } + let result = []; + for (let i2 = 0; i2 < str.length; i2++) { + const c2 = str.charCodeAt(i2); + if (c2 < 128) { + result.push(c2); + } else if (c2 < 2048) { + result.push(c2 >> 6 | 192); + result.push(c2 & 63 | 128); + } else if ((c2 & 64512) == 55296) { + i2++; + const c22 = str.charCodeAt(i2); + assertArgument(i2 < str.length && (c22 & 64512) === 56320, "invalid surrogate pair", "str", str); + const pair = 65536 + ((c2 & 1023) << 10) + (c22 & 1023); + result.push(pair >> 18 | 240); + result.push(pair >> 12 & 63 | 128); + result.push(pair >> 6 & 63 | 128); + result.push(pair & 63 | 128); + } else { + result.push(c2 >> 12 | 224); + result.push(c2 >> 6 & 63 | 128); + result.push(c2 & 63 | 128); + } + } + return new Uint8Array(result); +} +function _toUtf8String(codePoints) { + return codePoints.map((codePoint) => { + if (codePoint <= 65535) { + return String.fromCharCode(codePoint); + } + codePoint -= 65536; + return String.fromCharCode((codePoint >> 10 & 1023) + 55296, (codePoint & 1023) + 56320); + }).join(""); +} +function toUtf8String(bytes2, onError) { + return _toUtf8String(getUtf8CodePoints(bytes2, onError)); +} +function hexlifyByte(value) { + let result = value.toString(16); + while (result.length < 2) { + result = "0" + result; + } + return "0x" + result; +} +function unarrayifyInteger(data, offset2, length) { + let result = 0; + for (let i2 = 0; i2 < length; i2++) { + result = result * 256 + data[offset2 + i2]; + } + return result; +} +function _decodeChildren(data, offset2, childOffset, length) { + const result = []; + while (childOffset < offset2 + 1 + length) { + const decoded = _decode(data, childOffset); + result.push(decoded.result); + childOffset += decoded.consumed; + assert(childOffset <= offset2 + 1 + length, "child data too short", "BUFFER_OVERRUN", { + buffer: data, + length, + offset: offset2 + }); + } + return { consumed: 1 + length, result }; +} +function _decode(data, offset2) { + assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { + buffer: data, + length: 0, + offset: 1 + }); + const checkOffset = (offset3) => { + assert(offset3 <= data.length, "data short segment too short", "BUFFER_OVERRUN", { + buffer: data, + length: data.length, + offset: offset3 + }); + }; + if (data[offset2] >= 248) { + const lengthLength = data[offset2] - 247; + checkOffset(offset2 + 1 + lengthLength); + const length = unarrayifyInteger(data, offset2 + 1, lengthLength); + checkOffset(offset2 + 1 + lengthLength + length); + return _decodeChildren(data, offset2, offset2 + 1 + lengthLength, lengthLength + length); + } else if (data[offset2] >= 192) { + const length = data[offset2] - 192; + checkOffset(offset2 + 1 + length); + return _decodeChildren(data, offset2, offset2 + 1, length); + } else if (data[offset2] >= 184) { + const lengthLength = data[offset2] - 183; + checkOffset(offset2 + 1 + lengthLength); + const length = unarrayifyInteger(data, offset2 + 1, lengthLength); + checkOffset(offset2 + 1 + lengthLength + length); + const result = hexlify(data.slice(offset2 + 1 + lengthLength, offset2 + 1 + lengthLength + length)); + return { consumed: 1 + lengthLength + length, result }; + } else if (data[offset2] >= 128) { + const length = data[offset2] - 128; + checkOffset(offset2 + 1 + length); + const result = hexlify(data.slice(offset2 + 1, offset2 + 1 + length)); + return { consumed: 1 + length, result }; + } + return { consumed: 1, result: hexlifyByte(data[offset2]) }; +} +function decodeRlp(_data5) { + const data = getBytes(_data5, "data"); + const decoded = _decode(data, 0); + assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data5); + return decoded.result; +} +function arrayifyInteger(value) { + const result = []; + while (value) { + result.unshift(value & 255); + value >>= 8; + } + return result; +} +function _encode3(object) { + if (Array.isArray(object)) { + let payload = []; + object.forEach(function(child) { + payload = payload.concat(_encode3(child)); + }); + if (payload.length <= 55) { + payload.unshift(192 + payload.length); + return payload; + } + const length2 = arrayifyInteger(payload.length); + length2.unshift(247 + length2.length); + return length2.concat(payload); + } + const data = Array.prototype.slice.call(getBytes(object, "object")); + if (data.length === 1 && data[0] <= 127) { + return data; + } else if (data.length <= 55) { + data.unshift(128 + data.length); + return data; + } + const length = arrayifyInteger(data.length); + length.unshift(183 + length.length); + return length.concat(data); +} +const nibbles = "0123456789abcdef"; +function encodeRlp(object) { + let result = "0x"; + for (const v6 of _encode3(object)) { + result += nibbles[v6 >> 4]; + result += nibbles[v6 & 15]; + } + return result; +} +function uuidV4(randomBytes2) { + const bytes2 = getBytes(randomBytes2, "randomBytes"); + bytes2[6] = bytes2[6] & 15 | 64; + bytes2[8] = bytes2[8] & 63 | 128; + const value = hexlify(bytes2); + return [ + value.substring(2, 10), + value.substring(10, 14), + value.substring(14, 18), + value.substring(18, 22), + value.substring(22, 34) + ].join("-"); +} +const WordSize = 32; +const Padding = new Uint8Array(WordSize); +const passProperties = ["then"]; +const _guard$5 = {}; +const resultNames = /* @__PURE__ */ new WeakMap(); +function getNames(result) { + return resultNames.get(result); +} +function setNames(result, names) { + resultNames.set(result, names); +} +function throwError(name2, error) { + const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name2}`); + wrapped.error = error; + throw wrapped; +} +function toObject(names, items, deep) { + if (names.indexOf(null) >= 0) { + return items.map((item, index2) => { + if (item instanceof Result) { + return toObject(getNames(item), item, deep); + } + return item; + }); + } + return names.reduce((accum, name2, index2) => { + let item = items.getValue(name2); + if (!(name2 in accum)) { + if (deep && item instanceof Result) { + item = toObject(getNames(item), item, deep); + } + accum[name2] = item; + } + return accum; + }, {}); +} +const _Result = class _Result extends Array { + /** + * @private + */ + constructor(...args) { + const guard2 = args[0]; + let items = args[1]; + let names = (args[2] || []).slice(); + let wrap2 = true; + if (guard2 !== _guard$5) { + items = args; + names = []; + wrap2 = false; + } + super(items.length); + // No longer used; but cannot be removed as it will remove the + // #private field from the .d.ts which may break backwards + // compatibility + __privateAdd(this, _names, void 0); + items.forEach((item, index2) => { + this[index2] = item; + }); + const nameCounts = names.reduce((accum, name2) => { + if (typeof name2 === "string") { + accum.set(name2, (accum.get(name2) || 0) + 1); + } + return accum; + }, /* @__PURE__ */ new Map()); + setNames(this, Object.freeze(items.map((item, index2) => { + const name2 = names[index2]; + if (name2 != null && nameCounts.get(name2) === 1) { + return name2; + } + return null; + }))); + __privateSet(this, _names, []); + if (__privateGet(this, _names) == null) { + void __privateGet(this, _names); + } + if (!wrap2) { + return; + } + Object.freeze(this); + const proxy = new Proxy(this, { + get: (target, prop, receiver) => { + if (typeof prop === "string") { + if (prop.match(/^[0-9]+$/)) { + const index2 = getNumber(prop, "%index"); + if (index2 < 0 || index2 >= this.length) { + throw new RangeError("out of result range"); + } + const item = target[index2]; + if (item instanceof Error) { + throwError(`index ${index2}`, item); + } + return item; + } + if (passProperties.indexOf(prop) >= 0) { + return Reflect.get(target, prop, receiver); + } + const value = target[prop]; + if (value instanceof Function) { + return function(...args2) { + return value.apply(this === receiver ? target : this, args2); + }; + } else if (!(prop in target)) { + return target.getValue.apply(this === receiver ? target : this, [prop]); + } + } + return Reflect.get(target, prop, receiver); + } + }); + setNames(proxy, getNames(this)); + return proxy; + } + /** + * Returns the Result as a normal Array. If %%deep%%, any children + * which are Result objects are also converted to a normal Array. + * + * This will throw if there are any outstanding deferred + * errors. + */ + toArray(deep) { + const result = []; + this.forEach((item, index2) => { + if (item instanceof Error) { + throwError(`index ${index2}`, item); + } + if (deep && item instanceof _Result) { + item = item.toArray(deep); + } + result.push(item); + }); + return result; + } + /** + * Returns the Result as an Object with each name-value pair. If + * %%deep%%, any children which are Result objects are also + * converted to an Object. + * + * This will throw if any value is unnamed, or if there are + * any outstanding deferred errors. + */ + toObject(deep) { + const names = getNames(this); + return names.reduce((accum, name2, index2) => { + assert(name2 != null, `value at index ${index2} unnamed`, "UNSUPPORTED_OPERATION", { + operation: "toObject()" + }); + return toObject(names, this, deep); + }, {}); + } + /** + * @_ignore + */ + slice(start, end) { + if (start == null) { + start = 0; + } + if (start < 0) { + start += this.length; + if (start < 0) { + start = 0; + } + } + if (end == null) { + end = this.length; + } + if (end < 0) { + end += this.length; + if (end < 0) { + end = 0; + } + } + if (end > this.length) { + end = this.length; + } + const _names2 = getNames(this); + const result = [], names = []; + for (let i2 = start; i2 < end; i2++) { + result.push(this[i2]); + names.push(_names2[i2]); + } + return new _Result(_guard$5, result, names); + } + /** + * @_ignore + */ + filter(callback, thisArg) { + const _names2 = getNames(this); + const result = [], names = []; + for (let i2 = 0; i2 < this.length; i2++) { + const item = this[i2]; + if (item instanceof Error) { + throwError(`index ${i2}`, item); + } + if (callback.call(thisArg, item, i2, this)) { + result.push(item); + names.push(_names2[i2]); + } + } + return new _Result(_guard$5, result, names); + } + /** + * @_ignore + */ + map(callback, thisArg) { + const result = []; + for (let i2 = 0; i2 < this.length; i2++) { + const item = this[i2]; + if (item instanceof Error) { + throwError(`index ${i2}`, item); + } + result.push(callback.call(thisArg, item, i2, this)); + } + return result; + } + /** + * Returns the value for %%name%%. + * + * Since it is possible to have a key whose name conflicts with + * a method on a [[Result]] or its superclass Array, or any + * JavaScript keyword, this ensures all named values are still + * accessible by name. + */ + getValue(name2) { + const index2 = getNames(this).indexOf(name2); + if (index2 === -1) { + return void 0; + } + const value = this[index2]; + if (value instanceof Error) { + throwError(`property ${JSON.stringify(name2)}`, value.error); + } + return value; + } + /** + * Creates a new [[Result]] for %%items%% with each entry + * also accessible by its corresponding name in %%keys%%. + */ + static fromItems(items, keys2) { + return new _Result(_guard$5, items, keys2); + } +}; +_names = new WeakMap(); +let Result = _Result; +function getValue(value) { + let bytes2 = toBeArray(value); + assert(bytes2.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes2, length: WordSize, offset: bytes2.length }); + if (bytes2.length !== WordSize) { + bytes2 = getBytesCopy(concat([Padding.slice(bytes2.length % WordSize), bytes2])); + } + return bytes2; +} +class Coder { + constructor(name2, type2, localName, dynamic) { + // The coder name: + // - address, uint256, tuple, array, etc. + __publicField(this, "name"); + // The fully expanded type, including composite types: + // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. + __publicField(this, "type"); + // The localName bound in the signature, in this example it is "baz": + // - tuple(address foo, uint bar) baz + __publicField(this, "localName"); + // Whether this type is dynamic: + // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. + // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) + __publicField(this, "dynamic"); + defineProperties(this, { name: name2, type: type2, localName, dynamic }, { + name: "string", + type: "string", + localName: "string", + dynamic: "boolean" + }); + } + _throwError(message2, value) { + assertArgument(false, message2, this.localName, value); + } +} +class Writer { + constructor() { + __privateAdd(this, _writeData); + // An array of WordSize lengthed objects to concatenation + __privateAdd(this, _data, void 0); + __privateAdd(this, _dataLength, void 0); + __privateSet(this, _data, []); + __privateSet(this, _dataLength, 0); + } + get data() { + return concat(__privateGet(this, _data)); + } + get length() { + return __privateGet(this, _dataLength); + } + appendWriter(writer) { + return __privateMethod(this, _writeData, writeData_fn).call(this, getBytesCopy(writer.data)); + } + // Arrayish item; pad on the right to *nearest* WordSize + writeBytes(value) { + let bytes2 = getBytesCopy(value); + const paddingOffset = bytes2.length % WordSize; + if (paddingOffset) { + bytes2 = getBytesCopy(concat([bytes2, Padding.slice(paddingOffset)])); + } + return __privateMethod(this, _writeData, writeData_fn).call(this, bytes2); + } + // Numeric item; pad on the left *to* WordSize + writeValue(value) { + return __privateMethod(this, _writeData, writeData_fn).call(this, getValue(value)); + } + // Inserts a numeric place-holder, returning a callback that can + // be used to asjust the value later + writeUpdatableValue() { + const offset2 = __privateGet(this, _data).length; + __privateGet(this, _data).push(Padding); + __privateSet(this, _dataLength, __privateGet(this, _dataLength) + WordSize); + return (value) => { + __privateGet(this, _data)[offset2] = getValue(value); + }; + } +} +_data = new WeakMap(); +_dataLength = new WeakMap(); +_writeData = new WeakSet(); +writeData_fn = function(data) { + __privateGet(this, _data).push(data); + __privateSet(this, _dataLength, __privateGet(this, _dataLength) + data.length); + return data.length; +}; +const _Reader = class _Reader { + constructor(data, allowLoose, maxInflation) { + __privateAdd(this, _incrementBytesRead); + __privateAdd(this, _peekBytes); + // Allows incomplete unpadded data to be read; otherwise an error + // is raised if attempting to overrun the buffer. This is required + // to deal with an old Solidity bug, in which event data for + // external (not public thoguh) was tightly packed. + __publicField(this, "allowLoose"); + __privateAdd(this, _data2, void 0); + __privateAdd(this, _offset, void 0); + __privateAdd(this, _bytesRead, void 0); + __privateAdd(this, _parent, void 0); + __privateAdd(this, _maxInflation, void 0); + defineProperties(this, { allowLoose: !!allowLoose }); + __privateSet(this, _data2, getBytesCopy(data)); + __privateSet(this, _bytesRead, 0); + __privateSet(this, _parent, null); + __privateSet(this, _maxInflation, maxInflation != null ? maxInflation : 1024); + __privateSet(this, _offset, 0); + } + get data() { + return hexlify(__privateGet(this, _data2)); + } + get dataLength() { + return __privateGet(this, _data2).length; + } + get consumed() { + return __privateGet(this, _offset); + } + get bytes() { + return new Uint8Array(__privateGet(this, _data2)); + } + // Create a sub-reader with the same underlying data, but offset + subReader(offset2) { + const reader = new _Reader(__privateGet(this, _data2).slice(__privateGet(this, _offset) + offset2), this.allowLoose, __privateGet(this, _maxInflation)); + __privateSet(reader, _parent, this); + return reader; + } + // Read bytes + readBytes(length, loose) { + let bytes2 = __privateMethod(this, _peekBytes, peekBytes_fn).call(this, 0, length, !!loose); + __privateMethod(this, _incrementBytesRead, incrementBytesRead_fn).call(this, length); + __privateSet(this, _offset, __privateGet(this, _offset) + bytes2.length); + return bytes2.slice(0, length); + } + // Read a numeric values + readValue() { + return toBigInt(this.readBytes(WordSize)); + } + readIndex() { + return toNumber(this.readBytes(WordSize)); + } +}; +_data2 = new WeakMap(); +_offset = new WeakMap(); +_bytesRead = new WeakMap(); +_parent = new WeakMap(); +_maxInflation = new WeakMap(); +_incrementBytesRead = new WeakSet(); +incrementBytesRead_fn = function(count) { + var _a3; + if (__privateGet(this, _parent)) { + return __privateMethod(_a3 = __privateGet(this, _parent), _incrementBytesRead, incrementBytesRead_fn).call(_a3, count); + } + __privateSet(this, _bytesRead, __privateGet(this, _bytesRead) + count); + assert(__privateGet(this, _maxInflation) < 1 || __privateGet(this, _bytesRead) <= __privateGet(this, _maxInflation) * this.dataLength, `compressed ABI data exceeds inflation ratio of ${__privateGet(this, _maxInflation)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", { + buffer: getBytesCopy(__privateGet(this, _data2)), + offset: __privateGet(this, _offset), + length: count, + info: { + bytesRead: __privateGet(this, _bytesRead), + dataLength: this.dataLength + } + }); +}; +_peekBytes = new WeakSet(); +peekBytes_fn = function(offset2, length, loose) { + let alignedLength = Math.ceil(length / WordSize) * WordSize; + if (__privateGet(this, _offset) + alignedLength > __privateGet(this, _data2).length) { + if (this.allowLoose && loose && __privateGet(this, _offset) + length <= __privateGet(this, _data2).length) { + alignedLength = length; + } else { + assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { + buffer: getBytesCopy(__privateGet(this, _data2)), + length: __privateGet(this, _data2).length, + offset: __privateGet(this, _offset) + alignedLength + }); + } + } + return __privateGet(this, _data2).slice(__privateGet(this, _offset), __privateGet(this, _offset) + alignedLength); +}; +let Reader = _Reader; +function number(n5) { + if (!Number.isSafeInteger(n5) || n5 < 0) + throw new Error(`Wrong positive integer: ${n5}`); +} +function bytes(b2, ...lengths) { + if (!(b2 instanceof Uint8Array)) + throw new Error("Expected Uint8Array"); + if (lengths.length > 0 && !lengths.includes(b2.length)) + throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b2.length}`); +} +function hash2(hash3) { + if (typeof hash3 !== "function" || typeof hash3.create !== "function") + throw new Error("Hash should be wrapped by utils.wrapConstructor"); + number(hash3.outputLen); + number(hash3.blockLen); +} +function exists(instance2, checkFinished = true) { + if (instance2.destroyed) + throw new Error("Hash instance has been destroyed"); + if (checkFinished && instance2.finished) + throw new Error("Hash#digest() has already been called"); +} +function output(out, instance2) { + bytes(out); + const min = instance2.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } +} +const crypto$3 = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const u8a$1 = (a3) => a3 instanceof Uint8Array; +const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +const rotr = (word, shift) => word << 32 - shift | word >>> shift; +const isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; +if (!isLE) + throw new Error("Non little-endian hardware is not supported"); +const nextTick = async () => { +}; +async function asyncLoop(iters, tick, cb2) { + let ts2 = Date.now(); + for (let i2 = 0; i2 < iters; i2++) { + cb2(i2); + const diff = Date.now() - ts2; + if (diff >= 0 && diff < tick) + continue; + await nextTick(); + ts2 += diff; + } +} +function utf8ToBytes$1(str) { + if (typeof str !== "string") + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); +} +function toBytes2(data) { + if (typeof data === "string") + data = utf8ToBytes$1(data); + if (!u8a$1(data)) + throw new Error(`expected Uint8Array, got ${typeof data}`); + return data; +} +function concatBytes$1(...arrays) { + const r2 = new Uint8Array(arrays.reduce((sum, a3) => sum + a3.length, 0)); + let pad3 = 0; + arrays.forEach((a3) => { + if (!u8a$1(a3)) + throw new Error("Uint8Array expected"); + r2.set(a3, pad3); + pad3 += a3.length; + }); + return r2; +} +class Hash3 { + // Safe version that clones internal state + clone() { + return this._cloneInto(); + } +} +const toStr = {}.toString; +function checkOpts(defaults2, opts) { + if (opts !== void 0 && toStr.call(opts) !== "[object Object]") + throw new Error("Options should be object or undefined"); + const merged = Object.assign(defaults2, opts); + return merged; +} +function wrapConstructor(hashCons) { + const hashC = (msg) => hashCons().update(toBytes2(msg)).digest(); + const tmp = hashCons(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashCons(); + return hashC; +} +function randomBytes$2(bytesLength = 32) { + if (crypto$3 && typeof crypto$3.getRandomValues === "function") { + return crypto$3.getRandomValues(new Uint8Array(bytesLength)); + } + throw new Error("crypto.getRandomValues must be defined"); +} +class HMAC2 extends Hash3 { + constructor(hash$12, _key) { + super(); + this.finished = false; + this.destroyed = false; + hash2(hash$12); + const key2 = toBytes2(_key); + this.iHash = hash$12.create(); + if (typeof this.iHash.update !== "function") + throw new Error("Expected instance of class which extends utils.Hash"); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad3 = new Uint8Array(blockLen); + pad3.set(key2.length > blockLen ? hash$12.create().update(key2).digest() : key2); + for (let i2 = 0; i2 < pad3.length; i2++) + pad3[i2] ^= 54; + this.iHash.update(pad3); + this.oHash = hash$12.create(); + for (let i2 = 0; i2 < pad3.length; i2++) + pad3[i2] ^= 54 ^ 92; + this.oHash.update(pad3); + pad3.fill(0); + } + update(buf) { + exists(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + exists(this); + bytes(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to2) { + to2 || (to2 = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished: finished2, destroyed, blockLen, outputLen } = this; + to2 = to2; + to2.finished = finished2; + to2.destroyed = destroyed; + to2.blockLen = blockLen; + to2.outputLen = outputLen; + to2.oHash = oHash._cloneInto(to2.oHash); + to2.iHash = iHash._cloneInto(to2.iHash); + return to2; + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } +} +const hmac2 = (hash3, key2, message2) => new HMAC2(hash3, key2).update(message2).digest(); +hmac2.create = (hash3, key2) => new HMAC2(hash3, key2); +function pbkdf2Init(hash$12, _password, _salt, _opts) { + hash2(hash$12); + const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); + const { c: c2, dkLen, asyncTick } = opts; + number(c2); + number(dkLen); + number(asyncTick); + if (c2 < 1) + throw new Error("PBKDF2: iterations (c) should be >= 1"); + const password = toBytes2(_password); + const salt = toBytes2(_salt); + const DK2 = new Uint8Array(dkLen); + const PRF = hmac2.create(hash$12, password); + const PRFSalt = PRF._cloneInto().update(salt); + return { c: c2, dkLen, asyncTick, DK: DK2, PRF, PRFSalt }; +} +function pbkdf2Output(PRF, PRFSalt, DK2, prfW, u2) { + PRF.destroy(); + PRFSalt.destroy(); + if (prfW) + prfW.destroy(); + u2.fill(0); + return DK2; +} +function pbkdf2$1(hash3, password, salt, opts) { + const { c: c2, dkLen, DK: DK2, PRF, PRFSalt } = pbkdf2Init(hash3, password, salt, opts); + let prfW; + const arr = new Uint8Array(4); + const view = createView(arr); + const u2 = new Uint8Array(PRF.outputLen); + for (let ti2 = 1, pos = 0; pos < dkLen; ti2++, pos += PRF.outputLen) { + const Ti2 = DK2.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti2, false); + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u2); + Ti2.set(u2.subarray(0, Ti2.length)); + for (let ui2 = 1; ui2 < c2; ui2++) { + PRF._cloneInto(prfW).update(u2).digestInto(u2); + for (let i2 = 0; i2 < Ti2.length; i2++) + Ti2[i2] ^= u2[i2]; + } + } + return pbkdf2Output(PRF, PRFSalt, DK2, prfW, u2); +} +function setBigUint64(view, byteOffset, value, isLE2) { + if (typeof view.setBigUint64 === "function") + return view.setBigUint64(byteOffset, value, isLE2); + const _32n2 = BigInt(32); + const _u32_max = BigInt(4294967295); + const wh2 = Number(value >> _32n2 & _u32_max); + const wl = Number(value & _u32_max); + const h4 = isLE2 ? 4 : 0; + const l2 = isLE2 ? 0 : 4; + view.setUint32(byteOffset + h4, wh2, isLE2); + view.setUint32(byteOffset + l2, wl, isLE2); +} +class SHA2 extends Hash3 { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + exists(this); + const { view, buffer: buffer2, blockLen } = this; + data = toBytes2(data); + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + if (take === blockLen) { + const dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer2.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + exists(this); + output(out, this); + this.finished = true; + const { buffer: buffer2, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer2[pos++] = 128; + this.buffer.subarray(pos).fill(0); + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + for (let i2 = pos; i2 < blockLen; i2++) + buffer2[i2] = 0; + setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2); + this.process(view, 0); + const oview = createView(out); + const len = this.outputLen; + if (len % 4) + throw new Error("_sha2: outputLen should be aligned to 32bit"); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error("_sha2: outputLen bigger than state"); + for (let i2 = 0; i2 < outLen; i2++) + oview.setUint32(4 * i2, state[i2], isLE2); + } + digest() { + const { buffer: buffer2, outputLen } = this; + this.digestInto(buffer2); + const res = buffer2.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to2) { + to2 || (to2 = new this.constructor()); + to2.set(...this.get()); + const { blockLen, buffer: buffer2, length, finished: finished2, destroyed, pos } = this; + to2.length = length; + to2.pos = pos; + to2.finished = finished2; + to2.destroyed = destroyed; + if (length % blockLen) + to2.buffer.set(buffer2); + return to2; + } +} +const Chi = (a3, b2, c2) => a3 & b2 ^ ~a3 & c2; +const Maj = (a3, b2, c2) => a3 & b2 ^ a3 & c2 ^ b2 & c2; +const SHA256_K = /* @__PURE__ */ new Uint32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 +]); +const IV = /* @__PURE__ */ new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 +]); +const SHA256_W = /* @__PURE__ */ new Uint32Array(64); +let SHA256$1 = class SHA2562 extends SHA2 { + constructor() { + super(64, 32, 8, false); + this.A = IV[0] | 0; + this.B = IV[1] | 0; + this.C = IV[2] | 0; + this.D = IV[3] | 0; + this.E = IV[4] | 0; + this.F = IV[5] | 0; + this.G = IV[6] | 0; + this.H = IV[7] | 0; + } + get() { + const { A: A2, B: B2, C: C3, D: D2, E: E2, F: F2, G: G2, H: H2 } = this; + return [A2, B2, C3, D2, E2, F2, G2, H2]; + } + // prettier-ignore + set(A2, B2, C3, D2, E2, F2, G2, H2) { + this.A = A2 | 0; + this.B = B2 | 0; + this.C = C3 | 0; + this.D = D2 | 0; + this.E = E2 | 0; + this.F = F2 | 0; + this.G = G2 | 0; + this.H = H2 | 0; + } + process(view, offset2) { + for (let i2 = 0; i2 < 16; i2++, offset2 += 4) + SHA256_W[i2] = view.getUint32(offset2, false); + for (let i2 = 16; i2 < 64; i2++) { + const W15 = SHA256_W[i2 - 15]; + const W2 = SHA256_W[i2 - 2]; + const s02 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3; + const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10; + SHA256_W[i2] = s1 + SHA256_W[i2 - 7] + s02 + SHA256_W[i2 - 16] | 0; + } + let { A: A2, B: B2, C: C3, D: D2, E: E2, F: F2, G: G2, H: H2 } = this; + for (let i2 = 0; i2 < 64; i2++) { + const sigma1 = rotr(E2, 6) ^ rotr(E2, 11) ^ rotr(E2, 25); + const T12 = H2 + sigma1 + Chi(E2, F2, G2) + SHA256_K[i2] + SHA256_W[i2] | 0; + const sigma0 = rotr(A2, 2) ^ rotr(A2, 13) ^ rotr(A2, 22); + const T22 = sigma0 + Maj(A2, B2, C3) | 0; + H2 = G2; + G2 = F2; + F2 = E2; + E2 = D2 + T12 | 0; + D2 = C3; + C3 = B2; + B2 = A2; + A2 = T12 + T22 | 0; + } + A2 = A2 + this.A | 0; + B2 = B2 + this.B | 0; + C3 = C3 + this.C | 0; + D2 = D2 + this.D | 0; + E2 = E2 + this.E | 0; + F2 = F2 + this.F | 0; + G2 = G2 + this.G | 0; + H2 = H2 + this.H | 0; + this.set(A2, B2, C3, D2, E2, F2, G2, H2); + } + roundClean() { + SHA256_W.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } +}; +const sha256$1 = /* @__PURE__ */ wrapConstructor(() => new SHA256$1()); +const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); +const _32n = /* @__PURE__ */ BigInt(32); +function fromBig(n5, le2 = false) { + if (le2) + return { h: Number(n5 & U32_MASK64), l: Number(n5 >> _32n & U32_MASK64) }; + return { h: Number(n5 >> _32n & U32_MASK64) | 0, l: Number(n5 & U32_MASK64) | 0 }; +} +function split(lst, le2 = false) { + let Ah2 = new Uint32Array(lst.length); + let Al = new Uint32Array(lst.length); + for (let i2 = 0; i2 < lst.length; i2++) { + const { h: h4, l: l2 } = fromBig(lst[i2], le2); + [Ah2[i2], Al[i2]] = [h4, l2]; + } + return [Ah2, Al]; +} +const toBig = (h4, l2) => BigInt(h4 >>> 0) << _32n | BigInt(l2 >>> 0); +const shrSH = (h4, _l2, s2) => h4 >>> s2; +const shrSL = (h4, l2, s2) => h4 << 32 - s2 | l2 >>> s2; +const rotrSH = (h4, l2, s2) => h4 >>> s2 | l2 << 32 - s2; +const rotrSL = (h4, l2, s2) => h4 << 32 - s2 | l2 >>> s2; +const rotrBH = (h4, l2, s2) => h4 << 64 - s2 | l2 >>> s2 - 32; +const rotrBL = (h4, l2, s2) => h4 >>> s2 - 32 | l2 << 64 - s2; +const rotr32H = (_h3, l2) => l2; +const rotr32L = (h4, _l2) => h4; +const rotlSH = (h4, l2, s2) => h4 << s2 | l2 >>> 32 - s2; +const rotlSL = (h4, l2, s2) => l2 << s2 | h4 >>> 32 - s2; +const rotlBH = (h4, l2, s2) => l2 << s2 - 32 | h4 >>> 64 - s2; +const rotlBL = (h4, l2, s2) => h4 << s2 - 32 | l2 >>> 64 - s2; +function add5(Ah2, Al, Bh2, Bl) { + const l2 = (Al >>> 0) + (Bl >>> 0); + return { h: Ah2 + Bh2 + (l2 / 2 ** 32 | 0) | 0, l: l2 | 0 }; +} +const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); +const add3H = (low, Ah2, Bh2, Ch2) => Ah2 + Bh2 + Ch2 + (low / 2 ** 32 | 0) | 0; +const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); +const add4H = (low, Ah2, Bh2, Ch2, Dh2) => Ah2 + Bh2 + Ch2 + Dh2 + (low / 2 ** 32 | 0) | 0; +const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); +const add5H = (low, Ah2, Bh2, Ch2, Dh2, Eh2) => Ah2 + Bh2 + Ch2 + Dh2 + Eh2 + (low / 2 ** 32 | 0) | 0; +const u64 = { + fromBig, + split, + toBig, + shrSH, + shrSL, + rotrSH, + rotrSL, + rotrBH, + rotrBL, + rotr32H, + rotr32L, + rotlSH, + rotlSL, + rotlBH, + rotlBL, + add: add5, + add3L, + add3H, + add4L, + add4H, + add5H, + add5L +}; +const u64$1 = u64; +const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64$1.split([ + "0x428a2f98d728ae22", + "0x7137449123ef65cd", + "0xb5c0fbcfec4d3b2f", + "0xe9b5dba58189dbbc", + "0x3956c25bf348b538", + "0x59f111f1b605d019", + "0x923f82a4af194f9b", + "0xab1c5ed5da6d8118", + "0xd807aa98a3030242", + "0x12835b0145706fbe", + "0x243185be4ee4b28c", + "0x550c7dc3d5ffb4e2", + "0x72be5d74f27b896f", + "0x80deb1fe3b1696b1", + "0x9bdc06a725c71235", + "0xc19bf174cf692694", + "0xe49b69c19ef14ad2", + "0xefbe4786384f25e3", + "0x0fc19dc68b8cd5b5", + "0x240ca1cc77ac9c65", + "0x2de92c6f592b0275", + "0x4a7484aa6ea6e483", + "0x5cb0a9dcbd41fbd4", + "0x76f988da831153b5", + "0x983e5152ee66dfab", + "0xa831c66d2db43210", + "0xb00327c898fb213f", + "0xbf597fc7beef0ee4", + "0xc6e00bf33da88fc2", + "0xd5a79147930aa725", + "0x06ca6351e003826f", + "0x142929670a0e6e70", + "0x27b70a8546d22ffc", + "0x2e1b21385c26c926", + "0x4d2c6dfc5ac42aed", + "0x53380d139d95b3df", + "0x650a73548baf63de", + "0x766a0abb3c77b2a8", + "0x81c2c92e47edaee6", + "0x92722c851482353b", + "0xa2bfe8a14cf10364", + "0xa81a664bbc423001", + "0xc24b8b70d0f89791", + "0xc76c51a30654be30", + "0xd192e819d6ef5218", + "0xd69906245565a910", + "0xf40e35855771202a", + "0x106aa07032bbd1b8", + "0x19a4c116b8d2d0c8", + "0x1e376c085141ab53", + "0x2748774cdf8eeb99", + "0x34b0bcb5e19b48a8", + "0x391c0cb3c5c95a63", + "0x4ed8aa4ae3418acb", + "0x5b9cca4f7763e373", + "0x682e6ff3d6b2b8a3", + "0x748f82ee5defb2fc", + "0x78a5636f43172f60", + "0x84c87814a1f0ab72", + "0x8cc702081a6439ec", + "0x90befffa23631e28", + "0xa4506cebde82bde9", + "0xbef9a3f7b2c67915", + "0xc67178f2e372532b", + "0xca273eceea26619c", + "0xd186b8c721c0c207", + "0xeada7dd6cde0eb1e", + "0xf57d4f7fee6ed178", + "0x06f067aa72176fba", + "0x0a637dc5a2c898a6", + "0x113f9804bef90dae", + "0x1b710b35131c471b", + "0x28db77f523047d84", + "0x32caab7b40c72493", + "0x3c9ebe0a15c9bebc", + "0x431d67c49c100d4c", + "0x4cc5d4becb3e42b6", + "0x597f299cfc657e2a", + "0x5fcb6fab3ad6faec", + "0x6c44198c4a475817" +].map((n5) => BigInt(n5))))(); +const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); +const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); +class SHA5122 extends SHA2 { + constructor() { + super(128, 64, 16, false); + this.Ah = 1779033703 | 0; + this.Al = 4089235720 | 0; + this.Bh = 3144134277 | 0; + this.Bl = 2227873595 | 0; + this.Ch = 1013904242 | 0; + this.Cl = 4271175723 | 0; + this.Dh = 2773480762 | 0; + this.Dl = 1595750129 | 0; + this.Eh = 1359893119 | 0; + this.El = 2917565137 | 0; + this.Fh = 2600822924 | 0; + this.Fl = 725511199 | 0; + this.Gh = 528734635 | 0; + this.Gl = 4215389547 | 0; + this.Hh = 1541459225 | 0; + this.Hl = 327033209 | 0; + } + // prettier-ignore + get() { + const { Ah: Ah2, Al, Bh: Bh2, Bl, Ch: Ch2, Cl, Dh: Dh2, Dl, Eh: Eh2, El, Fh: Fh2, Fl, Gh: Gh2, Gl, Hh: Hh2, Hl } = this; + return [Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl]; + } + // prettier-ignore + set(Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl) { + this.Ah = Ah2 | 0; + this.Al = Al | 0; + this.Bh = Bh2 | 0; + this.Bl = Bl | 0; + this.Ch = Ch2 | 0; + this.Cl = Cl | 0; + this.Dh = Dh2 | 0; + this.Dl = Dl | 0; + this.Eh = Eh2 | 0; + this.El = El | 0; + this.Fh = Fh2 | 0; + this.Fl = Fl | 0; + this.Gh = Gh2 | 0; + this.Gl = Gl | 0; + this.Hh = Hh2 | 0; + this.Hl = Hl | 0; + } + process(view, offset2) { + for (let i2 = 0; i2 < 16; i2++, offset2 += 4) { + SHA512_W_H[i2] = view.getUint32(offset2); + SHA512_W_L[i2] = view.getUint32(offset2 += 4); + } + for (let i2 = 16; i2 < 80; i2++) { + const W15h = SHA512_W_H[i2 - 15] | 0; + const W15l = SHA512_W_L[i2 - 15] | 0; + const s0h = u64$1.rotrSH(W15h, W15l, 1) ^ u64$1.rotrSH(W15h, W15l, 8) ^ u64$1.shrSH(W15h, W15l, 7); + const s0l = u64$1.rotrSL(W15h, W15l, 1) ^ u64$1.rotrSL(W15h, W15l, 8) ^ u64$1.shrSL(W15h, W15l, 7); + const W2h = SHA512_W_H[i2 - 2] | 0; + const W2l = SHA512_W_L[i2 - 2] | 0; + const s1h = u64$1.rotrSH(W2h, W2l, 19) ^ u64$1.rotrBH(W2h, W2l, 61) ^ u64$1.shrSH(W2h, W2l, 6); + const s1l = u64$1.rotrSL(W2h, W2l, 19) ^ u64$1.rotrBL(W2h, W2l, 61) ^ u64$1.shrSL(W2h, W2l, 6); + const SUMl = u64$1.add4L(s0l, s1l, SHA512_W_L[i2 - 7], SHA512_W_L[i2 - 16]); + const SUMh = u64$1.add4H(SUMl, s0h, s1h, SHA512_W_H[i2 - 7], SHA512_W_H[i2 - 16]); + SHA512_W_H[i2] = SUMh | 0; + SHA512_W_L[i2] = SUMl | 0; + } + let { Ah: Ah2, Al, Bh: Bh2, Bl, Ch: Ch2, Cl, Dh: Dh2, Dl, Eh: Eh2, El, Fh: Fh2, Fl, Gh: Gh2, Gl, Hh: Hh2, Hl } = this; + for (let i2 = 0; i2 < 80; i2++) { + const sigma1h = u64$1.rotrSH(Eh2, El, 14) ^ u64$1.rotrSH(Eh2, El, 18) ^ u64$1.rotrBH(Eh2, El, 41); + const sigma1l = u64$1.rotrSL(Eh2, El, 14) ^ u64$1.rotrSL(Eh2, El, 18) ^ u64$1.rotrBL(Eh2, El, 41); + const CHIh = Eh2 & Fh2 ^ ~Eh2 & Gh2; + const CHIl = El & Fl ^ ~El & Gl; + const T1ll = u64$1.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i2], SHA512_W_L[i2]); + const T1h = u64$1.add5H(T1ll, Hh2, sigma1h, CHIh, SHA512_Kh[i2], SHA512_W_H[i2]); + const T1l = T1ll | 0; + const sigma0h = u64$1.rotrSH(Ah2, Al, 28) ^ u64$1.rotrBH(Ah2, Al, 34) ^ u64$1.rotrBH(Ah2, Al, 39); + const sigma0l = u64$1.rotrSL(Ah2, Al, 28) ^ u64$1.rotrBL(Ah2, Al, 34) ^ u64$1.rotrBL(Ah2, Al, 39); + const MAJh = Ah2 & Bh2 ^ Ah2 & Ch2 ^ Bh2 & Ch2; + const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; + Hh2 = Gh2 | 0; + Hl = Gl | 0; + Gh2 = Fh2 | 0; + Gl = Fl | 0; + Fh2 = Eh2 | 0; + Fl = El | 0; + ({ h: Eh2, l: El } = u64$1.add(Dh2 | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh2 = Ch2 | 0; + Dl = Cl | 0; + Ch2 = Bh2 | 0; + Cl = Bl | 0; + Bh2 = Ah2 | 0; + Bl = Al | 0; + const All = u64$1.add3L(T1l, sigma0l, MAJl); + Ah2 = u64$1.add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + ({ h: Ah2, l: Al } = u64$1.add(this.Ah | 0, this.Al | 0, Ah2 | 0, Al | 0)); + ({ h: Bh2, l: Bl } = u64$1.add(this.Bh | 0, this.Bl | 0, Bh2 | 0, Bl | 0)); + ({ h: Ch2, l: Cl } = u64$1.add(this.Ch | 0, this.Cl | 0, Ch2 | 0, Cl | 0)); + ({ h: Dh2, l: Dl } = u64$1.add(this.Dh | 0, this.Dl | 0, Dh2 | 0, Dl | 0)); + ({ h: Eh2, l: El } = u64$1.add(this.Eh | 0, this.El | 0, Eh2 | 0, El | 0)); + ({ h: Fh2, l: Fl } = u64$1.add(this.Fh | 0, this.Fl | 0, Fh2 | 0, Fl | 0)); + ({ h: Gh2, l: Gl } = u64$1.add(this.Gh | 0, this.Gl | 0, Gh2 | 0, Gl | 0)); + ({ h: Hh2, l: Hl } = u64$1.add(this.Hh | 0, this.Hl | 0, Hh2 | 0, Hl | 0)); + this.set(Ah2, Al, Bh2, Bl, Ch2, Cl, Dh2, Dl, Eh2, El, Fh2, Fl, Gh2, Gl, Hh2, Hl); + } + roundClean() { + SHA512_W_H.fill(0); + SHA512_W_L.fill(0); + } + destroy() { + this.buffer.fill(0); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } +} +const sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA5122()); +function getGlobal() { + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw new Error("unable to locate global object"); +} +const anyGlobal = getGlobal(); +const crypto$2 = anyGlobal.crypto || anyGlobal.msCrypto; +function createHash(algo) { + switch (algo) { + case "sha256": + return sha256$1.create(); + case "sha512": + return sha512.create(); + } + assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); +} +function createHmac(_algo, key2) { + const algo = { sha256: sha256$1, sha512 }[_algo]; + assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); + return hmac2.create(algo, key2); +} +function pbkdf2Sync(password, salt, iterations, keylen, _algo) { + const algo = { sha256: sha256$1, sha512 }[_algo]; + assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); + return pbkdf2$1(algo, password, salt, { c: iterations, dkLen: keylen }); +} +function randomBytes$1(length) { + assert(crypto$2 != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { + operation: "randomBytes" + }); + assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); + const result = new Uint8Array(length); + crypto$2.getRandomValues(result); + return result; +} +let locked$4 = false; +const _computeHmac = function(algorithm, key2, data) { + return createHmac(algorithm, key2).update(data).digest(); +}; +let __computeHmac = _computeHmac; +function computeHmac(algorithm, _key, _data5) { + const key2 = getBytes(_key, "key"); + const data = getBytes(_data5, "data"); + return hexlify(__computeHmac(algorithm, key2, data)); +} +computeHmac._ = _computeHmac; +computeHmac.lock = function() { + locked$4 = true; +}; +computeHmac.register = function(func) { + if (locked$4) { + throw new Error("computeHmac is locked"); + } + __computeHmac = func; +}; +Object.freeze(computeHmac); +const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; +const _0n$4 = /* @__PURE__ */ BigInt(0); +const _1n$5 = /* @__PURE__ */ BigInt(1); +const _2n$3 = /* @__PURE__ */ BigInt(2); +const _7n = /* @__PURE__ */ BigInt(7); +const _256n = /* @__PURE__ */ BigInt(256); +const _0x71n = /* @__PURE__ */ BigInt(113); +for (let round = 0, R3 = _1n$5, x3 = 1, y3 = 0; round < 24; round++) { + [x3, y3] = [y3, (2 * x3 + 3 * y3) % 5]; + SHA3_PI.push(2 * (5 * y3 + x3)); + SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64); + let t2 = _0n$4; + for (let j2 = 0; j2 < 7; j2++) { + R3 = (R3 << _1n$5 ^ (R3 >> _7n) * _0x71n) % _256n; + if (R3 & _2n$3) + t2 ^= _1n$5 << (_1n$5 << /* @__PURE__ */ BigInt(j2)) - _1n$5; + } + _SHA3_IOTA.push(t2); +} +const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true); +const rotlH = (h4, l2, s2) => s2 > 32 ? rotlBH(h4, l2, s2) : rotlSH(h4, l2, s2); +const rotlL = (h4, l2, s2) => s2 > 32 ? rotlBL(h4, l2, s2) : rotlSL(h4, l2, s2); +function keccakP(s2, rounds = 24) { + const B2 = new Uint32Array(5 * 2); + for (let round = 24 - rounds; round < 24; round++) { + for (let x3 = 0; x3 < 10; x3++) + B2[x3] = s2[x3] ^ s2[x3 + 10] ^ s2[x3 + 20] ^ s2[x3 + 30] ^ s2[x3 + 40]; + for (let x3 = 0; x3 < 10; x3 += 2) { + const idx1 = (x3 + 8) % 10; + const idx0 = (x3 + 2) % 10; + const B02 = B2[idx0]; + const B1 = B2[idx0 + 1]; + const Th2 = rotlH(B02, B1, 1) ^ B2[idx1]; + const Tl = rotlL(B02, B1, 1) ^ B2[idx1 + 1]; + for (let y3 = 0; y3 < 50; y3 += 10) { + s2[x3 + y3] ^= Th2; + s2[x3 + y3 + 1] ^= Tl; + } + } + let curH = s2[2]; + let curL = s2[3]; + for (let t2 = 0; t2 < 24; t2++) { + const shift = SHA3_ROTL[t2]; + const Th2 = rotlH(curH, curL, shift); + const Tl = rotlL(curH, curL, shift); + const PI = SHA3_PI[t2]; + curH = s2[PI]; + curL = s2[PI + 1]; + s2[PI] = Th2; + s2[PI + 1] = Tl; + } + for (let y3 = 0; y3 < 50; y3 += 10) { + for (let x3 = 0; x3 < 10; x3++) + B2[x3] = s2[y3 + x3]; + for (let x3 = 0; x3 < 10; x3++) + s2[y3 + x3] ^= ~B2[(x3 + 2) % 10] & B2[(x3 + 4) % 10]; + } + s2[0] ^= SHA3_IOTA_H[round]; + s2[1] ^= SHA3_IOTA_L[round]; + } + B2.fill(0); +} +class Keccak2 extends Hash3 { + // NOTE: we accept arguments in bytes instead of bits here. + constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { + super(); + this.blockLen = blockLen; + this.suffix = suffix; + this.outputLen = outputLen; + this.enableXOF = enableXOF; + this.rounds = rounds; + this.pos = 0; + this.posOut = 0; + this.finished = false; + this.destroyed = false; + number(outputLen); + if (0 >= this.blockLen || this.blockLen >= 200) + throw new Error("Sha3 supports only keccak-f1600 function"); + this.state = new Uint8Array(200); + this.state32 = u32(this.state); + } + keccak() { + keccakP(this.state32, this.rounds); + this.posOut = 0; + this.pos = 0; + } + update(data) { + exists(this); + const { blockLen, state } = this; + data = toBytes2(data); + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + for (let i2 = 0; i2 < take; i2++) + state[this.pos++] ^= data[pos++]; + if (this.pos === blockLen) + this.keccak(); + } + return this; + } + finish() { + if (this.finished) + return; + this.finished = true; + const { state, suffix, pos, blockLen } = this; + state[pos] ^= suffix; + if ((suffix & 128) !== 0 && pos === blockLen - 1) + this.keccak(); + state[blockLen - 1] ^= 128; + this.keccak(); + } + writeInto(out) { + exists(this, false); + bytes(out); + this.finish(); + const bufferOut = this.state; + const { blockLen } = this; + for (let pos = 0, len = out.length; pos < len; ) { + if (this.posOut >= blockLen) + this.keccak(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; + } + return out; + } + xofInto(out) { + if (!this.enableXOF) + throw new Error("XOF is not possible for this instance"); + return this.writeInto(out); + } + xof(bytes2) { + number(bytes2); + return this.xofInto(new Uint8Array(bytes2)); + } + digestInto(out) { + output(out, this); + if (this.finished) + throw new Error("digest() was already called"); + this.writeInto(out); + this.destroy(); + return out; + } + digest() { + return this.digestInto(new Uint8Array(this.outputLen)); + } + destroy() { + this.destroyed = true; + this.state.fill(0); + } + _cloneInto(to2) { + const { blockLen, suffix, outputLen, rounds, enableXOF } = this; + to2 || (to2 = new Keccak2(blockLen, suffix, outputLen, enableXOF, rounds)); + to2.state32.set(this.state32); + to2.pos = this.pos; + to2.posOut = this.posOut; + to2.finished = this.finished; + to2.rounds = rounds; + to2.suffix = suffix; + to2.outputLen = outputLen; + to2.enableXOF = enableXOF; + to2.destroyed = this.destroyed; + return to2; + } +} +const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak2(blockLen, suffix, outputLen)); +const keccak_256 = /* @__PURE__ */ gen(1, 136, 256 / 8); +let locked$3 = false; +const _keccak256 = function(data) { + return keccak_256(data); +}; +let __keccak256 = _keccak256; +function keccak256(_data5) { + const data = getBytes(_data5, "data"); + return hexlify(__keccak256(data)); +} +keccak256._ = _keccak256; +keccak256.lock = function() { + locked$3 = true; +}; +keccak256.register = function(func) { + if (locked$3) { + throw new TypeError("keccak256 is locked"); + } + __keccak256 = func; +}; +Object.freeze(keccak256); +const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); +const Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_3, i2) => i2); +const Pi = /* @__PURE__ */ Id.map((i2) => (9 * i2 + 5) % 16); +let idxL = [Id]; +let idxR = [Pi]; +for (let i2 = 0; i2 < 4; i2++) + for (let j2 of [idxL, idxR]) + j2.push(j2[i2].map((k2) => Rho[k2])); +const shifts = /* @__PURE__ */ [ + [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], + [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], + [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], + [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], + [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5] +].map((i2) => new Uint8Array(i2)); +const shiftsL = /* @__PURE__ */ idxL.map((idx, i2) => idx.map((j2) => shifts[i2][j2])); +const shiftsR = /* @__PURE__ */ idxR.map((idx, i2) => idx.map((j2) => shifts[i2][j2])); +const Kl = /* @__PURE__ */ new Uint32Array([ + 0, + 1518500249, + 1859775393, + 2400959708, + 2840853838 +]); +const Kr = /* @__PURE__ */ new Uint32Array([ + 1352829926, + 1548603684, + 1836072691, + 2053994217, + 0 +]); +const rotl$1 = (word, shift) => word << shift | word >>> 32 - shift; +function f3(group, x3, y3, z3) { + if (group === 0) + return x3 ^ y3 ^ z3; + else if (group === 1) + return x3 & y3 | ~x3 & z3; + else if (group === 2) + return (x3 | ~y3) ^ z3; + else if (group === 3) + return x3 & z3 | y3 & ~z3; + else + return x3 ^ (y3 | ~z3); +} +const BUF = /* @__PURE__ */ new Uint32Array(16); +class RIPEMD160 extends SHA2 { + constructor() { + super(64, 20, 8, true); + this.h0 = 1732584193 | 0; + this.h1 = 4023233417 | 0; + this.h2 = 2562383102 | 0; + this.h3 = 271733878 | 0; + this.h4 = 3285377520 | 0; + } + get() { + const { h0, h1, h2: h22, h3: h32, h4 } = this; + return [h0, h1, h22, h32, h4]; + } + set(h0, h1, h22, h32, h4) { + this.h0 = h0 | 0; + this.h1 = h1 | 0; + this.h2 = h22 | 0; + this.h3 = h32 | 0; + this.h4 = h4 | 0; + } + process(view, offset2) { + for (let i2 = 0; i2 < 16; i2++, offset2 += 4) + BUF[i2] = view.getUint32(offset2, true); + let al2 = this.h0 | 0, ar2 = al2, bl2 = this.h1 | 0, br2 = bl2, cl2 = this.h2 | 0, cr2 = cl2, dl2 = this.h3 | 0, dr3 = dl2, el2 = this.h4 | 0, er2 = el2; + for (let group = 0; group < 5; group++) { + const rGroup = 4 - group; + const hbl = Kl[group], hbr = Kr[group]; + const rl2 = idxL[group], rr2 = idxR[group]; + const sl2 = shiftsL[group], sr2 = shiftsR[group]; + for (let i2 = 0; i2 < 16; i2++) { + const tl2 = rotl$1(al2 + f3(group, bl2, cl2, dl2) + BUF[rl2[i2]] + hbl, sl2[i2]) + el2 | 0; + al2 = el2, el2 = dl2, dl2 = rotl$1(cl2, 10) | 0, cl2 = bl2, bl2 = tl2; + } + for (let i2 = 0; i2 < 16; i2++) { + const tr2 = rotl$1(ar2 + f3(rGroup, br2, cr2, dr3) + BUF[rr2[i2]] + hbr, sr2[i2]) + er2 | 0; + ar2 = er2, er2 = dr3, dr3 = rotl$1(cr2, 10) | 0, cr2 = br2, br2 = tr2; + } + } + this.set(this.h1 + cl2 + dr3 | 0, this.h2 + dl2 + er2 | 0, this.h3 + el2 + ar2 | 0, this.h4 + al2 + br2 | 0, this.h0 + bl2 + cr2 | 0); + } + roundClean() { + BUF.fill(0); + } + destroy() { + this.destroyed = true; + this.buffer.fill(0); + this.set(0, 0, 0, 0, 0); + } +} +const ripemd160$1 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160()); +let locked$2 = false; +const _ripemd160 = function(data) { + return ripemd160$1(data); +}; +let __ripemd160 = _ripemd160; +function ripemd160(_data5) { + const data = getBytes(_data5, "data"); + return hexlify(__ripemd160(data)); +} +ripemd160._ = _ripemd160; +ripemd160.lock = function() { + locked$2 = true; +}; +ripemd160.register = function(func) { + if (locked$2) { + throw new TypeError("ripemd160 is locked"); + } + __ripemd160 = func; +}; +Object.freeze(ripemd160); +let locked$1 = false; +const _pbkdf2 = function(password, salt, iterations, keylen, algo) { + return pbkdf2Sync(password, salt, iterations, keylen, algo); +}; +let __pbkdf2 = _pbkdf2; +function pbkdf2(_password, _salt, iterations, keylen, algo) { + const password = getBytes(_password, "password"); + const salt = getBytes(_salt, "salt"); + return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); +} +pbkdf2._ = _pbkdf2; +pbkdf2.lock = function() { + locked$1 = true; +}; +pbkdf2.register = function(func) { + if (locked$1) { + throw new Error("pbkdf2 is locked"); + } + __pbkdf2 = func; +}; +Object.freeze(pbkdf2); +let locked = false; +const _randomBytes = function(length) { + return new Uint8Array(randomBytes$1(length)); +}; +let __randomBytes = _randomBytes; +function randomBytes(length) { + return __randomBytes(length); +} +randomBytes._ = _randomBytes; +randomBytes.lock = function() { + locked = true; +}; +randomBytes.register = function(func) { + if (locked) { + throw new Error("randomBytes is locked"); + } + __randomBytes = func; +}; +Object.freeze(randomBytes); +const rotl = (a3, b2) => a3 << b2 | a3 >>> 32 - b2; +function XorAndSalsa(prev, pi2, input, ii2, out, oi2) { + let y00 = prev[pi2++] ^ input[ii2++], y01 = prev[pi2++] ^ input[ii2++]; + let y02 = prev[pi2++] ^ input[ii2++], y03 = prev[pi2++] ^ input[ii2++]; + let y04 = prev[pi2++] ^ input[ii2++], y05 = prev[pi2++] ^ input[ii2++]; + let y06 = prev[pi2++] ^ input[ii2++], y07 = prev[pi2++] ^ input[ii2++]; + let y08 = prev[pi2++] ^ input[ii2++], y09 = prev[pi2++] ^ input[ii2++]; + let y10 = prev[pi2++] ^ input[ii2++], y11 = prev[pi2++] ^ input[ii2++]; + let y12 = prev[pi2++] ^ input[ii2++], y13 = prev[pi2++] ^ input[ii2++]; + let y14 = prev[pi2++] ^ input[ii2++], y15 = prev[pi2++] ^ input[ii2++]; + let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; + for (let i2 = 0; i2 < 8; i2 += 2) { + x04 ^= rotl(x00 + x12 | 0, 7); + x08 ^= rotl(x04 + x00 | 0, 9); + x12 ^= rotl(x08 + x04 | 0, 13); + x00 ^= rotl(x12 + x08 | 0, 18); + x09 ^= rotl(x05 + x01 | 0, 7); + x13 ^= rotl(x09 + x05 | 0, 9); + x01 ^= rotl(x13 + x09 | 0, 13); + x05 ^= rotl(x01 + x13 | 0, 18); + x14 ^= rotl(x10 + x06 | 0, 7); + x02 ^= rotl(x14 + x10 | 0, 9); + x06 ^= rotl(x02 + x14 | 0, 13); + x10 ^= rotl(x06 + x02 | 0, 18); + x03 ^= rotl(x15 + x11 | 0, 7); + x07 ^= rotl(x03 + x15 | 0, 9); + x11 ^= rotl(x07 + x03 | 0, 13); + x15 ^= rotl(x11 + x07 | 0, 18); + x01 ^= rotl(x00 + x03 | 0, 7); + x02 ^= rotl(x01 + x00 | 0, 9); + x03 ^= rotl(x02 + x01 | 0, 13); + x00 ^= rotl(x03 + x02 | 0, 18); + x06 ^= rotl(x05 + x04 | 0, 7); + x07 ^= rotl(x06 + x05 | 0, 9); + x04 ^= rotl(x07 + x06 | 0, 13); + x05 ^= rotl(x04 + x07 | 0, 18); + x11 ^= rotl(x10 + x09 | 0, 7); + x08 ^= rotl(x11 + x10 | 0, 9); + x09 ^= rotl(x08 + x11 | 0, 13); + x10 ^= rotl(x09 + x08 | 0, 18); + x12 ^= rotl(x15 + x14 | 0, 7); + x13 ^= rotl(x12 + x15 | 0, 9); + x14 ^= rotl(x13 + x12 | 0, 13); + x15 ^= rotl(x14 + x13 | 0, 18); + } + out[oi2++] = y00 + x00 | 0; + out[oi2++] = y01 + x01 | 0; + out[oi2++] = y02 + x02 | 0; + out[oi2++] = y03 + x03 | 0; + out[oi2++] = y04 + x04 | 0; + out[oi2++] = y05 + x05 | 0; + out[oi2++] = y06 + x06 | 0; + out[oi2++] = y07 + x07 | 0; + out[oi2++] = y08 + x08 | 0; + out[oi2++] = y09 + x09 | 0; + out[oi2++] = y10 + x10 | 0; + out[oi2++] = y11 + x11 | 0; + out[oi2++] = y12 + x12 | 0; + out[oi2++] = y13 + x13 | 0; + out[oi2++] = y14 + x14 | 0; + out[oi2++] = y15 + x15 | 0; +} +function BlockMix(input, ii2, out, oi2, r2) { + let head = oi2 + 0; + let tail = oi2 + 16 * r2; + for (let i2 = 0; i2 < 16; i2++) + out[tail + i2] = input[ii2 + (2 * r2 - 1) * 16 + i2]; + for (let i2 = 0; i2 < r2; i2++, head += 16, ii2 += 16) { + XorAndSalsa(out, tail, input, ii2, out, head); + if (i2 > 0) + tail += 16; + XorAndSalsa(out, head, input, ii2 += 16, out, tail); + } +} +function scryptInit(password, salt, _opts) { + const opts = checkOpts({ + dkLen: 32, + asyncTick: 10, + maxmem: 1024 ** 3 + 1024 + }, _opts); + const { N: N2, r: r2, p: p3, dkLen, asyncTick, maxmem, onProgress } = opts; + number(N2); + number(r2); + number(p3); + number(dkLen); + number(asyncTick); + number(maxmem); + if (onProgress !== void 0 && typeof onProgress !== "function") + throw new Error("progressCb should be function"); + const blockSize = 128 * r2; + const blockSize32 = blockSize / 4; + if (N2 <= 1 || (N2 & N2 - 1) !== 0 || N2 >= 2 ** (blockSize / 8) || N2 > 2 ** 32) { + throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32"); + } + if (p3 < 0 || p3 > (2 ** 32 - 1) * 32 / blockSize) { + throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)"); + } + if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { + throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32"); + } + const memUsed = blockSize * (N2 + p3); + if (memUsed > maxmem) { + throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`); + } + const B2 = pbkdf2$1(sha256$1, password, salt, { c: 1, dkLen: blockSize * p3 }); + const B32 = u32(B2); + const V3 = u32(new Uint8Array(blockSize * N2)); + const tmp = u32(new Uint8Array(blockSize)); + let blockMixCb = () => { + }; + if (onProgress) { + const totalBlockMix = 2 * N2 * p3; + const callbackPer = Math.max(Math.floor(totalBlockMix / 1e4), 1); + let blockMixCnt = 0; + blockMixCb = () => { + blockMixCnt++; + if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) + onProgress(blockMixCnt / totalBlockMix); + }; + } + return { N: N2, r: r2, p: p3, dkLen, blockSize32, V: V3, B32, B: B2, tmp, blockMixCb, asyncTick }; +} +function scryptOutput(password, dkLen, B2, V3, tmp) { + const res = pbkdf2$1(sha256$1, password, B2, { c: 1, dkLen }); + B2.fill(0); + V3.fill(0); + tmp.fill(0); + return res; +} +function scrypt$1(password, salt, opts) { + const { N: N2, r: r2, p: p3, dkLen, blockSize32, V: V3, B32, B: B2, tmp, blockMixCb } = scryptInit(password, salt, opts); + for (let pi2 = 0; pi2 < p3; pi2++) { + const Pi2 = blockSize32 * pi2; + for (let i2 = 0; i2 < blockSize32; i2++) + V3[i2] = B32[Pi2 + i2]; + for (let i2 = 0, pos = 0; i2 < N2 - 1; i2++) { + BlockMix(V3, pos, V3, pos += blockSize32, r2); + blockMixCb(); + } + BlockMix(V3, (N2 - 1) * blockSize32, B32, Pi2, r2); + blockMixCb(); + for (let i2 = 0; i2 < N2; i2++) { + const j2 = B32[Pi2 + blockSize32 - 16] % N2; + for (let k2 = 0; k2 < blockSize32; k2++) + tmp[k2] = B32[Pi2 + k2] ^ V3[j2 * blockSize32 + k2]; + BlockMix(tmp, 0, B32, Pi2, r2); + blockMixCb(); + } + } + return scryptOutput(password, dkLen, B2, V3, tmp); +} +async function scryptAsync(password, salt, opts) { + const { N: N2, r: r2, p: p3, dkLen, blockSize32, V: V3, B32, B: B2, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); + for (let pi2 = 0; pi2 < p3; pi2++) { + const Pi2 = blockSize32 * pi2; + for (let i2 = 0; i2 < blockSize32; i2++) + V3[i2] = B32[Pi2 + i2]; + let pos = 0; + await asyncLoop(N2 - 1, asyncTick, () => { + BlockMix(V3, pos, V3, pos += blockSize32, r2); + blockMixCb(); + }); + BlockMix(V3, (N2 - 1) * blockSize32, B32, Pi2, r2); + blockMixCb(); + await asyncLoop(N2, asyncTick, () => { + const j2 = B32[Pi2 + blockSize32 - 16] % N2; + for (let k2 = 0; k2 < blockSize32; k2++) + tmp[k2] = B32[Pi2 + k2] ^ V3[j2 * blockSize32 + k2]; + BlockMix(tmp, 0, B32, Pi2, r2); + blockMixCb(); + }); + } + return scryptOutput(password, dkLen, B2, V3, tmp); +} +let lockedSync = false, lockedAsync = false; +const _scryptAsync = async function(passwd, salt, N2, r2, p3, dkLen, onProgress) { + return await scryptAsync(passwd, salt, { N: N2, r: r2, p: p3, dkLen, onProgress }); +}; +const _scryptSync = function(passwd, salt, N2, r2, p3, dkLen) { + return scrypt$1(passwd, salt, { N: N2, r: r2, p: p3, dkLen }); +}; +let __scryptAsync = _scryptAsync; +let __scryptSync = _scryptSync; +async function scrypt(_passwd, _salt, N2, r2, p3, dkLen, progress) { + const passwd = getBytes(_passwd, "passwd"); + const salt = getBytes(_salt, "salt"); + return hexlify(await __scryptAsync(passwd, salt, N2, r2, p3, dkLen, progress)); +} +scrypt._ = _scryptAsync; +scrypt.lock = function() { + lockedAsync = true; +}; +scrypt.register = function(func) { + if (lockedAsync) { + throw new Error("scrypt is locked"); + } + __scryptAsync = func; +}; +Object.freeze(scrypt); +function scryptSync(_passwd, _salt, N2, r2, p3, dkLen) { + const passwd = getBytes(_passwd, "passwd"); + const salt = getBytes(_salt, "salt"); + return hexlify(__scryptSync(passwd, salt, N2, r2, p3, dkLen)); +} +scryptSync._ = _scryptSync; +scryptSync.lock = function() { + lockedSync = true; +}; +scryptSync.register = function(func) { + if (lockedSync) { + throw new Error("scryptSync is locked"); + } + __scryptSync = func; +}; +Object.freeze(scryptSync); +const _sha256 = function(data) { + return createHash("sha256").update(data).digest(); +}; +let __sha256 = _sha256; +let locked256 = false; +function sha256(_data5) { + const data = getBytes(_data5, "data"); + return hexlify(__sha256(data)); +} +sha256._ = _sha256; +sha256.lock = function() { + locked256 = true; +}; +sha256.register = function(func) { + if (locked256) { + throw new Error("sha256 is locked"); + } + __sha256 = func; +}; +Object.freeze(sha256); +Object.freeze(sha256); +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const _0n$3 = BigInt(0); +const _1n$4 = BigInt(1); +const _2n$2 = BigInt(2); +const u8a = (a3) => a3 instanceof Uint8Array; +const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_3, i2) => i2.toString(16).padStart(2, "0")); +function bytesToHex(bytes2) { + if (!u8a(bytes2)) + throw new Error("Uint8Array expected"); + let hex = ""; + for (let i2 = 0; i2 < bytes2.length; i2++) { + hex += hexes[bytes2[i2]]; + } + return hex; +} +function numberToHexUnpadded(num) { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; +} +function hexToNumber(hex) { + if (typeof hex !== "string") + throw new Error("hex string expected, got " + typeof hex); + return BigInt(hex === "" ? "0" : `0x${hex}`); +} +function hexToBytes(hex) { + if (typeof hex !== "string") + throw new Error("hex string expected, got " + typeof hex); + const len = hex.length; + if (len % 2) + throw new Error("padded hex string expected, got unpadded hex of length " + len); + const array2 = new Uint8Array(len / 2); + for (let i2 = 0; i2 < array2.length; i2++) { + const j2 = i2 * 2; + const hexByte = hex.slice(j2, j2 + 2); + const byte2 = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte2) || byte2 < 0) + throw new Error("Invalid byte sequence"); + array2[i2] = byte2; + } + return array2; +} +function bytesToNumberBE(bytes2) { + return hexToNumber(bytesToHex(bytes2)); +} +function bytesToNumberLE(bytes2) { + if (!u8a(bytes2)) + throw new Error("Uint8Array expected"); + return hexToNumber(bytesToHex(Uint8Array.from(bytes2).reverse())); +} +function numberToBytesBE(n5, len) { + return hexToBytes(n5.toString(16).padStart(len * 2, "0")); +} +function numberToBytesLE(n5, len) { + return numberToBytesBE(n5, len).reverse(); +} +function numberToVarBytesBE(n5) { + return hexToBytes(numberToHexUnpadded(n5)); +} +function ensureBytes(title, hex, expectedLength) { + let res; + if (typeof hex === "string") { + try { + res = hexToBytes(hex); + } catch (e18) { + throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e18}`); + } + } else if (u8a(hex)) { + res = Uint8Array.from(hex); + } else { + throw new Error(`${title} must be hex string or Uint8Array`); + } + const len = res.length; + if (typeof expectedLength === "number" && len !== expectedLength) + throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); + return res; +} +function concatBytes(...arrays) { + const r2 = new Uint8Array(arrays.reduce((sum, a3) => sum + a3.length, 0)); + let pad3 = 0; + arrays.forEach((a3) => { + if (!u8a(a3)) + throw new Error("Uint8Array expected"); + r2.set(a3, pad3); + pad3 += a3.length; + }); + return r2; +} +function equalBytes(b1, b2) { + if (b1.length !== b2.length) + return false; + for (let i2 = 0; i2 < b1.length; i2++) + if (b1[i2] !== b2[i2]) + return false; + return true; +} +function utf8ToBytes(str) { + if (typeof str !== "string") + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); +} +function bitLen(n5) { + let len; + for (len = 0; n5 > _0n$3; n5 >>= _1n$4, len += 1) + ; + return len; +} +function bitGet(n5, pos) { + return n5 >> BigInt(pos) & _1n$4; +} +const bitSet = (n5, pos, value) => { + return n5 | (value ? _1n$4 : _0n$3) << BigInt(pos); +}; +const bitMask = (n5) => (_2n$2 << BigInt(n5 - 1)) - _1n$4; +const u8n = (data) => new Uint8Array(data); +const u8fr = (arr) => Uint8Array.from(arr); +function createHmacDrbg(hashLen, qByteLen, hmacFn) { + if (typeof hashLen !== "number" || hashLen < 2) + throw new Error("hashLen must be a number"); + if (typeof qByteLen !== "number" || qByteLen < 2) + throw new Error("qByteLen must be a number"); + if (typeof hmacFn !== "function") + throw new Error("hmacFn must be a function"); + let v6 = u8n(hashLen); + let k2 = u8n(hashLen); + let i2 = 0; + const reset = () => { + v6.fill(1); + k2.fill(0); + i2 = 0; + }; + const h4 = (...b2) => hmacFn(k2, v6, ...b2); + const reseed2 = (seed = u8n()) => { + k2 = h4(u8fr([0]), seed); + v6 = h4(); + if (seed.length === 0) + return; + k2 = h4(u8fr([1]), seed); + v6 = h4(); + }; + const gen2 = () => { + if (i2++ >= 1e3) + throw new Error("drbg: tried 1000 values"); + let len = 0; + const out = []; + while (len < qByteLen) { + v6 = h4(); + const sl2 = v6.slice(); + out.push(sl2); + len += v6.length; + } + return concatBytes(...out); + }; + const genUntil = (seed, pred) => { + reset(); + reseed2(seed); + let res = void 0; + while (!(res = pred(gen2()))) + reseed2(); + reset(); + return res; + }; + return genUntil; +} +const validatorFns = { + bigint: (val) => typeof val === "bigint", + function: (val) => typeof val === "function", + boolean: (val) => typeof val === "boolean", + string: (val) => typeof val === "string", + stringOrUint8Array: (val) => typeof val === "string" || val instanceof Uint8Array, + isSafeInteger: (val) => Number.isSafeInteger(val), + array: (val) => Array.isArray(val), + field: (val, object) => object.Fp.isValid(val), + hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen) +}; +function validateObject(object, validators2, optValidators = {}) { + const checkField = (fieldName, type2, isOptional) => { + const checkVal = validatorFns[type2]; + if (typeof checkVal !== "function") + throw new Error(`Invalid validator "${type2}", expected function`); + const val = object[fieldName]; + if (isOptional && val === void 0) + return; + if (!checkVal(val, object)) { + throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type2}`); + } + }; + for (const [fieldName, type2] of Object.entries(validators2)) + checkField(fieldName, type2, false); + for (const [fieldName, type2] of Object.entries(optValidators)) + checkField(fieldName, type2, true); + return object; +} +const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + bitGet, + bitLen, + bitMask, + bitSet, + bytesToHex, + bytesToNumberBE, + bytesToNumberLE, + concatBytes, + createHmacDrbg, + ensureBytes, + equalBytes, + hexToBytes, + hexToNumber, + numberToBytesBE, + numberToBytesLE, + numberToHexUnpadded, + numberToVarBytesBE, + utf8ToBytes, + validateObject +}, Symbol.toStringTag, { value: "Module" })); +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const _0n$2 = BigInt(0), _1n$3 = BigInt(1), _2n$1 = BigInt(2), _3n$1 = BigInt(3); +const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); +BigInt(9); +BigInt(16); +function mod(a3, b2) { + const result = a3 % b2; + return result >= _0n$2 ? result : b2 + result; +} +function pow(num, power, modulo) { + if (modulo <= _0n$2 || power < _0n$2) + throw new Error("Expected power/modulo > 0"); + if (modulo === _1n$3) + return _0n$2; + let res = _1n$3; + while (power > _0n$2) { + if (power & _1n$3) + res = res * num % modulo; + num = num * num % modulo; + power >>= _1n$3; + } + return res; +} +function pow2(x3, power, modulo) { + let res = x3; + while (power-- > _0n$2) { + res *= res; + res %= modulo; + } + return res; +} +function invert(number2, modulo) { + if (number2 === _0n$2 || modulo <= _0n$2) { + throw new Error(`invert: expected positive integers, got n=${number2} mod=${modulo}`); + } + let a3 = mod(number2, modulo); + let b2 = modulo; + let x3 = _0n$2, u2 = _1n$3; + while (a3 !== _0n$2) { + const q2 = b2 / a3; + const r2 = b2 % a3; + const m3 = x3 - u2 * q2; + b2 = a3, a3 = r2, x3 = u2, u2 = m3; + } + const gcd = b2; + if (gcd !== _1n$3) + throw new Error("invert: does not exist"); + return mod(x3, modulo); +} +function tonelliShanks(P2) { + const legendreC = (P2 - _1n$3) / _2n$1; + let Q2, S4, Z2; + for (Q2 = P2 - _1n$3, S4 = 0; Q2 % _2n$1 === _0n$2; Q2 /= _2n$1, S4++) + ; + for (Z2 = _2n$1; Z2 < P2 && pow(Z2, legendreC, P2) !== P2 - _1n$3; Z2++) + ; + if (S4 === 1) { + const p1div4 = (P2 + _1n$3) / _4n; + return function tonelliFast(Fp2, n5) { + const root = Fp2.pow(n5, p1div4); + if (!Fp2.eql(Fp2.sqr(root), n5)) + throw new Error("Cannot find square root"); + return root; + }; + } + const Q1div2 = (Q2 + _1n$3) / _2n$1; + return function tonelliSlow(Fp2, n5) { + if (Fp2.pow(n5, legendreC) === Fp2.neg(Fp2.ONE)) + throw new Error("Cannot find square root"); + let r2 = S4; + let g3 = Fp2.pow(Fp2.mul(Fp2.ONE, Z2), Q2); + let x3 = Fp2.pow(n5, Q1div2); + let b2 = Fp2.pow(n5, Q2); + while (!Fp2.eql(b2, Fp2.ONE)) { + if (Fp2.eql(b2, Fp2.ZERO)) + return Fp2.ZERO; + let m3 = 1; + for (let t2 = Fp2.sqr(b2); m3 < r2; m3++) { + if (Fp2.eql(t2, Fp2.ONE)) + break; + t2 = Fp2.sqr(t2); + } + const ge2 = Fp2.pow(g3, _1n$3 << BigInt(r2 - m3 - 1)); + g3 = Fp2.sqr(ge2); + x3 = Fp2.mul(x3, ge2); + b2 = Fp2.mul(b2, g3); + r2 = m3; + } + return x3; + }; +} +function FpSqrt(P2) { + if (P2 % _4n === _3n$1) { + const p1div4 = (P2 + _1n$3) / _4n; + return function sqrt3mod4(Fp2, n5) { + const root = Fp2.pow(n5, p1div4); + if (!Fp2.eql(Fp2.sqr(root), n5)) + throw new Error("Cannot find square root"); + return root; + }; + } + if (P2 % _8n === _5n) { + const c1 = (P2 - _5n) / _8n; + return function sqrt5mod8(Fp2, n5) { + const n22 = Fp2.mul(n5, _2n$1); + const v6 = Fp2.pow(n22, c1); + const nv2 = Fp2.mul(n5, v6); + const i2 = Fp2.mul(Fp2.mul(nv2, _2n$1), v6); + const root = Fp2.mul(nv2, Fp2.sub(i2, Fp2.ONE)); + if (!Fp2.eql(Fp2.sqr(root), n5)) + throw new Error("Cannot find square root"); + return root; + }; + } + return tonelliShanks(P2); +} +const FIELD_FIELDS = [ + "create", + "isValid", + "is0", + "neg", + "inv", + "sqrt", + "sqr", + "eql", + "add", + "sub", + "mul", + "pow", + "div", + "addN", + "subN", + "mulN", + "sqrN" +]; +function validateField(field) { + const initial = { + ORDER: "bigint", + MASK: "bigint", + BYTES: "isSafeInteger", + BITS: "isSafeInteger" + }; + const opts = FIELD_FIELDS.reduce((map, val) => { + map[val] = "function"; + return map; + }, initial); + return validateObject(field, opts); +} +function FpPow(f4, num, power) { + if (power < _0n$2) + throw new Error("Expected power > 0"); + if (power === _0n$2) + return f4.ONE; + if (power === _1n$3) + return num; + let p3 = f4.ONE; + let d4 = num; + while (power > _0n$2) { + if (power & _1n$3) + p3 = f4.mul(p3, d4); + d4 = f4.sqr(d4); + power >>= _1n$3; + } + return p3; +} +function FpInvertBatch(f4, nums) { + const tmp = new Array(nums.length); + const lastMultiplied = nums.reduce((acc, num, i2) => { + if (f4.is0(num)) + return acc; + tmp[i2] = acc; + return f4.mul(acc, num); + }, f4.ONE); + const inverted = f4.inv(lastMultiplied); + nums.reduceRight((acc, num, i2) => { + if (f4.is0(num)) + return acc; + tmp[i2] = f4.mul(acc, tmp[i2]); + return f4.mul(acc, num); + }, inverted); + return tmp; +} +function nLength(n5, nBitLength) { + const _nBitLength = nBitLength !== void 0 ? nBitLength : n5.toString(2).length; + const nByteLength = Math.ceil(_nBitLength / 8); + return { nBitLength: _nBitLength, nByteLength }; +} +function Field(ORDER, bitLen2, isLE2 = false, redef = {}) { + if (ORDER <= _0n$2) + throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); + const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2); + if (BYTES > 2048) + throw new Error("Field lengths over 2048 bytes are not supported"); + const sqrtP = FpSqrt(ORDER); + const f4 = Object.freeze({ + ORDER, + BITS, + BYTES, + MASK: bitMask(BITS), + ZERO: _0n$2, + ONE: _1n$3, + create: (num) => mod(num, ORDER), + isValid: (num) => { + if (typeof num !== "bigint") + throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); + return _0n$2 <= num && num < ORDER; + }, + is0: (num) => num === _0n$2, + isOdd: (num) => (num & _1n$3) === _1n$3, + neg: (num) => mod(-num, ORDER), + eql: (lhs, rhs) => lhs === rhs, + sqr: (num) => mod(num * num, ORDER), + add: (lhs, rhs) => mod(lhs + rhs, ORDER), + sub: (lhs, rhs) => mod(lhs - rhs, ORDER), + mul: (lhs, rhs) => mod(lhs * rhs, ORDER), + pow: (num, power) => FpPow(f4, num, power), + div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), + // Same as above, but doesn't normalize + sqrN: (num) => num * num, + addN: (lhs, rhs) => lhs + rhs, + subN: (lhs, rhs) => lhs - rhs, + mulN: (lhs, rhs) => lhs * rhs, + inv: (num) => invert(num, ORDER), + sqrt: redef.sqrt || ((n5) => sqrtP(f4, n5)), + invertBatch: (lst) => FpInvertBatch(f4, lst), + // TODO: do we really need constant cmov? + // We don't have const-time bigints anyway, so probably will be not very useful + cmov: (a3, b2, c2) => c2 ? b2 : a3, + toBytes: (num) => isLE2 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES), + fromBytes: (bytes2) => { + if (bytes2.length !== BYTES) + throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes2.length}`); + return isLE2 ? bytesToNumberLE(bytes2) : bytesToNumberBE(bytes2); + } + }); + return Object.freeze(f4); +} +function getFieldBytesLength(fieldOrder) { + if (typeof fieldOrder !== "bigint") + throw new Error("field order must be bigint"); + const bitLength = fieldOrder.toString(2).length; + return Math.ceil(bitLength / 8); +} +function getMinHashLength(fieldOrder) { + const length = getFieldBytesLength(fieldOrder); + return length + Math.ceil(length / 2); +} +function mapHashToField(key2, fieldOrder, isLE2 = false) { + const len = key2.length; + const fieldLen = getFieldBytesLength(fieldOrder); + const minLen = getMinHashLength(fieldOrder); + if (len < 16 || len < minLen || len > 1024) + throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); + const num = isLE2 ? bytesToNumberBE(key2) : bytesToNumberLE(key2); + const reduced = mod(num, fieldOrder - _1n$3) + _1n$3; + return isLE2 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); +} +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const _0n$1 = BigInt(0); +const _1n$2 = BigInt(1); +function wNAF(c2, bits) { + const constTimeNegate = (condition, item) => { + const neg4 = item.negate(); + return condition ? neg4 : item; + }; + const opts = (W2) => { + const windows = Math.ceil(bits / W2) + 1; + const windowSize = 2 ** (W2 - 1); + return { windows, windowSize }; + }; + return { + constTimeNegate, + // non-const time multiplication ladder + unsafeLadder(elm, n5) { + let p3 = c2.ZERO; + let d4 = elm; + while (n5 > _0n$1) { + if (n5 & _1n$2) + p3 = p3.add(d4); + d4 = d4.double(); + n5 >>= _1n$2; + } + return p3; + }, + /** + * Creates a wNAF precomputation window. Used for caching. + * Default window size is set by `utils.precompute()` and is equal to 8. + * Number of precomputed points depends on the curve size: + * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: + * - 𝑊 is the window size + * - 𝑛 is the bitlength of the curve order. + * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. + * @returns precomputed point tables flattened to a single array + */ + precomputeWindow(elm, W2) { + const { windows, windowSize } = opts(W2); + const points = []; + let p3 = elm; + let base3 = p3; + for (let window2 = 0; window2 < windows; window2++) { + base3 = p3; + points.push(base3); + for (let i2 = 1; i2 < windowSize; i2++) { + base3 = base3.add(p3); + points.push(base3); + } + p3 = base3.double(); + } + return points; + }, + /** + * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. + * @param W window size + * @param precomputes precomputed tables + * @param n scalar (we don't check here, but should be less than curve order) + * @returns real and fake (for const-time) points + */ + wNAF(W2, precomputes, n5) { + const { windows, windowSize } = opts(W2); + let p3 = c2.ZERO; + let f4 = c2.BASE; + const mask2 = BigInt(2 ** W2 - 1); + const maxNumber = 2 ** W2; + const shiftBy = BigInt(W2); + for (let window2 = 0; window2 < windows; window2++) { + const offset2 = window2 * windowSize; + let wbits = Number(n5 & mask2); + n5 >>= shiftBy; + if (wbits > windowSize) { + wbits -= maxNumber; + n5 += _1n$2; + } + const offset1 = offset2; + const offset22 = offset2 + Math.abs(wbits) - 1; + const cond1 = window2 % 2 !== 0; + const cond2 = wbits < 0; + if (wbits === 0) { + f4 = f4.add(constTimeNegate(cond1, precomputes[offset1])); + } else { + p3 = p3.add(constTimeNegate(cond2, precomputes[offset22])); + } + } + return { p: p3, f: f4 }; + }, + wNAFCached(P2, precomputesMap, n5, transform) { + const W2 = P2._WINDOW_SIZE || 1; + let comp = precomputesMap.get(P2); + if (!comp) { + comp = this.precomputeWindow(P2, W2); + if (W2 !== 1) { + precomputesMap.set(P2, transform(comp)); + } + } + return this.wNAF(W2, comp, n5); + } + }; +} +function validateBasic(curve2) { + validateField(curve2.Fp); + validateObject(curve2, { + n: "bigint", + h: "bigint", + Gx: "field", + Gy: "field" + }, { + nBitLength: "isSafeInteger", + nByteLength: "isSafeInteger" + }); + return Object.freeze({ + ...nLength(curve2.n, curve2.nBitLength), + ...curve2, + ...{ p: curve2.Fp.ORDER } + }); +} +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +function validatePointOpts(curve2) { + const opts = validateBasic(curve2); + validateObject(opts, { + a: "field", + b: "field" + }, { + allowedPrivateKeyLengths: "array", + wrapPrivateKey: "boolean", + isTorsionFree: "function", + clearCofactor: "function", + allowInfinityPoint: "boolean", + fromBytes: "function", + toBytes: "function" + }); + const { endo, Fp: Fp2, a: a3 } = opts; + if (endo) { + if (!Fp2.eql(a3, Fp2.ZERO)) { + throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0"); + } + if (typeof endo !== "object" || typeof endo.beta !== "bigint" || typeof endo.splitScalar !== "function") { + throw new Error("Expected endomorphism with beta: bigint and splitScalar: function"); + } + } + return Object.freeze({ ...opts }); +} +const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut; +const DER = { + // asn.1 DER encoding utils + Err: class DERErr2 extends Error { + constructor(m3 = "") { + super(m3); + } + }, + _parseInt(data) { + const { Err: E2 } = DER; + if (data.length < 2 || data[0] !== 2) + throw new E2("Invalid signature integer tag"); + const len = data[1]; + const res = data.subarray(2, len + 2); + if (!len || res.length !== len) + throw new E2("Invalid signature integer: wrong length"); + if (res[0] & 128) + throw new E2("Invalid signature integer: negative"); + if (res[0] === 0 && !(res[1] & 128)) + throw new E2("Invalid signature integer: unnecessary leading zero"); + return { d: b2n(res), l: data.subarray(len + 2) }; + }, + toSig(hex) { + const { Err: E2 } = DER; + const data = typeof hex === "string" ? h2b(hex) : hex; + if (!(data instanceof Uint8Array)) + throw new Error("ui8a expected"); + let l2 = data.length; + if (l2 < 2 || data[0] != 48) + throw new E2("Invalid signature tag"); + if (data[1] !== l2 - 2) + throw new E2("Invalid signature: incorrect length"); + const { d: r2, l: sBytes } = DER._parseInt(data.subarray(2)); + const { d: s2, l: rBytesLeft } = DER._parseInt(sBytes); + if (rBytesLeft.length) + throw new E2("Invalid signature: left bytes after parsing"); + return { r: r2, s: s2 }; + }, + hexFromSig(sig) { + const slice = (s3) => Number.parseInt(s3[0], 16) & 8 ? "00" + s3 : s3; + const h4 = (num) => { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; + }; + const s2 = slice(h4(sig.s)); + const r2 = slice(h4(sig.r)); + const shl = s2.length / 2; + const rhl = r2.length / 2; + const sl2 = h4(shl); + const rl2 = h4(rhl); + return `30${h4(rhl + shl + 4)}02${rl2}${r2}02${sl2}${s2}`; + } +}; +const _0n = BigInt(0), _1n$1 = BigInt(1); +BigInt(2); +const _3n = BigInt(3); +BigInt(4); +function weierstrassPoints(opts) { + const CURVE = validatePointOpts(opts); + const { Fp: Fp2 } = CURVE; + const toBytes3 = CURVE.toBytes || ((_c2, point5, _isCompressed) => { + const a3 = point5.toAffine(); + return concatBytes(Uint8Array.from([4]), Fp2.toBytes(a3.x), Fp2.toBytes(a3.y)); + }); + const fromBytes = CURVE.fromBytes || ((bytes2) => { + const tail = bytes2.subarray(1); + const x3 = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); + const y3 = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); + return { x: x3, y: y3 }; + }); + function weierstrassEquation(x3) { + const { a: a3, b: b2 } = CURVE; + const x22 = Fp2.sqr(x3); + const x32 = Fp2.mul(x22, x3); + return Fp2.add(Fp2.add(x32, Fp2.mul(x3, a3)), b2); + } + if (!Fp2.eql(Fp2.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) + throw new Error("bad generator point: equation left != right"); + function isWithinCurveOrder(num) { + return typeof num === "bigint" && _0n < num && num < CURVE.n; + } + function assertGE(num) { + if (!isWithinCurveOrder(num)) + throw new Error("Expected valid bigint: 0 < bigint < curve.n"); + } + function normPrivateKeyToScalar(key2) { + const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n: n5 } = CURVE; + if (lengths && typeof key2 !== "bigint") { + if (key2 instanceof Uint8Array) + key2 = bytesToHex(key2); + if (typeof key2 !== "string" || !lengths.includes(key2.length)) + throw new Error("Invalid key"); + key2 = key2.padStart(nByteLength * 2, "0"); + } + let num; + try { + num = typeof key2 === "bigint" ? key2 : bytesToNumberBE(ensureBytes("private key", key2, nByteLength)); + } catch (error) { + throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key2}`); + } + if (wrapPrivateKey) + num = mod(num, n5); + assertGE(num); + return num; + } + const pointPrecomputes = /* @__PURE__ */ new Map(); + function assertPrjPoint(other) { + if (!(other instanceof Point2)) + throw new Error("ProjectivePoint expected"); + } + class Point2 { + constructor(px, py, pz) { + this.px = px; + this.py = py; + this.pz = pz; + if (px == null || !Fp2.isValid(px)) + throw new Error("x required"); + if (py == null || !Fp2.isValid(py)) + throw new Error("y required"); + if (pz == null || !Fp2.isValid(pz)) + throw new Error("z required"); + } + // Does not validate if the point is on-curve. + // Use fromHex instead, or call assertValidity() later. + static fromAffine(p3) { + const { x: x3, y: y3 } = p3 || {}; + if (!p3 || !Fp2.isValid(x3) || !Fp2.isValid(y3)) + throw new Error("invalid affine point"); + if (p3 instanceof Point2) + throw new Error("projective point not allowed"); + const is0 = (i2) => Fp2.eql(i2, Fp2.ZERO); + if (is0(x3) && is0(y3)) + return Point2.ZERO; + return new Point2(x3, y3, Fp2.ONE); + } + get x() { + return this.toAffine().x; + } + get y() { + return this.toAffine().y; + } + /** + * Takes a bunch of Projective Points but executes only one + * inversion on all of them. Inversion is very slow operation, + * so this improves performance massively. + * Optimization: converts a list of projective points to a list of identical points with Z=1. + */ + static normalizeZ(points) { + const toInv = Fp2.invertBatch(points.map((p3) => p3.pz)); + return points.map((p3, i2) => p3.toAffine(toInv[i2])).map(Point2.fromAffine); + } + /** + * Converts hash string or Uint8Array to Point. + * @param hex short/long ECDSA hex + */ + static fromHex(hex) { + const P2 = Point2.fromAffine(fromBytes(ensureBytes("pointHex", hex))); + P2.assertValidity(); + return P2; + } + // Multiplies generator point by privateKey. + static fromPrivateKey(privateKey) { + return Point2.BASE.multiply(normPrivateKeyToScalar(privateKey)); + } + // "Private method", don't use it directly + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); + } + // A point on curve is valid if it conforms to equation. + assertValidity() { + if (this.is0()) { + if (CURVE.allowInfinityPoint && !Fp2.is0(this.py)) + return; + throw new Error("bad point: ZERO"); + } + const { x: x3, y: y3 } = this.toAffine(); + if (!Fp2.isValid(x3) || !Fp2.isValid(y3)) + throw new Error("bad point: x or y not FE"); + const left = Fp2.sqr(y3); + const right = weierstrassEquation(x3); + if (!Fp2.eql(left, right)) + throw new Error("bad point: equation left != right"); + if (!this.isTorsionFree()) + throw new Error("bad point: not in prime-order subgroup"); + } + hasEvenY() { + const { y: y3 } = this.toAffine(); + if (Fp2.isOdd) + return !Fp2.isOdd(y3); + throw new Error("Field doesn't support isOdd"); + } + /** + * Compare one point to another. + */ + equals(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + const U12 = Fp2.eql(Fp2.mul(X1, Z2), Fp2.mul(X2, Z1)); + const U22 = Fp2.eql(Fp2.mul(Y1, Z2), Fp2.mul(Y2, Z1)); + return U12 && U22; + } + /** + * Flips point to one corresponding to (x, -y) in Affine coordinates. + */ + negate() { + return new Point2(this.px, Fp2.neg(this.py), this.pz); + } + // Renes-Costello-Batina exception-free doubling formula. + // There is 30% faster Jacobian formula, but it is not complete. + // https://eprint.iacr.org/2015/1060, algorithm 3 + // Cost: 8M + 3S + 3*a + 2*b3 + 15add. + double() { + const { a: a3, b: b2 } = CURVE; + const b3 = Fp2.mul(b2, _3n); + const { px: X1, py: Y1, pz: Z1 } = this; + let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; + let t02 = Fp2.mul(X1, X1); + let t1 = Fp2.mul(Y1, Y1); + let t2 = Fp2.mul(Z1, Z1); + let t3 = Fp2.mul(X1, Y1); + t3 = Fp2.add(t3, t3); + Z3 = Fp2.mul(X1, Z1); + Z3 = Fp2.add(Z3, Z3); + X3 = Fp2.mul(a3, Z3); + Y3 = Fp2.mul(b3, t2); + Y3 = Fp2.add(X3, Y3); + X3 = Fp2.sub(t1, Y3); + Y3 = Fp2.add(t1, Y3); + Y3 = Fp2.mul(X3, Y3); + X3 = Fp2.mul(t3, X3); + Z3 = Fp2.mul(b3, Z3); + t2 = Fp2.mul(a3, t2); + t3 = Fp2.sub(t02, t2); + t3 = Fp2.mul(a3, t3); + t3 = Fp2.add(t3, Z3); + Z3 = Fp2.add(t02, t02); + t02 = Fp2.add(Z3, t02); + t02 = Fp2.add(t02, t2); + t02 = Fp2.mul(t02, t3); + Y3 = Fp2.add(Y3, t02); + t2 = Fp2.mul(Y1, Z1); + t2 = Fp2.add(t2, t2); + t02 = Fp2.mul(t2, t3); + X3 = Fp2.sub(X3, t02); + Z3 = Fp2.mul(t2, t1); + Z3 = Fp2.add(Z3, Z3); + Z3 = Fp2.add(Z3, Z3); + return new Point2(X3, Y3, Z3); + } + // Renes-Costello-Batina exception-free addition formula. + // There is 30% faster Jacobian formula, but it is not complete. + // https://eprint.iacr.org/2015/1060, algorithm 1 + // Cost: 12M + 0S + 3*a + 3*b3 + 23add. + add(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; + const a3 = CURVE.a; + const b3 = Fp2.mul(CURVE.b, _3n); + let t02 = Fp2.mul(X1, X2); + let t1 = Fp2.mul(Y1, Y2); + let t2 = Fp2.mul(Z1, Z2); + let t3 = Fp2.add(X1, Y1); + let t4 = Fp2.add(X2, Y2); + t3 = Fp2.mul(t3, t4); + t4 = Fp2.add(t02, t1); + t3 = Fp2.sub(t3, t4); + t4 = Fp2.add(X1, Z1); + let t5 = Fp2.add(X2, Z2); + t4 = Fp2.mul(t4, t5); + t5 = Fp2.add(t02, t2); + t4 = Fp2.sub(t4, t5); + t5 = Fp2.add(Y1, Z1); + X3 = Fp2.add(Y2, Z2); + t5 = Fp2.mul(t5, X3); + X3 = Fp2.add(t1, t2); + t5 = Fp2.sub(t5, X3); + Z3 = Fp2.mul(a3, t4); + X3 = Fp2.mul(b3, t2); + Z3 = Fp2.add(X3, Z3); + X3 = Fp2.sub(t1, Z3); + Z3 = Fp2.add(t1, Z3); + Y3 = Fp2.mul(X3, Z3); + t1 = Fp2.add(t02, t02); + t1 = Fp2.add(t1, t02); + t2 = Fp2.mul(a3, t2); + t4 = Fp2.mul(b3, t4); + t1 = Fp2.add(t1, t2); + t2 = Fp2.sub(t02, t2); + t2 = Fp2.mul(a3, t2); + t4 = Fp2.add(t4, t2); + t02 = Fp2.mul(t1, t4); + Y3 = Fp2.add(Y3, t02); + t02 = Fp2.mul(t5, t4); + X3 = Fp2.mul(t3, X3); + X3 = Fp2.sub(X3, t02); + t02 = Fp2.mul(t3, t1); + Z3 = Fp2.mul(t5, Z3); + Z3 = Fp2.add(Z3, t02); + return new Point2(X3, Y3, Z3); + } + subtract(other) { + return this.add(other.negate()); + } + is0() { + return this.equals(Point2.ZERO); + } + wNAF(n5) { + return wnaf.wNAFCached(this, pointPrecomputes, n5, (comp) => { + const toInv = Fp2.invertBatch(comp.map((p3) => p3.pz)); + return comp.map((p3, i2) => p3.toAffine(toInv[i2])).map(Point2.fromAffine); + }); + } + /** + * Non-constant-time multiplication. Uses double-and-add algorithm. + * It's faster, but should only be used when you don't care about + * an exposed private key e.g. sig verification, which works over *public* keys. + */ + multiplyUnsafe(n5) { + const I2 = Point2.ZERO; + if (n5 === _0n) + return I2; + assertGE(n5); + if (n5 === _1n$1) + return this; + const { endo } = CURVE; + if (!endo) + return wnaf.unsafeLadder(this, n5); + let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n5); + let k1p = I2; + let k2p = I2; + let d4 = this; + while (k1 > _0n || k2 > _0n) { + if (k1 & _1n$1) + k1p = k1p.add(d4); + if (k2 & _1n$1) + k2p = k2p.add(d4); + d4 = d4.double(); + k1 >>= _1n$1; + k2 >>= _1n$1; + } + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new Point2(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + return k1p.add(k2p); + } + /** + * Constant time multiplication. + * Uses wNAF method. Windowed method may be 10% faster, + * but takes 2x longer to generate and consumes 2x memory. + * Uses precomputes when available. + * Uses endomorphism for Koblitz curves. + * @param scalar by which the point would be multiplied + * @returns New point + */ + multiply(scalar) { + assertGE(scalar); + let n5 = scalar; + let point5, fake; + const { endo } = CURVE; + if (endo) { + const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n5); + let { p: k1p, f: f1p } = this.wNAF(k1); + let { p: k2p, f: f2p } = this.wNAF(k2); + k1p = wnaf.constTimeNegate(k1neg, k1p); + k2p = wnaf.constTimeNegate(k2neg, k2p); + k2p = new Point2(Fp2.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + point5 = k1p.add(k2p); + fake = f1p.add(f2p); + } else { + const { p: p3, f: f4 } = this.wNAF(n5); + point5 = p3; + fake = f4; + } + return Point2.normalizeZ([point5, fake])[0]; + } + /** + * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. + * Not using Strauss-Shamir trick: precomputation tables are faster. + * The trick could be useful if both P and Q are not G (not in our case). + * @returns non-zero affine point + */ + multiplyAndAddUnsafe(Q2, a3, b2) { + const G2 = Point2.BASE; + const mul6 = (P2, a4) => a4 === _0n || a4 === _1n$1 || !P2.equals(G2) ? P2.multiplyUnsafe(a4) : P2.multiply(a4); + const sum = mul6(this, a3).add(mul6(Q2, b2)); + return sum.is0() ? void 0 : sum; + } + // Converts Projective point to affine (x, y) coordinates. + // Can accept precomputed Z^-1 - for example, from invertBatch. + // (x, y, z) ∋ (x=x/z, y=y/z) + toAffine(iz) { + const { px: x3, py: y3, pz: z3 } = this; + const is0 = this.is0(); + if (iz == null) + iz = is0 ? Fp2.ONE : Fp2.inv(z3); + const ax = Fp2.mul(x3, iz); + const ay = Fp2.mul(y3, iz); + const zz = Fp2.mul(z3, iz); + if (is0) + return { x: Fp2.ZERO, y: Fp2.ZERO }; + if (!Fp2.eql(zz, Fp2.ONE)) + throw new Error("invZ was invalid"); + return { x: ax, y: ay }; + } + isTorsionFree() { + const { h: cofactor, isTorsionFree } = CURVE; + if (cofactor === _1n$1) + return true; + if (isTorsionFree) + return isTorsionFree(Point2, this); + throw new Error("isTorsionFree() has not been declared for the elliptic curve"); + } + clearCofactor() { + const { h: cofactor, clearCofactor } = CURVE; + if (cofactor === _1n$1) + return this; + if (clearCofactor) + return clearCofactor(Point2, this); + return this.multiplyUnsafe(CURVE.h); + } + toRawBytes(isCompressed = true) { + this.assertValidity(); + return toBytes3(Point2, this, isCompressed); + } + toHex(isCompressed = true) { + return bytesToHex(this.toRawBytes(isCompressed)); + } + } + Point2.BASE = new Point2(CURVE.Gx, CURVE.Gy, Fp2.ONE); + Point2.ZERO = new Point2(Fp2.ZERO, Fp2.ONE, Fp2.ZERO); + const _bits = CURVE.nBitLength; + const wnaf = wNAF(Point2, CURVE.endo ? Math.ceil(_bits / 2) : _bits); + return { + CURVE, + ProjectivePoint: Point2, + normPrivateKeyToScalar, + weierstrassEquation, + isWithinCurveOrder + }; +} +function validateOpts(curve2) { + const opts = validateBasic(curve2); + validateObject(opts, { + hash: "hash", + hmac: "function", + randomBytes: "function" + }, { + bits2int: "function", + bits2int_modN: "function", + lowS: "boolean" + }); + return Object.freeze({ lowS: true, ...opts }); +} +function weierstrass(curveDef) { + const CURVE = validateOpts(curveDef); + const { Fp: Fp2, n: CURVE_ORDER } = CURVE; + const compressedLen = Fp2.BYTES + 1; + const uncompressedLen = 2 * Fp2.BYTES + 1; + function isValidFieldElement(num) { + return _0n < num && num < Fp2.ORDER; + } + function modN(a3) { + return mod(a3, CURVE_ORDER); + } + function invN(a3) { + return invert(a3, CURVE_ORDER); + } + const { ProjectivePoint: Point2, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder } = weierstrassPoints({ + ...CURVE, + toBytes(_c2, point5, isCompressed) { + const a3 = point5.toAffine(); + const x3 = Fp2.toBytes(a3.x); + const cat = concatBytes; + if (isCompressed) { + return cat(Uint8Array.from([point5.hasEvenY() ? 2 : 3]), x3); + } else { + return cat(Uint8Array.from([4]), x3, Fp2.toBytes(a3.y)); + } + }, + fromBytes(bytes2) { + const len = bytes2.length; + const head = bytes2[0]; + const tail = bytes2.subarray(1); + if (len === compressedLen && (head === 2 || head === 3)) { + const x3 = bytesToNumberBE(tail); + if (!isValidFieldElement(x3)) + throw new Error("Point is not on curve"); + const y22 = weierstrassEquation(x3); + let y3 = Fp2.sqrt(y22); + const isYOdd = (y3 & _1n$1) === _1n$1; + const isHeadOdd = (head & 1) === 1; + if (isHeadOdd !== isYOdd) + y3 = Fp2.neg(y3); + return { x: x3, y: y3 }; + } else if (len === uncompressedLen && head === 4) { + const x3 = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES)); + const y3 = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES)); + return { x: x3, y: y3 }; + } else { + throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); + } + } + }); + const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength)); + function isBiggerThanHalfOrder(number2) { + const HALF = CURVE_ORDER >> _1n$1; + return number2 > HALF; + } + function normalizeS(s2) { + return isBiggerThanHalfOrder(s2) ? modN(-s2) : s2; + } + const slcNum = (b2, from2, to2) => bytesToNumberBE(b2.slice(from2, to2)); + class Signature2 { + constructor(r2, s2, recovery) { + this.r = r2; + this.s = s2; + this.recovery = recovery; + this.assertValidity(); + } + // pair (bytes of r, bytes of s) + static fromCompact(hex) { + const l2 = CURVE.nByteLength; + hex = ensureBytes("compactSignature", hex, l2 * 2); + return new Signature2(slcNum(hex, 0, l2), slcNum(hex, l2, 2 * l2)); + } + // DER encoded ECDSA signature + // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script + static fromDER(hex) { + const { r: r2, s: s2 } = DER.toSig(ensureBytes("DER", hex)); + return new Signature2(r2, s2); + } + assertValidity() { + if (!isWithinCurveOrder(this.r)) + throw new Error("r must be 0 < r < CURVE.n"); + if (!isWithinCurveOrder(this.s)) + throw new Error("s must be 0 < s < CURVE.n"); + } + addRecoveryBit(recovery) { + return new Signature2(this.r, this.s, recovery); + } + recoverPublicKey(msgHash) { + const { r: r2, s: s2, recovery: rec } = this; + const h4 = bits2int_modN(ensureBytes("msgHash", msgHash)); + if (rec == null || ![0, 1, 2, 3].includes(rec)) + throw new Error("recovery id invalid"); + const radj = rec === 2 || rec === 3 ? r2 + CURVE.n : r2; + if (radj >= Fp2.ORDER) + throw new Error("recovery id 2 or 3 invalid"); + const prefix = (rec & 1) === 0 ? "02" : "03"; + const R3 = Point2.fromHex(prefix + numToNByteStr(radj)); + const ir2 = invN(radj); + const u1 = modN(-h4 * ir2); + const u2 = modN(s2 * ir2); + const Q2 = Point2.BASE.multiplyAndAddUnsafe(R3, u1, u2); + if (!Q2) + throw new Error("point at infinify"); + Q2.assertValidity(); + return Q2; + } + // Signatures should be low-s, to prevent malleability. + hasHighS() { + return isBiggerThanHalfOrder(this.s); + } + normalizeS() { + return this.hasHighS() ? new Signature2(this.r, modN(-this.s), this.recovery) : this; + } + // DER-encoded + toDERRawBytes() { + return hexToBytes(this.toDERHex()); + } + toDERHex() { + return DER.hexFromSig({ r: this.r, s: this.s }); + } + // padded bytes of r, then padded bytes of s + toCompactRawBytes() { + return hexToBytes(this.toCompactHex()); + } + toCompactHex() { + return numToNByteStr(this.r) + numToNByteStr(this.s); + } + } + const utils2 = { + isValidPrivateKey(privateKey) { + try { + normPrivateKeyToScalar(privateKey); + return true; + } catch (error) { + return false; + } + }, + normPrivateKeyToScalar, + /** + * Produces cryptographically secure private key from random of size + * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. + */ + randomPrivateKey: () => { + const length = getMinHashLength(CURVE.n); + return mapHashToField(CURVE.randomBytes(length), CURVE.n); + }, + /** + * Creates precompute table for an arbitrary EC point. Makes point "cached". + * Allows to massively speed-up `point.multiply(scalar)`. + * @returns cached point + * @example + * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); + * fast.multiply(privKey); // much faster ECDH now + */ + precompute(windowSize = 8, point5 = Point2.BASE) { + point5._setWindowSize(windowSize); + point5.multiply(BigInt(3)); + return point5; + } + }; + function getPublicKey(privateKey, isCompressed = true) { + return Point2.fromPrivateKey(privateKey).toRawBytes(isCompressed); + } + function isProbPub(item) { + const arr = item instanceof Uint8Array; + const str = typeof item === "string"; + const len = (arr || str) && item.length; + if (arr) + return len === compressedLen || len === uncompressedLen; + if (str) + return len === 2 * compressedLen || len === 2 * uncompressedLen; + if (item instanceof Point2) + return true; + return false; + } + function getSharedSecret(privateA, publicB, isCompressed = true) { + if (isProbPub(privateA)) + throw new Error("first arg must be private key"); + if (!isProbPub(publicB)) + throw new Error("second arg must be public key"); + const b2 = Point2.fromHex(publicB); + return b2.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); + } + const bits2int = CURVE.bits2int || function(bytes2) { + const num = bytesToNumberBE(bytes2); + const delta = bytes2.length * 8 - CURVE.nBitLength; + return delta > 0 ? num >> BigInt(delta) : num; + }; + const bits2int_modN = CURVE.bits2int_modN || function(bytes2) { + return modN(bits2int(bytes2)); + }; + const ORDER_MASK = bitMask(CURVE.nBitLength); + function int2octets(num) { + if (typeof num !== "bigint") + throw new Error("bigint expected"); + if (!(_0n <= num && num < ORDER_MASK)) + throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); + return numberToBytesBE(num, CURVE.nByteLength); + } + function prepSig(msgHash, privateKey, opts = defaultSigOpts) { + if (["recovered", "canonical"].some((k2) => k2 in opts)) + throw new Error("sign() legacy options not supported"); + const { hash: hash3, randomBytes: randomBytes2 } = CURVE; + let { lowS, prehash, extraEntropy: ent } = opts; + if (lowS == null) + lowS = true; + msgHash = ensureBytes("msgHash", msgHash); + if (prehash) + msgHash = ensureBytes("prehashed msgHash", hash3(msgHash)); + const h1int = bits2int_modN(msgHash); + const d4 = normPrivateKeyToScalar(privateKey); + const seedArgs = [int2octets(d4), int2octets(h1int)]; + if (ent != null) { + const e18 = ent === true ? randomBytes2(Fp2.BYTES) : ent; + seedArgs.push(ensureBytes("extraEntropy", e18)); + } + const seed = concatBytes(...seedArgs); + const m3 = h1int; + function k2sig(kBytes) { + const k2 = bits2int(kBytes); + if (!isWithinCurveOrder(k2)) + return; + const ik2 = invN(k2); + const q2 = Point2.BASE.multiply(k2).toAffine(); + const r2 = modN(q2.x); + if (r2 === _0n) + return; + const s2 = modN(ik2 * modN(m3 + r2 * d4)); + if (s2 === _0n) + return; + let recovery = (q2.x === r2 ? 0 : 2) | Number(q2.y & _1n$1); + let normS = s2; + if (lowS && isBiggerThanHalfOrder(s2)) { + normS = normalizeS(s2); + recovery ^= 1; + } + return new Signature2(r2, normS, recovery); + } + return { seed, k2sig }; + } + const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; + const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; + function sign6(msgHash, privKey, opts = defaultSigOpts) { + const { seed, k2sig } = prepSig(msgHash, privKey, opts); + const C3 = CURVE; + const drbg = createHmacDrbg(C3.hash.outputLen, C3.nByteLength, C3.hmac); + return drbg(seed, k2sig); + } + Point2.BASE._setWindowSize(8); + function verify6(signature2, msgHash, publicKey2, opts = defaultVerOpts) { + var _a3; + const sg2 = signature2; + msgHash = ensureBytes("msgHash", msgHash); + publicKey2 = ensureBytes("publicKey", publicKey2); + if ("strict" in opts) + throw new Error("options.strict was renamed to lowS"); + const { lowS, prehash } = opts; + let _sig2 = void 0; + let P2; + try { + if (typeof sg2 === "string" || sg2 instanceof Uint8Array) { + try { + _sig2 = Signature2.fromDER(sg2); + } catch (derError) { + if (!(derError instanceof DER.Err)) + throw derError; + _sig2 = Signature2.fromCompact(sg2); + } + } else if (typeof sg2 === "object" && typeof sg2.r === "bigint" && typeof sg2.s === "bigint") { + const { r: r3, s: s3 } = sg2; + _sig2 = new Signature2(r3, s3); + } else { + throw new Error("PARSE"); + } + P2 = Point2.fromHex(publicKey2); + } catch (error) { + if (error.message === "PARSE") + throw new Error(`signature must be Signature instance, Uint8Array or hex string`); + return false; + } + if (lowS && _sig2.hasHighS()) + return false; + if (prehash) + msgHash = CURVE.hash(msgHash); + const { r: r2, s: s2 } = _sig2; + const h4 = bits2int_modN(msgHash); + const is2 = invN(s2); + const u1 = modN(h4 * is2); + const u2 = modN(r2 * is2); + const R3 = (_a3 = Point2.BASE.multiplyAndAddUnsafe(P2, u1, u2)) == null ? void 0 : _a3.toAffine(); + if (!R3) + return false; + const v6 = modN(R3.x); + return v6 === r2; + } + return { + CURVE, + getPublicKey, + getSharedSecret, + sign: sign6, + verify: verify6, + ProjectivePoint: Point2, + Signature: Signature2, + utils: utils2 + }; +} +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +function getHash(hash3) { + return { + hash: hash3, + hmac: (key2, ...msgs) => hmac2(hash3, key2, concatBytes$1(...msgs)), + randomBytes: randomBytes$2 + }; +} +function createCurve(curveDef, defHash) { + const create3 = (hash3) => weierstrass({ ...curveDef, ...getHash(hash3) }); + return Object.freeze({ ...create3(defHash), create: create3 }); +} +/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"); +const secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); +const _1n = BigInt(1); +const _2n = BigInt(2); +const divNearest = (a3, b2) => (a3 + b2 / _2n) / b2; +function sqrtMod(y3) { + const P2 = secp256k1P; + const _3n2 = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); + const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); + const b2 = y3 * y3 * y3 % P2; + const b3 = b2 * b2 * y3 % P2; + const b6 = pow2(b3, _3n2, P2) * b3 % P2; + const b9 = pow2(b6, _3n2, P2) * b3 % P2; + const b11 = pow2(b9, _2n, P2) * b2 % P2; + const b22 = pow2(b11, _11n, P2) * b11 % P2; + const b44 = pow2(b22, _22n, P2) * b22 % P2; + const b88 = pow2(b44, _44n, P2) * b44 % P2; + const b176 = pow2(b88, _88n, P2) * b88 % P2; + const b220 = pow2(b176, _44n, P2) * b44 % P2; + const b223 = pow2(b220, _3n2, P2) * b3 % P2; + const t1 = pow2(b223, _23n, P2) * b22 % P2; + const t2 = pow2(t1, _6n, P2) * b2 % P2; + const root = pow2(t2, _2n, P2); + if (!Fp.eql(Fp.sqr(root), y3)) + throw new Error("Cannot find square root"); + return root; +} +const Fp = Field(secp256k1P, void 0, void 0, { sqrt: sqrtMod }); +const secp256k1 = createCurve({ + a: BigInt(0), + b: BigInt(7), + Fp, + n: secp256k1N, + // Base point (x, y) aka generator point + Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"), + Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"), + h: BigInt(1), + lowS: true, + /** + * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. + * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. + * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. + * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 + */ + endo: { + beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"), + splitScalar: (k2) => { + const n5 = secp256k1N; + const a1 = BigInt("0x3086d221a7d46bcde86c90e49284eb15"); + const b1 = -_1n * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"); + const a22 = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"); + const b2 = a1; + const POW_2_128 = BigInt("0x100000000000000000000000000000000"); + const c1 = divNearest(b2 * k2, n5); + const c2 = divNearest(-b1 * k2, n5); + let k1 = mod(k2 - c1 * a1 - c2 * a22, n5); + let k22 = mod(-c1 * b1 - c2 * b2, n5); + const k1neg = k1 > POW_2_128; + const k2neg = k22 > POW_2_128; + if (k1neg) + k1 = n5 - k1; + if (k2neg) + k22 = n5 - k22; + if (k1 > POW_2_128 || k22 > POW_2_128) { + throw new Error("splitScalar: Endomorphism failed, k=" + k2); + } + return { k1neg, k1, k2neg, k2: k22 }; + } + } +}, sha256$1); +BigInt(0); +secp256k1.ProjectivePoint; +const ZeroAddress = "0x0000000000000000000000000000000000000000"; +const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; +const MessagePrefix = "Ethereum Signed Message:\n"; +const BN_0$5 = BigInt(0); +const BN_1$3 = BigInt(1); +const BN_2$1 = BigInt(2); +const BN_27$1 = BigInt(27); +const BN_28$1 = BigInt(28); +const BN_35$1 = BigInt(35); +const _guard$4 = {}; +function toUint256(value) { + return zeroPadValue(toBeArray(value), 32); +} +const _Signature = class _Signature { + /** + * @private + */ + constructor(guard2, r2, s2, v6) { + __privateAdd(this, _r2, void 0); + __privateAdd(this, _s2, void 0); + __privateAdd(this, _v2, void 0); + __privateAdd(this, _networkV, void 0); + assertPrivate(guard2, _guard$4, "Signature"); + __privateSet(this, _r2, r2); + __privateSet(this, _s2, s2); + __privateSet(this, _v2, v6); + __privateSet(this, _networkV, null); + } + /** + * The ``r`` value for a signautre. + * + * This represents the ``x`` coordinate of a "reference" or + * challenge point, from which the ``y`` can be computed. + */ + get r() { + return __privateGet(this, _r2); + } + set r(value) { + assertArgument(dataLength(value) === 32, "invalid r", "value", value); + __privateSet(this, _r2, hexlify(value)); + } + /** + * The ``s`` value for a signature. + */ + get s() { + return __privateGet(this, _s2); + } + set s(_value2) { + assertArgument(dataLength(_value2) === 32, "invalid s", "value", _value2); + const value = hexlify(_value2); + assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); + __privateSet(this, _s2, value); + } + /** + * The ``v`` value for a signature. + * + * Since a given ``x`` value for ``r`` has two possible values for + * its correspondin ``y``, the ``v`` indicates which of the two ``y`` + * values to use. + * + * It is normalized to the values ``27`` or ``28`` for legacy + * purposes. + */ + get v() { + return __privateGet(this, _v2); + } + set v(value) { + const v6 = getNumber(value, "value"); + assertArgument(v6 === 27 || v6 === 28, "invalid v", "v", value); + __privateSet(this, _v2, v6); + } + /** + * The EIP-155 ``v`` for legacy transactions. For non-legacy + * transactions, this value is ``null``. + */ + get networkV() { + return __privateGet(this, _networkV); + } + /** + * The chain ID for EIP-155 legacy transactions. For non-legacy + * transactions, this value is ``null``. + */ + get legacyChainId() { + const v6 = this.networkV; + if (v6 == null) { + return null; + } + return _Signature.getChainId(v6); + } + /** + * The ``yParity`` for the signature. + * + * See ``v`` for more details on how this value is used. + */ + get yParity() { + return this.v === 27 ? 0 : 1; + } + /** + * The [[link-eip-2098]] compact representation of the ``yParity`` + * and ``s`` compacted into a single ``bytes32``. + */ + get yParityAndS() { + const yParityAndS = getBytes(this.s); + if (this.yParity) { + yParityAndS[0] |= 128; + } + return hexlify(yParityAndS); + } + /** + * The [[link-eip-2098]] compact representation. + */ + get compactSerialized() { + return concat([this.r, this.yParityAndS]); + } + /** + * The serialized representation. + */ + get serialized() { + return concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); + } + [Symbol.for("nodejs.util.inspect.custom")]() { + return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; + } + /** + * Returns a new identical [[Signature]]. + */ + clone() { + const clone2 = new _Signature(_guard$4, this.r, this.s, this.v); + if (this.networkV) { + __privateSet(clone2, _networkV, this.networkV); + } + return clone2; + } + /** + * Returns a representation that is compatible with ``JSON.stringify``. + */ + toJSON() { + const networkV = this.networkV; + return { + _type: "signature", + networkV: networkV != null ? networkV.toString() : null, + r: this.r, + s: this.s, + v: this.v + }; + } + /** + * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. + * + * @example: + * Signature.getChainId(45) + * //_result: + * + * Signature.getChainId(46) + * //_result: + */ + static getChainId(v6) { + const bv = getBigInt(v6, "v"); + if (bv == BN_27$1 || bv == BN_28$1) { + return BN_0$5; + } + assertArgument(bv >= BN_35$1, "invalid EIP-155 v", "v", v6); + return (bv - BN_35$1) / BN_2$1; + } + /** + * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. + * + * Legacy transactions which use [[link-eip-155]] hijack the ``v`` + * property to include the chain ID. + * + * @example: + * Signature.getChainIdV(5, 27) + * //_result: + * + * Signature.getChainIdV(5, 28) + * //_result: + * + */ + static getChainIdV(chainId, v6) { + return getBigInt(chainId) * BN_2$1 + BigInt(35 + v6 - 27); + } + /** + * Compute the normalized legacy transaction ``v`` from a ``yParirty``, + * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. + * + * @example: + * // The values 0 and 1 imply v is actually yParity + * Signature.getNormalizedV(0) + * //_result: + * + * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) + * Signature.getNormalizedV(27) + * //_result: + * + * // Legacy EIP-155 transaction (i.e. >= 35) + * Signature.getNormalizedV(46) + * //_result: + * + * // Invalid values throw + * Signature.getNormalizedV(5) + * //_error: + */ + static getNormalizedV(v6) { + const bv = getBigInt(v6); + if (bv === BN_0$5 || bv === BN_27$1) { + return 27; + } + if (bv === BN_1$3 || bv === BN_28$1) { + return 28; + } + assertArgument(bv >= BN_35$1, "invalid v", "v", v6); + return bv & BN_1$3 ? 27 : 28; + } + /** + * Creates a new [[Signature]]. + * + * If no %%sig%% is provided, a new [[Signature]] is created + * with default values. + * + * If %%sig%% is a string, it is parsed. + */ + static from(sig) { + function assertError(check, message2) { + assertArgument(check, message2, "signature", sig); + } + if (sig == null) { + return new _Signature(_guard$4, ZeroHash, ZeroHash, 27); + } + if (typeof sig === "string") { + const bytes2 = getBytes(sig, "signature"); + if (bytes2.length === 64) { + const r3 = hexlify(bytes2.slice(0, 32)); + const s3 = bytes2.slice(32, 64); + const v7 = s3[0] & 128 ? 28 : 27; + s3[0] &= 127; + return new _Signature(_guard$4, r3, hexlify(s3), v7); + } + if (bytes2.length === 65) { + const r3 = hexlify(bytes2.slice(0, 32)); + const s3 = bytes2.slice(32, 64); + assertError((s3[0] & 128) === 0, "non-canonical s"); + const v7 = _Signature.getNormalizedV(bytes2[64]); + return new _Signature(_guard$4, r3, hexlify(s3), v7); + } + assertError(false, "invalid raw signature length"); + } + if (sig instanceof _Signature) { + return sig.clone(); + } + const _r3 = sig.r; + assertError(_r3 != null, "missing r"); + const r2 = toUint256(_r3); + const s2 = function(s3, yParityAndS) { + if (s3 != null) { + return toUint256(s3); + } + if (yParityAndS != null) { + assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); + const bytes2 = getBytes(yParityAndS); + bytes2[0] &= 127; + return hexlify(bytes2); + } + assertError(false, "missing s"); + }(sig.s, sig.yParityAndS); + assertError((getBytes(s2)[0] & 128) == 0, "non-canonical s"); + const { networkV, v: v6 } = function(_v3, yParityAndS, yParity) { + if (_v3 != null) { + const v7 = getBigInt(_v3); + return { + networkV: v7 >= BN_35$1 ? v7 : void 0, + v: _Signature.getNormalizedV(v7) + }; + } + if (yParityAndS != null) { + assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); + return { v: getBytes(yParityAndS)[0] & 128 ? 28 : 27 }; + } + if (yParity != null) { + switch (getNumber(yParity, "sig.yParity")) { + case 0: + return { v: 27 }; + case 1: + return { v: 28 }; + } + assertError(false, "invalid yParity"); + } + assertError(false, "missing v"); + }(sig.v, sig.yParityAndS, sig.yParity); + const result = new _Signature(_guard$4, r2, s2, v6); + if (networkV) { + __privateSet(result, _networkV, networkV); + } + assertError(sig.yParity == null || getNumber(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch"); + assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch"); + return result; + } +}; +_r2 = new WeakMap(); +_s2 = new WeakMap(); +_v2 = new WeakMap(); +_networkV = new WeakMap(); +let Signature = _Signature; +const _SigningKey = class _SigningKey { + /** + * Creates a new **SigningKey** for %%privateKey%%. + */ + constructor(privateKey) { + __privateAdd(this, _privateKey, void 0); + assertArgument(dataLength(privateKey) === 32, "invalid private key", "privateKey", "[REDACTED]"); + __privateSet(this, _privateKey, hexlify(privateKey)); + } + /** + * The private key. + */ + get privateKey() { + return __privateGet(this, _privateKey); + } + /** + * The uncompressed public key. + * + * This will always begin with the prefix ``0x04`` and be 132 + * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). + */ + get publicKey() { + return _SigningKey.computePublicKey(__privateGet(this, _privateKey)); + } + /** + * The compressed public key. + * + * This will always begin with either the prefix ``0x02`` or ``0x03`` + * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal + * nibbles) + */ + get compressedPublicKey() { + return _SigningKey.computePublicKey(__privateGet(this, _privateKey), true); + } + /** + * Return the signature of the signed %%digest%%. + */ + sign(digest9) { + assertArgument(dataLength(digest9) === 32, "invalid digest length", "digest", digest9); + const sig = secp256k1.sign(getBytesCopy(digest9), getBytesCopy(__privateGet(this, _privateKey)), { + lowS: true + }); + return Signature.from({ + r: toBeHex(sig.r, 32), + s: toBeHex(sig.s, 32), + v: sig.recovery ? 28 : 27 + }); + } + /** + * Returns the [[link-wiki-ecdh]] shared secret between this + * private key and the %%other%% key. + * + * The %%other%% key may be any type of key, a raw public key, + * a compressed/uncompressed pubic key or aprivate key. + * + * Best practice is usually to use a cryptographic hash on the + * returned value before using it as a symetric secret. + * + * @example: + * sign1 = new SigningKey(id("some-secret-1")) + * sign2 = new SigningKey(id("some-secret-2")) + * + * // Notice that privA.computeSharedSecret(pubB)... + * sign1.computeSharedSecret(sign2.publicKey) + * //_result: + * + * // ...is equal to privB.computeSharedSecret(pubA). + * sign2.computeSharedSecret(sign1.publicKey) + * //_result: + */ + computeSharedSecret(other) { + const pubKey = _SigningKey.computePublicKey(other); + return hexlify(secp256k1.getSharedSecret(getBytesCopy(__privateGet(this, _privateKey)), getBytes(pubKey), false)); + } + /** + * Compute the public key for %%key%%, optionally %%compressed%%. + * + * The %%key%% may be any type of key, a raw public key, a + * compressed/uncompressed public key or private key. + * + * @example: + * sign = new SigningKey(id("some-secret")); + * + * // Compute the uncompressed public key for a private key + * SigningKey.computePublicKey(sign.privateKey) + * //_result: + * + * // Compute the compressed public key for a private key + * SigningKey.computePublicKey(sign.privateKey, true) + * //_result: + * + * // Compute the uncompressed public key + * SigningKey.computePublicKey(sign.publicKey, false); + * //_result: + * + * // Compute the Compressed a public key + * SigningKey.computePublicKey(sign.publicKey, true); + * //_result: + */ + static computePublicKey(key2, compressed) { + let bytes2 = getBytes(key2, "key"); + if (bytes2.length === 32) { + const pubKey = secp256k1.getPublicKey(bytes2, !!compressed); + return hexlify(pubKey); + } + if (bytes2.length === 64) { + const pub2 = new Uint8Array(65); + pub2[0] = 4; + pub2.set(bytes2, 1); + bytes2 = pub2; + } + const point5 = secp256k1.ProjectivePoint.fromHex(bytes2); + return hexlify(point5.toRawBytes(compressed)); + } + /** + * Returns the public key for the private key which produced the + * %%signature%% for the given %%digest%%. + * + * @example: + * key = new SigningKey(id("some-secret")) + * digest = id("hello world") + * sig = key.sign(digest) + * + * // Notice the signer public key... + * key.publicKey + * //_result: + * + * // ...is equal to the recovered public key + * SigningKey.recoverPublicKey(digest, sig) + * //_result: + * + */ + static recoverPublicKey(digest9, signature2) { + assertArgument(dataLength(digest9) === 32, "invalid digest length", "digest", digest9); + const sig = Signature.from(signature2); + let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s]))); + secpSig = secpSig.addRecoveryBit(sig.yParity); + const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest9)); + assertArgument(pubKey != null, "invalid signautre for digest", "signature", signature2); + return "0x" + pubKey.toHex(false); + } + /** + * Returns the point resulting from adding the ellipic curve points + * %%p0%% and %%p1%%. + * + * This is not a common function most developers should require, but + * can be useful for certain privacy-specific techniques. + * + * For example, it is used by [[HDNodeWallet]] to compute child + * addresses from parent public keys and chain codes. + */ + static addPoints(p02, p1, compressed) { + const pub0 = secp256k1.ProjectivePoint.fromHex(_SigningKey.computePublicKey(p02).substring(2)); + const pub1 = secp256k1.ProjectivePoint.fromHex(_SigningKey.computePublicKey(p1).substring(2)); + return "0x" + pub0.add(pub1).toHex(!!compressed); + } +}; +_privateKey = new WeakMap(); +let SigningKey = _SigningKey; +const BN_0$4 = BigInt(0); +const BN_36 = BigInt(36); +function getChecksumAddress$1(address2) { + address2 = address2.toLowerCase(); + const chars = address2.substring(2).split(""); + const expanded = new Uint8Array(40); + for (let i2 = 0; i2 < 40; i2++) { + expanded[i2] = chars[i2].charCodeAt(0); + } + const hashed = getBytes(keccak256(expanded)); + for (let i2 = 0; i2 < 40; i2 += 2) { + if (hashed[i2 >> 1] >> 4 >= 8) { + chars[i2] = chars[i2].toUpperCase(); + } + if ((hashed[i2 >> 1] & 15) >= 8) { + chars[i2 + 1] = chars[i2 + 1].toUpperCase(); + } + } + return "0x" + chars.join(""); +} +const ibanLookup = {}; +for (let i2 = 0; i2 < 10; i2++) { + ibanLookup[String(i2)] = String(i2); +} +for (let i2 = 0; i2 < 26; i2++) { + ibanLookup[String.fromCharCode(65 + i2)] = String(10 + i2); +} +const safeDigits = 15; +function ibanChecksum(address2) { + address2 = address2.toUpperCase(); + address2 = address2.substring(4) + address2.substring(0, 2) + "00"; + let expanded = address2.split("").map((c2) => { + return ibanLookup[c2]; + }).join(""); + while (expanded.length >= safeDigits) { + let block = expanded.substring(0, safeDigits); + expanded = parseInt(block, 10) % 97 + expanded.substring(block.length); + } + let checksum2 = String(98 - parseInt(expanded, 10) % 97); + while (checksum2.length < 2) { + checksum2 = "0" + checksum2; + } + return checksum2; +} +const Base36 = function() { + const result = {}; + for (let i2 = 0; i2 < 36; i2++) { + const key2 = "0123456789abcdefghijklmnopqrstuvwxyz"[i2]; + result[key2] = BigInt(i2); + } + return result; +}(); +function fromBase36(value) { + value = value.toLowerCase(); + let result = BN_0$4; + for (let i2 = 0; i2 < value.length; i2++) { + result = result * BN_36 + Base36[value[i2]]; + } + return result; +} +function getAddress$1(address2) { + assertArgument(typeof address2 === "string", "invalid address", "address", address2); + if (address2.match(/^(0x)?[0-9a-fA-F]{40}$/)) { + if (!address2.startsWith("0x")) { + address2 = "0x" + address2; + } + const result = getChecksumAddress$1(address2); + assertArgument(!address2.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address2, "bad address checksum", "address", address2); + return result; + } + if (address2.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { + assertArgument(address2.substring(2, 4) === ibanChecksum(address2), "bad icap checksum", "address", address2); + let result = fromBase36(address2.substring(4)).toString(16); + while (result.length < 40) { + result = "0" + result; + } + return getChecksumAddress$1("0x" + result); + } + assertArgument(false, "invalid address", "address", address2); +} +function isAddressable(value) { + return value && typeof value.getAddress === "function"; +} +async function checkAddress(target, promise) { + const result = await promise; + if (result == null || result === "0x0000000000000000000000000000000000000000") { + assert(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); + assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); + } + return getAddress$1(result); +} +function resolveAddress(target, resolver) { + if (typeof target === "string") { + if (target.match(/^0x[0-9a-f]{40}$/i)) { + return getAddress$1(target); + } + assert(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); + return checkAddress(target, resolver.resolveName(target)); + } else if (isAddressable(target)) { + return checkAddress(target, target.getAddress()); + } else if (target && typeof target.then === "function") { + return checkAddress(target, target); + } + assertArgument(false, "unsupported addressable value", "target", target); +} +const _gaurd = {}; +function n4(value, width) { + let signed = false; + if (width < 0) { + signed = true; + width *= -1; + } + return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width }); +} +function b(value, size2) { + return new Typed(_gaurd, `bytes${size2 ? size2 : ""}`, value, { size: size2 }); +} +const _typedSymbol = Symbol.for("_ethers_typed"); +const _Typed = class _Typed { + /** + * @_ignore: + */ + constructor(gaurd, type2, value, options) { + /** + * The type, as a Solidity-compatible type. + */ + __publicField(this, "type"); + /** + * The actual value. + */ + __publicField(this, "value"); + __privateAdd(this, _options, void 0); + /** + * @_ignore: + */ + __publicField(this, "_typedSymbol"); + if (options == null) { + options = null; + } + assertPrivate(_gaurd, gaurd, "Typed"); + defineProperties(this, { _typedSymbol, type: type2, value }); + __privateSet(this, _options, options); + this.format(); + } + /** + * Format the type as a Human-Readable type. + */ + format() { + if (this.type === "array") { + throw new Error(""); + } else if (this.type === "dynamicArray") { + throw new Error(""); + } else if (this.type === "tuple") { + return `tuple(${this.value.map((v6) => v6.format()).join(",")})`; + } + return this.type; + } + /** + * The default value returned by this type. + */ + defaultValue() { + return 0; + } + /** + * The minimum value for numeric types. + */ + minValue() { + return 0; + } + /** + * The maximum value for numeric types. + */ + maxValue() { + return 0; + } + /** + * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. + */ + isBigInt() { + return !!this.type.match(/^u?int[0-9]+$/); + } + /** + * Returns ``true`` and provides a type guard is this is a [[TypedData]]. + */ + isData() { + return this.type.startsWith("bytes"); + } + /** + * Returns ``true`` and provides a type guard is this is a [[TypedString]]. + */ + isString() { + return this.type === "string"; + } + /** + * Returns the tuple name, if this is a tuple. Throws otherwise. + */ + get tupleName() { + if (this.type !== "tuple") { + throw TypeError("not a tuple"); + } + return __privateGet(this, _options); + } + // Returns the length of this type as an array + // - `null` indicates the length is unforced, it could be dynamic + // - `-1` indicates the length is dynamic + // - any other value indicates it is a static array and is its length + /** + * Returns the length of the array type or ``-1`` if it is dynamic. + * + * Throws if the type is not an array. + */ + get arrayLength() { + if (this.type !== "array") { + throw TypeError("not an array"); + } + if (__privateGet(this, _options) === true) { + return -1; + } + if (__privateGet(this, _options) === false) { + return this.value.length; + } + return null; + } + /** + * Returns a new **Typed** of %%type%% with the %%value%%. + */ + static from(type2, value) { + return new _Typed(_gaurd, type2, value); + } + /** + * Return a new ``uint8`` type for %%v%%. + */ + static uint8(v6) { + return n4(v6, 8); + } + /** + * Return a new ``uint16`` type for %%v%%. + */ + static uint16(v6) { + return n4(v6, 16); + } + /** + * Return a new ``uint24`` type for %%v%%. + */ + static uint24(v6) { + return n4(v6, 24); + } + /** + * Return a new ``uint32`` type for %%v%%. + */ + static uint32(v6) { + return n4(v6, 32); + } + /** + * Return a new ``uint40`` type for %%v%%. + */ + static uint40(v6) { + return n4(v6, 40); + } + /** + * Return a new ``uint48`` type for %%v%%. + */ + static uint48(v6) { + return n4(v6, 48); + } + /** + * Return a new ``uint56`` type for %%v%%. + */ + static uint56(v6) { + return n4(v6, 56); + } + /** + * Return a new ``uint64`` type for %%v%%. + */ + static uint64(v6) { + return n4(v6, 64); + } + /** + * Return a new ``uint72`` type for %%v%%. + */ + static uint72(v6) { + return n4(v6, 72); + } + /** + * Return a new ``uint80`` type for %%v%%. + */ + static uint80(v6) { + return n4(v6, 80); + } + /** + * Return a new ``uint88`` type for %%v%%. + */ + static uint88(v6) { + return n4(v6, 88); + } + /** + * Return a new ``uint96`` type for %%v%%. + */ + static uint96(v6) { + return n4(v6, 96); + } + /** + * Return a new ``uint104`` type for %%v%%. + */ + static uint104(v6) { + return n4(v6, 104); + } + /** + * Return a new ``uint112`` type for %%v%%. + */ + static uint112(v6) { + return n4(v6, 112); + } + /** + * Return a new ``uint120`` type for %%v%%. + */ + static uint120(v6) { + return n4(v6, 120); + } + /** + * Return a new ``uint128`` type for %%v%%. + */ + static uint128(v6) { + return n4(v6, 128); + } + /** + * Return a new ``uint136`` type for %%v%%. + */ + static uint136(v6) { + return n4(v6, 136); + } + /** + * Return a new ``uint144`` type for %%v%%. + */ + static uint144(v6) { + return n4(v6, 144); + } + /** + * Return a new ``uint152`` type for %%v%%. + */ + static uint152(v6) { + return n4(v6, 152); + } + /** + * Return a new ``uint160`` type for %%v%%. + */ + static uint160(v6) { + return n4(v6, 160); + } + /** + * Return a new ``uint168`` type for %%v%%. + */ + static uint168(v6) { + return n4(v6, 168); + } + /** + * Return a new ``uint176`` type for %%v%%. + */ + static uint176(v6) { + return n4(v6, 176); + } + /** + * Return a new ``uint184`` type for %%v%%. + */ + static uint184(v6) { + return n4(v6, 184); + } + /** + * Return a new ``uint192`` type for %%v%%. + */ + static uint192(v6) { + return n4(v6, 192); + } + /** + * Return a new ``uint200`` type for %%v%%. + */ + static uint200(v6) { + return n4(v6, 200); + } + /** + * Return a new ``uint208`` type for %%v%%. + */ + static uint208(v6) { + return n4(v6, 208); + } + /** + * Return a new ``uint216`` type for %%v%%. + */ + static uint216(v6) { + return n4(v6, 216); + } + /** + * Return a new ``uint224`` type for %%v%%. + */ + static uint224(v6) { + return n4(v6, 224); + } + /** + * Return a new ``uint232`` type for %%v%%. + */ + static uint232(v6) { + return n4(v6, 232); + } + /** + * Return a new ``uint240`` type for %%v%%. + */ + static uint240(v6) { + return n4(v6, 240); + } + /** + * Return a new ``uint248`` type for %%v%%. + */ + static uint248(v6) { + return n4(v6, 248); + } + /** + * Return a new ``uint256`` type for %%v%%. + */ + static uint256(v6) { + return n4(v6, 256); + } + /** + * Return a new ``uint256`` type for %%v%%. + */ + static uint(v6) { + return n4(v6, 256); + } + /** + * Return a new ``int8`` type for %%v%%. + */ + static int8(v6) { + return n4(v6, -8); + } + /** + * Return a new ``int16`` type for %%v%%. + */ + static int16(v6) { + return n4(v6, -16); + } + /** + * Return a new ``int24`` type for %%v%%. + */ + static int24(v6) { + return n4(v6, -24); + } + /** + * Return a new ``int32`` type for %%v%%. + */ + static int32(v6) { + return n4(v6, -32); + } + /** + * Return a new ``int40`` type for %%v%%. + */ + static int40(v6) { + return n4(v6, -40); + } + /** + * Return a new ``int48`` type for %%v%%. + */ + static int48(v6) { + return n4(v6, -48); + } + /** + * Return a new ``int56`` type for %%v%%. + */ + static int56(v6) { + return n4(v6, -56); + } + /** + * Return a new ``int64`` type for %%v%%. + */ + static int64(v6) { + return n4(v6, -64); + } + /** + * Return a new ``int72`` type for %%v%%. + */ + static int72(v6) { + return n4(v6, -72); + } + /** + * Return a new ``int80`` type for %%v%%. + */ + static int80(v6) { + return n4(v6, -80); + } + /** + * Return a new ``int88`` type for %%v%%. + */ + static int88(v6) { + return n4(v6, -88); + } + /** + * Return a new ``int96`` type for %%v%%. + */ + static int96(v6) { + return n4(v6, -96); + } + /** + * Return a new ``int104`` type for %%v%%. + */ + static int104(v6) { + return n4(v6, -104); + } + /** + * Return a new ``int112`` type for %%v%%. + */ + static int112(v6) { + return n4(v6, -112); + } + /** + * Return a new ``int120`` type for %%v%%. + */ + static int120(v6) { + return n4(v6, -120); + } + /** + * Return a new ``int128`` type for %%v%%. + */ + static int128(v6) { + return n4(v6, -128); + } + /** + * Return a new ``int136`` type for %%v%%. + */ + static int136(v6) { + return n4(v6, -136); + } + /** + * Return a new ``int144`` type for %%v%%. + */ + static int144(v6) { + return n4(v6, -144); + } + /** + * Return a new ``int52`` type for %%v%%. + */ + static int152(v6) { + return n4(v6, -152); + } + /** + * Return a new ``int160`` type for %%v%%. + */ + static int160(v6) { + return n4(v6, -160); + } + /** + * Return a new ``int168`` type for %%v%%. + */ + static int168(v6) { + return n4(v6, -168); + } + /** + * Return a new ``int176`` type for %%v%%. + */ + static int176(v6) { + return n4(v6, -176); + } + /** + * Return a new ``int184`` type for %%v%%. + */ + static int184(v6) { + return n4(v6, -184); + } + /** + * Return a new ``int92`` type for %%v%%. + */ + static int192(v6) { + return n4(v6, -192); + } + /** + * Return a new ``int200`` type for %%v%%. + */ + static int200(v6) { + return n4(v6, -200); + } + /** + * Return a new ``int208`` type for %%v%%. + */ + static int208(v6) { + return n4(v6, -208); + } + /** + * Return a new ``int216`` type for %%v%%. + */ + static int216(v6) { + return n4(v6, -216); + } + /** + * Return a new ``int224`` type for %%v%%. + */ + static int224(v6) { + return n4(v6, -224); + } + /** + * Return a new ``int232`` type for %%v%%. + */ + static int232(v6) { + return n4(v6, -232); + } + /** + * Return a new ``int240`` type for %%v%%. + */ + static int240(v6) { + return n4(v6, -240); + } + /** + * Return a new ``int248`` type for %%v%%. + */ + static int248(v6) { + return n4(v6, -248); + } + /** + * Return a new ``int256`` type for %%v%%. + */ + static int256(v6) { + return n4(v6, -256); + } + /** + * Return a new ``int256`` type for %%v%%. + */ + static int(v6) { + return n4(v6, -256); + } + /** + * Return a new ``bytes1`` type for %%v%%. + */ + static bytes1(v6) { + return b(v6, 1); + } + /** + * Return a new ``bytes2`` type for %%v%%. + */ + static bytes2(v6) { + return b(v6, 2); + } + /** + * Return a new ``bytes3`` type for %%v%%. + */ + static bytes3(v6) { + return b(v6, 3); + } + /** + * Return a new ``bytes4`` type for %%v%%. + */ + static bytes4(v6) { + return b(v6, 4); + } + /** + * Return a new ``bytes5`` type for %%v%%. + */ + static bytes5(v6) { + return b(v6, 5); + } + /** + * Return a new ``bytes6`` type for %%v%%. + */ + static bytes6(v6) { + return b(v6, 6); + } + /** + * Return a new ``bytes7`` type for %%v%%. + */ + static bytes7(v6) { + return b(v6, 7); + } + /** + * Return a new ``bytes8`` type for %%v%%. + */ + static bytes8(v6) { + return b(v6, 8); + } + /** + * Return a new ``bytes9`` type for %%v%%. + */ + static bytes9(v6) { + return b(v6, 9); + } + /** + * Return a new ``bytes10`` type for %%v%%. + */ + static bytes10(v6) { + return b(v6, 10); + } + /** + * Return a new ``bytes11`` type for %%v%%. + */ + static bytes11(v6) { + return b(v6, 11); + } + /** + * Return a new ``bytes12`` type for %%v%%. + */ + static bytes12(v6) { + return b(v6, 12); + } + /** + * Return a new ``bytes13`` type for %%v%%. + */ + static bytes13(v6) { + return b(v6, 13); + } + /** + * Return a new ``bytes14`` type for %%v%%. + */ + static bytes14(v6) { + return b(v6, 14); + } + /** + * Return a new ``bytes15`` type for %%v%%. + */ + static bytes15(v6) { + return b(v6, 15); + } + /** + * Return a new ``bytes16`` type for %%v%%. + */ + static bytes16(v6) { + return b(v6, 16); + } + /** + * Return a new ``bytes17`` type for %%v%%. + */ + static bytes17(v6) { + return b(v6, 17); + } + /** + * Return a new ``bytes18`` type for %%v%%. + */ + static bytes18(v6) { + return b(v6, 18); + } + /** + * Return a new ``bytes19`` type for %%v%%. + */ + static bytes19(v6) { + return b(v6, 19); + } + /** + * Return a new ``bytes20`` type for %%v%%. + */ + static bytes20(v6) { + return b(v6, 20); + } + /** + * Return a new ``bytes21`` type for %%v%%. + */ + static bytes21(v6) { + return b(v6, 21); + } + /** + * Return a new ``bytes22`` type for %%v%%. + */ + static bytes22(v6) { + return b(v6, 22); + } + /** + * Return a new ``bytes23`` type for %%v%%. + */ + static bytes23(v6) { + return b(v6, 23); + } + /** + * Return a new ``bytes24`` type for %%v%%. + */ + static bytes24(v6) { + return b(v6, 24); + } + /** + * Return a new ``bytes25`` type for %%v%%. + */ + static bytes25(v6) { + return b(v6, 25); + } + /** + * Return a new ``bytes26`` type for %%v%%. + */ + static bytes26(v6) { + return b(v6, 26); + } + /** + * Return a new ``bytes27`` type for %%v%%. + */ + static bytes27(v6) { + return b(v6, 27); + } + /** + * Return a new ``bytes28`` type for %%v%%. + */ + static bytes28(v6) { + return b(v6, 28); + } + /** + * Return a new ``bytes29`` type for %%v%%. + */ + static bytes29(v6) { + return b(v6, 29); + } + /** + * Return a new ``bytes30`` type for %%v%%. + */ + static bytes30(v6) { + return b(v6, 30); + } + /** + * Return a new ``bytes31`` type for %%v%%. + */ + static bytes31(v6) { + return b(v6, 31); + } + /** + * Return a new ``bytes32`` type for %%v%%. + */ + static bytes32(v6) { + return b(v6, 32); + } + /** + * Return a new ``address`` type for %%v%%. + */ + static address(v6) { + return new _Typed(_gaurd, "address", v6); + } + /** + * Return a new ``bool`` type for %%v%%. + */ + static bool(v6) { + return new _Typed(_gaurd, "bool", !!v6); + } + /** + * Return a new ``bytes`` type for %%v%%. + */ + static bytes(v6) { + return new _Typed(_gaurd, "bytes", v6); + } + /** + * Return a new ``string`` type for %%v%%. + */ + static string(v6) { + return new _Typed(_gaurd, "string", v6); + } + /** + * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. + */ + static array(v6, dynamic) { + throw new Error("not implemented yet"); + } + /** + * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. + */ + static tuple(v6, name2) { + throw new Error("not implemented yet"); + } + /** + * Return a new ``uint8`` type for %%v%%. + */ + static overrides(v6) { + return new _Typed(_gaurd, "overrides", Object.assign({}, v6)); + } + /** + * Returns true only if %%value%% is a [[Typed]] instance. + */ + static isTyped(value) { + return value && typeof value === "object" && "_typedSymbol" in value && value._typedSymbol === _typedSymbol; + } + /** + * If the value is a [[Typed]] instance, validates the underlying value + * and returns it, otherwise returns value directly. + * + * This is useful for functions that with to accept either a [[Typed]] + * object or values. + */ + static dereference(value, type2) { + if (_Typed.isTyped(value)) { + if (value.type !== type2) { + throw new Error(`invalid type: expecetd ${type2}, got ${value.type}`); + } + return value.value; + } + return value; + } +}; +_options = new WeakMap(); +let Typed = _Typed; +class AddressCoder extends Coder { + constructor(localName) { + super("address", "address", localName, false); + } + defaultValue() { + return "0x0000000000000000000000000000000000000000"; + } + encode(writer, _value2) { + let value = Typed.dereference(_value2, "string"); + try { + value = getAddress$1(value); + } catch (error) { + return this._throwError(error.message, _value2); + } + return writer.writeValue(value); + } + decode(reader) { + return getAddress$1(toBeHex(reader.readValue(), 20)); + } +} +class AnonymousCoder extends Coder { + constructor(coder) { + super(coder.name, coder.type, "_", coder.dynamic); + __publicField(this, "coder"); + this.coder = coder; + } + defaultValue() { + return this.coder.defaultValue(); + } + encode(writer, value) { + return this.coder.encode(writer, value); + } + decode(reader) { + return this.coder.decode(reader); + } +} +function pack(writer, coders, values) { + let arrayValues = []; + if (Array.isArray(values)) { + arrayValues = values; + } else if (values && typeof values === "object") { + let unique = {}; + arrayValues = coders.map((coder) => { + const name2 = coder.localName; + assert(name2, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); + assert(!unique[name2], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); + unique[name2] = true; + return values[name2]; + }); + } else { + assertArgument(false, "invalid tuple value", "tuple", values); + } + assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); + let staticWriter = new Writer(); + let dynamicWriter = new Writer(); + let updateFuncs = []; + coders.forEach((coder, index2) => { + let value = arrayValues[index2]; + if (coder.dynamic) { + let dynamicOffset = dynamicWriter.length; + coder.encode(dynamicWriter, value); + let updateFunc = staticWriter.writeUpdatableValue(); + updateFuncs.push((baseOffset) => { + updateFunc(baseOffset + dynamicOffset); + }); + } else { + coder.encode(staticWriter, value); + } + }); + updateFuncs.forEach((func) => { + func(staticWriter.length); + }); + let length = writer.appendWriter(staticWriter); + length += writer.appendWriter(dynamicWriter); + return length; +} +function unpack(reader, coders) { + let values = []; + let keys2 = []; + let baseReader = reader.subReader(0); + coders.forEach((coder) => { + let value = null; + if (coder.dynamic) { + let offset2 = reader.readIndex(); + let offsetReader = baseReader.subReader(offset2); + try { + value = coder.decode(offsetReader); + } catch (error) { + if (isError(error, "BUFFER_OVERRUN")) { + throw error; + } + value = error; + value.baseType = coder.name; + value.name = coder.localName; + value.type = coder.type; + } + } else { + try { + value = coder.decode(reader); + } catch (error) { + if (isError(error, "BUFFER_OVERRUN")) { + throw error; + } + value = error; + value.baseType = coder.name; + value.name = coder.localName; + value.type = coder.type; + } + } + if (value == void 0) { + throw new Error("investigate"); + } + values.push(value); + keys2.push(coder.localName || null); + }); + return Result.fromItems(values, keys2); +} +class ArrayCoder extends Coder { + constructor(coder, length, localName) { + const type2 = coder.type + "[" + (length >= 0 ? length : "") + "]"; + const dynamic = length === -1 || coder.dynamic; + super("array", type2, localName, dynamic); + __publicField(this, "coder"); + __publicField(this, "length"); + defineProperties(this, { coder, length }); + } + defaultValue() { + const defaultChild = this.coder.defaultValue(); + const result = []; + for (let i2 = 0; i2 < this.length; i2++) { + result.push(defaultChild); + } + return result; + } + encode(writer, _value2) { + const value = Typed.dereference(_value2, "array"); + if (!Array.isArray(value)) { + this._throwError("expected array value", value); + } + let count = this.length; + if (count === -1) { + count = value.length; + writer.writeValue(value.length); + } + assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); + let coders = []; + for (let i2 = 0; i2 < value.length; i2++) { + coders.push(this.coder); + } + return pack(writer, coders, value); + } + decode(reader) { + let count = this.length; + if (count === -1) { + count = reader.readIndex(); + assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength }); + } + let coders = []; + for (let i2 = 0; i2 < count; i2++) { + coders.push(new AnonymousCoder(this.coder)); + } + return unpack(reader, coders); + } +} +class BooleanCoder extends Coder { + constructor(localName) { + super("bool", "bool", localName, false); + } + defaultValue() { + return false; + } + encode(writer, _value2) { + const value = Typed.dereference(_value2, "bool"); + return writer.writeValue(value ? 1 : 0); + } + decode(reader) { + return !!reader.readValue(); + } +} +class DynamicBytesCoder extends Coder { + constructor(type2, localName) { + super(type2, type2, localName, true); + } + defaultValue() { + return "0x"; + } + encode(writer, value) { + value = getBytesCopy(value); + let length = writer.writeValue(value.length); + length += writer.writeBytes(value); + return length; + } + decode(reader) { + return reader.readBytes(reader.readIndex(), true); + } +} +class BytesCoder extends DynamicBytesCoder { + constructor(localName) { + super("bytes", localName); + } + decode(reader) { + return hexlify(super.decode(reader)); + } +} +class FixedBytesCoder extends Coder { + constructor(size2, localName) { + let name2 = "bytes" + String(size2); + super(name2, name2, localName, false); + __publicField(this, "size"); + defineProperties(this, { size: size2 }, { size: "number" }); + } + defaultValue() { + return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); + } + encode(writer, _value2) { + let data = getBytesCopy(Typed.dereference(_value2, this.type)); + if (data.length !== this.size) { + this._throwError("incorrect data length", _value2); + } + return writer.writeBytes(data); + } + decode(reader) { + return hexlify(reader.readBytes(this.size)); + } +} +const Empty = new Uint8Array([]); +class NullCoder extends Coder { + constructor(localName) { + super("null", "", localName, false); + } + defaultValue() { + return null; + } + encode(writer, value) { + if (value != null) { + this._throwError("not null", value); + } + return writer.writeBytes(Empty); + } + decode(reader) { + reader.readBytes(0); + return null; + } +} +const BN_0$3 = BigInt(0); +const BN_1$2 = BigInt(1); +const BN_MAX_UINT256$2 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); +class NumberCoder extends Coder { + constructor(size2, signed, localName) { + const name2 = (signed ? "int" : "uint") + size2 * 8; + super(name2, name2, localName, false); + __publicField(this, "size"); + __publicField(this, "signed"); + defineProperties(this, { size: size2, signed }, { size: "number", signed: "boolean" }); + } + defaultValue() { + return 0; + } + encode(writer, _value2) { + let value = getBigInt(Typed.dereference(_value2, this.type)); + let maxUintValue = mask(BN_MAX_UINT256$2, WordSize * 8); + if (this.signed) { + let bounds = mask(maxUintValue, this.size * 8 - 1); + if (value > bounds || value < -(bounds + BN_1$2)) { + this._throwError("value out-of-bounds", _value2); + } + value = toTwos(value, 8 * WordSize); + } else if (value < BN_0$3 || value > mask(maxUintValue, this.size * 8)) { + this._throwError("value out-of-bounds", _value2); + } + return writer.writeValue(value); + } + decode(reader) { + let value = mask(reader.readValue(), this.size * 8); + if (this.signed) { + value = fromTwos(value, this.size * 8); + } + return value; + } +} +class StringCoder extends DynamicBytesCoder { + constructor(localName) { + super("string", localName); + } + defaultValue() { + return ""; + } + encode(writer, _value2) { + return super.encode(writer, toUtf8Bytes(Typed.dereference(_value2, "string"))); + } + decode(reader) { + return toUtf8String(super.decode(reader)); + } +} +class TupleCoder extends Coder { + constructor(coders, localName) { + let dynamic = false; + const types2 = []; + coders.forEach((coder) => { + if (coder.dynamic) { + dynamic = true; + } + types2.push(coder.type); + }); + const type2 = "tuple(" + types2.join(",") + ")"; + super("tuple", type2, localName, dynamic); + __publicField(this, "coders"); + defineProperties(this, { coders: Object.freeze(coders.slice()) }); + } + defaultValue() { + const values = []; + this.coders.forEach((coder) => { + values.push(coder.defaultValue()); + }); + const uniqueNames = this.coders.reduce((accum, coder) => { + const name2 = coder.localName; + if (name2) { + if (!accum[name2]) { + accum[name2] = 0; + } + accum[name2]++; + } + return accum; + }, {}); + this.coders.forEach((coder, index2) => { + let name2 = coder.localName; + if (!name2 || uniqueNames[name2] !== 1) { + return; + } + if (name2 === "length") { + name2 = "_length"; + } + if (values[name2] != null) { + return; + } + values[name2] = values[index2]; + }); + return Object.freeze(values); + } + encode(writer, _value2) { + const value = Typed.dereference(_value2, "tuple"); + return pack(writer, this.coders, value); + } + decode(reader) { + return unpack(reader, this.coders); + } +} +function id(value) { + return keccak256(toUtf8Bytes(value)); +} +function accessSetify(addr, storageKeys) { + return { + address: getAddress$1(addr), + storageKeys: storageKeys.map((storageKey, index2) => { + assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index2}]`, storageKey); + return storageKey.toLowerCase(); + }) + }; +} +function accessListify(value) { + if (Array.isArray(value)) { + return value.map((set2, index2) => { + if (Array.isArray(set2)) { + assertArgument(set2.length === 2, "invalid slot set", `value[${index2}]`, set2); + return accessSetify(set2[0], set2[1]); + } + assertArgument(set2 != null && typeof set2 === "object", "invalid address-slot set", "value", value); + return accessSetify(set2.address, set2.storageKeys); + }); + } + assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); + const result = Object.keys(value).map((addr) => { + const storageKeys = value[addr].reduce((accum, storageKey) => { + accum[storageKey] = true; + return accum; + }, {}); + return accessSetify(addr, Object.keys(storageKeys).sort()); + }); + result.sort((a3, b2) => a3.address.localeCompare(b2.address)); + return result; +} +function computeAddress$1(key2) { + let pubkey; + if (typeof key2 === "string") { + pubkey = SigningKey.computePublicKey(key2, false); + } else { + pubkey = key2.publicKey; + } + return getAddress$1(keccak256("0x" + pubkey.substring(4)).substring(26)); +} +function recoverAddress(digest9, signature2) { + return computeAddress$1(SigningKey.recoverPublicKey(digest9, signature2)); +} +const BN_0$2 = BigInt(0); +const BN_2 = BigInt(2); +const BN_27 = BigInt(27); +const BN_28 = BigInt(28); +const BN_35 = BigInt(35); +const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); +const BLOB_SIZE = 4096 * 32; +function getVersionedHash(version2, hash3) { + let versioned = version2.toString(16); + while (versioned.length < 2) { + versioned = "0" + versioned; + } + versioned += sha256(hash3).substring(4); + return "0x" + versioned; +} +function handleAddress(value) { + if (value === "0x") { + return null; + } + return getAddress$1(value); +} +function handleAccessList(value, param) { + try { + return accessListify(value); + } catch (error) { + assertArgument(false, error.message, param, value); + } +} +function handleNumber(_value2, param) { + if (_value2 === "0x") { + return 0; + } + return getNumber(_value2, param); +} +function handleUint(_value2, param) { + if (_value2 === "0x") { + return BN_0$2; + } + const value = getBigInt(_value2, param); + assertArgument(value <= BN_MAX_UINT, "value exceeds uint size", param, value); + return value; +} +function formatNumber(_value2, name2) { + const value = getBigInt(_value2, "value"); + const result = toBeArray(value); + assertArgument(result.length <= 32, `value too large`, `tx.${name2}`, value); + return result; +} +function formatAccessList(value) { + return accessListify(value).map((set2) => [set2.address, set2.storageKeys]); +} +function formatHashes(value, param) { + assertArgument(Array.isArray(value), `invalid ${param}`, "value", value); + for (let i2 = 0; i2 < value.length; i2++) { + assertArgument(isHexString(value[i2], 32), "invalid ${ param } hash", `value[${i2}]`, value[i2]); + } + return value; +} +function _parseLegacy(data) { + const fields = decodeRlp(data); + assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), "invalid field count for legacy transaction", "data", data); + const tx = { + type: 0, + nonce: handleNumber(fields[0], "nonce"), + gasPrice: handleUint(fields[1], "gasPrice"), + gasLimit: handleUint(fields[2], "gasLimit"), + to: handleAddress(fields[3]), + value: handleUint(fields[4], "value"), + data: hexlify(fields[5]), + chainId: BN_0$2 + }; + if (fields.length === 6) { + return tx; + } + const v6 = handleUint(fields[6], "v"); + const r2 = handleUint(fields[7], "r"); + const s2 = handleUint(fields[8], "s"); + if (r2 === BN_0$2 && s2 === BN_0$2) { + tx.chainId = v6; + } else { + let chainId = (v6 - BN_35) / BN_2; + if (chainId < BN_0$2) { + chainId = BN_0$2; + } + tx.chainId = chainId; + assertArgument(chainId !== BN_0$2 || (v6 === BN_27 || v6 === BN_28), "non-canonical legacy v", "v", fields[6]); + tx.signature = Signature.from({ + r: zeroPadValue(fields[7], 32), + s: zeroPadValue(fields[8], 32), + v: v6 + }); + } + return tx; +} +function _serializeLegacy(tx, sig) { + const fields = [ + formatNumber(tx.nonce, "nonce"), + formatNumber(tx.gasPrice || 0, "gasPrice"), + formatNumber(tx.gasLimit, "gasLimit"), + tx.to || "0x", + formatNumber(tx.value, "value"), + tx.data + ]; + let chainId = BN_0$2; + if (tx.chainId != BN_0$2) { + chainId = getBigInt(tx.chainId, "tx.chainId"); + assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig); + } else if (tx.signature) { + const legacy = tx.signature.legacyChainId; + if (legacy != null) { + chainId = legacy; + } + } + if (!sig) { + if (chainId !== BN_0$2) { + fields.push(toBeArray(chainId)); + fields.push("0x"); + fields.push("0x"); + } + return encodeRlp(fields); + } + let v6 = BigInt(27 + sig.yParity); + if (chainId !== BN_0$2) { + v6 = Signature.getChainIdV(chainId, sig.v); + } else if (BigInt(sig.v) !== v6) { + assertArgument(false, "tx.chainId/sig.v mismatch", "sig", sig); + } + fields.push(toBeArray(v6)); + fields.push(toBeArray(sig.r)); + fields.push(toBeArray(sig.s)); + return encodeRlp(fields); +} +function _parseEipSignature(tx, fields) { + let yParity; + try { + yParity = handleNumber(fields[0], "yParity"); + if (yParity !== 0 && yParity !== 1) { + throw new Error("bad yParity"); + } + } catch (error) { + assertArgument(false, "invalid yParity", "yParity", fields[0]); + } + const r2 = zeroPadValue(fields[1], 32); + const s2 = zeroPadValue(fields[2], 32); + const signature2 = Signature.from({ r: r2, s: s2, yParity }); + tx.signature = signature2; +} +function _parseEip1559(data) { + const fields = decodeRlp(getBytes(data).slice(1)); + assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), "invalid field count for transaction type: 2", "data", hexlify(data)); + const tx = { + type: 2, + chainId: handleUint(fields[0], "chainId"), + nonce: handleNumber(fields[1], "nonce"), + maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), + maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), + gasPrice: null, + gasLimit: handleUint(fields[4], "gasLimit"), + to: handleAddress(fields[5]), + value: handleUint(fields[6], "value"), + data: hexlify(fields[7]), + accessList: handleAccessList(fields[8], "accessList") + }; + if (fields.length === 9) { + return tx; + } + _parseEipSignature(tx, fields.slice(9)); + return tx; +} +function _serializeEip1559(tx, sig) { + const fields = [ + formatNumber(tx.chainId, "chainId"), + formatNumber(tx.nonce, "nonce"), + formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), + formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), + formatNumber(tx.gasLimit, "gasLimit"), + tx.to || "0x", + formatNumber(tx.value, "value"), + tx.data, + formatAccessList(tx.accessList || []) + ]; + if (sig) { + fields.push(formatNumber(sig.yParity, "yParity")); + fields.push(toBeArray(sig.r)); + fields.push(toBeArray(sig.s)); + } + return concat(["0x02", encodeRlp(fields)]); +} +function _parseEip2930(data) { + const fields = decodeRlp(getBytes(data).slice(1)); + assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), "invalid field count for transaction type: 1", "data", hexlify(data)); + const tx = { + type: 1, + chainId: handleUint(fields[0], "chainId"), + nonce: handleNumber(fields[1], "nonce"), + gasPrice: handleUint(fields[2], "gasPrice"), + gasLimit: handleUint(fields[3], "gasLimit"), + to: handleAddress(fields[4]), + value: handleUint(fields[5], "value"), + data: hexlify(fields[6]), + accessList: handleAccessList(fields[7], "accessList") + }; + if (fields.length === 8) { + return tx; + } + _parseEipSignature(tx, fields.slice(8)); + return tx; +} +function _serializeEip2930(tx, sig) { + const fields = [ + formatNumber(tx.chainId, "chainId"), + formatNumber(tx.nonce, "nonce"), + formatNumber(tx.gasPrice || 0, "gasPrice"), + formatNumber(tx.gasLimit, "gasLimit"), + tx.to || "0x", + formatNumber(tx.value, "value"), + tx.data, + formatAccessList(tx.accessList || []) + ]; + if (sig) { + fields.push(formatNumber(sig.yParity, "recoveryParam")); + fields.push(toBeArray(sig.r)); + fields.push(toBeArray(sig.s)); + } + return concat(["0x01", encodeRlp(fields)]); +} +function _parseEip4844(data) { + let fields = decodeRlp(getBytes(data).slice(1)); + let typeName = "3"; + let blobs = null; + if (fields.length === 4 && Array.isArray(fields[0])) { + typeName = "3 (network format)"; + const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3]; + assertArgument(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs); + assertArgument(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits); + assertArgument(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs); + assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); + assertArgument(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); + blobs = []; + for (let i2 = 0; i2 < fields[1].length; i2++) { + blobs.push({ + data: fBlobs[i2], + commitment: fCommits[i2], + proof: fProofs[i2] + }); + } + fields = fields[0]; + } + assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, "data", hexlify(data)); + const tx = { + type: 3, + chainId: handleUint(fields[0], "chainId"), + nonce: handleNumber(fields[1], "nonce"), + maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), + maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), + gasPrice: null, + gasLimit: handleUint(fields[4], "gasLimit"), + to: handleAddress(fields[5]), + value: handleUint(fields[6], "value"), + data: hexlify(fields[7]), + accessList: handleAccessList(fields[8], "accessList"), + maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"), + blobVersionedHashes: fields[10] + }; + if (blobs) { + tx.blobs = blobs; + } + assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, "data", data); + assertArgument(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data); + for (let i2 = 0; i2 < tx.blobVersionedHashes.length; i2++) { + assertArgument(isHexString(tx.blobVersionedHashes[i2], 32), `invalid blobVersionedHash at index ${i2}: must be length 32`, "data", data); + } + if (fields.length === 11) { + return tx; + } + _parseEipSignature(tx, fields.slice(11)); + return tx; +} +function _serializeEip4844(tx, sig, blobs) { + const fields = [ + formatNumber(tx.chainId, "chainId"), + formatNumber(tx.nonce, "nonce"), + formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), + formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), + formatNumber(tx.gasLimit, "gasLimit"), + tx.to || ZeroAddress, + formatNumber(tx.value, "value"), + tx.data, + formatAccessList(tx.accessList || []), + formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"), + formatHashes(tx.blobVersionedHashes || [], "blobVersionedHashes") + ]; + if (sig) { + fields.push(formatNumber(sig.yParity, "yParity")); + fields.push(toBeArray(sig.r)); + fields.push(toBeArray(sig.s)); + if (blobs) { + return concat([ + "0x03", + encodeRlp([ + fields, + blobs.map((b2) => b2.data), + blobs.map((b2) => b2.commitment), + blobs.map((b2) => b2.proof) + ]) + ]); + } + } + return concat(["0x03", encodeRlp(fields)]); +} +let Transaction$1 = (_n2 = class { + /** + * Creates a new Transaction with default values. + */ + constructor() { + __privateAdd(this, _getSerialized); + __privateAdd(this, _type, void 0); + __privateAdd(this, _to, void 0); + __privateAdd(this, _data3, void 0); + __privateAdd(this, _nonce, void 0); + __privateAdd(this, _gasLimit, void 0); + __privateAdd(this, _gasPrice, void 0); + __privateAdd(this, _maxPriorityFeePerGas, void 0); + __privateAdd(this, _maxFeePerGas, void 0); + __privateAdd(this, _value, void 0); + __privateAdd(this, _chainId, void 0); + __privateAdd(this, _sig, void 0); + __privateAdd(this, _accessList, void 0); + __privateAdd(this, _maxFeePerBlobGas, void 0); + __privateAdd(this, _blobVersionedHashes, void 0); + __privateAdd(this, _kzg, void 0); + __privateAdd(this, _blobs, void 0); + __privateSet(this, _type, null); + __privateSet(this, _to, null); + __privateSet(this, _nonce, 0); + __privateSet(this, _gasLimit, BN_0$2); + __privateSet(this, _gasPrice, null); + __privateSet(this, _maxPriorityFeePerGas, null); + __privateSet(this, _maxFeePerGas, null); + __privateSet(this, _data3, "0x"); + __privateSet(this, _value, BN_0$2); + __privateSet(this, _chainId, BN_0$2); + __privateSet(this, _sig, null); + __privateSet(this, _accessList, null); + __privateSet(this, _maxFeePerBlobGas, null); + __privateSet(this, _blobVersionedHashes, null); + __privateSet(this, _blobs, null); + __privateSet(this, _kzg, null); + } + /** + * The transaction type. + * + * If null, the type will be automatically inferred based on + * explicit properties. + */ + get type() { + return __privateGet(this, _type); + } + set type(value) { + switch (value) { + case null: + __privateSet(this, _type, null); + break; + case 0: + case "legacy": + __privateSet(this, _type, 0); + break; + case 1: + case "berlin": + case "eip-2930": + __privateSet(this, _type, 1); + break; + case 2: + case "london": + case "eip-1559": + __privateSet(this, _type, 2); + break; + case 3: + case "cancun": + case "eip-4844": + __privateSet(this, _type, 3); + break; + default: + assertArgument(false, "unsupported transaction type", "type", value); + } + } + /** + * The name of the transaction type. + */ + get typeName() { + switch (this.type) { + case 0: + return "legacy"; + case 1: + return "eip-2930"; + case 2: + return "eip-1559"; + case 3: + return "eip-4844"; + } + return null; + } + /** + * The ``to`` address for the transaction or ``null`` if the + * transaction is an ``init`` transaction. + */ + get to() { + const value = __privateGet(this, _to); + if (value == null && this.type === 3) { + return ZeroAddress; + } + return value; + } + set to(value) { + __privateSet(this, _to, value == null ? null : getAddress$1(value)); + } + /** + * The transaction nonce. + */ + get nonce() { + return __privateGet(this, _nonce); + } + set nonce(value) { + __privateSet(this, _nonce, getNumber(value, "value")); + } + /** + * The gas limit. + */ + get gasLimit() { + return __privateGet(this, _gasLimit); + } + set gasLimit(value) { + __privateSet(this, _gasLimit, getBigInt(value)); + } + /** + * The gas price. + * + * On legacy networks this defines the fee that will be paid. On + * EIP-1559 networks, this should be ``null``. + */ + get gasPrice() { + const value = __privateGet(this, _gasPrice); + if (value == null && (this.type === 0 || this.type === 1)) { + return BN_0$2; + } + return value; + } + set gasPrice(value) { + __privateSet(this, _gasPrice, value == null ? null : getBigInt(value, "gasPrice")); + } + /** + * The maximum priority fee per unit of gas to pay. On legacy + * networks this should be ``null``. + */ + get maxPriorityFeePerGas() { + const value = __privateGet(this, _maxPriorityFeePerGas); + if (value == null) { + if (this.type === 2 || this.type === 3) { + return BN_0$2; + } + return null; + } + return value; + } + set maxPriorityFeePerGas(value) { + __privateSet(this, _maxPriorityFeePerGas, value == null ? null : getBigInt(value, "maxPriorityFeePerGas")); + } + /** + * The maximum total fee per unit of gas to pay. On legacy + * networks this should be ``null``. + */ + get maxFeePerGas() { + const value = __privateGet(this, _maxFeePerGas); + if (value == null) { + if (this.type === 2 || this.type === 3) { + return BN_0$2; + } + return null; + } + return value; + } + set maxFeePerGas(value) { + __privateSet(this, _maxFeePerGas, value == null ? null : getBigInt(value, "maxFeePerGas")); + } + /** + * The transaction data. For ``init`` transactions this is the + * deployment code. + */ + get data() { + return __privateGet(this, _data3); + } + set data(value) { + __privateSet(this, _data3, hexlify(value)); + } + /** + * The amount of ether (in wei) to send in this transactions. + */ + get value() { + return __privateGet(this, _value); + } + set value(value) { + __privateSet(this, _value, getBigInt(value, "value")); + } + /** + * The chain ID this transaction is valid on. + */ + get chainId() { + return __privateGet(this, _chainId); + } + set chainId(value) { + __privateSet(this, _chainId, getBigInt(value)); + } + /** + * If signed, the signature for this transaction. + */ + get signature() { + return __privateGet(this, _sig) || null; + } + set signature(value) { + __privateSet(this, _sig, value == null ? null : Signature.from(value)); + } + /** + * The access list. + * + * An access list permits discounted (but pre-paid) access to + * bytecode and state variable access within contract execution. + */ + get accessList() { + const value = __privateGet(this, _accessList) || null; + if (value == null) { + if (this.type === 1 || this.type === 2 || this.type === 3) { + return []; + } + return null; + } + return value; + } + set accessList(value) { + __privateSet(this, _accessList, value == null ? null : accessListify(value)); + } + /** + * The max fee per blob gas for Cancun transactions. + */ + get maxFeePerBlobGas() { + const value = __privateGet(this, _maxFeePerBlobGas); + if (value == null && this.type === 3) { + return BN_0$2; + } + return value; + } + set maxFeePerBlobGas(value) { + __privateSet(this, _maxFeePerBlobGas, value == null ? null : getBigInt(value, "maxFeePerBlobGas")); + } + /** + * The BLOb versioned hashes for Cancun transactions. + */ + get blobVersionedHashes() { + let value = __privateGet(this, _blobVersionedHashes); + if (value == null && this.type === 3) { + return []; + } + return value; + } + set blobVersionedHashes(value) { + if (value != null) { + assertArgument(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value); + value = value.slice(); + for (let i2 = 0; i2 < value.length; i2++) { + assertArgument(isHexString(value[i2], 32), "invalid blobVersionedHash", `value[${i2}]`, value[i2]); + } + } + __privateSet(this, _blobVersionedHashes, value); + } + /** + * The BLObs for the Transaction, if any. + * + * If ``blobs`` is non-``null``, then the [[seriailized]] + * will return the network formatted sidecar, otherwise it + * will return the standard [[link-eip-2718]] payload. The + * [[unsignedSerialized]] is unaffected regardless. + * + * When setting ``blobs``, either fully valid [[Blob]] objects + * may be specified (i.e. correctly padded, with correct + * committments and proofs) or a raw [[BytesLike]] may + * be provided. + * + * If raw [[BytesLike]] are provided, the [[kzg]] property **must** + * be already set. The blob will be correctly padded and the + * [[KzgLibrary]] will be used to compute the committment and + * proof for the blob. + * + * A BLOb is a sequence of field elements, each of which must + * be within the BLS field modulo, so some additional processing + * may be required to encode arbitrary data to ensure each 32 byte + * field is within the valid range. + * + * Setting this automatically populates [[blobVersionedHashes]], + * overwriting any existing values. Setting this to ``null`` + * does **not** remove the [[blobVersionedHashes]], leaving them + * present. + */ + get blobs() { + if (__privateGet(this, _blobs) == null) { + return null; + } + return __privateGet(this, _blobs).map((b2) => Object.assign({}, b2)); + } + set blobs(_blobs2) { + if (_blobs2 == null) { + __privateSet(this, _blobs, null); + return; + } + const blobs = []; + const versionedHashes = []; + for (let i2 = 0; i2 < _blobs2.length; i2++) { + const blob2 = _blobs2[i2]; + if (isBytesLike(blob2)) { + assert(__privateGet(this, _kzg), "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", { + operation: "set blobs()" + }); + let data = getBytes(blob2); + assertArgument(data.length <= BLOB_SIZE, "blob is too large", `blobs[${i2}]`, blob2); + if (data.length !== BLOB_SIZE) { + const padded = new Uint8Array(BLOB_SIZE); + padded.set(data); + data = padded; + } + const commit = __privateGet(this, _kzg).blobToKzgCommitment(data); + const proof = hexlify(__privateGet(this, _kzg).computeBlobKzgProof(data, commit)); + blobs.push({ + data: hexlify(data), + commitment: hexlify(commit), + proof + }); + versionedHashes.push(getVersionedHash(1, commit)); + } else { + const commit = hexlify(blob2.commitment); + blobs.push({ + data: hexlify(blob2.data), + commitment: commit, + proof: hexlify(blob2.proof) + }); + versionedHashes.push(getVersionedHash(1, commit)); + } + } + __privateSet(this, _blobs, blobs); + __privateSet(this, _blobVersionedHashes, versionedHashes); + } + get kzg() { + return __privateGet(this, _kzg); + } + set kzg(kzg) { + __privateSet(this, _kzg, kzg); + } + /** + * The transaction hash, if signed. Otherwise, ``null``. + */ + get hash() { + if (this.signature == null) { + return null; + } + return keccak256(__privateMethod(this, _getSerialized, getSerialized_fn).call(this, true, false)); + } + /** + * The pre-image hash of this transaction. + * + * This is the digest that a [[Signer]] must sign to authorize + * this transaction. + */ + get unsignedHash() { + return keccak256(this.unsignedSerialized); + } + /** + * The sending address, if signed. Otherwise, ``null``. + */ + get from() { + if (this.signature == null) { + return null; + } + return recoverAddress(this.unsignedHash, this.signature); + } + /** + * The public key of the sender, if signed. Otherwise, ``null``. + */ + get fromPublicKey() { + if (this.signature == null) { + return null; + } + return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); + } + /** + * Returns true if signed. + * + * This provides a Type Guard that properties requiring a signed + * transaction are non-null. + */ + isSigned() { + return this.signature != null; + } + /** + * The serialized transaction. + * + * This throws if the transaction is unsigned. For the pre-image, + * use [[unsignedSerialized]]. + */ + get serialized() { + return __privateMethod(this, _getSerialized, getSerialized_fn).call(this, true, true); + } + /** + * The transaction pre-image. + * + * The hash of this is the digest which needs to be signed to + * authorize this transaction. + */ + get unsignedSerialized() { + return __privateMethod(this, _getSerialized, getSerialized_fn).call(this, false, false); + } + /** + * Return the most "likely" type; currently the highest + * supported transaction type. + */ + inferType() { + const types2 = this.inferTypes(); + if (types2.indexOf(2) >= 0) { + return 2; + } + return types2.pop(); + } + /** + * Validates the explicit properties and returns a list of compatible + * transaction types. + */ + inferTypes() { + const hasGasPrice = this.gasPrice != null; + const hasFee = this.maxFeePerGas != null || this.maxPriorityFeePerGas != null; + const hasAccessList = this.accessList != null; + const hasBlob = __privateGet(this, _maxFeePerBlobGas) != null || __privateGet(this, _blobVersionedHashes); + if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) { + assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, "priorityFee cannot be more than maxFee", "BAD_DATA", { value: this }); + } + assert(!hasFee || this.type !== 0 && this.type !== 1, "transaction type cannot have maxFeePerGas or maxPriorityFeePerGas", "BAD_DATA", { value: this }); + assert(this.type !== 0 || !hasAccessList, "legacy transaction cannot have accessList", "BAD_DATA", { value: this }); + const types2 = []; + if (this.type != null) { + types2.push(this.type); + } else { + if (hasFee) { + types2.push(2); + } else if (hasGasPrice) { + types2.push(1); + if (!hasAccessList) { + types2.push(0); + } + } else if (hasAccessList) { + types2.push(1); + types2.push(2); + } else if (hasBlob && this.to) { + types2.push(3); + } else { + types2.push(0); + types2.push(1); + types2.push(2); + types2.push(3); + } + } + types2.sort(); + return types2; + } + /** + * Returns true if this transaction is a legacy transaction (i.e. + * ``type === 0``). + * + * This provides a Type Guard that the related properties are + * non-null. + */ + isLegacy() { + return this.type === 0; + } + /** + * Returns true if this transaction is berlin hardform transaction (i.e. + * ``type === 1``). + * + * This provides a Type Guard that the related properties are + * non-null. + */ + isBerlin() { + return this.type === 1; + } + /** + * Returns true if this transaction is london hardform transaction (i.e. + * ``type === 2``). + * + * This provides a Type Guard that the related properties are + * non-null. + */ + isLondon() { + return this.type === 2; + } + /** + * Returns true if this transaction is an [[link-eip-4844]] BLOB + * transaction. + * + * This provides a Type Guard that the related properties are + * non-null. + */ + isCancun() { + return this.type === 3; + } + /** + * Create a copy of this transaciton. + */ + clone() { + return _n2.from(this); + } + /** + * Return a JSON-friendly object. + */ + toJSON() { + const s2 = (v6) => { + if (v6 == null) { + return null; + } + return v6.toString(); + }; + return { + type: this.type, + to: this.to, + // from: this.from, + data: this.data, + nonce: this.nonce, + gasLimit: s2(this.gasLimit), + gasPrice: s2(this.gasPrice), + maxPriorityFeePerGas: s2(this.maxPriorityFeePerGas), + maxFeePerGas: s2(this.maxFeePerGas), + value: s2(this.value), + chainId: s2(this.chainId), + sig: this.signature ? this.signature.toJSON() : null, + accessList: this.accessList + }; + } + /** + * Create a **Transaction** from a serialized transaction or a + * Transaction-like object. + */ + static from(tx) { + if (tx == null) { + return new _n2(); + } + if (typeof tx === "string") { + const payload = getBytes(tx); + if (payload[0] >= 127) { + return _n2.from(_parseLegacy(payload)); + } + switch (payload[0]) { + case 1: + return _n2.from(_parseEip2930(payload)); + case 2: + return _n2.from(_parseEip1559(payload)); + case 3: + return _n2.from(_parseEip4844(payload)); + } + assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" }); + } + const result = new _n2(); + if (tx.type != null) { + result.type = tx.type; + } + if (tx.to != null) { + result.to = tx.to; + } + if (tx.nonce != null) { + result.nonce = tx.nonce; + } + if (tx.gasLimit != null) { + result.gasLimit = tx.gasLimit; + } + if (tx.gasPrice != null) { + result.gasPrice = tx.gasPrice; + } + if (tx.maxPriorityFeePerGas != null) { + result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas; + } + if (tx.maxFeePerGas != null) { + result.maxFeePerGas = tx.maxFeePerGas; + } + if (tx.maxFeePerBlobGas != null) { + result.maxFeePerBlobGas = tx.maxFeePerBlobGas; + } + if (tx.data != null) { + result.data = tx.data; + } + if (tx.value != null) { + result.value = tx.value; + } + if (tx.chainId != null) { + result.chainId = tx.chainId; + } + if (tx.signature != null) { + result.signature = Signature.from(tx.signature); + } + if (tx.accessList != null) { + result.accessList = tx.accessList; + } + if (tx.blobVersionedHashes != null) { + result.blobVersionedHashes = tx.blobVersionedHashes; + } + if (tx.kzg != null) { + result.kzg = tx.kzg; + } + if (tx.blobs != null) { + result.blobs = tx.blobs; + } + if (tx.hash != null) { + assertArgument(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); + assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); + } + if (tx.from != null) { + assertArgument(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); + assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); + } + return result; + } +}, _type = new WeakMap(), _to = new WeakMap(), _data3 = new WeakMap(), _nonce = new WeakMap(), _gasLimit = new WeakMap(), _gasPrice = new WeakMap(), _maxPriorityFeePerGas = new WeakMap(), _maxFeePerGas = new WeakMap(), _value = new WeakMap(), _chainId = new WeakMap(), _sig = new WeakMap(), _accessList = new WeakMap(), _maxFeePerBlobGas = new WeakMap(), _blobVersionedHashes = new WeakMap(), _kzg = new WeakMap(), _blobs = new WeakMap(), _getSerialized = new WeakSet(), getSerialized_fn = function(signed, sidecar) { + assert(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); + const sig = signed ? this.signature : null; + switch (this.inferType()) { + case 0: + return _serializeLegacy(this, sig); + case 1: + return _serializeEip2930(this, sig); + case 2: + return _serializeEip1559(this, sig); + case 3: + return _serializeEip4844(this, sig, sidecar ? this.blobs : null); + } + assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); +}, _n2); +function hashMessage$1(message2) { + if (typeof message2 === "string") { + message2 = toUtf8Bytes(message2); + } + return keccak256(concat([ + toUtf8Bytes(MessagePrefix), + toUtf8Bytes(String(message2.length)), + message2 + ])); +} +const padding$1 = new Uint8Array(32); +padding$1.fill(0); +const BN__1$1 = BigInt(-1); +const BN_0$1 = BigInt(0); +const BN_1$1 = BigInt(1); +const BN_MAX_UINT256$1 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); +function hexPadRight$1(value) { + const bytes2 = getBytes(value); + const padOffset = bytes2.length % 32; + if (padOffset) { + return concat([bytes2, padding$1.slice(padOffset)]); + } + return hexlify(bytes2); +} +const hexTrue$1 = toBeHex(BN_1$1, 32); +const hexFalse$1 = toBeHex(BN_0$1, 32); +const domainFieldTypes$1 = { + name: "string", + version: "string", + chainId: "uint256", + verifyingContract: "address", + salt: "bytes32" +}; +const domainFieldNames$1 = [ + "name", + "version", + "chainId", + "verifyingContract", + "salt" +]; +function checkString$1(key2) { + return function(value) { + assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key2)}`, `domain.${key2}`, value); + return value; + }; +} +const domainChecks$1 = { + name: checkString$1("name"), + version: checkString$1("version"), + chainId: function(_value2) { + const value = getBigInt(_value2, "domain.chainId"); + assertArgument(value >= 0, "invalid chain ID", "domain.chainId", _value2); + if (Number.isSafeInteger(value)) { + return Number(value); + } + return toQuantity(value); + }, + verifyingContract: function(value) { + try { + return getAddress$1(value).toLowerCase(); + } catch (error) { + } + assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); + }, + salt: function(value) { + const bytes2 = getBytes(value, "domain.salt"); + assertArgument(bytes2.length === 32, `invalid domain value "salt"`, "domain.salt", value); + return hexlify(bytes2); + } +}; +function getBaseEncoder$1(type2) { + { + const match = type2.match(/^(u?)int(\d+)$/); + if (match) { + const signed = match[1] === ""; + const width = parseInt(match[2]); + assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), "invalid numeric width", "type", type2); + const boundsUpper = mask(BN_MAX_UINT256$1, signed ? width - 1 : width); + const boundsLower = signed ? (boundsUpper + BN_1$1) * BN__1$1 : BN_0$1; + return function(_value2) { + const value = getBigInt(_value2, "value"); + assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type2}`, "value", value); + return toBeHex(signed ? toTwos(value, 256) : value, 32); + }; + } + } + { + const match = type2.match(/^bytes(\d+)$/); + if (match) { + const width = parseInt(match[1]); + assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type2); + return function(value) { + const bytes2 = getBytes(value); + assertArgument(bytes2.length === width, `invalid length for ${type2}`, "value", value); + return hexPadRight$1(value); + }; + } + } + switch (type2) { + case "address": + return function(value) { + return zeroPadValue(getAddress$1(value), 32); + }; + case "bool": + return function(value) { + return !value ? hexFalse$1 : hexTrue$1; + }; + case "bytes": + return function(value) { + return keccak256(value); + }; + case "string": + return function(value) { + return id(value); + }; + } + return null; +} +function encodeType$1(name2, fields) { + return `${name2}(${fields.map(({ name: name3, type: type2 }) => type2 + " " + name3).join(",")})`; +} +function splitArray(type2) { + const match = type2.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/); + if (match) { + return { + base: match[1], + index: match[2] + match[4], + array: { + base: match[1], + prefix: match[1] + match[2], + count: match[5] ? parseInt(match[5]) : -1 + } + }; + } + return { base: type2 }; +} +let TypedDataEncoder$1 = (_o2 = class { + /** + * Create a new **TypedDataEncoder** for %%types%%. + * + * This performs all necessary checking that types are valid and + * do not violate the [[link-eip-712]] structural constraints as + * well as computes the [[primaryType]]. + */ + constructor(_types3) { + __privateAdd(this, _getEncoder); + /** + * The primary type for the structured [[types]]. + * + * This is derived automatically from the [[types]], since no + * recursion is possible, once the DAG for the types is consturcted + * internally, the primary type must be the only remaining type with + * no parent nodes. + */ + __publicField(this, "primaryType"); + __privateAdd(this, _types, void 0); + __privateAdd(this, _fullTypes, void 0); + __privateAdd(this, _encoderCache, void 0); + __privateSet(this, _fullTypes, /* @__PURE__ */ new Map()); + __privateSet(this, _encoderCache, /* @__PURE__ */ new Map()); + const links = /* @__PURE__ */ new Map(); + const parents = /* @__PURE__ */ new Map(); + const subtypes = /* @__PURE__ */ new Map(); + const types2 = {}; + Object.keys(_types3).forEach((type2) => { + types2[type2] = _types3[type2].map(({ name: name2, type: type3 }) => { + let { base: base3, index: index2 } = splitArray(type3); + if (base3 === "int" && !_types3["int"]) { + base3 = "int256"; + } + if (base3 === "uint" && !_types3["uint"]) { + base3 = "uint256"; + } + return { name: name2, type: base3 + (index2 || "") }; + }); + links.set(type2, /* @__PURE__ */ new Set()); + parents.set(type2, []); + subtypes.set(type2, /* @__PURE__ */ new Set()); + }); + __privateSet(this, _types, JSON.stringify(types2)); + for (const name2 in types2) { + const uniqueNames = /* @__PURE__ */ new Set(); + for (const field of types2[name2]) { + assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name2)}`, "types", _types3); + uniqueNames.add(field.name); + const baseType = splitArray(field.type).base; + assertArgument(baseType !== name2, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types3); + const encoder2 = getBaseEncoder$1(baseType); + if (encoder2) { + continue; + } + assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", _types3); + parents.get(baseType).push(name2); + links.get(name2).add(baseType); + } + } + const primaryTypes = Array.from(parents.keys()).filter((n5) => parents.get(n5).length === 0); + assertArgument(primaryTypes.length !== 0, "missing primary type", "types", _types3); + assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t2) => JSON.stringify(t2)).join(", ")}`, "types", _types3); + defineProperties(this, { primaryType: primaryTypes[0] }); + function checkCircular(type2, found) { + assertArgument(!found.has(type2), `circular type reference to ${JSON.stringify(type2)}`, "types", _types3); + found.add(type2); + for (const child of links.get(type2)) { + if (!parents.has(child)) { + continue; + } + checkCircular(child, found); + for (const subtype of found) { + subtypes.get(subtype).add(child); + } + } + found.delete(type2); + } + checkCircular(this.primaryType, /* @__PURE__ */ new Set()); + for (const [name2, set2] of subtypes) { + const st2 = Array.from(set2); + st2.sort(); + __privateGet(this, _fullTypes).set(name2, encodeType$1(name2, types2[name2]) + st2.map((t2) => encodeType$1(t2, types2[t2])).join("")); + } + } + /** + * The types. + */ + get types() { + return JSON.parse(__privateGet(this, _types)); + } + /** + * Returnthe encoder for the specific %%type%%. + */ + getEncoder(type2) { + let encoder2 = __privateGet(this, _encoderCache).get(type2); + if (!encoder2) { + encoder2 = __privateMethod(this, _getEncoder, getEncoder_fn).call(this, type2); + __privateGet(this, _encoderCache).set(type2, encoder2); + } + return encoder2; + } + /** + * Return the full type for %%name%%. + */ + encodeType(name2) { + const result = __privateGet(this, _fullTypes).get(name2); + assertArgument(result, `unknown type: ${JSON.stringify(name2)}`, "name", name2); + return result; + } + /** + * Return the encoded %%value%% for the %%type%%. + */ + encodeData(type2, value) { + return this.getEncoder(type2)(value); + } + /** + * Returns the hash of %%value%% for the type of %%name%%. + */ + hashStruct(name2, value) { + return keccak256(this.encodeData(name2, value)); + } + /** + * Return the fulled encoded %%value%% for the [[types]]. + */ + encode(value) { + return this.encodeData(this.primaryType, value); + } + /** + * Return the hash of the fully encoded %%value%% for the [[types]]. + */ + hash(value) { + return this.hashStruct(this.primaryType, value); + } + /** + * @_ignore: + */ + _visit(type2, value, callback) { + { + const encoder2 = getBaseEncoder$1(type2); + if (encoder2) { + return callback(type2, value); + } + } + const array2 = splitArray(type2).array; + if (array2) { + assertArgument(array2.count === -1 || array2.count === value.length, `array length mismatch; expected length ${array2.count}`, "value", value); + return value.map((v6) => this._visit(array2.prefix, v6, callback)); + } + const fields = this.types[type2]; + if (fields) { + return fields.reduce((accum, { name: name2, type: type3 }) => { + accum[name2] = this._visit(type3, value[name2], callback); + return accum; + }, {}); + } + assertArgument(false, `unknown type: ${type2}`, "type", type2); + } + /** + * Call %%calback%% for each value in %%value%%, passing the type and + * component within %%value%%. + * + * This is useful for replacing addresses or other transformation that + * may be desired on each component, based on its type. + */ + visit(value, callback) { + return this._visit(this.primaryType, value, callback); + } + /** + * Create a new **TypedDataEncoder** for %%types%%. + */ + static from(types2) { + return new _o2(types2); + } + /** + * Return the primary type for %%types%%. + */ + static getPrimaryType(types2) { + return _o2.from(types2).primaryType; + } + /** + * Return the hashed struct for %%value%% using %%types%% and %%name%%. + */ + static hashStruct(name2, types2, value) { + return _o2.from(types2).hashStruct(name2, value); + } + /** + * Return the domain hash for %%domain%%. + */ + static hashDomain(domain) { + const domainFields = []; + for (const name2 in domain) { + if (domain[name2] == null) { + continue; + } + const type2 = domainFieldTypes$1[name2]; + assertArgument(type2, `invalid typed-data domain key: ${JSON.stringify(name2)}`, "domain", domain); + domainFields.push({ name: name2, type: type2 }); + } + domainFields.sort((a3, b2) => { + return domainFieldNames$1.indexOf(a3.name) - domainFieldNames$1.indexOf(b2.name); + }); + return _o2.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); + } + /** + * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. + */ + static encode(domain, types2, value) { + return concat([ + "0x1901", + _o2.hashDomain(domain), + _o2.from(types2).hash(value) + ]); + } + /** + * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. + */ + static hash(domain, types2, value) { + return keccak256(_o2.encode(domain, types2, value)); + } + // Replaces all address types with ENS names with their looked up address + /** + * Resolves to the value from resolving all addresses in %%value%% for + * %%types%% and the %%domain%%. + */ + static async resolveNames(domain, types2, value, resolveName) { + domain = Object.assign({}, domain); + for (const key2 in domain) { + if (domain[key2] == null) { + delete domain[key2]; + } + } + const ensCache = {}; + if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) { + ensCache[domain.verifyingContract] = "0x"; + } + const encoder2 = _o2.from(types2); + encoder2.visit(value, (type2, value2) => { + if (type2 === "address" && !isHexString(value2, 20)) { + ensCache[value2] = "0x"; + } + return value2; + }); + for (const name2 in ensCache) { + ensCache[name2] = await resolveName(name2); + } + if (domain.verifyingContract && ensCache[domain.verifyingContract]) { + domain.verifyingContract = ensCache[domain.verifyingContract]; + } + value = encoder2.visit(value, (type2, value2) => { + if (type2 === "address" && ensCache[value2]) { + return ensCache[value2]; + } + return value2; + }); + return { domain, value }; + } + /** + * Returns the JSON-encoded payload expected by nodes which implement + * the JSON-RPC [[link-eip-712]] method. + */ + static getPayload(domain, types2, value) { + _o2.hashDomain(domain); + const domainValues = {}; + const domainTypes = []; + domainFieldNames$1.forEach((name2) => { + const value2 = domain[name2]; + if (value2 == null) { + return; + } + domainValues[name2] = domainChecks$1[name2](value2); + domainTypes.push({ name: name2, type: domainFieldTypes$1[name2] }); + }); + const encoder2 = _o2.from(types2); + types2 = encoder2.types; + const typesWithDomain = Object.assign({}, types2); + assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types2); + typesWithDomain.EIP712Domain = domainTypes; + encoder2.encode(value); + return { + types: typesWithDomain, + domain: domainValues, + primaryType: encoder2.primaryType, + message: encoder2.visit(value, (type2, value2) => { + if (type2.match(/^bytes(\d*)/)) { + return hexlify(getBytes(value2)); + } + if (type2.match(/^u?int/)) { + return getBigInt(value2).toString(); + } + switch (type2) { + case "address": + return value2.toLowerCase(); + case "bool": + return !!value2; + case "string": + assertArgument(typeof value2 === "string", "invalid string", "value", value2); + return value2; + } + assertArgument(false, "unsupported type", "type", type2); + }) + }; + } +}, _types = new WeakMap(), _fullTypes = new WeakMap(), _encoderCache = new WeakMap(), _getEncoder = new WeakSet(), getEncoder_fn = function(type2) { + { + const encoder2 = getBaseEncoder$1(type2); + if (encoder2) { + return encoder2; + } + } + const array2 = splitArray(type2).array; + if (array2) { + const subtype = array2.prefix; + const subEncoder = this.getEncoder(subtype); + return (value) => { + assertArgument(array2.count === -1 || array2.count === value.length, `array length mismatch; expected length ${array2.count}`, "value", value); + let result = value.map(subEncoder); + if (__privateGet(this, _fullTypes).has(subtype)) { + result = result.map(keccak256); + } + return keccak256(concat(result)); + }; + } + const fields = this.types[type2]; + if (fields) { + const encodedType = id(__privateGet(this, _fullTypes).get(type2)); + return (value) => { + const values = fields.map(({ name: name2, type: type3 }) => { + const result = this.getEncoder(type3)(value[name2]); + if (__privateGet(this, _fullTypes).has(type3)) { + return keccak256(result); + } + return result; + }); + values.unshift(encodedType); + return concat(values); + }; + } + assertArgument(false, `unknown type: ${type2}`, "type", type2); +}, _o2); +function setify$1(items) { + const result = /* @__PURE__ */ new Set(); + items.forEach((k2) => result.add(k2)); + return Object.freeze(result); +} +const _kwVisibDeploy = "external public payable override"; +setify$1(_kwVisibDeploy.split(" ")); +const _kwVisib$1 = "constant external internal payable private public pure view override"; +setify$1(_kwVisib$1.split(" ")); +const _kwTypes$1 = "constructor error event fallback function receive struct"; +setify$1(_kwTypes$1.split(" ")); +const _kwModifiers$1 = "calldata memory storage payable indexed"; +const KwModifiers$1 = setify$1(_kwModifiers$1.split(" ")); +const _kwOther$1 = "tuple returns"; +const _keywords$1 = [_kwTypes$1, _kwModifiers$1, _kwOther$1, _kwVisib$1].join(" "); +const Keywords$1 = setify$1(_keywords$1.split(" ")); +const SimpleTokens$1 = { + "(": "OPEN_PAREN", + ")": "CLOSE_PAREN", + "[": "OPEN_BRACKET", + "]": "CLOSE_BRACKET", + ",": "COMMA", + "@": "AT" +}; +const regexWhitespacePrefix$1 = new RegExp("^(\\s*)"); +const regexNumberPrefix$1 = new RegExp("^([0-9]+)"); +const regexIdPrefix$1 = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); +const regexId$1 = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); +const regexType$1 = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); +let TokenString$1 = (_p = class { + constructor(tokens) { + __privateAdd(this, _subTokenString); + __privateAdd(this, _offset2, void 0); + __privateAdd(this, _tokens, void 0); + __privateSet(this, _offset2, 0); + __privateSet(this, _tokens, tokens.slice()); + } + get offset() { + return __privateGet(this, _offset2); + } + get length() { + return __privateGet(this, _tokens).length - __privateGet(this, _offset2); + } + clone() { + return new _p(__privateGet(this, _tokens)); + } + reset() { + __privateSet(this, _offset2, 0); + } + // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens + popKeyword(allowed) { + const top = this.peek(); + if (top.type !== "KEYWORD" || !allowed.has(top.text)) { + throw new Error(`expected keyword ${top.text}`); + } + return this.pop().text; + } + // Pops and returns the value of the next token if it is `type`; throws if out of tokens + popType(type2) { + if (this.peek().type !== type2) { + const top = this.peek(); + throw new Error(`expected ${type2}; got ${top.type} ${JSON.stringify(top.text)}`); + } + return this.pop().text; + } + // Pops and returns a "(" TOKENS ")" + popParen() { + const top = this.peek(); + if (top.type !== "OPEN_PAREN") { + throw new Error("bad start"); + } + const result = __privateMethod(this, _subTokenString, subTokenString_fn).call(this, __privateGet(this, _offset2) + 1, top.match + 1); + __privateSet(this, _offset2, top.match + 1); + return result; + } + // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" + popParams() { + const top = this.peek(); + if (top.type !== "OPEN_PAREN") { + throw new Error("bad start"); + } + const result = []; + while (__privateGet(this, _offset2) < top.match - 1) { + const link = this.peek().linkNext; + result.push(__privateMethod(this, _subTokenString, subTokenString_fn).call(this, __privateGet(this, _offset2) + 1, link)); + __privateSet(this, _offset2, link); + } + __privateSet(this, _offset2, top.match + 1); + return result; + } + // Returns the top Token, throwing if out of tokens + peek() { + if (__privateGet(this, _offset2) >= __privateGet(this, _tokens).length) { + throw new Error("out-of-bounds"); + } + return __privateGet(this, _tokens)[__privateGet(this, _offset2)]; + } + // Returns the next value, if it is a keyword in `allowed` + peekKeyword(allowed) { + const top = this.peekType("KEYWORD"); + return top != null && allowed.has(top) ? top : null; + } + // Returns the value of the next token if it is `type` + peekType(type2) { + if (this.length === 0) { + return null; + } + const top = this.peek(); + return top.type === type2 ? top.text : null; + } + // Returns the next token; throws if out of tokens + pop() { + const result = this.peek(); + __privateWrapper(this, _offset2)._++; + return result; + } + toString() { + const tokens = []; + for (let i2 = __privateGet(this, _offset2); i2 < __privateGet(this, _tokens).length; i2++) { + const token2 = __privateGet(this, _tokens)[i2]; + tokens.push(`${token2.type}:${token2.text}`); + } + return ``; + } +}, _offset2 = new WeakMap(), _tokens = new WeakMap(), _subTokenString = new WeakSet(), subTokenString_fn = function(from2 = 0, to2 = 0) { + return new _p(__privateGet(this, _tokens).slice(from2, to2).map((t2) => { + return Object.freeze(Object.assign({}, t2, { + match: t2.match - from2, + linkBack: t2.linkBack - from2, + linkNext: t2.linkNext - from2 + })); + })); +}, _p); +function lex$1(text) { + const tokens = []; + const throwError2 = (message2) => { + const token2 = offset2 < text.length ? JSON.stringify(text[offset2]) : "$EOI"; + throw new Error(`invalid token ${token2} at ${offset2}: ${message2}`); + }; + let brackets = []; + let commas = []; + let offset2 = 0; + while (offset2 < text.length) { + let cur = text.substring(offset2); + let match = cur.match(regexWhitespacePrefix$1); + if (match) { + offset2 += match[1].length; + cur = text.substring(offset2); + } + const token2 = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset: offset2, value: -1 }; + tokens.push(token2); + let type2 = SimpleTokens$1[cur[0]] || ""; + if (type2) { + token2.type = type2; + token2.text = cur[0]; + offset2++; + if (type2 === "OPEN_PAREN") { + brackets.push(tokens.length - 1); + commas.push(tokens.length - 1); + } else if (type2 == "CLOSE_PAREN") { + if (brackets.length === 0) { + throwError2("no matching open bracket"); + } + token2.match = brackets.pop(); + tokens[token2.match].match = tokens.length - 1; + token2.depth--; + token2.linkBack = commas.pop(); + tokens[token2.linkBack].linkNext = tokens.length - 1; + } else if (type2 === "COMMA") { + token2.linkBack = commas.pop(); + tokens[token2.linkBack].linkNext = tokens.length - 1; + commas.push(tokens.length - 1); + } else if (type2 === "OPEN_BRACKET") { + token2.type = "BRACKET"; + } else if (type2 === "CLOSE_BRACKET") { + let suffix = tokens.pop().text; + if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { + const value = tokens.pop().text; + suffix = value + suffix; + tokens[tokens.length - 1].value = getNumber(value); + } + if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { + throw new Error("missing opening bracket"); + } + tokens[tokens.length - 1].text += suffix; + } + continue; + } + match = cur.match(regexIdPrefix$1); + if (match) { + token2.text = match[1]; + offset2 += token2.text.length; + if (Keywords$1.has(token2.text)) { + token2.type = "KEYWORD"; + continue; + } + if (token2.text.match(regexType$1)) { + token2.type = "TYPE"; + continue; + } + token2.type = "ID"; + continue; + } + match = cur.match(regexNumberPrefix$1); + if (match) { + token2.text = match[1]; + token2.type = "NUMBER"; + offset2 += token2.text.length; + continue; + } + throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset2}`); + } + return new TokenString$1(tokens.map((t2) => Object.freeze(t2))); +} +function consumeKeywords$1(tokens, allowed) { + const keywords2 = /* @__PURE__ */ new Set(); + while (true) { + const keyword = tokens.peekType("KEYWORD"); + if (keyword == null || allowed && !allowed.has(keyword)) { + break; + } + tokens.pop(); + if (keywords2.has(keyword)) { + throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); + } + keywords2.add(keyword); + } + return Object.freeze(keywords2); +} +const regexArrayType$1 = new RegExp(/^(.*)\[([0-9]*)\]$/); +function verifyBasicType$1(type2) { + const match = type2.match(regexType$1); + assertArgument(match, "invalid type", "type", type2); + if (type2 === "uint") { + return "uint256"; + } + if (type2 === "int") { + return "int256"; + } + if (match[2]) { + const length = parseInt(match[2]); + assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type2); + } else if (match[3]) { + const size2 = parseInt(match[3]); + assertArgument(size2 !== 0 && size2 <= 256 && size2 % 8 === 0, "invalid numeric width", "type", type2); + } + return type2; +} +const _guard$3 = {}; +const internal$1 = Symbol.for("_ethers_internal"); +const ParamTypeInternal$1 = "_ParamTypeInternal"; +let ParamType$1 = (_q = class { + /** + * @private + */ + constructor(guard2, name2, type2, baseType, indexed, components, arrayLength, arrayChildren) { + __privateAdd(this, _walkAsync); + /** + * The local name of the parameter (or ``""`` if unbound) + */ + __publicField(this, "name"); + /** + * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, + * ``"uint256[3][]"``) + */ + __publicField(this, "type"); + /** + * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) + */ + __publicField(this, "baseType"); + /** + * True if the parameters is indexed. + * + * For non-indexable types this is ``null``. + */ + __publicField(this, "indexed"); + /** + * The components for the tuple. + * + * For non-tuple types this is ``null``. + */ + __publicField(this, "components"); + /** + * The array length, or ``-1`` for dynamic-lengthed arrays. + * + * For non-array types this is ``null``. + */ + __publicField(this, "arrayLength"); + /** + * The type of each child in the array. + * + * For non-array types this is ``null``. + */ + __publicField(this, "arrayChildren"); + assertPrivate(guard2, _guard$3, "ParamType"); + Object.defineProperty(this, internal$1, { value: ParamTypeInternal$1 }); + if (components) { + components = Object.freeze(components.slice()); + } + if (baseType === "array") { + if (arrayLength == null || arrayChildren == null) { + throw new Error(""); + } + } else if (arrayLength != null || arrayChildren != null) { + throw new Error(""); + } + if (baseType === "tuple") { + if (components == null) { + throw new Error(""); + } + } else if (components != null) { + throw new Error(""); + } + defineProperties(this, { + name: name2, + type: type2, + baseType, + indexed, + components, + arrayLength, + arrayChildren + }); + } + /** + * Return a string representation of this type. + * + * For example, + * + * ``sighash" => "(uint256,address)"`` + * + * ``"minimal" => "tuple(uint256,address) indexed"`` + * + * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` + */ + format(format2) { + if (format2 == null) { + format2 = "sighash"; + } + if (format2 === "json") { + const name2 = this.name || ""; + if (this.isArray()) { + const result3 = JSON.parse(this.arrayChildren.format("json")); + result3.name = name2; + result3.type += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; + return JSON.stringify(result3); + } + const result2 = { + type: this.baseType === "tuple" ? "tuple" : this.type, + name: name2 + }; + if (typeof this.indexed === "boolean") { + result2.indexed = this.indexed; + } + if (this.isTuple()) { + result2.components = this.components.map((c2) => JSON.parse(c2.format(format2))); + } + return JSON.stringify(result2); + } + let result = ""; + if (this.isArray()) { + result += this.arrayChildren.format(format2); + result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; + } else { + if (this.isTuple()) { + result += "(" + this.components.map((comp) => comp.format(format2)).join(format2 === "full" ? ", " : ",") + ")"; + } else { + result += this.type; + } + } + if (format2 !== "sighash") { + if (this.indexed === true) { + result += " indexed"; + } + if (format2 === "full" && this.name) { + result += " " + this.name; + } + } + return result; + } + /** + * Returns true if %%this%% is an Array type. + * + * This provides a type gaurd ensuring that [[arrayChildren]] + * and [[arrayLength]] are non-null. + */ + isArray() { + return this.baseType === "array"; + } + /** + * Returns true if %%this%% is a Tuple type. + * + * This provides a type gaurd ensuring that [[components]] + * is non-null. + */ + isTuple() { + return this.baseType === "tuple"; + } + /** + * Returns true if %%this%% is an Indexable type. + * + * This provides a type gaurd ensuring that [[indexed]] + * is non-null. + */ + isIndexable() { + return this.indexed != null; + } + /** + * Walks the **ParamType** with %%value%%, calling %%process%% + * on each type, destructing the %%value%% recursively. + */ + walk(value, process2) { + if (this.isArray()) { + if (!Array.isArray(value)) { + throw new Error("invalid array value"); + } + if (this.arrayLength !== -1 && value.length !== this.arrayLength) { + throw new Error("array is wrong length"); + } + const _this = this; + return value.map((v6) => _this.arrayChildren.walk(v6, process2)); + } + if (this.isTuple()) { + if (!Array.isArray(value)) { + throw new Error("invalid tuple value"); + } + if (value.length !== this.components.length) { + throw new Error("array is wrong length"); + } + const _this = this; + return value.map((v6, i2) => _this.components[i2].walk(v6, process2)); + } + return process2(this.type, value); + } + /** + * Walks the **ParamType** with %%value%%, asynchronously calling + * %%process%% on each type, destructing the %%value%% recursively. + * + * This can be used to resolve ENS names by walking and resolving each + * ``"address"`` type. + */ + async walkAsync(value, process2) { + const promises = []; + const result = [value]; + __privateMethod(this, _walkAsync, walkAsync_fn).call(this, promises, value, process2, (value2) => { + result[0] = value2; + }); + if (promises.length) { + await Promise.all(promises); + } + return result[0]; + } + /** + * Creates a new **ParamType** for %%obj%%. + * + * If %%allowIndexed%% then the ``indexed`` keyword is permitted, + * otherwise the ``indexed`` keyword will throw an error. + */ + static from(obj, allowIndexed) { + if (_q.isParamType(obj)) { + return obj; + } + if (typeof obj === "string") { + try { + return _q.from(lex$1(obj), allowIndexed); + } catch (error) { + assertArgument(false, "invalid param type", "obj", obj); + } + } else if (obj instanceof TokenString$1) { + let type3 = "", baseType = ""; + let comps = null; + if (consumeKeywords$1(obj, setify$1(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) { + baseType = "tuple"; + comps = obj.popParams().map((t2) => _q.from(t2)); + type3 = `tuple(${comps.map((c2) => c2.format()).join(",")})`; + } else { + type3 = verifyBasicType$1(obj.popType("TYPE")); + baseType = type3; + } + let arrayChildren = null; + let arrayLength = null; + while (obj.length && obj.peekType("BRACKET")) { + const bracket = obj.pop(); + arrayChildren = new _q(_guard$3, "", type3, baseType, null, comps, arrayLength, arrayChildren); + arrayLength = bracket.value; + type3 += bracket.text; + baseType = "array"; + comps = null; + } + let indexed2 = null; + const keywords2 = consumeKeywords$1(obj, KwModifiers$1); + if (keywords2.has("indexed")) { + if (!allowIndexed) { + throw new Error(""); + } + indexed2 = true; + } + const name3 = obj.peekType("ID") ? obj.pop().text : ""; + if (obj.length) { + throw new Error("leftover tokens"); + } + return new _q(_guard$3, name3, type3, baseType, indexed2, comps, arrayLength, arrayChildren); + } + const name2 = obj.name; + assertArgument(!name2 || typeof name2 === "string" && name2.match(regexId$1), "invalid name", "obj.name", name2); + let indexed = obj.indexed; + if (indexed != null) { + assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); + indexed = !!indexed; + } + let type2 = obj.type; + let arrayMatch = type2.match(regexArrayType$1); + if (arrayMatch) { + const arrayLength = parseInt(arrayMatch[2] || "-1"); + const arrayChildren = _q.from({ + type: arrayMatch[1], + components: obj.components + }); + return new _q(_guard$3, name2 || "", type2, "array", indexed, null, arrayLength, arrayChildren); + } + if (type2 === "tuple" || type2.startsWith( + "tuple(" + /* fix: ) */ + ) || type2.startsWith( + "(" + /* fix: ) */ + )) { + const comps = obj.components != null ? obj.components.map((c2) => _q.from(c2)) : null; + const tuple2 = new _q(_guard$3, name2 || "", type2, "tuple", indexed, comps, null, null); + return tuple2; + } + type2 = verifyBasicType$1(obj.type); + return new _q(_guard$3, name2 || "", type2, type2, indexed, null, null, null); + } + /** + * Returns true if %%value%% is a **ParamType**. + */ + static isParamType(value) { + return value && value[internal$1] === ParamTypeInternal$1; + } +}, _walkAsync = new WeakSet(), walkAsync_fn = function(promises, value, process2, setValue) { + if (this.isArray()) { + if (!Array.isArray(value)) { + throw new Error("invalid array value"); + } + if (this.arrayLength !== -1 && value.length !== this.arrayLength) { + throw new Error("array is wrong length"); + } + const childType = this.arrayChildren; + const result2 = value.slice(); + result2.forEach((value2, index2) => { + var _a3; + __privateMethod(_a3 = childType, _walkAsync, walkAsync_fn).call(_a3, promises, value2, process2, (value3) => { + result2[index2] = value3; + }); + }); + setValue(result2); + return; + } + if (this.isTuple()) { + const components = this.components; + let result2; + if (Array.isArray(value)) { + result2 = value.slice(); + } else { + if (value == null || typeof value !== "object") { + throw new Error("invalid tuple value"); + } + result2 = components.map((param) => { + if (!param.name) { + throw new Error("cannot use object value with unnamed components"); + } + if (!(param.name in value)) { + throw new Error(`missing value for component ${param.name}`); + } + return value[param.name]; + }); + } + if (result2.length !== this.components.length) { + throw new Error("array is wrong length"); + } + result2.forEach((value2, index2) => { + var _a3; + __privateMethod(_a3 = components[index2], _walkAsync, walkAsync_fn).call(_a3, promises, value2, process2, (value3) => { + result2[index2] = value3; + }); + }); + setValue(result2); + return; + } + const result = process2(this.type, value); + if (result.then) { + promises.push(async function() { + setValue(await result); + }()); + } else { + setValue(result); + } +}, _q); +const PanicReasons$1 = /* @__PURE__ */ new Map(); +PanicReasons$1.set(0, "GENERIC_PANIC"); +PanicReasons$1.set(1, "ASSERT_FALSE"); +PanicReasons$1.set(17, "OVERFLOW"); +PanicReasons$1.set(18, "DIVIDE_BY_ZERO"); +PanicReasons$1.set(33, "ENUM_RANGE_ERROR"); +PanicReasons$1.set(34, "BAD_STORAGE_DATA"); +PanicReasons$1.set(49, "STACK_UNDERFLOW"); +PanicReasons$1.set(50, "ARRAY_RANGE_ERROR"); +PanicReasons$1.set(65, "OUT_OF_MEMORY"); +PanicReasons$1.set(81, "UNINITIALIZED_FUNCTION_CALL"); +const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); +const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); +let defaultCoder = null; +let defaultMaxInflation = 1024; +function getBuiltinCallException(action, tx, data, abiCoder2) { + let message2 = "missing revert data"; + let reason = null; + const invocation = null; + let revert = null; + if (data) { + message2 = "execution reverted"; + const bytes2 = getBytes(data); + data = hexlify(data); + if (bytes2.length === 0) { + message2 += " (no data present; likely require(false) occurred"; + reason = "require(false)"; + } else if (bytes2.length % 32 !== 4) { + message2 += " (could not decode reason; invalid data length)"; + } else if (hexlify(bytes2.slice(0, 4)) === "0x08c379a0") { + try { + reason = abiCoder2.decode(["string"], bytes2.slice(4))[0]; + revert = { + signature: "Error(string)", + name: "Error", + args: [reason] + }; + message2 += `: ${JSON.stringify(reason)}`; + } catch (error) { + message2 += " (could not decode reason; invalid string data)"; + } + } else if (hexlify(bytes2.slice(0, 4)) === "0x4e487b71") { + try { + const code2 = Number(abiCoder2.decode(["uint256"], bytes2.slice(4))[0]); + revert = { + signature: "Panic(uint256)", + name: "Panic", + args: [code2] + }; + reason = `Panic due to ${PanicReasons$1.get(code2) || "UNKNOWN"}(${code2})`; + message2 += `: ${reason}`; + } catch (error) { + message2 += " (could not decode panic code)"; + } + } else { + message2 += " (unknown custom error)"; + } + } + const transaction2 = { + to: tx.to ? getAddress$1(tx.to) : null, + data: tx.data || "0x" + }; + if (tx.from) { + transaction2.from = getAddress$1(tx.from); + } + return makeError(message2, "CALL_EXCEPTION", { + action, + data, + reason, + transaction: transaction2, + invocation, + revert + }); +} +const _AbiCoder = class _AbiCoder { + constructor() { + __privateAdd(this, _getCoder); + } + /** + * Get the default values for the given %%types%%. + * + * For example, a ``uint`` is by default ``0`` and ``bool`` + * is by default ``false``. + */ + getDefaultValue(types2) { + const coders = types2.map((type2) => __privateMethod(this, _getCoder, getCoder_fn).call(this, ParamType$1.from(type2))); + const coder = new TupleCoder(coders, "_"); + return coder.defaultValue(); + } + /** + * Encode the %%values%% as the %%types%% into ABI data. + * + * @returns DataHexstring + */ + encode(types2, values) { + assertArgumentCount(values.length, types2.length, "types/values length mismatch"); + const coders = types2.map((type2) => __privateMethod(this, _getCoder, getCoder_fn).call(this, ParamType$1.from(type2))); + const coder = new TupleCoder(coders, "_"); + const writer = new Writer(); + coder.encode(writer, values); + return writer.data; + } + /** + * Decode the ABI %%data%% as the %%types%% into values. + * + * If %%loose%% decoding is enabled, then strict padding is + * not enforced. Some older versions of Solidity incorrectly + * padded event data emitted from ``external`` functions. + */ + decode(types2, data, loose) { + const coders = types2.map((type2) => __privateMethod(this, _getCoder, getCoder_fn).call(this, ParamType$1.from(type2))); + const coder = new TupleCoder(coders, "_"); + return coder.decode(new Reader(data, loose, defaultMaxInflation)); + } + static _setDefaultMaxInflation(value) { + assertArgument(typeof value === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); + defaultMaxInflation = value; + } + /** + * Returns the shared singleton instance of a default [[AbiCoder]]. + * + * On the first call, the instance is created internally. + */ + static defaultAbiCoder() { + if (defaultCoder == null) { + defaultCoder = new _AbiCoder(); + } + return defaultCoder; + } + /** + * Returns an ethers-compatible [[CallExceptionError]] Error for the given + * result %%data%% for the [[CallExceptionAction]] %%action%% against + * the Transaction %%tx%%. + */ + static getBuiltinCallException(action, tx, data) { + return getBuiltinCallException(action, tx, data, _AbiCoder.defaultAbiCoder()); + } +}; +_getCoder = new WeakSet(); +getCoder_fn = function(param) { + if (param.isArray()) { + return new ArrayCoder(__privateMethod(this, _getCoder, getCoder_fn).call(this, param.arrayChildren), param.arrayLength, param.name); + } + if (param.isTuple()) { + return new TupleCoder(param.components.map((c2) => __privateMethod(this, _getCoder, getCoder_fn).call(this, c2)), param.name); + } + switch (param.baseType) { + case "address": + return new AddressCoder(param.name); + case "bool": + return new BooleanCoder(param.name); + case "string": + return new StringCoder(param.name); + case "bytes": + return new BytesCoder(param.name); + case "": + return new NullCoder(param.name); + } + let match = param.type.match(paramTypeNumber); + if (match) { + let size2 = parseInt(match[2] || "256"); + assertArgument(size2 !== 0 && size2 <= 256 && size2 % 8 === 0, "invalid " + match[1] + " bit length", "param", param); + return new NumberCoder(size2 / 8, match[1] === "int", param.name); + } + match = param.type.match(paramTypeBytes); + if (match) { + let size2 = parseInt(match[1]); + assertArgument(size2 !== 0 && size2 <= 32, "invalid bytes length", "param", param); + return new FixedBytesCoder(size2, param.name); + } + assertArgument(false, "invalid type", "type", param.type); +}; +let AbiCoder = _AbiCoder; +BigInt(0); +function copyRequest(req) { + const result = {}; + if (req.to) { + result.to = req.to; + } + if (req.from) { + result.from = req.from; + } + if (req.data) { + result.data = hexlify(req.data); + } + const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); + for (const key2 of bigIntKeys) { + if (!(key2 in req) || req[key2] == null) { + continue; + } + result[key2] = getBigInt(req[key2], `request.${key2}`); + } + const numberKeys = "type,nonce".split(/,/); + for (const key2 of numberKeys) { + if (!(key2 in req) || req[key2] == null) { + continue; + } + result[key2] = getNumber(req[key2], `request.${key2}`); + } + if (req.accessList) { + result.accessList = accessListify(req.accessList); + } + if ("blockTag" in req) { + result.blockTag = req.blockTag; + } + if ("enableCcipRead" in req) { + result.enableCcipRead = !!req.enableCcipRead; + } + if ("customData" in req) { + result.customData = req.customData; + } + if ("blobVersionedHashes" in req && req.blobVersionedHashes) { + result.blobVersionedHashes = req.blobVersionedHashes.slice(); + } + if ("kzg" in req) { + result.kzg = req.kzg; + } + if ("blobs" in req && req.blobs) { + result.blobs = req.blobs.map((b2) => { + if (isBytesLike(b2)) { + return hexlify(b2); + } + return Object.assign({}, b2); + }); + } + return result; +} +function checkProvider(signer, operation) { + if (signer.provider) { + return signer.provider; + } + assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); +} +async function populate(signer, tx) { + let pop = copyRequest(tx); + if (pop.to != null) { + pop.to = resolveAddress(pop.to, signer); + } + if (pop.from != null) { + const from2 = pop.from; + pop.from = Promise.all([ + signer.getAddress(), + resolveAddress(from2, signer) + ]).then(([address2, from3]) => { + assertArgument(address2.toLowerCase() === from3.toLowerCase(), "transaction from mismatch", "tx.from", from3); + return address2; + }); + } else { + pop.from = signer.getAddress(); + } + return await resolveProperties(pop); +} +class AbstractSigner { + /** + * Creates a new Signer connected to %%provider%%. + */ + constructor(provider) { + /** + * The provider this signer is connected to. + */ + __publicField(this, "provider"); + defineProperties(this, { provider: provider || null }); + } + async getNonce(blockTag) { + return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); + } + async populateCall(tx) { + const pop = await populate(this, tx); + return pop; + } + async populateTransaction(tx) { + const provider = checkProvider(this, "populateTransaction"); + const pop = await populate(this, tx); + if (pop.nonce == null) { + pop.nonce = await this.getNonce("pending"); + } + if (pop.gasLimit == null) { + pop.gasLimit = await this.estimateGas(pop); + } + const network = await this.provider.getNetwork(); + if (pop.chainId != null) { + const chainId = getBigInt(pop.chainId); + assertArgument(chainId === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId); + } else { + pop.chainId = network.chainId; + } + const hasEip1559 = pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null; + if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) { + assertArgument(false, "eip-1559 transaction do not support gasPrice", "tx", tx); + } else if ((pop.type === 0 || pop.type === 1) && hasEip1559) { + assertArgument(false, "pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "tx", tx); + } + if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) { + pop.type = 2; + } else if (pop.type === 0 || pop.type === 1) { + const feeData = await provider.getFeeData(); + assert(feeData.gasPrice != null, "network does not support gasPrice", "UNSUPPORTED_OPERATION", { + operation: "getGasPrice" + }); + if (pop.gasPrice == null) { + pop.gasPrice = feeData.gasPrice; + } + } else { + const feeData = await provider.getFeeData(); + if (pop.type == null) { + if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) { + pop.type = 2; + if (pop.gasPrice != null) { + const gasPrice = pop.gasPrice; + delete pop.gasPrice; + pop.maxFeePerGas = gasPrice; + pop.maxPriorityFeePerGas = gasPrice; + } else { + if (pop.maxFeePerGas == null) { + pop.maxFeePerGas = feeData.maxFeePerGas; + } + if (pop.maxPriorityFeePerGas == null) { + pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; + } + } + } else if (feeData.gasPrice != null) { + assert(!hasEip1559, "network does not support EIP-1559", "UNSUPPORTED_OPERATION", { + operation: "populateTransaction" + }); + if (pop.gasPrice == null) { + pop.gasPrice = feeData.gasPrice; + } + pop.type = 0; + } else { + assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { + operation: "signer.getFeeData" + }); + } + } else if (pop.type === 2 || pop.type === 3) { + if (pop.maxFeePerGas == null) { + pop.maxFeePerGas = feeData.maxFeePerGas; + } + if (pop.maxPriorityFeePerGas == null) { + pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; + } + } + } + return await resolveProperties(pop); + } + async estimateGas(tx) { + return checkProvider(this, "estimateGas").estimateGas(await this.populateCall(tx)); + } + async call(tx) { + return checkProvider(this, "call").call(await this.populateCall(tx)); + } + async resolveName(name2) { + const provider = checkProvider(this, "resolveName"); + return await provider.resolveName(name2); + } + async sendTransaction(tx) { + const provider = checkProvider(this, "sendTransaction"); + const pop = await this.populateTransaction(tx); + delete pop.from; + const txObj = Transaction$1.from(pop); + return await provider.broadcastTransaction(await this.signTransaction(txObj)); + } +} +const _VoidSigner = class _VoidSigner extends AbstractSigner { + /** + * Creates a new **VoidSigner** with %%address%% attached to + * %%provider%%. + */ + constructor(address2, provider) { + super(provider); + __privateAdd(this, _throwUnsupported); + /** + * The signer address. + */ + __publicField(this, "address"); + defineProperties(this, { address: address2 }); + } + async getAddress() { + return this.address; + } + connect(provider) { + return new _VoidSigner(this.address, provider); + } + async signTransaction(tx) { + __privateMethod(this, _throwUnsupported, throwUnsupported_fn).call(this, "transactions", "signTransaction"); + } + async signMessage(message2) { + __privateMethod(this, _throwUnsupported, throwUnsupported_fn).call(this, "messages", "signMessage"); + } + async signTypedData(domain, types2, value) { + __privateMethod(this, _throwUnsupported, throwUnsupported_fn).call(this, "typed-data", "signTypedData"); + } +}; +_throwUnsupported = new WeakSet(); +throwUnsupported_fn = function(suffix, operation) { + assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { operation }); +}; +let VoidSigner = _VoidSigner; +const _BaseWallet = class _BaseWallet extends AbstractSigner { + /** + * Creates a new BaseWallet for %%privateKey%%, optionally + * connected to %%provider%%. + * + * If %%provider%% is not specified, only offline methods can + * be used. + */ + constructor(privateKey, provider) { + super(provider); + /** + * The wallet address. + */ + __publicField(this, "address"); + __privateAdd(this, _signingKey, void 0); + assertArgument(privateKey && typeof privateKey.sign === "function", "invalid private key", "privateKey", "[ REDACTED ]"); + __privateSet(this, _signingKey, privateKey); + const address2 = computeAddress$1(this.signingKey.publicKey); + defineProperties(this, { address: address2 }); + } + // Store private values behind getters to reduce visibility + // in console.log + /** + * The [[SigningKey]] used for signing payloads. + */ + get signingKey() { + return __privateGet(this, _signingKey); + } + /** + * The private key for this wallet. + */ + get privateKey() { + return this.signingKey.privateKey; + } + async getAddress() { + return this.address; + } + connect(provider) { + return new _BaseWallet(__privateGet(this, _signingKey), provider); + } + async signTransaction(tx) { + tx = copyRequest(tx); + const { to: to2, from: from2 } = await resolveProperties({ + to: tx.to ? resolveAddress(tx.to, this.provider) : void 0, + from: tx.from ? resolveAddress(tx.from, this.provider) : void 0 + }); + if (to2 != null) { + tx.to = to2; + } + if (from2 != null) { + tx.from = from2; + } + if (tx.from != null) { + assertArgument(getAddress$1(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); + delete tx.from; + } + const btx = Transaction$1.from(tx); + btx.signature = this.signingKey.sign(btx.unsignedHash); + return btx.serialized; + } + async signMessage(message2) { + return this.signMessageSync(message2); + } + // @TODO: Add a secialized signTx and signTyped sync that enforces + // all parameters are known? + /** + * Returns the signature for %%message%% signed with this wallet. + */ + signMessageSync(message2) { + return this.signingKey.sign(hashMessage$1(message2)).serialized; + } + async signTypedData(domain, types2, value) { + const populated = await TypedDataEncoder$1.resolveNames(domain, types2, value, async (name2) => { + assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { + operation: "resolveName", + info: { name: name2 } + }); + const address2 = await this.provider.resolveName(name2); + assert(address2 != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { + value: name2 + }); + return address2; + }); + return this.signingKey.sign(TypedDataEncoder$1.hash(populated.domain, types2, populated.value)).serialized; + } +}; +_signingKey = new WeakMap(); +let BaseWallet = _BaseWallet; +const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; +const Word = /^[a-z]*$/i; +function unfold(words2, sep) { + let initial = 97; + return words2.reduce((accum, word) => { + if (word === sep) { + initial++; + } else if (word.match(Word)) { + accum.push(String.fromCharCode(initial) + word); + } else { + initial = 97; + accum.push(word); + } + return accum; + }, []); +} +function decode2(data, subs) { + for (let i2 = subsChrs.length - 1; i2 >= 0; i2--) { + data = data.split(subsChrs[i2]).join(subs.substring(2 * i2, 2 * i2 + 2)); + } + const clumps = []; + const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all2, item, semi, word) => { + if (semi) { + for (let i2 = parseInt(semi); i2 >= 0; i2--) { + clumps.push(";"); + } + } else { + clumps.push(item.toLowerCase()); + } + return ""; + }); + if (leftover) { + throw new Error(`leftovers: ${JSON.stringify(leftover)}`); + } + return unfold(unfold(clumps, ";"), ":"); +} +function decodeOwl(data) { + assertArgument(data[0] === "0", "unsupported auwl data", "data", data); + return decode2(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); +} +class Wordlist { + /** + * Creates a new Wordlist instance. + * + * Sub-classes MUST call this if they provide their own constructor, + * passing in the locale string of the language. + * + * Generally there is no need to create instances of a Wordlist, + * since each language-specific Wordlist creates an instance and + * there is no state kept internally, so they are safe to share. + */ + constructor(locale) { + __publicField(this, "locale"); + defineProperties(this, { locale }); + } + /** + * Sub-classes may override this to provide a language-specific + * method for spliting %%phrase%% into individual words. + * + * By default, %%phrase%% is split using any sequences of + * white-space as defined by regular expressions (i.e. ``/\s+/``). + */ + split(phrase) { + return phrase.toLowerCase().split(/\s+/g); + } + /** + * Sub-classes may override this to provider a language-specific + * method for joining %%words%% into a phrase. + * + * By default, %%words%% are joined by a single space. + */ + join(words2) { + return words2.join(" "); + } +} +class WordlistOwl extends Wordlist { + /** + * Creates a new Wordlist for %%locale%% using the OWL %%data%% + * and validated against the %%checksum%%. + */ + constructor(locale, data, checksum2) { + super(locale); + __privateAdd(this, _loadWords); + __privateAdd(this, _data4, void 0); + __privateAdd(this, _checksum, void 0); + __privateAdd(this, _words, void 0); + __privateSet(this, _data4, data); + __privateSet(this, _checksum, checksum2); + __privateSet(this, _words, null); + } + /** + * The OWL-encoded data. + */ + get _data() { + return __privateGet(this, _data4); + } + /** + * Decode all the words for the wordlist. + */ + _decodeWords() { + return decodeOwl(__privateGet(this, _data4)); + } + getWord(index2) { + const words2 = __privateMethod(this, _loadWords, loadWords_fn).call(this); + assertArgument(index2 >= 0 && index2 < words2.length, `invalid word index: ${index2}`, "index", index2); + return words2[index2]; + } + getWordIndex(word) { + return __privateMethod(this, _loadWords, loadWords_fn).call(this).indexOf(word); + } +} +_data4 = new WeakMap(); +_checksum = new WeakMap(); +_words = new WeakMap(); +_loadWords = new WeakSet(); +loadWords_fn = function() { + if (__privateGet(this, _words) == null) { + const words2 = this._decodeWords(); + const checksum2 = id(words2.join("\n") + "\n"); + if (checksum2 !== __privateGet(this, _checksum)) { + throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`); + } + __privateSet(this, _words, words2); + } + return __privateGet(this, _words); +}; +const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)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=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; +const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; +let wordlist = null; +class LangEn extends WordlistOwl { + /** + * Creates a new instance of the English language Wordlist. + * + * This should be unnecessary most of the time as the exported + * [[langEn]] should suffice. + * + * @_ignore: + */ + constructor() { + super("en", words, checksum); + } + /** + * Returns a singleton instance of a ``LangEn``, creating it + * if this is the first time being called. + */ + static wordlist() { + if (wordlist == null) { + wordlist = new LangEn(); + } + return wordlist; + } +} +function getUpperMask(bits) { + return (1 << bits) - 1 << 8 - bits & 255; +} +function getLowerMask(bits) { + return (1 << bits) - 1 & 255; +} +function mnemonicToEntropy(mnemonic, wordlist2) { + assertNormalize("NFKD"); + if (wordlist2 == null) { + wordlist2 = LangEn.wordlist(); + } + const words2 = wordlist2.split(mnemonic); + assertArgument(words2.length % 3 === 0 && words2.length >= 12 && words2.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); + const entropy = new Uint8Array(Math.ceil(11 * words2.length / 8)); + let offset2 = 0; + for (let i2 = 0; i2 < words2.length; i2++) { + let index2 = wordlist2.getWordIndex(words2[i2].normalize("NFKD")); + assertArgument(index2 >= 0, `invalid mnemonic word at index ${i2}`, "mnemonic", "[ REDACTED ]"); + for (let bit = 0; bit < 11; bit++) { + if (index2 & 1 << 10 - bit) { + entropy[offset2 >> 3] |= 1 << 7 - offset2 % 8; + } + offset2++; + } + } + const entropyBits = 32 * words2.length / 3; + const checksumBits = words2.length / 3; + const checksumMask = getUpperMask(checksumBits); + const checksum2 = getBytes(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; + assertArgument(checksum2 === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); + return hexlify(entropy.slice(0, entropyBits / 8)); +} +function entropyToMnemonic(entropy, wordlist2) { + assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); + if (wordlist2 == null) { + wordlist2 = LangEn.wordlist(); + } + const indices = [0]; + let remainingBits = 11; + for (let i2 = 0; i2 < entropy.length; i2++) { + if (remainingBits > 8) { + indices[indices.length - 1] <<= 8; + indices[indices.length - 1] |= entropy[i2]; + remainingBits -= 8; + } else { + indices[indices.length - 1] <<= remainingBits; + indices[indices.length - 1] |= entropy[i2] >> 8 - remainingBits; + indices.push(entropy[i2] & getLowerMask(8 - remainingBits)); + remainingBits += 3; + } + } + const checksumBits = entropy.length / 4; + const checksum2 = parseInt(sha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits); + indices[indices.length - 1] <<= checksumBits; + indices[indices.length - 1] |= checksum2 >> 8 - checksumBits; + return wordlist2.join(indices.map((index2) => wordlist2.getWord(index2))); +} +const _guard$2 = {}; +class Mnemonic { + /** + * @private + */ + constructor(guard2, entropy, phrase, password, wordlist2) { + /** + * The mnemonic phrase of 12, 15, 18, 21 or 24 words. + * + * Use the [[wordlist]] ``split`` method to get the individual words. + */ + __publicField(this, "phrase"); + /** + * The password used for this mnemonic. If no password is used this + * is the empty string (i.e. ``""``) as per the specification. + */ + __publicField(this, "password"); + /** + * The wordlist for this mnemonic. + */ + __publicField(this, "wordlist"); + /** + * The underlying entropy which the mnemonic encodes. + */ + __publicField(this, "entropy"); + if (password == null) { + password = ""; + } + if (wordlist2 == null) { + wordlist2 = LangEn.wordlist(); + } + assertPrivate(guard2, _guard$2, "Mnemonic"); + defineProperties(this, { phrase, password, wordlist: wordlist2, entropy }); + } + /** + * Returns the seed for the mnemonic. + */ + computeSeed() { + const salt = toUtf8Bytes("mnemonic" + this.password, "NFKD"); + return pbkdf2(toUtf8Bytes(this.phrase, "NFKD"), salt, 2048, 64, "sha512"); + } + /** + * Creates a new Mnemonic for the %%phrase%%. + * + * The default %%password%% is the empty string and the default + * wordlist is the [English wordlists](LangEn). + */ + static fromPhrase(phrase, password, wordlist2) { + const entropy = mnemonicToEntropy(phrase, wordlist2); + phrase = entropyToMnemonic(getBytes(entropy), wordlist2); + return new Mnemonic(_guard$2, entropy, phrase, password, wordlist2); + } + /** + * Create a new **Mnemonic** from the %%entropy%%. + * + * The default %%password%% is the empty string and the default + * wordlist is the [English wordlists](LangEn). + */ + static fromEntropy(_entropy, password, wordlist2) { + const entropy = getBytes(_entropy, "entropy"); + const phrase = entropyToMnemonic(entropy, wordlist2); + return new Mnemonic(_guard$2, hexlify(entropy), phrase, password, wordlist2); + } + /** + * Returns the phrase for %%mnemonic%%. + */ + static entropyToPhrase(_entropy, wordlist2) { + const entropy = getBytes(_entropy, "entropy"); + return entropyToMnemonic(entropy, wordlist2); + } + /** + * Returns the entropy for %%phrase%%. + */ + static phraseToEntropy(phrase, wordlist2) { + return mnemonicToEntropy(phrase, wordlist2); + } + /** + * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. + * + * This checks all the provided words belong to the %%wordlist%%, + * that the length is valid and the checksum is correct. + */ + static isValidMnemonic(phrase, wordlist2) { + try { + mnemonicToEntropy(phrase, wordlist2); + return true; + } catch (error) { + } + return false; + } +} +/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ +var __classPrivateFieldGet$1 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f4) { + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver); +}; +var __classPrivateFieldSet$1 = globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f4) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state.set(receiver, value), value; +}; +var _AES_key, _AES_Kd, _AES_Ke; +const numberOfRounds = { 16: 10, 24: 12, 32: 14 }; +const rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145]; +const S3 = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22]; +const Si = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125]; +const T1 = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986]; +const T2 = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766]; +const T3 = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126]; +const T4 = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436]; +const T5 = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890]; +const T6 = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935]; +const T7 = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600]; +const T8 = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480]; +const U1 = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795]; +const U2 = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855]; +const U3 = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150]; +const U4 = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925]; +function convertToInt32(bytes2) { + const result = []; + for (let i2 = 0; i2 < bytes2.length; i2 += 4) { + result.push(bytes2[i2] << 24 | bytes2[i2 + 1] << 16 | bytes2[i2 + 2] << 8 | bytes2[i2 + 3]); + } + return result; +} +class AES { + get key() { + return __classPrivateFieldGet$1(this, _AES_key, "f").slice(); + } + constructor(key2) { + _AES_key.set(this, void 0); + _AES_Kd.set(this, void 0); + _AES_Ke.set(this, void 0); + if (!(this instanceof AES)) { + throw Error("AES must be instanitated with `new`"); + } + __classPrivateFieldSet$1(this, _AES_key, new Uint8Array(key2), "f"); + const rounds = numberOfRounds[this.key.length]; + if (rounds == null) { + throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)"); + } + __classPrivateFieldSet$1(this, _AES_Ke, [], "f"); + __classPrivateFieldSet$1(this, _AES_Kd, [], "f"); + for (let i2 = 0; i2 <= rounds; i2++) { + __classPrivateFieldGet$1(this, _AES_Ke, "f").push([0, 0, 0, 0]); + __classPrivateFieldGet$1(this, _AES_Kd, "f").push([0, 0, 0, 0]); + } + const roundKeyCount = (rounds + 1) * 4; + const KC = this.key.length / 4; + const tk2 = convertToInt32(this.key); + let index2; + for (let i2 = 0; i2 < KC; i2++) { + index2 = i2 >> 2; + __classPrivateFieldGet$1(this, _AES_Ke, "f")[index2][i2 % 4] = tk2[i2]; + __classPrivateFieldGet$1(this, _AES_Kd, "f")[rounds - index2][i2 % 4] = tk2[i2]; + } + let rconpointer = 0; + let t2 = KC, tt2; + while (t2 < roundKeyCount) { + tt2 = tk2[KC - 1]; + tk2[0] ^= S3[tt2 >> 16 & 255] << 24 ^ S3[tt2 >> 8 & 255] << 16 ^ S3[tt2 & 255] << 8 ^ S3[tt2 >> 24 & 255] ^ rcon[rconpointer] << 24; + rconpointer += 1; + if (KC != 8) { + for (let i3 = 1; i3 < KC; i3++) { + tk2[i3] ^= tk2[i3 - 1]; + } + } else { + for (let i3 = 1; i3 < KC / 2; i3++) { + tk2[i3] ^= tk2[i3 - 1]; + } + tt2 = tk2[KC / 2 - 1]; + tk2[KC / 2] ^= S3[tt2 & 255] ^ S3[tt2 >> 8 & 255] << 8 ^ S3[tt2 >> 16 & 255] << 16 ^ S3[tt2 >> 24 & 255] << 24; + for (let i3 = KC / 2 + 1; i3 < KC; i3++) { + tk2[i3] ^= tk2[i3 - 1]; + } + } + let i2 = 0, r2, c2; + while (i2 < KC && t2 < roundKeyCount) { + r2 = t2 >> 2; + c2 = t2 % 4; + __classPrivateFieldGet$1(this, _AES_Ke, "f")[r2][c2] = tk2[i2]; + __classPrivateFieldGet$1(this, _AES_Kd, "f")[rounds - r2][c2] = tk2[i2++]; + t2++; + } + } + for (let r2 = 1; r2 < rounds; r2++) { + for (let c2 = 0; c2 < 4; c2++) { + tt2 = __classPrivateFieldGet$1(this, _AES_Kd, "f")[r2][c2]; + __classPrivateFieldGet$1(this, _AES_Kd, "f")[r2][c2] = U1[tt2 >> 24 & 255] ^ U2[tt2 >> 16 & 255] ^ U3[tt2 >> 8 & 255] ^ U4[tt2 & 255]; + } + } + } + encrypt(plaintext) { + if (plaintext.length != 16) { + throw new TypeError("invalid plaintext size (must be 16 bytes)"); + } + const rounds = __classPrivateFieldGet$1(this, _AES_Ke, "f").length - 1; + const a3 = [0, 0, 0, 0]; + let t2 = convertToInt32(plaintext); + for (let i2 = 0; i2 < 4; i2++) { + t2[i2] ^= __classPrivateFieldGet$1(this, _AES_Ke, "f")[0][i2]; + } + for (let r2 = 1; r2 < rounds; r2++) { + for (let i2 = 0; i2 < 4; i2++) { + a3[i2] = T1[t2[i2] >> 24 & 255] ^ T2[t2[(i2 + 1) % 4] >> 16 & 255] ^ T3[t2[(i2 + 2) % 4] >> 8 & 255] ^ T4[t2[(i2 + 3) % 4] & 255] ^ __classPrivateFieldGet$1(this, _AES_Ke, "f")[r2][i2]; + } + t2 = a3.slice(); + } + const result = new Uint8Array(16); + let tt2 = 0; + for (let i2 = 0; i2 < 4; i2++) { + tt2 = __classPrivateFieldGet$1(this, _AES_Ke, "f")[rounds][i2]; + result[4 * i2] = (S3[t2[i2] >> 24 & 255] ^ tt2 >> 24) & 255; + result[4 * i2 + 1] = (S3[t2[(i2 + 1) % 4] >> 16 & 255] ^ tt2 >> 16) & 255; + result[4 * i2 + 2] = (S3[t2[(i2 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255; + result[4 * i2 + 3] = (S3[t2[(i2 + 3) % 4] & 255] ^ tt2) & 255; + } + return result; + } + decrypt(ciphertext) { + if (ciphertext.length != 16) { + throw new TypeError("invalid ciphertext size (must be 16 bytes)"); + } + const rounds = __classPrivateFieldGet$1(this, _AES_Kd, "f").length - 1; + const a3 = [0, 0, 0, 0]; + let t2 = convertToInt32(ciphertext); + for (let i2 = 0; i2 < 4; i2++) { + t2[i2] ^= __classPrivateFieldGet$1(this, _AES_Kd, "f")[0][i2]; + } + for (let r2 = 1; r2 < rounds; r2++) { + for (let i2 = 0; i2 < 4; i2++) { + a3[i2] = T5[t2[i2] >> 24 & 255] ^ T6[t2[(i2 + 3) % 4] >> 16 & 255] ^ T7[t2[(i2 + 2) % 4] >> 8 & 255] ^ T8[t2[(i2 + 1) % 4] & 255] ^ __classPrivateFieldGet$1(this, _AES_Kd, "f")[r2][i2]; + } + t2 = a3.slice(); + } + const result = new Uint8Array(16); + let tt2 = 0; + for (let i2 = 0; i2 < 4; i2++) { + tt2 = __classPrivateFieldGet$1(this, _AES_Kd, "f")[rounds][i2]; + result[4 * i2] = (Si[t2[i2] >> 24 & 255] ^ tt2 >> 24) & 255; + result[4 * i2 + 1] = (Si[t2[(i2 + 3) % 4] >> 16 & 255] ^ tt2 >> 16) & 255; + result[4 * i2 + 2] = (Si[t2[(i2 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255; + result[4 * i2 + 3] = (Si[t2[(i2 + 1) % 4] & 255] ^ tt2) & 255; + } + return result; + } +} +_AES_key = /* @__PURE__ */ new WeakMap(), _AES_Kd = /* @__PURE__ */ new WeakMap(), _AES_Ke = /* @__PURE__ */ new WeakMap(); +class ModeOfOperation { + constructor(name2, key2, cls) { + if (cls && !(this instanceof cls)) { + throw new Error(`${name2} must be instantiated with "new"`); + } + Object.defineProperties(this, { + aes: { enumerable: true, value: new AES(key2) }, + name: { enumerable: true, value: name2 } + }); + } +} +var __classPrivateFieldSet = globalThis && globalThis.__classPrivateFieldSet || function(receiver, state, value, kind, f4) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state.set(receiver, value), value; +}; +var __classPrivateFieldGet = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state, kind, f4) { + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver); +}; +var _CTR_remaining, _CTR_remainingIndex, _CTR_counter; +class CTR extends ModeOfOperation { + constructor(key2, initialValue) { + super("CTR", key2, CTR); + _CTR_remaining.set(this, void 0); + _CTR_remainingIndex.set(this, void 0); + _CTR_counter.set(this, void 0); + __classPrivateFieldSet(this, _CTR_counter, new Uint8Array(16), "f"); + __classPrivateFieldGet(this, _CTR_counter, "f").fill(0); + __classPrivateFieldSet(this, _CTR_remaining, __classPrivateFieldGet(this, _CTR_counter, "f"), "f"); + __classPrivateFieldSet(this, _CTR_remainingIndex, 16, "f"); + if (initialValue == null) { + initialValue = 1; + } + if (typeof initialValue === "number") { + this.setCounterValue(initialValue); + } else { + this.setCounterBytes(initialValue); + } + } + get counter() { + return new Uint8Array(__classPrivateFieldGet(this, _CTR_counter, "f")); + } + setCounterValue(value) { + if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) { + throw new TypeError("invalid counter initial integer value"); + } + for (let index2 = 15; index2 >= 0; --index2) { + __classPrivateFieldGet(this, _CTR_counter, "f")[index2] = value % 256; + value = Math.floor(value / 256); + } + } + setCounterBytes(value) { + if (value.length !== 16) { + throw new TypeError("invalid counter initial Uint8Array value length"); + } + __classPrivateFieldGet(this, _CTR_counter, "f").set(value); + } + increment() { + for (let i2 = 15; i2 >= 0; i2--) { + if (__classPrivateFieldGet(this, _CTR_counter, "f")[i2] === 255) { + __classPrivateFieldGet(this, _CTR_counter, "f")[i2] = 0; + } else { + __classPrivateFieldGet(this, _CTR_counter, "f")[i2]++; + break; + } + } + } + encrypt(plaintext) { + var _a3, _b2; + const crypttext = new Uint8Array(plaintext); + for (let i2 = 0; i2 < crypttext.length; i2++) { + if (__classPrivateFieldGet(this, _CTR_remainingIndex, "f") === 16) { + __classPrivateFieldSet(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet(this, _CTR_counter, "f")), "f"); + __classPrivateFieldSet(this, _CTR_remainingIndex, 0, "f"); + this.increment(); + } + crypttext[i2] ^= __classPrivateFieldGet(this, _CTR_remaining, "f")[__classPrivateFieldSet(this, _CTR_remainingIndex, (_b2 = __classPrivateFieldGet(this, _CTR_remainingIndex, "f"), _a3 = _b2++, _b2), "f"), _a3]; + } + return crypttext; + } + decrypt(ciphertext) { + return this.encrypt(ciphertext); + } +} +_CTR_remaining = /* @__PURE__ */ new WeakMap(), _CTR_remainingIndex = /* @__PURE__ */ new WeakMap(), _CTR_counter = /* @__PURE__ */ new WeakMap(); +function zpad$1(value, length) { + value = String(value); + while (value.length < length) { + value = "0" + value; + } + return value; +} +function getPassword(password) { + if (typeof password === "string") { + return toUtf8Bytes(password, "NFKC"); + } + return getBytesCopy(password); +} +const defaultPath$1 = "m/44'/60'/0'/0/0"; +function getEncryptKdfParams(options) { + const salt = options.salt != null ? getBytes(options.salt, "options.salt") : randomBytes(32); + let N2 = 1 << 17, r2 = 8, p3 = 1; + if (options.scrypt) { + if (options.scrypt.N) { + N2 = options.scrypt.N; + } + if (options.scrypt.r) { + r2 = options.scrypt.r; + } + if (options.scrypt.p) { + p3 = options.scrypt.p; + } + } + assertArgument(typeof N2 === "number" && N2 > 0 && Number.isSafeInteger(N2) && (BigInt(N2) & BigInt(N2 - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N2); + assertArgument(typeof r2 === "number" && r2 > 0 && Number.isSafeInteger(r2), "invalid scrypt r parameter", "options.r", r2); + assertArgument(typeof p3 === "number" && p3 > 0 && Number.isSafeInteger(p3), "invalid scrypt p parameter", "options.p", p3); + return { name: "scrypt", dkLen: 32, salt, N: N2, r: r2, p: p3 }; +} +function _encryptKeystore(key2, kdf, account, options) { + const privateKey = getBytes(account.privateKey, "privateKey"); + const iv2 = options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); + assertArgument(iv2.length === 16, "invalid options.iv length", "options.iv", options.iv); + const uuidRandom = options.uuid != null ? getBytes(options.uuid, "options.uuid") : randomBytes(16); + assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); + const derivedKey = key2.slice(0, 16); + const macPrefix = key2.slice(16, 32); + const aesCtr = new CTR(derivedKey, iv2); + const ciphertext = getBytes(aesCtr.encrypt(privateKey)); + const mac = keccak256(concat([macPrefix, ciphertext])); + const data = { + address: account.address.substring(2).toLowerCase(), + id: uuidV4(uuidRandom), + version: 3, + Crypto: { + cipher: "aes-128-ctr", + cipherparams: { + iv: hexlify(iv2).substring(2) + }, + ciphertext: hexlify(ciphertext).substring(2), + kdf: "scrypt", + kdfparams: { + salt: hexlify(kdf.salt).substring(2), + n: kdf.N, + dklen: 32, + p: kdf.p, + r: kdf.r + }, + mac: mac.substring(2) + } + }; + if (account.mnemonic) { + const client2 = options.client != null ? options.client : `ethers/${version$2}`; + const path = account.mnemonic.path || defaultPath$1; + const locale = account.mnemonic.locale || "en"; + const mnemonicKey = key2.slice(32, 64); + const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); + const mnemonicIv = randomBytes(16); + const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); + const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); + const now = /* @__PURE__ */ new Date(); + const timestamp = now.getUTCFullYear() + "-" + zpad$1(now.getUTCMonth() + 1, 2) + "-" + zpad$1(now.getUTCDate(), 2) + "T" + zpad$1(now.getUTCHours(), 2) + "-" + zpad$1(now.getUTCMinutes(), 2) + "-" + zpad$1(now.getUTCSeconds(), 2) + ".0Z"; + const gethFilename = "UTC--" + timestamp + "--" + data.address; + data["x-ethers"] = { + client: client2, + gethFilename, + path, + locale, + mnemonicCounter: hexlify(mnemonicIv).substring(2), + mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), + version: "0.1" + }; + } + return JSON.stringify(data); +} +function encryptKeystoreJsonSync(account, password, options) { + if (options == null) { + options = {}; + } + const passwordBytes = getPassword(password); + const kdf = getEncryptKdfParams(options); + const key2 = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); + return _encryptKeystore(getBytes(key2), kdf, account, options); +} +async function encryptKeystoreJson(account, password, options) { + if (options == null) { + options = {}; + } + const passwordBytes = getPassword(password); + const kdf = getEncryptKdfParams(options); + const key2 = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); + return _encryptKeystore(getBytes(key2), kdf, account, options); +} +const defaultPath = "m/44'/60'/0'/0/0"; +const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); +const HardenedBit = 2147483648; +const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); +const Nibbles = "0123456789abcdef"; +function zpad(value, length) { + let result = ""; + while (value) { + result = Nibbles[value % 16] + result; + value = Math.trunc(value / 16); + } + while (result.length < length * 2) { + result = "0" + result; + } + return "0x" + result; +} +function encodeBase58Check(_value2) { + const value = getBytes(_value2); + const check = dataSlice(sha256(sha256(value)), 0, 4); + const bytes2 = concat([value, check]); + return encodeBase58(bytes2); +} +const _guard$1 = {}; +function ser_I(index2, chainCode, publicKey2, privateKey) { + const data = new Uint8Array(37); + if (index2 & HardenedBit) { + assert(privateKey != null, "cannot derive child of neutered node", "UNSUPPORTED_OPERATION", { + operation: "deriveChild" + }); + data.set(getBytes(privateKey), 1); + } else { + data.set(getBytes(publicKey2)); + } + for (let i2 = 24; i2 >= 0; i2 -= 8) { + data[33 + (i2 >> 3)] = index2 >> 24 - i2 & 255; + } + const I2 = getBytes(computeHmac("sha512", chainCode, data)); + return { IL: I2.slice(0, 32), IR: I2.slice(32) }; +} +function derivePath(node2, path) { + const components = path.split("/"); + assertArgument(components.length > 0, "invalid path", "path", path); + if (components[0] === "m") { + assertArgument(node2.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node2.depth}`, "path", path); + components.shift(); + } + let result = node2; + for (let i2 = 0; i2 < components.length; i2++) { + const component = components[i2]; + if (component.match(/^[0-9]+'$/)) { + const index2 = parseInt(component.substring(0, component.length - 1)); + assertArgument(index2 < HardenedBit, "invalid path index", `path[${i2}]`, component); + result = result.deriveChild(HardenedBit + index2); + } else if (component.match(/^[0-9]+$/)) { + const index2 = parseInt(component); + assertArgument(index2 < HardenedBit, "invalid path index", `path[${i2}]`, component); + result = result.deriveChild(index2); + } else { + assertArgument(false, "invalid path component", `path[${i2}]`, component); + } + } + return result; +} +const _HDNodeWallet = class _HDNodeWallet extends BaseWallet { + /** + * @private + */ + constructor(guard2, signingKey, parentFingerprint, chainCode, path, index2, depth, mnemonic, provider) { + super(signingKey, provider); + __privateAdd(this, _account); + /** + * The compressed public key. + */ + __publicField(this, "publicKey"); + /** + * The fingerprint. + * + * A fingerprint allows quick qay to detect parent and child nodes, + * but developers should be prepared to deal with collisions as it + * is only 4 bytes. + */ + __publicField(this, "fingerprint"); + /** + * The parent fingerprint. + */ + __publicField(this, "parentFingerprint"); + /** + * The mnemonic used to create this HD Node, if available. + * + * Sources such as extended keys do not encode the mnemonic, in + * which case this will be ``null``. + */ + __publicField(this, "mnemonic"); + /** + * The chaincode, which is effectively a public key used + * to derive children. + */ + __publicField(this, "chainCode"); + /** + * The derivation path of this wallet. + * + * Since extended keys do not provide full path details, this + * may be ``null``, if instantiated from a source that does not + * encode it. + */ + __publicField(this, "path"); + /** + * The child index of this wallet. Values over ``2 *\* 31`` indicate + * the node is hardened. + */ + __publicField(this, "index"); + /** + * The depth of this wallet, which is the number of components + * in its path. + */ + __publicField(this, "depth"); + assertPrivate(guard2, _guard$1, "HDNodeWallet"); + defineProperties(this, { publicKey: signingKey.compressedPublicKey }); + const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); + defineProperties(this, { + parentFingerprint, + fingerprint, + chainCode, + path, + index: index2, + depth + }); + defineProperties(this, { mnemonic }); + } + connect(provider) { + return new _HDNodeWallet(_guard$1, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider); + } + /** + * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with + * %%password%%. + * + * If %%progressCallback%% is specified, it will receive periodic + * updates as the encryption process progreses. + */ + async encrypt(password, progressCallback) { + return await encryptKeystoreJson(__privateMethod(this, _account, account_fn).call(this), password, { progressCallback }); + } + /** + * Returns a [JSON Keystore Wallet](json-wallets) encryped with + * %%password%%. + * + * It is preferred to use the [async version](encrypt) instead, + * which allows a [[ProgressCallback]] to keep the user informed. + * + * This method will block the event loop (freezing all UI) until + * it is complete, which may be a non-trivial duration. + */ + encryptSync(password) { + return encryptKeystoreJsonSync(__privateMethod(this, _account, account_fn).call(this), password); + } + /** + * The extended key. + * + * This key will begin with the prefix ``xpriv`` and can be used to + * reconstruct this HD Node to derive its children. + */ + get extendedKey() { + assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); + return encodeBase58Check(concat([ + "0x0488ADE4", + zpad(this.depth, 1), + this.parentFingerprint, + zpad(this.index, 4), + this.chainCode, + concat(["0x00", this.privateKey]) + ])); + } + /** + * Returns true if this wallet has a path, providing a Type Guard + * that the path is non-null. + */ + hasPath() { + return this.path != null; + } + /** + * Returns a neutered HD Node, which removes the private details + * of an HD Node. + * + * A neutered node has no private key, but can be used to derive + * child addresses and other public data about the HD Node. + */ + neuter() { + return new HDNodeVoidWallet(_guard$1, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider); + } + /** + * Return the child for %%index%%. + */ + deriveChild(_index) { + const index2 = getNumber(_index, "index"); + assertArgument(index2 <= 4294967295, "invalid index", "index", index2); + let path = this.path; + if (path) { + path += "/" + (index2 & ~HardenedBit); + if (index2 & HardenedBit) { + path += "'"; + } + } + const { IR, IL: IL2 } = ser_I(index2, this.chainCode, this.publicKey, this.privateKey); + const ki2 = new SigningKey(toBeHex((toBigInt(IL2) + BigInt(this.privateKey)) % N, 32)); + return new _HDNodeWallet(_guard$1, ki2, this.fingerprint, hexlify(IR), path, index2, this.depth + 1, this.mnemonic, this.provider); + } + /** + * Return the HDNode for %%path%% from this node. + */ + derivePath(path) { + return derivePath(this, path); + } + /** + * Creates a new HD Node from %%extendedKey%%. + * + * If the %%extendedKey%% will either have a prefix or ``xpub`` or + * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) + * or full HD Node ([[HDNodeWallet) respectively. + */ + static fromExtendedKey(extendedKey) { + const bytes2 = toBeArray(decodeBase58(extendedKey)); + assertArgument(bytes2.length === 82 || encodeBase58Check(bytes2.slice(0, 78)) === extendedKey, "invalid extended key", "extendedKey", "[ REDACTED ]"); + const depth = bytes2[4]; + const parentFingerprint = hexlify(bytes2.slice(5, 9)); + const index2 = parseInt(hexlify(bytes2.slice(9, 13)).substring(2), 16); + const chainCode = hexlify(bytes2.slice(13, 45)); + const key2 = bytes2.slice(45, 78); + switch (hexlify(bytes2.slice(0, 4))) { + case "0x0488b21e": + case "0x043587cf": { + const publicKey2 = hexlify(key2); + return new HDNodeVoidWallet(_guard$1, computeAddress$1(publicKey2), publicKey2, parentFingerprint, chainCode, null, index2, depth, null); + } + case "0x0488ade4": + case "0x04358394 ": + if (key2[0] !== 0) { + break; + } + return new _HDNodeWallet(_guard$1, new SigningKey(key2.slice(1)), parentFingerprint, chainCode, null, index2, depth, null, null); + } + assertArgument(false, "invalid extended key prefix", "extendedKey", "[ REDACTED ]"); + } + /** + * Creates a new random HDNode. + */ + static createRandom(password, path, wordlist2) { + var _a3; + if (password == null) { + password = ""; + } + if (path == null) { + path = defaultPath; + } + if (wordlist2 == null) { + wordlist2 = LangEn.wordlist(); + } + const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist2); + return __privateMethod(_a3 = _HDNodeWallet, _fromSeed, fromSeed_fn).call(_a3, mnemonic.computeSeed(), mnemonic).derivePath(path); + } + /** + * Create an HD Node from %%mnemonic%%. + */ + static fromMnemonic(mnemonic, path) { + var _a3; + if (!path) { + path = defaultPath; + } + return __privateMethod(_a3 = _HDNodeWallet, _fromSeed, fromSeed_fn).call(_a3, mnemonic.computeSeed(), mnemonic).derivePath(path); + } + /** + * Creates an HD Node from a mnemonic %%phrase%%. + */ + static fromPhrase(phrase, password, path, wordlist2) { + var _a3; + if (password == null) { + password = ""; + } + if (path == null) { + path = defaultPath; + } + if (wordlist2 == null) { + wordlist2 = LangEn.wordlist(); + } + const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist2); + return __privateMethod(_a3 = _HDNodeWallet, _fromSeed, fromSeed_fn).call(_a3, mnemonic.computeSeed(), mnemonic).derivePath(path); + } + /** + * Creates an HD Node from a %%seed%%. + */ + static fromSeed(seed) { + var _a3; + return __privateMethod(_a3 = _HDNodeWallet, _fromSeed, fromSeed_fn).call(_a3, seed, null); + } +}; +_account = new WeakSet(); +account_fn = function() { + const account = { address: this.address, privateKey: this.privateKey }; + const m3 = this.mnemonic; + if (this.path && m3 && m3.wordlist.locale === "en" && m3.password === "") { + account.mnemonic = { + path: this.path, + locale: "en", + entropy: m3.entropy + }; + } + return account; +}; +_fromSeed = new WeakSet(); +fromSeed_fn = function(_seed, mnemonic) { + assertArgument(isBytesLike(_seed), "invalid seed", "seed", "[REDACTED]"); + const seed = getBytes(_seed, "seed"); + assertArgument(seed.length >= 16 && seed.length <= 64, "invalid seed", "seed", "[REDACTED]"); + const I2 = getBytes(computeHmac("sha512", MasterSecret, seed)); + const signingKey = new SigningKey(hexlify(I2.slice(0, 32))); + return new _HDNodeWallet(_guard$1, signingKey, "0x00000000", hexlify(I2.slice(32)), "m", 0, 0, mnemonic, null); +}; +__privateAdd(_HDNodeWallet, _fromSeed); +let HDNodeWallet = _HDNodeWallet; +class HDNodeVoidWallet extends VoidSigner { + /** + * @private + */ + constructor(guard2, address2, publicKey2, parentFingerprint, chainCode, path, index2, depth, provider) { + super(address2, provider); + /** + * The compressed public key. + */ + __publicField(this, "publicKey"); + /** + * The fingerprint. + * + * A fingerprint allows quick qay to detect parent and child nodes, + * but developers should be prepared to deal with collisions as it + * is only 4 bytes. + */ + __publicField(this, "fingerprint"); + /** + * The parent node fingerprint. + */ + __publicField(this, "parentFingerprint"); + /** + * The chaincode, which is effectively a public key used + * to derive children. + */ + __publicField(this, "chainCode"); + /** + * The derivation path of this wallet. + * + * Since extended keys do not provider full path details, this + * may be ``null``, if instantiated from a source that does not + * enocde it. + */ + __publicField(this, "path"); + /** + * The child index of this wallet. Values over ``2 *\* 31`` indicate + * the node is hardened. + */ + __publicField(this, "index"); + /** + * The depth of this wallet, which is the number of components + * in its path. + */ + __publicField(this, "depth"); + assertPrivate(guard2, _guard$1, "HDNodeVoidWallet"); + defineProperties(this, { publicKey: publicKey2 }); + const fingerprint = dataSlice(ripemd160(sha256(publicKey2)), 0, 4); + defineProperties(this, { + publicKey: publicKey2, + fingerprint, + parentFingerprint, + chainCode, + path, + index: index2, + depth + }); + } + connect(provider) { + return new HDNodeVoidWallet(_guard$1, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider); + } + /** + * The extended key. + * + * This key will begin with the prefix ``xpub`` and can be used to + * reconstruct this neutered key to derive its children addresses. + */ + get extendedKey() { + assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); + return encodeBase58Check(concat([ + "0x0488B21E", + zpad(this.depth, 1), + this.parentFingerprint, + zpad(this.index, 4), + this.chainCode, + this.publicKey + ])); + } + /** + * Returns true if this wallet has a path, providing a Type Guard + * that the path is non-null. + */ + hasPath() { + return this.path != null; + } + /** + * Return the child for %%index%%. + */ + deriveChild(_index) { + const index2 = getNumber(_index, "index"); + assertArgument(index2 <= 4294967295, "invalid index", "index", index2); + let path = this.path; + if (path) { + path += "/" + (index2 & ~HardenedBit); + if (index2 & HardenedBit) { + path += "'"; + } + } + const { IR, IL: IL2 } = ser_I(index2, this.chainCode, this.publicKey, null); + const Ki2 = SigningKey.addPoints(IL2, this.publicKey, true); + const address2 = computeAddress$1(Ki2); + return new HDNodeVoidWallet(_guard$1, address2, Ki2, this.fingerprint, hexlify(IR), path, index2, this.depth + 1, this.provider); + } + /** + * Return the signer for %%path%% from this node. + */ + derivePath(path) { + return derivePath(this, path); + } +} +const wordlists = { + en: LangEn.wordlist() +}; +var _a; +function setify(items) { + const result = /* @__PURE__ */ new Set(); + items.forEach((k2) => result.add(k2)); + return Object.freeze(result); +} +const _kwVisib = "constant external internal payable private public pure view"; +const KwVisib = setify(_kwVisib.split(" ")); +const _kwTypes = "constructor error event fallback function receive struct"; +const KwTypes = setify(_kwTypes.split(" ")); +const _kwModifiers = "calldata memory storage payable indexed"; +const KwModifiers = setify(_kwModifiers.split(" ")); +const _kwOther = "tuple returns"; +const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); +const Keywords = setify(_keywords.split(" ")); +const SimpleTokens = { + "(": "OPEN_PAREN", + ")": "CLOSE_PAREN", + "[": "OPEN_BRACKET", + "]": "CLOSE_BRACKET", + ",": "COMMA", + "@": "AT" +}; +const regexWhitespacePrefix = new RegExp("^(\\s*)"); +const regexNumberPrefix = new RegExp("^([0-9]+)"); +const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); +const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); +const regexType = new RegExp("^(trcToken|address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); +class TokenString { + constructor(tokens) { + __privateAdd(this, _subTokenString2); + __privateAdd(this, _offset3, void 0); + __privateAdd(this, _tokens2, void 0); + __privateSet(this, _offset3, 0); + __privateSet(this, _tokens2, tokens.slice()); + } + get offset() { + return __privateGet(this, _offset3); + } + get length() { + return __privateGet(this, _tokens2).length - __privateGet(this, _offset3); + } + clone() { + return new _a(__privateGet(this, _tokens2)); + } + reset() { + __privateSet(this, _offset3, 0); + } + // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens + popKeyword(allowed) { + const top = this.peek(); + if (top.type !== "KEYWORD" || !allowed.has(top.text)) { + throw new Error(`expected keyword ${top.text}`); + } + return this.pop().text; + } + // Pops and returns the value of the next token if it is `type`; throws if out of tokens + popType(type2) { + if (this.peek().type !== type2) { + throw new Error(`expected ${type2}; got ${JSON.stringify(this.peek())}`); + } + return this.pop().text; + } + // Pops and returns a "(" TOKENS ")" + popParen() { + const top = this.peek(); + if (top.type !== "OPEN_PAREN") { + throw new Error("bad start"); + } + const result = __privateMethod(this, _subTokenString2, subTokenString_fn2).call(this, __privateGet(this, _offset3) + 1, top.match + 1); + __privateSet(this, _offset3, top.match + 1); + return result; + } + // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" + popParams() { + const top = this.peek(); + if (top.type !== "OPEN_PAREN") { + throw new Error("bad start"); + } + const result = []; + while (__privateGet(this, _offset3) < top.match - 1) { + const link = this.peek().linkNext; + result.push(__privateMethod(this, _subTokenString2, subTokenString_fn2).call(this, __privateGet(this, _offset3) + 1, link)); + __privateSet(this, _offset3, link); + } + __privateSet(this, _offset3, top.match + 1); + return result; + } + // Returns the top Token, throwing if out of tokens + peek() { + if (__privateGet(this, _offset3) >= __privateGet(this, _tokens2).length) { + throw new Error("out-of-bounds"); + } + return __privateGet(this, _tokens2)[__privateGet(this, _offset3)]; + } + // Returns the next value, if it is a keyword in `allowed` + peekKeyword(allowed) { + const top = this.peekType("KEYWORD"); + return top != null && allowed.has(top) ? top : null; + } + // Returns the value of the next token if it is `type` + peekType(type2) { + if (this.length === 0) { + return null; + } + const top = this.peek(); + return top.type === type2 ? top.text : null; + } + // Returns the next token; throws if out of tokens + pop() { + const result = this.peek(); + __privateWrapper(this, _offset3)._++; + return result; + } + toString() { + const tokens = []; + for (let i2 = __privateGet(this, _offset3); i2 < __privateGet(this, _tokens2).length; i2++) { + const token2 = __privateGet(this, _tokens2)[i2]; + tokens.push(`${token2.type}:${token2.text}`); + } + return ``; + } +} +_offset3 = new WeakMap(); +_tokens2 = new WeakMap(); +_subTokenString2 = new WeakSet(); +subTokenString_fn2 = function(from2 = 0, to2 = 0) { + return new _a(__privateGet(this, _tokens2).slice(from2, to2).map((t2) => { + return Object.freeze(Object.assign({}, t2, { + match: t2.match - from2, + linkBack: t2.linkBack - from2, + linkNext: t2.linkNext - from2 + })); + })); +}; +_a = TokenString; +function lex(text) { + const tokens = []; + const throwError2 = (message2) => { + const token2 = offset2 < text.length ? JSON.stringify(text[offset2]) : "$EOI"; + throw new Error(`invalid token ${token2} at ${offset2}: ${message2}`); + }; + const brackets = []; + const commas = []; + let offset2 = 0; + while (offset2 < text.length) { + let cur = text.substring(offset2); + let match = cur.match(regexWhitespacePrefix); + if (match) { + offset2 += match[1].length; + cur = text.substring(offset2); + } + const token2 = { + depth: brackets.length, + linkBack: -1, + linkNext: -1, + match: -1, + type: "", + text: "", + offset: offset2, + value: -1 + }; + tokens.push(token2); + const type2 = SimpleTokens[cur[0]] || ""; + if (type2) { + token2.type = type2; + token2.text = cur[0]; + offset2++; + if (type2 === "OPEN_PAREN") { + brackets.push(tokens.length - 1); + commas.push(tokens.length - 1); + } else if (type2 == "CLOSE_PAREN") { + if (brackets.length === 0) { + throwError2("no matching open bracket"); + } + token2.match = brackets.pop(); + tokens[token2.match].match = tokens.length - 1; + token2.depth--; + token2.linkBack = commas.pop(); + tokens[token2.linkBack].linkNext = tokens.length - 1; + } else if (type2 === "COMMA") { + token2.linkBack = commas.pop(); + tokens[token2.linkBack].linkNext = tokens.length - 1; + commas.push(tokens.length - 1); + } else if (type2 === "OPEN_BRACKET") { + token2.type = "BRACKET"; + } else if (type2 === "CLOSE_BRACKET") { + let suffix = tokens.pop().text; + if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { + const value = tokens.pop().text; + suffix = value + suffix; + tokens[tokens.length - 1].value = getNumber(value); + } + if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { + throw new Error("missing opening bracket"); + } + tokens[tokens.length - 1].text += suffix; + } + continue; + } + match = cur.match(regexIdPrefix); + if (match) { + token2.text = match[1]; + offset2 += token2.text.length; + if (Keywords.has(token2.text)) { + token2.type = "KEYWORD"; + continue; + } + if (token2.text.match(regexType)) { + token2.type = "TYPE"; + continue; + } + token2.type = "ID"; + continue; + } + match = cur.match(regexNumberPrefix); + if (match) { + token2.text = match[1]; + token2.type = "NUMBER"; + offset2 += token2.text.length; + continue; + } + throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset2}`); + } + return new TokenString(tokens.map((t2) => Object.freeze(t2))); +} +function allowSingle(set2, allowed) { + const included = []; + for (const key2 in allowed.keys()) { + if (set2.has(key2)) { + included.push(key2); + } + } + if (included.length > 1) { + throw new Error(`conflicting types: ${included.join(", ")}`); + } +} +function consumeName(type2, tokens) { + if (tokens.peekKeyword(KwTypes)) { + const keyword = tokens.pop().text; + if (keyword !== type2) { + throw new Error(`expected ${type2}, got ${keyword}`); + } + } + return tokens.popType("ID"); +} +function consumeKeywords(tokens, allowed) { + const keywords2 = /* @__PURE__ */ new Set(); + while (true) { + const keyword = tokens.peekType("KEYWORD"); + if (keyword == null || allowed && !allowed.has(keyword)) { + break; + } + tokens.pop(); + if (keywords2.has(keyword)) { + throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); + } + keywords2.add(keyword); + } + return Object.freeze(keywords2); +} +function consumeMutability(tokens) { + const modifiers = consumeKeywords(tokens, KwVisib); + allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); + allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); + if (modifiers.has("view")) { + return "view"; + } + if (modifiers.has("pure")) { + return "pure"; + } + if (modifiers.has("payable")) { + return "payable"; + } + if (modifiers.has("nonpayable")) { + return "nonpayable"; + } + if (modifiers.has("constant")) { + return "view"; + } + return "nonpayable"; +} +function consumeParams(tokens, allowIndexed) { + return tokens.popParams().map((t2) => ParamType.from(t2, allowIndexed)); +} +function consumeGas(tokens) { + if (tokens.peekType("AT")) { + tokens.pop(); + if (tokens.peekType("NUMBER")) { + return getBigInt(tokens.pop().text); + } + throw new Error("invalid gas"); + } + return null; +} +function consumeEoi(tokens) { + if (tokens.length) { + throw new Error(`unexpected tokens: ${tokens.toString()}`); + } +} +const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); +function verifyBasicType(type2) { + const match = type2.match(regexType); + assertArgument(match, "invalid type", "type", type2); + if (type2 === "uint") { + return "uint256"; + } + if (type2 === "int") { + return "int256"; + } + if (match[2]) { + const length = parseInt(match[2]); + assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type2); + } else if (match[3]) { + const size2 = parseInt(match[3]); + assertArgument(size2 !== 0 && size2 <= 256 && size2 % 8 === 0, "invalid numeric width", "type", type2); + } + return type2; +} +const _guard = {}; +const internal = Symbol.for("_ethers_internal"); +const ParamTypeInternal = "_ParamTypeInternal"; +const ErrorFragmentInternal = "_ErrorInternal"; +const EventFragmentInternal = "_EventInternal"; +const ConstructorFragmentInternal = "_ConstructorInternal"; +const FallbackFragmentInternal = "_FallbackInternal"; +const FunctionFragmentInternal = "_FunctionInternal"; +const StructFragmentInternal = "_StructInternal"; +const _ParamType = class _ParamType { + /** + * @private + */ + constructor(guard2, name2, type2, baseType, indexed, components, arrayLength, arrayChildren) { + __privateAdd(this, _walkAsync2); + /** + * The local name of the parameter (or ``""`` if unbound) + */ + __publicField(this, "name"); + /** + * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, + * ``"uint256[3][]"``) + */ + __publicField(this, "type"); + /** + * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) + */ + __publicField(this, "baseType"); + /** + * True if the parameters is indexed. + * + * For non-indexable types this is ``null``. + */ + __publicField(this, "indexed"); + /** + * The components for the tuple. + * + * For non-tuple types this is ``null``. + */ + __publicField(this, "components"); + /** + * The array length, or ``-1`` for dynamic-lengthed arrays. + * + * For non-array types this is ``null``. + */ + __publicField(this, "arrayLength"); + /** + * The type of each child in the array. + * + * For non-array types this is ``null``. + */ + __publicField(this, "arrayChildren"); + assertPrivate(guard2, _guard, "ParamType"); + Object.defineProperty(this, internal, { value: ParamTypeInternal }); + if (components) { + components = Object.freeze(components.slice()); + } + if (baseType === "array") { + if (arrayLength == null || arrayChildren == null) { + throw new Error(""); + } + } else if (arrayLength != null || arrayChildren != null) { + throw new Error(""); + } + if (baseType === "tuple") { + if (components == null) { + throw new Error(""); + } + } else if (components != null) { + throw new Error(""); + } + defineProperties(this, { + name: name2, + type: type2, + baseType, + indexed, + components, + arrayLength, + arrayChildren + }); + } + /** + * Return a string representation of this type. + * + * For example, + * + * ``sighash" => "(uint256,address)"`` + * + * ``"minimal" => "tuple(uint256,address) indexed"`` + * + * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` + */ + format(format2) { + if (format2 == null) { + format2 = "sighash"; + } + if (format2 === "json") { + const result2 = { + type: this.baseType === "tuple" ? "tuple" : this.type, + name: this.name || void 0 + }; + if (typeof this.indexed === "boolean") { + result2.indexed = this.indexed; + } + if (this.isTuple()) { + result2.components = this.components.map((c2) => JSON.parse(c2.format(format2))); + } + return JSON.stringify(result2); + } + let result = ""; + if (this.isArray()) { + result += this.arrayChildren.format(format2); + result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; + } else { + if (this.isTuple()) { + if (format2 !== "sighash") { + result += this.type; + } + result += "(" + this.components.map((comp) => comp.format(format2)).join(format2 === "full" ? ", " : ",") + ")"; + } else { + result += this.type; + } + } + if (format2 !== "sighash") { + if (this.indexed === true) { + result += " indexed"; + } + if (format2 === "full" && this.name) { + result += " " + this.name; + } + } + return result; + } + /** + * Returns true if %%this%% is an Array type. + * + * This provides a type gaurd ensuring that [[arrayChildren]] + * and [[arrayLength]] are non-null. + */ + isArray() { + return this.baseType === "array"; + } + /** + * Returns true if %%this%% is a Tuple type. + * + * This provides a type gaurd ensuring that [[components]] + * is non-null. + */ + isTuple() { + return this.baseType === "tuple"; + } + /** + * Returns true if %%this%% is an Indexable type. + * + * This provides a type gaurd ensuring that [[indexed]] + * is non-null. + */ + isIndexable() { + return this.indexed != null; + } + /** + * Walks the **ParamType** with %%value%%, calling %%process%% + * on each type, destructing the %%value%% recursively. + */ + walk(value, process2) { + if (this.isArray()) { + if (!Array.isArray(value)) { + throw new Error("invalid array value"); + } + if (this.arrayLength !== -1 && value.length !== this.arrayLength) { + throw new Error("array is wrong length"); + } + return value.map((v6) => { + var _a3; + return (_a3 = this.arrayChildren) == null ? void 0 : _a3.walk(v6, process2); + }); + } + if (this.isTuple()) { + if (!Array.isArray(value)) { + throw new Error("invalid tuple value"); + } + if (value.length !== this.components.length) { + throw new Error("array is wrong length"); + } + return value.map((v6, i2) => { + var _a3; + return (_a3 = this.components) == null ? void 0 : _a3[i2].walk(v6, process2); + }); + } + return process2(this.type, value); + } + /** + * Walks the **ParamType** with %%value%%, asynchronously calling + * %%process%% on each type, destructing the %%value%% recursively. + * + * This can be used to resolve ENS naes by walking and resolving each + * ``"address"`` type. + */ + async walkAsync(value, process2) { + const promises = []; + const result = [value]; + __privateMethod(this, _walkAsync2, walkAsync_fn2).call(this, promises, value, process2, (value2) => { + result[0] = value2; + }); + if (promises.length) { + await Promise.all(promises); + } + return result[0]; + } + /** + * Creates a new **ParamType** for %%obj%%. + * + * If %%allowIndexed%% then the ``indexed`` keyword is permitted, + * otherwise the ``indexed`` keyword will throw an error. + */ + static from(obj, allowIndexed) { + if (_ParamType.isParamType(obj)) { + return obj; + } + if (typeof obj === "string") { + return _ParamType.from(lex(obj), allowIndexed); + } else if (obj instanceof TokenString) { + let type3 = "", baseType = ""; + let comps = null; + if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) { + baseType = "tuple"; + comps = obj.popParams().map((t2) => _ParamType.from(t2)); + type3 = `tuple(${comps.map((c2) => c2.format()).join(",")})`; + } else { + type3 = verifyBasicType(obj.popType("TYPE")); + baseType = type3; + } + let arrayChildren = null; + let arrayLength = null; + while (obj.length && obj.peekType("BRACKET")) { + const bracket = obj.pop(); + arrayChildren = new _ParamType(_guard, "", type3, baseType, null, comps, arrayLength, arrayChildren); + arrayLength = bracket.value; + type3 += bracket.text; + baseType = "array"; + comps = null; + } + let indexed2 = null; + const keywords2 = consumeKeywords(obj, KwModifiers); + if (keywords2.has("indexed")) { + if (!allowIndexed) { + throw new Error(""); + } + indexed2 = true; + } + const name3 = obj.peekType("ID") ? obj.pop().text : ""; + if (obj.length) { + throw new Error("leftover tokens"); + } + return new _ParamType(_guard, name3, type3, baseType, indexed2, comps, arrayLength, arrayChildren); + } + const name2 = obj.name; + assertArgument(!name2 || typeof name2 === "string" && name2.match(regexId), "invalid name", "obj.name", name2); + let indexed = obj.indexed; + if (indexed != null) { + assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); + indexed = !!indexed; + } + let type2 = obj.type; + const arrayMatch = type2.match(regexArrayType); + if (arrayMatch) { + const arrayLength = parseInt(arrayMatch[2] || "-1"); + const arrayChildren = _ParamType.from({ + type: arrayMatch[1], + components: obj.components + }); + return new _ParamType(_guard, name2 || "", type2, "array", indexed, null, arrayLength, arrayChildren); + } + if (type2 === "tuple" || type2.startsWith( + "tuple(" + /* fix: ) */ + ) || type2.startsWith( + "(" + /* fix: ) */ + )) { + const comps = obj.components != null ? obj.components.map((c2) => _ParamType.from(c2)) : null; + const tuple2 = new _ParamType(_guard, name2 || "", type2, "tuple", indexed, comps, null, null); + return tuple2; + } + type2 = verifyBasicType(obj.type); + return new _ParamType(_guard, name2 || "", type2, type2, indexed, null, null, null); + } + /** + * Returns true if %%value%% is a **ParamType**. + */ + static isParamType(value) { + return value && value[internal] === ParamTypeInternal; + } +}; +_walkAsync2 = new WeakSet(); +walkAsync_fn2 = function(promises, value, process2, setValue) { + if (this.isArray()) { + if (!Array.isArray(value)) { + throw new Error("invalid array value"); + } + if (this.arrayLength !== -1 && value.length !== this.arrayLength) { + throw new Error("array is wrong length"); + } + const childType = this.arrayChildren; + const result2 = value.slice(); + result2.forEach((value2, index2) => { + var _a3; + __privateMethod(_a3 = childType, _walkAsync2, walkAsync_fn2).call(_a3, promises, value2, process2, (value3) => { + result2[index2] = value3; + }); + }); + setValue(result2); + return; + } + if (this.isTuple()) { + const components = this.components; + let result2; + if (Array.isArray(value)) { + result2 = value.slice(); + } else { + if (value == null || typeof value !== "object") { + throw new Error("invalid tuple value"); + } + result2 = components.map((param) => { + if (!param.name) { + throw new Error("cannot use object value with unnamed components"); + } + if (!(param.name in value)) { + throw new Error(`missing value for component ${param.name}`); + } + return value[param.name]; + }); + } + if (result2.length !== this.components.length) { + throw new Error("array is wrong length"); + } + result2.forEach((value2, index2) => { + var _a3; + __privateMethod(_a3 = components[index2], _walkAsync2, walkAsync_fn2).call(_a3, promises, value2, process2, (value3) => { + result2[index2] = value3; + }); + }); + setValue(result2); + return; + } + const result = process2(this.type, value); + if (result.then) { + promises.push(async function() { + setValue(await result); + }()); + } else { + setValue(result); + } +}; +let ParamType = _ParamType; +class Fragment { + /** + * @private + */ + constructor(guard2, type2, inputs) { + /** + * The type of the fragment. + */ + __publicField(this, "type"); + /** + * The inputs for the fragment. + */ + __publicField(this, "inputs"); + assertPrivate(guard2, _guard, "Fragment"); + inputs = Object.freeze(inputs.slice()); + defineProperties(this, { type: type2, inputs }); + } + /** + * Creates a new **Fragment** for %%obj%%, wich can be any supported + * ABI frgament type. + */ + static from(obj) { + if (typeof obj === "string") { + try { + Fragment.from(JSON.parse(obj)); + } catch (e18) { + } + return Fragment.from(lex(obj)); + } + if (obj instanceof TokenString) { + const type2 = obj.peekKeyword(KwTypes); + switch (type2) { + case "constructor": + return ConstructorFragment.from(obj); + case "error": + return ErrorFragment.from(obj); + case "event": + return EventFragment.from(obj); + case "fallback": + case "receive": + return FallbackFragment.from(obj); + case "function": + return FunctionFragment.from(obj); + case "struct": + return StructFragment.from(obj); + } + } else if (typeof obj === "object") { + switch (obj.type) { + case "constructor": + return ConstructorFragment.from(obj); + case "error": + return ErrorFragment.from(obj); + case "event": + return EventFragment.from(obj); + case "fallback": + case "receive": + return FallbackFragment.from(obj); + case "function": + return FunctionFragment.from(obj); + case "struct": + return StructFragment.from(obj); + } + assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { + operation: "Fragment.from" + }); + } + assertArgument(false, "unsupported frgament object", "obj", obj); + } + /** + * Returns true if %%value%% is a [[ConstructorFragment]]. + */ + static isConstructor(value) { + return ConstructorFragment.isFragment(value); + } + /** + * Returns true if %%value%% is an [[ErrorFragment]]. + */ + static isError(value) { + return ErrorFragment.isFragment(value); + } + /** + * Returns true if %%value%% is an [[EventFragment]]. + */ + static isEvent(value) { + return EventFragment.isFragment(value); + } + /** + * Returns true if %%value%% is a [[FunctionFragment]]. + */ + static isFunction(value) { + return FunctionFragment.isFragment(value); + } + /** + * Returns true if %%value%% is a [[StructFragment]]. + */ + static isStruct(value) { + return StructFragment.isFragment(value); + } +} +class NamedFragment extends Fragment { + /** + * @private + */ + constructor(guard2, type2, name2, inputs) { + super(guard2, type2, inputs); + /** + * The name of the fragment. + */ + __publicField(this, "name"); + assertArgument(typeof name2 === "string" && name2.match(regexId), "invalid identifier", "name", name2); + inputs = Object.freeze(inputs.slice()); + defineProperties(this, { name: name2 }); + } +} +function joinParams(format2, params) { + return "(" + params.map((p3) => p3.format(format2)).join(format2 === "full" ? ", " : ",") + ")"; +} +class ErrorFragment extends NamedFragment { + /** + * @private + */ + constructor(guard2, name2, inputs) { + super(guard2, "error", name2, inputs); + Object.defineProperty(this, internal, { value: ErrorFragmentInternal }); + } + /** + * The Custom Error selector. + */ + get selector() { + return id(this.format("sighash")).substring(0, 10); + } + /** + * Returns a string representation of this fragment as %%format%%. + */ + format(format2) { + if (format2 == null) { + format2 = "sighash"; + } + if (format2 === "json") { + return JSON.stringify({ + type: "error", + name: this.name, + inputs: this.inputs.map((input) => JSON.parse(input.format(format2))) + }); + } + const result = []; + if (format2 !== "sighash") { + result.push("error"); + } + result.push(this.name + joinParams(format2, this.inputs)); + return result.join(" "); + } + /** + * Returns a new **ErrorFragment** for %%obj%%. + */ + static from(obj) { + if (ErrorFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return ErrorFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const name2 = consumeName("error", obj); + const inputs = consumeParams(obj); + consumeEoi(obj); + return new ErrorFragment(_guard, name2, inputs); + } + return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); + } + /** + * Returns ``true`` and provides a type guard if %%value%% is an + * **ErrorFragment**. + */ + static isFragment(value) { + return value && value[internal] === ErrorFragmentInternal; + } +} +class EventFragment extends NamedFragment { + /** + * @private + */ + constructor(guard2, name2, inputs, anonymous) { + super(guard2, "event", name2, inputs); + /** + * Whether this event is anonymous. + */ + __publicField(this, "anonymous"); + Object.defineProperty(this, internal, { value: EventFragmentInternal }); + defineProperties(this, { anonymous }); + } + /** + * The Event topic hash. + */ + get topicHash() { + return id(this.format("sighash")); + } + /** + * Returns a string representation of this event as %%format%%. + */ + format(format2) { + if (format2 == null) { + format2 = "sighash"; + } + if (format2 === "json") { + return JSON.stringify({ + type: "event", + anonymous: this.anonymous, + name: this.name, + inputs: this.inputs.map((i2) => JSON.parse(i2.format(format2))) + }); + } + const result = []; + if (format2 !== "sighash") { + result.push("event"); + } + result.push(this.name + joinParams(format2, this.inputs)); + if (format2 !== "sighash" && this.anonymous) { + result.push("anonymous"); + } + return result.join(" "); + } + /** + * Return the topic hash for an event with %%name%% and %%params%%. + */ + static getTopicHash(name2, params) { + params = (params || []).map((p3) => ParamType.from(p3)); + const fragment = new EventFragment(_guard, name2, params, false); + return fragment.topicHash; + } + /** + * Returns a new **EventFragment** for %%obj%%. + */ + static from(obj) { + if (EventFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return EventFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const name2 = consumeName("event", obj); + const inputs = consumeParams(obj, true); + const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); + consumeEoi(obj); + return new EventFragment(_guard, name2, inputs, anonymous); + } + return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p3) => ParamType.from(p3, true)) : [], !!obj.anonymous); + } + /** + * Returns ``true`` and provides a type guard if %%value%% is an + * **EventFragment**. + */ + static isFragment(value) { + return value && value[internal] === EventFragmentInternal; + } +} +class ConstructorFragment extends Fragment { + /** + * @private + */ + constructor(guard2, type2, inputs, payable, gas) { + super(guard2, type2, inputs); + /** + * Whether the constructor can receive an endowment. + */ + __publicField(this, "payable"); + /** + * The recommended gas limit for deployment or ``null``. + */ + __publicField(this, "gas"); + Object.defineProperty(this, internal, { + value: ConstructorFragmentInternal + }); + defineProperties(this, { payable, gas }); + } + /** + * Returns a string representation of this constructor as %%format%%. + */ + format(format2) { + assert(format2 != null && format2 !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { + operation: "format(sighash)" + }); + if (format2 === "json") { + return JSON.stringify({ + type: "constructor", + stateMutability: this.payable ? "payable" : "undefined", + payable: this.payable, + gas: this.gas != null ? this.gas : void 0, + inputs: this.inputs.map((i2) => JSON.parse(i2.format(format2))) + }); + } + const result = [`constructor${joinParams(format2, this.inputs)}`]; + result.push(this.payable ? "payable" : "nonpayable"); + if (this.gas != null) { + result.push(`@${this.gas.toString()}`); + } + return result.join(" "); + } + /** + * Returns a new **ConstructorFragment** for %%obj%%. + */ + static from(obj) { + if (ConstructorFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return ConstructorFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + consumeKeywords(obj, setify(["constructor"])); + const inputs = consumeParams(obj); + const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable"); + const gas = consumeGas(obj); + consumeEoi(obj); + return new ConstructorFragment(_guard, "constructor", inputs, payable, gas); + } + return new ConstructorFragment(_guard, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.gas != null ? obj.gas : null); + } + /** + * Returns ``true`` and provides a type guard if %%value%% is a + * **ConstructorFragment**. + */ + static isFragment(value) { + return value && value[internal] === ConstructorFragmentInternal; + } +} +class FallbackFragment extends Fragment { + constructor(guard2, inputs, payable) { + super(guard2, "fallback", inputs); + /** + * If the function can be sent value during invocation. + */ + __publicField(this, "payable"); + Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); + defineProperties(this, { payable }); + } + /** + * Returns a string representation of this fallback as %%format%%. + */ + format(format2) { + const type2 = this.inputs.length === 0 ? "receive" : "fallback"; + if (format2 === "json") { + const stateMutability = this.payable ? "payable" : "nonpayable"; + return JSON.stringify({ type: type2, stateMutability }); + } + return `${type2}()${this.payable ? " payable" : ""}`; + } + /** + * Returns a new **FallbackFragment** for %%obj%%. + */ + static from(obj) { + if (FallbackFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return FallbackFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const errorObj = obj.toString(); + const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); + assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); + const type2 = obj.popKeyword(setify(["fallback", "receive"])); + if (type2 === "receive") { + const inputs2 = consumeParams(obj); + assertArgument(inputs2.length === 0, `receive cannot have arguments`, "obj.inputs", inputs2); + consumeKeywords(obj, setify(["payable"])); + consumeEoi(obj); + return new FallbackFragment(_guard, [], true); + } + let inputs = consumeParams(obj); + if (inputs.length) { + assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i2) => i2.format("minimal")).join(", ")); + } else { + inputs = [ParamType.from("bytes")]; + } + const mutability = consumeMutability(obj); + assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); + if (consumeKeywords(obj, setify(["returns"])).has("returns")) { + const outputs = consumeParams(obj); + assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i2) => i2.format("minimal")).join(", ")); + } + consumeEoi(obj); + return new FallbackFragment(_guard, inputs, mutability === "payable"); + } + if (obj.type === "receive") { + return new FallbackFragment(_guard, [], true); + } + if (obj.type === "fallback") { + const inputs = [ParamType.from("bytes")]; + const payable = obj.stateMutability === "payable"; + return new FallbackFragment(_guard, inputs, payable); + } + assertArgument(false, "invalid fallback description", "obj", obj); + } + /** + * Returns ``true`` and provides a type guard if %%value%% is a + * **FallbackFragment**. + */ + static isFragment(value) { + return value && value[internal] === FallbackFragmentInternal; + } +} +class FunctionFragment extends NamedFragment { + /** + * @private + */ + constructor(guard2, name2, stateMutability, inputs, outputs, gas) { + super(guard2, "function", name2, inputs); + /** + * If the function is constant (e.g. ``pure`` or ``view`` functions). + */ + __publicField(this, "constant"); + /** + * The returned types for the result of calling this function. + */ + __publicField(this, "outputs"); + /** + * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` + * or ``pure``) + */ + __publicField(this, "stateMutability"); + /** + * If the function can be sent value during invocation. + */ + __publicField(this, "payable"); + /** + * The recommended gas limit to send when calling this function. + */ + __publicField(this, "gas"); + Object.defineProperty(this, internal, { value: FunctionFragmentInternal }); + outputs = Object.freeze(outputs.slice()); + const constant = stateMutability === "view" || stateMutability === "pure"; + const payable = stateMutability === "payable"; + defineProperties(this, { + constant, + gas, + outputs, + payable, + stateMutability + }); + } + /** + * The Function selector. + */ + get selector() { + return id(this.format("sighash")).substring(0, 10); + } + /** + * Returns a string representation of this function as %%format%%. + */ + format(format2) { + if (format2 == null) { + format2 = "sighash"; + } + if (format2 === "json") { + return JSON.stringify({ + type: "function", + name: this.name, + constant: this.constant, + stateMutability: this.stateMutability !== "nonpayable" ? this.stateMutability : void 0, + payable: this.payable, + gas: this.gas != null ? this.gas : void 0, + inputs: this.inputs.map((i2) => JSON.parse(i2.format(format2))), + outputs: this.outputs.map((o2) => JSON.parse(o2.format(format2))) + }); + } + const result = []; + if (format2 !== "sighash") { + result.push("function"); + } + result.push(this.name + joinParams(format2, this.inputs)); + if (format2 !== "sighash") { + if (this.stateMutability !== "nonpayable") { + result.push(this.stateMutability); + } + if (this.outputs && this.outputs.length) { + result.push("returns"); + result.push(joinParams(format2, this.outputs)); + } + if (this.gas != null) { + result.push(`@${this.gas.toString()}`); + } + } + return result.join(" "); + } + /** + * Return the selector for a function with %%name%% and %%params%%. + */ + static getSelector(name2, params) { + params = (params || []).map((p3) => ParamType.from(p3)); + const fragment = new FunctionFragment(_guard, name2, "view", params, [], null); + return fragment.selector; + } + /** + * Returns a new **FunctionFragment** for %%obj%%. + */ + static from(obj) { + if (FunctionFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return FunctionFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const name2 = consumeName("function", obj); + const inputs = consumeParams(obj); + const mutability = consumeMutability(obj); + let outputs = []; + if (consumeKeywords(obj, setify(["returns"])).has("returns")) { + outputs = consumeParams(obj); + } + const gas = consumeGas(obj); + consumeEoi(obj); + return new FunctionFragment(_guard, name2, mutability, inputs, outputs, gas); + } + let stateMutability = obj.stateMutability; + if (stateMutability == null) { + stateMutability = "payable"; + if (typeof obj.constant === "boolean") { + stateMutability = "view"; + if (!obj.constant) { + stateMutability = "payable"; + if (typeof obj.payable === "boolean" && !obj.payable) { + stateMutability = "nonpayable"; + } + } + } else if (typeof obj.payable === "boolean" && !obj.payable) { + stateMutability = "nonpayable"; + } + } + return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.gas != null ? obj.gas : null); + } + /** + * Returns ``true`` and provides a type guard if %%value%% is a + * **FunctionFragment**. + */ + static isFragment(value) { + return value && value[internal] === FunctionFragmentInternal; + } +} +class StructFragment extends NamedFragment { + /** + * @private + */ + constructor(guard2, name2, inputs) { + super(guard2, "struct", name2, inputs); + Object.defineProperty(this, internal, { value: StructFragmentInternal }); + } + /** + * Returns a string representation of this struct as %%format%%. + */ + format() { + throw new Error("@TODO"); + } + /** + * Returns a new **StructFragment** for %%obj%%. + */ + static from(obj) { + if (typeof obj === "string") { + return StructFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const name2 = consumeName("struct", obj); + const inputs = consumeParams(obj); + consumeEoi(obj); + return new StructFragment(_guard, name2, inputs); + } + return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); + } + // @TODO: fix this return type + /** + * Returns ``true`` and provides a type guard if %%value%% is a + * **StructFragment**. + */ + static isFragment(value) { + return value && value[internal] === StructFragmentInternal; + } +} +class LogDescription { + /** + * @_ignore: + */ + constructor(fragment, topic, args) { + /** + * The matching fragment for the ``topic0``. + */ + __publicField(this, "fragment"); + /** + * The name of the Event. + */ + __publicField(this, "name"); + /** + * The full Event signature. + */ + __publicField(this, "signature"); + /** + * The topic hash for the Event. + */ + __publicField(this, "topic"); + /** + * The arguments passed into the Event with ``emit``. + */ + __publicField(this, "args"); + const name2 = fragment.name, signature2 = fragment.format(); + defineProperties(this, { + fragment, + name: name2, + signature: signature2, + topic, + args + }); + } +} +class TransactionDescription { + /** + * @_ignore: + */ + constructor(fragment, selector, args, value) { + /** + * The matching fragment from the transaction ``data``. + */ + __publicField(this, "fragment"); + /** + * The name of the Function from the transaction ``data``. + */ + __publicField(this, "name"); + /** + * The arguments passed to the Function from the transaction ``data``. + */ + __publicField(this, "args"); + /** + * The full Function signature from the transaction ``data``. + */ + __publicField(this, "signature"); + /** + * The selector for the Function from the transaction ``data``. + */ + __publicField(this, "selector"); + /** + * The ``value`` (in wei) from the transaction. + */ + __publicField(this, "value"); + const name2 = fragment.name, signature2 = fragment.format(); + defineProperties(this, { + fragment, + name: name2, + args, + signature: signature2, + selector, + value + }); + } +} +class ErrorDescription { + /** + * @_ignore: + */ + constructor(fragment, selector, args) { + /** + * The matching fragment. + */ + __publicField(this, "fragment"); + /** + * The name of the Error. + */ + __publicField(this, "name"); + /** + * The arguments passed to the Error with ``revert``. + */ + __publicField(this, "args"); + /** + * The full Error signature. + */ + __publicField(this, "signature"); + /** + * The selector for the Error. + */ + __publicField(this, "selector"); + const name2 = fragment.name, signature2 = fragment.format(); + defineProperties(this, { + fragment, + name: name2, + args, + signature: signature2, + selector + }); + } +} +class Indexed { + /** + * @_ignore: + */ + constructor(hash3) { + /** + * The ``keccak256`` of the value logged. + */ + __publicField(this, "hash"); + /** + * @_ignore: + */ + __publicField(this, "_isIndexed"); + defineProperties(this, { hash: hash3, _isIndexed: true }); + } + /** + * Returns ``true`` if %%value%% is an **Indexed**. + * + * This provides a Type Guard for property access. + */ + static isIndexed(value) { + return !!(value && value._isIndexed); + } +} +const PanicReasons = { + "0": "generic panic", + "1": "assert(false)", + "17": "arithmetic overflow", + "18": "division or modulo by zero", + "33": "enum overflow", + "34": "invalid encoded storage byte array accessed", + "49": "out-of-bounds array access; popping on an empty array", + "50": "out-of-bounds access of an array or bytesN", + "65": "out of memory", + "81": "uninitialized function" +}; +const BuiltinErrors = { + "0x08c379a0": { + signature: "Error(string)", + name: "Error", + inputs: ["string"], + reason: (message2) => { + return `reverted with reason string ${JSON.stringify(message2)}`; + } + }, + "0x4e487b71": { + signature: "Panic(uint256)", + name: "Panic", + inputs: ["uint256"], + reason: (code2) => { + let reason = "unknown panic code"; + if (code2 >= 0 && code2 <= 255 && PanicReasons[code2.toString()]) { + reason = PanicReasons[code2.toString()]; + } + return `reverted with panic code 0x${code2.toString(16)} (${reason})`; + } + } +}; +const _Interface = class _Interface { + /** + * Create a new Interface for the %%fragments%%. + */ + constructor(fragments) { + // Find a function definition by any means necessary (unless it is ambiguous) + __privateAdd(this, _getFunction); + // Find an event definition by any means necessary (unless it is ambiguous) + __privateAdd(this, _getEvent); + /** + * All the Contract ABI members (i.e. methods, events, errors, etc). + */ + __publicField(this, "fragments"); + /** + * The Contract constructor. + */ + __publicField(this, "deploy"); + /** + * The Fallback method, if any. + */ + __publicField(this, "fallback"); + /** + * If receiving ether is supported. + */ + __publicField(this, "receive"); + __privateAdd(this, _errors, void 0); + __privateAdd(this, _events, void 0); + __privateAdd(this, _functions, void 0); + // #structs: Map; + __privateAdd(this, _abiCoder, void 0); + let abi2 = []; + if (typeof fragments === "string") { + abi2 = JSON.parse(fragments); + } else { + abi2 = fragments; + } + __privateSet(this, _functions, /* @__PURE__ */ new Map()); + __privateSet(this, _errors, /* @__PURE__ */ new Map()); + __privateSet(this, _events, /* @__PURE__ */ new Map()); + const frags = []; + for (const a3 of abi2) { + try { + frags.push(Fragment.from(a3)); + } catch (error) { + console.log("EE", error); + } + } + defineProperties(this, { + fragments: Object.freeze(frags) + }); + let fallback = null; + let receive = false; + __privateSet(this, _abiCoder, this.getAbiCoder()); + this.fragments.forEach((fragment, index2) => { + let bucket; + switch (fragment.type) { + case "constructor": + if (this.deploy) { + console.log("duplicate definition - constructor"); + return; + } + defineProperties(this, { + deploy: fragment + }); + return; + case "fallback": + if (fragment.inputs.length === 0) { + receive = true; + } else { + assertArgument(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index2}]`, fragment); + fallback = fragment; + receive = fallback.payable; + } + return; + case "function": + bucket = __privateGet(this, _functions); + break; + case "event": + bucket = __privateGet(this, _events); + break; + case "error": + bucket = __privateGet(this, _errors); + break; + default: + return; + } + const signature2 = fragment.format(); + if (bucket.has(signature2)) { + return; + } + bucket.set(signature2, fragment); + }); + if (!this.deploy) { + defineProperties(this, { + deploy: ConstructorFragment.from("constructor()") + }); + } + defineProperties(this, { fallback, receive }); + } + /** + * Returns the entire Human-Readable ABI, as an array of + * signatures, optionally as %%minimal%% strings, which + * removes parameter names and unneceesary spaces. + */ + format(minimal) { + const format2 = minimal ? "minimal" : "full"; + const abi2 = this.fragments.map((f4) => f4.format(format2)); + return abi2; + } + /** + * Return the JSON-encoded ABI. This is the format Solidiy + * returns. + */ + formatJson() { + const abi2 = this.fragments.map((f4) => f4.format("json")); + return JSON.stringify(abi2.map((j2) => JSON.parse(j2))); + } + /** + * The ABI coder that will be used to encode and decode binary + * data. + */ + getAbiCoder() { + return AbiCoder.defaultAbiCoder(); + } + /** + * Get the function name for %%key%%, which may be a function selector, + * function name or function signature that belongs to the ABI. + */ + getFunctionName(key2) { + const fragment = __privateMethod(this, _getFunction, getFunction_fn).call(this, key2, null, false); + assertArgument(fragment, "no matching function", "key", key2); + return fragment.name; + } + /** + * Returns true if %%key%% (a function selector, function name or + * function signature) is present in the ABI. + * + * In the case of a function name, the name may be ambiguous, so + * accessing the [[FunctionFragment]] may require refinement. + */ + hasFunction(key2) { + return !!__privateMethod(this, _getFunction, getFunction_fn).call(this, key2, null, false); + } + /** + * Get the [[FunctionFragment]] for %%key%%, which may be a function + * selector, function name or function signature that belongs to the ABI. + * + * If %%values%% is provided, it will use the Typed API to handle + * ambiguous cases where multiple functions match by name. + * + * If the %%key%% and %%values%% do not refine to a single function in + * the ABI, this will throw. + */ + getFunction(key2, values) { + return __privateMethod(this, _getFunction, getFunction_fn).call(this, key2, values || null, true); + } + /** + * Iterate over all functions, calling %%callback%%, sorted by their name. + */ + forEachFunction(callback) { + const names = Array.from(__privateGet(this, _functions).keys()); + names.sort((a3, b2) => a3.localeCompare(b2)); + for (let i2 = 0; i2 < names.length; i2++) { + const name2 = names[i2]; + callback(__privateGet(this, _functions).get(name2), i2); + } + } + /** + * Get the event name for %%key%%, which may be a topic hash, + * event name or event signature that belongs to the ABI. + */ + getEventName(key2) { + const fragment = __privateMethod(this, _getEvent, getEvent_fn).call(this, key2, null, false); + assertArgument(fragment, "no matching event", "key", key2); + return fragment.name; + } + /** + * Returns true if %%key%% (an event topic hash, event name or + * event signature) is present in the ABI. + * + * In the case of an event name, the name may be ambiguous, so + * accessing the [[EventFragment]] may require refinement. + */ + hasEvent(key2) { + return !!__privateMethod(this, _getEvent, getEvent_fn).call(this, key2, null, false); + } + /** + * Get the [[EventFragment]] for %%key%%, which may be a topic hash, + * event name or event signature that belongs to the ABI. + * + * If %%values%% is provided, it will use the Typed API to handle + * ambiguous cases where multiple events match by name. + * + * If the %%key%% and %%values%% do not refine to a single event in + * the ABI, this will throw. + */ + getEvent(key2, values) { + return __privateMethod(this, _getEvent, getEvent_fn).call(this, key2, values || null, true); + } + /** + * Iterate over all events, calling %%callback%%, sorted by their name. + */ + forEachEvent(callback) { + const names = Array.from(__privateGet(this, _events).keys()); + names.sort((a3, b2) => a3.localeCompare(b2)); + for (let i2 = 0; i2 < names.length; i2++) { + const name2 = names[i2]; + callback(__privateGet(this, _events).get(name2), i2); + } + } + /** + * Get the [[ErrorFragment]] for %%key%%, which may be an error + * selector, error name or error signature that belongs to the ABI. + * + * If %%values%% is provided, it will use the Typed API to handle + * ambiguous cases where multiple errors match by name. + * + * If the %%key%% and %%values%% do not refine to a single error in + * the ABI, this will throw. + */ + getError(key2, values) { + if (isHexString(key2)) { + const selector = key2.toLowerCase(); + if (BuiltinErrors[selector]) { + return ErrorFragment.from(BuiltinErrors[selector].signature); + } + for (const fragment of __privateGet(this, _errors).values()) { + if (selector === fragment.selector) { + return fragment; + } + } + return null; + } + if (key2.indexOf("(") === -1) { + const matching = []; + for (const [name2, fragment] of __privateGet(this, _errors)) { + if (name2.split( + "(" + /* fix:) */ + )[0] === key2) { + matching.push(fragment); + } + } + if (matching.length === 0) { + if (key2 === "Error") { + return ErrorFragment.from("error Error(string)"); + } + if (key2 === "Panic") { + return ErrorFragment.from("error Panic(uint256)"); + } + return null; + } else if (matching.length > 1) { + const matchStr = matching.map((m3) => JSON.stringify(m3.format())).join(", "); + assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key2); + } + return matching[0]; + } + key2 = ErrorFragment.from(key2).format(); + if (key2 === "Error(string)") { + return ErrorFragment.from("error Error(string)"); + } + if (key2 === "Panic(uint256)") { + return ErrorFragment.from("error Panic(uint256)"); + } + const result = __privateGet(this, _errors).get(key2); + if (result) { + return result; + } + return null; + } + /** + * Iterate over all errors, calling %%callback%%, sorted by their name. + */ + forEachError(callback) { + const names = Array.from(__privateGet(this, _errors).keys()); + names.sort((a3, b2) => a3.localeCompare(b2)); + for (let i2 = 0; i2 < names.length; i2++) { + const name2 = names[i2]; + callback(__privateGet(this, _errors).get(name2), i2); + } + } + // Get the 4-byte selector used by Solidity to identify a function + /* + getSelector(fragment: ErrorFragment | FunctionFragment): string { + if (typeof(fragment) === "string") { + const matches: Array = [ ]; + + try { matches.push(this.getFunction(fragment)); } catch (error) { } + try { matches.push(this.getError(fragment)); } catch (_) { } + + if (matches.length === 0) { + logger.throwArgumentError("unknown fragment", "key", fragment); + } else if (matches.length > 1) { + logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); + } + + fragment = matches[0]; + } + + return dataSlice(id(fragment.format()), 0, 4); + } + */ + // Get the 32-byte topic hash used by Solidity to identify an event + /* + getEventTopic(fragment: EventFragment): string { + //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } + return id(fragment.format()); + } + */ + _decodeParams(params, data) { + return __privateGet(this, _abiCoder).decode(params, data); + } + _encodeParams(params, values) { + return __privateGet(this, _abiCoder).encode(params, values); + } + /** + * Encodes a ``tx.data`` object for deploying the Contract with + * the %%values%% as the constructor arguments. + */ + encodeDeploy(values) { + return this._encodeParams(this.deploy.inputs, values || []); + } + /** + * Decodes the result %%data%% (e.g. from an ``eth_call``) for the + * specified error (see [[getError]] for valid values for + * %%key%%). + * + * Most developers should prefer the [[parseCallResult]] method instead, + * which will automatically detect a ``CALL_EXCEPTION`` and throw the + * corresponding error. + */ + decodeErrorResult(fragment, data) { + if (typeof fragment === "string") { + const f4 = this.getError(fragment); + assertArgument(f4, "unknown error", "fragment", fragment); + fragment = f4; + } + assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); + return this._decodeParams(fragment.inputs, dataSlice(data, 4)); + } + /** + * Encodes the transaction revert data for a call result that + * reverted from the the Contract with the sepcified %%error%% + * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. + * + * This is generally not used by most developers, unless trying to mock + * a result from a Contract. + */ + encodeErrorResult(fragment, values) { + if (typeof fragment === "string") { + const f4 = this.getError(fragment); + assertArgument(f4, "unknown error", "fragment", fragment); + fragment = f4; + } + return concat([fragment.selector, this._encodeParams(fragment.inputs, values || [])]); + } + /** + * Decodes the %%data%% from a transaction ``tx.data`` for + * the function specified (see [[getFunction]] for valid values + * for %%fragment%%). + * + * Most developers should prefer the [[parseTransaction]] method + * instead, which will automatically detect the fragment. + */ + decodeFunctionData(fragment, data) { + if (typeof fragment === "string") { + const f4 = this.getFunction(fragment); + assertArgument(f4, "unknown function", "fragment", fragment); + fragment = f4; + } + assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); + return this._decodeParams(fragment.inputs, dataSlice(data, 4)); + } + /** + * Encodes the ``tx.data`` for a transaction that calls the function + * specified (see [[getFunction]] for valid values for %%fragment%%) with + * the %%values%%. + */ + encodeFunctionData(fragment, values) { + if (typeof fragment === "string") { + const f4 = this.getFunction(fragment); + assertArgument(f4, "unknown function", "fragment", fragment); + fragment = f4; + } + return concat([fragment.selector, this._encodeParams(fragment.inputs, values || [])]); + } + /** + * Decodes the result %%data%% (e.g. from an ``eth_call``) for the + * specified function (see [[getFunction]] for valid values for + * %%key%%). + * + * Most developers should prefer the [[parseCallResult]] method instead, + * which will automatically detect a ``CALL_EXCEPTION`` and throw the + * corresponding error. + */ + decodeFunctionResult(fragment, data) { + if (typeof fragment === "string") { + const f4 = this.getFunction(fragment); + assertArgument(f4, "unknown function", "fragment", fragment); + fragment = f4; + } + let message2 = "invalid length for result data"; + const bytes2 = getBytesCopy(data); + if (bytes2.length % 32 === 0) { + try { + return __privateGet(this, _abiCoder).decode(fragment.outputs, bytes2); + } catch (error) { + message2 = "could not decode result data"; + } + } + assert(false, message2, "BAD_DATA", { + value: hexlify(bytes2), + info: { method: fragment.name, signature: fragment.format() } + }); + } + makeError(_data5, tx) { + const data = getBytes(_data5, "data"); + const error = AbiCoder.getBuiltinCallException("call", tx, data); + const customPrefix = "execution reverted (unknown custom error)"; + if (error.message.startsWith(customPrefix)) { + const selector = hexlify(data.slice(0, 4)); + const ef2 = this.getError(selector); + if (ef2) { + try { + const args = __privateGet(this, _abiCoder).decode(ef2.inputs, data.slice(4)); + error.revert = { + name: ef2.name, + signature: ef2.format(), + args + }; + error.reason = error.revert.signature; + error.message = `execution reverted: ${error.reason}`; + } catch (e18) { + error.message = `execution reverted (coult not decode custom error)`; + } + } + } + const parsed = this.parseTransaction(tx); + if (parsed) { + error.invocation = { + method: parsed.name, + signature: parsed.signature, + args: parsed.args + }; + } + return error; + } + /** + * Encodes the result data (e.g. from an ``eth_call``) for the + * specified function (see [[getFunction]] for valid values + * for %%fragment%%) with %%values%%. + * + * This is generally not used by most developers, unless trying to mock + * a result from a Contract. + */ + encodeFunctionResult(fragment, values) { + if (typeof fragment === "string") { + const f4 = this.getFunction(fragment); + assertArgument(f4, "unknown function", "fragment", fragment); + fragment = f4; + } + return hexlify(__privateGet(this, _abiCoder).encode(fragment.outputs, values || [])); + } + /* + spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { + const promises: Array> = [ ]; + const process = function(type: ParamType, value: any): any { + if (type.baseType === "array") { + return descend(type.child + } + if (type. === "address") { + } + }; + + const descend = function (inputs: Array, values: ReadonlyArray) { + if (inputs.length !== values.length) { throw new Error("length mismatch"); } + + }; + + const result: Array = [ ]; + values.forEach((value, index) => { + if (value == null) { + topics.push(null); + } else if (param.baseType === "array" || param.baseType === "tuple") { + logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); + } else if (Array.isArray(value)) { + topics.push(value.map((value) => encodeTopic(param, value))); + } else { + topics.push(encodeTopic(param, value)); + } + }); + } + */ + // Create the filter for the event with search criteria (e.g. for eth_filterLog) + encodeFilterTopics(fragment, values) { + if (typeof fragment === "string") { + const f4 = this.getEvent(fragment); + assertArgument(f4, "unknown event", "eventFragment", fragment); + fragment = f4; + } + assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { + count: values.length, + expectedCount: fragment.inputs.length + }); + const topics = []; + if (!fragment.anonymous) { + topics.push(fragment.topicHash); + } + const encodeTopic = (param, value) => { + if (param.type === "string") { + return id(value); + } else if (param.type === "bytes") { + return keccak256(hexlify(value)); + } + if (param.type === "bool" && typeof value === "boolean") { + value = value ? "0x01" : "0x00"; + } + if (param.type.match(/^u?int/)) { + value = toBeHex(value); + } + if (param.type === "address") { + __privateGet(this, _abiCoder).encode(["address"], [value]); + } + return zeroPadValue(hexlify(value), 32); + }; + values.forEach((value, index2) => { + const param = fragment.inputs[index2]; + if (!param.indexed) { + assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); + return; + } + if (value == null) { + topics.push(null); + } else if (param.baseType === "array" || param.baseType === "tuple") { + assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); + } else if (Array.isArray(value)) { + topics.push(value.map((value2) => encodeTopic(param, value2))); + } else { + topics.push(encodeTopic(param, value)); + } + }); + while (topics.length && topics[topics.length - 1] === null) { + topics.pop(); + } + return topics; + } + encodeEventLog(fragment, values) { + if (typeof fragment === "string") { + const f4 = this.getEvent(fragment); + assertArgument(f4, "unknown event", "eventFragment", fragment); + fragment = f4; + } + const topics = []; + const dataTypes = []; + const dataValues = []; + if (!fragment.anonymous) { + topics.push(fragment.topicHash); + } + assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); + fragment.inputs.forEach((param, index2) => { + const value = values[index2]; + if (param.indexed) { + if (param.type === "string") { + topics.push(id(value)); + } else if (param.type === "bytes") { + topics.push(keccak256(value)); + } else if (param.baseType === "tuple" || param.baseType === "array") { + throw new Error("not implemented"); + } else { + topics.push(__privateGet(this, _abiCoder).encode([param.type], [value])); + } + } else { + dataTypes.push(param); + dataValues.push(value); + } + }); + return { + data: __privateGet(this, _abiCoder).encode(dataTypes, dataValues), + topics + }; + } + // Decode a filter for the event and the search criteria + decodeEventLog(fragment, data, topics) { + if (typeof fragment === "string") { + const f4 = this.getEvent(fragment); + assertArgument(f4, "unknown event", "eventFragment", fragment); + fragment = f4; + } + if (topics != null && !fragment.anonymous) { + const eventTopic = fragment.topicHash; + assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); + topics = topics.slice(1); + } + const indexed = []; + const nonIndexed = []; + const dynamic = []; + fragment.inputs.forEach((param, index2) => { + if (param.indexed) { + if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") { + indexed.push(ParamType.from({ type: "bytes32", name: param.name })); + dynamic.push(true); + } else { + indexed.push(param); + dynamic.push(false); + } + } else { + nonIndexed.push(param); + dynamic.push(false); + } + }); + const resultIndexed = topics != null ? __privateGet(this, _abiCoder).decode(indexed, concat(topics)) : null; + const resultNonIndexed = __privateGet(this, _abiCoder).decode(nonIndexed, data, true); + const values = []; + const keys2 = []; + let nonIndexedIndex = 0, indexedIndex = 0; + fragment.inputs.forEach((param, index2) => { + let value = null; + if (param.indexed) { + if (resultIndexed == null) { + value = new Indexed(null); + } else if (dynamic[index2]) { + value = new Indexed(resultIndexed[indexedIndex++]); + } else { + try { + value = resultIndexed[indexedIndex++]; + } catch (error) { + value = error; + } + } + } else { + try { + value = resultNonIndexed[nonIndexedIndex++]; + } catch (error) { + value = error; + } + } + values.push(value); + keys2.push(param.name || null); + }); + return Result.fromItems(values, keys2); + } + /** + * Parses a transaction, finding the matching function and extracts + * the parameter values along with other useful function details. + * + * If the matching function cannot be found, return null. + */ + parseTransaction(tx) { + const data = getBytes(tx.data, "tx.data"); + const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); + const fragment = this.getFunction(hexlify(data.slice(0, 4))); + if (!fragment) { + return null; + } + const args = __privateGet(this, _abiCoder).decode(fragment.inputs, data.slice(4)); + return new TransactionDescription(fragment, fragment.selector, args, value); + } + parseCallResult(data) { + throw new Error("@TODO"); + } + /** + * Parses a receipt log, finding the matching event and extracts + * the parameter values along with other useful event details. + * + * If the matching event cannot be found, returns null. + */ + parseLog(log2) { + const fragment = this.getEvent(log2.topics[0]); + if (!fragment || fragment.anonymous) { + return null; + } + return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log2.data, log2.topics)); + } + /** + * Parses a revert data, finding the matching error and extracts + * the parameter values along with other useful error details. + * + * If the matching event cannot be found, returns null. + */ + parseError(data) { + const hexData = hexlify(data); + const fragment = this.getError(dataSlice(hexData, 0, 4)); + if (!fragment) { + return null; + } + const args = __privateGet(this, _abiCoder).decode(fragment.inputs, dataSlice(hexData, 4)); + return new ErrorDescription(fragment, fragment.selector, args); + } + /** + * Creates a new [[Interface]] from the ABI %%value%%. + * + * The %%value%% may be provided as an existing [[Interface]] object, + * a JSON-encoded ABI or any Human-Readable ABI format. + */ + static from(value) { + if (value instanceof _Interface) { + return value; + } + if (typeof value === "string") { + return new _Interface(JSON.parse(value)); + } + if (typeof value.format === "function") { + return new _Interface(value.format("json")); + } + return new _Interface(value); + } +}; +_errors = new WeakMap(); +_events = new WeakMap(); +_functions = new WeakMap(); +_abiCoder = new WeakMap(); +_getFunction = new WeakSet(); +getFunction_fn = function(key2, values, forceUnique) { + if (isHexString(key2)) { + const selector = key2.toLowerCase(); + for (const fragment of __privateGet(this, _functions).values()) { + if (selector === fragment.selector) { + return fragment; + } + } + return null; + } + if (key2.indexOf("(") === -1) { + const matching = []; + for (const [name2, fragment] of __privateGet(this, _functions)) { + if (name2.split( + "(" + /* fix:) */ + )[0] === key2) { + matching.push(fragment); + } + } + if (values) { + const lastValue = values.length > 0 ? values[values.length - 1] : null; + let valueLength = values.length; + let allowOptions = true; + if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { + allowOptions = false; + valueLength--; + } + for (let i2 = matching.length - 1; i2 >= 0; i2--) { + const inputs = matching[i2].inputs.length; + if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) { + matching.splice(i2, 1); + } + } + for (let i2 = matching.length - 1; i2 >= 0; i2--) { + const inputs = matching[i2].inputs; + for (let j2 = 0; j2 < values.length; j2++) { + if (!Typed.isTyped(values[j2])) { + continue; + } + if (j2 >= inputs.length) { + if (values[j2].type === "overrides") { + continue; + } + matching.splice(i2, 1); + break; + } + if (values[j2].type !== inputs[j2].baseType) { + matching.splice(i2, 1); + break; + } + } + } + } + if (matching.length === 1 && values && values.length !== matching[0].inputs.length) { + const lastArg = values[values.length - 1]; + if (lastArg == null || Array.isArray(lastArg) || typeof lastArg !== "object") { + matching.splice(0, 1); + } + } + if (matching.length === 0) { + return null; + } + if (matching.length > 1 && forceUnique) { + const matchStr = matching.map((m3) => JSON.stringify(m3.format())).join(", "); + assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key2); + } + return matching[0]; + } + const result = __privateGet(this, _functions).get(FunctionFragment.from(key2).format()); + if (result) { + return result; + } + return null; +}; +_getEvent = new WeakSet(); +getEvent_fn = function(key2, values, forceUnique) { + if (isHexString(key2)) { + const eventTopic = key2.toLowerCase(); + for (const fragment of __privateGet(this, _events).values()) { + if (eventTopic === fragment.topicHash) { + return fragment; + } + } + return null; + } + if (key2.indexOf("(") === -1) { + const matching = []; + for (const [name2, fragment] of __privateGet(this, _events)) { + if (name2.split( + "(" + /* fix:) */ + )[0] === key2) { + matching.push(fragment); + } + } + if (values) { + for (let i2 = matching.length - 1; i2 >= 0; i2--) { + if (matching[i2].inputs.length < values.length) { + matching.splice(i2, 1); + } + } + for (let i2 = matching.length - 1; i2 >= 0; i2--) { + const inputs = matching[i2].inputs; + for (let j2 = 0; j2 < values.length; j2++) { + if (!Typed.isTyped(values[j2])) { + continue; + } + if (values[j2].type !== inputs[j2].baseType) { + matching.splice(i2, 1); + break; + } + } + } + } + if (matching.length === 0) { + return null; + } + if (matching.length > 1 && forceUnique) { + const matchStr = matching.map((m3) => JSON.stringify(m3.format())).join(", "); + assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key2); + } + return matching[0]; + } + const result = __privateGet(this, _events).get(EventFragment.from(key2).format()); + if (result) { + return result; + } + return null; +}; +let Interface = _Interface; +const splitSignature = (sigBytes) => Signature.from(sigBytes); +const joinSignature = (splitSig) => Signature.from(splitSig).serialized; +const arrayify = (value) => getBytes(value); +const FormatTypes = { + sighash: "sighash", + minimal: "minimal", + full: "full", + json: "json" +}; +const isValidMnemonic = Mnemonic.isValidMnemonic; +computeHmac.register((algorithm, key2, data) => { + return computeHmac._(algorithm, Buffer.from(key2), Buffer.from(data)); +}); +const ethersUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + AbiCoder, + FormatTypes, + Interface, + Mnemonic, + Signature, + SigningKey, + Wordlist, + arrayify, + concat, + ethersHDNodeWallet: HDNodeWallet, + id, + isValidMnemonic, + joinSignature, + keccak256, + recoverAddress, + sha256, + splitSignature, + toUtf8Bytes, + toUtf8String, + wordlists +}, Symbol.toStringTag, { value: "Module" })); +const ADDRESS_SIZE = 34; +const ADDRESS_PREFIX = "41"; +const ADDRESS_PREFIX_BYTE = 65; +const ADDRESS_PREFIX_REGEX = /^(41)/; +const TRON_BIP39_PATH_PREFIX = "m/44'/195'"; +const TRON_BIP39_PATH_INDEX_0 = TRON_BIP39_PATH_PREFIX + "/0'/0/0"; +function fromHex(address2) { + if (!isHex(address2)) + return address2; + return getBase58CheckAddress(hexStr2byteArray(address2.replace(/^0x/, ADDRESS_PREFIX))); +} +function toHex$1(address2) { + if (isHex(address2)) + return address2.toLowerCase().replace(/^0x/, ADDRESS_PREFIX); + return byteArray2hexStr(decodeBase58Address(address2)).toLowerCase(); +} +function getChecksumAddress(address2) { + address2 = address2.toLowerCase(); + const chars = address2.substring(2).split(""); + const expanded = new Uint8Array(40); + for (let i2 = 0; i2 < 40; i2++) { + expanded[i2] = chars[i2].charCodeAt(0); + } + const hashed = hexStr2byteArray(keccak256(expanded).slice(2)); + for (let i2 = 0; i2 < 40; i2 += 2) { + if (hashed[i2 >> 1] >> 4 >= 8) { + chars[i2] = chars[i2].toUpperCase(); + } + if ((hashed[i2 >> 1] & 15) >= 8) { + chars[i2 + 1] = chars[i2 + 1].toUpperCase(); + } + } + return ADDRESS_PREFIX + chars.join(""); +} +function toChecksumAddress(address2) { + if (!isAddress(address2)) + throw new Error(`'${address2}' is not a valid address string`); + return getChecksumAddress(toHex$1(address2)); +} +function isChecksumAddress(address2) { + if (!isHex(address2) || address2.length !== 42) + return false; + try { + return toChecksumAddress(address2) === address2; + } catch { + return false; + } +} +function fromPrivateKey(privateKey, strict = false) { + try { + return pkToAddress(privateKey, strict); + } catch { + return false; + } +} +function isAddress(address2) { + if (!address2 || !isString$1(address2)) + return false; + if (address2.length === 42) { + try { + return isAddress(getBase58CheckAddress(hexStr2byteArray(address2))); + } catch (err) { + return false; + } + } + try { + return isAddressValid(address2); + } catch (err) { + return false; + } +} +const address = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + ADDRESS_PREFIX, + ADDRESS_PREFIX_BYTE, + ADDRESS_PREFIX_REGEX, + ADDRESS_SIZE, + TRON_BIP39_PATH_INDEX_0, + TRON_BIP39_PATH_PREFIX, + fromHex, + fromPrivateKey, + isAddress, + isChecksumAddress, + toChecksumAddress, + toHex: toHex$1 +}, Symbol.toStringTag, { value: "Module" })); +const ALPHABET$1 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; +const ALPHABET_MAP = {}; +for (let i2 = 0; i2 < ALPHABET$1.length; i2++) + ALPHABET_MAP[ALPHABET$1.charAt(i2)] = i2; +const BASE = 58; +function encode58(buffer2) { + if (buffer2.length === 0) + return ""; + let i2; + let j2; + const digits = [0]; + for (i2 = 0; i2 < buffer2.length; i2++) { + for (j2 = 0; j2 < digits.length; j2++) + digits[j2] <<= 8; + digits[0] += buffer2[i2]; + let carry = 0; + for (j2 = 0; j2 < digits.length; ++j2) { + digits[j2] += carry; + carry = digits[j2] / BASE | 0; + digits[j2] %= BASE; + } + while (carry) { + digits.push(carry % BASE); + carry = carry / BASE | 0; + } + } + for (i2 = 0; buffer2[i2] === 0 && i2 < buffer2.length - 1; i2++) + digits.push(0); + return digits.reverse().map((digit) => ALPHABET$1[digit]).join(""); +} +function decode58(string2) { + if (string2.length === 0) + return []; + let i2; + let j2; + const bytes2 = [0]; + for (i2 = 0; i2 < string2.length; i2++) { + const c2 = string2[i2]; + if (!(c2 in ALPHABET_MAP)) + throw new Error("Non-base58 character"); + for (j2 = 0; j2 < bytes2.length; j2++) + bytes2[j2] *= BASE; + bytes2[0] += ALPHABET_MAP[c2]; + let carry = 0; + for (j2 = 0; j2 < bytes2.length; ++j2) { + bytes2[j2] += carry; + carry = bytes2[j2] >> 8; + bytes2[j2] &= 255; + } + while (carry) { + bytes2.push(carry & 255); + carry >>= 8; + } + } + for (i2 = 0; string2[i2] === "1" && i2 < string2.length - 1; i2++) + bytes2.push(0); + return bytes2.reverse(); +} +const base58 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + decode58, + encode58 +}, Symbol.toStringTag, { value: "Module" })); +function bind(fn2, thisArg) { + return function wrap2() { + return fn2.apply(thisArg, arguments); + }; +} +const { toString: toString$1 } = Object.prototype; +const { getPrototypeOf } = Object; +const kindOf = ((cache) => (thing) => { + const str = toString$1.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(/* @__PURE__ */ Object.create(null)); +const kindOfTest = (type2) => { + type2 = type2.toLowerCase(); + return (thing) => kindOf(thing) === type2; +}; +const typeOfTest = (type2) => (thing) => typeof thing === type2; +const { isArray } = Array; +const isUndefined = typeOfTest("undefined"); +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} +const isArrayBuffer = kindOfTest("ArrayBuffer"); +function isArrayBufferView(val) { + let result; + if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && isArrayBuffer(val.buffer); + } + return result; +} +const isString = typeOfTest("string"); +const isFunction = typeOfTest("function"); +const isNumber = typeOfTest("number"); +const isObject$1 = (thing) => thing !== null && typeof thing === "object"; +const isBoolean = (thing) => thing === true || thing === false; +const isPlainObject = (val) => { + if (kindOf(val) !== "object") { + return false; + } + const prototype2 = getPrototypeOf(val); + return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +}; +const isDate = kindOfTest("Date"); +const isFile = kindOfTest("File"); +const isBlob = kindOfTest("Blob"); +const isFileList = kindOfTest("FileList"); +const isStream = (val) => isObject$1(val) && isFunction(val.pipe); +const isFormData = (thing) => { + let kind; + return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance + kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]")); +}; +const isURLSearchParams = kindOfTest("URLSearchParams"); +const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); +const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); +function forEach(obj, fn2, { allOwnKeys = false } = {}) { + if (obj === null || typeof obj === "undefined") { + return; + } + let i2; + let l2; + if (typeof obj !== "object") { + obj = [obj]; + } + if (isArray(obj)) { + for (i2 = 0, l2 = obj.length; i2 < l2; i2++) { + fn2.call(null, obj[i2], i2, obj); + } + } else { + const keys2 = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys2.length; + let key2; + for (i2 = 0; i2 < len; i2++) { + key2 = keys2[i2]; + fn2.call(null, obj[key2], key2, obj); + } + } +} +function findKey(obj, key2) { + key2 = key2.toLowerCase(); + const keys2 = Object.keys(obj); + let i2 = keys2.length; + let _key; + while (i2-- > 0) { + _key = keys2[i2]; + if (key2 === _key.toLowerCase()) { + return _key; + } + } + return null; +} +const _global = (() => { + if (typeof globalThis !== "undefined") + return globalThis; + return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; +})(); +const isContextDefined = (context) => !isUndefined(context) && context !== _global; +function merge() { + const { caseless } = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key2) => { + const targetKey = caseless && findKey(result, key2) || key2; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + }; + for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) { + arguments[i2] && forEach(arguments[i2], assignValue); + } + return result; +} +const extend = (a3, b2, thisArg, { allOwnKeys } = {}) => { + forEach(b2, (val, key2) => { + if (thisArg && isFunction(val)) { + a3[key2] = bind(val, thisArg); + } else { + a3[key2] = val; + } + }, { allOwnKeys }); + return a3; +}; +const stripBOM = (content) => { + if (content.charCodeAt(0) === 65279) { + content = content.slice(1); + } + return content; +}; +const inherits = (constructor, superConstructor, props, descriptors2) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors2); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, "super", { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +}; +const toFlatObject = (sourceObj, destObj, filter2, propFilter) => { + let props; + let i2; + let prop; + const merged = {}; + destObj = destObj || {}; + if (sourceObj == null) + return destObj; + do { + props = Object.getOwnPropertyNames(sourceObj); + i2 = props.length; + while (i2-- > 0) { + prop = props[i2]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter2 !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype); + return destObj; +}; +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === void 0 || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; +const toArray = (thing) => { + if (!thing) + return null; + if (isArray(thing)) + return thing; + let i2 = thing.length; + if (!isNumber(i2)) + return null; + const arr = new Array(i2); + while (i2-- > 0) { + arr[i2] = thing[i2]; + } + return arr; +}; +const isTypedArray = ((TypedArray) => { + return (thing) => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); +const forEachEntry = (obj, fn2) => { + const generator = obj && obj[Symbol.iterator]; + const iterator = generator.call(obj); + let result; + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn2.call(obj, pair[0], pair[1]); + } +}; +const matchAll = (regExp, str) => { + let matches2; + const arr = []; + while ((matches2 = regExp.exec(str)) !== null) { + arr.push(matches2); + } + return arr; +}; +const isHTMLForm = kindOfTest("HTMLFormElement"); +const toCamelCase = (str) => { + return str.toLowerCase().replace( + /[-_\s]([a-z\d])(\w*)/g, + function replacer(m3, p1, p22) { + return p1.toUpperCase() + p22; + } + ); +}; +const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); +const isRegExp = kindOfTest("RegExp"); +const reduceDescriptors = (obj, reducer) => { + const descriptors2 = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + forEach(descriptors2, (descriptor, name2) => { + let ret; + if ((ret = reducer(descriptor, name2, obj)) !== false) { + reducedDescriptors[name2] = ret || descriptor; + } + }); + Object.defineProperties(obj, reducedDescriptors); +}; +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name2) => { + if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name2) !== -1) { + return false; + } + const value = obj[name2]; + if (!isFunction(value)) + return; + descriptor.enumerable = false; + if ("writable" in descriptor) { + descriptor.writable = false; + return; + } + if (!descriptor.set) { + descriptor.set = () => { + throw Error("Can not rewrite read-only method '" + name2 + "'"); + }; + } + }); +}; +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + const define2 = (arr) => { + arr.forEach((value) => { + obj[value] = true; + }); + }; + isArray(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter)); + return obj; +}; +const noop = () => { +}; +const toFiniteNumber = (value, defaultValue) => { + return value != null && Number.isFinite(value = +value) ? value : defaultValue; +}; +const ALPHA = "abcdefghijklmnopqrstuvwxyz"; +const DIGIT = "0123456789"; +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +}; +const generateString = (size2 = 16, alphabet2 = ALPHABET.ALPHA_DIGIT) => { + let str = ""; + const { length } = alphabet2; + while (size2--) { + str += alphabet2[Math.random() * length | 0]; + } + return str; +}; +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]); +} +const toJSONObject = (obj) => { + const stack = new Array(10); + const visit = (source, i2) => { + if (isObject$1(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + if (!("toJSON" in source)) { + stack[i2] = source; + const target = isArray(source) ? [] : {}; + forEach(source, (value, key2) => { + const reducedValue = visit(value, i2 + 1); + !isUndefined(reducedValue) && (target[key2] = reducedValue); + }); + stack[i2] = void 0; + return target; + } + } + return source; + }; + return visit(obj, 0); +}; +const isAsyncFn = kindOfTest("AsyncFunction"); +const isThenable = (thing) => thing && (isObject$1(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); +const _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) { + return setImmediate; + } + return postMessageSupported ? ((token2, callbacks) => { + _global.addEventListener("message", ({ source, data }) => { + if (source === _global && data === token2) { + callbacks.length && callbacks.shift()(); + } + }, false); + return (cb2) => { + callbacks.push(cb2); + _global.postMessage(token2, "*"); + }; + })(`axios@${Math.random()}`, []) : (cb2) => setTimeout(cb2); +})( + typeof setImmediate === "function", + isFunction(_global.postMessage) +); +const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; +const utils$5 = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject: isObject$1, + isPlainObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, + // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable, + setImmediate: _setImmediate, + asap +}; +function AxiosError(message2, code2, config2, request, response) { + Error.call(this); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack; + } + this.message = message2; + this.name = "AxiosError"; + code2 && (this.code = code2); + config2 && (this.config = config2); + request && (this.request = request); + response && (this.response = response); +} +utils$5.inherits(AxiosError, Error, { + toJSON: function toJSON2() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$5.toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); +const prototype$1 = AxiosError.prototype; +const descriptors = {}; +[ + "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", + "ERR_NOT_SUPPORT", + "ERR_INVALID_URL" + // eslint-disable-next-line func-names +].forEach((code2) => { + descriptors[code2] = { value: code2 }; +}); +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype$1, "isAxiosError", { value: true }); +AxiosError.from = (error, code2, config2, request, response, customProps) => { + const axiosError = Object.create(prototype$1); + utils$5.toFlatObject(error, axiosError, function filter2(obj) { + return obj !== Error.prototype; + }, (prop) => { + return prop !== "isAxiosError"; + }); + AxiosError.call(axiosError, error.message, code2, config2, request, response); + axiosError.cause = error; + axiosError.name = error.name; + customProps && Object.assign(axiosError, customProps); + return axiosError; +}; +const httpAdapter = null; +function isVisitable(thing) { + return utils$5.isPlainObject(thing) || utils$5.isArray(thing); +} +function removeBrackets(key2) { + return utils$5.endsWith(key2, "[]") ? key2.slice(0, -2) : key2; +} +function renderKey(path, key2, dots) { + if (!path) + return key2; + return path.concat(key2).map(function each(token2, i2) { + token2 = removeBrackets(token2); + return !dots && i2 ? "[" + token2 + "]" : token2; + }).join(dots ? "." : ""); +} +function isFlatArray(arr) { + return utils$5.isArray(arr) && !arr.some(isVisitable); +} +const predicates = utils$5.toFlatObject(utils$5, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); +function toFormData(obj, formData, options) { + if (!utils$5.isObject(obj)) { + throw new TypeError("target must be an object"); + } + formData = formData || new FormData(); + options = utils$5.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + return !utils$5.isUndefined(source[option]); + }); + const metaTokens = options.metaTokens; + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; + const useBlob = _Blob && utils$5.isSpecCompliantForm(formData); + if (!utils$5.isFunction(visitor)) { + throw new TypeError("visitor must be a function"); + } + function convertValue(value) { + if (value === null) + return ""; + if (utils$5.isDate(value)) { + return value.toISOString(); + } + if (!useBlob && utils$5.isBlob(value)) { + throw new AxiosError("Blob is not supported. Use a Buffer instead."); + } + if (utils$5.isArrayBuffer(value) || utils$5.isTypedArray(value)) { + return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); + } + return value; + } + function defaultVisitor(value, key2, path) { + let arr = value; + if (value && !path && typeof value === "object") { + if (utils$5.endsWith(key2, "{}")) { + key2 = metaTokens ? key2 : key2.slice(0, -2); + value = JSON.stringify(value); + } else if (utils$5.isArray(value) && isFlatArray(value) || (utils$5.isFileList(value) || utils$5.endsWith(key2, "[]")) && (arr = utils$5.toArray(value))) { + key2 = removeBrackets(key2); + arr.forEach(function each(el2, index2) { + !(utils$5.isUndefined(el2) || el2 === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key2], index2, dots) : indexes === null ? key2 : key2 + "[]", + convertValue(el2) + ); + }); + return false; + } + } + if (isVisitable(value)) { + return true; + } + formData.append(renderKey(path, key2, dots), convertValue(value)); + return false; + } + const stack = []; + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + function build(value, path) { + if (utils$5.isUndefined(value)) + return; + if (stack.indexOf(value) !== -1) { + throw Error("Circular reference detected in " + path.join(".")); + } + stack.push(value); + utils$5.forEach(value, function each(el2, key2) { + const result = !(utils$5.isUndefined(el2) || el2 === null) && visitor.call( + formData, + el2, + utils$5.isString(key2) ? key2.trim() : key2, + path, + exposedHelpers + ); + if (result === true) { + build(el2, path ? path.concat(key2) : [key2]); + } + }); + stack.pop(); + } + if (!utils$5.isObject(obj)) { + throw new TypeError("data must be an object"); + } + build(obj); + return formData; +} +function encode$1(str) { + const charMap = { + "!": "%21", + "'": "%27", + "(": "%28", + ")": "%29", + "~": "%7E", + "%20": "+", + "%00": "\0" + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} +function AxiosURLSearchParams(params, options) { + this._pairs = []; + params && toFormData(params, this, options); +} +const prototype = AxiosURLSearchParams.prototype; +prototype.append = function append(name2, value) { + this._pairs.push([name2, value]); +}; +prototype.toString = function toString2(encoder2) { + const _encode4 = encoder2 ? function(value) { + return encoder2.call(this, value, encode$1); + } : encode$1; + return this._pairs.map(function each(pair) { + return _encode4(pair[0]) + "=" + _encode4(pair[1]); + }, "").join("&"); +}; +function encode3(val) { + return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); +} +function buildURL(url, params, options) { + if (!params) { + return url; + } + const _encode4 = options && options.encode || encode3; + const serializeFn = options && options.serialize; + let serializedParams; + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$5.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode4); + } + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; + } + return url; +} +class InterceptorManager { + constructor() { + this.handlers = []; + } + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id2) { + if (this.handlers[id2]) { + this.handlers[id2] = null; + } + } + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn2) { + utils$5.forEach(this.handlers, function forEachHandler(h4) { + if (h4 !== null) { + fn2(h4); + } + }); + } +} +const InterceptorManager$1 = InterceptorManager; +const transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; +const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams; +const FormData$1 = typeof FormData !== "undefined" ? FormData : null; +const Blob$1 = typeof Blob !== "undefined" ? Blob : null; +const platform$1 = { + isBrowser: true, + classes: { + URLSearchParams: URLSearchParams$1, + FormData: FormData$1, + Blob: Blob$1 + }, + protocols: ["http", "https", "file", "blob", "url", "data"] +}; +const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; +const hasStandardBrowserEnv = ((product) => { + return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0; +})(typeof navigator !== "undefined" && navigator.product); +const hasStandardBrowserWebWorkerEnv = (() => { + return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; +})(); +const origin = hasBrowserEnv && window.location.href || "http://localhost"; +const utils$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + hasBrowserEnv, + hasStandardBrowserEnv, + hasStandardBrowserWebWorkerEnv, + origin +}, Symbol.toStringTag, { value: "Module" })); +const platform = { + ...utils$4, + ...platform$1 +}; +function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ + visitor: function(value, key2, path, helpers) { + if (platform.isNode && utils$5.isBuffer(value)) { + this.append(key2, value.toString("base64")); + return false; + } + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} +function parsePropPath(name2) { + return utils$5.matchAll(/\w+|\[(\w*)]/g, name2).map((match) => { + return match[0] === "[]" ? "" : match[1] || match[0]; + }); +} +function arrayToObject(arr) { + const obj = {}; + const keys2 = Object.keys(arr); + let i2; + const len = keys2.length; + let key2; + for (i2 = 0; i2 < len; i2++) { + key2 = keys2[i2]; + obj[key2] = arr[key2]; + } + return obj; +} +function formDataToJSON(formData) { + function buildPath(path, value, target, index2) { + let name2 = path[index2++]; + if (name2 === "__proto__") + return true; + const isNumericKey = Number.isFinite(+name2); + const isLast = index2 >= path.length; + name2 = !name2 && utils$5.isArray(target) ? target.length : name2; + if (isLast) { + if (utils$5.hasOwnProp(target, name2)) { + target[name2] = [target[name2], value]; + } else { + target[name2] = value; + } + return !isNumericKey; + } + if (!target[name2] || !utils$5.isObject(target[name2])) { + target[name2] = []; + } + const result = buildPath(path, value, target[name2], index2); + if (result && utils$5.isArray(target[name2])) { + target[name2] = arrayToObject(target[name2]); + } + return !isNumericKey; + } + if (utils$5.isFormData(formData) && utils$5.isFunction(formData.entries)) { + const obj = {}; + utils$5.forEachEntry(formData, (name2, value) => { + buildPath(parsePropPath(name2), value, obj, 0); + }); + return obj; + } + return null; +} +function stringifySafely(rawValue, parser, encoder2) { + if (utils$5.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$5.trim(rawValue); + } catch (e18) { + if (e18.name !== "SyntaxError") { + throw e18; + } + } + } + return (encoder2 || JSON.stringify)(rawValue); +} +const defaults = { + transitional: transitionalDefaults, + adapter: ["xhr", "http", "fetch"], + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ""; + const hasJSONContentType = contentType.indexOf("application/json") > -1; + const isObjectPayload = utils$5.isObject(data); + if (isObjectPayload && utils$5.isHTMLForm(data)) { + data = new FormData(data); + } + const isFormData2 = utils$5.isFormData(data); + if (isFormData2) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + if (utils$5.isArrayBuffer(data) || utils$5.isBuffer(data) || utils$5.isStream(data) || utils$5.isFile(data) || utils$5.isBlob(data) || utils$5.isReadableStream(data)) { + return data; + } + if (utils$5.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$5.isURLSearchParams(data)) { + headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); + return data.toString(); + } + let isFileList2; + if (isObjectPayload) { + if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + if ((isFileList2 = utils$5.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { + const _FormData = this.env && this.env.FormData; + return toFormData( + isFileList2 ? { "files[]": data } : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + if (isObjectPayload || hasJSONContentType) { + headers.setContentType("application/json", false); + return stringifySafely(data); + } + return data; + }], + transformResponse: [function transformResponse(data) { + const transitional2 = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing; + const JSONRequested = this.responseType === "json"; + if (utils$5.isResponse(data) || utils$5.isReadableStream(data)) { + return data; + } + if (data && utils$5.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { + const silentJSONParsing = transitional2 && transitional2.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + try { + return JSON.parse(data); + } catch (e18) { + if (strictJSONParsing) { + if (e18.name === "SyntaxError") { + throw AxiosError.from(e18, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e18; + } + } + } + return data; + }], + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + xsrfCookieName: "XSRF-TOKEN", + xsrfHeaderName: "X-XSRF-TOKEN", + maxContentLength: -1, + maxBodyLength: -1, + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + headers: { + common: { + "Accept": "application/json, text/plain, */*", + "Content-Type": void 0 + } + } +}; +utils$5.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { + defaults.headers[method] = {}; +}); +const defaults$1 = defaults; +const ignoreDuplicateOf = utils$5.toObjectSet([ + "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" +]); +const parseHeaders = (rawHeaders) => { + const parsed = {}; + let key2; + let val; + let i2; + rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { + i2 = line.indexOf(":"); + key2 = line.substring(0, i2).trim().toLowerCase(); + val = line.substring(i2 + 1).trim(); + if (!key2 || parsed[key2] && ignoreDuplicateOf[key2]) { + return; + } + if (key2 === "set-cookie") { + if (parsed[key2]) { + parsed[key2].push(val); + } else { + parsed[key2] = [val]; + } + } else { + parsed[key2] = parsed[key2] ? parsed[key2] + ", " + val : val; + } + }); + return parsed; +}; +const $internals = Symbol("internals"); +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + return utils$5.isArray(value) ? value.map(normalizeValue) : String(value); +} +function parseTokens(str) { + const tokens = /* @__PURE__ */ Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + while (match = tokensRE.exec(str)) { + tokens[match[1]] = match[2]; + } + return tokens; +} +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); +function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) { + if (utils$5.isFunction(filter2)) { + return filter2.call(this, value, header); + } + if (isHeaderNameFilter) { + value = header; + } + if (!utils$5.isString(value)) + return; + if (utils$5.isString(filter2)) { + return value.indexOf(filter2) !== -1; + } + if (utils$5.isRegExp(filter2)) { + return filter2.test(value); + } +} +function formatHeader(header) { + return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w2, char, str) => { + return char.toUpperCase() + str; + }); +} +function buildAccessors(obj, header) { + const accessorName = utils$5.toCamelCase(" " + header); + ["get", "set", "has"].forEach((methodName) => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + set(header, valueOrRewrite, rewrite) { + const self2 = this; + function setHeader(_value2, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + if (!lHeader) { + throw new Error("header name must be a non-empty string"); + } + const key2 = utils$5.findKey(self2, lHeader); + if (!key2 || self2[key2] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key2] !== false) { + self2[key2 || _header] = normalizeValue(_value2); + } + } + const setHeaders = (headers, _rewrite) => utils$5.forEach(headers, (_value2, _header) => setHeader(_value2, _header, _rewrite)); + if (utils$5.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if (utils$5.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else if (utils$5.isHeaders(header)) { + for (const [key2, value] of header.entries()) { + setHeader(value, key2, rewrite); + } + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + return this; + } + get(header, parser) { + header = normalizeHeader(header); + if (header) { + const key2 = utils$5.findKey(this, header); + if (key2) { + const value = this[key2]; + if (!parser) { + return value; + } + if (parser === true) { + return parseTokens(value); + } + if (utils$5.isFunction(parser)) { + return parser.call(this, value, key2); + } + if (utils$5.isRegExp(parser)) { + return parser.exec(value); + } + throw new TypeError("parser must be boolean|regexp|function"); + } + } + } + has(header, matcher) { + header = normalizeHeader(header); + if (header) { + const key2 = utils$5.findKey(this, header); + return !!(key2 && this[key2] !== void 0 && (!matcher || matchHeaderValue(this, this[key2], key2, matcher))); + } + return false; + } + delete(header, matcher) { + const self2 = this; + let deleted = false; + function deleteHeader(_header) { + _header = normalizeHeader(_header); + if (_header) { + const key2 = utils$5.findKey(self2, _header); + if (key2 && (!matcher || matchHeaderValue(self2, self2[key2], key2, matcher))) { + delete self2[key2]; + deleted = true; + } + } + } + if (utils$5.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + return deleted; + } + clear(matcher) { + const keys2 = Object.keys(this); + let i2 = keys2.length; + let deleted = false; + while (i2--) { + const key2 = keys2[i2]; + if (!matcher || matchHeaderValue(this, this[key2], key2, matcher, true)) { + delete this[key2]; + deleted = true; + } + } + return deleted; + } + normalize(format2) { + const self2 = this; + const headers = {}; + utils$5.forEach(this, (value, header) => { + const key2 = utils$5.findKey(headers, header); + if (key2) { + self2[key2] = normalizeValue(value); + delete self2[header]; + return; + } + const normalized = format2 ? formatHeader(header) : String(header).trim(); + if (normalized !== header) { + delete self2[header]; + } + self2[normalized] = normalizeValue(value); + headers[normalized] = true; + }); + return this; + } + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + toJSON(asStrings) { + const obj = /* @__PURE__ */ Object.create(null); + utils$5.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$5.isArray(value) ? value.join(", ") : value); + }); + return obj; + } + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); + } + get [Symbol.toStringTag]() { + return "AxiosHeaders"; + } + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + static concat(first, ...targets) { + const computed = new this(first); + targets.forEach((target) => computed.set(target)); + return computed; + } + static accessor(header) { + const internals = this[$internals] = this[$internals] = { + accessors: {} + }; + const accessors = internals.accessors; + const prototype2 = this.prototype; + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + if (!accessors[lHeader]) { + buildAccessors(prototype2, _header); + accessors[lHeader] = true; + } + } + utils$5.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + return this; + } +} +AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); +utils$5.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key2) => { + let mapped = key2[0].toUpperCase() + key2.slice(1); + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + }; +}); +utils$5.freezeMethods(AxiosHeaders); +const AxiosHeaders$1 = AxiosHeaders; +function transformData(fns, response) { + const config2 = this || defaults$1; + const context = response || config2; + const headers = AxiosHeaders$1.from(context.headers); + let data = context.data; + utils$5.forEach(fns, function transform(fn2) { + data = fn2.call(config2, data, headers.normalize(), response ? response.status : void 0); + }); + headers.normalize(); + return data; +} +function isCancel(value) { + return !!(value && value.__CANCEL__); +} +function CanceledError(message2, config2, request) { + AxiosError.call(this, message2 == null ? "canceled" : message2, AxiosError.ERR_CANCELED, config2, request); + this.name = "CanceledError"; +} +utils$5.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); +function settle(resolve, reject, response) { + const validateStatus2 = response.config.validateStatus; + if (!response.status || !validateStatus2 || validateStatus2(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + "Request failed with status code " + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ""; +} +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes2 = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + min = min !== void 0 ? min : 1e3; + return function push(chunkLength) { + const now = Date.now(); + const startedAt = timestamps[tail]; + if (!firstSampleTS) { + firstSampleTS = now; + } + bytes2[head] = chunkLength; + timestamps[head] = now; + let i2 = tail; + let bytesCount = 0; + while (i2 !== head) { + bytesCount += bytes2[i2++]; + i2 = i2 % samplesCount; + } + head = (head + 1) % samplesCount; + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + if (now - firstSampleTS < min) { + return; + } + const passed = startedAt && now - startedAt; + return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; + }; +} +function throttle(fn2, freq) { + let timestamp = 0; + let threshold = 1e3 / freq; + let lastArgs; + let timer2; + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer2) { + clearTimeout(timer2); + timer2 = null; + } + fn2.apply(null, args); + }; + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if (passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer2) { + timer2 = setTimeout(() => { + timer2 = null; + invoke(lastArgs); + }, threshold - passed); + } + } + }; + const flush = () => lastArgs && invoke(lastArgs); + return [throttled, flush]; +} +const progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + return throttle((e18) => { + const loaded = e18.loaded; + const total = e18.lengthComputable ? e18.total : void 0; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange2 = loaded <= total; + bytesNotified = loaded; + const data = { + loaded, + total, + progress: total ? loaded / total : void 0, + bytes: progressBytes, + rate: rate ? rate : void 0, + estimated: rate && total && inRange2 ? (total - loaded) / rate : void 0, + event: e18, + lengthComputable: total != null, + [isDownloadStream ? "download" : "upload"]: true + }; + listener(data); + }, freq); +}; +const progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + return [(loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), throttled[1]]; +}; +const asyncDecorator = (fn2) => (...args) => utils$5.asap(() => fn2(...args)); +const isURLSameOrigin = platform.hasStandardBrowserEnv ? ( + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement("a"); + let originURL; + function resolveURL(url) { + let href = url; + if (msie) { + urlParsingNode.setAttribute("href", href); + href = urlParsingNode.href; + } + urlParsingNode.setAttribute("href", href); + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "", + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "", + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "", + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname + }; + } + originURL = resolveURL(window.location.href); + return function isURLSameOrigin2(requestURL) { + const parsed = utils$5.isString(requestURL) ? resolveURL(requestURL) : requestURL; + return parsed.protocol === originURL.protocol && parsed.host === originURL.host; + }; + }() +) : ( + // Non standard browser envs (web workers, react-native) lack needed support. + function nonStandardBrowserEnv() { + return function isURLSameOrigin2() { + return true; + }; + }() +); +const cookies = platform.hasStandardBrowserEnv ? ( + // Standard browser envs support document.cookie + { + write(name2, value, expires, path, domain, secure) { + const cookie = [name2 + "=" + encodeURIComponent(value)]; + utils$5.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString()); + utils$5.isString(path) && cookie.push("path=" + path); + utils$5.isString(domain) && cookie.push("domain=" + domain); + secure === true && cookie.push("secure"); + document.cookie = cookie.join("; "); + }, + read(name2) { + const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)")); + return match ? decodeURIComponent(match[3]) : null; + }, + remove(name2) { + this.write(name2, "", Date.now() - 864e5); + } + } +) : ( + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() { + }, + read() { + return null; + }, + remove() { + } + } +); +function isAbsoluteURL(url) { + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} +function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; +} +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} +const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; +function mergeConfig(config1, config2) { + config2 = config2 || {}; + const config3 = {}; + function getMergedValue(target, source, caseless) { + if (utils$5.isPlainObject(target) && utils$5.isPlainObject(source)) { + return utils$5.merge.call({ caseless }, target, source); + } else if (utils$5.isPlainObject(source)) { + return utils$5.merge({}, source); + } else if (utils$5.isArray(source)) { + return source.slice(); + } + return source; + } + function mergeDeepProperties(a3, b2, caseless) { + if (!utils$5.isUndefined(b2)) { + return getMergedValue(a3, b2, caseless); + } else if (!utils$5.isUndefined(a3)) { + return getMergedValue(void 0, a3, caseless); + } + } + function valueFromConfig2(a3, b2) { + if (!utils$5.isUndefined(b2)) { + return getMergedValue(void 0, b2); + } + } + function defaultToConfig2(a3, b2) { + if (!utils$5.isUndefined(b2)) { + return getMergedValue(void 0, b2); + } else if (!utils$5.isUndefined(a3)) { + return getMergedValue(void 0, a3); + } + } + function mergeDirectKeys(a3, b2, prop) { + if (prop in config2) { + return getMergedValue(a3, b2); + } else if (prop in config1) { + return getMergedValue(void 0, a3); + } + } + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a3, b2) => mergeDeepProperties(headersToObject(a3), headersToObject(b2), true) + }; + utils$5.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge2 = mergeMap[prop] || mergeDeepProperties; + const configValue = merge2(config1[prop], config2[prop], prop); + utils$5.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config3[prop] = configValue); + }); + return config3; +} +const resolveConfig = (config2) => { + const newConfig = mergeConfig({}, config2); + let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; + newConfig.headers = headers = AxiosHeaders$1.from(headers); + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config2.params, config2.paramsSerializer); + if (auth) { + headers.set( + "Authorization", + "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) + ); + } + let contentType; + if (utils$5.isFormData(data)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + headers.setContentType(void 0); + } else if ((contentType = headers.getContentType()) !== false) { + const [type2, ...tokens] = contentType ? contentType.split(";").map((token2) => token2.trim()).filter(Boolean) : []; + headers.setContentType([type2 || "multipart/form-data", ...tokens].join("; ")); + } + } + if (platform.hasStandardBrowserEnv) { + withXSRFToken && utils$5.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); + if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } + return newConfig; +}; +const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; +const xhrAdapter = isXHRAdapterSupported && function(config2) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + const _config = resolveConfig(config2); + let requestData = _config.data; + const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); + let { responseType, onUploadProgress, onDownloadProgress } = _config; + let onCanceled; + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload; + function done() { + flushUpload && flushUpload(); + flushDownload && flushDownload(); + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + _config.signal && _config.signal.removeEventListener("abort", onCanceled); + } + let request = new XMLHttpRequest(); + request.open(_config.method.toUpperCase(), _config.url, true); + request.timeout = _config.timeout; + function onloadend() { + if (!request) { + return; + } + const responseHeaders = AxiosHeaders$1.from( + "getAllResponseHeaders" in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config2, + request + }; + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + request = null; + } + if ("onloadend" in request) { + request.onloadend = onloadend; + } else { + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { + return; + } + setTimeout(onloadend); + }; + } + request.onabort = function handleAbort() { + if (!request) { + return; + } + reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config2, request)); + request = null; + }; + request.onerror = function handleError() { + reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config2, request)); + request = null; + }; + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; + const transitional2 = _config.transitional || transitionalDefaults; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional2.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config2, + request + )); + request = null; + }; + requestData === void 0 && requestHeaders.setContentType(null); + if ("setRequestHeader" in request) { + utils$5.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key2) { + request.setRequestHeader(key2, val); + }); + } + if (!utils$5.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; + } + if (responseType && responseType !== "json") { + request.responseType = _config.responseType; + } + if (onDownloadProgress) { + [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); + request.addEventListener("progress", downloadThrottled); + } + if (onUploadProgress && request.upload) { + [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); + request.upload.addEventListener("progress", uploadThrottled); + request.upload.addEventListener("loadend", flushUpload); + } + if (_config.cancelToken || _config.signal) { + onCanceled = (cancel) => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config2, request) : cancel); + request.abort(); + request = null; + }; + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); + } + } + const protocol = parseProtocol(_config.url); + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config2)); + return; + } + request.send(requestData || null); + }); +}; +const composeSignals = (signals, timeout) => { + let controller = new AbortController(); + let aborted; + const onabort = function(cancel) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = cancel instanceof Error ? cancel : this.reason; + controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + } + }; + let timer2 = timeout && setTimeout(() => { + onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); + }, timeout); + const unsubscribe = () => { + if (signals) { + timer2 && clearTimeout(timer2); + timer2 = null; + signals.forEach((signal2) => { + signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort)); + }); + signals = null; + } + }; + signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort)); + const { signal } = controller; + signal.unsubscribe = unsubscribe; + return [signal, () => { + timer2 && clearTimeout(timer2); + timer2 = null; + }]; +}; +const composeSignals$1 = composeSignals; +const streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + let pos = 0; + let end; + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } +}; +const readBytes = async function* (iterable, chunkSize, encode5) { + for await (const chunk of iterable) { + yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : await encode5(String(chunk)), chunkSize); + } +}; +const trackStream = (stream2, chunkSize, onProgress, onFinish, encode5) => { + const iterator = readBytes(stream2, chunkSize, encode5); + let bytes2 = 0; + let done; + let _onFinish = (e18) => { + if (!done) { + done = true; + onFinish && onFinish(e18); + } + }; + return new ReadableStream({ + async pull(controller) { + try { + const { done: done2, value } = await iterator.next(); + if (done2) { + _onFinish(); + controller.close(); + return; + } + let len = value.byteLength; + if (onProgress) { + let loadedBytes = bytes2 += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + }, + cancel(reason) { + _onFinish(reason); + return iterator.return(); + } + }, { + highWaterMark: 2 + }); +}; +const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function"; +const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function"; +const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder2) => (str) => encoder2.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer())); +const test = (fn2, ...args) => { + try { + return !!fn2(...args); + } catch (e18) { + return false; + } +}; +const supportsRequestStream = isReadableStreamSupported && test(() => { + let duplexAccessed = false; + const hasContentType = new Request(platform.origin, { + body: new ReadableStream(), + method: "POST", + get duplex() { + duplexAccessed = true; + return "half"; + } + }).headers.has("Content-Type"); + return duplexAccessed && !hasContentType; +}); +const DEFAULT_CHUNK_SIZE = 64 * 1024; +const supportsResponseStream = isReadableStreamSupported && test(() => utils$5.isReadableStream(new Response("").body)); +const resolvers = { + stream: supportsResponseStream && ((res) => res.body) +}; +isFetchSupported && ((res) => { + ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type2) => { + !resolvers[type2] && (resolvers[type2] = utils$5.isFunction(res[type2]) ? (res2) => res2[type2]() : (_3, config2) => { + throw new AxiosError(`Response type '${type2}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config2); + }); + }); +})(new Response()); +const getBodyLength = async (body) => { + if (body == null) { + return 0; + } + if (utils$5.isBlob(body)) { + return body.size; + } + if (utils$5.isSpecCompliantForm(body)) { + return (await new Request(body).arrayBuffer()).byteLength; + } + if (utils$5.isArrayBufferView(body) || utils$5.isArrayBuffer(body)) { + return body.byteLength; + } + if (utils$5.isURLSearchParams(body)) { + body = body + ""; + } + if (utils$5.isString(body)) { + return (await encodeText(body)).byteLength; + } +}; +const resolveBodyLength = async (headers, body) => { + const length = utils$5.toFiniteNumber(headers.getContentLength()); + return length == null ? getBodyLength(body) : length; +}; +const fetchAdapter = isFetchSupported && (async (config2) => { + let { + url, + method, + data, + signal, + cancelToken, + timeout, + onDownloadProgress, + onUploadProgress, + responseType, + headers, + withCredentials = "same-origin", + fetchOptions + } = resolveConfig(config2); + responseType = responseType ? (responseType + "").toLowerCase() : "text"; + let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals$1([signal, cancelToken], timeout) : []; + let finished2, request; + const onFinish = () => { + !finished2 && setTimeout(() => { + composedSignal && composedSignal.unsubscribe(); + }); + finished2 = true; + }; + let requestContentLength; + try { + if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { + let _request = new Request(url, { + method: "POST", + body: data, + duplex: "half" + }); + let contentTypeHeader; + if (utils$5.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { + headers.setContentType(contentTypeHeader); + } + if (_request.body) { + const [onProgress, flush] = progressEventDecorator( + requestContentLength, + progressEventReducer(asyncDecorator(onUploadProgress)) + ); + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText); + } + } + if (!utils$5.isString(withCredentials)) { + withCredentials = withCredentials ? "include" : "omit"; + } + request = new Request(url, { + ...fetchOptions, + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: withCredentials + }); + let response = await fetch(request); + const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); + if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) { + const options = {}; + ["status", "statusText", "headers"].forEach((prop) => { + options[prop] = response[prop]; + }); + const responseContentLength = utils$5.toFiniteNumber(response.headers.get("content-length")); + const [onProgress, flush] = onDownloadProgress && progressEventDecorator( + responseContentLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true) + ) || []; + response = new Response( + trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + flush && flush(); + isStreamResponse && onFinish(); + }, encodeText), + options + ); + } + responseType = responseType || "text"; + let responseData = await resolvers[utils$5.findKey(resolvers, responseType) || "text"](response, config2); + !isStreamResponse && onFinish(); + stopTimeout && stopTimeout(); + return await new Promise((resolve, reject) => { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders$1.from(response.headers), + status: response.status, + statusText: response.statusText, + config: config2, + request + }); + }); + } catch (err) { + onFinish(); + if (err && err.name === "TypeError" && /fetch/i.test(err.message)) { + throw Object.assign( + new AxiosError("Network Error", AxiosError.ERR_NETWORK, config2, request), + { + cause: err.cause || err + } + ); + } + throw AxiosError.from(err, err && err.code, config2, request); + } +}); +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter, + fetch: fetchAdapter +}; +utils$5.forEach(knownAdapters, (fn2, value) => { + if (fn2) { + try { + Object.defineProperty(fn2, "name", { value }); + } catch (e18) { + } + Object.defineProperty(fn2, "adapterName", { value }); + } +}); +const renderReason = (reason) => `- ${reason}`; +const isResolvedHandle = (adapter) => utils$5.isFunction(adapter) || adapter === null || adapter === false; +const adapters = { + getAdapter: (adapters2) => { + adapters2 = utils$5.isArray(adapters2) ? adapters2 : [adapters2]; + const { length } = adapters2; + let nameOrAdapter; + let adapter; + const rejectedReasons = {}; + for (let i2 = 0; i2 < length; i2++) { + nameOrAdapter = adapters2[i2]; + let id2; + adapter = nameOrAdapter; + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id2 = String(nameOrAdapter)).toLowerCase()]; + if (adapter === void 0) { + throw new AxiosError(`Unknown adapter '${id2}'`); + } + } + if (adapter) { + break; + } + rejectedReasons[id2 || "#" + i2] = adapter; + } + if (!adapter) { + const reasons = Object.entries(rejectedReasons).map( + ([id2, state]) => `adapter ${id2} ` + (state === false ? "is not supported by the environment" : "is not available in the build") + ); + let s2 = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; + throw new AxiosError( + `There is no suitable adapter to dispatch the request ` + s2, + "ERR_NOT_SUPPORT" + ); + } + return adapter; + }, + adapters: knownAdapters +}; +function throwIfCancellationRequested(config2) { + if (config2.cancelToken) { + config2.cancelToken.throwIfRequested(); + } + if (config2.signal && config2.signal.aborted) { + throw new CanceledError(null, config2); + } +} +function dispatchRequest(config2) { + throwIfCancellationRequested(config2); + config2.headers = AxiosHeaders$1.from(config2.headers); + config2.data = transformData.call( + config2, + config2.transformRequest + ); + if (["post", "put", "patch"].indexOf(config2.method) !== -1) { + config2.headers.setContentType("application/x-www-form-urlencoded", false); + } + const adapter = adapters.getAdapter(config2.adapter || defaults$1.adapter); + return adapter(config2).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config2); + response.data = transformData.call( + config2, + config2.transformResponse, + response + ); + response.headers = AxiosHeaders$1.from(response.headers); + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config2); + if (reason && reason.response) { + reason.response.data = transformData.call( + config2, + config2.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + } + } + return Promise.reject(reason); + }); +} +const VERSION = "1.7.4"; +const validators$1 = {}; +["object", "boolean", "number", "function", "string", "symbol"].forEach((type2, i2) => { + validators$1[type2] = function validator2(thing) { + return typeof thing === type2 || "a" + (i2 < 1 ? "n " : " ") + type2; + }; +}); +const deprecatedWarnings = {}; +validators$1.transitional = function transitional(validator2, version2, message2) { + function formatMessage(opt, desc) { + return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message2 ? ". " + message2 : ""); + } + return (value, opt, opts) => { + if (validator2 === false) { + throw new AxiosError( + formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")), + AxiosError.ERR_DEPRECATED + ); + } + if (version2 && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + console.warn( + formatMessage( + opt, + " has been deprecated since v" + version2 + " and will be removed in the near future" + ) + ); + } + return validator2 ? validator2(value, opt, opts) : true; + }; +}; +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== "object") { + throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys2 = Object.keys(options); + let i2 = keys2.length; + while (i2-- > 0) { + const opt = keys2[i2]; + const validator2 = schema[opt]; + if (validator2) { + const value = options[opt]; + const result = value === void 0 || validator2(value, opt, options); + if (result !== true) { + throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION); + } + } +} +const validator = { + assertOptions, + validators: validators$1 +}; +const validators = validator.validators; +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config2) { + try { + return await this._request(configOrUrl, config2); + } catch (err) { + if (err instanceof Error) { + let dummy; + Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error(); + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; + try { + if (!err.stack) { + err.stack = stack; + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { + err.stack += "\n" + stack; + } + } catch (e18) { + } + } + throw err; + } + } + _request(configOrUrl, config2) { + if (typeof configOrUrl === "string") { + config2 = config2 || {}; + config2.url = configOrUrl; + } else { + config2 = configOrUrl || {}; + } + config2 = mergeConfig(this.defaults, config2); + const { transitional: transitional2, paramsSerializer, headers } = config2; + if (transitional2 !== void 0) { + validator.assertOptions(transitional2, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + if (paramsSerializer != null) { + if (utils$5.isFunction(paramsSerializer)) { + config2.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + config2.method = (config2.method || this.defaults.method || "get").toLowerCase(); + let contextHeaders = headers && utils$5.merge( + headers.common, + headers[config2.method] + ); + headers && utils$5.forEach( + ["delete", "get", "head", "post", "put", "patch", "common"], + (method) => { + delete headers[method]; + } + ); + config2.headers = AxiosHeaders$1.concat(contextHeaders, headers); + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) { + return; + } + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + let promise; + let i2 = 0; + let len; + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), void 0]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + promise = Promise.resolve(config2); + while (i2 < len) { + promise = promise.then(chain[i2++], chain[i2++]); + } + return promise; + } + len = requestInterceptorChain.length; + let newConfig = config2; + i2 = 0; + while (i2 < len) { + const onFulfilled = requestInterceptorChain[i2++]; + const onRejected = requestInterceptorChain[i2++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + i2 = 0; + len = responseInterceptorChain.length; + while (i2 < len) { + promise = promise.then(responseInterceptorChain[i2++], responseInterceptorChain[i2++]); + } + return promise; + } + getUri(config2) { + config2 = mergeConfig(this.defaults, config2); + const fullPath = buildFullPath(config2.baseURL, config2.url); + return buildURL(fullPath, config2.params, config2.paramsSerializer); + } +} +utils$5.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { + Axios.prototype[method] = function(url, config2) { + return this.request(mergeConfig(config2 || {}, { + method, + url, + data: (config2 || {}).data + })); + }; +}); +utils$5.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config2) { + return this.request(mergeConfig(config2 || {}, { + method, + headers: isForm ? { + "Content-Type": "multipart/form-data" + } : {}, + url, + data + })); + }; + } + Axios.prototype[method] = generateHTTPMethod(); + Axios.prototype[method + "Form"] = generateHTTPMethod(true); +}); +const Axios$1 = Axios; +class CancelToken { + constructor(executor) { + if (typeof executor !== "function") { + throw new TypeError("executor must be a function."); + } + let resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + const token2 = this; + this.promise.then((cancel) => { + if (!token2._listeners) + return; + let i2 = token2._listeners.length; + while (i2-- > 0) { + token2._listeners[i2](cancel); + } + token2._listeners = null; + }); + this.promise.then = (onfulfilled) => { + let _resolve; + const promise = new Promise((resolve) => { + token2.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + promise.cancel = function reject() { + token2.unsubscribe(_resolve); + }; + return promise; + }; + executor(function cancel(message2, config2, request) { + if (token2.reason) { + return; + } + token2.reason = new CanceledError(message2, config2, request); + resolvePromise(token2.reason); + }); + } + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + /** + * Subscribe to the cancel signal + */ + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + /** + * Unsubscribe from the cancel signal + */ + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index2 = this._listeners.indexOf(listener); + if (index2 !== -1) { + this._listeners.splice(index2, 1); + } + } + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token2 = new CancelToken(function executor(c2) { + cancel = c2; + }); + return { + token: token2, + cancel + }; + } +} +const CancelToken$1 = CancelToken; +function spread(callback) { + return function wrap2(arr) { + return callback.apply(null, arr); + }; +} +function isAxiosError(payload) { + return utils$5.isObject(payload) && payload.isAxiosError === true; +} +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511 +}; +Object.entries(HttpStatusCode).forEach(([key2, value]) => { + HttpStatusCode[value] = key2; +}); +const HttpStatusCode$1 = HttpStatusCode; +function createInstance(defaultConfig) { + const context = new Axios$1(defaultConfig); + const instance2 = bind(Axios$1.prototype.request, context); + utils$5.extend(instance2, Axios$1.prototype, context, { allOwnKeys: true }); + utils$5.extend(instance2, context, null, { allOwnKeys: true }); + instance2.create = function create3(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + return instance2; +} +const axios = createInstance(defaults$1); +axios.Axios = Axios$1; +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken$1; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; +axios.AxiosError = AxiosError; +axios.Cancel = axios.CanceledError; +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = spread; +axios.isAxiosError = isAxiosError; +axios.mergeConfig = mergeConfig; +axios.AxiosHeaders = AxiosHeaders$1; +axios.formToJSON = (thing) => formDataToJSON(utils$5.isHTMLForm(thing) ? new FormData(thing) : thing); +axios.getAdapter = adapters.getAdapter; +axios.HttpStatusCode = HttpStatusCode$1; +axios.default = axios; +const et = axios; +class HttpProvider { + constructor(host, timeout = 3e4, user = "", password = "", headers = {}, statusPage = "/") { + __publicField(this, "host"); + __publicField(this, "timeout"); + __publicField(this, "user"); + __publicField(this, "password"); + __publicField(this, "headers"); + __publicField(this, "statusPage"); + __publicField(this, "instance"); + if (!isValidURL(host)) + throw new Error("Invalid URL provided to HttpProvider"); + if (isNaN(timeout) || timeout < 0) + throw new Error("Invalid timeout duration provided"); + if (!isObject$2(headers)) + throw new Error("Invalid headers object provided"); + host = host.replace(/\/+$/, ""); + this.host = host; + this.timeout = timeout; + this.user = user; + this.password = password; + this.headers = headers; + this.statusPage = statusPage; + this.instance = et.create({ + baseURL: host, + timeout, + headers, + auth: user ? { + username: user, + password + } : void 0 + }); + } + setStatusPage(statusPage = "/") { + this.statusPage = statusPage; + } + async isConnected(statusPage = this.statusPage) { + return this.request(statusPage).then((data) => { + return hasProperties(data, "blockID", "block_header"); + }).catch(() => false); + } + request(url, payload = {}, method = "get") { + method = method.toLowerCase(); + return this.instance.request({ + data: method == "post" && Object.keys(payload).length ? payload : null, + params: method == "get" && payload, + url, + method + }).then(({ data }) => data); + } +} +const providers = { HttpProvider }; +var eventemitter3 = { exports: {} }; +(function(module) { + var has = Object.prototype.hasOwnProperty, prefix = "~"; + function Events() { + } + if (Object.create) { + Events.prototype = /* @__PURE__ */ Object.create(null); + if (!new Events().__proto__) + prefix = false; + } + function EE2(fn2, context, once3) { + this.fn = fn2; + this.context = context; + this.once = once3 || false; + } + function addListener2(emitter, event, fn2, context, once3) { + if (typeof fn2 !== "function") { + throw new TypeError("The listener must be a function"); + } + var listener = new EE2(fn2, context || emitter, once3), evt = prefix ? prefix + event : event; + if (!emitter._events[evt]) + emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) + emitter._events[evt].push(listener); + else + emitter._events[evt] = [emitter._events[evt], listener]; + return emitter; + } + function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) + emitter._events = new Events(); + else + delete emitter._events[evt]; + } + function EventEmitter2() { + this._events = new Events(); + this._eventsCount = 0; + } + EventEmitter2.prototype.eventNames = function eventNames2() { + var names = [], events2, name2; + if (this._eventsCount === 0) + return names; + for (name2 in events2 = this._events) { + if (has.call(events2, name2)) + names.push(prefix ? name2.slice(1) : name2); + } + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events2)); + } + return names; + }; + EventEmitter2.prototype.listeners = function listeners3(event) { + var evt = prefix ? prefix + event : event, handlers = this._events[evt]; + if (!handlers) + return []; + if (handlers.fn) + return [handlers.fn]; + for (var i2 = 0, l2 = handlers.length, ee2 = new Array(l2); i2 < l2; i2++) { + ee2[i2] = handlers[i2].fn; + } + return ee2; + }; + EventEmitter2.prototype.listenerCount = function listenerCount2(event) { + var evt = prefix ? prefix + event : event, listeners3 = this._events[evt]; + if (!listeners3) + return 0; + if (listeners3.fn) + return 1; + return listeners3.length; + }; + EventEmitter2.prototype.emit = function emit2(event, a1, a22, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + if (!this._events[evt]) + return false; + var listeners3 = this._events[evt], len = arguments.length, args, i2; + if (listeners3.fn) { + if (listeners3.once) + this.removeListener(event, listeners3.fn, void 0, true); + switch (len) { + case 1: + return listeners3.fn.call(listeners3.context), true; + case 2: + return listeners3.fn.call(listeners3.context, a1), true; + case 3: + return listeners3.fn.call(listeners3.context, a1, a22), true; + case 4: + return listeners3.fn.call(listeners3.context, a1, a22, a3), true; + case 5: + return listeners3.fn.call(listeners3.context, a1, a22, a3, a4), true; + case 6: + return listeners3.fn.call(listeners3.context, a1, a22, a3, a4, a5), true; + } + for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) { + args[i2 - 1] = arguments[i2]; + } + listeners3.fn.apply(listeners3.context, args); + } else { + var length = listeners3.length, j2; + for (i2 = 0; i2 < length; i2++) { + if (listeners3[i2].once) + this.removeListener(event, listeners3[i2].fn, void 0, true); + switch (len) { + case 1: + listeners3[i2].fn.call(listeners3[i2].context); + break; + case 2: + listeners3[i2].fn.call(listeners3[i2].context, a1); + break; + case 3: + listeners3[i2].fn.call(listeners3[i2].context, a1, a22); + break; + case 4: + listeners3[i2].fn.call(listeners3[i2].context, a1, a22, a3); + break; + default: + if (!args) + for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) { + args[j2 - 1] = arguments[j2]; + } + listeners3[i2].fn.apply(listeners3[i2].context, args); + } + } + } + return true; + }; + EventEmitter2.prototype.on = function on2(event, fn2, context) { + return addListener2(this, event, fn2, context, false); + }; + EventEmitter2.prototype.once = function once3(event, fn2, context) { + return addListener2(this, event, fn2, context, true); + }; + EventEmitter2.prototype.removeListener = function removeListener2(event, fn2, context, once3) { + var evt = prefix ? prefix + event : event; + if (!this._events[evt]) + return this; + if (!fn2) { + clearEvent(this, evt); + return this; + } + var listeners3 = this._events[evt]; + if (listeners3.fn) { + if (listeners3.fn === fn2 && (!once3 || listeners3.once) && (!context || listeners3.context === context)) { + clearEvent(this, evt); + } + } else { + for (var i2 = 0, events2 = [], length = listeners3.length; i2 < length; i2++) { + if (listeners3[i2].fn !== fn2 || once3 && !listeners3[i2].once || context && listeners3[i2].context !== context) { + events2.push(listeners3[i2]); + } + } + if (events2.length) + this._events[evt] = events2.length === 1 ? events2[0] : events2; + else + clearEvent(this, evt); + } + return this; + }; + EventEmitter2.prototype.removeAllListeners = function removeAllListeners2(event) { + var evt; + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) + clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + return this; + }; + EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; + EventEmitter2.prototype.addListener = EventEmitter2.prototype.on; + EventEmitter2.prefixed = prefix; + EventEmitter2.EventEmitter = EventEmitter2; + { + module.exports = EventEmitter2; + } +})(eventemitter3); +var eventemitter3Exports = eventemitter3.exports; +const EventEmitter$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(eventemitter3Exports); +var semver$1 = { exports: {} }; +(function(module, exports) { + exports = module.exports = SemVer; + var debug; + if (typeof process === "object" && process.env && {}.NODE_DEBUG && /\bsemver\b/i.test({}.NODE_DEBUG)) { + debug = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug = function() { + }; + } + exports.SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER2 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var re2 = exports.re = []; + var safeRe = exports.safeRe = []; + var src2 = exports.src = []; + var R3 = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + function makeSafeRe(value) { + for (var i3 = 0; i3 < safeRegexReplacements.length; i3++) { + var token2 = safeRegexReplacements[i3][0]; + var max = safeRegexReplacements[i3][1]; + value = value.split(token2 + "*").join(token2 + "{0," + max + "}").split(token2 + "+").join(token2 + "{1," + max + "}"); + } + return value; + } + var NUMERICIDENTIFIER = R3++; + src2[NUMERICIDENTIFIER] = "0|[1-9]\\d*"; + var NUMERICIDENTIFIERLOOSE = R3++; + src2[NUMERICIDENTIFIERLOOSE] = "\\d+"; + var NONNUMERICIDENTIFIER = R3++; + src2[NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*"; + var MAINVERSION = R3++; + src2[MAINVERSION] = "(" + src2[NUMERICIDENTIFIER] + ")\\.(" + src2[NUMERICIDENTIFIER] + ")\\.(" + src2[NUMERICIDENTIFIER] + ")"; + var MAINVERSIONLOOSE = R3++; + src2[MAINVERSIONLOOSE] = "(" + src2[NUMERICIDENTIFIERLOOSE] + ")\\.(" + src2[NUMERICIDENTIFIERLOOSE] + ")\\.(" + src2[NUMERICIDENTIFIERLOOSE] + ")"; + var PRERELEASEIDENTIFIER = R3++; + src2[PRERELEASEIDENTIFIER] = "(?:" + src2[NUMERICIDENTIFIER] + "|" + src2[NONNUMERICIDENTIFIER] + ")"; + var PRERELEASEIDENTIFIERLOOSE = R3++; + src2[PRERELEASEIDENTIFIERLOOSE] = "(?:" + src2[NUMERICIDENTIFIERLOOSE] + "|" + src2[NONNUMERICIDENTIFIER] + ")"; + var PRERELEASE = R3++; + src2[PRERELEASE] = "(?:-(" + src2[PRERELEASEIDENTIFIER] + "(?:\\." + src2[PRERELEASEIDENTIFIER] + ")*))"; + var PRERELEASELOOSE = R3++; + src2[PRERELEASELOOSE] = "(?:-?(" + src2[PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src2[PRERELEASEIDENTIFIERLOOSE] + ")*))"; + var BUILDIDENTIFIER = R3++; + src2[BUILDIDENTIFIER] = LETTERDASHNUMBER + "+"; + var BUILD = R3++; + src2[BUILD] = "(?:\\+(" + src2[BUILDIDENTIFIER] + "(?:\\." + src2[BUILDIDENTIFIER] + ")*))"; + var FULL = R3++; + var FULLPLAIN = "v?" + src2[MAINVERSION] + src2[PRERELEASE] + "?" + src2[BUILD] + "?"; + src2[FULL] = "^" + FULLPLAIN + "$"; + var LOOSEPLAIN = "[v=\\s]*" + src2[MAINVERSIONLOOSE] + src2[PRERELEASELOOSE] + "?" + src2[BUILD] + "?"; + var LOOSE = R3++; + src2[LOOSE] = "^" + LOOSEPLAIN + "$"; + var GTLT = R3++; + src2[GTLT] = "((?:<|>)?=?)"; + var XRANGEIDENTIFIERLOOSE = R3++; + src2[XRANGEIDENTIFIERLOOSE] = src2[NUMERICIDENTIFIERLOOSE] + "|x|X|\\*"; + var XRANGEIDENTIFIER = R3++; + src2[XRANGEIDENTIFIER] = src2[NUMERICIDENTIFIER] + "|x|X|\\*"; + var XRANGEPLAIN = R3++; + src2[XRANGEPLAIN] = "[v=\\s]*(" + src2[XRANGEIDENTIFIER] + ")(?:\\.(" + src2[XRANGEIDENTIFIER] + ")(?:\\.(" + src2[XRANGEIDENTIFIER] + ")(?:" + src2[PRERELEASE] + ")?" + src2[BUILD] + "?)?)?"; + var XRANGEPLAINLOOSE = R3++; + src2[XRANGEPLAINLOOSE] = "[v=\\s]*(" + src2[XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src2[XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src2[XRANGEIDENTIFIERLOOSE] + ")(?:" + src2[PRERELEASELOOSE] + ")?" + src2[BUILD] + "?)?)?"; + var XRANGE = R3++; + src2[XRANGE] = "^" + src2[GTLT] + "\\s*" + src2[XRANGEPLAIN] + "$"; + var XRANGELOOSE = R3++; + src2[XRANGELOOSE] = "^" + src2[GTLT] + "\\s*" + src2[XRANGEPLAINLOOSE] + "$"; + var COERCE = R3++; + src2[COERCE] = "(?:^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])"; + var LONETILDE = R3++; + src2[LONETILDE] = "(?:~>?)"; + var TILDETRIM = R3++; + src2[TILDETRIM] = "(\\s*)" + src2[LONETILDE] + "\\s+"; + re2[TILDETRIM] = new RegExp(src2[TILDETRIM], "g"); + safeRe[TILDETRIM] = new RegExp(makeSafeRe(src2[TILDETRIM]), "g"); + var tildeTrimReplace = "$1~"; + var TILDE = R3++; + src2[TILDE] = "^" + src2[LONETILDE] + src2[XRANGEPLAIN] + "$"; + var TILDELOOSE = R3++; + src2[TILDELOOSE] = "^" + src2[LONETILDE] + src2[XRANGEPLAINLOOSE] + "$"; + var LONECARET = R3++; + src2[LONECARET] = "(?:\\^)"; + var CARETTRIM = R3++; + src2[CARETTRIM] = "(\\s*)" + src2[LONECARET] + "\\s+"; + re2[CARETTRIM] = new RegExp(src2[CARETTRIM], "g"); + safeRe[CARETTRIM] = new RegExp(makeSafeRe(src2[CARETTRIM]), "g"); + var caretTrimReplace = "$1^"; + var CARET = R3++; + src2[CARET] = "^" + src2[LONECARET] + src2[XRANGEPLAIN] + "$"; + var CARETLOOSE = R3++; + src2[CARETLOOSE] = "^" + src2[LONECARET] + src2[XRANGEPLAINLOOSE] + "$"; + var COMPARATORLOOSE = R3++; + src2[COMPARATORLOOSE] = "^" + src2[GTLT] + "\\s*(" + LOOSEPLAIN + ")$|^$"; + var COMPARATOR = R3++; + src2[COMPARATOR] = "^" + src2[GTLT] + "\\s*(" + FULLPLAIN + ")$|^$"; + var COMPARATORTRIM = R3++; + src2[COMPARATORTRIM] = "(\\s*)" + src2[GTLT] + "\\s*(" + LOOSEPLAIN + "|" + src2[XRANGEPLAIN] + ")"; + re2[COMPARATORTRIM] = new RegExp(src2[COMPARATORTRIM], "g"); + safeRe[COMPARATORTRIM] = new RegExp(makeSafeRe(src2[COMPARATORTRIM]), "g"); + var comparatorTrimReplace = "$1$2$3"; + var HYPHENRANGE = R3++; + src2[HYPHENRANGE] = "^\\s*(" + src2[XRANGEPLAIN] + ")\\s+-\\s+(" + src2[XRANGEPLAIN] + ")\\s*$"; + var HYPHENRANGELOOSE = R3++; + src2[HYPHENRANGELOOSE] = "^\\s*(" + src2[XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src2[XRANGEPLAINLOOSE] + ")\\s*$"; + var STAR = R3++; + src2[STAR] = "(<|>)?=?\\s*\\*"; + for (var i2 = 0; i2 < R3; i2++) { + debug(i2, src2[i2]); + if (!re2[i2]) { + re2[i2] = new RegExp(src2[i2]); + safeRe[i2] = new RegExp(makeSafeRe(src2[i2])); + } + } + exports.parse = parse2; + function parse2(version2, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; + } + if (version2 instanceof SemVer) { + return version2; + } + if (typeof version2 !== "string") { + return null; + } + if (version2.length > MAX_LENGTH) { + return null; + } + var r2 = options.loose ? safeRe[LOOSE] : safeRe[FULL]; + if (!r2.test(version2)) { + return null; + } + try { + return new SemVer(version2, options); + } catch (er2) { + return null; + } + } + exports.valid = valid; + function valid(version2, options) { + var v6 = parse2(version2, options); + return v6 ? v6.version : null; + } + exports.clean = clean; + function clean(version2, options) { + var s2 = parse2(version2.trim().replace(/^[=v]+/, ""), options); + return s2 ? s2.version : null; + } + exports.SemVer = SemVer; + function SemVer(version2, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; + } + if (version2 instanceof SemVer) { + if (version2.loose === options.loose) { + return version2; + } else { + version2 = version2.version; + } + } else if (typeof version2 !== "string") { + throw new TypeError("Invalid Version: " + version2); + } + if (version2.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); + } + if (!(this instanceof SemVer)) { + return new SemVer(version2, options); + } + debug("SemVer", version2, options); + this.options = options; + this.loose = !!options.loose; + var m3 = version2.trim().match(options.loose ? safeRe[LOOSE] : safeRe[FULL]); + if (!m3) { + throw new TypeError("Invalid Version: " + version2); + } + this.raw = version2; + this.major = +m3[1]; + this.minor = +m3[2]; + this.patch = +m3[3]; + if (this.major > MAX_SAFE_INTEGER2 || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER2 || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER2 || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m3[4]) { + this.prerelease = []; + } else { + this.prerelease = m3[4].split(".").map(function(id2) { + if (/^[0-9]+$/.test(id2)) { + var num = +id2; + if (num >= 0 && num < MAX_SAFE_INTEGER2) { + return num; + } + } + return id2; + }); + } + this.build = m3[5] ? m3[5].split(".") : []; + this.format(); + } + SemVer.prototype.format = function() { + this.version = this.major + "." + this.minor + "." + this.patch; + if (this.prerelease.length) { + this.version += "-" + this.prerelease.join("."); + } + return this.version; + }; + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + return this.compareMain(other) || this.comparePre(other); + }; + SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + }; + SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + var i3 = 0; + do { + var a3 = this.prerelease[i3]; + var b2 = other.prerelease[i3]; + debug("prerelease compare", i3, a3, b2); + if (a3 === void 0 && b2 === void 0) { + return 0; + } else if (b2 === void 0) { + return 1; + } else if (a3 === void 0) { + return -1; + } else if (a3 === b2) { + continue; + } else { + return compareIdentifiers(a3, b2); + } + } while (++i3); + }; + SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier); + this.inc("pre", identifier); + break; + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier); + } + this.inc("pre", identifier); + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + case "pre": + if (this.prerelease.length === 0) { + this.prerelease = [0]; + } else { + var i3 = this.prerelease.length; + while (--i3 >= 0) { + if (typeof this.prerelease[i3] === "number") { + this.prerelease[i3]++; + i3 = -2; + } + } + if (i3 === -1) { + this.prerelease.push(0); + } + } + if (identifier) { + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0]; + } + } else { + this.prerelease = [identifier, 0]; + } + } + break; + default: + throw new Error("invalid increment argument: " + release); + } + this.format(); + this.raw = this.version; + return this; + }; + exports.inc = inc; + function inc(version2, release, loose, identifier) { + if (typeof loose === "string") { + identifier = loose; + loose = void 0; + } + try { + return new SemVer(version2, loose).inc(release, identifier).version; + } catch (er2) { + return null; + } + } + exports.diff = diff; + function diff(version1, version2) { + if (eq7(version1, version2)) { + return null; + } else { + var v12 = parse2(version1); + var v22 = parse2(version2); + var prefix = ""; + if (v12.prerelease.length || v22.prerelease.length) { + prefix = "pre"; + var defaultResult = "prerelease"; + } + for (var key2 in v12) { + if (key2 === "major" || key2 === "minor" || key2 === "patch") { + if (v12[key2] !== v22[key2]) { + return prefix + key2; + } + } + } + return defaultResult; + } + } + exports.compareIdentifiers = compareIdentifiers; + var numeric2 = /^[0-9]+$/; + function compareIdentifiers(a3, b2) { + var anum = numeric2.test(a3); + var bnum = numeric2.test(b2); + if (anum && bnum) { + a3 = +a3; + b2 = +b2; + } + return a3 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a3 < b2 ? -1 : 1; + } + exports.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a3, b2) { + return compareIdentifiers(b2, a3); + } + exports.major = major; + function major(a3, loose) { + return new SemVer(a3, loose).major; + } + exports.minor = minor; + function minor(a3, loose) { + return new SemVer(a3, loose).minor; + } + exports.patch = patch; + function patch(a3, loose) { + return new SemVer(a3, loose).patch; + } + exports.compare = compare2; + function compare2(a3, b2, loose) { + return new SemVer(a3, loose).compare(new SemVer(b2, loose)); + } + exports.compareLoose = compareLoose; + function compareLoose(a3, b2) { + return compare2(a3, b2, true); + } + exports.rcompare = rcompare; + function rcompare(a3, b2, loose) { + return compare2(b2, a3, loose); + } + exports.sort = sort; + function sort(list, loose) { + return list.sort(function(a3, b2) { + return exports.compare(a3, b2, loose); + }); + } + exports.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a3, b2) { + return exports.rcompare(a3, b2, loose); + }); + } + exports.gt = gt2; + function gt2(a3, b2, loose) { + return compare2(a3, b2, loose) > 0; + } + exports.lt = lt2; + function lt2(a3, b2, loose) { + return compare2(a3, b2, loose) < 0; + } + exports.eq = eq7; + function eq7(a3, b2, loose) { + return compare2(a3, b2, loose) === 0; + } + exports.neq = neq; + function neq(a3, b2, loose) { + return compare2(a3, b2, loose) !== 0; + } + exports.gte = gte; + function gte(a3, b2, loose) { + return compare2(a3, b2, loose) >= 0; + } + exports.lte = lte; + function lte(a3, b2, loose) { + return compare2(a3, b2, loose) <= 0; + } + exports.cmp = cmp; + function cmp(a3, op, b2, loose) { + switch (op) { + case "===": + if (typeof a3 === "object") + a3 = a3.version; + if (typeof b2 === "object") + b2 = b2.version; + return a3 === b2; + case "!==": + if (typeof a3 === "object") + a3 = a3.version; + if (typeof b2 === "object") + b2 = b2.version; + return a3 !== b2; + case "": + case "=": + case "==": + return eq7(a3, b2, loose); + case "!=": + return neq(a3, b2, loose); + case ">": + return gt2(a3, b2, loose); + case ">=": + return gte(a3, b2, loose); + case "<": + return lt2(a3, b2, loose); + case "<=": + return lte(a3, b2, loose); + default: + throw new TypeError("Invalid operator: " + op); + } + } + exports.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; + } + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; + } + } + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); + } + comp = comp.trim().split(/\s+/).join(" "); + debug("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; + } else { + this.value = this.operator + this.semver.version; + } + debug("comp", this); + } + var ANY = {}; + Comparator.prototype.parse = function(comp) { + var r2 = this.options.loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR]; + var m3 = comp.match(r2); + if (!m3) { + throw new TypeError("Invalid comparator: " + comp); + } + this.operator = m3[1]; + if (this.operator === "=") { + this.operator = ""; + } + if (!m3[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer(m3[2], this.options.loose); + } + }; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version2) { + debug("Comparator.test", version2, this.options.loose); + if (this.semver === ANY) { + return true; + } + if (typeof version2 === "string") { + version2 = new SemVer(version2, this.options); + } + return cmp(version2, this.operator, this.semver, this.options); + }; + Comparator.prototype.intersects = function(comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError("a Comparator is required"); + } + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; + } + var rangeTmp; + if (this.operator === "") { + rangeTmp = new Range(comp.value, options); + return satisfies(this.value, rangeTmp, options); + } else if (comp.operator === "") { + rangeTmp = new Range(this.value, options); + return satisfies(comp.semver, rangeTmp, options); + } + var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">"); + var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<"); + var sameSemVer = this.semver.version === comp.semver.version; + var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<="); + var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<")); + var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">")); + return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; + }; + exports.Range = Range; + function Range(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; + } + if (range instanceof Range) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range(range.raw, options); + } + } + if (range instanceof Comparator) { + return new Range(range.value, options); + } + if (!(this instanceof Range)) { + return new Range(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c2) { + return c2.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); + } + Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(" ").trim(); + }).join("||").trim(); + return this.range; + }; + Range.prototype.toString = function() { + return this.range; + }; + Range.prototype.parseRange = function(range) { + var loose = this.options.loose; + var hr2 = loose ? safeRe[HYPHENRANGELOOSE] : safeRe[HYPHENRANGE]; + range = range.replace(hr2, hyphenReplace); + debug("hyphen replace", range); + range = range.replace(safeRe[COMPARATORTRIM], comparatorTrimReplace); + debug("comparator trim", range, safeRe[COMPARATORTRIM]); + range = range.replace(safeRe[TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[CARETTRIM], caretTrimReplace); + var compRe = loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; + }; + Range.prototype.intersects = function(range, options) { + if (!(range instanceof Range)) { + throw new TypeError("a Range is required"); + } + return this.set.some(function(thisComparators) { + return thisComparators.every(function(thisComparator) { + return range.set.some(function(rangeComparators) { + return rangeComparators.every(function(rangeComparator) { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); + }; + exports.toComparators = toComparators; + function toComparators(range, options) { + return new Range(range, options).set.map(function(comp) { + return comp.map(function(c2) { + return c2.value; + }).join(" ").trim().split(" "); + }); + } + function parseComparator(comp, options) { + debug("comp", comp, options); + comp = replaceCarets(comp, options); + debug("caret", comp); + comp = replaceTildes(comp, options); + debug("tildes", comp); + comp = replaceXRanges(comp, options); + debug("xrange", comp); + comp = replaceStars(comp, options); + debug("stars", comp); + return comp; + } + function isX(id2) { + return !id2 || id2.toLowerCase() === "x" || id2 === "*"; + } + function replaceTildes(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceTilde(comp2, options); + }).join(" "); + } + function replaceTilde(comp, options) { + var r2 = options.loose ? safeRe[TILDELOOSE] : safeRe[TILDE]; + return comp.replace(r2, function(_3, M3, m3, p3, pr2) { + debug("tilde", comp, _3, M3, m3, p3, pr2); + var ret; + if (isX(M3)) { + ret = ""; + } else if (isX(m3)) { + ret = ">=" + M3 + ".0.0 <" + (+M3 + 1) + ".0.0"; + } else if (isX(p3)) { + ret = ">=" + M3 + "." + m3 + ".0 <" + M3 + "." + (+m3 + 1) + ".0"; + } else if (pr2) { + debug("replaceTilde pr", pr2); + ret = ">=" + M3 + "." + m3 + "." + p3 + "-" + pr2 + " <" + M3 + "." + (+m3 + 1) + ".0"; + } else { + ret = ">=" + M3 + "." + m3 + "." + p3 + " <" + M3 + "." + (+m3 + 1) + ".0"; + } + debug("tilde return", ret); + return ret; + }); + } + function replaceCarets(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceCaret(comp2, options); + }).join(" "); + } + function replaceCaret(comp, options) { + debug("caret", comp, options); + var r2 = options.loose ? safeRe[CARETLOOSE] : safeRe[CARET]; + return comp.replace(r2, function(_3, M3, m3, p3, pr2) { + debug("caret", comp, _3, M3, m3, p3, pr2); + var ret; + if (isX(M3)) { + ret = ""; + } else if (isX(m3)) { + ret = ">=" + M3 + ".0.0 <" + (+M3 + 1) + ".0.0"; + } else if (isX(p3)) { + if (M3 === "0") { + ret = ">=" + M3 + "." + m3 + ".0 <" + M3 + "." + (+m3 + 1) + ".0"; + } else { + ret = ">=" + M3 + "." + m3 + ".0 <" + (+M3 + 1) + ".0.0"; + } + } else if (pr2) { + debug("replaceCaret pr", pr2); + if (M3 === "0") { + if (m3 === "0") { + ret = ">=" + M3 + "." + m3 + "." + p3 + "-" + pr2 + " <" + M3 + "." + m3 + "." + (+p3 + 1); + } else { + ret = ">=" + M3 + "." + m3 + "." + p3 + "-" + pr2 + " <" + M3 + "." + (+m3 + 1) + ".0"; + } + } else { + ret = ">=" + M3 + "." + m3 + "." + p3 + "-" + pr2 + " <" + (+M3 + 1) + ".0.0"; + } + } else { + debug("no pr"); + if (M3 === "0") { + if (m3 === "0") { + ret = ">=" + M3 + "." + m3 + "." + p3 + " <" + M3 + "." + m3 + "." + (+p3 + 1); + } else { + ret = ">=" + M3 + "." + m3 + "." + p3 + " <" + M3 + "." + (+m3 + 1) + ".0"; + } + } else { + ret = ">=" + M3 + "." + m3 + "." + p3 + " <" + (+M3 + 1) + ".0.0"; + } + } + debug("caret return", ret); + return ret; + }); + } + function replaceXRanges(comp, options) { + debug("replaceXRanges", comp, options); + return comp.split(/\s+/).map(function(comp2) { + return replaceXRange(comp2, options); + }).join(" "); + } + function replaceXRange(comp, options) { + comp = comp.trim(); + var r2 = options.loose ? safeRe[XRANGELOOSE] : safeRe[XRANGE]; + return comp.replace(r2, function(ret, gtlt, M3, m3, p3, pr2) { + debug("xRange", comp, ret, gtlt, M3, m3, p3, pr2); + var xM = isX(M3); + var xm = xM || isX(m3); + var xp = xm || isX(p3); + var anyX = xp; + if (gtlt === "=" && anyX) { + gtlt = ""; + } + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0"; + } else { + ret = "*"; + } + } else if (gtlt && anyX) { + if (xm) { + m3 = 0; + } + p3 = 0; + if (gtlt === ">") { + gtlt = ">="; + if (xm) { + M3 = +M3 + 1; + m3 = 0; + p3 = 0; + } else { + m3 = +m3 + 1; + p3 = 0; + } + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M3 = +M3 + 1; + } else { + m3 = +m3 + 1; + } + } + ret = gtlt + M3 + "." + m3 + "." + p3; + } else if (xm) { + ret = ">=" + M3 + ".0.0 <" + (+M3 + 1) + ".0.0"; + } else if (xp) { + ret = ">=" + M3 + "." + m3 + ".0 <" + M3 + "." + (+m3 + 1) + ".0"; + } + debug("xRange return", ret); + return ret; + }); + } + function replaceStars(comp, options) { + debug("replaceStars", comp, options); + return comp.trim().replace(safeRe[STAR], ""); + } + function hyphenReplace($02, from2, fM, fm, fp, fpr, fb2, to2, tM, tm, tp, tpr, tb2) { + if (isX(fM)) { + from2 = ""; + } else if (isX(fm)) { + from2 = ">=" + fM + ".0.0"; + } else if (isX(fp)) { + from2 = ">=" + fM + "." + fm + ".0"; + } else { + from2 = ">=" + from2; + } + if (isX(tM)) { + to2 = ""; + } else if (isX(tm)) { + to2 = "<" + (+tM + 1) + ".0.0"; + } else if (isX(tp)) { + to2 = "<" + tM + "." + (+tm + 1) + ".0"; + } else if (tpr) { + to2 = "<=" + tM + "." + tm + "." + tp + "-" + tpr; + } else { + to2 = "<=" + to2; + } + return (from2 + " " + to2).trim(); + } + Range.prototype.test = function(version2) { + if (!version2) { + return false; + } + if (typeof version2 === "string") { + version2 = new SemVer(version2, this.options); + } + for (var i3 = 0; i3 < this.set.length; i3++) { + if (testSet(this.set[i3], version2, this.options)) { + return true; + } + } + return false; + }; + function testSet(set2, version2, options) { + for (var i3 = 0; i3 < set2.length; i3++) { + if (!set2[i3].test(version2)) { + return false; + } + } + if (version2.prerelease.length && !options.includePrerelease) { + for (i3 = 0; i3 < set2.length; i3++) { + debug(set2[i3].semver); + if (set2[i3].semver === ANY) { + continue; + } + if (set2[i3].semver.prerelease.length > 0) { + var allowed = set2[i3].semver; + if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { + return true; + } + } + } + return false; + } + return true; + } + exports.satisfies = satisfies; + function satisfies(version2, range, options) { + try { + range = new Range(range, options); + } catch (er2) { + return false; + } + return range.test(version2); + } + exports.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range(range, options); + } catch (er2) { + return null; + } + versions.forEach(function(v6) { + if (rangeObj.test(v6)) { + if (!max || maxSV.compare(v6) === -1) { + max = v6; + maxSV = new SemVer(max, options); + } + } + }); + return max; + } + exports.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range(range, options); + } catch (er2) { + return null; + } + versions.forEach(function(v6) { + if (rangeObj.test(v6)) { + if (!min || minSV.compare(v6) === 1) { + min = v6; + minSV = new SemVer(min, options); + } + } + }); + return min; + } + exports.minVersion = minVersion; + function minVersion(range, loose) { + range = new Range(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; + } + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (var i3 = 0; i3 < range.set.length; ++i3) { + var comparators = range.set[i3]; + comparators.forEach(function(comparator) { + var compver = new SemVer(comparator.semver.version); + switch (comparator.operator) { + case ">": + if (compver.prerelease.length === 0) { + compver.patch++; + } else { + compver.prerelease.push(0); + } + compver.raw = compver.format(); + case "": + case ">=": + if (!minver || gt2(minver, compver)) { + minver = compver; + } + break; + case "<": + case "<=": + break; + default: + throw new Error("Unexpected operation: " + comparator.operator); + } + }); + } + if (minver && range.test(minver)) { + return minver; + } + return null; + } + exports.validRange = validRange; + function validRange(range, options) { + try { + return new Range(range, options).range || "*"; + } catch (er2) { + return null; + } + } + exports.ltr = ltr; + function ltr(version2, range, options) { + return outside(version2, range, "<", options); + } + exports.gtr = gtr; + function gtr(version2, range, options) { + return outside(version2, range, ">", options); + } + exports.outside = outside; + function outside(version2, range, hilo, options) { + version2 = new SemVer(version2, options); + range = new Range(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt2; + ltefn = lte; + ltfn = lt2; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt2; + ltefn = gte; + ltfn = gt2; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies(version2, range, options)) { + return false; + } + for (var i3 = 0; i3 < range.set.length; ++i3) { + var comparators = range.set[i3]; + var high = null; + var low = null; + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator; + } + }); + if (high.operator === comp || high.operator === ecomp) { + return false; + } + if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version2, low.semver)) { + return false; + } + } + return true; + } + exports.prerelease = prerelease; + function prerelease(version2, options) { + var parsed = parse2(version2, options); + return parsed && parsed.prerelease.length ? parsed.prerelease : null; + } + exports.intersects = intersects; + function intersects(r1, r2, options) { + r1 = new Range(r1, options); + r2 = new Range(r2, options); + return r1.intersects(r2); + } + exports.coerce = coerce2; + function coerce2(version2) { + if (version2 instanceof SemVer) { + return version2; + } + if (typeof version2 !== "string") { + return null; + } + var match = version2.match(safeRe[COERCE]); + if (match == null) { + return null; + } + return parse2(match[1] + "." + (match[2] || "0") + "." + (match[3] || "0")); + } +})(semver$1, semver$1.exports); +var semverExports = semver$1.exports; +const semver = /* @__PURE__ */ getDefaultExportFromCjs$1(semverExports); +const abiCoder = new AbiCoder(); +function _addressToHex(value) { + return TronWeb.address.toHex(value).replace(ADDRESS_PREFIX_REGEX, "0x"); +} +function decodeParams(names, types2, output2, ignoreMethodHash = false) { + if (ignoreMethodHash && output2.replace(/^0x/, "").length % 64 === 8) + output2 = "0x" + output2.replace(/^0x/, "").substring(8); + if (output2.replace(/^0x/, "").length % 64) { + throw new Error("The encoded string is not valid. Its length must be a multiple of 64."); + } + types2 = types2.map((type2) => { + if (/trcToken/.test(type2)) { + type2 = type2.replace(/trcToken/, "uint256"); + } + return type2; + }); + return abiCoder.decode(types2, output2).reduce((obj, arg, index2) => { + if (types2[index2] == "address") { + arg = ADDRESS_PREFIX + arg.substr(2).toLowerCase(); + } + if (names.length) { + obj[names[index2]] = arg; + } else { + obj.push(arg); + } + return obj; + }, names.length ? {} : []); +} +function encodeParams(types2, values) { + for (let i2 = 0; i2 < types2.length; i2++) { + if (types2[i2] === "address") { + values[i2] = TronWeb.address.toHex(values[i2]).replace(ADDRESS_PREFIX_REGEX, "0x"); + } + } + return abiCoder.encode(types2, values); +} +function extractSize(type2) { + const size2 = type2.match(/([a-zA-Z0-9])(\[.*\])/); + return size2 ? size2[2] : ""; +} +function extractArrayDim(type2) { + const size2 = extractSize(type2); + return (size2.match(/\]\[/g) || []).length + 1; +} +function encodeParamsV2ByABI(funABI, args) { + const types2 = []; + const buildFullTypeDefinition = (typeDef) => { + if (typeDef && typeDef.type.indexOf("tuple") === 0 && typeDef.components) { + const innerTypes = typeDef.components.map((innerType) => { + return buildFullTypeDefinition(innerType); + }); + return `tuple(${innerTypes.join(",")})${extractSize(typeDef.type)}`; + } + if (/trcToken/.test(typeDef.type)) + return typeDef.type.replace(/trcToken/, "uint256"); + return typeDef.type; + }; + const convertTypes = (types3) => { + for (let i2 = 0; i2 < types3.length; i2++) { + const type2 = types3[i2]; + if (/trcToken/.test(type2)) + types3[i2] = type2.replace(/trcToken/, "uint256"); + } + }; + const convertAddresses = (addrArr) => { + if (Array.isArray(addrArr)) { + addrArr.forEach((addrs, i2) => { + addrArr[i2] = convertAddresses(addrs); + }); + return addrArr; + } else { + return _addressToHex(addrArr); + } + }; + const mapTuple = (components, args2, dimension) => { + if (dimension > 1) { + if (args2.length) { + args2.forEach((arg) => { + mapTuple(components, arg, dimension - 1); + }); + } + } else { + if (args2.length && dimension) { + args2.forEach((arg) => { + encodeArgs(components, arg); + }); + } + } + }; + const encodeArgs = (inputs = [], args2) => { + if (inputs.length) + inputs.forEach((input, i2) => { + const type2 = input.type; + if (args2[i2]) { + if (type2 === "address") + args2[i2] = _addressToHex(args2[i2]); + else if (type2.match(/^([^\x5b]*)(\x5b|$)/)[0] === "address[") + convertAddresses(args2[i2]); + else if (type2.indexOf("tuple") === 0) + if (extractSize(type2)) { + const dimension = extractArrayDim(type2); + mapTuple(input.components, args2[i2], dimension); + } else + encodeArgs(input.components, args2[i2]); + } + }); + }; + if (funABI.inputs && funABI.inputs.length) { + for (let i2 = 0; i2 < funABI.inputs.length; i2++) { + const type2 = funABI.inputs[i2].type; + if (type2 === "bool" && args[i2] === "false") { + args[i2] = false; + } + types2.push(type2.indexOf("tuple") === 0 ? buildFullTypeDefinition(funABI.inputs[i2]) : type2); + if (args.length < types2.length) { + args.push(""); + } + } + } + encodeArgs(funABI.inputs, args); + convertTypes(types2); + return abiCoder.encode(types2, args); +} +function decodeParamsV2ByABI(funABI, data) { + const convertTypeNames = (types2) => { + for (let i2 = 0; i2 < types2.length; i2++) { + const type2 = types2[i2]; + if (/^trcToken/.test(type2)) + types2[i2] = type2.replace(/^trcToken/, "uint256"); + } + }; + const convertAddresses = (addrArr) => { + if (Array.isArray(addrArr)) { + addrArr.forEach((addrs, i2) => { + addrArr[i2] = convertAddresses(addrs); + }); + return addrArr; + } else { + return TronWeb.address.toHex(addrArr); + } + }; + const mapTuple = (components, args, dimension) => { + if (dimension > 1) { + if (args.length) { + args.forEach((arg) => { + mapTuple(components, arg, dimension - 1); + }); + } + } else { + if (args.length && dimension) { + args.forEach((arg) => { + decodeResult(components, arg); + }); + } + } + }; + const buildFullTypeNameDefinition = (typeDef) => { + const name2 = typeDef.name ? ` ${typeDef.name}` : ""; + if (typeDef && typeDef.type.indexOf("tuple") === 0 && typeDef.components) { + const innerTypes = typeDef.components.map((innerType) => { + return buildFullTypeNameDefinition(innerType); + }); + return `tuple(${innerTypes.join(",")})${extractSize(typeDef.type)}${name2}`; + } + if (/trcToken/.test(typeDef.type)) + return typeDef.type.replace(/trcToken/, "uint256") + name2; + return typeDef.type + name2; + }; + const decodeResult = (outputs, result) => { + if (outputs.length) + outputs.forEach((output2, i2) => { + const { type: type2, name: name2 } = output2; + if (result[i2]) { + if (type2 === "address") { + result[i2] = TronWeb.address.toHex(result[i2]); + if (name2) + result[name2] = TronWeb.address.toHex(result[i2]); + } else if (type2.match(/^([^\x5b]*)(\x5b|$)/)[0] === "address[") { + convertAddresses(result[i2]); + if (name2) + result[name2] = convertAddresses(result[i2]); + } else if (type2.indexOf("tuple") === 0) { + if (extractSize(type2)) { + const dimension = extractArrayDim(type2); + mapTuple(output2.components, result[i2], dimension); + } else + decodeResult(output2.components, result[i2]); + if (name2) + result[name2] = result[i2]; + } else { + if (name2) + result[name2] = result[i2]; + } + } else { + if (name2) + result[name2] = result[i2]; + } + }); + }; + if ("outputs" in funABI && funABI.outputs && funABI.outputs.length > 0) { + const outputTypes = []; + for (let i2 = 0; i2 < funABI.outputs.length; i2++) { + const type2 = funABI.outputs[i2].type; + const name2 = funABI.outputs[i2].name ? ` ${funABI.outputs[i2].name}` : ""; + outputTypes.push(type2.indexOf("tuple") === 0 ? buildFullTypeNameDefinition(funABI.outputs[i2]) : type2 + name2); + } + convertTypeNames(outputTypes); + if (!data || !data.length) + data = new Uint8Array(32 * funABI.outputs.length); + const decodeRes = abiCoder.decode(outputTypes, data); + const decodeResCopy = decodeRes.toArray(true); + decodeResult(funABI.outputs, decodeResCopy); + return decodeResCopy; + } + return []; +} +const abi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + decodeParams, + decodeParamsV2ByABI, + encodeParams, + encodeParamsV2ByABI +}, Symbol.toStringTag, { value: "Module" })); +class Validator { + invalid(param) { + return param.msg || `Invalid ${param.name}${param.type === "address" ? " address" : ""} provided`; + } + notPositive(param) { + return `${param.name} must be a positive integer`; + } + notEqual(param) { + var _a3, _b2; + return param.msg || `${(_a3 = param.names) == null ? void 0 : _a3[0]} can not be equal to ${(_b2 = param.names) == null ? void 0 : _b2[1]}`; + } + notValid(params) { + const normalized = {}; + let no2 = false; + for (const param of params) { + const { name: name2, names, value, type: type2, gt: gt2, lt: lt2, gte, lte, optional: optional2 } = param; + if (optional2 && (!isNotNullOrUndefined(value) || type2 !== "boolean" && value === false)) + continue; + normalized[name2] = param.value; + switch (type2) { + case "address": + if (!isAddress(value)) { + no2 = true; + } else { + normalized[name2] = toHex$1(value); + } + break; + case "integer": + if (!isInteger(value) || typeof gt2 === "number" && value <= gt2 || typeof lt2 === "number" && value >= lt2 || typeof gte === "number" && value < gte || typeof lte === "number" && value > lte) { + no2 = true; + } + break; + case "positive-integer": + if (!isInteger(value) || value <= 0) { + throw new Error(this.notPositive(param)); + } + break; + case "tokenId": + if (!isString$1(value) || !value.length) { + no2 = true; + } + break; + case "notEmptyObject": + if (!isObject$2(value) || !Object.keys(value).length) { + no2 = true; + } + break; + case "notEqual": + if (names && normalized[names[0]] === normalized[names[1]]) { + throw new Error(this.notEqual(param)); + } + break; + case "resource": + if (!["BANDWIDTH", "ENERGY"].includes(value)) { + no2 = true; + } + break; + case "url": + if (!isValidURL(value)) { + no2 = true; + } + break; + case "hex": + if (!isHex(value)) { + no2 = true; + } + break; + case "array": + if (!Array.isArray(value)) { + no2 = true; + } + break; + case "not-empty-string": + if (!isString$1(value) || !value.length) { + no2 = true; + } + break; + case "boolean": + if (!isBoolean$1(value)) { + no2 = true; + } + break; + case "string": + if (!isString$1(value) || typeof gt2 === "number" && value.length <= gt2 || typeof lt2 === "number" && value.length >= lt2 || typeof gte === "number" && value.length < gte || typeof lte === "number" && value.length > lte) { + no2 = true; + } + break; + } + if (no2) { + throw new Error(this.invalid(param)); + } + } + return false; + } +} +var ContractType; +(function(ContractType2) { + ContractType2["AccountCreateContract"] = "AccountCreateContract"; + ContractType2["TransferContract"] = "TransferContract"; + ContractType2["TransferAssetContract"] = "TransferAssetContract"; + ContractType2["VoteAssetContract"] = "VoteAssetContract"; + ContractType2["VoteWitnessContract"] = "VoteWitnessContract"; + ContractType2["WitnessCreateContract"] = "WitnessCreateContract"; + ContractType2["AssetIssueContract"] = "AssetIssueContract"; + ContractType2["WitnessUpdateContract"] = "WitnessUpdateContract"; + ContractType2["ParticipateAssetIssueContract"] = "ParticipateAssetIssueContract"; + ContractType2["AccountUpdateContract"] = "AccountUpdateContract"; + ContractType2["FreezeBalanceContract"] = "FreezeBalanceContract"; + ContractType2["UnfreezeBalanceContract"] = "UnfreezeBalanceContract"; + ContractType2["CancelAllUnfreezeV2Contract"] = "CancelAllUnfreezeV2Contract"; + ContractType2["WithdrawBalanceContract"] = "WithdrawBalanceContract"; + ContractType2["UnfreezeAssetContract"] = "UnfreezeAssetContract"; + ContractType2["UpdateAssetContract"] = "UpdateAssetContract"; + ContractType2["ProposalCreateContract"] = "ProposalCreateContract"; + ContractType2["ProposalApproveContract"] = "ProposalApproveContract"; + ContractType2["ProposalDeleteContract"] = "ProposalDeleteContract"; + ContractType2["SetAccountIdContract"] = "SetAccountIdContract"; + ContractType2["CustomContract"] = "CustomContract"; + ContractType2["CreateSmartContract"] = "CreateSmartContract"; + ContractType2["TriggerSmartContract"] = "TriggerSmartContract"; + ContractType2["GetContract"] = "GetContract"; + ContractType2["UpdateSettingContract"] = "UpdateSettingContract"; + ContractType2["ExchangeCreateContract"] = "ExchangeCreateContract"; + ContractType2["ExchangeInjectContract"] = "ExchangeInjectContract"; + ContractType2["ExchangeWithdrawContract"] = "ExchangeWithdrawContract"; + ContractType2["ExchangeTransactionContract"] = "ExchangeTransactionContract"; + ContractType2["UpdateEnergyLimitContract"] = "UpdateEnergyLimitContract"; + ContractType2["AccountPermissionUpdateContract"] = "AccountPermissionUpdateContract"; + ContractType2["ClearABIContract"] = "ClearABIContract"; + ContractType2["UpdateBrokerageContract"] = "UpdateBrokerageContract"; + ContractType2["ShieldedTransferContract"] = "ShieldedTransferContract"; + ContractType2["MarketSellAssetContract"] = "MarketSellAssetContract"; + ContractType2["MarketCancelOrderContract"] = "MarketCancelOrderContract"; + ContractType2["FreezeBalanceV2Contract"] = "FreezeBalanceV2Contract"; + ContractType2["UnfreezeBalanceV2Contract"] = "UnfreezeBalanceV2Contract"; + ContractType2["WithdrawExpireUnfreezeContract"] = "WithdrawExpireUnfreezeContract"; + ContractType2["DelegateResourceContract"] = "DelegateResourceContract"; + ContractType2["UnDelegateResourceContract"] = "UnDelegateResourceContract"; + ContractType2["UNRECOGNIZED"] = "UNRECOGNIZED"; +})(ContractType || (ContractType = {})); +var Permission_PermissionType; +(function(Permission_PermissionType2) { + Permission_PermissionType2[Permission_PermissionType2["Owner"] = 0] = "Owner"; + Permission_PermissionType2[Permission_PermissionType2["Witness"] = 1] = "Witness"; + Permission_PermissionType2[Permission_PermissionType2["Active"] = 2] = "Active"; + Permission_PermissionType2[Permission_PermissionType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(Permission_PermissionType || (Permission_PermissionType = {})); +var AccountType; +(function(AccountType2) { + AccountType2[AccountType2["Normal"] = 0] = "Normal"; + AccountType2[AccountType2["AssetIssue"] = 1] = "AssetIssue"; + AccountType2[AccountType2["Contract"] = 2] = "Contract"; + AccountType2[AccountType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(AccountType || (AccountType = {})); +var any_pb = {}; +var googleProtobuf = {}; +(function(exports) { + var aa2 = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a3, b2, c2) { + a3 != Array.prototype && a3 != Object.prototype && (a3[b2] = c2.value); + }, e18 = "undefined" != typeof window && window === commonjsGlobal ? commonjsGlobal : "undefined" != typeof commonjsGlobal && null != commonjsGlobal ? commonjsGlobal : commonjsGlobal; + function ba2(a3, b2) { + if (b2) { + var c2 = e18; + a3 = a3.split("."); + for (var d4 = 0; d4 < a3.length - 1; d4++) { + var f4 = a3[d4]; + f4 in c2 || (c2[f4] = {}); + c2 = c2[f4]; + } + a3 = a3[a3.length - 1]; + d4 = c2[a3]; + b2 = b2(d4); + b2 != d4 && null != b2 && aa2(c2, a3, { configurable: true, writable: true, value: b2 }); + } + } + function ca2(a3) { + var b2 = 0; + return function() { + return b2 < a3.length ? { done: false, value: a3[b2++] } : { done: true }; + }; + } + function da2() { + da2 = function() { + }; + e18.Symbol || (e18.Symbol = ea2); + } + function fa2(a3, b2) { + this.a = a3; + aa2(this, "description", { configurable: true, writable: true, value: b2 }); + } + fa2.prototype.toString = function() { + return this.a; + }; + var ea2 = function() { + function a3(c2) { + if (this instanceof a3) + throw new TypeError("Symbol is not a constructor"); + return new fa2("jscomp_symbol_" + (c2 || "") + "_" + b2++, c2); + } + var b2 = 0; + return a3; + }(); + function ha2() { + da2(); + var a3 = e18.Symbol.iterator; + a3 || (a3 = e18.Symbol.iterator = e18.Symbol("Symbol.iterator")); + "function" != typeof Array.prototype[a3] && aa2(Array.prototype, a3, { configurable: true, writable: true, value: function() { + return ia2(ca2(this)); + } }); + ha2 = function() { + }; + } + function ia2(a3) { + ha2(); + a3 = { next: a3 }; + a3[e18.Symbol.iterator] = function() { + return this; + }; + return a3; + } + function ja2(a3, b2) { + ha2(); + a3 instanceof String && (a3 += ""); + var c2 = 0, d4 = { next: function() { + if (c2 < a3.length) { + var f4 = c2++; + return { value: b2(f4, a3[f4]), done: false }; + } + d4.next = function() { + return { done: true, value: void 0 }; + }; + return d4.next(); + } }; + d4[Symbol.iterator] = function() { + return d4; + }; + return d4; + } + ba2("Array.prototype.entries", function(a3) { + return a3 ? a3 : function() { + return ja2(this, function(b2, c2) { + return [b2, c2]; + }); + }; + }); + var ka2 = commonjsGlobal || self; + function g3(a3, b2, c2) { + a3 = a3.split("."); + c2 = c2 || ka2; + a3[0] in c2 || "undefined" == typeof c2.execScript || c2.execScript("var " + a3[0]); + for (var d4; a3.length && (d4 = a3.shift()); ) + a3.length || void 0 === b2 ? c2[d4] && c2[d4] !== Object.prototype[d4] ? c2 = c2[d4] : c2 = c2[d4] = {} : c2[d4] = b2; + } + function k2(a3) { + var b2 = typeof a3; + if ("object" == b2) + if (a3) { + if (a3 instanceof Array) + return "array"; + if (a3 instanceof Object) + return b2; + var c2 = Object.prototype.toString.call(a3); + if ("[object Window]" == c2) + return "object"; + if ("[object Array]" == c2 || "number" == typeof a3.length && "undefined" != typeof a3.splice && "undefined" != typeof a3.propertyIsEnumerable && !a3.propertyIsEnumerable("splice")) + return "array"; + if ("[object Function]" == c2 || "undefined" != typeof a3.call && "undefined" != typeof a3.propertyIsEnumerable && !a3.propertyIsEnumerable("call")) + return "function"; + } else + return "null"; + else if ("function" == b2 && "undefined" == typeof a3.call) + return "object"; + return b2; + } + function la2(a3) { + var b2 = typeof a3; + return "object" == b2 && null != a3 || "function" == b2; + } + function ma2(a3, b2, c2) { + g3(a3, b2, c2); + } + function na2(a3, b2) { + function c2() { + } + c2.prototype = b2.prototype; + a3.prototype = new c2(); + a3.prototype.constructor = a3; + } + var oa2 = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); + function pa2(a3, b2) { + for (var c2, d4, f4 = 1; f4 < arguments.length; f4++) { + d4 = arguments[f4]; + for (c2 in d4) + a3[c2] = d4[c2]; + for (var h4 = 0; h4 < oa2.length; h4++) + c2 = oa2[h4], Object.prototype.hasOwnProperty.call(d4, c2) && (a3[c2] = d4[c2]); + } + } + var qa2 = Array.prototype.forEach ? function(a3, b2) { + Array.prototype.forEach.call(a3, b2, void 0); + } : function(a3, b2) { + for (var c2 = a3.length, d4 = "string" === typeof a3 ? a3.split("") : a3, f4 = 0; f4 < c2; f4++) + f4 in d4 && b2.call(void 0, d4[f4], f4, a3); + }, l2 = Array.prototype.map ? function(a3, b2) { + return Array.prototype.map.call(a3, b2, void 0); + } : function(a3, b2) { + for (var c2 = a3.length, d4 = Array(c2), f4 = "string" === typeof a3 ? a3.split("") : a3, h4 = 0; h4 < c2; h4++) + h4 in f4 && (d4[h4] = b2.call(void 0, f4[h4], h4, a3)); + return d4; + }; + function ra2(a3, b2, c2) { + return 2 >= arguments.length ? Array.prototype.slice.call(a3, b2) : Array.prototype.slice.call(a3, b2, c2); + } + function sa2(a3, b2, c2, d4) { + var f4 = "Assertion failed"; + if (c2) { + f4 += ": " + c2; + var h4 = d4; + } else + a3 && (f4 += ": " + a3, h4 = b2); + throw Error(f4, h4 || []); + } + function n5(a3, b2, c2) { + for (var d4 = [], f4 = 2; f4 < arguments.length; ++f4) + d4[f4 - 2] = arguments[f4]; + a3 || sa2("", null, b2, d4); + return a3; + } + function ta2(a3, b2, c2) { + for (var d4 = [], f4 = 2; f4 < arguments.length; ++f4) + d4[f4 - 2] = arguments[f4]; + "string" !== typeof a3 && sa2("Expected string but got %s: %s.", [k2(a3), a3], b2, d4); + } + function ua2(a3, b2, c2) { + for (var d4 = [], f4 = 2; f4 < arguments.length; ++f4) + d4[f4 - 2] = arguments[f4]; + Array.isArray(a3) || sa2("Expected array but got %s: %s.", [k2(a3), a3], b2, d4); + } + function p3(a3, b2) { + for (var c2 = [], d4 = 1; d4 < arguments.length; ++d4) + c2[d4 - 1] = arguments[d4]; + throw Error("Failure" + (a3 ? ": " + a3 : ""), c2); + } + function q2(a3, b2, c2, d4) { + for (var f4 = [], h4 = 3; h4 < arguments.length; ++h4) + f4[h4 - 3] = arguments[h4]; + a3 instanceof b2 || sa2("Expected instanceof %s but got %s.", [va2(b2), va2(a3)], c2, f4); + } + function va2(a3) { + return a3 instanceof Function ? a3.displayName || a3.name || "unknown type name" : a3 instanceof Object ? a3.constructor.displayName || a3.constructor.name || Object.prototype.toString.call(a3) : null === a3 ? "null" : typeof a3; + } + function r2(a3, b2) { + this.c = a3; + this.b = b2; + this.a = {}; + this.arrClean = true; + if (0 < this.c.length) { + for (a3 = 0; a3 < this.c.length; a3++) { + b2 = this.c[a3]; + var c2 = b2[0]; + this.a[c2.toString()] = new wa2(c2, b2[1]); + } + this.arrClean = true; + } + } + g3("jspb.Map", r2, void 0); + r2.prototype.g = function() { + if (this.arrClean) { + if (this.b) { + var a3 = this.a, b2; + for (b2 in a3) + if (Object.prototype.hasOwnProperty.call(a3, b2)) { + var c2 = a3[b2].a; + c2 && c2.g(); + } + } + } else { + this.c.length = 0; + a3 = u2(this); + a3.sort(); + for (b2 = 0; b2 < a3.length; b2++) { + var d4 = this.a[a3[b2]]; + (c2 = d4.a) && c2.g(); + this.c.push([d4.key, d4.value]); + } + this.arrClean = true; + } + return this.c; + }; + r2.prototype.toArray = r2.prototype.g; + r2.prototype.Mc = function(a3, b2) { + for (var c2 = this.g(), d4 = [], f4 = 0; f4 < c2.length; f4++) { + var h4 = this.a[c2[f4][0].toString()]; + v6(this, h4); + var m3 = h4.a; + m3 ? (n5(b2), d4.push([h4.key, b2(a3, m3)])) : d4.push([h4.key, h4.value]); + } + return d4; + }; + r2.prototype.toObject = r2.prototype.Mc; + r2.fromObject = function(a3, b2, c2) { + b2 = new r2([], b2); + for (var d4 = 0; d4 < a3.length; d4++) { + var f4 = a3[d4][0], h4 = c2(a3[d4][1]); + b2.set(f4, h4); + } + return b2; + }; + function w2(a3) { + this.a = 0; + this.b = a3; + } + w2.prototype.next = function() { + return this.a < this.b.length ? { done: false, value: this.b[this.a++] } : { done: true, value: void 0 }; + }; + "undefined" != typeof Symbol && (w2.prototype[Symbol.iterator] = function() { + return this; + }); + r2.prototype.Jb = function() { + return u2(this).length; + }; + r2.prototype.getLength = r2.prototype.Jb; + r2.prototype.clear = function() { + this.a = {}; + this.arrClean = false; + }; + r2.prototype.clear = r2.prototype.clear; + r2.prototype.Cb = function(a3) { + a3 = a3.toString(); + var b2 = this.a.hasOwnProperty(a3); + delete this.a[a3]; + this.arrClean = false; + return b2; + }; + r2.prototype.del = r2.prototype.Cb; + r2.prototype.Eb = function() { + var a3 = [], b2 = u2(this); + b2.sort(); + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = this.a[b2[c2]]; + a3.push([d4.key, d4.value]); + } + return a3; + }; + r2.prototype.getEntryList = r2.prototype.Eb; + r2.prototype.entries = function() { + var a3 = [], b2 = u2(this); + b2.sort(); + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = this.a[b2[c2]]; + a3.push([d4.key, v6(this, d4)]); + } + return new w2(a3); + }; + r2.prototype.entries = r2.prototype.entries; + r2.prototype.keys = function() { + var a3 = [], b2 = u2(this); + b2.sort(); + for (var c2 = 0; c2 < b2.length; c2++) + a3.push(this.a[b2[c2]].key); + return new w2(a3); + }; + r2.prototype.keys = r2.prototype.keys; + r2.prototype.values = function() { + var a3 = [], b2 = u2(this); + b2.sort(); + for (var c2 = 0; c2 < b2.length; c2++) + a3.push(v6(this, this.a[b2[c2]])); + return new w2(a3); + }; + r2.prototype.values = r2.prototype.values; + r2.prototype.forEach = function(a3, b2) { + var c2 = u2(this); + c2.sort(); + for (var d4 = 0; d4 < c2.length; d4++) { + var f4 = this.a[c2[d4]]; + a3.call(b2, v6(this, f4), f4.key, this); + } + }; + r2.prototype.forEach = r2.prototype.forEach; + r2.prototype.set = function(a3, b2) { + var c2 = new wa2(a3); + this.b ? (c2.a = b2, c2.value = b2.g()) : c2.value = b2; + this.a[a3.toString()] = c2; + this.arrClean = false; + return this; + }; + r2.prototype.set = r2.prototype.set; + function v6(a3, b2) { + return a3.b ? (b2.a || (b2.a = new a3.b(b2.value)), b2.a) : b2.value; + } + r2.prototype.get = function(a3) { + if (a3 = this.a[a3.toString()]) + return v6(this, a3); + }; + r2.prototype.get = r2.prototype.get; + r2.prototype.has = function(a3) { + return a3.toString() in this.a; + }; + r2.prototype.has = r2.prototype.has; + r2.prototype.Jc = function(a3, b2, c2, d4, f4) { + var h4 = u2(this); + h4.sort(); + for (var m3 = 0; m3 < h4.length; m3++) { + var t2 = this.a[h4[m3]]; + b2.Va(a3); + c2.call(b2, 1, t2.key); + this.b ? d4.call(b2, 2, v6(this, t2), f4) : d4.call(b2, 2, t2.value); + b2.Ya(); + } + }; + r2.prototype.serializeBinary = r2.prototype.Jc; + r2.deserializeBinary = function(a3, b2, c2, d4, f4, h4, m3) { + for (; b2.oa() && !b2.bb(); ) { + var t2 = b2.c; + 1 == t2 ? h4 = c2.call(b2) : 2 == t2 && (a3.b ? (n5(f4), m3 || (m3 = new a3.b()), d4.call(b2, m3, f4)) : m3 = d4.call(b2)); + } + n5(void 0 != h4); + n5(void 0 != m3); + a3.set(h4, m3); + }; + function u2(a3) { + a3 = a3.a; + var b2 = [], c2; + for (c2 in a3) + Object.prototype.hasOwnProperty.call(a3, c2) && b2.push(c2); + return b2; + } + function wa2(a3, b2) { + this.key = a3; + this.value = b2; + this.a = void 0; + } + function xa2(a3) { + if (8192 >= a3.length) + return String.fromCharCode.apply(null, a3); + for (var b2 = "", c2 = 0; c2 < a3.length; c2 += 8192) + b2 += String.fromCharCode.apply(null, ra2(a3, c2, c2 + 8192)); + return b2; + } + var ya2 = { "\0": "\\0", "\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", " ": "\\t", "\v": "\\x0B", '"': '\\"', "\\": "\\\\", "<": "\\u003C" }, za2 = { "'": "\\'" }; + var Aa2 = {}, x3 = null; + function Ba2(a3, b2) { + void 0 === b2 && (b2 = 0); + Ca2(); + b2 = Aa2[b2]; + for (var c2 = [], d4 = 0; d4 < a3.length; d4 += 3) { + var f4 = a3[d4], h4 = d4 + 1 < a3.length, m3 = h4 ? a3[d4 + 1] : 0, t2 = d4 + 2 < a3.length, B2 = t2 ? a3[d4 + 2] : 0, M3 = f4 >> 2; + f4 = (f4 & 3) << 4 | m3 >> 4; + m3 = (m3 & 15) << 2 | B2 >> 6; + B2 &= 63; + t2 || (B2 = 64, h4 || (m3 = 64)); + c2.push(b2[M3], b2[f4], b2[m3] || "", b2[B2] || ""); + } + return c2.join(""); + } + function Da2(a3) { + var b2 = a3.length, c2 = 3 * b2 / 4; + c2 % 3 ? c2 = Math.floor(c2) : -1 != "=.".indexOf(a3[b2 - 1]) && (c2 = -1 != "=.".indexOf(a3[b2 - 2]) ? c2 - 2 : c2 - 1); + var d4 = new Uint8Array(c2), f4 = 0; + Ea2(a3, function(h4) { + d4[f4++] = h4; + }); + return d4.subarray(0, f4); + } + function Ea2(a3, b2) { + function c2(B2) { + for (; d4 < a3.length; ) { + var M3 = a3.charAt(d4++), La2 = x3[M3]; + if (null != La2) + return La2; + if (!/^[\s\xa0]*$/.test(M3)) + throw Error("Unknown base64 encoding at char: " + M3); + } + return B2; + } + Ca2(); + for (var d4 = 0; ; ) { + var f4 = c2(-1), h4 = c2(0), m3 = c2(64), t2 = c2(64); + if (64 === t2 && -1 === f4) + break; + b2(f4 << 2 | h4 >> 4); + 64 != m3 && (b2(h4 << 4 & 240 | m3 >> 2), 64 != t2 && b2(m3 << 6 & 192 | t2)); + } + } + function Ca2() { + if (!x3) { + x3 = {}; + for (var a3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""), b2 = ["+/=", "+/", "-_=", "-_.", "-_"], c2 = 0; 5 > c2; c2++) { + var d4 = a3.concat(b2[c2].split("")); + Aa2[c2] = d4; + for (var f4 = 0; f4 < d4.length; f4++) { + var h4 = d4[f4]; + void 0 === x3[h4] && (x3[h4] = f4); + } + } + } + } + g3("jspb.ConstBinaryMessage", function() { + }, void 0); + g3("jspb.BinaryMessage", function() { + }, void 0); + g3("jspb.BinaryConstants.FieldType", { yb: -1, ee: 1, FLOAT: 2, ke: 3, te: 4, je: 5, xb: 6, wb: 7, BOOL: 8, re: 9, ie: 10, le: 11, ce: 12, se: 13, ge: 14, me: 15, ne: 16, oe: 17, pe: 18, he: 30, ve: 31 }, void 0); + g3("jspb.BinaryConstants.WireType", { yb: -1, ue: 0, xb: 1, de: 2, qe: 3, fe: 4, wb: 5 }, void 0); + g3("jspb.BinaryConstants.FieldTypeToWireType", function(a3) { + switch (a3) { + case 5: + case 3: + case 13: + case 4: + case 17: + case 18: + case 8: + case 14: + case 31: + return 0; + case 1: + case 6: + case 16: + case 30: + return 1; + case 9: + case 11: + case 12: + return 2; + case 2: + case 7: + case 15: + return 5; + default: + return -1; + } + }, void 0); + g3("jspb.BinaryConstants.INVALID_FIELD_NUMBER", -1, void 0); + g3("jspb.BinaryConstants.FLOAT32_EPS", 1401298464324817e-60, void 0); + g3("jspb.BinaryConstants.FLOAT32_MIN", 11754943508222875e-54, void 0); + g3("jspb.BinaryConstants.FLOAT32_MAX", 34028234663852886e22, void 0); + g3("jspb.BinaryConstants.FLOAT64_EPS", 5e-324, void 0); + g3("jspb.BinaryConstants.FLOAT64_MIN", 22250738585072014e-324, void 0); + g3("jspb.BinaryConstants.FLOAT64_MAX", 17976931348623157e292, void 0); + g3("jspb.BinaryConstants.TWO_TO_20", 1048576, void 0); + g3("jspb.BinaryConstants.TWO_TO_23", 8388608, void 0); + g3("jspb.BinaryConstants.TWO_TO_31", 2147483648, void 0); + g3("jspb.BinaryConstants.TWO_TO_32", 4294967296, void 0); + g3("jspb.BinaryConstants.TWO_TO_52", 4503599627370496, void 0); + g3("jspb.BinaryConstants.TWO_TO_63", 9223372036854776e3, void 0); + g3("jspb.BinaryConstants.TWO_TO_64", 18446744073709552e3, void 0); + g3("jspb.BinaryConstants.ZERO_HASH", "\0\0\0\0\0\0\0\0", void 0); + var y3 = 0, z3 = 0; + g3("jspb.utils.getSplit64Low", function() { + return y3; + }, void 0); + g3("jspb.utils.getSplit64High", function() { + return z3; + }, void 0); + function Fa2(a3) { + var b2 = a3 >>> 0; + a3 = Math.floor((a3 - b2) / 4294967296) >>> 0; + y3 = b2; + z3 = a3; + } + g3("jspb.utils.splitUint64", Fa2, void 0); + function A2(a3) { + var b2 = 0 > a3; + a3 = Math.abs(a3); + var c2 = a3 >>> 0; + a3 = Math.floor((a3 - c2) / 4294967296); + a3 >>>= 0; + b2 && (a3 = ~a3 >>> 0, c2 = (~c2 >>> 0) + 1, 4294967295 < c2 && (c2 = 0, a3++, 4294967295 < a3 && (a3 = 0))); + y3 = c2; + z3 = a3; + } + g3("jspb.utils.splitInt64", A2, void 0); + function Ga2(a3) { + var b2 = 0 > a3; + a3 = 2 * Math.abs(a3); + Fa2(a3); + a3 = y3; + var c2 = z3; + b2 && (0 == a3 ? 0 == c2 ? c2 = a3 = 4294967295 : (c2--, a3 = 4294967295) : a3--); + y3 = a3; + z3 = c2; + } + g3("jspb.utils.splitZigzag64", Ga2, void 0); + function Ha2(a3) { + var b2 = 0 > a3 ? 1 : 0; + a3 = b2 ? -a3 : a3; + if (0 === a3) + 0 < 1 / a3 ? y3 = z3 = 0 : (z3 = 0, y3 = 2147483648); + else if (isNaN(a3)) + z3 = 0, y3 = 2147483647; + else if (34028234663852886e22 < a3) + z3 = 0, y3 = (b2 << 31 | 2139095040) >>> 0; + else if (11754943508222875e-54 > a3) + a3 = Math.round(a3 / Math.pow(2, -149)), z3 = 0, y3 = (b2 << 31 | a3) >>> 0; + else { + var c2 = Math.floor(Math.log(a3) / Math.LN2); + a3 *= Math.pow(2, -c2); + a3 = Math.round(8388608 * a3); + 16777216 <= a3 && ++c2; + z3 = 0; + y3 = (b2 << 31 | c2 + 127 << 23 | a3 & 8388607) >>> 0; + } + } + g3("jspb.utils.splitFloat32", Ha2, void 0); + function Ia2(a3) { + var b2 = 0 > a3 ? 1 : 0; + a3 = b2 ? -a3 : a3; + if (0 === a3) + z3 = 0 < 1 / a3 ? 0 : 2147483648, y3 = 0; + else if (isNaN(a3)) + z3 = 2147483647, y3 = 4294967295; + else if (17976931348623157e292 < a3) + z3 = (b2 << 31 | 2146435072) >>> 0, y3 = 0; + else if (22250738585072014e-324 > a3) + a3 /= Math.pow(2, -1074), z3 = (b2 << 31 | a3 / 4294967296) >>> 0, y3 = a3 >>> 0; + else { + var c2 = a3, d4 = 0; + if (2 <= c2) + for (; 2 <= c2 && 1023 > d4; ) + d4++, c2 /= 2; + else + for (; 1 > c2 && -1022 < d4; ) + c2 *= 2, d4--; + a3 *= Math.pow(2, -d4); + z3 = (b2 << 31 | d4 + 1023 << 20 | 1048576 * a3 & 1048575) >>> 0; + y3 = 4503599627370496 * a3 >>> 0; + } + } + g3("jspb.utils.splitFloat64", Ia2, void 0); + function C3(a3) { + var b2 = a3.charCodeAt(4), c2 = a3.charCodeAt(5), d4 = a3.charCodeAt(6), f4 = a3.charCodeAt(7); + y3 = a3.charCodeAt(0) + (a3.charCodeAt(1) << 8) + (a3.charCodeAt(2) << 16) + (a3.charCodeAt(3) << 24) >>> 0; + z3 = b2 + (c2 << 8) + (d4 << 16) + (f4 << 24) >>> 0; + } + g3("jspb.utils.splitHash64", C3, void 0); + function D2(a3, b2) { + return 4294967296 * b2 + (a3 >>> 0); + } + g3("jspb.utils.joinUint64", D2, void 0); + function E2(a3, b2) { + var c2 = b2 & 2147483648; + c2 && (a3 = ~a3 + 1 >>> 0, b2 = ~b2 >>> 0, 0 == a3 && (b2 = b2 + 1 >>> 0)); + a3 = D2(a3, b2); + return c2 ? -a3 : a3; + } + g3("jspb.utils.joinInt64", E2, void 0); + function Ja2(a3, b2, c2) { + var d4 = b2 >> 31; + return c2(a3 << 1 ^ d4, (b2 << 1 | a3 >>> 31) ^ d4); + } + g3("jspb.utils.toZigzag64", Ja2, void 0); + function Ka2(a3, b2) { + return Ma2(a3, b2, E2); + } + g3("jspb.utils.joinZigzag64", Ka2, void 0); + function Ma2(a3, b2, c2) { + var d4 = -(a3 & 1); + return c2((a3 >>> 1 | b2 << 31) ^ d4, b2 >>> 1 ^ d4); + } + g3("jspb.utils.fromZigzag64", Ma2, void 0); + function Na2(a3) { + var b2 = 2 * (a3 >> 31) + 1, c2 = a3 >>> 23 & 255; + a3 &= 8388607; + return 255 == c2 ? a3 ? NaN : Infinity * b2 : 0 == c2 ? b2 * Math.pow(2, -149) * a3 : b2 * Math.pow(2, c2 - 150) * (a3 + Math.pow(2, 23)); + } + g3("jspb.utils.joinFloat32", Na2, void 0); + function Oa2(a3, b2) { + var c2 = 2 * (b2 >> 31) + 1, d4 = b2 >>> 20 & 2047; + a3 = 4294967296 * (b2 & 1048575) + a3; + return 2047 == d4 ? a3 ? NaN : Infinity * c2 : 0 == d4 ? c2 * Math.pow(2, -1074) * a3 : c2 * Math.pow(2, d4 - 1075) * (a3 + 4503599627370496); + } + g3("jspb.utils.joinFloat64", Oa2, void 0); + function Pa2(a3, b2) { + return String.fromCharCode(a3 >>> 0 & 255, a3 >>> 8 & 255, a3 >>> 16 & 255, a3 >>> 24 & 255, b2 >>> 0 & 255, b2 >>> 8 & 255, b2 >>> 16 & 255, b2 >>> 24 & 255); + } + g3("jspb.utils.joinHash64", Pa2, void 0); + g3("jspb.utils.DIGITS", "0123456789abcdef".split(""), void 0); + function F2(a3, b2) { + function c2(f4, h4) { + f4 = f4 ? String(f4) : ""; + return h4 ? "0000000".slice(f4.length) + f4 : f4; + } + if (2097151 >= b2) + return "" + D2(a3, b2); + var d4 = (a3 >>> 24 | b2 << 8) >>> 0 & 16777215; + b2 = b2 >> 16 & 65535; + a3 = (a3 & 16777215) + 6777216 * d4 + 6710656 * b2; + d4 += 8147497 * b2; + b2 *= 2; + 1e7 <= a3 && (d4 += Math.floor(a3 / 1e7), a3 %= 1e7); + 1e7 <= d4 && (b2 += Math.floor(d4 / 1e7), d4 %= 1e7); + return c2(b2, 0) + c2(d4, b2) + c2(a3, 1); + } + g3("jspb.utils.joinUnsignedDecimalString", F2, void 0); + function G2(a3, b2) { + var c2 = b2 & 2147483648; + c2 && (a3 = ~a3 + 1 >>> 0, b2 = ~b2 + (0 == a3 ? 1 : 0) >>> 0); + a3 = F2(a3, b2); + return c2 ? "-" + a3 : a3; + } + g3("jspb.utils.joinSignedDecimalString", G2, void 0); + function Qa2(a3, b2) { + C3(a3); + a3 = y3; + var c2 = z3; + return b2 ? G2(a3, c2) : F2(a3, c2); + } + g3("jspb.utils.hash64ToDecimalString", Qa2, void 0); + g3("jspb.utils.hash64ArrayToDecimalStrings", function(a3, b2) { + for (var c2 = Array(a3.length), d4 = 0; d4 < a3.length; d4++) + c2[d4] = Qa2(a3[d4], b2); + return c2; + }, void 0); + function H2(a3) { + function b2(m3, t2) { + for (var B2 = 0; 8 > B2 && (1 !== m3 || 0 < t2); B2++) + t2 = m3 * f4[B2] + t2, f4[B2] = t2 & 255, t2 >>>= 8; + } + function c2() { + for (var m3 = 0; 8 > m3; m3++) + f4[m3] = ~f4[m3] & 255; + } + n5(0 < a3.length); + var d4 = false; + "-" === a3[0] && (d4 = true, a3 = a3.slice(1)); + for (var f4 = [0, 0, 0, 0, 0, 0, 0, 0], h4 = 0; h4 < a3.length; h4++) + b2(10, a3.charCodeAt(h4) - 48); + d4 && (c2(), b2(1, 1)); + return xa2(f4); + } + g3("jspb.utils.decimalStringToHash64", H2, void 0); + g3("jspb.utils.splitDecimalString", function(a3) { + C3(H2(a3)); + }, void 0); + function Ra2(a3) { + return String.fromCharCode(10 > a3 ? 48 + a3 : 87 + a3); + } + function Sa2(a3) { + return 97 <= a3 ? a3 - 97 + 10 : a3 - 48; + } + g3("jspb.utils.hash64ToHexString", function(a3) { + var b2 = Array(18); + b2[0] = "0"; + b2[1] = "x"; + for (var c2 = 0; 8 > c2; c2++) { + var d4 = a3.charCodeAt(7 - c2); + b2[2 * c2 + 2] = Ra2(d4 >> 4); + b2[2 * c2 + 3] = Ra2(d4 & 15); + } + return b2.join(""); + }, void 0); + g3("jspb.utils.hexStringToHash64", function(a3) { + a3 = a3.toLowerCase(); + n5(18 == a3.length); + n5("0" == a3[0]); + n5("x" == a3[1]); + for (var b2 = "", c2 = 0; 8 > c2; c2++) + b2 = String.fromCharCode(16 * Sa2(a3.charCodeAt(2 * c2 + 2)) + Sa2(a3.charCodeAt(2 * c2 + 3))) + b2; + return b2; + }, void 0); + g3("jspb.utils.hash64ToNumber", function(a3, b2) { + C3(a3); + a3 = y3; + var c2 = z3; + return b2 ? E2(a3, c2) : D2(a3, c2); + }, void 0); + g3("jspb.utils.numberToHash64", function(a3) { + A2(a3); + return Pa2(y3, z3); + }, void 0); + g3("jspb.utils.countVarints", function(a3, b2, c2) { + for (var d4 = 0, f4 = b2; f4 < c2; f4++) + d4 += a3[f4] >> 7; + return c2 - b2 - d4; + }, void 0); + g3("jspb.utils.countVarintFields", function(a3, b2, c2, d4) { + var f4 = 0; + d4 *= 8; + if (128 > d4) + for (; b2 < c2 && a3[b2++] == d4; ) + for (f4++; ; ) { + var h4 = a3[b2++]; + if (0 == (h4 & 128)) + break; + } + else + for (; b2 < c2; ) { + for (h4 = d4; 128 < h4; ) { + if (a3[b2] != (h4 & 127 | 128)) + return f4; + b2++; + h4 >>= 7; + } + if (a3[b2++] != h4) + break; + for (f4++; h4 = a3[b2++], 0 != (h4 & 128); ) + ; + } + return f4; + }, void 0); + function Ta2(a3, b2, c2, d4, f4) { + var h4 = 0; + if (128 > d4) + for (; b2 < c2 && a3[b2++] == d4; ) + h4++, b2 += f4; + else + for (; b2 < c2; ) { + for (var m3 = d4; 128 < m3; ) { + if (a3[b2++] != (m3 & 127 | 128)) + return h4; + m3 >>= 7; + } + if (a3[b2++] != m3) + break; + h4++; + b2 += f4; + } + return h4; + } + g3("jspb.utils.countFixed32Fields", function(a3, b2, c2, d4) { + return Ta2(a3, b2, c2, 8 * d4 + 5, 4); + }, void 0); + g3("jspb.utils.countFixed64Fields", function(a3, b2, c2, d4) { + return Ta2(a3, b2, c2, 8 * d4 + 1, 8); + }, void 0); + g3("jspb.utils.countDelimitedFields", function(a3, b2, c2, d4) { + var f4 = 0; + for (d4 = 8 * d4 + 2; b2 < c2; ) { + for (var h4 = d4; 128 < h4; ) { + if (a3[b2++] != (h4 & 127 | 128)) + return f4; + h4 >>= 7; + } + if (a3[b2++] != h4) + break; + f4++; + for (var m3 = 0, t2 = 1; h4 = a3[b2++], m3 += (h4 & 127) * t2, t2 *= 128, 0 != (h4 & 128); ) + ; + b2 += m3; + } + return f4; + }, void 0); + g3("jspb.utils.debugBytesToTextFormat", function(a3) { + var b2 = '"'; + if (a3) { + a3 = Ua2(a3); + for (var c2 = 0; c2 < a3.length; c2++) + b2 += "\\x", 16 > a3[c2] && (b2 += "0"), b2 += a3[c2].toString(16); + } + return b2 + '"'; + }, void 0); + g3("jspb.utils.debugScalarToTextFormat", function(a3) { + if ("string" === typeof a3) { + a3 = String(a3); + for (var b2 = ['"'], c2 = 0; c2 < a3.length; c2++) { + var d4 = a3.charAt(c2), f4 = d4.charCodeAt(0), h4 = c2 + 1, m3; + if (!(m3 = ya2[d4])) { + if (!(31 < f4 && 127 > f4)) + if (f4 = d4, f4 in za2) + d4 = za2[f4]; + else if (f4 in ya2) + d4 = za2[f4] = ya2[f4]; + else { + m3 = f4.charCodeAt(0); + if (31 < m3 && 127 > m3) + d4 = f4; + else { + if (256 > m3) { + if (d4 = "\\x", 16 > m3 || 256 < m3) + d4 += "0"; + } else + d4 = "\\u", 4096 > m3 && (d4 += "0"); + d4 += m3.toString(16).toUpperCase(); + } + d4 = za2[f4] = d4; + } + m3 = d4; + } + b2[h4] = m3; + } + b2.push('"'); + a3 = b2.join(""); + } else + a3 = a3.toString(); + return a3; + }, void 0); + g3("jspb.utils.stringToByteArray", function(a3) { + for (var b2 = new Uint8Array(a3.length), c2 = 0; c2 < a3.length; c2++) { + var d4 = a3.charCodeAt(c2); + if (255 < d4) + throw Error("Conversion error: string contains codepoint outside of byte range"); + b2[c2] = d4; + } + return b2; + }, void 0); + function Ua2(a3) { + if (a3.constructor === Uint8Array) + return a3; + if (a3.constructor === ArrayBuffer) + return new Uint8Array(a3); + if (a3.constructor === Array) + return new Uint8Array(a3); + if (a3.constructor === String) + return Da2(a3); + if (a3 instanceof Uint8Array) + return new Uint8Array(a3.buffer, a3.byteOffset, a3.byteLength); + p3("Type not convertible to Uint8Array."); + return new Uint8Array(0); + } + g3("jspb.utils.byteSourceToUint8Array", Ua2, void 0); + function I2(a3, b2, c2) { + this.b = null; + this.a = this.c = this.h = 0; + this.v = false; + a3 && this.H(a3, b2, c2); + } + g3("jspb.BinaryDecoder", I2, void 0); + var Va2 = []; + I2.getInstanceCacheLength = function() { + return Va2.length; + }; + function Wa2(a3, b2, c2) { + if (Va2.length) { + var d4 = Va2.pop(); + a3 && d4.H(a3, b2, c2); + return d4; + } + return new I2(a3, b2, c2); + } + I2.alloc = Wa2; + I2.prototype.Ca = function() { + this.clear(); + 100 > Va2.length && Va2.push(this); + }; + I2.prototype.free = I2.prototype.Ca; + I2.prototype.clone = function() { + return Wa2(this.b, this.h, this.c - this.h); + }; + I2.prototype.clone = I2.prototype.clone; + I2.prototype.clear = function() { + this.b = null; + this.a = this.c = this.h = 0; + this.v = false; + }; + I2.prototype.clear = I2.prototype.clear; + I2.prototype.Y = function() { + return this.b; + }; + I2.prototype.getBuffer = I2.prototype.Y; + I2.prototype.H = function(a3, b2, c2) { + this.b = Ua2(a3); + this.h = void 0 !== b2 ? b2 : 0; + this.c = void 0 !== c2 ? this.h + c2 : this.b.length; + this.a = this.h; + }; + I2.prototype.setBlock = I2.prototype.H; + I2.prototype.Db = function() { + return this.c; + }; + I2.prototype.getEnd = I2.prototype.Db; + I2.prototype.setEnd = function(a3) { + this.c = a3; + }; + I2.prototype.setEnd = I2.prototype.setEnd; + I2.prototype.reset = function() { + this.a = this.h; + }; + I2.prototype.reset = I2.prototype.reset; + I2.prototype.B = function() { + return this.a; + }; + I2.prototype.getCursor = I2.prototype.B; + I2.prototype.Ma = function(a3) { + this.a = a3; + }; + I2.prototype.setCursor = I2.prototype.Ma; + I2.prototype.advance = function(a3) { + this.a += a3; + n5(this.a <= this.c); + }; + I2.prototype.advance = I2.prototype.advance; + I2.prototype.ya = function() { + return this.a == this.c; + }; + I2.prototype.atEnd = I2.prototype.ya; + I2.prototype.Qb = function() { + return this.a > this.c; + }; + I2.prototype.pastEnd = I2.prototype.Qb; + I2.prototype.getError = function() { + return this.v || 0 > this.a || this.a > this.c; + }; + I2.prototype.getError = I2.prototype.getError; + I2.prototype.w = function(a3) { + for (var b2 = 128, c2 = 0, d4 = 0, f4 = 0; 4 > f4 && 128 <= b2; f4++) + b2 = this.b[this.a++], c2 |= (b2 & 127) << 7 * f4; + 128 <= b2 && (b2 = this.b[this.a++], c2 |= (b2 & 127) << 28, d4 |= (b2 & 127) >> 4); + if (128 <= b2) + for (f4 = 0; 5 > f4 && 128 <= b2; f4++) + b2 = this.b[this.a++], d4 |= (b2 & 127) << 7 * f4 + 3; + if (128 > b2) + return a3(c2 >>> 0, d4 >>> 0); + p3("Failed to read varint, encoding is invalid."); + this.v = true; + }; + I2.prototype.readSplitVarint64 = I2.prototype.w; + I2.prototype.ea = function(a3) { + return this.w(function(b2, c2) { + return Ma2(b2, c2, a3); + }); + }; + I2.prototype.readSplitZigzagVarint64 = I2.prototype.ea; + I2.prototype.ta = function(a3) { + var b2 = this.b, c2 = this.a; + this.a += 8; + for (var d4 = 0, f4 = 0, h4 = c2 + 7; h4 >= c2; h4--) + d4 = d4 << 8 | b2[h4], f4 = f4 << 8 | b2[h4 + 4]; + return a3(d4, f4); + }; + I2.prototype.readSplitFixed64 = I2.prototype.ta; + I2.prototype.kb = function() { + for (; this.b[this.a] & 128; ) + this.a++; + this.a++; + }; + I2.prototype.skipVarint = I2.prototype.kb; + I2.prototype.mb = function(a3) { + for (; 128 < a3; ) + this.a--, a3 >>>= 7; + this.a--; + }; + I2.prototype.unskipVarint = I2.prototype.mb; + I2.prototype.o = function() { + var a3 = this.b; + var b2 = a3[this.a]; + var c2 = b2 & 127; + if (128 > b2) + return this.a += 1, n5(this.a <= this.c), c2; + b2 = a3[this.a + 1]; + c2 |= (b2 & 127) << 7; + if (128 > b2) + return this.a += 2, n5(this.a <= this.c), c2; + b2 = a3[this.a + 2]; + c2 |= (b2 & 127) << 14; + if (128 > b2) + return this.a += 3, n5(this.a <= this.c), c2; + b2 = a3[this.a + 3]; + c2 |= (b2 & 127) << 21; + if (128 > b2) + return this.a += 4, n5(this.a <= this.c), c2; + b2 = a3[this.a + 4]; + c2 |= (b2 & 15) << 28; + if (128 > b2) + return this.a += 5, n5(this.a <= this.c), c2 >>> 0; + this.a += 5; + 128 <= a3[this.a++] && 128 <= a3[this.a++] && 128 <= a3[this.a++] && 128 <= a3[this.a++] && 128 <= a3[this.a++] && n5(false); + n5(this.a <= this.c); + return c2; + }; + I2.prototype.readUnsignedVarint32 = I2.prototype.o; + I2.prototype.da = function() { + return ~~this.o(); + }; + I2.prototype.readSignedVarint32 = I2.prototype.da; + I2.prototype.O = function() { + return this.o().toString(); + }; + I2.prototype.Ea = function() { + return this.da().toString(); + }; + I2.prototype.readSignedVarint32String = I2.prototype.Ea; + I2.prototype.Ia = function() { + var a3 = this.o(); + return a3 >>> 1 ^ -(a3 & 1); + }; + I2.prototype.readZigzagVarint32 = I2.prototype.Ia; + I2.prototype.Ga = function() { + return this.w(D2); + }; + I2.prototype.readUnsignedVarint64 = I2.prototype.Ga; + I2.prototype.Ha = function() { + return this.w(F2); + }; + I2.prototype.readUnsignedVarint64String = I2.prototype.Ha; + I2.prototype.sa = function() { + return this.w(E2); + }; + I2.prototype.readSignedVarint64 = I2.prototype.sa; + I2.prototype.Fa = function() { + return this.w(G2); + }; + I2.prototype.readSignedVarint64String = I2.prototype.Fa; + I2.prototype.Ja = function() { + return this.w(Ka2); + }; + I2.prototype.readZigzagVarint64 = I2.prototype.Ja; + I2.prototype.fb = function() { + return this.ea(Pa2); + }; + I2.prototype.readZigzagVarintHash64 = I2.prototype.fb; + I2.prototype.Ka = function() { + return this.ea(G2); + }; + I2.prototype.readZigzagVarint64String = I2.prototype.Ka; + I2.prototype.Gc = function() { + var a3 = this.b[this.a]; + this.a += 1; + n5(this.a <= this.c); + return a3; + }; + I2.prototype.readUint8 = I2.prototype.Gc; + I2.prototype.Ec = function() { + var a3 = this.b[this.a], b2 = this.b[this.a + 1]; + this.a += 2; + n5(this.a <= this.c); + return a3 << 0 | b2 << 8; + }; + I2.prototype.readUint16 = I2.prototype.Ec; + I2.prototype.m = function() { + var a3 = this.b[this.a], b2 = this.b[this.a + 1], c2 = this.b[this.a + 2], d4 = this.b[this.a + 3]; + this.a += 4; + n5(this.a <= this.c); + return (a3 << 0 | b2 << 8 | c2 << 16 | d4 << 24) >>> 0; + }; + I2.prototype.readUint32 = I2.prototype.m; + I2.prototype.ga = function() { + var a3 = this.m(), b2 = this.m(); + return D2(a3, b2); + }; + I2.prototype.readUint64 = I2.prototype.ga; + I2.prototype.ha = function() { + var a3 = this.m(), b2 = this.m(); + return F2(a3, b2); + }; + I2.prototype.readUint64String = I2.prototype.ha; + I2.prototype.Xb = function() { + var a3 = this.b[this.a]; + this.a += 1; + n5(this.a <= this.c); + return a3 << 24 >> 24; + }; + I2.prototype.readInt8 = I2.prototype.Xb; + I2.prototype.Vb = function() { + var a3 = this.b[this.a], b2 = this.b[this.a + 1]; + this.a += 2; + n5(this.a <= this.c); + return (a3 << 0 | b2 << 8) << 16 >> 16; + }; + I2.prototype.readInt16 = I2.prototype.Vb; + I2.prototype.P = function() { + var a3 = this.b[this.a], b2 = this.b[this.a + 1], c2 = this.b[this.a + 2], d4 = this.b[this.a + 3]; + this.a += 4; + n5(this.a <= this.c); + return a3 << 0 | b2 << 8 | c2 << 16 | d4 << 24; + }; + I2.prototype.readInt32 = I2.prototype.P; + I2.prototype.ba = function() { + var a3 = this.m(), b2 = this.m(); + return E2(a3, b2); + }; + I2.prototype.readInt64 = I2.prototype.ba; + I2.prototype.ca = function() { + var a3 = this.m(), b2 = this.m(); + return G2(a3, b2); + }; + I2.prototype.readInt64String = I2.prototype.ca; + I2.prototype.aa = function() { + var a3 = this.m(); + return Na2(a3); + }; + I2.prototype.readFloat = I2.prototype.aa; + I2.prototype.Z = function() { + var a3 = this.m(), b2 = this.m(); + return Oa2(a3, b2); + }; + I2.prototype.readDouble = I2.prototype.Z; + I2.prototype.pa = function() { + return !!this.b[this.a++]; + }; + I2.prototype.readBool = I2.prototype.pa; + I2.prototype.ra = function() { + return this.da(); + }; + I2.prototype.readEnum = I2.prototype.ra; + I2.prototype.fa = function(a3) { + var b2 = this.b, c2 = this.a; + a3 = c2 + a3; + for (var d4 = [], f4 = ""; c2 < a3; ) { + var h4 = b2[c2++]; + if (128 > h4) + d4.push(h4); + else if (192 > h4) + continue; + else if (224 > h4) { + var m3 = b2[c2++]; + d4.push((h4 & 31) << 6 | m3 & 63); + } else if (240 > h4) { + m3 = b2[c2++]; + var t2 = b2[c2++]; + d4.push((h4 & 15) << 12 | (m3 & 63) << 6 | t2 & 63); + } else if (248 > h4) { + m3 = b2[c2++]; + t2 = b2[c2++]; + var B2 = b2[c2++]; + h4 = (h4 & 7) << 18 | (m3 & 63) << 12 | (t2 & 63) << 6 | B2 & 63; + h4 -= 65536; + d4.push((h4 >> 10 & 1023) + 55296, (h4 & 1023) + 56320); + } + 8192 <= d4.length && (f4 += String.fromCharCode.apply(null, d4), d4.length = 0); + } + f4 += xa2(d4); + this.a = c2; + return f4; + }; + I2.prototype.readString = I2.prototype.fa; + I2.prototype.Dc = function() { + var a3 = this.o(); + return this.fa(a3); + }; + I2.prototype.readStringWithLength = I2.prototype.Dc; + I2.prototype.qa = function(a3) { + if (0 > a3 || this.a + a3 > this.b.length) + return this.v = true, p3("Invalid byte length!"), new Uint8Array(0); + var b2 = this.b.subarray(this.a, this.a + a3); + this.a += a3; + n5(this.a <= this.c); + return b2; + }; + I2.prototype.readBytes = I2.prototype.qa; + I2.prototype.ia = function() { + return this.w(Pa2); + }; + I2.prototype.readVarintHash64 = I2.prototype.ia; + I2.prototype.$ = function() { + var a3 = this.b, b2 = this.a, c2 = a3[b2], d4 = a3[b2 + 1], f4 = a3[b2 + 2], h4 = a3[b2 + 3], m3 = a3[b2 + 4], t2 = a3[b2 + 5], B2 = a3[b2 + 6]; + a3 = a3[b2 + 7]; + this.a += 8; + return String.fromCharCode(c2, d4, f4, h4, m3, t2, B2, a3); + }; + I2.prototype.readFixedHash64 = I2.prototype.$; + function J2(a3, b2, c2) { + this.a = Wa2(a3, b2, c2); + this.O = this.a.B(); + this.b = this.c = -1; + this.h = false; + this.v = null; + } + g3("jspb.BinaryReader", J2, void 0); + var K3 = []; + J2.clearInstanceCache = function() { + K3 = []; + }; + J2.getInstanceCacheLength = function() { + return K3.length; + }; + function Xa2(a3, b2, c2) { + if (K3.length) { + var d4 = K3.pop(); + a3 && d4.a.H(a3, b2, c2); + return d4; + } + return new J2(a3, b2, c2); + } + J2.alloc = Xa2; + J2.prototype.zb = Xa2; + J2.prototype.alloc = J2.prototype.zb; + J2.prototype.Ca = function() { + this.a.clear(); + this.b = this.c = -1; + this.h = false; + this.v = null; + 100 > K3.length && K3.push(this); + }; + J2.prototype.free = J2.prototype.Ca; + J2.prototype.Fb = function() { + return this.O; + }; + J2.prototype.getFieldCursor = J2.prototype.Fb; + J2.prototype.B = function() { + return this.a.B(); + }; + J2.prototype.getCursor = J2.prototype.B; + J2.prototype.Y = function() { + return this.a.Y(); + }; + J2.prototype.getBuffer = J2.prototype.Y; + J2.prototype.Hb = function() { + return this.c; + }; + J2.prototype.getFieldNumber = J2.prototype.Hb; + J2.prototype.Lb = function() { + return this.b; + }; + J2.prototype.getWireType = J2.prototype.Lb; + J2.prototype.Mb = function() { + return 2 == this.b; + }; + J2.prototype.isDelimited = J2.prototype.Mb; + J2.prototype.bb = function() { + return 4 == this.b; + }; + J2.prototype.isEndGroup = J2.prototype.bb; + J2.prototype.getError = function() { + return this.h || this.a.getError(); + }; + J2.prototype.getError = J2.prototype.getError; + J2.prototype.H = function(a3, b2, c2) { + this.a.H(a3, b2, c2); + this.b = this.c = -1; + }; + J2.prototype.setBlock = J2.prototype.H; + J2.prototype.reset = function() { + this.a.reset(); + this.b = this.c = -1; + }; + J2.prototype.reset = J2.prototype.reset; + J2.prototype.advance = function(a3) { + this.a.advance(a3); + }; + J2.prototype.advance = J2.prototype.advance; + J2.prototype.oa = function() { + if (this.a.ya()) + return false; + if (this.getError()) + return p3("Decoder hit an error"), false; + this.O = this.a.B(); + var a3 = this.a.o(), b2 = a3 >>> 3; + a3 &= 7; + if (0 != a3 && 5 != a3 && 1 != a3 && 2 != a3 && 3 != a3 && 4 != a3) + return p3("Invalid wire type: %s (at position %s)", a3, this.O), this.h = true, false; + this.c = b2; + this.b = a3; + return true; + }; + J2.prototype.nextField = J2.prototype.oa; + J2.prototype.Oa = function() { + this.a.mb(this.c << 3 | this.b); + }; + J2.prototype.unskipHeader = J2.prototype.Oa; + J2.prototype.Lc = function() { + var a3 = this.c; + for (this.Oa(); this.oa() && this.c == a3; ) + this.C(); + this.a.ya() || this.Oa(); + }; + J2.prototype.skipMatchingFields = J2.prototype.Lc; + J2.prototype.lb = function() { + 0 != this.b ? (p3("Invalid wire type for skipVarintField"), this.C()) : this.a.kb(); + }; + J2.prototype.skipVarintField = J2.prototype.lb; + J2.prototype.gb = function() { + if (2 != this.b) + p3("Invalid wire type for skipDelimitedField"), this.C(); + else { + var a3 = this.a.o(); + this.a.advance(a3); + } + }; + J2.prototype.skipDelimitedField = J2.prototype.gb; + J2.prototype.hb = function() { + 5 != this.b ? (p3("Invalid wire type for skipFixed32Field"), this.C()) : this.a.advance(4); + }; + J2.prototype.skipFixed32Field = J2.prototype.hb; + J2.prototype.ib = function() { + 1 != this.b ? (p3("Invalid wire type for skipFixed64Field"), this.C()) : this.a.advance(8); + }; + J2.prototype.skipFixed64Field = J2.prototype.ib; + J2.prototype.jb = function() { + var a3 = this.c; + do { + if (!this.oa()) { + p3("Unmatched start-group tag: stream EOF"); + this.h = true; + break; + } + if (4 == this.b) { + this.c != a3 && (p3("Unmatched end-group tag"), this.h = true); + break; + } + this.C(); + } while (1); + }; + J2.prototype.skipGroup = J2.prototype.jb; + J2.prototype.C = function() { + switch (this.b) { + case 0: + this.lb(); + break; + case 1: + this.ib(); + break; + case 2: + this.gb(); + break; + case 5: + this.hb(); + break; + case 3: + this.jb(); + break; + default: + p3("Invalid wire encoding for field."); + } + }; + J2.prototype.skipField = J2.prototype.C; + J2.prototype.Hc = function(a3, b2) { + null === this.v && (this.v = {}); + n5(!this.v[a3]); + this.v[a3] = b2; + }; + J2.prototype.registerReadCallback = J2.prototype.Hc; + J2.prototype.Ic = function(a3) { + n5(null !== this.v); + a3 = this.v[a3]; + n5(a3); + return a3(this); + }; + J2.prototype.runReadCallback = J2.prototype.Ic; + J2.prototype.Yb = function(a3, b2) { + n5(2 == this.b); + var c2 = this.a.c, d4 = this.a.o(); + d4 = this.a.B() + d4; + this.a.setEnd(d4); + b2(a3, this); + this.a.Ma(d4); + this.a.setEnd(c2); + }; + J2.prototype.readMessage = J2.prototype.Yb; + J2.prototype.Ub = function(a3, b2, c2) { + n5(3 == this.b); + n5(this.c == a3); + c2(b2, this); + this.h || 4 == this.b || (p3("Group submessage did not end with an END_GROUP tag"), this.h = true); + }; + J2.prototype.readGroup = J2.prototype.Ub; + J2.prototype.Gb = function() { + n5(2 == this.b); + var a3 = this.a.o(), b2 = this.a.B(), c2 = b2 + a3; + a3 = Wa2(this.a.Y(), b2, a3); + this.a.Ma(c2); + return a3; + }; + J2.prototype.getFieldDecoder = J2.prototype.Gb; + J2.prototype.P = function() { + n5(0 == this.b); + return this.a.da(); + }; + J2.prototype.readInt32 = J2.prototype.P; + J2.prototype.Wb = function() { + n5(0 == this.b); + return this.a.Ea(); + }; + J2.prototype.readInt32String = J2.prototype.Wb; + J2.prototype.ba = function() { + n5(0 == this.b); + return this.a.sa(); + }; + J2.prototype.readInt64 = J2.prototype.ba; + J2.prototype.ca = function() { + n5(0 == this.b); + return this.a.Fa(); + }; + J2.prototype.readInt64String = J2.prototype.ca; + J2.prototype.m = function() { + n5(0 == this.b); + return this.a.o(); + }; + J2.prototype.readUint32 = J2.prototype.m; + J2.prototype.Fc = function() { + n5(0 == this.b); + return this.a.O(); + }; + J2.prototype.readUint32String = J2.prototype.Fc; + J2.prototype.ga = function() { + n5(0 == this.b); + return this.a.Ga(); + }; + J2.prototype.readUint64 = J2.prototype.ga; + J2.prototype.ha = function() { + n5(0 == this.b); + return this.a.Ha(); + }; + J2.prototype.readUint64String = J2.prototype.ha; + J2.prototype.zc = function() { + n5(0 == this.b); + return this.a.Ia(); + }; + J2.prototype.readSint32 = J2.prototype.zc; + J2.prototype.Ac = function() { + n5(0 == this.b); + return this.a.Ja(); + }; + J2.prototype.readSint64 = J2.prototype.Ac; + J2.prototype.Bc = function() { + n5(0 == this.b); + return this.a.Ka(); + }; + J2.prototype.readSint64String = J2.prototype.Bc; + J2.prototype.Rb = function() { + n5(5 == this.b); + return this.a.m(); + }; + J2.prototype.readFixed32 = J2.prototype.Rb; + J2.prototype.Sb = function() { + n5(1 == this.b); + return this.a.ga(); + }; + J2.prototype.readFixed64 = J2.prototype.Sb; + J2.prototype.Tb = function() { + n5(1 == this.b); + return this.a.ha(); + }; + J2.prototype.readFixed64String = J2.prototype.Tb; + J2.prototype.vc = function() { + n5(5 == this.b); + return this.a.P(); + }; + J2.prototype.readSfixed32 = J2.prototype.vc; + J2.prototype.wc = function() { + n5(5 == this.b); + return this.a.P().toString(); + }; + J2.prototype.readSfixed32String = J2.prototype.wc; + J2.prototype.xc = function() { + n5(1 == this.b); + return this.a.ba(); + }; + J2.prototype.readSfixed64 = J2.prototype.xc; + J2.prototype.yc = function() { + n5(1 == this.b); + return this.a.ca(); + }; + J2.prototype.readSfixed64String = J2.prototype.yc; + J2.prototype.aa = function() { + n5(5 == this.b); + return this.a.aa(); + }; + J2.prototype.readFloat = J2.prototype.aa; + J2.prototype.Z = function() { + n5(1 == this.b); + return this.a.Z(); + }; + J2.prototype.readDouble = J2.prototype.Z; + J2.prototype.pa = function() { + n5(0 == this.b); + return !!this.a.o(); + }; + J2.prototype.readBool = J2.prototype.pa; + J2.prototype.ra = function() { + n5(0 == this.b); + return this.a.sa(); + }; + J2.prototype.readEnum = J2.prototype.ra; + J2.prototype.fa = function() { + n5(2 == this.b); + var a3 = this.a.o(); + return this.a.fa(a3); + }; + J2.prototype.readString = J2.prototype.fa; + J2.prototype.qa = function() { + n5(2 == this.b); + var a3 = this.a.o(); + return this.a.qa(a3); + }; + J2.prototype.readBytes = J2.prototype.qa; + J2.prototype.ia = function() { + n5(0 == this.b); + return this.a.ia(); + }; + J2.prototype.readVarintHash64 = J2.prototype.ia; + J2.prototype.Cc = function() { + n5(0 == this.b); + return this.a.fb(); + }; + J2.prototype.readSintHash64 = J2.prototype.Cc; + J2.prototype.w = function(a3) { + n5(0 == this.b); + return this.a.w(a3); + }; + J2.prototype.readSplitVarint64 = J2.prototype.w; + J2.prototype.ea = function(a3) { + n5(0 == this.b); + return this.a.w(function(b2, c2) { + return Ma2(b2, c2, a3); + }); + }; + J2.prototype.readSplitZigzagVarint64 = J2.prototype.ea; + J2.prototype.$ = function() { + n5(1 == this.b); + return this.a.$(); + }; + J2.prototype.readFixedHash64 = J2.prototype.$; + J2.prototype.ta = function(a3) { + n5(1 == this.b); + return this.a.ta(a3); + }; + J2.prototype.readSplitFixed64 = J2.prototype.ta; + function L4(a3, b2) { + n5(2 == a3.b); + var c2 = a3.a.o(); + c2 = a3.a.B() + c2; + for (var d4 = []; a3.a.B() < c2; ) + d4.push(b2.call(a3.a)); + return d4; + } + J2.prototype.gc = function() { + return L4(this, this.a.da); + }; + J2.prototype.readPackedInt32 = J2.prototype.gc; + J2.prototype.hc = function() { + return L4(this, this.a.Ea); + }; + J2.prototype.readPackedInt32String = J2.prototype.hc; + J2.prototype.ic = function() { + return L4(this, this.a.sa); + }; + J2.prototype.readPackedInt64 = J2.prototype.ic; + J2.prototype.jc = function() { + return L4(this, this.a.Fa); + }; + J2.prototype.readPackedInt64String = J2.prototype.jc; + J2.prototype.qc = function() { + return L4(this, this.a.o); + }; + J2.prototype.readPackedUint32 = J2.prototype.qc; + J2.prototype.rc = function() { + return L4(this, this.a.O); + }; + J2.prototype.readPackedUint32String = J2.prototype.rc; + J2.prototype.sc = function() { + return L4(this, this.a.Ga); + }; + J2.prototype.readPackedUint64 = J2.prototype.sc; + J2.prototype.tc = function() { + return L4(this, this.a.Ha); + }; + J2.prototype.readPackedUint64String = J2.prototype.tc; + J2.prototype.nc = function() { + return L4(this, this.a.Ia); + }; + J2.prototype.readPackedSint32 = J2.prototype.nc; + J2.prototype.oc = function() { + return L4(this, this.a.Ja); + }; + J2.prototype.readPackedSint64 = J2.prototype.oc; + J2.prototype.pc = function() { + return L4(this, this.a.Ka); + }; + J2.prototype.readPackedSint64String = J2.prototype.pc; + J2.prototype.bc = function() { + return L4(this, this.a.m); + }; + J2.prototype.readPackedFixed32 = J2.prototype.bc; + J2.prototype.cc = function() { + return L4(this, this.a.ga); + }; + J2.prototype.readPackedFixed64 = J2.prototype.cc; + J2.prototype.dc = function() { + return L4(this, this.a.ha); + }; + J2.prototype.readPackedFixed64String = J2.prototype.dc; + J2.prototype.kc = function() { + return L4(this, this.a.P); + }; + J2.prototype.readPackedSfixed32 = J2.prototype.kc; + J2.prototype.lc = function() { + return L4(this, this.a.ba); + }; + J2.prototype.readPackedSfixed64 = J2.prototype.lc; + J2.prototype.mc = function() { + return L4(this, this.a.ca); + }; + J2.prototype.readPackedSfixed64String = J2.prototype.mc; + J2.prototype.fc = function() { + return L4(this, this.a.aa); + }; + J2.prototype.readPackedFloat = J2.prototype.fc; + J2.prototype.$b = function() { + return L4(this, this.a.Z); + }; + J2.prototype.readPackedDouble = J2.prototype.$b; + J2.prototype.Zb = function() { + return L4(this, this.a.pa); + }; + J2.prototype.readPackedBool = J2.prototype.Zb; + J2.prototype.ac = function() { + return L4(this, this.a.ra); + }; + J2.prototype.readPackedEnum = J2.prototype.ac; + J2.prototype.uc = function() { + return L4(this, this.a.ia); + }; + J2.prototype.readPackedVarintHash64 = J2.prototype.uc; + J2.prototype.ec = function() { + return L4(this, this.a.$); + }; + J2.prototype.readPackedFixedHash64 = J2.prototype.ec; + function Ya2(a3, b2, c2, d4, f4) { + this.ma = a3; + this.Ba = b2; + this.la = c2; + this.Na = d4; + this.na = f4; + } + g3("jspb.ExtensionFieldInfo", Ya2, void 0); + function Za2(a3, b2, c2, d4, f4, h4) { + this.Za = a3; + this.za = b2; + this.Aa = c2; + this.Wa = d4; + this.Ab = f4; + this.Nb = h4; + } + g3("jspb.ExtensionFieldBinaryInfo", Za2, void 0); + Ya2.prototype.F = function() { + return !!this.la; + }; + Ya2.prototype.isMessageType = Ya2.prototype.F; + function N2() { + } + g3("jspb.Message", N2, void 0); + N2.GENERATE_TO_OBJECT = true; + N2.GENERATE_FROM_OBJECT = true; + var $a2 = "function" == typeof Uint8Array; + N2.prototype.Ib = function() { + return this.b; + }; + N2.prototype.getJsPbMessageId = N2.prototype.Ib; + N2.initialize = function(a3, b2, c2, d4, f4, h4) { + a3.f = null; + b2 || (b2 = c2 ? [c2] : []); + a3.b = c2 ? String(c2) : void 0; + a3.D = 0 === c2 ? -1 : 0; + a3.u = b2; + a: { + c2 = a3.u.length; + b2 = -1; + if (c2 && (b2 = c2 - 1, c2 = a3.u[b2], !(null === c2 || "object" != typeof c2 || Array.isArray(c2) || $a2 && c2 instanceof Uint8Array))) { + a3.G = b2 - a3.D; + a3.i = c2; + break a; + } + -1 < d4 ? (a3.G = Math.max(d4, b2 + 1 - a3.D), a3.i = null) : a3.G = Number.MAX_VALUE; + } + a3.a = {}; + if (f4) + for (d4 = 0; d4 < f4.length; d4++) + b2 = f4[d4], b2 < a3.G ? (b2 += a3.D, a3.u[b2] = a3.u[b2] || ab2) : (bb2(a3), a3.i[b2] = a3.i[b2] || ab2); + if (h4 && h4.length) + for (d4 = 0; d4 < h4.length; d4++) + cb2(a3, h4[d4]); + }; + var ab2 = Object.freeze ? Object.freeze([]) : []; + function bb2(a3) { + var b2 = a3.G + a3.D; + a3.u[b2] || (a3.i = a3.u[b2] = {}); + } + function db2(a3, b2, c2) { + for (var d4 = [], f4 = 0; f4 < a3.length; f4++) + d4[f4] = b2.call(a3[f4], c2, a3[f4]); + return d4; + } + N2.toObjectList = db2; + N2.toObjectExtension = function(a3, b2, c2, d4, f4) { + for (var h4 in c2) { + var m3 = c2[h4], t2 = d4.call(a3, m3); + if (null != t2) { + for (var B2 in m3.Ba) + if (m3.Ba.hasOwnProperty(B2)) + break; + b2[B2] = m3.Na ? m3.na ? db2(t2, m3.Na, f4) : m3.Na(f4, t2) : t2; + } + } + }; + N2.serializeBinaryExtensions = function(a3, b2, c2, d4) { + for (var f4 in c2) { + var h4 = c2[f4], m3 = h4.Za; + if (!h4.Aa) + throw Error("Message extension present that was generated without binary serialization support"); + var t2 = d4.call(a3, m3); + if (null != t2) + if (m3.F()) + if (h4.Wa) + h4.Aa.call(b2, m3.ma, t2, h4.Wa); + else + throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format"); + else + h4.Aa.call(b2, m3.ma, t2); + } + }; + N2.readBinaryExtension = function(a3, b2, c2, d4, f4) { + var h4 = c2[b2.c]; + if (h4) { + c2 = h4.Za; + if (!h4.za) + throw Error("Deserializing extension whose generated code does not support binary format"); + if (c2.F()) { + var m3 = new c2.la(); + h4.za.call(b2, m3, h4.Ab); + } else + m3 = h4.za.call(b2); + c2.na && !h4.Nb ? (b2 = d4.call(a3, c2)) ? b2.push(m3) : f4.call(a3, c2, [m3]) : f4.call(a3, c2, m3); + } else + b2.C(); + }; + function O3(a3, b2) { + if (b2 < a3.G) { + b2 += a3.D; + var c2 = a3.u[b2]; + return c2 === ab2 ? a3.u[b2] = [] : c2; + } + if (a3.i) + return c2 = a3.i[b2], c2 === ab2 ? a3.i[b2] = [] : c2; + } + N2.getField = O3; + N2.getRepeatedField = function(a3, b2) { + return O3(a3, b2); + }; + function eb2(a3, b2) { + a3 = O3(a3, b2); + return null == a3 ? a3 : +a3; + } + N2.getOptionalFloatingPointField = eb2; + function fb2(a3, b2) { + a3 = O3(a3, b2); + return null == a3 ? a3 : !!a3; + } + N2.getBooleanField = fb2; + N2.getRepeatedFloatingPointField = function(a3, b2) { + var c2 = O3(a3, b2); + a3.a || (a3.a = {}); + if (!a3.a[b2]) { + for (var d4 = 0; d4 < c2.length; d4++) + c2[d4] = +c2[d4]; + a3.a[b2] = true; + } + return c2; + }; + N2.getRepeatedBooleanField = function(a3, b2) { + var c2 = O3(a3, b2); + a3.a || (a3.a = {}); + if (!a3.a[b2]) { + for (var d4 = 0; d4 < c2.length; d4++) + c2[d4] = !!c2[d4]; + a3.a[b2] = true; + } + return c2; + }; + function gb2(a3) { + if (null == a3 || "string" === typeof a3) + return a3; + if ($a2 && a3 instanceof Uint8Array) + return Ba2(a3); + p3("Cannot coerce to b64 string: " + k2(a3)); + return null; + } + N2.bytesAsB64 = gb2; + function hb2(a3) { + if (null == a3 || a3 instanceof Uint8Array) + return a3; + if ("string" === typeof a3) + return Da2(a3); + p3("Cannot coerce to Uint8Array: " + k2(a3)); + return null; + } + N2.bytesAsU8 = hb2; + N2.bytesListAsB64 = function(a3) { + ib2(a3); + return a3.length && "string" !== typeof a3[0] ? l2(a3, gb2) : a3; + }; + N2.bytesListAsU8 = function(a3) { + ib2(a3); + return !a3.length || a3[0] instanceof Uint8Array ? a3 : l2(a3, hb2); + }; + function ib2(a3) { + if (a3 && 1 < a3.length) { + var b2 = k2(a3[0]); + qa2(a3, function(c2) { + k2(c2) != b2 && p3("Inconsistent type in JSPB repeated field array. Got " + k2(c2) + " expected " + b2); + }); + } + } + function jb2(a3, b2, c2) { + a3 = O3(a3, b2); + return null == a3 ? c2 : a3; + } + N2.getFieldWithDefault = jb2; + N2.getBooleanFieldWithDefault = function(a3, b2, c2) { + a3 = fb2(a3, b2); + return null == a3 ? c2 : a3; + }; + N2.getFloatingPointFieldWithDefault = function(a3, b2, c2) { + a3 = eb2(a3, b2); + return null == a3 ? c2 : a3; + }; + N2.getFieldProto3 = jb2; + N2.getMapField = function(a3, b2, c2, d4) { + a3.f || (a3.f = {}); + if (b2 in a3.f) + return a3.f[b2]; + var f4 = O3(a3, b2); + if (!f4) { + if (c2) + return; + f4 = []; + P2(a3, b2, f4); + } + return a3.f[b2] = new r2(f4, d4); + }; + function P2(a3, b2, c2) { + q2(a3, N2); + b2 < a3.G ? a3.u[b2 + a3.D] = c2 : (bb2(a3), a3.i[b2] = c2); + return a3; + } + N2.setField = P2; + N2.setProto3IntField = function(a3, b2, c2) { + return Q2(a3, b2, c2, 0); + }; + N2.setProto3FloatField = function(a3, b2, c2) { + return Q2(a3, b2, c2, 0); + }; + N2.setProto3BooleanField = function(a3, b2, c2) { + return Q2(a3, b2, c2, false); + }; + N2.setProto3StringField = function(a3, b2, c2) { + return Q2(a3, b2, c2, ""); + }; + N2.setProto3BytesField = function(a3, b2, c2) { + return Q2(a3, b2, c2, ""); + }; + N2.setProto3EnumField = function(a3, b2, c2) { + return Q2(a3, b2, c2, 0); + }; + N2.setProto3StringIntField = function(a3, b2, c2) { + return Q2(a3, b2, c2, "0"); + }; + function Q2(a3, b2, c2, d4) { + q2(a3, N2); + c2 !== d4 ? P2(a3, b2, c2) : b2 < a3.G ? a3.u[b2 + a3.D] = null : (bb2(a3), delete a3.i[b2]); + return a3; + } + N2.addToRepeatedField = function(a3, b2, c2, d4) { + q2(a3, N2); + b2 = O3(a3, b2); + void 0 != d4 ? b2.splice(d4, 0, c2) : b2.push(c2); + return a3; + }; + function kb2(a3, b2, c2, d4) { + q2(a3, N2); + (c2 = cb2(a3, c2)) && c2 !== b2 && void 0 !== d4 && (a3.f && c2 in a3.f && (a3.f[c2] = void 0), P2(a3, c2, void 0)); + return P2(a3, b2, d4); + } + N2.setOneofField = kb2; + function cb2(a3, b2) { + for (var c2, d4, f4 = 0; f4 < b2.length; f4++) { + var h4 = b2[f4], m3 = O3(a3, h4); + null != m3 && (c2 = h4, d4 = m3, P2(a3, h4, void 0)); + } + return c2 ? (P2(a3, c2, d4), c2) : 0; + } + N2.computeOneofCase = cb2; + N2.getWrapperField = function(a3, b2, c2, d4) { + a3.f || (a3.f = {}); + if (!a3.f[c2]) { + var f4 = O3(a3, c2); + if (d4 || f4) + a3.f[c2] = new b2(f4); + } + return a3.f[c2]; + }; + N2.getRepeatedWrapperField = function(a3, b2, c2) { + lb2(a3, b2, c2); + b2 = a3.f[c2]; + b2 == ab2 && (b2 = a3.f[c2] = []); + return b2; + }; + function lb2(a3, b2, c2) { + a3.f || (a3.f = {}); + if (!a3.f[c2]) { + for (var d4 = O3(a3, c2), f4 = [], h4 = 0; h4 < d4.length; h4++) + f4[h4] = new b2(d4[h4]); + a3.f[c2] = f4; + } + } + N2.setWrapperField = function(a3, b2, c2) { + q2(a3, N2); + a3.f || (a3.f = {}); + var d4 = c2 ? c2.g() : c2; + a3.f[b2] = c2; + return P2(a3, b2, d4); + }; + N2.setOneofWrapperField = function(a3, b2, c2, d4) { + q2(a3, N2); + a3.f || (a3.f = {}); + var f4 = d4 ? d4.g() : d4; + a3.f[b2] = d4; + return kb2(a3, b2, c2, f4); + }; + N2.setRepeatedWrapperField = function(a3, b2, c2) { + q2(a3, N2); + a3.f || (a3.f = {}); + c2 = c2 || []; + for (var d4 = [], f4 = 0; f4 < c2.length; f4++) + d4[f4] = c2[f4].g(); + a3.f[b2] = c2; + return P2(a3, b2, d4); + }; + N2.addToRepeatedWrapperField = function(a3, b2, c2, d4, f4) { + lb2(a3, d4, b2); + var h4 = a3.f[b2]; + h4 || (h4 = a3.f[b2] = []); + c2 = c2 ? c2 : new d4(); + a3 = O3(a3, b2); + void 0 != f4 ? (h4.splice(f4, 0, c2), a3.splice(f4, 0, c2.g())) : (h4.push(c2), a3.push(c2.g())); + return c2; + }; + N2.toMap = function(a3, b2, c2, d4) { + for (var f4 = {}, h4 = 0; h4 < a3.length; h4++) + f4[b2.call(a3[h4])] = c2 ? c2.call(a3[h4], d4, a3[h4]) : a3[h4]; + return f4; + }; + function mb2(a3) { + if (a3.f) + for (var b2 in a3.f) { + var c2 = a3.f[b2]; + if (Array.isArray(c2)) + for (var d4 = 0; d4 < c2.length; d4++) + c2[d4] && c2[d4].g(); + else + c2 && c2.g(); + } + } + N2.prototype.g = function() { + mb2(this); + return this.u; + }; + N2.prototype.toArray = N2.prototype.g; + N2.prototype.toString = function() { + mb2(this); + return this.u.toString(); + }; + N2.prototype.getExtension = function(a3) { + if (this.i) { + this.f || (this.f = {}); + var b2 = a3.ma; + if (a3.na) { + if (a3.F()) + return this.f[b2] || (this.f[b2] = l2(this.i[b2] || [], function(c2) { + return new a3.la(c2); + })), this.f[b2]; + } else if (a3.F()) + return !this.f[b2] && this.i[b2] && (this.f[b2] = new a3.la(this.i[b2])), this.f[b2]; + return this.i[b2]; + } + }; + N2.prototype.getExtension = N2.prototype.getExtension; + N2.prototype.Kc = function(a3, b2) { + this.f || (this.f = {}); + bb2(this); + var c2 = a3.ma; + a3.na ? (b2 = b2 || [], a3.F() ? (this.f[c2] = b2, this.i[c2] = l2(b2, function(d4) { + return d4.g(); + })) : this.i[c2] = b2) : a3.F() ? (this.f[c2] = b2, this.i[c2] = b2 ? b2.g() : b2) : this.i[c2] = b2; + return this; + }; + N2.prototype.setExtension = N2.prototype.Kc; + N2.difference = function(a3, b2) { + if (!(a3 instanceof b2.constructor)) + throw Error("Messages have different types."); + var c2 = a3.g(); + b2 = b2.g(); + var d4 = [], f4 = 0, h4 = c2.length > b2.length ? c2.length : b2.length; + a3.b && (d4[0] = a3.b, f4 = 1); + for (; f4 < h4; f4++) + nb2(c2[f4], b2[f4]) || (d4[f4] = b2[f4]); + return new a3.constructor(d4); + }; + N2.equals = function(a3, b2) { + return a3 == b2 || !(!a3 || !b2) && a3 instanceof b2.constructor && nb2(a3.g(), b2.g()); + }; + function ob2(a3, b2) { + a3 = a3 || {}; + b2 = b2 || {}; + var c2 = {}, d4; + for (d4 in a3) + c2[d4] = 0; + for (d4 in b2) + c2[d4] = 0; + for (d4 in c2) + if (!nb2(a3[d4], b2[d4])) + return false; + return true; + } + N2.compareExtensions = ob2; + function nb2(a3, b2) { + if (a3 == b2) + return true; + if (!la2(a3) || !la2(b2)) + return "number" === typeof a3 && isNaN(a3) || "number" === typeof b2 && isNaN(b2) ? String(a3) == String(b2) : false; + if (a3.constructor != b2.constructor) + return false; + if ($a2 && a3.constructor === Uint8Array) { + if (a3.length != b2.length) + return false; + for (var c2 = 0; c2 < a3.length; c2++) + if (a3[c2] != b2[c2]) + return false; + return true; + } + if (a3.constructor === Array) { + var d4 = void 0, f4 = void 0, h4 = Math.max(a3.length, b2.length); + for (c2 = 0; c2 < h4; c2++) { + var m3 = a3[c2], t2 = b2[c2]; + m3 && m3.constructor == Object && (n5(void 0 === d4), n5(c2 === a3.length - 1), d4 = m3, m3 = void 0); + t2 && t2.constructor == Object && (n5(void 0 === f4), n5(c2 === b2.length - 1), f4 = t2, t2 = void 0); + if (!nb2(m3, t2)) + return false; + } + return d4 || f4 ? (d4 = d4 || {}, f4 = f4 || {}, ob2(d4, f4)) : true; + } + if (a3.constructor === Object) + return ob2(a3, b2); + throw Error("Invalid type in JSPB array"); + } + N2.compareFields = nb2; + N2.prototype.Bb = function() { + return pb2(this); + }; + N2.prototype.cloneMessage = N2.prototype.Bb; + N2.prototype.clone = function() { + return pb2(this); + }; + N2.prototype.clone = N2.prototype.clone; + N2.clone = function(a3) { + return pb2(a3); + }; + function pb2(a3) { + return new a3.constructor(qb2(a3.g())); + } + N2.copyInto = function(a3, b2) { + q2(a3, N2); + q2(b2, N2); + n5(a3.constructor == b2.constructor, "Copy source and target message should have the same type."); + a3 = pb2(a3); + for (var c2 = b2.g(), d4 = a3.g(), f4 = c2.length = 0; f4 < d4.length; f4++) + c2[f4] = d4[f4]; + b2.f = a3.f; + b2.i = a3.i; + }; + function qb2(a3) { + if (Array.isArray(a3)) { + for (var b2 = Array(a3.length), c2 = 0; c2 < a3.length; c2++) { + var d4 = a3[c2]; + null != d4 && (b2[c2] = "object" == typeof d4 ? qb2(n5(d4)) : d4); + } + return b2; + } + if ($a2 && a3 instanceof Uint8Array) + return new Uint8Array(a3); + b2 = {}; + for (c2 in a3) + d4 = a3[c2], null != d4 && (b2[c2] = "object" == typeof d4 ? qb2(n5(d4)) : d4); + return b2; + } + N2.registerMessageType = function(a3, b2) { + b2.we = a3; + }; + var R3 = { dump: function(a3) { + q2(a3, N2, "jspb.Message instance expected"); + n5(a3.getExtension, "Only unobfuscated and unoptimized compilation modes supported."); + return R3.X(a3); + } }; + g3("jspb.debug.dump", R3.dump, void 0); + R3.X = function(a3) { + var b2 = k2(a3); + if ("number" == b2 || "string" == b2 || "boolean" == b2 || "null" == b2 || "undefined" == b2 || "undefined" !== typeof Uint8Array && a3 instanceof Uint8Array) + return a3; + if ("array" == b2) + return ua2(a3), l2(a3, R3.X); + if (a3 instanceof r2) { + var c2 = {}; + a3 = a3.entries(); + for (var d4 = a3.next(); !d4.done; d4 = a3.next()) + c2[d4.value[0]] = R3.X(d4.value[1]); + return c2; + } + q2(a3, N2, "Only messages expected: " + a3); + b2 = a3.constructor; + var f4 = { $name: b2.name || b2.displayName }; + for (t2 in b2.prototype) { + var h4 = /^get([A-Z]\w*)/.exec(t2); + if (h4 && "getExtension" != t2 && "getJsPbMessageId" != t2) { + var m3 = "has" + h4[1]; + if (!a3[m3] || a3[m3]()) + m3 = a3[t2](), f4[R3.$a(h4[1])] = R3.X(m3); + } + } + if (a3.extensionObject_) + return f4.$extensions = "Recursive dumping of extensions not supported in compiled code. Switch to uncompiled or dump extension object directly", f4; + for (d4 in b2.extensions) + if (/^\d+$/.test(d4)) { + m3 = b2.extensions[d4]; + var t2 = a3.getExtension(m3); + h4 = void 0; + m3 = m3.Ba; + var B2 = [], M3 = 0; + for (h4 in m3) + B2[M3++] = h4; + h4 = B2[0]; + null != t2 && (c2 || (c2 = f4.$extensions = {}), c2[R3.$a(h4)] = R3.X(t2)); + } + return f4; + }; + R3.$a = function(a3) { + return a3.replace(/^[A-Z]/, function(b2) { + return b2.toLowerCase(); + }); + }; + function S4() { + this.a = []; + } + g3("jspb.BinaryEncoder", S4, void 0); + S4.prototype.length = function() { + return this.a.length; + }; + S4.prototype.length = S4.prototype.length; + S4.prototype.end = function() { + var a3 = this.a; + this.a = []; + return a3; + }; + S4.prototype.end = S4.prototype.end; + S4.prototype.l = function(a3, b2) { + n5(a3 == Math.floor(a3)); + n5(b2 == Math.floor(b2)); + n5(0 <= a3 && 4294967296 > a3); + for (n5(0 <= b2 && 4294967296 > b2); 0 < b2 || 127 < a3; ) + this.a.push(a3 & 127 | 128), a3 = (a3 >>> 7 | b2 << 25) >>> 0, b2 >>>= 7; + this.a.push(a3); + }; + S4.prototype.writeSplitVarint64 = S4.prototype.l; + S4.prototype.A = function(a3, b2) { + n5(a3 == Math.floor(a3)); + n5(b2 == Math.floor(b2)); + n5(0 <= a3 && 4294967296 > a3); + n5(0 <= b2 && 4294967296 > b2); + this.s(a3); + this.s(b2); + }; + S4.prototype.writeSplitFixed64 = S4.prototype.A; + S4.prototype.j = function(a3) { + n5(a3 == Math.floor(a3)); + for (n5(0 <= a3 && 4294967296 > a3); 127 < a3; ) + this.a.push(a3 & 127 | 128), a3 >>>= 7; + this.a.push(a3); + }; + S4.prototype.writeUnsignedVarint32 = S4.prototype.j; + S4.prototype.M = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-2147483648 <= a3 && 2147483648 > a3); + if (0 <= a3) + this.j(a3); + else { + for (var b2 = 0; 9 > b2; b2++) + this.a.push(a3 & 127 | 128), a3 >>= 7; + this.a.push(1); + } + }; + S4.prototype.writeSignedVarint32 = S4.prototype.M; + S4.prototype.va = function(a3) { + n5(a3 == Math.floor(a3)); + n5(0 <= a3 && 18446744073709552e3 > a3); + A2(a3); + this.l(y3, z3); + }; + S4.prototype.writeUnsignedVarint64 = S4.prototype.va; + S4.prototype.ua = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-9223372036854776e3 <= a3 && 9223372036854776e3 > a3); + A2(a3); + this.l(y3, z3); + }; + S4.prototype.writeSignedVarint64 = S4.prototype.ua; + S4.prototype.wa = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-2147483648 <= a3 && 2147483648 > a3); + this.j((a3 << 1 ^ a3 >> 31) >>> 0); + }; + S4.prototype.writeZigzagVarint32 = S4.prototype.wa; + S4.prototype.xa = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-9223372036854776e3 <= a3 && 9223372036854776e3 > a3); + Ga2(a3); + this.l(y3, z3); + }; + S4.prototype.writeZigzagVarint64 = S4.prototype.xa; + S4.prototype.Ta = function(a3) { + this.W(H2(a3)); + }; + S4.prototype.writeZigzagVarint64String = S4.prototype.Ta; + S4.prototype.W = function(a3) { + var b2 = this; + C3(a3); + Ja2(y3, z3, function(c2, d4) { + b2.l(c2 >>> 0, d4 >>> 0); + }); + }; + S4.prototype.writeZigzagVarintHash64 = S4.prototype.W; + S4.prototype.be = function(a3) { + n5(a3 == Math.floor(a3)); + n5(0 <= a3 && 256 > a3); + this.a.push(a3 >>> 0 & 255); + }; + S4.prototype.writeUint8 = S4.prototype.be; + S4.prototype.ae = function(a3) { + n5(a3 == Math.floor(a3)); + n5(0 <= a3 && 65536 > a3); + this.a.push(a3 >>> 0 & 255); + this.a.push(a3 >>> 8 & 255); + }; + S4.prototype.writeUint16 = S4.prototype.ae; + S4.prototype.s = function(a3) { + n5(a3 == Math.floor(a3)); + n5(0 <= a3 && 4294967296 > a3); + this.a.push(a3 >>> 0 & 255); + this.a.push(a3 >>> 8 & 255); + this.a.push(a3 >>> 16 & 255); + this.a.push(a3 >>> 24 & 255); + }; + S4.prototype.writeUint32 = S4.prototype.s; + S4.prototype.V = function(a3) { + n5(a3 == Math.floor(a3)); + n5(0 <= a3 && 18446744073709552e3 > a3); + Fa2(a3); + this.s(y3); + this.s(z3); + }; + S4.prototype.writeUint64 = S4.prototype.V; + S4.prototype.Qc = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-128 <= a3 && 128 > a3); + this.a.push(a3 >>> 0 & 255); + }; + S4.prototype.writeInt8 = S4.prototype.Qc; + S4.prototype.Pc = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-32768 <= a3 && 32768 > a3); + this.a.push(a3 >>> 0 & 255); + this.a.push(a3 >>> 8 & 255); + }; + S4.prototype.writeInt16 = S4.prototype.Pc; + S4.prototype.S = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-2147483648 <= a3 && 2147483648 > a3); + this.a.push(a3 >>> 0 & 255); + this.a.push(a3 >>> 8 & 255); + this.a.push(a3 >>> 16 & 255); + this.a.push(a3 >>> 24 & 255); + }; + S4.prototype.writeInt32 = S4.prototype.S; + S4.prototype.T = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-9223372036854776e3 <= a3 && 9223372036854776e3 > a3); + A2(a3); + this.A(y3, z3); + }; + S4.prototype.writeInt64 = S4.prototype.T; + S4.prototype.ka = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-9223372036854776e3 <= +a3 && 9223372036854776e3 > +a3); + C3(H2(a3)); + this.A(y3, z3); + }; + S4.prototype.writeInt64String = S4.prototype.ka; + S4.prototype.L = function(a3) { + n5(Infinity === a3 || -Infinity === a3 || isNaN(a3) || -34028234663852886e22 <= a3 && 34028234663852886e22 >= a3); + Ha2(a3); + this.s(y3); + }; + S4.prototype.writeFloat = S4.prototype.L; + S4.prototype.J = function(a3) { + n5(Infinity === a3 || -Infinity === a3 || isNaN(a3) || -17976931348623157e292 <= a3 && 17976931348623157e292 >= a3); + Ia2(a3); + this.s(y3); + this.s(z3); + }; + S4.prototype.writeDouble = S4.prototype.J; + S4.prototype.I = function(a3) { + n5("boolean" === typeof a3 || "number" === typeof a3); + this.a.push(a3 ? 1 : 0); + }; + S4.prototype.writeBool = S4.prototype.I; + S4.prototype.R = function(a3) { + n5(a3 == Math.floor(a3)); + n5(-2147483648 <= a3 && 2147483648 > a3); + this.M(a3); + }; + S4.prototype.writeEnum = S4.prototype.R; + S4.prototype.ja = function(a3) { + this.a.push.apply(this.a, a3); + }; + S4.prototype.writeBytes = S4.prototype.ja; + S4.prototype.N = function(a3) { + C3(a3); + this.l(y3, z3); + }; + S4.prototype.writeVarintHash64 = S4.prototype.N; + S4.prototype.K = function(a3) { + C3(a3); + this.s(y3); + this.s(z3); + }; + S4.prototype.writeFixedHash64 = S4.prototype.K; + S4.prototype.U = function(a3) { + var b2 = this.a.length; + ta2(a3); + for (var c2 = 0; c2 < a3.length; c2++) { + var d4 = a3.charCodeAt(c2); + if (128 > d4) + this.a.push(d4); + else if (2048 > d4) + this.a.push(d4 >> 6 | 192), this.a.push(d4 & 63 | 128); + else if (65536 > d4) + if (55296 <= d4 && 56319 >= d4 && c2 + 1 < a3.length) { + var f4 = a3.charCodeAt(c2 + 1); + 56320 <= f4 && 57343 >= f4 && (d4 = 1024 * (d4 - 55296) + f4 - 56320 + 65536, this.a.push(d4 >> 18 | 240), this.a.push(d4 >> 12 & 63 | 128), this.a.push(d4 >> 6 & 63 | 128), this.a.push(d4 & 63 | 128), c2++); + } else + this.a.push(d4 >> 12 | 224), this.a.push(d4 >> 6 & 63 | 128), this.a.push(d4 & 63 | 128); + } + return this.a.length - b2; + }; + S4.prototype.writeString = S4.prototype.U; + function T9(a3, b2) { + this.lo = a3; + this.hi = b2; + } + g3("jspb.arith.UInt64", T9, void 0); + T9.prototype.cmp = function(a3) { + return this.hi < a3.hi || this.hi == a3.hi && this.lo < a3.lo ? -1 : this.hi == a3.hi && this.lo == a3.lo ? 0 : 1; + }; + T9.prototype.cmp = T9.prototype.cmp; + T9.prototype.La = function() { + return new T9((this.lo >>> 1 | (this.hi & 1) << 31) >>> 0, this.hi >>> 1 >>> 0); + }; + T9.prototype.rightShift = T9.prototype.La; + T9.prototype.Da = function() { + return new T9(this.lo << 1 >>> 0, (this.hi << 1 | this.lo >>> 31) >>> 0); + }; + T9.prototype.leftShift = T9.prototype.Da; + T9.prototype.cb = function() { + return !!(this.hi & 2147483648); + }; + T9.prototype.msb = T9.prototype.cb; + T9.prototype.Ob = function() { + return !!(this.lo & 1); + }; + T9.prototype.lsb = T9.prototype.Ob; + T9.prototype.Ua = function() { + return 0 == this.lo && 0 == this.hi; + }; + T9.prototype.zero = T9.prototype.Ua; + T9.prototype.add = function(a3) { + return new T9((this.lo + a3.lo & 4294967295) >>> 0 >>> 0, ((this.hi + a3.hi & 4294967295) >>> 0) + (4294967296 <= this.lo + a3.lo ? 1 : 0) >>> 0); + }; + T9.prototype.add = T9.prototype.add; + T9.prototype.sub = function(a3) { + return new T9((this.lo - a3.lo & 4294967295) >>> 0 >>> 0, ((this.hi - a3.hi & 4294967295) >>> 0) - (0 > this.lo - a3.lo ? 1 : 0) >>> 0); + }; + T9.prototype.sub = T9.prototype.sub; + function rb2(a3, b2) { + var c2 = a3 & 65535; + a3 >>>= 16; + var d4 = b2 & 65535, f4 = b2 >>> 16; + b2 = c2 * d4 + 65536 * (c2 * f4 & 65535) + 65536 * (a3 * d4 & 65535); + for (c2 = a3 * f4 + (c2 * f4 >>> 16) + (a3 * d4 >>> 16); 4294967296 <= b2; ) + b2 -= 4294967296, c2 += 1; + return new T9(b2 >>> 0, c2 >>> 0); + } + T9.mul32x32 = rb2; + T9.prototype.eb = function(a3) { + var b2 = rb2(this.lo, a3); + a3 = rb2(this.hi, a3); + a3.hi = a3.lo; + a3.lo = 0; + return b2.add(a3); + }; + T9.prototype.mul = T9.prototype.eb; + T9.prototype.Xa = function(a3) { + if (0 == a3) + return []; + var b2 = new T9(0, 0), c2 = new T9(this.lo, this.hi); + a3 = new T9(a3, 0); + for (var d4 = new T9(1, 0); !a3.cb(); ) + a3 = a3.Da(), d4 = d4.Da(); + for (; !d4.Ua(); ) + 0 >= a3.cmp(c2) && (b2 = b2.add(d4), c2 = c2.sub(a3)), a3 = a3.La(), d4 = d4.La(); + return [b2, c2]; + }; + T9.prototype.div = T9.prototype.Xa; + T9.prototype.toString = function() { + for (var a3 = "", b2 = this; !b2.Ua(); ) { + b2 = b2.Xa(10); + var c2 = b2[0]; + a3 = b2[1].lo + a3; + b2 = c2; + } + "" == a3 && (a3 = "0"); + return a3; + }; + T9.prototype.toString = T9.prototype.toString; + function U5(a3) { + for (var b2 = new T9(0, 0), c2 = new T9(0, 0), d4 = 0; d4 < a3.length; d4++) { + if ("0" > a3[d4] || "9" < a3[d4]) + return null; + c2.lo = parseInt(a3[d4], 10); + b2 = b2.eb(10).add(c2); + } + return b2; + } + T9.fromString = U5; + T9.prototype.clone = function() { + return new T9(this.lo, this.hi); + }; + T9.prototype.clone = T9.prototype.clone; + function V3(a3, b2) { + this.lo = a3; + this.hi = b2; + } + g3("jspb.arith.Int64", V3, void 0); + V3.prototype.add = function(a3) { + return new V3((this.lo + a3.lo & 4294967295) >>> 0 >>> 0, ((this.hi + a3.hi & 4294967295) >>> 0) + (4294967296 <= this.lo + a3.lo ? 1 : 0) >>> 0); + }; + V3.prototype.add = V3.prototype.add; + V3.prototype.sub = function(a3) { + return new V3((this.lo - a3.lo & 4294967295) >>> 0 >>> 0, ((this.hi - a3.hi & 4294967295) >>> 0) - (0 > this.lo - a3.lo ? 1 : 0) >>> 0); + }; + V3.prototype.sub = V3.prototype.sub; + V3.prototype.clone = function() { + return new V3(this.lo, this.hi); + }; + V3.prototype.clone = V3.prototype.clone; + V3.prototype.toString = function() { + var a3 = 0 != (this.hi & 2147483648), b2 = new T9(this.lo, this.hi); + a3 && (b2 = new T9(0, 0).sub(b2)); + return (a3 ? "-" : "") + b2.toString(); + }; + V3.prototype.toString = V3.prototype.toString; + function sb2(a3) { + var b2 = 0 < a3.length && "-" == a3[0]; + b2 && (a3 = a3.substring(1)); + a3 = U5(a3); + if (null === a3) + return null; + b2 && (a3 = new T9(0, 0).sub(a3)); + return new V3(a3.lo, a3.hi); + } + V3.fromString = sb2; + function W2() { + this.c = []; + this.b = 0; + this.a = new S4(); + this.h = []; + } + g3("jspb.BinaryWriter", W2, void 0); + function tb2(a3, b2) { + var c2 = a3.a.end(); + a3.c.push(c2); + a3.c.push(b2); + a3.b += c2.length + b2.length; + } + function X2(a3, b2) { + Y2(a3, b2, 2); + b2 = a3.a.end(); + a3.c.push(b2); + a3.b += b2.length; + b2.push(a3.b); + return b2; + } + function Z2(a3, b2) { + var c2 = b2.pop(); + c2 = a3.b + a3.a.length() - c2; + for (n5(0 <= c2); 127 < c2; ) + b2.push(c2 & 127 | 128), c2 >>>= 7, a3.b++; + b2.push(c2); + a3.b++; + } + W2.prototype.pb = function(a3, b2, c2) { + tb2(this, a3.subarray(b2, c2)); + }; + W2.prototype.writeSerializedMessage = W2.prototype.pb; + W2.prototype.Pb = function(a3, b2, c2) { + null != a3 && null != b2 && null != c2 && this.pb(a3, b2, c2); + }; + W2.prototype.maybeWriteSerializedMessage = W2.prototype.Pb; + W2.prototype.reset = function() { + this.c = []; + this.a.end(); + this.b = 0; + this.h = []; + }; + W2.prototype.reset = W2.prototype.reset; + W2.prototype.ab = function() { + n5(0 == this.h.length); + for (var a3 = new Uint8Array(this.b + this.a.length()), b2 = this.c, c2 = b2.length, d4 = 0, f4 = 0; f4 < c2; f4++) { + var h4 = b2[f4]; + a3.set(h4, d4); + d4 += h4.length; + } + b2 = this.a.end(); + a3.set(b2, d4); + d4 += b2.length; + n5(d4 == a3.length); + this.c = [a3]; + return a3; + }; + W2.prototype.getResultBuffer = W2.prototype.ab; + W2.prototype.Kb = function(a3) { + return Ba2(this.ab(), a3); + }; + W2.prototype.getResultBase64String = W2.prototype.Kb; + W2.prototype.Va = function(a3) { + this.h.push(X2(this, a3)); + }; + W2.prototype.beginSubMessage = W2.prototype.Va; + W2.prototype.Ya = function() { + n5(0 <= this.h.length); + Z2(this, this.h.pop()); + }; + W2.prototype.endSubMessage = W2.prototype.Ya; + function Y2(a3, b2, c2) { + n5(1 <= b2 && b2 == Math.floor(b2)); + a3.a.j(8 * b2 + c2); + } + W2.prototype.Nc = function(a3, b2, c2) { + switch (a3) { + case 1: + this.J(b2, c2); + break; + case 2: + this.L(b2, c2); + break; + case 3: + this.T(b2, c2); + break; + case 4: + this.V(b2, c2); + break; + case 5: + this.S(b2, c2); + break; + case 6: + this.Qa(b2, c2); + break; + case 7: + this.Pa(b2, c2); + break; + case 8: + this.I(b2, c2); + break; + case 9: + this.U(b2, c2); + break; + case 10: + p3("Group field type not supported in writeAny()"); + break; + case 11: + p3("Message field type not supported in writeAny()"); + break; + case 12: + this.ja(b2, c2); + break; + case 13: + this.s(b2, c2); + break; + case 14: + this.R(b2, c2); + break; + case 15: + this.Ra(b2, c2); + break; + case 16: + this.Sa(b2, c2); + break; + case 17: + this.rb(b2, c2); + break; + case 18: + this.sb(b2, c2); + break; + case 30: + this.K(b2, c2); + break; + case 31: + this.N(b2, c2); + break; + default: + p3("Invalid field type in writeAny()"); + } + }; + W2.prototype.writeAny = W2.prototype.Nc; + function ub2(a3, b2, c2) { + null != c2 && (Y2(a3, b2, 0), a3.a.j(c2)); + } + function vb2(a3, b2, c2) { + null != c2 && (Y2(a3, b2, 0), a3.a.M(c2)); + } + W2.prototype.S = function(a3, b2) { + null != b2 && (n5(-2147483648 <= b2 && 2147483648 > b2), vb2(this, a3, b2)); + }; + W2.prototype.writeInt32 = W2.prototype.S; + W2.prototype.ob = function(a3, b2) { + null != b2 && (b2 = parseInt(b2, 10), n5(-2147483648 <= b2 && 2147483648 > b2), vb2(this, a3, b2)); + }; + W2.prototype.writeInt32String = W2.prototype.ob; + W2.prototype.T = function(a3, b2) { + null != b2 && (n5(-9223372036854776e3 <= b2 && 9223372036854776e3 > b2), null != b2 && (Y2(this, a3, 0), this.a.ua(b2))); + }; + W2.prototype.writeInt64 = W2.prototype.T; + W2.prototype.ka = function(a3, b2) { + null != b2 && (b2 = sb2(b2), Y2(this, a3, 0), this.a.l(b2.lo, b2.hi)); + }; + W2.prototype.writeInt64String = W2.prototype.ka; + W2.prototype.s = function(a3, b2) { + null != b2 && (n5(0 <= b2 && 4294967296 > b2), ub2(this, a3, b2)); + }; + W2.prototype.writeUint32 = W2.prototype.s; + W2.prototype.ub = function(a3, b2) { + null != b2 && (b2 = parseInt(b2, 10), n5(0 <= b2 && 4294967296 > b2), ub2(this, a3, b2)); + }; + W2.prototype.writeUint32String = W2.prototype.ub; + W2.prototype.V = function(a3, b2) { + null != b2 && (n5(0 <= b2 && 18446744073709552e3 > b2), null != b2 && (Y2(this, a3, 0), this.a.va(b2))); + }; + W2.prototype.writeUint64 = W2.prototype.V; + W2.prototype.vb = function(a3, b2) { + null != b2 && (b2 = U5(b2), Y2(this, a3, 0), this.a.l(b2.lo, b2.hi)); + }; + W2.prototype.writeUint64String = W2.prototype.vb; + W2.prototype.rb = function(a3, b2) { + null != b2 && (n5(-2147483648 <= b2 && 2147483648 > b2), null != b2 && (Y2(this, a3, 0), this.a.wa(b2))); + }; + W2.prototype.writeSint32 = W2.prototype.rb; + W2.prototype.sb = function(a3, b2) { + null != b2 && (n5(-9223372036854776e3 <= b2 && 9223372036854776e3 > b2), null != b2 && (Y2(this, a3, 0), this.a.xa(b2))); + }; + W2.prototype.writeSint64 = W2.prototype.sb; + W2.prototype.$d = function(a3, b2) { + null != b2 && null != b2 && (Y2(this, a3, 0), this.a.W(b2)); + }; + W2.prototype.writeSintHash64 = W2.prototype.$d; + W2.prototype.Zd = function(a3, b2) { + null != b2 && null != b2 && (Y2(this, a3, 0), this.a.Ta(b2)); + }; + W2.prototype.writeSint64String = W2.prototype.Zd; + W2.prototype.Pa = function(a3, b2) { + null != b2 && (n5(0 <= b2 && 4294967296 > b2), Y2(this, a3, 5), this.a.s(b2)); + }; + W2.prototype.writeFixed32 = W2.prototype.Pa; + W2.prototype.Qa = function(a3, b2) { + null != b2 && (n5(0 <= b2 && 18446744073709552e3 > b2), Y2(this, a3, 1), this.a.V(b2)); + }; + W2.prototype.writeFixed64 = W2.prototype.Qa; + W2.prototype.nb = function(a3, b2) { + null != b2 && (b2 = U5(b2), Y2(this, a3, 1), this.a.A(b2.lo, b2.hi)); + }; + W2.prototype.writeFixed64String = W2.prototype.nb; + W2.prototype.Ra = function(a3, b2) { + null != b2 && (n5(-2147483648 <= b2 && 2147483648 > b2), Y2(this, a3, 5), this.a.S(b2)); + }; + W2.prototype.writeSfixed32 = W2.prototype.Ra; + W2.prototype.Sa = function(a3, b2) { + null != b2 && (n5(-9223372036854776e3 <= b2 && 9223372036854776e3 > b2), Y2(this, a3, 1), this.a.T(b2)); + }; + W2.prototype.writeSfixed64 = W2.prototype.Sa; + W2.prototype.qb = function(a3, b2) { + null != b2 && (b2 = sb2(b2), Y2(this, a3, 1), this.a.A(b2.lo, b2.hi)); + }; + W2.prototype.writeSfixed64String = W2.prototype.qb; + W2.prototype.L = function(a3, b2) { + null != b2 && (Y2(this, a3, 5), this.a.L(b2)); + }; + W2.prototype.writeFloat = W2.prototype.L; + W2.prototype.J = function(a3, b2) { + null != b2 && (Y2(this, a3, 1), this.a.J(b2)); + }; + W2.prototype.writeDouble = W2.prototype.J; + W2.prototype.I = function(a3, b2) { + null != b2 && (n5("boolean" === typeof b2 || "number" === typeof b2), Y2(this, a3, 0), this.a.I(b2)); + }; + W2.prototype.writeBool = W2.prototype.I; + W2.prototype.R = function(a3, b2) { + null != b2 && (n5(-2147483648 <= b2 && 2147483648 > b2), Y2(this, a3, 0), this.a.M(b2)); + }; + W2.prototype.writeEnum = W2.prototype.R; + W2.prototype.U = function(a3, b2) { + null != b2 && (a3 = X2(this, a3), this.a.U(b2), Z2(this, a3)); + }; + W2.prototype.writeString = W2.prototype.U; + W2.prototype.ja = function(a3, b2) { + null != b2 && (b2 = Ua2(b2), Y2(this, a3, 2), this.a.j(b2.length), tb2(this, b2)); + }; + W2.prototype.writeBytes = W2.prototype.ja; + W2.prototype.Rc = function(a3, b2, c2) { + null != b2 && (a3 = X2(this, a3), c2(b2, this), Z2(this, a3)); + }; + W2.prototype.writeMessage = W2.prototype.Rc; + W2.prototype.Sc = function(a3, b2, c2) { + null != b2 && (Y2(this, 1, 3), Y2(this, 2, 0), this.a.M(a3), a3 = X2(this, 3), c2(b2, this), Z2(this, a3), Y2(this, 1, 4)); + }; + W2.prototype.writeMessageSet = W2.prototype.Sc; + W2.prototype.Oc = function(a3, b2, c2) { + null != b2 && (Y2(this, a3, 3), c2(b2, this), Y2(this, a3, 4)); + }; + W2.prototype.writeGroup = W2.prototype.Oc; + W2.prototype.K = function(a3, b2) { + null != b2 && (n5(8 == b2.length), Y2(this, a3, 1), this.a.K(b2)); + }; + W2.prototype.writeFixedHash64 = W2.prototype.K; + W2.prototype.N = function(a3, b2) { + null != b2 && (n5(8 == b2.length), Y2(this, a3, 0), this.a.N(b2)); + }; + W2.prototype.writeVarintHash64 = W2.prototype.N; + W2.prototype.A = function(a3, b2, c2) { + Y2(this, a3, 1); + this.a.A(b2, c2); + }; + W2.prototype.writeSplitFixed64 = W2.prototype.A; + W2.prototype.l = function(a3, b2, c2) { + Y2(this, a3, 0); + this.a.l(b2, c2); + }; + W2.prototype.writeSplitVarint64 = W2.prototype.l; + W2.prototype.tb = function(a3, b2, c2) { + Y2(this, a3, 0); + var d4 = this.a; + Ja2(b2, c2, function(f4, h4) { + d4.l(f4 >>> 0, h4 >>> 0); + }); + }; + W2.prototype.writeSplitZigzagVarint64 = W2.prototype.tb; + W2.prototype.Ed = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + vb2(this, a3, b2[c2]); + }; + W2.prototype.writeRepeatedInt32 = W2.prototype.Ed; + W2.prototype.Fd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.ob(a3, b2[c2]); + }; + W2.prototype.writeRepeatedInt32String = W2.prototype.Fd; + W2.prototype.Gd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = b2[c2]; + null != d4 && (Y2(this, a3, 0), this.a.ua(d4)); + } + }; + W2.prototype.writeRepeatedInt64 = W2.prototype.Gd; + W2.prototype.Qd = function(a3, b2, c2, d4) { + if (null != b2) + for (var f4 = 0; f4 < b2.length; f4++) + this.A(a3, c2(b2[f4]), d4(b2[f4])); + }; + W2.prototype.writeRepeatedSplitFixed64 = W2.prototype.Qd; + W2.prototype.Rd = function(a3, b2, c2, d4) { + if (null != b2) + for (var f4 = 0; f4 < b2.length; f4++) + this.l(a3, c2(b2[f4]), d4(b2[f4])); + }; + W2.prototype.writeRepeatedSplitVarint64 = W2.prototype.Rd; + W2.prototype.Sd = function(a3, b2, c2, d4) { + if (null != b2) + for (var f4 = 0; f4 < b2.length; f4++) + this.tb(a3, c2(b2[f4]), d4(b2[f4])); + }; + W2.prototype.writeRepeatedSplitZigzagVarint64 = W2.prototype.Sd; + W2.prototype.Hd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.ka(a3, b2[c2]); + }; + W2.prototype.writeRepeatedInt64String = W2.prototype.Hd; + W2.prototype.Ud = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + ub2(this, a3, b2[c2]); + }; + W2.prototype.writeRepeatedUint32 = W2.prototype.Ud; + W2.prototype.Vd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.ub(a3, b2[c2]); + }; + W2.prototype.writeRepeatedUint32String = W2.prototype.Vd; + W2.prototype.Wd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = b2[c2]; + null != d4 && (Y2(this, a3, 0), this.a.va(d4)); + } + }; + W2.prototype.writeRepeatedUint64 = W2.prototype.Wd; + W2.prototype.Xd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.vb(a3, b2[c2]); + }; + W2.prototype.writeRepeatedUint64String = W2.prototype.Xd; + W2.prototype.Md = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = b2[c2]; + null != d4 && (Y2(this, a3, 0), this.a.wa(d4)); + } + }; + W2.prototype.writeRepeatedSint32 = W2.prototype.Md; + W2.prototype.Nd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = b2[c2]; + null != d4 && (Y2(this, a3, 0), this.a.xa(d4)); + } + }; + W2.prototype.writeRepeatedSint64 = W2.prototype.Nd; + W2.prototype.Od = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = b2[c2]; + null != d4 && (Y2(this, a3, 0), this.a.Ta(d4)); + } + }; + W2.prototype.writeRepeatedSint64String = W2.prototype.Od; + W2.prototype.Pd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = b2[c2]; + null != d4 && (Y2(this, a3, 0), this.a.W(d4)); + } + }; + W2.prototype.writeRepeatedSintHash64 = W2.prototype.Pd; + W2.prototype.yd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.Pa(a3, b2[c2]); + }; + W2.prototype.writeRepeatedFixed32 = W2.prototype.yd; + W2.prototype.zd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.Qa(a3, b2[c2]); + }; + W2.prototype.writeRepeatedFixed64 = W2.prototype.zd; + W2.prototype.Ad = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.nb(a3, b2[c2]); + }; + W2.prototype.writeRepeatedFixed64String = W2.prototype.Ad; + W2.prototype.Jd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.Ra(a3, b2[c2]); + }; + W2.prototype.writeRepeatedSfixed32 = W2.prototype.Jd; + W2.prototype.Kd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.Sa(a3, b2[c2]); + }; + W2.prototype.writeRepeatedSfixed64 = W2.prototype.Kd; + W2.prototype.Ld = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.qb(a3, b2[c2]); + }; + W2.prototype.writeRepeatedSfixed64String = W2.prototype.Ld; + W2.prototype.Cd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.L(a3, b2[c2]); + }; + W2.prototype.writeRepeatedFloat = W2.prototype.Cd; + W2.prototype.wd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.J(a3, b2[c2]); + }; + W2.prototype.writeRepeatedDouble = W2.prototype.wd; + W2.prototype.ud = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.I(a3, b2[c2]); + }; + W2.prototype.writeRepeatedBool = W2.prototype.ud; + W2.prototype.xd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.R(a3, b2[c2]); + }; + W2.prototype.writeRepeatedEnum = W2.prototype.xd; + W2.prototype.Td = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.U(a3, b2[c2]); + }; + W2.prototype.writeRepeatedString = W2.prototype.Td; + W2.prototype.vd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.ja(a3, b2[c2]); + }; + W2.prototype.writeRepeatedBytes = W2.prototype.vd; + W2.prototype.Id = function(a3, b2, c2) { + if (null != b2) + for (var d4 = 0; d4 < b2.length; d4++) { + var f4 = X2(this, a3); + c2(b2[d4], this); + Z2(this, f4); + } + }; + W2.prototype.writeRepeatedMessage = W2.prototype.Id; + W2.prototype.Dd = function(a3, b2, c2) { + if (null != b2) + for (var d4 = 0; d4 < b2.length; d4++) + Y2(this, a3, 3), c2(b2[d4], this), Y2(this, a3, 4); + }; + W2.prototype.writeRepeatedGroup = W2.prototype.Dd; + W2.prototype.Bd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.K(a3, b2[c2]); + }; + W2.prototype.writeRepeatedFixedHash64 = W2.prototype.Bd; + W2.prototype.Yd = function(a3, b2) { + if (null != b2) + for (var c2 = 0; c2 < b2.length; c2++) + this.N(a3, b2[c2]); + }; + W2.prototype.writeRepeatedVarintHash64 = W2.prototype.Yd; + W2.prototype.ad = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.M(b2[c2]); + Z2(this, a3); + } + }; + W2.prototype.writePackedInt32 = W2.prototype.ad; + W2.prototype.bd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.M(parseInt(b2[c2], 10)); + Z2(this, a3); + } + }; + W2.prototype.writePackedInt32String = W2.prototype.bd; + W2.prototype.cd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.ua(b2[c2]); + Z2(this, a3); + } + }; + W2.prototype.writePackedInt64 = W2.prototype.cd; + W2.prototype.md = function(a3, b2, c2, d4) { + if (null != b2) { + a3 = X2(this, a3); + for (var f4 = 0; f4 < b2.length; f4++) + this.a.A(c2(b2[f4]), d4(b2[f4])); + Z2(this, a3); + } + }; + W2.prototype.writePackedSplitFixed64 = W2.prototype.md; + W2.prototype.nd = function(a3, b2, c2, d4) { + if (null != b2) { + a3 = X2(this, a3); + for (var f4 = 0; f4 < b2.length; f4++) + this.a.l(c2(b2[f4]), d4(b2[f4])); + Z2(this, a3); + } + }; + W2.prototype.writePackedSplitVarint64 = W2.prototype.nd; + W2.prototype.od = function(a3, b2, c2, d4) { + if (null != b2) { + a3 = X2(this, a3); + for (var f4 = this.a, h4 = 0; h4 < b2.length; h4++) + Ja2(c2(b2[h4]), d4(b2[h4]), function(m3, t2) { + f4.l(m3 >>> 0, t2 >>> 0); + }); + Z2(this, a3); + } + }; + W2.prototype.writePackedSplitZigzagVarint64 = W2.prototype.od; + W2.prototype.dd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = sb2(b2[c2]); + this.a.l(d4.lo, d4.hi); + } + Z2(this, a3); + } + }; + W2.prototype.writePackedInt64String = W2.prototype.dd; + W2.prototype.pd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.j(b2[c2]); + Z2(this, a3); + } + }; + W2.prototype.writePackedUint32 = W2.prototype.pd; + W2.prototype.qd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.j(parseInt(b2[c2], 10)); + Z2(this, a3); + } + }; + W2.prototype.writePackedUint32String = W2.prototype.qd; + W2.prototype.rd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.va(b2[c2]); + Z2(this, a3); + } + }; + W2.prototype.writePackedUint64 = W2.prototype.rd; + W2.prototype.sd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) { + var d4 = U5(b2[c2]); + this.a.l(d4.lo, d4.hi); + } + Z2(this, a3); + } + }; + W2.prototype.writePackedUint64String = W2.prototype.sd; + W2.prototype.hd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.wa(b2[c2]); + Z2(this, a3); + } + }; + W2.prototype.writePackedSint32 = W2.prototype.hd; + W2.prototype.jd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.xa(b2[c2]); + Z2(this, a3); + } + }; + W2.prototype.writePackedSint64 = W2.prototype.jd; + W2.prototype.kd = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.W(H2(b2[c2])); + Z2(this, a3); + } + }; + W2.prototype.writePackedSint64String = W2.prototype.kd; + W2.prototype.ld = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.W(b2[c2]); + Z2(this, a3); + } + }; + W2.prototype.writePackedSintHash64 = W2.prototype.ld; + W2.prototype.Wc = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(4 * b2.length), a3 = 0; a3 < b2.length; a3++) + this.a.s(b2[a3]); + }; + W2.prototype.writePackedFixed32 = W2.prototype.Wc; + W2.prototype.Xc = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) + this.a.V(b2[a3]); + }; + W2.prototype.writePackedFixed64 = W2.prototype.Xc; + W2.prototype.Yc = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) { + var c2 = U5(b2[a3]); + this.a.A(c2.lo, c2.hi); + } + }; + W2.prototype.writePackedFixed64String = W2.prototype.Yc; + W2.prototype.ed = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(4 * b2.length), a3 = 0; a3 < b2.length; a3++) + this.a.S(b2[a3]); + }; + W2.prototype.writePackedSfixed32 = W2.prototype.ed; + W2.prototype.fd = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) + this.a.T(b2[a3]); + }; + W2.prototype.writePackedSfixed64 = W2.prototype.fd; + W2.prototype.gd = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) + this.a.ka(b2[a3]); + }; + W2.prototype.writePackedSfixed64String = W2.prototype.gd; + W2.prototype.$c = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(4 * b2.length), a3 = 0; a3 < b2.length; a3++) + this.a.L(b2[a3]); + }; + W2.prototype.writePackedFloat = W2.prototype.$c; + W2.prototype.Uc = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) + this.a.J(b2[a3]); + }; + W2.prototype.writePackedDouble = W2.prototype.Uc; + W2.prototype.Tc = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(b2.length), a3 = 0; a3 < b2.length; a3++) + this.a.I(b2[a3]); + }; + W2.prototype.writePackedBool = W2.prototype.Tc; + W2.prototype.Vc = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.R(b2[c2]); + Z2(this, a3); + } + }; + W2.prototype.writePackedEnum = W2.prototype.Vc; + W2.prototype.Zc = function(a3, b2) { + if (null != b2 && b2.length) + for (Y2(this, a3, 2), this.a.j(8 * b2.length), a3 = 0; a3 < b2.length; a3++) + this.a.K(b2[a3]); + }; + W2.prototype.writePackedFixedHash64 = W2.prototype.Zc; + W2.prototype.td = function(a3, b2) { + if (null != b2 && b2.length) { + a3 = X2(this, a3); + for (var c2 = 0; c2 < b2.length; c2++) + this.a.N(b2[c2]); + Z2(this, a3); + } + }; + W2.prototype.writePackedVarintHash64 = W2.prototype.td; + exports.debug = R3, exports.Map = r2, exports.Message = N2, exports.BinaryReader = J2, exports.BinaryWriter = W2, exports.ExtensionFieldInfo = Ya2, exports.ExtensionFieldBinaryInfo = Za2, exports.exportSymbol = ma2, exports.inherits = na2, exports.object = { extend: pa2 }, exports.typeOf = k2; +})(googleProtobuf); +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + goog.exportSymbol("proto.google.protobuf.Any", null, global2); + proto.google.protobuf.Any = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(proto.google.protobuf.Any, jspb.Message); + if (goog.DEBUG && !COMPILED) { + proto.google.protobuf.Any.displayName = "proto.google.protobuf.Any"; + } + if (jspb.Message.GENERATE_TO_OBJECT) { + proto.google.protobuf.Any.prototype.toObject = function(opt_includeInstance) { + return proto.google.protobuf.Any.toObject(opt_includeInstance, this); + }; + proto.google.protobuf.Any.toObject = function(includeInstance, msg) { + var obj = { + typeUrl: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: msg.getValue_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + proto.google.protobuf.Any.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new proto.google.protobuf.Any(); + return proto.google.protobuf.Any.deserializeBinaryFromReader(msg, reader); + }; + proto.google.protobuf.Any.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setTypeUrl(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + proto.google.protobuf.Any.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.protobuf.Any.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + proto.google.protobuf.Any.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getTypeUrl(); + if (f4.length > 0) { + writer.writeString( + 1, + f4 + ); + } + f4 = message2.getValue_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + }; + proto.google.protobuf.Any.prototype.getTypeUrl = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + proto.google.protobuf.Any.prototype.setTypeUrl = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); + }; + proto.google.protobuf.Any.prototype.getValue = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + proto.google.protobuf.Any.prototype.getValue_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getValue() + ) + ); + }; + proto.google.protobuf.Any.prototype.getValue_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getValue() + ) + ); + }; + proto.google.protobuf.Any.prototype.setValue = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + goog.object.extend(exports, proto.google.protobuf); + proto.google.protobuf.Any.prototype.getTypeName = function() { + return this.getTypeUrl().split("/").pop(); + }; + proto.google.protobuf.Any.prototype.pack = function(serialized, name2, opt_typeUrlPrefix) { + if (!opt_typeUrlPrefix) { + opt_typeUrlPrefix = "type.googleapis.com/"; + } + if (opt_typeUrlPrefix.substr(-1) != "/") { + this.setTypeUrl(opt_typeUrlPrefix + "/" + name2); + } else { + this.setTypeUrl(opt_typeUrlPrefix + name2); + } + this.setValue(serialized); + }; + proto.google.protobuf.Any.prototype.unpack = function(deserialize2, name2) { + if (this.getTypeName() == name2) { + return deserialize2(this.getValue_asU8()); + } else { + return null; + } + }; +})(any_pb); +const google_protobuf_any_pb = /* @__PURE__ */ getDefaultExportFromCjs$1(any_pb); +var Tron_pb = {}; +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + var google_protobuf_any_pb2 = any_pb; + goog.object.extend(proto, google_protobuf_any_pb2); + goog.exportSymbol("TronWebProto.Account", null, global2); + goog.exportSymbol("TronWebProto.Account.AccountResource", null, global2); + goog.exportSymbol("TronWebProto.Account.Frozen", null, global2); + goog.exportSymbol("TronWebProto.AccountId", null, global2); + goog.exportSymbol("TronWebProto.AccountType", null, global2); + goog.exportSymbol("TronWebProto.DelegatedResource", null, global2); + goog.exportSymbol("TronWebProto.Exchange", null, global2); + goog.exportSymbol("TronWebProto.Key", null, global2); + goog.exportSymbol("TronWebProto.MarketOrderDetail", null, global2); + goog.exportSymbol("TronWebProto.Permission", null, global2); + goog.exportSymbol("TronWebProto.Permission.PermissionType", null, global2); + goog.exportSymbol("TronWebProto.Proposal", null, global2); + goog.exportSymbol("TronWebProto.Proposal.State", null, global2); + goog.exportSymbol("TronWebProto.Transaction", null, global2); + goog.exportSymbol("TronWebProto.Transaction.Contract", null, global2); + goog.exportSymbol("TronWebProto.Transaction.Contract.ContractType", null, global2); + goog.exportSymbol("TronWebProto.Transaction.Result", null, global2); + goog.exportSymbol("TronWebProto.Transaction.Result.code", null, global2); + goog.exportSymbol("TronWebProto.Transaction.Result.contractResult", null, global2); + goog.exportSymbol("TronWebProto.Transaction.raw", null, global2); + goog.exportSymbol("TronWebProto.Vote", null, global2); + goog.exportSymbol("TronWebProto.Votes", null, global2); + goog.exportSymbol("TronWebProto.Witness", null, global2); + goog.exportSymbol("TronWebProto.authority", null, global2); + TronWebProto.AccountId = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.AccountId, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AccountId.displayName = "TronWebProto.AccountId"; + } + TronWebProto.Vote = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.Vote, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Vote.displayName = "TronWebProto.Vote"; + } + TronWebProto.Proposal = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Proposal.repeatedFields_, null); + }; + goog.inherits(TronWebProto.Proposal, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Proposal.displayName = "TronWebProto.Proposal"; + } + TronWebProto.Exchange = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.Exchange, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Exchange.displayName = "TronWebProto.Exchange"; + } + TronWebProto.Account = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Account.repeatedFields_, null); + }; + goog.inherits(TronWebProto.Account, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Account.displayName = "TronWebProto.Account"; + } + TronWebProto.Account.Frozen = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.Account.Frozen, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Account.Frozen.displayName = "TronWebProto.Account.Frozen"; + } + TronWebProto.Account.AccountResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.Account.AccountResource, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Account.AccountResource.displayName = "TronWebProto.Account.AccountResource"; + } + TronWebProto.Key = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.Key, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Key.displayName = "TronWebProto.Key"; + } + TronWebProto.DelegatedResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.DelegatedResource, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.DelegatedResource.displayName = "TronWebProto.DelegatedResource"; + } + TronWebProto.authority = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.authority, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.authority.displayName = "TronWebProto.authority"; + } + TronWebProto.Permission = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Permission.repeatedFields_, null); + }; + goog.inherits(TronWebProto.Permission, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Permission.displayName = "TronWebProto.Permission"; + } + TronWebProto.Witness = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.Witness, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Witness.displayName = "TronWebProto.Witness"; + } + TronWebProto.Votes = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Votes.repeatedFields_, null); + }; + goog.inherits(TronWebProto.Votes, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Votes.displayName = "TronWebProto.Votes"; + } + TronWebProto.MarketOrderDetail = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.MarketOrderDetail, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.MarketOrderDetail.displayName = "TronWebProto.MarketOrderDetail"; + } + TronWebProto.Transaction = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Transaction.repeatedFields_, null); + }; + goog.inherits(TronWebProto.Transaction, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Transaction.displayName = "TronWebProto.Transaction"; + } + TronWebProto.Transaction.Contract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.Transaction.Contract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Transaction.Contract.displayName = "TronWebProto.Transaction.Contract"; + } + TronWebProto.Transaction.Result = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Transaction.Result.repeatedFields_, null); + }; + goog.inherits(TronWebProto.Transaction.Result, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Transaction.Result.displayName = "TronWebProto.Transaction.Result"; + } + TronWebProto.Transaction.raw = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.Transaction.raw.repeatedFields_, null); + }; + goog.inherits(TronWebProto.Transaction.raw, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.Transaction.raw.displayName = "TronWebProto.Transaction.raw"; + } + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AccountId.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AccountId.toObject(opt_includeInstance, this); + }; + TronWebProto.AccountId.toObject = function(includeInstance, msg) { + var obj = { + name: msg.getName_asB64(), + address: msg.getAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AccountId.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AccountId(); + return TronWebProto.AccountId.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AccountId.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setName(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AccountId.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AccountId.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AccountId.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getName_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + }; + TronWebProto.AccountId.prototype.getName = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.AccountId.prototype.getName_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getName() + ) + ); + }; + TronWebProto.AccountId.prototype.getName_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getName() + ) + ); + }; + TronWebProto.AccountId.prototype.setName = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.AccountId.prototype.getAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.AccountId.prototype.getAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAddress() + ) + ); + }; + TronWebProto.AccountId.prototype.getAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAddress() + ) + ); + }; + TronWebProto.AccountId.prototype.setAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Vote.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Vote.toObject(opt_includeInstance, this); + }; + TronWebProto.Vote.toObject = function(includeInstance, msg) { + var obj = { + voteAddress: msg.getVoteAddress_asB64(), + voteCount: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Vote.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Vote(); + return TronWebProto.Vote.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Vote.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setVoteAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setVoteCount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Vote.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Vote.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Vote.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getVoteAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getVoteCount(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + }; + TronWebProto.Vote.prototype.getVoteAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.Vote.prototype.getVoteAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getVoteAddress() + ) + ); + }; + TronWebProto.Vote.prototype.getVoteAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getVoteAddress() + ) + ); + }; + TronWebProto.Vote.prototype.setVoteAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.Vote.prototype.getVoteCount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.Vote.prototype.setVoteCount = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.Proposal.repeatedFields_ = [6]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Proposal.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Proposal.toObject(opt_includeInstance, this); + }; + TronWebProto.Proposal.toObject = function(includeInstance, msg) { + var f4, obj = { + proposalId: jspb.Message.getFieldWithDefault(msg, 1, 0), + proposerAddress: msg.getProposerAddress_asB64(), + parametersMap: (f4 = msg.getParametersMap()) ? f4.toObject(includeInstance, void 0) : [], + expirationTime: jspb.Message.getFieldWithDefault(msg, 4, 0), + createTime: jspb.Message.getFieldWithDefault(msg, 5, 0), + approvalsList: msg.getApprovalsList_asB64(), + state: jspb.Message.getFieldWithDefault(msg, 7, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Proposal.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Proposal(); + return TronWebProto.Proposal.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Proposal.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setProposalId(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setProposerAddress(value); + break; + case 3: + var value = msg.getParametersMap(); + reader.readMessage(value, function(message2, reader2) { + jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readInt64, null, 0, 0); + }); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExpirationTime(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setCreateTime(value); + break; + case 6: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.addApprovals(value); + break; + case 7: + var value = ( + /** @type {!TronWebProto.Proposal.State} */ + reader.readEnum() + ); + msg.setState(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Proposal.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Proposal.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Proposal.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getProposalId(); + if (f4 !== 0) { + writer.writeInt64( + 1, + f4 + ); + } + f4 = message2.getProposerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + f4 = message2.getParametersMap(true); + if (f4 && f4.getLength() > 0) { + f4.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeInt64, jspb.BinaryWriter.prototype.writeInt64); + } + f4 = message2.getExpirationTime(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + f4 = message2.getCreateTime(); + if (f4 !== 0) { + writer.writeInt64( + 5, + f4 + ); + } + f4 = message2.getApprovalsList_asU8(); + if (f4.length > 0) { + writer.writeRepeatedBytes( + 6, + f4 + ); + } + f4 = message2.getState(); + if (f4 !== 0) { + writer.writeEnum( + 7, + f4 + ); + } + }; + TronWebProto.Proposal.State = { + PENDING: 0, + DISAPPROVED: 1, + APPROVED: 2, + CANCELED: 3 + }; + TronWebProto.Proposal.prototype.getProposalId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.Proposal.prototype.setProposalId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.Proposal.prototype.getProposerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.Proposal.prototype.getProposerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getProposerAddress() + ) + ); + }; + TronWebProto.Proposal.prototype.getProposerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getProposerAddress() + ) + ); + }; + TronWebProto.Proposal.prototype.setProposerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.Proposal.prototype.getParametersMap = function(opt_noLazyCreate) { + return ( + /** @type {!jspb.Map} */ + jspb.Message.getMapField( + this, + 3, + opt_noLazyCreate, + null + ) + ); + }; + TronWebProto.Proposal.prototype.clearParametersMap = function() { + this.getParametersMap().clear(); + return this; + }; + TronWebProto.Proposal.prototype.getExpirationTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.Proposal.prototype.setExpirationTime = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + TronWebProto.Proposal.prototype.getCreateTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.Proposal.prototype.setCreateTime = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + TronWebProto.Proposal.prototype.getApprovalsList = function() { + return ( + /** @type {!(Array|Array)} */ + jspb.Message.getRepeatedField(this, 6) + ); + }; + TronWebProto.Proposal.prototype.getApprovalsList_asB64 = function() { + return ( + /** @type {!Array} */ + jspb.Message.bytesListAsB64( + this.getApprovalsList() + ) + ); + }; + TronWebProto.Proposal.prototype.getApprovalsList_asU8 = function() { + return ( + /** @type {!Array} */ + jspb.Message.bytesListAsU8( + this.getApprovalsList() + ) + ); + }; + TronWebProto.Proposal.prototype.setApprovalsList = function(value) { + return jspb.Message.setField(this, 6, value || []); + }; + TronWebProto.Proposal.prototype.addApprovals = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 6, value, opt_index); + }; + TronWebProto.Proposal.prototype.clearApprovalsList = function() { + return this.setApprovalsList([]); + }; + TronWebProto.Proposal.prototype.getState = function() { + return ( + /** @type {!TronWebProto.Proposal.State} */ + jspb.Message.getFieldWithDefault(this, 7, 0) + ); + }; + TronWebProto.Proposal.prototype.setState = function(value) { + return jspb.Message.setProto3EnumField(this, 7, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Exchange.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Exchange.toObject(opt_includeInstance, this); + }; + TronWebProto.Exchange.toObject = function(includeInstance, msg) { + var obj = { + exchangeId: jspb.Message.getFieldWithDefault(msg, 1, 0), + creatorAddress: msg.getCreatorAddress_asB64(), + createTime: jspb.Message.getFieldWithDefault(msg, 3, 0), + firstTokenId: msg.getFirstTokenId_asB64(), + firstTokenBalance: jspb.Message.getFieldWithDefault(msg, 7, 0), + secondTokenId: msg.getSecondTokenId_asB64(), + secondTokenBalance: jspb.Message.getFieldWithDefault(msg, 9, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Exchange.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Exchange(); + return TronWebProto.Exchange.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Exchange.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExchangeId(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setCreatorAddress(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setCreateTime(value); + break; + case 6: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setFirstTokenId(value); + break; + case 7: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFirstTokenBalance(value); + break; + case 8: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setSecondTokenId(value); + break; + case 9: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setSecondTokenBalance(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Exchange.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Exchange.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Exchange.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getExchangeId(); + if (f4 !== 0) { + writer.writeInt64( + 1, + f4 + ); + } + f4 = message2.getCreatorAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + f4 = message2.getCreateTime(); + if (f4 !== 0) { + writer.writeInt64( + 3, + f4 + ); + } + f4 = message2.getFirstTokenId_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 6, + f4 + ); + } + f4 = message2.getFirstTokenBalance(); + if (f4 !== 0) { + writer.writeInt64( + 7, + f4 + ); + } + f4 = message2.getSecondTokenId_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 8, + f4 + ); + } + f4 = message2.getSecondTokenBalance(); + if (f4 !== 0) { + writer.writeInt64( + 9, + f4 + ); + } + }; + TronWebProto.Exchange.prototype.getExchangeId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.Exchange.prototype.setExchangeId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.Exchange.prototype.getCreatorAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.Exchange.prototype.getCreatorAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getCreatorAddress() + ) + ); + }; + TronWebProto.Exchange.prototype.getCreatorAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getCreatorAddress() + ) + ); + }; + TronWebProto.Exchange.prototype.setCreatorAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.Exchange.prototype.getCreateTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.Exchange.prototype.setCreateTime = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.Exchange.prototype.getFirstTokenId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 6, "") + ); + }; + TronWebProto.Exchange.prototype.getFirstTokenId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getFirstTokenId() + ) + ); + }; + TronWebProto.Exchange.prototype.getFirstTokenId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getFirstTokenId() + ) + ); + }; + TronWebProto.Exchange.prototype.setFirstTokenId = function(value) { + return jspb.Message.setProto3BytesField(this, 6, value); + }; + TronWebProto.Exchange.prototype.getFirstTokenBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 7, 0) + ); + }; + TronWebProto.Exchange.prototype.setFirstTokenBalance = function(value) { + return jspb.Message.setProto3IntField(this, 7, value); + }; + TronWebProto.Exchange.prototype.getSecondTokenId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 8, "") + ); + }; + TronWebProto.Exchange.prototype.getSecondTokenId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getSecondTokenId() + ) + ); + }; + TronWebProto.Exchange.prototype.getSecondTokenId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getSecondTokenId() + ) + ); + }; + TronWebProto.Exchange.prototype.setSecondTokenId = function(value) { + return jspb.Message.setProto3BytesField(this, 8, value); + }; + TronWebProto.Exchange.prototype.getSecondTokenBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 9, 0) + ); + }; + TronWebProto.Exchange.prototype.setSecondTokenBalance = function(value) { + return jspb.Message.setProto3IntField(this, 9, value); + }; + TronWebProto.Account.repeatedFields_ = [5, 7, 16, 33]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Account.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Account.toObject(opt_includeInstance, this); + }; + TronWebProto.Account.toObject = function(includeInstance, msg) { + var f4, obj = { + accountName: msg.getAccountName_asB64(), + type: jspb.Message.getFieldWithDefault(msg, 2, 0), + address: msg.getAddress_asB64(), + balance: jspb.Message.getFieldWithDefault(msg, 4, 0), + votesList: jspb.Message.toObjectList( + msg.getVotesList(), + TronWebProto.Vote.toObject, + includeInstance + ), + assetMap: (f4 = msg.getAssetMap()) ? f4.toObject(includeInstance, void 0) : [], + assetv2Map: (f4 = msg.getAssetv2Map()) ? f4.toObject(includeInstance, void 0) : [], + frozenList: jspb.Message.toObjectList( + msg.getFrozenList(), + TronWebProto.Account.Frozen.toObject, + includeInstance + ), + netUsage: jspb.Message.getFieldWithDefault(msg, 8, 0), + acquiredDelegatedFrozenBalanceForBandwidth: jspb.Message.getFieldWithDefault(msg, 41, 0), + delegatedFrozenBalanceForBandwidth: jspb.Message.getFieldWithDefault(msg, 42, 0), + oldTronPower: jspb.Message.getFieldWithDefault(msg, 46, 0), + tronPower: (f4 = msg.getTronPower()) && TronWebProto.Account.Frozen.toObject(includeInstance, f4), + assetOptimized: jspb.Message.getBooleanFieldWithDefault(msg, 60, false), + createTime: jspb.Message.getFieldWithDefault(msg, 9, 0), + latestOprationTime: jspb.Message.getFieldWithDefault(msg, 10, 0), + allowance: jspb.Message.getFieldWithDefault(msg, 11, 0), + latestWithdrawTime: jspb.Message.getFieldWithDefault(msg, 12, 0), + code: msg.getCode_asB64(), + isWitness: jspb.Message.getBooleanFieldWithDefault(msg, 14, false), + isCommittee: jspb.Message.getBooleanFieldWithDefault(msg, 15, false), + frozenSupplyList: jspb.Message.toObjectList( + msg.getFrozenSupplyList(), + TronWebProto.Account.Frozen.toObject, + includeInstance + ), + assetIssuedName: msg.getAssetIssuedName_asB64(), + assetIssuedId: msg.getAssetIssuedId_asB64(), + latestAssetOperationTimeMap: (f4 = msg.getLatestAssetOperationTimeMap()) ? f4.toObject(includeInstance, void 0) : [], + latestAssetOperationTimev2Map: (f4 = msg.getLatestAssetOperationTimev2Map()) ? f4.toObject(includeInstance, void 0) : [], + freeNetUsage: jspb.Message.getFieldWithDefault(msg, 19, 0), + freeAssetNetUsageMap: (f4 = msg.getFreeAssetNetUsageMap()) ? f4.toObject(includeInstance, void 0) : [], + freeAssetNetUsagev2Map: (f4 = msg.getFreeAssetNetUsagev2Map()) ? f4.toObject(includeInstance, void 0) : [], + latestConsumeTime: jspb.Message.getFieldWithDefault(msg, 21, 0), + latestConsumeFreeTime: jspb.Message.getFieldWithDefault(msg, 22, 0), + accountId: msg.getAccountId_asB64(), + accountResource: (f4 = msg.getAccountResource()) && TronWebProto.Account.AccountResource.toObject(includeInstance, f4), + codehash: msg.getCodehash_asB64(), + ownerPermission: (f4 = msg.getOwnerPermission()) && TronWebProto.Permission.toObject(includeInstance, f4), + witnessPermission: (f4 = msg.getWitnessPermission()) && TronWebProto.Permission.toObject(includeInstance, f4), + activePermissionList: jspb.Message.toObjectList( + msg.getActivePermissionList(), + TronWebProto.Permission.toObject, + includeInstance + ) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Account.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Account(); + return TronWebProto.Account.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Account.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAccountName(value); + break; + case 2: + var value = ( + /** @type {!TronWebProto.AccountType} */ + reader.readEnum() + ); + msg.setType(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAddress(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setBalance(value); + break; + case 5: + var value = new TronWebProto.Vote(); + reader.readMessage(value, TronWebProto.Vote.deserializeBinaryFromReader); + msg.addVotes(value); + break; + case 6: + var value = msg.getAssetMap(); + reader.readMessage(value, function(message2, reader2) { + jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); + }); + break; + case 56: + var value = msg.getAssetv2Map(); + reader.readMessage(value, function(message2, reader2) { + jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); + }); + break; + case 7: + var value = new TronWebProto.Account.Frozen(); + reader.readMessage(value, TronWebProto.Account.Frozen.deserializeBinaryFromReader); + msg.addFrozen(value); + break; + case 8: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setNetUsage(value); + break; + case 41: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setAcquiredDelegatedFrozenBalanceForBandwidth(value); + break; + case 42: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setDelegatedFrozenBalanceForBandwidth(value); + break; + case 46: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setOldTronPower(value); + break; + case 47: + var value = new TronWebProto.Account.Frozen(); + reader.readMessage(value, TronWebProto.Account.Frozen.deserializeBinaryFromReader); + msg.setTronPower(value); + break; + case 60: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setAssetOptimized(value); + break; + case 9: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setCreateTime(value); + break; + case 10: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setLatestOprationTime(value); + break; + case 11: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setAllowance(value); + break; + case 12: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setLatestWithdrawTime(value); + break; + case 13: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setCode(value); + break; + case 14: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setIsWitness(value); + break; + case 15: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setIsCommittee(value); + break; + case 16: + var value = new TronWebProto.Account.Frozen(); + reader.readMessage(value, TronWebProto.Account.Frozen.deserializeBinaryFromReader); + msg.addFrozenSupply(value); + break; + case 17: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAssetIssuedName(value); + break; + case 57: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAssetIssuedId(value); + break; + case 18: + var value = msg.getLatestAssetOperationTimeMap(); + reader.readMessage(value, function(message2, reader2) { + jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); + }); + break; + case 58: + var value = msg.getLatestAssetOperationTimev2Map(); + reader.readMessage(value, function(message2, reader2) { + jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); + }); + break; + case 19: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFreeNetUsage(value); + break; + case 20: + var value = msg.getFreeAssetNetUsageMap(); + reader.readMessage(value, function(message2, reader2) { + jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); + }); + break; + case 59: + var value = msg.getFreeAssetNetUsagev2Map(); + reader.readMessage(value, function(message2, reader2) { + jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64, null, "", 0); + }); + break; + case 21: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setLatestConsumeTime(value); + break; + case 22: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setLatestConsumeFreeTime(value); + break; + case 23: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAccountId(value); + break; + case 26: + var value = new TronWebProto.Account.AccountResource(); + reader.readMessage(value, TronWebProto.Account.AccountResource.deserializeBinaryFromReader); + msg.setAccountResource(value); + break; + case 30: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setCodehash(value); + break; + case 31: + var value = new TronWebProto.Permission(); + reader.readMessage(value, TronWebProto.Permission.deserializeBinaryFromReader); + msg.setOwnerPermission(value); + break; + case 32: + var value = new TronWebProto.Permission(); + reader.readMessage(value, TronWebProto.Permission.deserializeBinaryFromReader); + msg.setWitnessPermission(value); + break; + case 33: + var value = new TronWebProto.Permission(); + reader.readMessage(value, TronWebProto.Permission.deserializeBinaryFromReader); + msg.addActivePermission(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Account.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Account.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Account.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAccountName_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getType(); + if (f4 !== 0) { + writer.writeEnum( + 2, + f4 + ); + } + f4 = message2.getAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getBalance(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + f4 = message2.getVotesList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 5, + f4, + TronWebProto.Vote.serializeBinaryToWriter + ); + } + f4 = message2.getAssetMap(true); + if (f4 && f4.getLength() > 0) { + f4.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f4 = message2.getAssetv2Map(true); + if (f4 && f4.getLength() > 0) { + f4.serializeBinary(56, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f4 = message2.getFrozenList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 7, + f4, + TronWebProto.Account.Frozen.serializeBinaryToWriter + ); + } + f4 = message2.getNetUsage(); + if (f4 !== 0) { + writer.writeInt64( + 8, + f4 + ); + } + f4 = message2.getAcquiredDelegatedFrozenBalanceForBandwidth(); + if (f4 !== 0) { + writer.writeInt64( + 41, + f4 + ); + } + f4 = message2.getDelegatedFrozenBalanceForBandwidth(); + if (f4 !== 0) { + writer.writeInt64( + 42, + f4 + ); + } + f4 = message2.getOldTronPower(); + if (f4 !== 0) { + writer.writeInt64( + 46, + f4 + ); + } + f4 = message2.getTronPower(); + if (f4 != null) { + writer.writeMessage( + 47, + f4, + TronWebProto.Account.Frozen.serializeBinaryToWriter + ); + } + f4 = message2.getAssetOptimized(); + if (f4) { + writer.writeBool( + 60, + f4 + ); + } + f4 = message2.getCreateTime(); + if (f4 !== 0) { + writer.writeInt64( + 9, + f4 + ); + } + f4 = message2.getLatestOprationTime(); + if (f4 !== 0) { + writer.writeInt64( + 10, + f4 + ); + } + f4 = message2.getAllowance(); + if (f4 !== 0) { + writer.writeInt64( + 11, + f4 + ); + } + f4 = message2.getLatestWithdrawTime(); + if (f4 !== 0) { + writer.writeInt64( + 12, + f4 + ); + } + f4 = message2.getCode_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 13, + f4 + ); + } + f4 = message2.getIsWitness(); + if (f4) { + writer.writeBool( + 14, + f4 + ); + } + f4 = message2.getIsCommittee(); + if (f4) { + writer.writeBool( + 15, + f4 + ); + } + f4 = message2.getFrozenSupplyList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 16, + f4, + TronWebProto.Account.Frozen.serializeBinaryToWriter + ); + } + f4 = message2.getAssetIssuedName_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 17, + f4 + ); + } + f4 = message2.getAssetIssuedId_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 57, + f4 + ); + } + f4 = message2.getLatestAssetOperationTimeMap(true); + if (f4 && f4.getLength() > 0) { + f4.serializeBinary(18, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f4 = message2.getLatestAssetOperationTimev2Map(true); + if (f4 && f4.getLength() > 0) { + f4.serializeBinary(58, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f4 = message2.getFreeNetUsage(); + if (f4 !== 0) { + writer.writeInt64( + 19, + f4 + ); + } + f4 = message2.getFreeAssetNetUsageMap(true); + if (f4 && f4.getLength() > 0) { + f4.serializeBinary(20, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f4 = message2.getFreeAssetNetUsagev2Map(true); + if (f4 && f4.getLength() > 0) { + f4.serializeBinary(59, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f4 = message2.getLatestConsumeTime(); + if (f4 !== 0) { + writer.writeInt64( + 21, + f4 + ); + } + f4 = message2.getLatestConsumeFreeTime(); + if (f4 !== 0) { + writer.writeInt64( + 22, + f4 + ); + } + f4 = message2.getAccountId_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 23, + f4 + ); + } + f4 = message2.getAccountResource(); + if (f4 != null) { + writer.writeMessage( + 26, + f4, + TronWebProto.Account.AccountResource.serializeBinaryToWriter + ); + } + f4 = message2.getCodehash_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 30, + f4 + ); + } + f4 = message2.getOwnerPermission(); + if (f4 != null) { + writer.writeMessage( + 31, + f4, + TronWebProto.Permission.serializeBinaryToWriter + ); + } + f4 = message2.getWitnessPermission(); + if (f4 != null) { + writer.writeMessage( + 32, + f4, + TronWebProto.Permission.serializeBinaryToWriter + ); + } + f4 = message2.getActivePermissionList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 33, + f4, + TronWebProto.Permission.serializeBinaryToWriter + ); + } + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Account.Frozen.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Account.Frozen.toObject(opt_includeInstance, this); + }; + TronWebProto.Account.Frozen.toObject = function(includeInstance, msg) { + var obj = { + frozenBalance: jspb.Message.getFieldWithDefault(msg, 1, 0), + expireTime: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Account.Frozen.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Account.Frozen(); + return TronWebProto.Account.Frozen.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Account.Frozen.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFrozenBalance(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExpireTime(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Account.Frozen.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Account.Frozen.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Account.Frozen.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getFrozenBalance(); + if (f4 !== 0) { + writer.writeInt64( + 1, + f4 + ); + } + f4 = message2.getExpireTime(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + }; + TronWebProto.Account.Frozen.prototype.getFrozenBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.Account.Frozen.prototype.setFrozenBalance = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.Account.Frozen.prototype.getExpireTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.Account.Frozen.prototype.setExpireTime = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Account.AccountResource.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Account.AccountResource.toObject(opt_includeInstance, this); + }; + TronWebProto.Account.AccountResource.toObject = function(includeInstance, msg) { + var f4, obj = { + energyUsage: jspb.Message.getFieldWithDefault(msg, 1, 0), + frozenBalanceForEnergy: (f4 = msg.getFrozenBalanceForEnergy()) && TronWebProto.Account.Frozen.toObject(includeInstance, f4), + latestConsumeTimeForEnergy: jspb.Message.getFieldWithDefault(msg, 3, 0), + acquiredDelegatedFrozenBalanceForEnergy: jspb.Message.getFieldWithDefault(msg, 4, 0), + delegatedFrozenBalanceForEnergy: jspb.Message.getFieldWithDefault(msg, 5, 0), + storageLimit: jspb.Message.getFieldWithDefault(msg, 6, 0), + storageUsage: jspb.Message.getFieldWithDefault(msg, 7, 0), + latestExchangeStorageTime: jspb.Message.getFieldWithDefault(msg, 8, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Account.AccountResource.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Account.AccountResource(); + return TronWebProto.Account.AccountResource.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Account.AccountResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setEnergyUsage(value); + break; + case 2: + var value = new TronWebProto.Account.Frozen(); + reader.readMessage(value, TronWebProto.Account.Frozen.deserializeBinaryFromReader); + msg.setFrozenBalanceForEnergy(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setLatestConsumeTimeForEnergy(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setAcquiredDelegatedFrozenBalanceForEnergy(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setDelegatedFrozenBalanceForEnergy(value); + break; + case 6: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setStorageLimit(value); + break; + case 7: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setStorageUsage(value); + break; + case 8: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setLatestExchangeStorageTime(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Account.AccountResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Account.AccountResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Account.AccountResource.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getEnergyUsage(); + if (f4 !== 0) { + writer.writeInt64( + 1, + f4 + ); + } + f4 = message2.getFrozenBalanceForEnergy(); + if (f4 != null) { + writer.writeMessage( + 2, + f4, + TronWebProto.Account.Frozen.serializeBinaryToWriter + ); + } + f4 = message2.getLatestConsumeTimeForEnergy(); + if (f4 !== 0) { + writer.writeInt64( + 3, + f4 + ); + } + f4 = message2.getAcquiredDelegatedFrozenBalanceForEnergy(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + f4 = message2.getDelegatedFrozenBalanceForEnergy(); + if (f4 !== 0) { + writer.writeInt64( + 5, + f4 + ); + } + f4 = message2.getStorageLimit(); + if (f4 !== 0) { + writer.writeInt64( + 6, + f4 + ); + } + f4 = message2.getStorageUsage(); + if (f4 !== 0) { + writer.writeInt64( + 7, + f4 + ); + } + f4 = message2.getLatestExchangeStorageTime(); + if (f4 !== 0) { + writer.writeInt64( + 8, + f4 + ); + } + }; + TronWebProto.Account.AccountResource.prototype.getEnergyUsage = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.Account.AccountResource.prototype.setEnergyUsage = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.Account.AccountResource.prototype.getFrozenBalanceForEnergy = function() { + return ( + /** @type{?TronWebProto.Account.Frozen} */ + jspb.Message.getWrapperField(this, TronWebProto.Account.Frozen, 2) + ); + }; + TronWebProto.Account.AccountResource.prototype.setFrozenBalanceForEnergy = function(value) { + return jspb.Message.setWrapperField(this, 2, value); + }; + TronWebProto.Account.AccountResource.prototype.clearFrozenBalanceForEnergy = function() { + return this.setFrozenBalanceForEnergy(void 0); + }; + TronWebProto.Account.AccountResource.prototype.hasFrozenBalanceForEnergy = function() { + return jspb.Message.getField(this, 2) != null; + }; + TronWebProto.Account.AccountResource.prototype.getLatestConsumeTimeForEnergy = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.Account.AccountResource.prototype.setLatestConsumeTimeForEnergy = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.Account.AccountResource.prototype.getAcquiredDelegatedFrozenBalanceForEnergy = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.Account.AccountResource.prototype.setAcquiredDelegatedFrozenBalanceForEnergy = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + TronWebProto.Account.AccountResource.prototype.getDelegatedFrozenBalanceForEnergy = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.Account.AccountResource.prototype.setDelegatedFrozenBalanceForEnergy = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + TronWebProto.Account.AccountResource.prototype.getStorageLimit = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 6, 0) + ); + }; + TronWebProto.Account.AccountResource.prototype.setStorageLimit = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); + }; + TronWebProto.Account.AccountResource.prototype.getStorageUsage = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 7, 0) + ); + }; + TronWebProto.Account.AccountResource.prototype.setStorageUsage = function(value) { + return jspb.Message.setProto3IntField(this, 7, value); + }; + TronWebProto.Account.AccountResource.prototype.getLatestExchangeStorageTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 8, 0) + ); + }; + TronWebProto.Account.AccountResource.prototype.setLatestExchangeStorageTime = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); + }; + TronWebProto.Account.prototype.getAccountName = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.Account.prototype.getAccountName_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAccountName() + ) + ); + }; + TronWebProto.Account.prototype.getAccountName_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAccountName() + ) + ); + }; + TronWebProto.Account.prototype.setAccountName = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.Account.prototype.getType = function() { + return ( + /** @type {!TronWebProto.AccountType} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.Account.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); + }; + TronWebProto.Account.prototype.getAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.Account.prototype.getAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAddress() + ) + ); + }; + TronWebProto.Account.prototype.getAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAddress() + ) + ); + }; + TronWebProto.Account.prototype.setAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.Account.prototype.getBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.Account.prototype.setBalance = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + TronWebProto.Account.prototype.getVotesList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.Vote, 5) + ); + }; + TronWebProto.Account.prototype.setVotesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); + }; + TronWebProto.Account.prototype.addVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, TronWebProto.Vote, opt_index); + }; + TronWebProto.Account.prototype.clearVotesList = function() { + return this.setVotesList([]); + }; + TronWebProto.Account.prototype.getAssetMap = function(opt_noLazyCreate) { + return ( + /** @type {!jspb.Map} */ + jspb.Message.getMapField( + this, + 6, + opt_noLazyCreate, + null + ) + ); + }; + TronWebProto.Account.prototype.clearAssetMap = function() { + this.getAssetMap().clear(); + return this; + }; + TronWebProto.Account.prototype.getAssetv2Map = function(opt_noLazyCreate) { + return ( + /** @type {!jspb.Map} */ + jspb.Message.getMapField( + this, + 56, + opt_noLazyCreate, + null + ) + ); + }; + TronWebProto.Account.prototype.clearAssetv2Map = function() { + this.getAssetv2Map().clear(); + return this; + }; + TronWebProto.Account.prototype.getFrozenList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.Account.Frozen, 7) + ); + }; + TronWebProto.Account.prototype.setFrozenList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 7, value); + }; + TronWebProto.Account.prototype.addFrozen = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, TronWebProto.Account.Frozen, opt_index); + }; + TronWebProto.Account.prototype.clearFrozenList = function() { + return this.setFrozenList([]); + }; + TronWebProto.Account.prototype.getNetUsage = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 8, 0) + ); + }; + TronWebProto.Account.prototype.setNetUsage = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); + }; + TronWebProto.Account.prototype.getAcquiredDelegatedFrozenBalanceForBandwidth = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 41, 0) + ); + }; + TronWebProto.Account.prototype.setAcquiredDelegatedFrozenBalanceForBandwidth = function(value) { + return jspb.Message.setProto3IntField(this, 41, value); + }; + TronWebProto.Account.prototype.getDelegatedFrozenBalanceForBandwidth = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 42, 0) + ); + }; + TronWebProto.Account.prototype.setDelegatedFrozenBalanceForBandwidth = function(value) { + return jspb.Message.setProto3IntField(this, 42, value); + }; + TronWebProto.Account.prototype.getOldTronPower = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 46, 0) + ); + }; + TronWebProto.Account.prototype.setOldTronPower = function(value) { + return jspb.Message.setProto3IntField(this, 46, value); + }; + TronWebProto.Account.prototype.getTronPower = function() { + return ( + /** @type{?TronWebProto.Account.Frozen} */ + jspb.Message.getWrapperField(this, TronWebProto.Account.Frozen, 47) + ); + }; + TronWebProto.Account.prototype.setTronPower = function(value) { + return jspb.Message.setWrapperField(this, 47, value); + }; + TronWebProto.Account.prototype.clearTronPower = function() { + return this.setTronPower(void 0); + }; + TronWebProto.Account.prototype.hasTronPower = function() { + return jspb.Message.getField(this, 47) != null; + }; + TronWebProto.Account.prototype.getAssetOptimized = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 60, false) + ); + }; + TronWebProto.Account.prototype.setAssetOptimized = function(value) { + return jspb.Message.setProto3BooleanField(this, 60, value); + }; + TronWebProto.Account.prototype.getCreateTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 9, 0) + ); + }; + TronWebProto.Account.prototype.setCreateTime = function(value) { + return jspb.Message.setProto3IntField(this, 9, value); + }; + TronWebProto.Account.prototype.getLatestOprationTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 10, 0) + ); + }; + TronWebProto.Account.prototype.setLatestOprationTime = function(value) { + return jspb.Message.setProto3IntField(this, 10, value); + }; + TronWebProto.Account.prototype.getAllowance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 11, 0) + ); + }; + TronWebProto.Account.prototype.setAllowance = function(value) { + return jspb.Message.setProto3IntField(this, 11, value); + }; + TronWebProto.Account.prototype.getLatestWithdrawTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 12, 0) + ); + }; + TronWebProto.Account.prototype.setLatestWithdrawTime = function(value) { + return jspb.Message.setProto3IntField(this, 12, value); + }; + TronWebProto.Account.prototype.getCode = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 13, "") + ); + }; + TronWebProto.Account.prototype.getCode_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getCode() + ) + ); + }; + TronWebProto.Account.prototype.getCode_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getCode() + ) + ); + }; + TronWebProto.Account.prototype.setCode = function(value) { + return jspb.Message.setProto3BytesField(this, 13, value); + }; + TronWebProto.Account.prototype.getIsWitness = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 14, false) + ); + }; + TronWebProto.Account.prototype.setIsWitness = function(value) { + return jspb.Message.setProto3BooleanField(this, 14, value); + }; + TronWebProto.Account.prototype.getIsCommittee = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 15, false) + ); + }; + TronWebProto.Account.prototype.setIsCommittee = function(value) { + return jspb.Message.setProto3BooleanField(this, 15, value); + }; + TronWebProto.Account.prototype.getFrozenSupplyList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.Account.Frozen, 16) + ); + }; + TronWebProto.Account.prototype.setFrozenSupplyList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 16, value); + }; + TronWebProto.Account.prototype.addFrozenSupply = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 16, opt_value, TronWebProto.Account.Frozen, opt_index); + }; + TronWebProto.Account.prototype.clearFrozenSupplyList = function() { + return this.setFrozenSupplyList([]); + }; + TronWebProto.Account.prototype.getAssetIssuedName = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 17, "") + ); + }; + TronWebProto.Account.prototype.getAssetIssuedName_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAssetIssuedName() + ) + ); + }; + TronWebProto.Account.prototype.getAssetIssuedName_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAssetIssuedName() + ) + ); + }; + TronWebProto.Account.prototype.setAssetIssuedName = function(value) { + return jspb.Message.setProto3BytesField(this, 17, value); + }; + TronWebProto.Account.prototype.getAssetIssuedId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 57, "") + ); + }; + TronWebProto.Account.prototype.getAssetIssuedId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAssetIssuedId() + ) + ); + }; + TronWebProto.Account.prototype.getAssetIssuedId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAssetIssuedId() + ) + ); + }; + TronWebProto.Account.prototype.setAssetIssuedId = function(value) { + return jspb.Message.setProto3BytesField(this, 57, value); + }; + TronWebProto.Account.prototype.getLatestAssetOperationTimeMap = function(opt_noLazyCreate) { + return ( + /** @type {!jspb.Map} */ + jspb.Message.getMapField( + this, + 18, + opt_noLazyCreate, + null + ) + ); + }; + TronWebProto.Account.prototype.clearLatestAssetOperationTimeMap = function() { + this.getLatestAssetOperationTimeMap().clear(); + return this; + }; + TronWebProto.Account.prototype.getLatestAssetOperationTimev2Map = function(opt_noLazyCreate) { + return ( + /** @type {!jspb.Map} */ + jspb.Message.getMapField( + this, + 58, + opt_noLazyCreate, + null + ) + ); + }; + TronWebProto.Account.prototype.clearLatestAssetOperationTimev2Map = function() { + this.getLatestAssetOperationTimev2Map().clear(); + return this; + }; + TronWebProto.Account.prototype.getFreeNetUsage = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 19, 0) + ); + }; + TronWebProto.Account.prototype.setFreeNetUsage = function(value) { + return jspb.Message.setProto3IntField(this, 19, value); + }; + TronWebProto.Account.prototype.getFreeAssetNetUsageMap = function(opt_noLazyCreate) { + return ( + /** @type {!jspb.Map} */ + jspb.Message.getMapField( + this, + 20, + opt_noLazyCreate, + null + ) + ); + }; + TronWebProto.Account.prototype.clearFreeAssetNetUsageMap = function() { + this.getFreeAssetNetUsageMap().clear(); + return this; + }; + TronWebProto.Account.prototype.getFreeAssetNetUsagev2Map = function(opt_noLazyCreate) { + return ( + /** @type {!jspb.Map} */ + jspb.Message.getMapField( + this, + 59, + opt_noLazyCreate, + null + ) + ); + }; + TronWebProto.Account.prototype.clearFreeAssetNetUsagev2Map = function() { + this.getFreeAssetNetUsagev2Map().clear(); + return this; + }; + TronWebProto.Account.prototype.getLatestConsumeTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 21, 0) + ); + }; + TronWebProto.Account.prototype.setLatestConsumeTime = function(value) { + return jspb.Message.setProto3IntField(this, 21, value); + }; + TronWebProto.Account.prototype.getLatestConsumeFreeTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 22, 0) + ); + }; + TronWebProto.Account.prototype.setLatestConsumeFreeTime = function(value) { + return jspb.Message.setProto3IntField(this, 22, value); + }; + TronWebProto.Account.prototype.getAccountId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 23, "") + ); + }; + TronWebProto.Account.prototype.getAccountId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAccountId() + ) + ); + }; + TronWebProto.Account.prototype.getAccountId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAccountId() + ) + ); + }; + TronWebProto.Account.prototype.setAccountId = function(value) { + return jspb.Message.setProto3BytesField(this, 23, value); + }; + TronWebProto.Account.prototype.getAccountResource = function() { + return ( + /** @type{?TronWebProto.Account.AccountResource} */ + jspb.Message.getWrapperField(this, TronWebProto.Account.AccountResource, 26) + ); + }; + TronWebProto.Account.prototype.setAccountResource = function(value) { + return jspb.Message.setWrapperField(this, 26, value); + }; + TronWebProto.Account.prototype.clearAccountResource = function() { + return this.setAccountResource(void 0); + }; + TronWebProto.Account.prototype.hasAccountResource = function() { + return jspb.Message.getField(this, 26) != null; + }; + TronWebProto.Account.prototype.getCodehash = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 30, "") + ); + }; + TronWebProto.Account.prototype.getCodehash_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getCodehash() + ) + ); + }; + TronWebProto.Account.prototype.getCodehash_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getCodehash() + ) + ); + }; + TronWebProto.Account.prototype.setCodehash = function(value) { + return jspb.Message.setProto3BytesField(this, 30, value); + }; + TronWebProto.Account.prototype.getOwnerPermission = function() { + return ( + /** @type{?TronWebProto.Permission} */ + jspb.Message.getWrapperField(this, TronWebProto.Permission, 31) + ); + }; + TronWebProto.Account.prototype.setOwnerPermission = function(value) { + return jspb.Message.setWrapperField(this, 31, value); + }; + TronWebProto.Account.prototype.clearOwnerPermission = function() { + return this.setOwnerPermission(void 0); + }; + TronWebProto.Account.prototype.hasOwnerPermission = function() { + return jspb.Message.getField(this, 31) != null; + }; + TronWebProto.Account.prototype.getWitnessPermission = function() { + return ( + /** @type{?TronWebProto.Permission} */ + jspb.Message.getWrapperField(this, TronWebProto.Permission, 32) + ); + }; + TronWebProto.Account.prototype.setWitnessPermission = function(value) { + return jspb.Message.setWrapperField(this, 32, value); + }; + TronWebProto.Account.prototype.clearWitnessPermission = function() { + return this.setWitnessPermission(void 0); + }; + TronWebProto.Account.prototype.hasWitnessPermission = function() { + return jspb.Message.getField(this, 32) != null; + }; + TronWebProto.Account.prototype.getActivePermissionList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.Permission, 33) + ); + }; + TronWebProto.Account.prototype.setActivePermissionList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 33, value); + }; + TronWebProto.Account.prototype.addActivePermission = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 33, opt_value, TronWebProto.Permission, opt_index); + }; + TronWebProto.Account.prototype.clearActivePermissionList = function() { + return this.setActivePermissionList([]); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Key.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Key.toObject(opt_includeInstance, this); + }; + TronWebProto.Key.toObject = function(includeInstance, msg) { + var obj = { + address: msg.getAddress_asB64(), + weight: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Key.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Key(); + return TronWebProto.Key.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Key.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setWeight(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Key.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Key.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Key.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getWeight(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + }; + TronWebProto.Key.prototype.getAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.Key.prototype.getAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAddress() + ) + ); + }; + TronWebProto.Key.prototype.getAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAddress() + ) + ); + }; + TronWebProto.Key.prototype.setAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.Key.prototype.getWeight = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.Key.prototype.setWeight = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.DelegatedResource.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.DelegatedResource.toObject(opt_includeInstance, this); + }; + TronWebProto.DelegatedResource.toObject = function(includeInstance, msg) { + var obj = { + from: msg.getFrom_asB64(), + to: msg.getTo_asB64(), + frozenBalanceForBandwidth: jspb.Message.getFieldWithDefault(msg, 3, 0), + frozenBalanceForEnergy: jspb.Message.getFieldWithDefault(msg, 4, 0), + expireTimeForBandwidth: jspb.Message.getFieldWithDefault(msg, 5, 0), + expireTimeForEnergy: jspb.Message.getFieldWithDefault(msg, 6, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.DelegatedResource.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.DelegatedResource(); + return TronWebProto.DelegatedResource.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.DelegatedResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setFrom(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setTo(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFrozenBalanceForBandwidth(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFrozenBalanceForEnergy(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExpireTimeForBandwidth(value); + break; + case 6: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExpireTimeForEnergy(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.DelegatedResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.DelegatedResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.DelegatedResource.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getFrom_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getTo_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + f4 = message2.getFrozenBalanceForBandwidth(); + if (f4 !== 0) { + writer.writeInt64( + 3, + f4 + ); + } + f4 = message2.getFrozenBalanceForEnergy(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + f4 = message2.getExpireTimeForBandwidth(); + if (f4 !== 0) { + writer.writeInt64( + 5, + f4 + ); + } + f4 = message2.getExpireTimeForEnergy(); + if (f4 !== 0) { + writer.writeInt64( + 6, + f4 + ); + } + }; + TronWebProto.DelegatedResource.prototype.getFrom = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.DelegatedResource.prototype.getFrom_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getFrom() + ) + ); + }; + TronWebProto.DelegatedResource.prototype.getFrom_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getFrom() + ) + ); + }; + TronWebProto.DelegatedResource.prototype.setFrom = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.DelegatedResource.prototype.getTo = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.DelegatedResource.prototype.getTo_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getTo() + ) + ); + }; + TronWebProto.DelegatedResource.prototype.getTo_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getTo() + ) + ); + }; + TronWebProto.DelegatedResource.prototype.setTo = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.DelegatedResource.prototype.getFrozenBalanceForBandwidth = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.DelegatedResource.prototype.setFrozenBalanceForBandwidth = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.DelegatedResource.prototype.getFrozenBalanceForEnergy = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.DelegatedResource.prototype.setFrozenBalanceForEnergy = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + TronWebProto.DelegatedResource.prototype.getExpireTimeForBandwidth = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.DelegatedResource.prototype.setExpireTimeForBandwidth = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + TronWebProto.DelegatedResource.prototype.getExpireTimeForEnergy = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 6, 0) + ); + }; + TronWebProto.DelegatedResource.prototype.setExpireTimeForEnergy = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.authority.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.authority.toObject(opt_includeInstance, this); + }; + TronWebProto.authority.toObject = function(includeInstance, msg) { + var f4, obj = { + account: (f4 = msg.getAccount()) && TronWebProto.AccountId.toObject(includeInstance, f4), + permissionName: msg.getPermissionName_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.authority.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.authority(); + return TronWebProto.authority.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.authority.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new TronWebProto.AccountId(); + reader.readMessage(value, TronWebProto.AccountId.deserializeBinaryFromReader); + msg.setAccount(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setPermissionName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.authority.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.authority.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.authority.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAccount(); + if (f4 != null) { + writer.writeMessage( + 1, + f4, + TronWebProto.AccountId.serializeBinaryToWriter + ); + } + f4 = message2.getPermissionName_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + }; + TronWebProto.authority.prototype.getAccount = function() { + return ( + /** @type{?TronWebProto.AccountId} */ + jspb.Message.getWrapperField(this, TronWebProto.AccountId, 1) + ); + }; + TronWebProto.authority.prototype.setAccount = function(value) { + return jspb.Message.setWrapperField(this, 1, value); + }; + TronWebProto.authority.prototype.clearAccount = function() { + return this.setAccount(void 0); + }; + TronWebProto.authority.prototype.hasAccount = function() { + return jspb.Message.getField(this, 1) != null; + }; + TronWebProto.authority.prototype.getPermissionName = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.authority.prototype.getPermissionName_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getPermissionName() + ) + ); + }; + TronWebProto.authority.prototype.getPermissionName_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getPermissionName() + ) + ); + }; + TronWebProto.authority.prototype.setPermissionName = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.Permission.repeatedFields_ = [7]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Permission.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Permission.toObject(opt_includeInstance, this); + }; + TronWebProto.Permission.toObject = function(includeInstance, msg) { + var obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + id: jspb.Message.getFieldWithDefault(msg, 2, 0), + permissionName: jspb.Message.getFieldWithDefault(msg, 3, ""), + threshold: jspb.Message.getFieldWithDefault(msg, 4, 0), + parentId: jspb.Message.getFieldWithDefault(msg, 5, 0), + operations: msg.getOperations_asB64(), + keysList: jspb.Message.toObjectList( + msg.getKeysList(), + TronWebProto.Key.toObject, + includeInstance + ) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Permission.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Permission(); + return TronWebProto.Permission.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Permission.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!TronWebProto.Permission.PermissionType} */ + reader.readEnum() + ); + msg.setType(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt32() + ); + msg.setId(value); + break; + case 3: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setPermissionName(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setThreshold(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt32() + ); + msg.setParentId(value); + break; + case 6: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOperations(value); + break; + case 7: + var value = new TronWebProto.Key(); + reader.readMessage(value, TronWebProto.Key.deserializeBinaryFromReader); + msg.addKeys(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Permission.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Permission.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Permission.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getType(); + if (f4 !== 0) { + writer.writeEnum( + 1, + f4 + ); + } + f4 = message2.getId(); + if (f4 !== 0) { + writer.writeInt32( + 2, + f4 + ); + } + f4 = message2.getPermissionName(); + if (f4.length > 0) { + writer.writeString( + 3, + f4 + ); + } + f4 = message2.getThreshold(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + f4 = message2.getParentId(); + if (f4 !== 0) { + writer.writeInt32( + 5, + f4 + ); + } + f4 = message2.getOperations_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 6, + f4 + ); + } + f4 = message2.getKeysList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 7, + f4, + TronWebProto.Key.serializeBinaryToWriter + ); + } + }; + TronWebProto.Permission.PermissionType = { + OWNER: 0, + WITNESS: 1, + ACTIVE: 2 + }; + TronWebProto.Permission.prototype.getType = function() { + return ( + /** @type {!TronWebProto.Permission.PermissionType} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.Permission.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); + }; + TronWebProto.Permission.prototype.getId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.Permission.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.Permission.prototype.getPermissionName = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.Permission.prototype.setPermissionName = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); + }; + TronWebProto.Permission.prototype.getThreshold = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.Permission.prototype.setThreshold = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + TronWebProto.Permission.prototype.getParentId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.Permission.prototype.setParentId = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + TronWebProto.Permission.prototype.getOperations = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 6, "") + ); + }; + TronWebProto.Permission.prototype.getOperations_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOperations() + ) + ); + }; + TronWebProto.Permission.prototype.getOperations_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOperations() + ) + ); + }; + TronWebProto.Permission.prototype.setOperations = function(value) { + return jspb.Message.setProto3BytesField(this, 6, value); + }; + TronWebProto.Permission.prototype.getKeysList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.Key, 7) + ); + }; + TronWebProto.Permission.prototype.setKeysList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 7, value); + }; + TronWebProto.Permission.prototype.addKeys = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, TronWebProto.Key, opt_index); + }; + TronWebProto.Permission.prototype.clearKeysList = function() { + return this.setKeysList([]); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Witness.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Witness.toObject(opt_includeInstance, this); + }; + TronWebProto.Witness.toObject = function(includeInstance, msg) { + var obj = { + address: msg.getAddress_asB64(), + votecount: jspb.Message.getFieldWithDefault(msg, 2, 0), + pubkey: msg.getPubkey_asB64(), + url: jspb.Message.getFieldWithDefault(msg, 4, ""), + totalproduced: jspb.Message.getFieldWithDefault(msg, 5, 0), + totalmissed: jspb.Message.getFieldWithDefault(msg, 6, 0), + latestblocknum: jspb.Message.getFieldWithDefault(msg, 7, 0), + latestslotnum: jspb.Message.getFieldWithDefault(msg, 8, 0), + isjobs: jspb.Message.getBooleanFieldWithDefault(msg, 9, false) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Witness.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Witness(); + return TronWebProto.Witness.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Witness.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setVotecount(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setPubkey(value); + break; + case 4: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setUrl(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setTotalproduced(value); + break; + case 6: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setTotalmissed(value); + break; + case 7: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setLatestblocknum(value); + break; + case 8: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setLatestslotnum(value); + break; + case 9: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setIsjobs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Witness.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Witness.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Witness.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getVotecount(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + f4 = message2.getPubkey_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getUrl(); + if (f4.length > 0) { + writer.writeString( + 4, + f4 + ); + } + f4 = message2.getTotalproduced(); + if (f4 !== 0) { + writer.writeInt64( + 5, + f4 + ); + } + f4 = message2.getTotalmissed(); + if (f4 !== 0) { + writer.writeInt64( + 6, + f4 + ); + } + f4 = message2.getLatestblocknum(); + if (f4 !== 0) { + writer.writeInt64( + 7, + f4 + ); + } + f4 = message2.getLatestslotnum(); + if (f4 !== 0) { + writer.writeInt64( + 8, + f4 + ); + } + f4 = message2.getIsjobs(); + if (f4) { + writer.writeBool( + 9, + f4 + ); + } + }; + TronWebProto.Witness.prototype.getAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.Witness.prototype.getAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAddress() + ) + ); + }; + TronWebProto.Witness.prototype.getAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAddress() + ) + ); + }; + TronWebProto.Witness.prototype.setAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.Witness.prototype.getVotecount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.Witness.prototype.setVotecount = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.Witness.prototype.getPubkey = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.Witness.prototype.getPubkey_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getPubkey() + ) + ); + }; + TronWebProto.Witness.prototype.getPubkey_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getPubkey() + ) + ); + }; + TronWebProto.Witness.prototype.setPubkey = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.Witness.prototype.getUrl = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 4, "") + ); + }; + TronWebProto.Witness.prototype.setUrl = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); + }; + TronWebProto.Witness.prototype.getTotalproduced = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.Witness.prototype.setTotalproduced = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + TronWebProto.Witness.prototype.getTotalmissed = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 6, 0) + ); + }; + TronWebProto.Witness.prototype.setTotalmissed = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); + }; + TronWebProto.Witness.prototype.getLatestblocknum = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 7, 0) + ); + }; + TronWebProto.Witness.prototype.setLatestblocknum = function(value) { + return jspb.Message.setProto3IntField(this, 7, value); + }; + TronWebProto.Witness.prototype.getLatestslotnum = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 8, 0) + ); + }; + TronWebProto.Witness.prototype.setLatestslotnum = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); + }; + TronWebProto.Witness.prototype.getIsjobs = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 9, false) + ); + }; + TronWebProto.Witness.prototype.setIsjobs = function(value) { + return jspb.Message.setProto3BooleanField(this, 9, value); + }; + TronWebProto.Votes.repeatedFields_ = [2, 3]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Votes.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Votes.toObject(opt_includeInstance, this); + }; + TronWebProto.Votes.toObject = function(includeInstance, msg) { + var obj = { + address: msg.getAddress_asB64(), + oldVotesList: jspb.Message.toObjectList( + msg.getOldVotesList(), + TronWebProto.Vote.toObject, + includeInstance + ), + newVotesList: jspb.Message.toObjectList( + msg.getNewVotesList(), + TronWebProto.Vote.toObject, + includeInstance + ) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Votes.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Votes(); + return TronWebProto.Votes.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Votes.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAddress(value); + break; + case 2: + var value = new TronWebProto.Vote(); + reader.readMessage(value, TronWebProto.Vote.deserializeBinaryFromReader); + msg.addOldVotes(value); + break; + case 3: + var value = new TronWebProto.Vote(); + reader.readMessage(value, TronWebProto.Vote.deserializeBinaryFromReader); + msg.addNewVotes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Votes.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Votes.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Votes.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getOldVotesList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 2, + f4, + TronWebProto.Vote.serializeBinaryToWriter + ); + } + f4 = message2.getNewVotesList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 3, + f4, + TronWebProto.Vote.serializeBinaryToWriter + ); + } + }; + TronWebProto.Votes.prototype.getAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.Votes.prototype.getAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAddress() + ) + ); + }; + TronWebProto.Votes.prototype.getAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAddress() + ) + ); + }; + TronWebProto.Votes.prototype.setAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.Votes.prototype.getOldVotesList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.Vote, 2) + ); + }; + TronWebProto.Votes.prototype.setOldVotesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); + }; + TronWebProto.Votes.prototype.addOldVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, TronWebProto.Vote, opt_index); + }; + TronWebProto.Votes.prototype.clearOldVotesList = function() { + return this.setOldVotesList([]); + }; + TronWebProto.Votes.prototype.getNewVotesList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.Vote, 3) + ); + }; + TronWebProto.Votes.prototype.setNewVotesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); + }; + TronWebProto.Votes.prototype.addNewVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, TronWebProto.Vote, opt_index); + }; + TronWebProto.Votes.prototype.clearNewVotesList = function() { + return this.setNewVotesList([]); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.MarketOrderDetail.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.MarketOrderDetail.toObject(opt_includeInstance, this); + }; + TronWebProto.MarketOrderDetail.toObject = function(includeInstance, msg) { + var obj = { + makerorderid: msg.getMakerorderid_asB64(), + takerorderid: msg.getTakerorderid_asB64(), + fillsellquantity: jspb.Message.getFieldWithDefault(msg, 3, 0), + fillbuyquantity: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.MarketOrderDetail.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.MarketOrderDetail(); + return TronWebProto.MarketOrderDetail.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.MarketOrderDetail.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setMakerorderid(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setTakerorderid(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFillsellquantity(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFillbuyquantity(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.MarketOrderDetail.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.MarketOrderDetail.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.MarketOrderDetail.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getMakerorderid_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getTakerorderid_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + f4 = message2.getFillsellquantity(); + if (f4 !== 0) { + writer.writeInt64( + 3, + f4 + ); + } + f4 = message2.getFillbuyquantity(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + }; + TronWebProto.MarketOrderDetail.prototype.getMakerorderid = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.MarketOrderDetail.prototype.getMakerorderid_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getMakerorderid() + ) + ); + }; + TronWebProto.MarketOrderDetail.prototype.getMakerorderid_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getMakerorderid() + ) + ); + }; + TronWebProto.MarketOrderDetail.prototype.setMakerorderid = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.MarketOrderDetail.prototype.getTakerorderid = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.MarketOrderDetail.prototype.getTakerorderid_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getTakerorderid() + ) + ); + }; + TronWebProto.MarketOrderDetail.prototype.getTakerorderid_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getTakerorderid() + ) + ); + }; + TronWebProto.MarketOrderDetail.prototype.setTakerorderid = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.MarketOrderDetail.prototype.getFillsellquantity = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.MarketOrderDetail.prototype.setFillsellquantity = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.MarketOrderDetail.prototype.getFillbuyquantity = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.MarketOrderDetail.prototype.setFillbuyquantity = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + TronWebProto.Transaction.repeatedFields_ = [2, 5]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Transaction.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Transaction.toObject(opt_includeInstance, this); + }; + TronWebProto.Transaction.toObject = function(includeInstance, msg) { + var f4, obj = { + rawData: (f4 = msg.getRawData()) && TronWebProto.Transaction.raw.toObject(includeInstance, f4), + signatureList: msg.getSignatureList_asB64(), + retList: jspb.Message.toObjectList( + msg.getRetList(), + TronWebProto.Transaction.Result.toObject, + includeInstance + ) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Transaction.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Transaction(); + return TronWebProto.Transaction.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Transaction.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new TronWebProto.Transaction.raw(); + reader.readMessage(value, TronWebProto.Transaction.raw.deserializeBinaryFromReader); + msg.setRawData(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.addSignature(value); + break; + case 5: + var value = new TronWebProto.Transaction.Result(); + reader.readMessage(value, TronWebProto.Transaction.Result.deserializeBinaryFromReader); + msg.addRet(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Transaction.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Transaction.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Transaction.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getRawData(); + if (f4 != null) { + writer.writeMessage( + 1, + f4, + TronWebProto.Transaction.raw.serializeBinaryToWriter + ); + } + f4 = message2.getSignatureList_asU8(); + if (f4.length > 0) { + writer.writeRepeatedBytes( + 2, + f4 + ); + } + f4 = message2.getRetList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 5, + f4, + TronWebProto.Transaction.Result.serializeBinaryToWriter + ); + } + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Transaction.Contract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Transaction.Contract.toObject(opt_includeInstance, this); + }; + TronWebProto.Transaction.Contract.toObject = function(includeInstance, msg) { + var f4, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + parameter: (f4 = msg.getParameter()) && google_protobuf_any_pb2.Any.toObject(includeInstance, f4), + provider: msg.getProvider_asB64(), + contractname: msg.getContractname_asB64(), + permissionId: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Transaction.Contract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Transaction.Contract(); + return TronWebProto.Transaction.Contract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Transaction.Contract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!TronWebProto.Transaction.Contract.ContractType} */ + reader.readEnum() + ); + msg.setType(value); + break; + case 2: + var value = new google_protobuf_any_pb2.Any(); + reader.readMessage(value, google_protobuf_any_pb2.Any.deserializeBinaryFromReader); + msg.setParameter(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setProvider(value); + break; + case 4: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setContractname(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt32() + ); + msg.setPermissionId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Transaction.Contract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Transaction.Contract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Transaction.Contract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getType(); + if (f4 !== 0) { + writer.writeEnum( + 1, + f4 + ); + } + f4 = message2.getParameter(); + if (f4 != null) { + writer.writeMessage( + 2, + f4, + google_protobuf_any_pb2.Any.serializeBinaryToWriter + ); + } + f4 = message2.getProvider_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getContractname_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 4, + f4 + ); + } + f4 = message2.getPermissionId(); + if (f4 !== 0) { + writer.writeInt32( + 5, + f4 + ); + } + }; + TronWebProto.Transaction.Contract.ContractType = { + ACCOUNTCREATECONTRACT: 0, + TRANSFERCONTRACT: 1, + TRANSFERASSETCONTRACT: 2, + VOTEASSETCONTRACT: 3, + VOTEWITNESSCONTRACT: 4, + WITNESSCREATECONTRACT: 5, + ASSETISSUECONTRACT: 6, + WITNESSUPDATECONTRACT: 8, + PARTICIPATEASSETISSUECONTRACT: 9, + ACCOUNTUPDATECONTRACT: 10, + FREEZEBALANCECONTRACT: 11, + UNFREEZEBALANCECONTRACT: 12, + WITHDRAWBALANCECONTRACT: 13, + UNFREEZEASSETCONTRACT: 14, + UPDATEASSETCONTRACT: 15, + PROPOSALCREATECONTRACT: 16, + PROPOSALAPPROVECONTRACT: 17, + PROPOSALDELETECONTRACT: 18, + SETACCOUNTIDCONTRACT: 19, + CUSTOMCONTRACT: 20, + CREATESMARTCONTRACT: 30, + TRIGGERSMARTCONTRACT: 31, + GETCONTRACT: 32, + UPDATESETTINGCONTRACT: 33, + EXCHANGECREATECONTRACT: 41, + EXCHANGEINJECTCONTRACT: 42, + EXCHANGEWITHDRAWCONTRACT: 43, + EXCHANGETRANSACTIONCONTRACT: 44, + UPDATEENERGYLIMITCONTRACT: 45, + ACCOUNTPERMISSIONUPDATECONTRACT: 46, + CLEARABICONTRACT: 48, + UPDATEBROKERAGECONTRACT: 49, + SHIELDEDTRANSFERCONTRACT: 51, + MARKETSELLASSETCONTRACT: 52, + MARKETCANCELORDERCONTRACT: 53, + FREEZEBALANCEV2CONTRACT: 54, + UNFREEZEBALANCEV2CONTRACT: 55, + WITHDRAWEXPIREUNFREEZECONTRACT: 56, + DELEGATERESOURCECONTRACT: 57, + UNDELEGATERESOURCECONTRACT: 58, + CANCELALLUNFREEZEV2CONTRACT: 59 + }; + TronWebProto.Transaction.Contract.prototype.getType = function() { + return ( + /** @type {!TronWebProto.Transaction.Contract.ContractType} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.Transaction.Contract.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); + }; + TronWebProto.Transaction.Contract.prototype.getParameter = function() { + return ( + /** @type{?TronWebProto.Any} */ + jspb.Message.getWrapperField(this, google_protobuf_any_pb2.Any, 2) + ); + }; + TronWebProto.Transaction.Contract.prototype.setParameter = function(value) { + return jspb.Message.setWrapperField(this, 2, value); + }; + TronWebProto.Transaction.Contract.prototype.clearParameter = function() { + return this.setParameter(void 0); + }; + TronWebProto.Transaction.Contract.prototype.hasParameter = function() { + return jspb.Message.getField(this, 2) != null; + }; + TronWebProto.Transaction.Contract.prototype.getProvider = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.Transaction.Contract.prototype.getProvider_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getProvider() + ) + ); + }; + TronWebProto.Transaction.Contract.prototype.getProvider_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getProvider() + ) + ); + }; + TronWebProto.Transaction.Contract.prototype.setProvider = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.Transaction.Contract.prototype.getContractname = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 4, "") + ); + }; + TronWebProto.Transaction.Contract.prototype.getContractname_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getContractname() + ) + ); + }; + TronWebProto.Transaction.Contract.prototype.getContractname_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getContractname() + ) + ); + }; + TronWebProto.Transaction.Contract.prototype.setContractname = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); + }; + TronWebProto.Transaction.Contract.prototype.getPermissionId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.Transaction.Contract.prototype.setPermissionId = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + TronWebProto.Transaction.Result.repeatedFields_ = [26]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Transaction.Result.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Transaction.Result.toObject(opt_includeInstance, this); + }; + TronWebProto.Transaction.Result.toObject = function(includeInstance, msg) { + var obj = { + fee: jspb.Message.getFieldWithDefault(msg, 1, 0), + ret: jspb.Message.getFieldWithDefault(msg, 2, 0), + contractret: jspb.Message.getFieldWithDefault(msg, 3, 0), + assetissueid: jspb.Message.getFieldWithDefault(msg, 14, ""), + withdrawAmount: jspb.Message.getFieldWithDefault(msg, 15, 0), + unfreezeAmount: jspb.Message.getFieldWithDefault(msg, 16, 0), + exchangeReceivedAmount: jspb.Message.getFieldWithDefault(msg, 18, 0), + exchangeInjectAnotherAmount: jspb.Message.getFieldWithDefault(msg, 19, 0), + exchangeWithdrawAnotherAmount: jspb.Message.getFieldWithDefault(msg, 20, 0), + exchangeId: jspb.Message.getFieldWithDefault(msg, 21, 0), + shieldedTransactionFee: jspb.Message.getFieldWithDefault(msg, 22, 0), + orderid: msg.getOrderid_asB64(), + orderdetailsList: jspb.Message.toObjectList( + msg.getOrderdetailsList(), + TronWebProto.MarketOrderDetail.toObject, + includeInstance + ) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Transaction.Result.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Transaction.Result(); + return TronWebProto.Transaction.Result.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Transaction.Result.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFee(value); + break; + case 2: + var value = ( + /** @type {!TronWebProto.Transaction.Result.code} */ + reader.readEnum() + ); + msg.setRet(value); + break; + case 3: + var value = ( + /** @type {!TronWebProto.Transaction.Result.contractResult} */ + reader.readEnum() + ); + msg.setContractret(value); + break; + case 14: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setAssetissueid(value); + break; + case 15: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setWithdrawAmount(value); + break; + case 16: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setUnfreezeAmount(value); + break; + case 18: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExchangeReceivedAmount(value); + break; + case 19: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExchangeInjectAnotherAmount(value); + break; + case 20: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExchangeWithdrawAnotherAmount(value); + break; + case 21: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExchangeId(value); + break; + case 22: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setShieldedTransactionFee(value); + break; + case 25: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOrderid(value); + break; + case 26: + var value = new TronWebProto.MarketOrderDetail(); + reader.readMessage(value, TronWebProto.MarketOrderDetail.deserializeBinaryFromReader); + msg.addOrderdetails(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Transaction.Result.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Transaction.Result.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Transaction.Result.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getFee(); + if (f4 !== 0) { + writer.writeInt64( + 1, + f4 + ); + } + f4 = message2.getRet(); + if (f4 !== 0) { + writer.writeEnum( + 2, + f4 + ); + } + f4 = message2.getContractret(); + if (f4 !== 0) { + writer.writeEnum( + 3, + f4 + ); + } + f4 = message2.getAssetissueid(); + if (f4.length > 0) { + writer.writeString( + 14, + f4 + ); + } + f4 = message2.getWithdrawAmount(); + if (f4 !== 0) { + writer.writeInt64( + 15, + f4 + ); + } + f4 = message2.getUnfreezeAmount(); + if (f4 !== 0) { + writer.writeInt64( + 16, + f4 + ); + } + f4 = message2.getExchangeReceivedAmount(); + if (f4 !== 0) { + writer.writeInt64( + 18, + f4 + ); + } + f4 = message2.getExchangeInjectAnotherAmount(); + if (f4 !== 0) { + writer.writeInt64( + 19, + f4 + ); + } + f4 = message2.getExchangeWithdrawAnotherAmount(); + if (f4 !== 0) { + writer.writeInt64( + 20, + f4 + ); + } + f4 = message2.getExchangeId(); + if (f4 !== 0) { + writer.writeInt64( + 21, + f4 + ); + } + f4 = message2.getShieldedTransactionFee(); + if (f4 !== 0) { + writer.writeInt64( + 22, + f4 + ); + } + f4 = message2.getOrderid_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 25, + f4 + ); + } + f4 = message2.getOrderdetailsList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 26, + f4, + TronWebProto.MarketOrderDetail.serializeBinaryToWriter + ); + } + }; + TronWebProto.Transaction.Result.code = { + SUCESS: 0, + FAILED: 1 + }; + TronWebProto.Transaction.Result.contractResult = { + DEFAULT: 0, + SUCCESS: 1, + REVERT: 2, + BAD_JUMP_DESTINATION: 3, + OUT_OF_MEMORY: 4, + PRECOMPILED_CONTRACT: 5, + STACK_TOO_SMALL: 6, + STACK_TOO_LARGE: 7, + ILLEGAL_OPERATION: 8, + STACK_OVERFLOW: 9, + OUT_OF_ENERGY: 10, + OUT_OF_TIME: 11, + JVM_STACK_OVER_FLOW: 12, + UNKNOWN: 13, + TRANSFER_FAILED: 14, + INVALID_CODE: 15 + }; + TronWebProto.Transaction.Result.prototype.getFee = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setFee = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.Transaction.Result.prototype.getRet = function() { + return ( + /** @type {!TronWebProto.Transaction.Result.code} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setRet = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); + }; + TronWebProto.Transaction.Result.prototype.getContractret = function() { + return ( + /** @type {!TronWebProto.Transaction.Result.contractResult} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setContractret = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); + }; + TronWebProto.Transaction.Result.prototype.getAssetissueid = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 14, "") + ); + }; + TronWebProto.Transaction.Result.prototype.setAssetissueid = function(value) { + return jspb.Message.setProto3StringField(this, 14, value); + }; + TronWebProto.Transaction.Result.prototype.getWithdrawAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 15, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setWithdrawAmount = function(value) { + return jspb.Message.setProto3IntField(this, 15, value); + }; + TronWebProto.Transaction.Result.prototype.getUnfreezeAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 16, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setUnfreezeAmount = function(value) { + return jspb.Message.setProto3IntField(this, 16, value); + }; + TronWebProto.Transaction.Result.prototype.getExchangeReceivedAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 18, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setExchangeReceivedAmount = function(value) { + return jspb.Message.setProto3IntField(this, 18, value); + }; + TronWebProto.Transaction.Result.prototype.getExchangeInjectAnotherAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 19, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setExchangeInjectAnotherAmount = function(value) { + return jspb.Message.setProto3IntField(this, 19, value); + }; + TronWebProto.Transaction.Result.prototype.getExchangeWithdrawAnotherAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 20, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setExchangeWithdrawAnotherAmount = function(value) { + return jspb.Message.setProto3IntField(this, 20, value); + }; + TronWebProto.Transaction.Result.prototype.getExchangeId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 21, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setExchangeId = function(value) { + return jspb.Message.setProto3IntField(this, 21, value); + }; + TronWebProto.Transaction.Result.prototype.getShieldedTransactionFee = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 22, 0) + ); + }; + TronWebProto.Transaction.Result.prototype.setShieldedTransactionFee = function(value) { + return jspb.Message.setProto3IntField(this, 22, value); + }; + TronWebProto.Transaction.Result.prototype.getOrderid = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 25, "") + ); + }; + TronWebProto.Transaction.Result.prototype.getOrderid_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOrderid() + ) + ); + }; + TronWebProto.Transaction.Result.prototype.getOrderid_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOrderid() + ) + ); + }; + TronWebProto.Transaction.Result.prototype.setOrderid = function(value) { + return jspb.Message.setProto3BytesField(this, 25, value); + }; + TronWebProto.Transaction.Result.prototype.getOrderdetailsList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.MarketOrderDetail, 26) + ); + }; + TronWebProto.Transaction.Result.prototype.setOrderdetailsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 26, value); + }; + TronWebProto.Transaction.Result.prototype.addOrderdetails = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 26, opt_value, TronWebProto.MarketOrderDetail, opt_index); + }; + TronWebProto.Transaction.Result.prototype.clearOrderdetailsList = function() { + return this.setOrderdetailsList([]); + }; + TronWebProto.Transaction.raw.repeatedFields_ = [9, 11]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.Transaction.raw.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.Transaction.raw.toObject(opt_includeInstance, this); + }; + TronWebProto.Transaction.raw.toObject = function(includeInstance, msg) { + var obj = { + refBlockBytes: msg.getRefBlockBytes_asB64(), + refBlockNum: jspb.Message.getFieldWithDefault(msg, 3, 0), + refBlockHash: msg.getRefBlockHash_asB64(), + expiration: jspb.Message.getFieldWithDefault(msg, 8, 0), + authsList: jspb.Message.toObjectList( + msg.getAuthsList(), + TronWebProto.authority.toObject, + includeInstance + ), + data: msg.getData_asB64(), + contractList: jspb.Message.toObjectList( + msg.getContractList(), + TronWebProto.Transaction.Contract.toObject, + includeInstance + ), + scripts: msg.getScripts_asB64(), + timestamp: jspb.Message.getFieldWithDefault(msg, 14, 0), + feeLimit: jspb.Message.getFieldWithDefault(msg, 18, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.Transaction.raw.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.Transaction.raw(); + return TronWebProto.Transaction.raw.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.Transaction.raw.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setRefBlockBytes(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setRefBlockNum(value); + break; + case 4: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setRefBlockHash(value); + break; + case 8: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExpiration(value); + break; + case 9: + var value = new TronWebProto.authority(); + reader.readMessage(value, TronWebProto.authority.deserializeBinaryFromReader); + msg.addAuths(value); + break; + case 10: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setData(value); + break; + case 11: + var value = new TronWebProto.Transaction.Contract(); + reader.readMessage(value, TronWebProto.Transaction.Contract.deserializeBinaryFromReader); + msg.addContract(value); + break; + case 12: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setScripts(value); + break; + case 14: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setTimestamp(value); + break; + case 18: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFeeLimit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.Transaction.raw.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.Transaction.raw.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.Transaction.raw.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getRefBlockBytes_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getRefBlockNum(); + if (f4 !== 0) { + writer.writeInt64( + 3, + f4 + ); + } + f4 = message2.getRefBlockHash_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 4, + f4 + ); + } + f4 = message2.getExpiration(); + if (f4 !== 0) { + writer.writeInt64( + 8, + f4 + ); + } + f4 = message2.getAuthsList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 9, + f4, + TronWebProto.authority.serializeBinaryToWriter + ); + } + f4 = message2.getData_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 10, + f4 + ); + } + f4 = message2.getContractList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 11, + f4, + TronWebProto.Transaction.Contract.serializeBinaryToWriter + ); + } + f4 = message2.getScripts_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 12, + f4 + ); + } + f4 = message2.getTimestamp(); + if (f4 !== 0) { + writer.writeInt64( + 14, + f4 + ); + } + f4 = message2.getFeeLimit(); + if (f4 !== 0) { + writer.writeInt64( + 18, + f4 + ); + } + }; + TronWebProto.Transaction.raw.prototype.getRefBlockBytes = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.Transaction.raw.prototype.getRefBlockBytes_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getRefBlockBytes() + ) + ); + }; + TronWebProto.Transaction.raw.prototype.getRefBlockBytes_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getRefBlockBytes() + ) + ); + }; + TronWebProto.Transaction.raw.prototype.setRefBlockBytes = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.Transaction.raw.prototype.getRefBlockNum = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.Transaction.raw.prototype.setRefBlockNum = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.Transaction.raw.prototype.getRefBlockHash = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 4, "") + ); + }; + TronWebProto.Transaction.raw.prototype.getRefBlockHash_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getRefBlockHash() + ) + ); + }; + TronWebProto.Transaction.raw.prototype.getRefBlockHash_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getRefBlockHash() + ) + ); + }; + TronWebProto.Transaction.raw.prototype.setRefBlockHash = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); + }; + TronWebProto.Transaction.raw.prototype.getExpiration = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 8, 0) + ); + }; + TronWebProto.Transaction.raw.prototype.setExpiration = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); + }; + TronWebProto.Transaction.raw.prototype.getAuthsList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.authority, 9) + ); + }; + TronWebProto.Transaction.raw.prototype.setAuthsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 9, value); + }; + TronWebProto.Transaction.raw.prototype.addAuths = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, TronWebProto.authority, opt_index); + }; + TronWebProto.Transaction.raw.prototype.clearAuthsList = function() { + return this.setAuthsList([]); + }; + TronWebProto.Transaction.raw.prototype.getData = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 10, "") + ); + }; + TronWebProto.Transaction.raw.prototype.getData_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getData() + ) + ); + }; + TronWebProto.Transaction.raw.prototype.getData_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getData() + ) + ); + }; + TronWebProto.Transaction.raw.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 10, value); + }; + TronWebProto.Transaction.raw.prototype.getContractList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.Transaction.Contract, 11) + ); + }; + TronWebProto.Transaction.raw.prototype.setContractList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 11, value); + }; + TronWebProto.Transaction.raw.prototype.addContract = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, TronWebProto.Transaction.Contract, opt_index); + }; + TronWebProto.Transaction.raw.prototype.clearContractList = function() { + return this.setContractList([]); + }; + TronWebProto.Transaction.raw.prototype.getScripts = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 12, "") + ); + }; + TronWebProto.Transaction.raw.prototype.getScripts_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getScripts() + ) + ); + }; + TronWebProto.Transaction.raw.prototype.getScripts_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getScripts() + ) + ); + }; + TronWebProto.Transaction.raw.prototype.setScripts = function(value) { + return jspb.Message.setProto3BytesField(this, 12, value); + }; + TronWebProto.Transaction.raw.prototype.getTimestamp = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 14, 0) + ); + }; + TronWebProto.Transaction.raw.prototype.setTimestamp = function(value) { + return jspb.Message.setProto3IntField(this, 14, value); + }; + TronWebProto.Transaction.raw.prototype.getFeeLimit = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 18, 0) + ); + }; + TronWebProto.Transaction.raw.prototype.setFeeLimit = function(value) { + return jspb.Message.setProto3IntField(this, 18, value); + }; + TronWebProto.Transaction.prototype.getRawData = function() { + return ( + /** @type{?TronWebProto.Transaction.raw} */ + jspb.Message.getWrapperField(this, TronWebProto.Transaction.raw, 1) + ); + }; + TronWebProto.Transaction.prototype.setRawData = function(value) { + return jspb.Message.setWrapperField(this, 1, value); + }; + TronWebProto.Transaction.prototype.clearRawData = function() { + return this.setRawData(void 0); + }; + TronWebProto.Transaction.prototype.hasRawData = function() { + return jspb.Message.getField(this, 1) != null; + }; + TronWebProto.Transaction.prototype.getSignatureList = function() { + return ( + /** @type {!(Array|Array)} */ + jspb.Message.getRepeatedField(this, 2) + ); + }; + TronWebProto.Transaction.prototype.getSignatureList_asB64 = function() { + return ( + /** @type {!Array} */ + jspb.Message.bytesListAsB64( + this.getSignatureList() + ) + ); + }; + TronWebProto.Transaction.prototype.getSignatureList_asU8 = function() { + return ( + /** @type {!Array} */ + jspb.Message.bytesListAsU8( + this.getSignatureList() + ) + ); + }; + TronWebProto.Transaction.prototype.setSignatureList = function(value) { + return jspb.Message.setField(this, 2, value || []); + }; + TronWebProto.Transaction.prototype.addSignature = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); + }; + TronWebProto.Transaction.prototype.clearSignatureList = function() { + return this.setSignatureList([]); + }; + TronWebProto.Transaction.prototype.getRetList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.Transaction.Result, 5) + ); + }; + TronWebProto.Transaction.prototype.setRetList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); + }; + TronWebProto.Transaction.prototype.addRet = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, TronWebProto.Transaction.Result, opt_index); + }; + TronWebProto.Transaction.prototype.clearRetList = function() { + return this.setRetList([]); + }; + TronWebProto.AccountType = { + NORMAL: 0, + ASSETISSUE: 1, + CONTRACT: 2 + }; + goog.object.extend(exports, TronWebProto); +})(Tron_pb); +var balance_contract_pb = {}; +var common_pb = {}; +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + goog.exportSymbol("TronWebProto.ResourceCode", null, global2); + TronWebProto.ResourceCode = { + BANDWIDTH: 0, + ENERGY: 1, + TRON_POWER: 2 + }; + goog.object.extend(exports, TronWebProto); +})(common_pb); +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + var core_contract_common_pb = common_pb; + goog.object.extend(proto, core_contract_common_pb); + goog.exportSymbol("TronWebProto.AccountBalanceRequest", null, global2); + goog.exportSymbol("TronWebProto.AccountBalanceResponse", null, global2); + goog.exportSymbol("TronWebProto.AccountIdentifier", null, global2); + goog.exportSymbol("TronWebProto.AccountTrace", null, global2); + goog.exportSymbol("TronWebProto.BlockBalanceTrace", null, global2); + goog.exportSymbol("TronWebProto.BlockBalanceTrace.BlockIdentifier", null, global2); + goog.exportSymbol("TronWebProto.CancelAllUnfreezeV2Contract", null, global2); + goog.exportSymbol("TronWebProto.DelegateResourceContract", null, global2); + goog.exportSymbol("TronWebProto.FreezeBalanceContract", null, global2); + goog.exportSymbol("TronWebProto.FreezeBalanceV2Contract", null, global2); + goog.exportSymbol("TronWebProto.TransactionBalanceTrace", null, global2); + goog.exportSymbol("TronWebProto.TransactionBalanceTrace.Operation", null, global2); + goog.exportSymbol("TronWebProto.TransferContract", null, global2); + goog.exportSymbol("TronWebProto.UnDelegateResourceContract", null, global2); + goog.exportSymbol("TronWebProto.UnfreezeBalanceContract", null, global2); + goog.exportSymbol("TronWebProto.UnfreezeBalanceV2Contract", null, global2); + goog.exportSymbol("TronWebProto.WithdrawBalanceContract", null, global2); + goog.exportSymbol("TronWebProto.WithdrawExpireUnfreezeContract", null, global2); + TronWebProto.FreezeBalanceContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.FreezeBalanceContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.FreezeBalanceContract.displayName = "TronWebProto.FreezeBalanceContract"; + } + TronWebProto.UnfreezeBalanceContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.UnfreezeBalanceContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.UnfreezeBalanceContract.displayName = "TronWebProto.UnfreezeBalanceContract"; + } + TronWebProto.WithdrawBalanceContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.WithdrawBalanceContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.WithdrawBalanceContract.displayName = "TronWebProto.WithdrawBalanceContract"; + } + TronWebProto.TransferContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.TransferContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.TransferContract.displayName = "TronWebProto.TransferContract"; + } + TronWebProto.TransactionBalanceTrace = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.TransactionBalanceTrace.repeatedFields_, null); + }; + goog.inherits(TronWebProto.TransactionBalanceTrace, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.TransactionBalanceTrace.displayName = "TronWebProto.TransactionBalanceTrace"; + } + TronWebProto.TransactionBalanceTrace.Operation = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.TransactionBalanceTrace.Operation, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.TransactionBalanceTrace.Operation.displayName = "TronWebProto.TransactionBalanceTrace.Operation"; + } + TronWebProto.BlockBalanceTrace = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.BlockBalanceTrace.repeatedFields_, null); + }; + goog.inherits(TronWebProto.BlockBalanceTrace, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.BlockBalanceTrace.displayName = "TronWebProto.BlockBalanceTrace"; + } + TronWebProto.BlockBalanceTrace.BlockIdentifier = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.BlockBalanceTrace.BlockIdentifier, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.BlockBalanceTrace.BlockIdentifier.displayName = "TronWebProto.BlockBalanceTrace.BlockIdentifier"; + } + TronWebProto.AccountTrace = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.AccountTrace, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AccountTrace.displayName = "TronWebProto.AccountTrace"; + } + TronWebProto.AccountIdentifier = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.AccountIdentifier, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AccountIdentifier.displayName = "TronWebProto.AccountIdentifier"; + } + TronWebProto.AccountBalanceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.AccountBalanceRequest, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AccountBalanceRequest.displayName = "TronWebProto.AccountBalanceRequest"; + } + TronWebProto.AccountBalanceResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.AccountBalanceResponse, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AccountBalanceResponse.displayName = "TronWebProto.AccountBalanceResponse"; + } + TronWebProto.FreezeBalanceV2Contract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.FreezeBalanceV2Contract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.FreezeBalanceV2Contract.displayName = "TronWebProto.FreezeBalanceV2Contract"; + } + TronWebProto.UnfreezeBalanceV2Contract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.UnfreezeBalanceV2Contract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.UnfreezeBalanceV2Contract.displayName = "TronWebProto.UnfreezeBalanceV2Contract"; + } + TronWebProto.WithdrawExpireUnfreezeContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.WithdrawExpireUnfreezeContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.WithdrawExpireUnfreezeContract.displayName = "TronWebProto.WithdrawExpireUnfreezeContract"; + } + TronWebProto.DelegateResourceContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.DelegateResourceContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.DelegateResourceContract.displayName = "TronWebProto.DelegateResourceContract"; + } + TronWebProto.UnDelegateResourceContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.UnDelegateResourceContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.UnDelegateResourceContract.displayName = "TronWebProto.UnDelegateResourceContract"; + } + TronWebProto.CancelAllUnfreezeV2Contract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.CancelAllUnfreezeV2Contract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.CancelAllUnfreezeV2Contract.displayName = "TronWebProto.CancelAllUnfreezeV2Contract"; + } + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.FreezeBalanceContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.FreezeBalanceContract.toObject(opt_includeInstance, this); + }; + TronWebProto.FreezeBalanceContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + frozenBalance: jspb.Message.getFieldWithDefault(msg, 2, 0), + frozenDuration: jspb.Message.getFieldWithDefault(msg, 3, 0), + resource: jspb.Message.getFieldWithDefault(msg, 10, 0), + receiverAddress: msg.getReceiverAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.FreezeBalanceContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.FreezeBalanceContract(); + return TronWebProto.FreezeBalanceContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.FreezeBalanceContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFrozenBalance(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFrozenDuration(value); + break; + case 10: + var value = ( + /** @type {!TronWebProto.ResourceCode} */ + reader.readEnum() + ); + msg.setResource(value); + break; + case 15: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setReceiverAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.FreezeBalanceContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.FreezeBalanceContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.FreezeBalanceContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getFrozenBalance(); + if (f4 !== 0) { + writer.writeInt64(2, f4); + } + f4 = message2.getFrozenDuration(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + f4 = message2.getResource(); + if (f4 !== 0) { + writer.writeEnum(10, f4); + } + f4 = message2.getReceiverAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(15, f4); + } + }; + TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.FreezeBalanceContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.FreezeBalanceContract.prototype.getFrozenBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.FreezeBalanceContract.prototype.setFrozenBalance = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.FreezeBalanceContract.prototype.getFrozenDuration = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.FreezeBalanceContract.prototype.setFrozenDuration = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.FreezeBalanceContract.prototype.getResource = function() { + return ( + /** @type {!TronWebProto.ResourceCode} */ + jspb.Message.getFieldWithDefault(this, 10, 0) + ); + }; + TronWebProto.FreezeBalanceContract.prototype.setResource = function(value) { + return jspb.Message.setProto3EnumField(this, 10, value); + }; + TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 15, "") + ); + }; + TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getReceiverAddress()) + ); + }; + TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getReceiverAddress()) + ); + }; + TronWebProto.FreezeBalanceContract.prototype.setReceiverAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 15, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.UnfreezeBalanceContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.UnfreezeBalanceContract.toObject(opt_includeInstance, this); + }; + TronWebProto.UnfreezeBalanceContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + resource: jspb.Message.getFieldWithDefault(msg, 10, 0), + receiverAddress: msg.getReceiverAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.UnfreezeBalanceContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.UnfreezeBalanceContract(); + return TronWebProto.UnfreezeBalanceContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.UnfreezeBalanceContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 10: + var value = ( + /** @type {!TronWebProto.ResourceCode} */ + reader.readEnum() + ); + msg.setResource(value); + break; + case 15: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setReceiverAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.UnfreezeBalanceContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.UnfreezeBalanceContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.UnfreezeBalanceContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getResource(); + if (f4 !== 0) { + writer.writeEnum(10, f4); + } + f4 = message2.getReceiverAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(15, f4); + } + }; + TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.UnfreezeBalanceContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.UnfreezeBalanceContract.prototype.getResource = function() { + return ( + /** @type {!TronWebProto.ResourceCode} */ + jspb.Message.getFieldWithDefault(this, 10, 0) + ); + }; + TronWebProto.UnfreezeBalanceContract.prototype.setResource = function(value) { + return jspb.Message.setProto3EnumField(this, 10, value); + }; + TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 15, "") + ); + }; + TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getReceiverAddress()) + ); + }; + TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getReceiverAddress()) + ); + }; + TronWebProto.UnfreezeBalanceContract.prototype.setReceiverAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 15, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.WithdrawBalanceContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.WithdrawBalanceContract.toObject(opt_includeInstance, this); + }; + TronWebProto.WithdrawBalanceContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.WithdrawBalanceContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.WithdrawBalanceContract(); + return TronWebProto.WithdrawBalanceContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.WithdrawBalanceContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.WithdrawBalanceContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.WithdrawBalanceContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.WithdrawBalanceContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + }; + TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.WithdrawBalanceContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.TransferContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.TransferContract.toObject(opt_includeInstance, this); + }; + TronWebProto.TransferContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + toAddress: msg.getToAddress_asB64(), + amount: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.TransferContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.TransferContract(); + return TronWebProto.TransferContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.TransferContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setToAddress(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setAmount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.TransferContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.TransferContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.TransferContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getToAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + f4 = message2.getAmount(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + }; + TronWebProto.TransferContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.TransferContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.TransferContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.TransferContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.TransferContract.prototype.getToAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.TransferContract.prototype.getToAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getToAddress()) + ); + }; + TronWebProto.TransferContract.prototype.getToAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getToAddress()) + ); + }; + TronWebProto.TransferContract.prototype.setToAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.TransferContract.prototype.getAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.TransferContract.prototype.setAmount = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.TransactionBalanceTrace.repeatedFields_ = [2]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.TransactionBalanceTrace.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.TransactionBalanceTrace.toObject(opt_includeInstance, this); + }; + TronWebProto.TransactionBalanceTrace.toObject = function(includeInstance, msg) { + var obj = { + transactionIdentifier: msg.getTransactionIdentifier_asB64(), + operationList: jspb.Message.toObjectList( + msg.getOperationList(), + TronWebProto.TransactionBalanceTrace.Operation.toObject, + includeInstance + ), + type: jspb.Message.getFieldWithDefault(msg, 3, ""), + status: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.TransactionBalanceTrace.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.TransactionBalanceTrace(); + return TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setTransactionIdentifier(value); + break; + case 2: + var value = new TronWebProto.TransactionBalanceTrace.Operation(); + reader.readMessage(value, TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader); + msg.addOperation(value); + break; + case 3: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setType(value); + break; + case 4: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setStatus(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.TransactionBalanceTrace.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getTransactionIdentifier_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getOperationList(); + if (f4.length > 0) { + writer.writeRepeatedMessage(2, f4, TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter); + } + f4 = message2.getType(); + if (f4.length > 0) { + writer.writeString(3, f4); + } + f4 = message2.getStatus(); + if (f4.length > 0) { + writer.writeString(4, f4); + } + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.TransactionBalanceTrace.Operation.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.TransactionBalanceTrace.Operation.toObject(opt_includeInstance, this); + }; + TronWebProto.TransactionBalanceTrace.Operation.toObject = function(includeInstance, msg) { + var obj = { + operationIdentifier: jspb.Message.getFieldWithDefault(msg, 1, 0), + address: msg.getAddress_asB64(), + amount: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.TransactionBalanceTrace.Operation.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.TransactionBalanceTrace.Operation(); + return TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setOperationIdentifier(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAddress(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setAmount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.TransactionBalanceTrace.Operation.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOperationIdentifier(); + if (f4 !== 0) { + writer.writeInt64(1, f4); + } + f4 = message2.getAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + f4 = message2.getAmount(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + }; + TronWebProto.TransactionBalanceTrace.Operation.prototype.getOperationIdentifier = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.TransactionBalanceTrace.Operation.prototype.setOperationIdentifier = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getAddress()) + ); + }; + TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getAddress()) + ); + }; + TronWebProto.TransactionBalanceTrace.Operation.prototype.setAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.TransactionBalanceTrace.Operation.prototype.getAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.TransactionBalanceTrace.Operation.prototype.setAmount = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getTransactionIdentifier()) + ); + }; + TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getTransactionIdentifier()) + ); + }; + TronWebProto.TransactionBalanceTrace.prototype.setTransactionIdentifier = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.TransactionBalanceTrace.prototype.getOperationList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.TransactionBalanceTrace.Operation, 2) + ); + }; + TronWebProto.TransactionBalanceTrace.prototype.setOperationList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); + }; + TronWebProto.TransactionBalanceTrace.prototype.addOperation = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, TronWebProto.TransactionBalanceTrace.Operation, opt_index); + }; + TronWebProto.TransactionBalanceTrace.prototype.clearOperationList = function() { + return this.setOperationList([]); + }; + TronWebProto.TransactionBalanceTrace.prototype.getType = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.TransactionBalanceTrace.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); + }; + TronWebProto.TransactionBalanceTrace.prototype.getStatus = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 4, "") + ); + }; + TronWebProto.TransactionBalanceTrace.prototype.setStatus = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); + }; + TronWebProto.BlockBalanceTrace.repeatedFields_ = [3]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.BlockBalanceTrace.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.BlockBalanceTrace.toObject(opt_includeInstance, this); + }; + TronWebProto.BlockBalanceTrace.toObject = function(includeInstance, msg) { + var f4, obj = { + blockIdentifier: (f4 = msg.getBlockIdentifier()) && TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(includeInstance, f4), + timestamp: jspb.Message.getFieldWithDefault(msg, 2, 0), + transactionBalanceTraceList: jspb.Message.toObjectList( + msg.getTransactionBalanceTraceList(), + TronWebProto.TransactionBalanceTrace.toObject, + includeInstance + ) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.BlockBalanceTrace.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.BlockBalanceTrace(); + return TronWebProto.BlockBalanceTrace.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.BlockBalanceTrace.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new TronWebProto.BlockBalanceTrace.BlockIdentifier(); + reader.readMessage(value, TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader); + msg.setBlockIdentifier(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setTimestamp(value); + break; + case 3: + var value = new TronWebProto.TransactionBalanceTrace(); + reader.readMessage(value, TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader); + msg.addTransactionBalanceTrace(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.BlockBalanceTrace.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.BlockBalanceTrace.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.BlockBalanceTrace.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getBlockIdentifier(); + if (f4 != null) { + writer.writeMessage(1, f4, TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter); + } + f4 = message2.getTimestamp(); + if (f4 !== 0) { + writer.writeInt64(2, f4); + } + f4 = message2.getTransactionBalanceTraceList(); + if (f4.length > 0) { + writer.writeRepeatedMessage(3, f4, TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter); + } + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(opt_includeInstance, this); + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject = function(includeInstance, msg) { + var obj = { + hash: msg.getHash_asB64(), + number: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.BlockBalanceTrace.BlockIdentifier(); + return TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setHash(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setNumber(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getHash_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getNumber(); + if (f4 !== 0) { + writer.writeInt64(2, f4); + } + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getHash()) + ); + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getHash()) + ); + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.setHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getNumber = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.setNumber = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.BlockBalanceTrace.prototype.getBlockIdentifier = function() { + return ( + /** @type{?TronWebProto.BlockBalanceTrace.BlockIdentifier} */ + jspb.Message.getWrapperField(this, TronWebProto.BlockBalanceTrace.BlockIdentifier, 1) + ); + }; + TronWebProto.BlockBalanceTrace.prototype.setBlockIdentifier = function(value) { + return jspb.Message.setWrapperField(this, 1, value); + }; + TronWebProto.BlockBalanceTrace.prototype.clearBlockIdentifier = function() { + return this.setBlockIdentifier(void 0); + }; + TronWebProto.BlockBalanceTrace.prototype.hasBlockIdentifier = function() { + return jspb.Message.getField(this, 1) != null; + }; + TronWebProto.BlockBalanceTrace.prototype.getTimestamp = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.BlockBalanceTrace.prototype.setTimestamp = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.BlockBalanceTrace.prototype.getTransactionBalanceTraceList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.TransactionBalanceTrace, 3) + ); + }; + TronWebProto.BlockBalanceTrace.prototype.setTransactionBalanceTraceList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); + }; + TronWebProto.BlockBalanceTrace.prototype.addTransactionBalanceTrace = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, TronWebProto.TransactionBalanceTrace, opt_index); + }; + TronWebProto.BlockBalanceTrace.prototype.clearTransactionBalanceTraceList = function() { + return this.setTransactionBalanceTraceList([]); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AccountTrace.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AccountTrace.toObject(opt_includeInstance, this); + }; + TronWebProto.AccountTrace.toObject = function(includeInstance, msg) { + var obj = { + balance: jspb.Message.getFieldWithDefault(msg, 1, 0), + placeholder: jspb.Message.getFieldWithDefault(msg, 99, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AccountTrace.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AccountTrace(); + return TronWebProto.AccountTrace.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AccountTrace.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setBalance(value); + break; + case 99: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setPlaceholder(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AccountTrace.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AccountTrace.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AccountTrace.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getBalance(); + if (f4 !== 0) { + writer.writeInt64(1, f4); + } + f4 = message2.getPlaceholder(); + if (f4 !== 0) { + writer.writeInt64(99, f4); + } + }; + TronWebProto.AccountTrace.prototype.getBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.AccountTrace.prototype.setBalance = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.AccountTrace.prototype.getPlaceholder = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 99, 0) + ); + }; + TronWebProto.AccountTrace.prototype.setPlaceholder = function(value) { + return jspb.Message.setProto3IntField(this, 99, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AccountIdentifier.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AccountIdentifier.toObject(opt_includeInstance, this); + }; + TronWebProto.AccountIdentifier.toObject = function(includeInstance, msg) { + var obj = { + address: msg.getAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AccountIdentifier.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AccountIdentifier(); + return TronWebProto.AccountIdentifier.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AccountIdentifier.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AccountIdentifier.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AccountIdentifier.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AccountIdentifier.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + }; + TronWebProto.AccountIdentifier.prototype.getAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.AccountIdentifier.prototype.getAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getAddress()) + ); + }; + TronWebProto.AccountIdentifier.prototype.getAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getAddress()) + ); + }; + TronWebProto.AccountIdentifier.prototype.setAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AccountBalanceRequest.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AccountBalanceRequest.toObject(opt_includeInstance, this); + }; + TronWebProto.AccountBalanceRequest.toObject = function(includeInstance, msg) { + var f4, obj = { + accountIdentifier: (f4 = msg.getAccountIdentifier()) && TronWebProto.AccountIdentifier.toObject(includeInstance, f4), + blockIdentifier: (f4 = msg.getBlockIdentifier()) && TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(includeInstance, f4) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AccountBalanceRequest.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AccountBalanceRequest(); + return TronWebProto.AccountBalanceRequest.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AccountBalanceRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new TronWebProto.AccountIdentifier(); + reader.readMessage(value, TronWebProto.AccountIdentifier.deserializeBinaryFromReader); + msg.setAccountIdentifier(value); + break; + case 2: + var value = new TronWebProto.BlockBalanceTrace.BlockIdentifier(); + reader.readMessage(value, TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader); + msg.setBlockIdentifier(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AccountBalanceRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AccountBalanceRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AccountBalanceRequest.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAccountIdentifier(); + if (f4 != null) { + writer.writeMessage(1, f4, TronWebProto.AccountIdentifier.serializeBinaryToWriter); + } + f4 = message2.getBlockIdentifier(); + if (f4 != null) { + writer.writeMessage(2, f4, TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter); + } + }; + TronWebProto.AccountBalanceRequest.prototype.getAccountIdentifier = function() { + return ( + /** @type{?TronWebProto.AccountIdentifier} */ + jspb.Message.getWrapperField(this, TronWebProto.AccountIdentifier, 1) + ); + }; + TronWebProto.AccountBalanceRequest.prototype.setAccountIdentifier = function(value) { + return jspb.Message.setWrapperField(this, 1, value); + }; + TronWebProto.AccountBalanceRequest.prototype.clearAccountIdentifier = function() { + return this.setAccountIdentifier(void 0); + }; + TronWebProto.AccountBalanceRequest.prototype.hasAccountIdentifier = function() { + return jspb.Message.getField(this, 1) != null; + }; + TronWebProto.AccountBalanceRequest.prototype.getBlockIdentifier = function() { + return ( + /** @type{?TronWebProto.BlockBalanceTrace.BlockIdentifier} */ + jspb.Message.getWrapperField(this, TronWebProto.BlockBalanceTrace.BlockIdentifier, 2) + ); + }; + TronWebProto.AccountBalanceRequest.prototype.setBlockIdentifier = function(value) { + return jspb.Message.setWrapperField(this, 2, value); + }; + TronWebProto.AccountBalanceRequest.prototype.clearBlockIdentifier = function() { + return this.setBlockIdentifier(void 0); + }; + TronWebProto.AccountBalanceRequest.prototype.hasBlockIdentifier = function() { + return jspb.Message.getField(this, 2) != null; + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AccountBalanceResponse.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AccountBalanceResponse.toObject(opt_includeInstance, this); + }; + TronWebProto.AccountBalanceResponse.toObject = function(includeInstance, msg) { + var f4, obj = { + balance: jspb.Message.getFieldWithDefault(msg, 1, 0), + blockIdentifier: (f4 = msg.getBlockIdentifier()) && TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(includeInstance, f4) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AccountBalanceResponse.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AccountBalanceResponse(); + return TronWebProto.AccountBalanceResponse.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AccountBalanceResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setBalance(value); + break; + case 2: + var value = new TronWebProto.BlockBalanceTrace.BlockIdentifier(); + reader.readMessage(value, TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader); + msg.setBlockIdentifier(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AccountBalanceResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AccountBalanceResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AccountBalanceResponse.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getBalance(); + if (f4 !== 0) { + writer.writeInt64(1, f4); + } + f4 = message2.getBlockIdentifier(); + if (f4 != null) { + writer.writeMessage(2, f4, TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter); + } + }; + TronWebProto.AccountBalanceResponse.prototype.getBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.AccountBalanceResponse.prototype.setBalance = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.AccountBalanceResponse.prototype.getBlockIdentifier = function() { + return ( + /** @type{?TronWebProto.BlockBalanceTrace.BlockIdentifier} */ + jspb.Message.getWrapperField(this, TronWebProto.BlockBalanceTrace.BlockIdentifier, 2) + ); + }; + TronWebProto.AccountBalanceResponse.prototype.setBlockIdentifier = function(value) { + return jspb.Message.setWrapperField(this, 2, value); + }; + TronWebProto.AccountBalanceResponse.prototype.clearBlockIdentifier = function() { + return this.setBlockIdentifier(void 0); + }; + TronWebProto.AccountBalanceResponse.prototype.hasBlockIdentifier = function() { + return jspb.Message.getField(this, 2) != null; + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.FreezeBalanceV2Contract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.FreezeBalanceV2Contract.toObject(opt_includeInstance, this); + }; + TronWebProto.FreezeBalanceV2Contract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + frozenBalance: jspb.Message.getFieldWithDefault(msg, 2, 0), + resource: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.FreezeBalanceV2Contract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.FreezeBalanceV2Contract(); + return TronWebProto.FreezeBalanceV2Contract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.FreezeBalanceV2Contract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFrozenBalance(value); + break; + case 3: + var value = ( + /** @type {!TronWebProto.ResourceCode} */ + reader.readEnum() + ); + msg.setResource(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.FreezeBalanceV2Contract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.FreezeBalanceV2Contract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.FreezeBalanceV2Contract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getFrozenBalance(); + if (f4 !== 0) { + writer.writeInt64(2, f4); + } + f4 = message2.getResource(); + if (f4 !== 0) { + writer.writeEnum(3, f4); + } + }; + TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.FreezeBalanceV2Contract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.FreezeBalanceV2Contract.prototype.getFrozenBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.FreezeBalanceV2Contract.prototype.setFrozenBalance = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.FreezeBalanceV2Contract.prototype.getResource = function() { + return ( + /** @type {!TronWebProto.ResourceCode} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.FreezeBalanceV2Contract.prototype.setResource = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.UnfreezeBalanceV2Contract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.UnfreezeBalanceV2Contract.toObject(opt_includeInstance, this); + }; + TronWebProto.UnfreezeBalanceV2Contract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + unfreezeBalance: jspb.Message.getFieldWithDefault(msg, 2, 0), + resource: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.UnfreezeBalanceV2Contract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.UnfreezeBalanceV2Contract(); + return TronWebProto.UnfreezeBalanceV2Contract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.UnfreezeBalanceV2Contract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setUnfreezeBalance(value); + break; + case 3: + var value = ( + /** @type {!TronWebProto.ResourceCode} */ + reader.readEnum() + ); + msg.setResource(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.UnfreezeBalanceV2Contract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.UnfreezeBalanceV2Contract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.UnfreezeBalanceV2Contract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getUnfreezeBalance(); + if (f4 !== 0) { + writer.writeInt64(2, f4); + } + f4 = message2.getResource(); + if (f4 !== 0) { + writer.writeEnum(3, f4); + } + }; + TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.UnfreezeBalanceV2Contract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.UnfreezeBalanceV2Contract.prototype.getUnfreezeBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.UnfreezeBalanceV2Contract.prototype.setUnfreezeBalance = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.UnfreezeBalanceV2Contract.prototype.getResource = function() { + return ( + /** @type {!TronWebProto.ResourceCode} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.UnfreezeBalanceV2Contract.prototype.setResource = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.WithdrawExpireUnfreezeContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.WithdrawExpireUnfreezeContract.toObject(opt_includeInstance, this); + }; + TronWebProto.WithdrawExpireUnfreezeContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.WithdrawExpireUnfreezeContract(); + return TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.WithdrawExpireUnfreezeContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.WithdrawExpireUnfreezeContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.WithdrawExpireUnfreezeContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + }; + TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.WithdrawExpireUnfreezeContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.DelegateResourceContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.DelegateResourceContract.toObject(opt_includeInstance, this); + }; + TronWebProto.DelegateResourceContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + resource: jspb.Message.getFieldWithDefault(msg, 2, 0), + balance: jspb.Message.getFieldWithDefault(msg, 3, 0), + receiverAddress: msg.getReceiverAddress_asB64(), + lock: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + lockPeriod: jspb.Message.getFieldWithDefault(msg, 6, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.DelegateResourceContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.DelegateResourceContract(); + return TronWebProto.DelegateResourceContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.DelegateResourceContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!TronWebProto.ResourceCode} */ + reader.readEnum() + ); + msg.setResource(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setBalance(value); + break; + case 4: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setReceiverAddress(value); + break; + case 5: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setLock(value); + break; + case 6: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setLockPeriod(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.DelegateResourceContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.DelegateResourceContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.DelegateResourceContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getResource(); + if (f4 !== 0) { + writer.writeEnum(2, f4); + } + f4 = message2.getBalance(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + f4 = message2.getReceiverAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(4, f4); + } + f4 = message2.getLock(); + if (f4) { + writer.writeBool(5, f4); + } + f4 = message2.getLockPeriod(); + if (f4 !== 0) { + writer.writeInt64(6, f4); + } + }; + TronWebProto.DelegateResourceContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.DelegateResourceContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.DelegateResourceContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.DelegateResourceContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.DelegateResourceContract.prototype.getResource = function() { + return ( + /** @type {!TronWebProto.ResourceCode} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.DelegateResourceContract.prototype.setResource = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); + }; + TronWebProto.DelegateResourceContract.prototype.getBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.DelegateResourceContract.prototype.setBalance = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.DelegateResourceContract.prototype.getReceiverAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 4, "") + ); + }; + TronWebProto.DelegateResourceContract.prototype.getReceiverAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getReceiverAddress()) + ); + }; + TronWebProto.DelegateResourceContract.prototype.getReceiverAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getReceiverAddress()) + ); + }; + TronWebProto.DelegateResourceContract.prototype.setReceiverAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); + }; + TronWebProto.DelegateResourceContract.prototype.getLock = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 5, false) + ); + }; + TronWebProto.DelegateResourceContract.prototype.setLock = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); + }; + TronWebProto.DelegateResourceContract.prototype.getLockPeriod = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 6, 0) + ); + }; + TronWebProto.DelegateResourceContract.prototype.setLockPeriod = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.UnDelegateResourceContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.UnDelegateResourceContract.toObject(opt_includeInstance, this); + }; + TronWebProto.UnDelegateResourceContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + resource: jspb.Message.getFieldWithDefault(msg, 2, 0), + balance: jspb.Message.getFieldWithDefault(msg, 3, 0), + receiverAddress: msg.getReceiverAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.UnDelegateResourceContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.UnDelegateResourceContract(); + return TronWebProto.UnDelegateResourceContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.UnDelegateResourceContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!TronWebProto.ResourceCode} */ + reader.readEnum() + ); + msg.setResource(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setBalance(value); + break; + case 4: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setReceiverAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.UnDelegateResourceContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.UnDelegateResourceContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.UnDelegateResourceContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getResource(); + if (f4 !== 0) { + writer.writeEnum(2, f4); + } + f4 = message2.getBalance(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + f4 = message2.getReceiverAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(4, f4); + } + }; + TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.UnDelegateResourceContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.UnDelegateResourceContract.prototype.getResource = function() { + return ( + /** @type {!TronWebProto.ResourceCode} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.UnDelegateResourceContract.prototype.setResource = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); + }; + TronWebProto.UnDelegateResourceContract.prototype.getBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.UnDelegateResourceContract.prototype.setBalance = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 4, "") + ); + }; + TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getReceiverAddress()) + ); + }; + TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getReceiverAddress()) + ); + }; + TronWebProto.UnDelegateResourceContract.prototype.setReceiverAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.CancelAllUnfreezeV2Contract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.CancelAllUnfreezeV2Contract.toObject(opt_includeInstance, this); + }; + TronWebProto.CancelAllUnfreezeV2Contract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.CancelAllUnfreezeV2Contract(); + return TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.CancelAllUnfreezeV2Contract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.CancelAllUnfreezeV2Contract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.CancelAllUnfreezeV2Contract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + }; + TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.CancelAllUnfreezeV2Contract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + goog.object.extend(exports, TronWebProto); +})(balance_contract_pb); +var asset_issue_contract_pb = {}; +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + goog.exportSymbol("TronWebProto.AssetIssueContract", null, global2); + goog.exportSymbol("TronWebProto.AssetIssueContract.FrozenSupply", null, global2); + goog.exportSymbol("TronWebProto.ParticipateAssetIssueContract", null, global2); + goog.exportSymbol("TronWebProto.TransferAssetContract", null, global2); + goog.exportSymbol("TronWebProto.UnfreezeAssetContract", null, global2); + goog.exportSymbol("TronWebProto.UpdateAssetContract", null, global2); + TronWebProto.AssetIssueContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.AssetIssueContract.repeatedFields_, null); + }; + goog.inherits(TronWebProto.AssetIssueContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AssetIssueContract.displayName = "TronWebProto.AssetIssueContract"; + } + TronWebProto.AssetIssueContract.FrozenSupply = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.AssetIssueContract.FrozenSupply, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AssetIssueContract.FrozenSupply.displayName = "TronWebProto.AssetIssueContract.FrozenSupply"; + } + TronWebProto.TransferAssetContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.TransferAssetContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.TransferAssetContract.displayName = "TronWebProto.TransferAssetContract"; + } + TronWebProto.UnfreezeAssetContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.UnfreezeAssetContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.UnfreezeAssetContract.displayName = "TronWebProto.UnfreezeAssetContract"; + } + TronWebProto.UpdateAssetContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.UpdateAssetContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.UpdateAssetContract.displayName = "TronWebProto.UpdateAssetContract"; + } + TronWebProto.ParticipateAssetIssueContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ParticipateAssetIssueContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ParticipateAssetIssueContract.displayName = "TronWebProto.ParticipateAssetIssueContract"; + } + TronWebProto.AssetIssueContract.repeatedFields_ = [5]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AssetIssueContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AssetIssueContract.toObject(opt_includeInstance, this); + }; + TronWebProto.AssetIssueContract.toObject = function(includeInstance, msg) { + var obj = { + id: jspb.Message.getFieldWithDefault(msg, 41, ""), + ownerAddress: msg.getOwnerAddress_asB64(), + name: msg.getName_asB64(), + abbr: msg.getAbbr_asB64(), + totalSupply: jspb.Message.getFieldWithDefault(msg, 4, 0), + frozenSupplyList: jspb.Message.toObjectList( + msg.getFrozenSupplyList(), + TronWebProto.AssetIssueContract.FrozenSupply.toObject, + includeInstance + ), + trxNum: jspb.Message.getFieldWithDefault(msg, 6, 0), + precision: jspb.Message.getFieldWithDefault(msg, 7, 0), + num: jspb.Message.getFieldWithDefault(msg, 8, 0), + startTime: jspb.Message.getFieldWithDefault(msg, 9, 0), + endTime: jspb.Message.getFieldWithDefault(msg, 10, 0), + order: jspb.Message.getFieldWithDefault(msg, 11, 0), + voteScore: jspb.Message.getFieldWithDefault(msg, 16, 0), + description: msg.getDescription_asB64(), + url: msg.getUrl_asB64(), + freeAssetNetLimit: jspb.Message.getFieldWithDefault(msg, 22, 0), + publicFreeAssetNetLimit: jspb.Message.getFieldWithDefault(msg, 23, 0), + publicFreeAssetNetUsage: jspb.Message.getFieldWithDefault(msg, 24, 0), + publicLatestFreeNetTime: jspb.Message.getFieldWithDefault(msg, 25, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AssetIssueContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AssetIssueContract(); + return TronWebProto.AssetIssueContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AssetIssueContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 41: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setId(value); + break; + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setName(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAbbr(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setTotalSupply(value); + break; + case 5: + var value = new TronWebProto.AssetIssueContract.FrozenSupply(); + reader.readMessage(value, TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader); + msg.addFrozenSupply(value); + break; + case 6: + var value = ( + /** @type {number} */ + reader.readInt32() + ); + msg.setTrxNum(value); + break; + case 7: + var value = ( + /** @type {number} */ + reader.readInt32() + ); + msg.setPrecision(value); + break; + case 8: + var value = ( + /** @type {number} */ + reader.readInt32() + ); + msg.setNum(value); + break; + case 9: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setStartTime(value); + break; + case 10: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setEndTime(value); + break; + case 11: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setOrder(value); + break; + case 16: + var value = ( + /** @type {number} */ + reader.readInt32() + ); + msg.setVoteScore(value); + break; + case 20: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setDescription(value); + break; + case 21: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setUrl(value); + break; + case 22: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFreeAssetNetLimit(value); + break; + case 23: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setPublicFreeAssetNetLimit(value); + break; + case 24: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setPublicFreeAssetNetUsage(value); + break; + case 25: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setPublicLatestFreeNetTime(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AssetIssueContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AssetIssueContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AssetIssueContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getId(); + if (f4.length > 0) { + writer.writeString( + 41, + f4 + ); + } + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getName_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + f4 = message2.getAbbr_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getTotalSupply(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + f4 = message2.getFrozenSupplyList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 5, + f4, + TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter + ); + } + f4 = message2.getTrxNum(); + if (f4 !== 0) { + writer.writeInt32( + 6, + f4 + ); + } + f4 = message2.getPrecision(); + if (f4 !== 0) { + writer.writeInt32( + 7, + f4 + ); + } + f4 = message2.getNum(); + if (f4 !== 0) { + writer.writeInt32( + 8, + f4 + ); + } + f4 = message2.getStartTime(); + if (f4 !== 0) { + writer.writeInt64( + 9, + f4 + ); + } + f4 = message2.getEndTime(); + if (f4 !== 0) { + writer.writeInt64( + 10, + f4 + ); + } + f4 = message2.getOrder(); + if (f4 !== 0) { + writer.writeInt64( + 11, + f4 + ); + } + f4 = message2.getVoteScore(); + if (f4 !== 0) { + writer.writeInt32( + 16, + f4 + ); + } + f4 = message2.getDescription_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 20, + f4 + ); + } + f4 = message2.getUrl_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 21, + f4 + ); + } + f4 = message2.getFreeAssetNetLimit(); + if (f4 !== 0) { + writer.writeInt64( + 22, + f4 + ); + } + f4 = message2.getPublicFreeAssetNetLimit(); + if (f4 !== 0) { + writer.writeInt64( + 23, + f4 + ); + } + f4 = message2.getPublicFreeAssetNetUsage(); + if (f4 !== 0) { + writer.writeInt64( + 24, + f4 + ); + } + f4 = message2.getPublicLatestFreeNetTime(); + if (f4 !== 0) { + writer.writeInt64( + 25, + f4 + ); + } + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AssetIssueContract.FrozenSupply.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AssetIssueContract.FrozenSupply.toObject(opt_includeInstance, this); + }; + TronWebProto.AssetIssueContract.FrozenSupply.toObject = function(includeInstance, msg) { + var obj = { + frozenAmount: jspb.Message.getFieldWithDefault(msg, 1, 0), + frozenDays: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AssetIssueContract.FrozenSupply(); + return TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFrozenAmount(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFrozenDays(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AssetIssueContract.FrozenSupply.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getFrozenAmount(); + if (f4 !== 0) { + writer.writeInt64( + 1, + f4 + ); + } + f4 = message2.getFrozenDays(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + }; + TronWebProto.AssetIssueContract.FrozenSupply.prototype.getFrozenAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.AssetIssueContract.FrozenSupply.prototype.setFrozenAmount = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.AssetIssueContract.FrozenSupply.prototype.getFrozenDays = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.AssetIssueContract.FrozenSupply.prototype.setFrozenDays = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.AssetIssueContract.prototype.getId = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 41, "") + ); + }; + TronWebProto.AssetIssueContract.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 41, value); + }; + TronWebProto.AssetIssueContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.AssetIssueContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.AssetIssueContract.prototype.getName = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.AssetIssueContract.prototype.getName_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getName() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.getName_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getName() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.setName = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.AssetIssueContract.prototype.getAbbr = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.AssetIssueContract.prototype.getAbbr_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAbbr() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.getAbbr_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAbbr() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.setAbbr = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.AssetIssueContract.prototype.getTotalSupply = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setTotalSupply = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + TronWebProto.AssetIssueContract.prototype.getFrozenSupplyList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.AssetIssueContract.FrozenSupply, 5) + ); + }; + TronWebProto.AssetIssueContract.prototype.setFrozenSupplyList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); + }; + TronWebProto.AssetIssueContract.prototype.addFrozenSupply = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, TronWebProto.AssetIssueContract.FrozenSupply, opt_index); + }; + TronWebProto.AssetIssueContract.prototype.clearFrozenSupplyList = function() { + return this.setFrozenSupplyList([]); + }; + TronWebProto.AssetIssueContract.prototype.getTrxNum = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 6, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setTrxNum = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); + }; + TronWebProto.AssetIssueContract.prototype.getPrecision = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 7, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setPrecision = function(value) { + return jspb.Message.setProto3IntField(this, 7, value); + }; + TronWebProto.AssetIssueContract.prototype.getNum = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 8, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setNum = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); + }; + TronWebProto.AssetIssueContract.prototype.getStartTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 9, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setStartTime = function(value) { + return jspb.Message.setProto3IntField(this, 9, value); + }; + TronWebProto.AssetIssueContract.prototype.getEndTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 10, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setEndTime = function(value) { + return jspb.Message.setProto3IntField(this, 10, value); + }; + TronWebProto.AssetIssueContract.prototype.getOrder = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 11, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setOrder = function(value) { + return jspb.Message.setProto3IntField(this, 11, value); + }; + TronWebProto.AssetIssueContract.prototype.getVoteScore = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 16, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setVoteScore = function(value) { + return jspb.Message.setProto3IntField(this, 16, value); + }; + TronWebProto.AssetIssueContract.prototype.getDescription = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 20, "") + ); + }; + TronWebProto.AssetIssueContract.prototype.getDescription_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getDescription() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.getDescription_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getDescription() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.setDescription = function(value) { + return jspb.Message.setProto3BytesField(this, 20, value); + }; + TronWebProto.AssetIssueContract.prototype.getUrl = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 21, "") + ); + }; + TronWebProto.AssetIssueContract.prototype.getUrl_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getUrl() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.getUrl_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getUrl() + ) + ); + }; + TronWebProto.AssetIssueContract.prototype.setUrl = function(value) { + return jspb.Message.setProto3BytesField(this, 21, value); + }; + TronWebProto.AssetIssueContract.prototype.getFreeAssetNetLimit = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 22, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setFreeAssetNetLimit = function(value) { + return jspb.Message.setProto3IntField(this, 22, value); + }; + TronWebProto.AssetIssueContract.prototype.getPublicFreeAssetNetLimit = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 23, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setPublicFreeAssetNetLimit = function(value) { + return jspb.Message.setProto3IntField(this, 23, value); + }; + TronWebProto.AssetIssueContract.prototype.getPublicFreeAssetNetUsage = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 24, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setPublicFreeAssetNetUsage = function(value) { + return jspb.Message.setProto3IntField(this, 24, value); + }; + TronWebProto.AssetIssueContract.prototype.getPublicLatestFreeNetTime = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 25, 0) + ); + }; + TronWebProto.AssetIssueContract.prototype.setPublicLatestFreeNetTime = function(value) { + return jspb.Message.setProto3IntField(this, 25, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.TransferAssetContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.TransferAssetContract.toObject(opt_includeInstance, this); + }; + TronWebProto.TransferAssetContract.toObject = function(includeInstance, msg) { + var obj = { + assetName: msg.getAssetName_asB64(), + ownerAddress: msg.getOwnerAddress_asB64(), + toAddress: msg.getToAddress_asB64(), + amount: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.TransferAssetContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.TransferAssetContract(); + return TronWebProto.TransferAssetContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.TransferAssetContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAssetName(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setToAddress(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setAmount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.TransferAssetContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.TransferAssetContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.TransferAssetContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAssetName_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + f4 = message2.getToAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getAmount(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + }; + TronWebProto.TransferAssetContract.prototype.getAssetName = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.TransferAssetContract.prototype.getAssetName_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAssetName() + ) + ); + }; + TronWebProto.TransferAssetContract.prototype.getAssetName_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAssetName() + ) + ); + }; + TronWebProto.TransferAssetContract.prototype.setAssetName = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.TransferAssetContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.TransferAssetContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.TransferAssetContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.TransferAssetContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.TransferAssetContract.prototype.getToAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.TransferAssetContract.prototype.getToAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getToAddress() + ) + ); + }; + TronWebProto.TransferAssetContract.prototype.getToAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getToAddress() + ) + ); + }; + TronWebProto.TransferAssetContract.prototype.setToAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.TransferAssetContract.prototype.getAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.TransferAssetContract.prototype.setAmount = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.UnfreezeAssetContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.UnfreezeAssetContract.toObject(opt_includeInstance, this); + }; + TronWebProto.UnfreezeAssetContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.UnfreezeAssetContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.UnfreezeAssetContract(); + return TronWebProto.UnfreezeAssetContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.UnfreezeAssetContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.UnfreezeAssetContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.UnfreezeAssetContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.UnfreezeAssetContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + }; + TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.UnfreezeAssetContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.UpdateAssetContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.UpdateAssetContract.toObject(opt_includeInstance, this); + }; + TronWebProto.UpdateAssetContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + description: msg.getDescription_asB64(), + url: msg.getUrl_asB64(), + newLimit: jspb.Message.getFieldWithDefault(msg, 4, 0), + newPublicLimit: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.UpdateAssetContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.UpdateAssetContract(); + return TronWebProto.UpdateAssetContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.UpdateAssetContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setDescription(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setUrl(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setNewLimit(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setNewPublicLimit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.UpdateAssetContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.UpdateAssetContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.UpdateAssetContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getDescription_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + f4 = message2.getUrl_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getNewLimit(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + f4 = message2.getNewPublicLimit(); + if (f4 !== 0) { + writer.writeInt64( + 5, + f4 + ); + } + }; + TronWebProto.UpdateAssetContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.UpdateAssetContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.UpdateAssetContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.UpdateAssetContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.UpdateAssetContract.prototype.getDescription = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.UpdateAssetContract.prototype.getDescription_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getDescription() + ) + ); + }; + TronWebProto.UpdateAssetContract.prototype.getDescription_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getDescription() + ) + ); + }; + TronWebProto.UpdateAssetContract.prototype.setDescription = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.UpdateAssetContract.prototype.getUrl = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.UpdateAssetContract.prototype.getUrl_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getUrl() + ) + ); + }; + TronWebProto.UpdateAssetContract.prototype.getUrl_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getUrl() + ) + ); + }; + TronWebProto.UpdateAssetContract.prototype.setUrl = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.UpdateAssetContract.prototype.getNewLimit = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.UpdateAssetContract.prototype.setNewLimit = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + TronWebProto.UpdateAssetContract.prototype.getNewPublicLimit = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.UpdateAssetContract.prototype.setNewPublicLimit = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ParticipateAssetIssueContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ParticipateAssetIssueContract.toObject(opt_includeInstance, this); + }; + TronWebProto.ParticipateAssetIssueContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + toAddress: msg.getToAddress_asB64(), + assetName: msg.getAssetName_asB64(), + amount: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ParticipateAssetIssueContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ParticipateAssetIssueContract(); + return TronWebProto.ParticipateAssetIssueContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ParticipateAssetIssueContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setToAddress(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAssetName(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setAmount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ParticipateAssetIssueContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ParticipateAssetIssueContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ParticipateAssetIssueContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getToAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + f4 = message2.getAssetName_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getAmount(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getToAddress() + ) + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getToAddress() + ) + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.setToAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getAssetName() + ) + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getAssetName() + ) + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.setAssetName = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.getAmount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.ParticipateAssetIssueContract.prototype.setAmount = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + goog.object.extend(exports, TronWebProto); +})(asset_issue_contract_pb); +var smart_contract_pb = {}; +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + var core_Tron_pb = Tron_pb; + goog.object.extend(proto, core_Tron_pb); + goog.exportSymbol("TronWebProto.ClearABIContract", null, global2); + goog.exportSymbol("TronWebProto.ContractState", null, global2); + goog.exportSymbol("TronWebProto.CreateSmartContract", null, global2); + goog.exportSymbol("TronWebProto.SmartContract", null, global2); + goog.exportSymbol("TronWebProto.SmartContract.ABI", null, global2); + goog.exportSymbol("TronWebProto.SmartContract.ABI.Entry", null, global2); + goog.exportSymbol("TronWebProto.SmartContract.ABI.Entry.EntryType", null, global2); + goog.exportSymbol("TronWebProto.SmartContract.ABI.Entry.Param", null, global2); + goog.exportSymbol("TronWebProto.SmartContract.ABI.Entry.StateMutabilityType", null, global2); + goog.exportSymbol("TronWebProto.SmartContractDataWrapper", null, global2); + goog.exportSymbol("TronWebProto.TriggerSmartContract", null, global2); + goog.exportSymbol("TronWebProto.UpdateEnergyLimitContract", null, global2); + goog.exportSymbol("TronWebProto.UpdateSettingContract", null, global2); + TronWebProto.SmartContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.SmartContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.SmartContract.displayName = "TronWebProto.SmartContract"; + } + TronWebProto.SmartContract.ABI = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.SmartContract.ABI.repeatedFields_, null); + }; + goog.inherits(TronWebProto.SmartContract.ABI, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.SmartContract.ABI.displayName = "TronWebProto.SmartContract.ABI"; + } + TronWebProto.SmartContract.ABI.Entry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.SmartContract.ABI.Entry.repeatedFields_, null); + }; + goog.inherits(TronWebProto.SmartContract.ABI.Entry, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.SmartContract.ABI.Entry.displayName = "TronWebProto.SmartContract.ABI.Entry"; + } + TronWebProto.SmartContract.ABI.Entry.Param = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.SmartContract.ABI.Entry.Param, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.SmartContract.ABI.Entry.Param.displayName = "TronWebProto.SmartContract.ABI.Entry.Param"; + } + TronWebProto.ContractState = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ContractState, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ContractState.displayName = "TronWebProto.ContractState"; + } + TronWebProto.CreateSmartContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.CreateSmartContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.CreateSmartContract.displayName = "TronWebProto.CreateSmartContract"; + } + TronWebProto.TriggerSmartContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.TriggerSmartContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.TriggerSmartContract.displayName = "TronWebProto.TriggerSmartContract"; + } + TronWebProto.ClearABIContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ClearABIContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ClearABIContract.displayName = "TronWebProto.ClearABIContract"; + } + TronWebProto.UpdateSettingContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.UpdateSettingContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.UpdateSettingContract.displayName = "TronWebProto.UpdateSettingContract"; + } + TronWebProto.UpdateEnergyLimitContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.UpdateEnergyLimitContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.UpdateEnergyLimitContract.displayName = "TronWebProto.UpdateEnergyLimitContract"; + } + TronWebProto.SmartContractDataWrapper = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.SmartContractDataWrapper, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.SmartContractDataWrapper.displayName = "TronWebProto.SmartContractDataWrapper"; + } + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.SmartContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.SmartContract.toObject(opt_includeInstance, this); + }; + TronWebProto.SmartContract.toObject = function(includeInstance, msg) { + var f4, obj = { + originAddress: msg.getOriginAddress_asB64(), + contractAddress: msg.getContractAddress_asB64(), + abi: (f4 = msg.getAbi()) && TronWebProto.SmartContract.ABI.toObject(includeInstance, f4), + bytecode: msg.getBytecode_asB64(), + callValue: jspb.Message.getFieldWithDefault(msg, 5, 0), + consumeUserResourcePercent: jspb.Message.getFieldWithDefault(msg, 6, 0), + name: jspb.Message.getFieldWithDefault(msg, 7, ""), + originEnergyLimit: jspb.Message.getFieldWithDefault(msg, 8, 0), + codeHash: msg.getCodeHash_asB64(), + trxHash: msg.getTrxHash_asB64(), + version: jspb.Message.getFieldWithDefault(msg, 11, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.SmartContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.SmartContract(); + return TronWebProto.SmartContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.SmartContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOriginAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setContractAddress(value); + break; + case 3: + var value = new TronWebProto.SmartContract.ABI(); + reader.readMessage(value, TronWebProto.SmartContract.ABI.deserializeBinaryFromReader); + msg.setAbi(value); + break; + case 4: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setBytecode(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setCallValue(value); + break; + case 6: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setConsumeUserResourcePercent(value); + break; + case 7: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setName(value); + break; + case 8: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setOriginEnergyLimit(value); + break; + case 9: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setCodeHash(value); + break; + case 10: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setTrxHash(value); + break; + case 11: + var value = ( + /** @type {number} */ + reader.readInt32() + ); + msg.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.SmartContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.SmartContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.SmartContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOriginAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getContractAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + f4 = message2.getAbi(); + if (f4 != null) { + writer.writeMessage(3, f4, TronWebProto.SmartContract.ABI.serializeBinaryToWriter); + } + f4 = message2.getBytecode_asU8(); + if (f4.length > 0) { + writer.writeBytes(4, f4); + } + f4 = message2.getCallValue(); + if (f4 !== 0) { + writer.writeInt64(5, f4); + } + f4 = message2.getConsumeUserResourcePercent(); + if (f4 !== 0) { + writer.writeInt64(6, f4); + } + f4 = message2.getName(); + if (f4.length > 0) { + writer.writeString(7, f4); + } + f4 = message2.getOriginEnergyLimit(); + if (f4 !== 0) { + writer.writeInt64(8, f4); + } + f4 = message2.getCodeHash_asU8(); + if (f4.length > 0) { + writer.writeBytes(9, f4); + } + f4 = message2.getTrxHash_asU8(); + if (f4.length > 0) { + writer.writeBytes(10, f4); + } + f4 = message2.getVersion(); + if (f4 !== 0) { + writer.writeInt32(11, f4); + } + }; + TronWebProto.SmartContract.ABI.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.SmartContract.ABI.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.SmartContract.ABI.toObject(opt_includeInstance, this); + }; + TronWebProto.SmartContract.ABI.toObject = function(includeInstance, msg) { + var obj = { + entrysList: jspb.Message.toObjectList( + msg.getEntrysList(), + TronWebProto.SmartContract.ABI.Entry.toObject, + includeInstance + ) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.SmartContract.ABI.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.SmartContract.ABI(); + return TronWebProto.SmartContract.ABI.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.SmartContract.ABI.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new TronWebProto.SmartContract.ABI.Entry(); + reader.readMessage(value, TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader); + msg.addEntrys(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.SmartContract.ABI.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.SmartContract.ABI.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.SmartContract.ABI.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getEntrysList(); + if (f4.length > 0) { + writer.writeRepeatedMessage(1, f4, TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter); + } + }; + TronWebProto.SmartContract.ABI.Entry.repeatedFields_ = [4, 5]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.SmartContract.ABI.Entry.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.SmartContract.ABI.Entry.toObject(opt_includeInstance, this); + }; + TronWebProto.SmartContract.ABI.Entry.toObject = function(includeInstance, msg) { + var obj = { + anonymous: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), + constant: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), + name: jspb.Message.getFieldWithDefault(msg, 3, ""), + inputsList: jspb.Message.toObjectList( + msg.getInputsList(), + TronWebProto.SmartContract.ABI.Entry.Param.toObject, + includeInstance + ), + outputsList: jspb.Message.toObjectList( + msg.getOutputsList(), + TronWebProto.SmartContract.ABI.Entry.Param.toObject, + includeInstance + ), + type: jspb.Message.getFieldWithDefault(msg, 6, 0), + payable: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), + statemutability: jspb.Message.getFieldWithDefault(msg, 8, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.SmartContract.ABI.Entry.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.SmartContract.ABI.Entry(); + return TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setAnonymous(value); + break; + case 2: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setConstant(value); + break; + case 3: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setName(value); + break; + case 4: + var value = new TronWebProto.SmartContract.ABI.Entry.Param(); + reader.readMessage(value, TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader); + msg.addInputs(value); + break; + case 5: + var value = new TronWebProto.SmartContract.ABI.Entry.Param(); + reader.readMessage(value, TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader); + msg.addOutputs(value); + break; + case 6: + var value = ( + /** @type {!TronWebProto.SmartContract.ABI.Entry.EntryType} */ + reader.readEnum() + ); + msg.setType(value); + break; + case 7: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setPayable(value); + break; + case 8: + var value = ( + /** @type {!TronWebProto.SmartContract.ABI.Entry.StateMutabilityType} */ + reader.readEnum() + ); + msg.setStatemutability(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.SmartContract.ABI.Entry.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAnonymous(); + if (f4) { + writer.writeBool(1, f4); + } + f4 = message2.getConstant(); + if (f4) { + writer.writeBool(2, f4); + } + f4 = message2.getName(); + if (f4.length > 0) { + writer.writeString(3, f4); + } + f4 = message2.getInputsList(); + if (f4.length > 0) { + writer.writeRepeatedMessage(4, f4, TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter); + } + f4 = message2.getOutputsList(); + if (f4.length > 0) { + writer.writeRepeatedMessage(5, f4, TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter); + } + f4 = message2.getType(); + if (f4 !== 0) { + writer.writeEnum(6, f4); + } + f4 = message2.getPayable(); + if (f4) { + writer.writeBool(7, f4); + } + f4 = message2.getStatemutability(); + if (f4 !== 0) { + writer.writeEnum(8, f4); + } + }; + TronWebProto.SmartContract.ABI.Entry.EntryType = { + UNKNOWNENTRYTYPE: 0, + CONSTRUCTOR: 1, + FUNCTION: 2, + EVENT: 3, + FALLBACK: 4, + RECEIVE: 5, + ERROR: 6 + }; + TronWebProto.SmartContract.ABI.Entry.StateMutabilityType = { + UNKNOWNMUTABILITYTYPE: 0, + PURE: 1, + VIEW: 2, + NONPAYABLE: 3, + PAYABLE: 4 + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.SmartContract.ABI.Entry.Param.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.SmartContract.ABI.Entry.Param.toObject(opt_includeInstance, this); + }; + TronWebProto.SmartContract.ABI.Entry.Param.toObject = function(includeInstance, msg) { + var obj = { + indexed: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + type: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.SmartContract.ABI.Entry.Param(); + return TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setIndexed(value); + break; + case 2: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setName(value); + break; + case 3: + var value = ( + /** @type {string} */ + reader.readString() + ); + msg.setType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.SmartContract.ABI.Entry.Param.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getIndexed(); + if (f4) { + writer.writeBool(1, f4); + } + f4 = message2.getName(); + if (f4.length > 0) { + writer.writeString(2, f4); + } + f4 = message2.getType(); + if (f4.length > 0) { + writer.writeString(3, f4); + } + }; + TronWebProto.SmartContract.ABI.Entry.Param.prototype.getIndexed = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 1, false) + ); + }; + TronWebProto.SmartContract.ABI.Entry.Param.prototype.setIndexed = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); + }; + TronWebProto.SmartContract.ABI.Entry.Param.prototype.getName = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.SmartContract.ABI.Entry.Param.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); + }; + TronWebProto.SmartContract.ABI.Entry.Param.prototype.getType = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.SmartContract.ABI.Entry.Param.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.getAnonymous = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 1, false) + ); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.setAnonymous = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.getConstant = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 2, false) + ); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.setConstant = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.getName = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.getInputsList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.SmartContract.ABI.Entry.Param, 4) + ); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.setInputsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.addInputs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, TronWebProto.SmartContract.ABI.Entry.Param, opt_index); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.clearInputsList = function() { + return this.setInputsList([]); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.getOutputsList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.SmartContract.ABI.Entry.Param, 5) + ); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.setOutputsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.addOutputs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, TronWebProto.SmartContract.ABI.Entry.Param, opt_index); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.clearOutputsList = function() { + return this.setOutputsList([]); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.getType = function() { + return ( + /** @type {!TronWebProto.SmartContract.ABI.Entry.EntryType} */ + jspb.Message.getFieldWithDefault(this, 6, 0) + ); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 6, value); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.getPayable = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 7, false) + ); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.setPayable = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.getStatemutability = function() { + return ( + /** @type {!TronWebProto.SmartContract.ABI.Entry.StateMutabilityType} */ + jspb.Message.getFieldWithDefault(this, 8, 0) + ); + }; + TronWebProto.SmartContract.ABI.Entry.prototype.setStatemutability = function(value) { + return jspb.Message.setProto3EnumField(this, 8, value); + }; + TronWebProto.SmartContract.ABI.prototype.getEntrysList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.SmartContract.ABI.Entry, 1) + ); + }; + TronWebProto.SmartContract.ABI.prototype.setEntrysList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); + }; + TronWebProto.SmartContract.ABI.prototype.addEntrys = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, TronWebProto.SmartContract.ABI.Entry, opt_index); + }; + TronWebProto.SmartContract.ABI.prototype.clearEntrysList = function() { + return this.setEntrysList([]); + }; + TronWebProto.SmartContract.prototype.getOriginAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.SmartContract.prototype.getOriginAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOriginAddress()) + ); + }; + TronWebProto.SmartContract.prototype.getOriginAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOriginAddress()) + ); + }; + TronWebProto.SmartContract.prototype.setOriginAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.SmartContract.prototype.getContractAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.SmartContract.prototype.getContractAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getContractAddress()) + ); + }; + TronWebProto.SmartContract.prototype.getContractAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getContractAddress()) + ); + }; + TronWebProto.SmartContract.prototype.setContractAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.SmartContract.prototype.getAbi = function() { + return ( + /** @type{?TronWebProto.SmartContract.ABI} */ + jspb.Message.getWrapperField(this, TronWebProto.SmartContract.ABI, 3) + ); + }; + TronWebProto.SmartContract.prototype.setAbi = function(value) { + return jspb.Message.setWrapperField(this, 3, value); + }; + TronWebProto.SmartContract.prototype.clearAbi = function() { + return this.setAbi(void 0); + }; + TronWebProto.SmartContract.prototype.hasAbi = function() { + return jspb.Message.getField(this, 3) != null; + }; + TronWebProto.SmartContract.prototype.getBytecode = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 4, "") + ); + }; + TronWebProto.SmartContract.prototype.getBytecode_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getBytecode()) + ); + }; + TronWebProto.SmartContract.prototype.getBytecode_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getBytecode()) + ); + }; + TronWebProto.SmartContract.prototype.setBytecode = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); + }; + TronWebProto.SmartContract.prototype.getCallValue = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.SmartContract.prototype.setCallValue = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + TronWebProto.SmartContract.prototype.getConsumeUserResourcePercent = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 6, 0) + ); + }; + TronWebProto.SmartContract.prototype.setConsumeUserResourcePercent = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); + }; + TronWebProto.SmartContract.prototype.getName = function() { + return ( + /** @type {string} */ + jspb.Message.getFieldWithDefault(this, 7, "") + ); + }; + TronWebProto.SmartContract.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); + }; + TronWebProto.SmartContract.prototype.getOriginEnergyLimit = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 8, 0) + ); + }; + TronWebProto.SmartContract.prototype.setOriginEnergyLimit = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); + }; + TronWebProto.SmartContract.prototype.getCodeHash = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 9, "") + ); + }; + TronWebProto.SmartContract.prototype.getCodeHash_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getCodeHash()) + ); + }; + TronWebProto.SmartContract.prototype.getCodeHash_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getCodeHash()) + ); + }; + TronWebProto.SmartContract.prototype.setCodeHash = function(value) { + return jspb.Message.setProto3BytesField(this, 9, value); + }; + TronWebProto.SmartContract.prototype.getTrxHash = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 10, "") + ); + }; + TronWebProto.SmartContract.prototype.getTrxHash_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getTrxHash()) + ); + }; + TronWebProto.SmartContract.prototype.getTrxHash_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getTrxHash()) + ); + }; + TronWebProto.SmartContract.prototype.setTrxHash = function(value) { + return jspb.Message.setProto3BytesField(this, 10, value); + }; + TronWebProto.SmartContract.prototype.getVersion = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 11, 0) + ); + }; + TronWebProto.SmartContract.prototype.setVersion = function(value) { + return jspb.Message.setProto3IntField(this, 11, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ContractState.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ContractState.toObject(opt_includeInstance, this); + }; + TronWebProto.ContractState.toObject = function(includeInstance, msg) { + var obj = { + energyUsage: jspb.Message.getFieldWithDefault(msg, 1, 0), + energyFactor: jspb.Message.getFieldWithDefault(msg, 2, 0), + updateCycle: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ContractState.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ContractState(); + return TronWebProto.ContractState.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ContractState.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setEnergyUsage(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setEnergyFactor(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setUpdateCycle(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ContractState.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ContractState.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ContractState.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getEnergyUsage(); + if (f4 !== 0) { + writer.writeInt64(1, f4); + } + f4 = message2.getEnergyFactor(); + if (f4 !== 0) { + writer.writeInt64(2, f4); + } + f4 = message2.getUpdateCycle(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + }; + TronWebProto.ContractState.prototype.getEnergyUsage = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 1, 0) + ); + }; + TronWebProto.ContractState.prototype.setEnergyUsage = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); + }; + TronWebProto.ContractState.prototype.getEnergyFactor = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.ContractState.prototype.setEnergyFactor = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.ContractState.prototype.getUpdateCycle = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.ContractState.prototype.setUpdateCycle = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.CreateSmartContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.CreateSmartContract.toObject(opt_includeInstance, this); + }; + TronWebProto.CreateSmartContract.toObject = function(includeInstance, msg) { + var f4, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + newContract: (f4 = msg.getNewContract()) && TronWebProto.SmartContract.toObject(includeInstance, f4), + callTokenValue: jspb.Message.getFieldWithDefault(msg, 3, 0), + tokenId: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.CreateSmartContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.CreateSmartContract(); + return TronWebProto.CreateSmartContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.CreateSmartContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = new TronWebProto.SmartContract(); + reader.readMessage(value, TronWebProto.SmartContract.deserializeBinaryFromReader); + msg.setNewContract(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setCallTokenValue(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setTokenId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.CreateSmartContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.CreateSmartContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.CreateSmartContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getNewContract(); + if (f4 != null) { + writer.writeMessage(2, f4, TronWebProto.SmartContract.serializeBinaryToWriter); + } + f4 = message2.getCallTokenValue(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + f4 = message2.getTokenId(); + if (f4 !== 0) { + writer.writeInt64(4, f4); + } + }; + TronWebProto.CreateSmartContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.CreateSmartContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.CreateSmartContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.CreateSmartContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.CreateSmartContract.prototype.getNewContract = function() { + return ( + /** @type{?TronWebProto.SmartContract} */ + jspb.Message.getWrapperField(this, TronWebProto.SmartContract, 2) + ); + }; + TronWebProto.CreateSmartContract.prototype.setNewContract = function(value) { + return jspb.Message.setWrapperField(this, 2, value); + }; + TronWebProto.CreateSmartContract.prototype.clearNewContract = function() { + return this.setNewContract(void 0); + }; + TronWebProto.CreateSmartContract.prototype.hasNewContract = function() { + return jspb.Message.getField(this, 2) != null; + }; + TronWebProto.CreateSmartContract.prototype.getCallTokenValue = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.CreateSmartContract.prototype.setCallTokenValue = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.CreateSmartContract.prototype.getTokenId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.CreateSmartContract.prototype.setTokenId = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.TriggerSmartContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.TriggerSmartContract.toObject(opt_includeInstance, this); + }; + TronWebProto.TriggerSmartContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + contractAddress: msg.getContractAddress_asB64(), + callValue: jspb.Message.getFieldWithDefault(msg, 3, 0), + data: msg.getData_asB64(), + callTokenValue: jspb.Message.getFieldWithDefault(msg, 5, 0), + tokenId: jspb.Message.getFieldWithDefault(msg, 6, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.TriggerSmartContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.TriggerSmartContract(); + return TronWebProto.TriggerSmartContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.TriggerSmartContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setContractAddress(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setCallValue(value); + break; + case 4: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setData(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setCallTokenValue(value); + break; + case 6: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setTokenId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.TriggerSmartContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.TriggerSmartContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.TriggerSmartContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getContractAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + f4 = message2.getCallValue(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + f4 = message2.getData_asU8(); + if (f4.length > 0) { + writer.writeBytes(4, f4); + } + f4 = message2.getCallTokenValue(); + if (f4 !== 0) { + writer.writeInt64(5, f4); + } + f4 = message2.getTokenId(); + if (f4 !== 0) { + writer.writeInt64(6, f4); + } + }; + TronWebProto.TriggerSmartContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.TriggerSmartContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.TriggerSmartContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.TriggerSmartContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.TriggerSmartContract.prototype.getContractAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.TriggerSmartContract.prototype.getContractAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getContractAddress()) + ); + }; + TronWebProto.TriggerSmartContract.prototype.getContractAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getContractAddress()) + ); + }; + TronWebProto.TriggerSmartContract.prototype.setContractAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.TriggerSmartContract.prototype.getCallValue = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.TriggerSmartContract.prototype.setCallValue = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.TriggerSmartContract.prototype.getData = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 4, "") + ); + }; + TronWebProto.TriggerSmartContract.prototype.getData_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getData()) + ); + }; + TronWebProto.TriggerSmartContract.prototype.getData_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getData()) + ); + }; + TronWebProto.TriggerSmartContract.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); + }; + TronWebProto.TriggerSmartContract.prototype.getCallTokenValue = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.TriggerSmartContract.prototype.setCallTokenValue = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + TronWebProto.TriggerSmartContract.prototype.getTokenId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 6, 0) + ); + }; + TronWebProto.TriggerSmartContract.prototype.setTokenId = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ClearABIContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ClearABIContract.toObject(opt_includeInstance, this); + }; + TronWebProto.ClearABIContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + contractAddress: msg.getContractAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ClearABIContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ClearABIContract(); + return TronWebProto.ClearABIContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ClearABIContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setContractAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ClearABIContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ClearABIContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ClearABIContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getContractAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + }; + TronWebProto.ClearABIContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.ClearABIContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.ClearABIContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.ClearABIContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.ClearABIContract.prototype.getContractAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.ClearABIContract.prototype.getContractAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getContractAddress()) + ); + }; + TronWebProto.ClearABIContract.prototype.getContractAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getContractAddress()) + ); + }; + TronWebProto.ClearABIContract.prototype.setContractAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.UpdateSettingContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.UpdateSettingContract.toObject(opt_includeInstance, this); + }; + TronWebProto.UpdateSettingContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + contractAddress: msg.getContractAddress_asB64(), + consumeUserResourcePercent: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.UpdateSettingContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.UpdateSettingContract(); + return TronWebProto.UpdateSettingContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.UpdateSettingContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setContractAddress(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setConsumeUserResourcePercent(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.UpdateSettingContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.UpdateSettingContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.UpdateSettingContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getContractAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + f4 = message2.getConsumeUserResourcePercent(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + }; + TronWebProto.UpdateSettingContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.UpdateSettingContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.UpdateSettingContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.UpdateSettingContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.UpdateSettingContract.prototype.getContractAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.UpdateSettingContract.prototype.getContractAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getContractAddress()) + ); + }; + TronWebProto.UpdateSettingContract.prototype.getContractAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getContractAddress()) + ); + }; + TronWebProto.UpdateSettingContract.prototype.setContractAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.UpdateSettingContract.prototype.getConsumeUserResourcePercent = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.UpdateSettingContract.prototype.setConsumeUserResourcePercent = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.UpdateEnergyLimitContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.UpdateEnergyLimitContract.toObject(opt_includeInstance, this); + }; + TronWebProto.UpdateEnergyLimitContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + contractAddress: msg.getContractAddress_asB64(), + originEnergyLimit: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.UpdateEnergyLimitContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.UpdateEnergyLimitContract(); + return TronWebProto.UpdateEnergyLimitContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.UpdateEnergyLimitContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setContractAddress(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setOriginEnergyLimit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.UpdateEnergyLimitContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.UpdateEnergyLimitContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.UpdateEnergyLimitContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getContractAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + f4 = message2.getOriginEnergyLimit(); + if (f4 !== 0) { + writer.writeInt64(3, f4); + } + }; + TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.UpdateEnergyLimitContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getContractAddress()) + ); + }; + TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getContractAddress()) + ); + }; + TronWebProto.UpdateEnergyLimitContract.prototype.setContractAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.UpdateEnergyLimitContract.prototype.getOriginEnergyLimit = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.UpdateEnergyLimitContract.prototype.setOriginEnergyLimit = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.SmartContractDataWrapper.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.SmartContractDataWrapper.toObject(opt_includeInstance, this); + }; + TronWebProto.SmartContractDataWrapper.toObject = function(includeInstance, msg) { + var f4, obj = { + smartContract: (f4 = msg.getSmartContract()) && TronWebProto.SmartContract.toObject(includeInstance, f4), + runtimecode: msg.getRuntimecode_asB64(), + contractState: (f4 = msg.getContractState()) && TronWebProto.ContractState.toObject(includeInstance, f4) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.SmartContractDataWrapper.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.SmartContractDataWrapper(); + return TronWebProto.SmartContractDataWrapper.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.SmartContractDataWrapper.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new TronWebProto.SmartContract(); + reader.readMessage(value, TronWebProto.SmartContract.deserializeBinaryFromReader); + msg.setSmartContract(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setRuntimecode(value); + break; + case 3: + var value = new TronWebProto.ContractState(); + reader.readMessage(value, TronWebProto.ContractState.deserializeBinaryFromReader); + msg.setContractState(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.SmartContractDataWrapper.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.SmartContractDataWrapper.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.SmartContractDataWrapper.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getSmartContract(); + if (f4 != null) { + writer.writeMessage(1, f4, TronWebProto.SmartContract.serializeBinaryToWriter); + } + f4 = message2.getRuntimecode_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + f4 = message2.getContractState(); + if (f4 != null) { + writer.writeMessage(3, f4, TronWebProto.ContractState.serializeBinaryToWriter); + } + }; + TronWebProto.SmartContractDataWrapper.prototype.getSmartContract = function() { + return ( + /** @type{?TronWebProto.SmartContract} */ + jspb.Message.getWrapperField(this, TronWebProto.SmartContract, 1) + ); + }; + TronWebProto.SmartContractDataWrapper.prototype.setSmartContract = function(value) { + return jspb.Message.setWrapperField(this, 1, value); + }; + TronWebProto.SmartContractDataWrapper.prototype.clearSmartContract = function() { + return this.setSmartContract(void 0); + }; + TronWebProto.SmartContractDataWrapper.prototype.hasSmartContract = function() { + return jspb.Message.getField(this, 1) != null; + }; + TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getRuntimecode()) + ); + }; + TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getRuntimecode()) + ); + }; + TronWebProto.SmartContractDataWrapper.prototype.setRuntimecode = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.SmartContractDataWrapper.prototype.getContractState = function() { + return ( + /** @type{?TronWebProto.ContractState} */ + jspb.Message.getWrapperField(this, TronWebProto.ContractState, 3) + ); + }; + TronWebProto.SmartContractDataWrapper.prototype.setContractState = function(value) { + return jspb.Message.setWrapperField(this, 3, value); + }; + TronWebProto.SmartContractDataWrapper.prototype.clearContractState = function() { + return this.setContractState(void 0); + }; + TronWebProto.SmartContractDataWrapper.prototype.hasContractState = function() { + return jspb.Message.getField(this, 3) != null; + }; + goog.object.extend(exports, TronWebProto); +})(smart_contract_pb); +var witness_contract_pb = {}; +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + goog.exportSymbol("TronWebProto.VoteWitnessContract", null, global2); + goog.exportSymbol("TronWebProto.VoteWitnessContract.Vote", null, global2); + goog.exportSymbol("TronWebProto.WitnessCreateContract", null, global2); + goog.exportSymbol("TronWebProto.WitnessUpdateContract", null, global2); + TronWebProto.WitnessCreateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.WitnessCreateContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.WitnessCreateContract.displayName = "TronWebProto.WitnessCreateContract"; + } + TronWebProto.WitnessUpdateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.WitnessUpdateContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.WitnessUpdateContract.displayName = "TronWebProto.WitnessUpdateContract"; + } + TronWebProto.VoteWitnessContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.VoteWitnessContract.repeatedFields_, null); + }; + goog.inherits(TronWebProto.VoteWitnessContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.VoteWitnessContract.displayName = "TronWebProto.VoteWitnessContract"; + } + TronWebProto.VoteWitnessContract.Vote = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.VoteWitnessContract.Vote, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.VoteWitnessContract.Vote.displayName = "TronWebProto.VoteWitnessContract.Vote"; + } + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.WitnessCreateContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.WitnessCreateContract.toObject(opt_includeInstance, this); + }; + TronWebProto.WitnessCreateContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + url: msg.getUrl_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.WitnessCreateContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.WitnessCreateContract(); + return TronWebProto.WitnessCreateContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.WitnessCreateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.WitnessCreateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.WitnessCreateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.WitnessCreateContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getUrl_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + }; + TronWebProto.WitnessCreateContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.WitnessCreateContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.WitnessCreateContract.prototype.getUrl = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.WitnessCreateContract.prototype.getUrl_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getUrl() + ) + ); + }; + TronWebProto.WitnessCreateContract.prototype.getUrl_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getUrl() + ) + ); + }; + TronWebProto.WitnessCreateContract.prototype.setUrl = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.WitnessUpdateContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.WitnessUpdateContract.toObject(opt_includeInstance, this); + }; + TronWebProto.WitnessUpdateContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + updateUrl: msg.getUpdateUrl_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.WitnessUpdateContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.WitnessUpdateContract(); + return TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 12: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setUpdateUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.WitnessUpdateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.WitnessUpdateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.WitnessUpdateContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getUpdateUrl_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 12, + f4 + ); + } + }; + TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.WitnessUpdateContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 12, "") + ); + }; + TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getUpdateUrl() + ) + ); + }; + TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getUpdateUrl() + ) + ); + }; + TronWebProto.WitnessUpdateContract.prototype.setUpdateUrl = function(value) { + return jspb.Message.setProto3BytesField(this, 12, value); + }; + TronWebProto.VoteWitnessContract.repeatedFields_ = [2]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.VoteWitnessContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.VoteWitnessContract.toObject(opt_includeInstance, this); + }; + TronWebProto.VoteWitnessContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + votesList: jspb.Message.toObjectList( + msg.getVotesList(), + TronWebProto.VoteWitnessContract.Vote.toObject, + includeInstance + ), + support: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.VoteWitnessContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.VoteWitnessContract(); + return TronWebProto.VoteWitnessContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.VoteWitnessContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = new TronWebProto.VoteWitnessContract.Vote(); + reader.readMessage(value, TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader); + msg.addVotes(value); + break; + case 3: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setSupport(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.VoteWitnessContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.VoteWitnessContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.VoteWitnessContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getVotesList(); + if (f4.length > 0) { + writer.writeRepeatedMessage( + 2, + f4, + TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter + ); + } + f4 = message2.getSupport(); + if (f4) { + writer.writeBool( + 3, + f4 + ); + } + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.VoteWitnessContract.Vote.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.VoteWitnessContract.Vote.toObject(opt_includeInstance, this); + }; + TronWebProto.VoteWitnessContract.Vote.toObject = function(includeInstance, msg) { + var obj = { + voteAddress: msg.getVoteAddress_asB64(), + voteCount: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.VoteWitnessContract.Vote.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.VoteWitnessContract.Vote(); + return TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setVoteAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setVoteCount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.VoteWitnessContract.Vote.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getVoteAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getVoteCount(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + }; + TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getVoteAddress() + ) + ); + }; + TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getVoteAddress() + ) + ); + }; + TronWebProto.VoteWitnessContract.Vote.prototype.setVoteAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.VoteWitnessContract.Vote.prototype.getVoteCount = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.VoteWitnessContract.Vote.prototype.setVoteCount = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.VoteWitnessContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.VoteWitnessContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.VoteWitnessContract.prototype.getVotesList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, TronWebProto.VoteWitnessContract.Vote, 2) + ); + }; + TronWebProto.VoteWitnessContract.prototype.setVotesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); + }; + TronWebProto.VoteWitnessContract.prototype.addVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, TronWebProto.VoteWitnessContract.Vote, opt_index); + }; + TronWebProto.VoteWitnessContract.prototype.clearVotesList = function() { + return this.setVotesList([]); + }; + TronWebProto.VoteWitnessContract.prototype.getSupport = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 3, false) + ); + }; + TronWebProto.VoteWitnessContract.prototype.setSupport = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); + }; + goog.object.extend(exports, TronWebProto); +})(witness_contract_pb); +var storage_contract_pb = {}; +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + goog.exportSymbol("TronWebProto.BuyStorageBytesContract", null, global2); + goog.exportSymbol("TronWebProto.BuyStorageContract", null, global2); + goog.exportSymbol("TronWebProto.SellStorageContract", null, global2); + goog.exportSymbol("TronWebProto.UpdateBrokerageContract", null, global2); + TronWebProto.BuyStorageBytesContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.BuyStorageBytesContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.BuyStorageBytesContract.displayName = "TronWebProto.BuyStorageBytesContract"; + } + TronWebProto.BuyStorageContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.BuyStorageContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.BuyStorageContract.displayName = "TronWebProto.BuyStorageContract"; + } + TronWebProto.SellStorageContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.SellStorageContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.SellStorageContract.displayName = "TronWebProto.SellStorageContract"; + } + TronWebProto.UpdateBrokerageContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.UpdateBrokerageContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.UpdateBrokerageContract.displayName = "TronWebProto.UpdateBrokerageContract"; + } + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.BuyStorageBytesContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.BuyStorageBytesContract.toObject(opt_includeInstance, this); + }; + TronWebProto.BuyStorageBytesContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + bytes: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.BuyStorageBytesContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.BuyStorageBytesContract(); + return TronWebProto.BuyStorageBytesContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.BuyStorageBytesContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setBytes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.BuyStorageBytesContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.BuyStorageBytesContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.BuyStorageBytesContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getBytes(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + }; + TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.BuyStorageBytesContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.BuyStorageBytesContract.prototype.getBytes = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.BuyStorageBytesContract.prototype.setBytes = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.BuyStorageContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.BuyStorageContract.toObject(opt_includeInstance, this); + }; + TronWebProto.BuyStorageContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + quant: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.BuyStorageContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.BuyStorageContract(); + return TronWebProto.BuyStorageContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.BuyStorageContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setQuant(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.BuyStorageContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.BuyStorageContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.BuyStorageContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getQuant(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + }; + TronWebProto.BuyStorageContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.BuyStorageContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.BuyStorageContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.BuyStorageContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.BuyStorageContract.prototype.getQuant = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.BuyStorageContract.prototype.setQuant = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.SellStorageContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.SellStorageContract.toObject(opt_includeInstance, this); + }; + TronWebProto.SellStorageContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + storageBytes: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.SellStorageContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.SellStorageContract(); + return TronWebProto.SellStorageContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.SellStorageContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setStorageBytes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.SellStorageContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.SellStorageContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.SellStorageContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getStorageBytes(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + }; + TronWebProto.SellStorageContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.SellStorageContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.SellStorageContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.SellStorageContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.SellStorageContract.prototype.getStorageBytes = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.SellStorageContract.prototype.setStorageBytes = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.UpdateBrokerageContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.UpdateBrokerageContract.toObject(opt_includeInstance, this); + }; + TronWebProto.UpdateBrokerageContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + brokerage: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.UpdateBrokerageContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.UpdateBrokerageContract(); + return TronWebProto.UpdateBrokerageContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.UpdateBrokerageContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt32() + ); + msg.setBrokerage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.UpdateBrokerageContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.UpdateBrokerageContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.UpdateBrokerageContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getBrokerage(); + if (f4 !== 0) { + writer.writeInt32( + 2, + f4 + ); + } + }; + TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.UpdateBrokerageContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.UpdateBrokerageContract.prototype.getBrokerage = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.UpdateBrokerageContract.prototype.setBrokerage = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + goog.object.extend(exports, TronWebProto); +})(storage_contract_pb); +var account_contract_pb = {}; +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + var core_Tron_pb = Tron_pb; + goog.object.extend(proto, core_Tron_pb); + goog.exportSymbol("TronWebProto.AccountCreateContract", null, global2); + goog.exportSymbol("TronWebProto.AccountPermissionUpdateContract", null, global2); + goog.exportSymbol("TronWebProto.AccountUpdateContract", null, global2); + goog.exportSymbol("TronWebProto.SetAccountIdContract", null, global2); + TronWebProto.AccountCreateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.AccountCreateContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AccountCreateContract.displayName = "TronWebProto.AccountCreateContract"; + } + TronWebProto.AccountUpdateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.AccountUpdateContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AccountUpdateContract.displayName = "TronWebProto.AccountUpdateContract"; + } + TronWebProto.SetAccountIdContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.SetAccountIdContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.SetAccountIdContract.displayName = "TronWebProto.SetAccountIdContract"; + } + TronWebProto.AccountPermissionUpdateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.AccountPermissionUpdateContract.repeatedFields_, null); + }; + goog.inherits(TronWebProto.AccountPermissionUpdateContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.AccountPermissionUpdateContract.displayName = "TronWebProto.AccountPermissionUpdateContract"; + } + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AccountCreateContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AccountCreateContract.toObject(opt_includeInstance, this); + }; + TronWebProto.AccountCreateContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + accountAddress: msg.getAccountAddress_asB64(), + type: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AccountCreateContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AccountCreateContract(); + return TronWebProto.AccountCreateContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AccountCreateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAccountAddress(value); + break; + case 3: + var value = ( + /** @type {!TronWebProto.AccountType} */ + reader.readEnum() + ); + msg.setType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AccountCreateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AccountCreateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AccountCreateContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getAccountAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + f4 = message2.getType(); + if (f4 !== 0) { + writer.writeEnum(3, f4); + } + }; + TronWebProto.AccountCreateContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.AccountCreateContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.AccountCreateContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.AccountCreateContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.AccountCreateContract.prototype.getAccountAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.AccountCreateContract.prototype.getAccountAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getAccountAddress()) + ); + }; + TronWebProto.AccountCreateContract.prototype.getAccountAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getAccountAddress()) + ); + }; + TronWebProto.AccountCreateContract.prototype.setAccountAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.AccountCreateContract.prototype.getType = function() { + return ( + /** @type {!TronWebProto.AccountType} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.AccountCreateContract.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AccountUpdateContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AccountUpdateContract.toObject(opt_includeInstance, this); + }; + TronWebProto.AccountUpdateContract.toObject = function(includeInstance, msg) { + var obj = { + accountName: msg.getAccountName_asB64(), + ownerAddress: msg.getOwnerAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AccountUpdateContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AccountUpdateContract(); + return TronWebProto.AccountUpdateContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AccountUpdateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAccountName(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AccountUpdateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AccountUpdateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AccountUpdateContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAccountName_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + }; + TronWebProto.AccountUpdateContract.prototype.getAccountName = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.AccountUpdateContract.prototype.getAccountName_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getAccountName()) + ); + }; + TronWebProto.AccountUpdateContract.prototype.getAccountName_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getAccountName()) + ); + }; + TronWebProto.AccountUpdateContract.prototype.setAccountName = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.AccountUpdateContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.AccountUpdateContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.AccountUpdateContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.AccountUpdateContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.SetAccountIdContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.SetAccountIdContract.toObject(opt_includeInstance, this); + }; + TronWebProto.SetAccountIdContract.toObject = function(includeInstance, msg) { + var obj = { + accountId: msg.getAccountId_asB64(), + ownerAddress: msg.getOwnerAddress_asB64() + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.SetAccountIdContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.SetAccountIdContract(); + return TronWebProto.SetAccountIdContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.SetAccountIdContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setAccountId(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.SetAccountIdContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.SetAccountIdContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.SetAccountIdContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getAccountId_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(2, f4); + } + }; + TronWebProto.SetAccountIdContract.prototype.getAccountId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.SetAccountIdContract.prototype.getAccountId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getAccountId()) + ); + }; + TronWebProto.SetAccountIdContract.prototype.getAccountId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getAccountId()) + ); + }; + TronWebProto.SetAccountIdContract.prototype.setAccountId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.SetAccountIdContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.SetAccountIdContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.SetAccountIdContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.SetAccountIdContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.AccountPermissionUpdateContract.repeatedFields_ = [4]; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.AccountPermissionUpdateContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.AccountPermissionUpdateContract.toObject(opt_includeInstance, this); + }; + TronWebProto.AccountPermissionUpdateContract.toObject = function(includeInstance, msg) { + var f4, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + owner: (f4 = msg.getOwner()) && core_Tron_pb.Permission.toObject(includeInstance, f4), + witness: (f4 = msg.getWitness()) && core_Tron_pb.Permission.toObject(includeInstance, f4), + activesList: jspb.Message.toObjectList(msg.getActivesList(), core_Tron_pb.Permission.toObject, includeInstance) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.AccountPermissionUpdateContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.AccountPermissionUpdateContract(); + return TronWebProto.AccountPermissionUpdateContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.AccountPermissionUpdateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = new core_Tron_pb.Permission(); + reader.readMessage(value, core_Tron_pb.Permission.deserializeBinaryFromReader); + msg.setOwner(value); + break; + case 3: + var value = new core_Tron_pb.Permission(); + reader.readMessage(value, core_Tron_pb.Permission.deserializeBinaryFromReader); + msg.setWitness(value); + break; + case 4: + var value = new core_Tron_pb.Permission(); + reader.readMessage(value, core_Tron_pb.Permission.deserializeBinaryFromReader); + msg.addActives(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.AccountPermissionUpdateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.AccountPermissionUpdateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.AccountPermissionUpdateContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes(1, f4); + } + f4 = message2.getOwner(); + if (f4 != null) { + writer.writeMessage(2, f4, core_Tron_pb.Permission.serializeBinaryToWriter); + } + f4 = message2.getWitness(); + if (f4 != null) { + writer.writeMessage(3, f4, core_Tron_pb.Permission.serializeBinaryToWriter); + } + f4 = message2.getActivesList(); + if (f4.length > 0) { + writer.writeRepeatedMessage(4, f4, core_Tron_pb.Permission.serializeBinaryToWriter); + } + }; + TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64(this.getOwnerAddress()) + ); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8(this.getOwnerAddress()) + ); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.getOwner = function() { + return ( + /** @type{?TronWebProto.Permission} */ + jspb.Message.getWrapperField(this, core_Tron_pb.Permission, 2) + ); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.setOwner = function(value) { + return jspb.Message.setWrapperField(this, 2, value); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.clearOwner = function() { + return this.setOwner(void 0); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.hasOwner = function() { + return jspb.Message.getField(this, 2) != null; + }; + TronWebProto.AccountPermissionUpdateContract.prototype.getWitness = function() { + return ( + /** @type{?TronWebProto.Permission} */ + jspb.Message.getWrapperField(this, core_Tron_pb.Permission, 3) + ); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.setWitness = function(value) { + return jspb.Message.setWrapperField(this, 3, value); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.clearWitness = function() { + return this.setWitness(void 0); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.hasWitness = function() { + return jspb.Message.getField(this, 3) != null; + }; + TronWebProto.AccountPermissionUpdateContract.prototype.getActivesList = function() { + return ( + /** @type{!Array} */ + jspb.Message.getRepeatedWrapperField(this, core_Tron_pb.Permission, 4) + ); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.setActivesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.addActives = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, TronWebProto.Permission, opt_index); + }; + TronWebProto.AccountPermissionUpdateContract.prototype.clearActivesList = function() { + return this.setActivesList([]); + }; + goog.object.extend(exports, TronWebProto); +})(account_contract_pb); +var proposal_contract_pb = {}; +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + goog.exportSymbol("TronWebProto.ProposalApproveContract", null, global2); + goog.exportSymbol("TronWebProto.ProposalCreateContract", null, global2); + goog.exportSymbol("TronWebProto.ProposalDeleteContract", null, global2); + TronWebProto.ProposalApproveContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ProposalApproveContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ProposalApproveContract.displayName = "TronWebProto.ProposalApproveContract"; + } + TronWebProto.ProposalCreateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ProposalCreateContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ProposalCreateContract.displayName = "TronWebProto.ProposalCreateContract"; + } + TronWebProto.ProposalDeleteContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ProposalDeleteContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ProposalDeleteContract.displayName = "TronWebProto.ProposalDeleteContract"; + } + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ProposalApproveContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ProposalApproveContract.toObject(opt_includeInstance, this); + }; + TronWebProto.ProposalApproveContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + proposalId: jspb.Message.getFieldWithDefault(msg, 2, 0), + isAddApproval: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ProposalApproveContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ProposalApproveContract(); + return TronWebProto.ProposalApproveContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ProposalApproveContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setProposalId(value); + break; + case 3: + var value = ( + /** @type {boolean} */ + reader.readBool() + ); + msg.setIsAddApproval(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ProposalApproveContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ProposalApproveContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ProposalApproveContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getProposalId(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + f4 = message2.getIsAddApproval(); + if (f4) { + writer.writeBool( + 3, + f4 + ); + } + }; + TronWebProto.ProposalApproveContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.ProposalApproveContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ProposalApproveContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ProposalApproveContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.ProposalApproveContract.prototype.getProposalId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.ProposalApproveContract.prototype.setProposalId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.ProposalApproveContract.prototype.getIsAddApproval = function() { + return ( + /** @type {boolean} */ + jspb.Message.getBooleanFieldWithDefault(this, 3, false) + ); + }; + TronWebProto.ProposalApproveContract.prototype.setIsAddApproval = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ProposalCreateContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ProposalCreateContract.toObject(opt_includeInstance, this); + }; + TronWebProto.ProposalCreateContract.toObject = function(includeInstance, msg) { + var f4, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + parametersMap: (f4 = msg.getParametersMap()) ? f4.toObject(includeInstance, void 0) : [] + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ProposalCreateContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ProposalCreateContract(); + return TronWebProto.ProposalCreateContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ProposalCreateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = msg.getParametersMap(); + reader.readMessage(value, function(message2, reader2) { + jspb.Map.deserializeBinary(message2, reader2, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readInt64, null, 0, 0); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ProposalCreateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ProposalCreateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ProposalCreateContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getParametersMap(true); + if (f4 && f4.getLength() > 0) { + f4.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeInt64, jspb.BinaryWriter.prototype.writeInt64); + } + }; + TronWebProto.ProposalCreateContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.ProposalCreateContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ProposalCreateContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ProposalCreateContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.ProposalCreateContract.prototype.getParametersMap = function(opt_noLazyCreate) { + return ( + /** @type {!jspb.Map} */ + jspb.Message.getMapField( + this, + 2, + opt_noLazyCreate, + null + ) + ); + }; + TronWebProto.ProposalCreateContract.prototype.clearParametersMap = function() { + this.getParametersMap().clear(); + return this; + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ProposalDeleteContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ProposalDeleteContract.toObject(opt_includeInstance, this); + }; + TronWebProto.ProposalDeleteContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + proposalId: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ProposalDeleteContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ProposalDeleteContract(); + return TronWebProto.ProposalDeleteContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ProposalDeleteContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setProposalId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ProposalDeleteContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ProposalDeleteContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ProposalDeleteContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getProposalId(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + }; + TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ProposalDeleteContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.ProposalDeleteContract.prototype.getProposalId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.ProposalDeleteContract.prototype.setProposalId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + goog.object.extend(exports, TronWebProto); +})(proposal_contract_pb); +var exchange_contract_pb = {}; +(function(exports) { + var jspb = googleProtobuf; + var goog = jspb; + var global2 = typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof global2 !== "undefined" && global2 || typeof self !== "undefined" && self || (function() { + return this; + }).call(null) || Function("return this")(); + goog.exportSymbol("TronWebProto.ExchangeCreateContract", null, global2); + goog.exportSymbol("TronWebProto.ExchangeInjectContract", null, global2); + goog.exportSymbol("TronWebProto.ExchangeTransactionContract", null, global2); + goog.exportSymbol("TronWebProto.ExchangeWithdrawContract", null, global2); + TronWebProto.ExchangeCreateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ExchangeCreateContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ExchangeCreateContract.displayName = "TronWebProto.ExchangeCreateContract"; + } + TronWebProto.ExchangeInjectContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ExchangeInjectContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ExchangeInjectContract.displayName = "TronWebProto.ExchangeInjectContract"; + } + TronWebProto.ExchangeWithdrawContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ExchangeWithdrawContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ExchangeWithdrawContract.displayName = "TronWebProto.ExchangeWithdrawContract"; + } + TronWebProto.ExchangeTransactionContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); + }; + goog.inherits(TronWebProto.ExchangeTransactionContract, jspb.Message); + if (goog.DEBUG && !COMPILED) { + TronWebProto.ExchangeTransactionContract.displayName = "TronWebProto.ExchangeTransactionContract"; + } + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ExchangeCreateContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ExchangeCreateContract.toObject(opt_includeInstance, this); + }; + TronWebProto.ExchangeCreateContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + firstTokenId: msg.getFirstTokenId_asB64(), + firstTokenBalance: jspb.Message.getFieldWithDefault(msg, 3, 0), + secondTokenId: msg.getSecondTokenId_asB64(), + secondTokenBalance: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ExchangeCreateContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ExchangeCreateContract(); + return TronWebProto.ExchangeCreateContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ExchangeCreateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setFirstTokenId(value); + break; + case 3: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setFirstTokenBalance(value); + break; + case 4: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setSecondTokenId(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setSecondTokenBalance(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ExchangeCreateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ExchangeCreateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ExchangeCreateContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getFirstTokenId_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 2, + f4 + ); + } + f4 = message2.getFirstTokenBalance(); + if (f4 !== 0) { + writer.writeInt64( + 3, + f4 + ); + } + f4 = message2.getSecondTokenId_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 4, + f4 + ); + } + f4 = message2.getSecondTokenBalance(); + if (f4 !== 0) { + writer.writeInt64( + 5, + f4 + ); + } + }; + TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ExchangeCreateContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 2, "") + ); + }; + TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getFirstTokenId() + ) + ); + }; + TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getFirstTokenId() + ) + ); + }; + TronWebProto.ExchangeCreateContract.prototype.setFirstTokenId = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); + }; + TronWebProto.ExchangeCreateContract.prototype.getFirstTokenBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 3, 0) + ); + }; + TronWebProto.ExchangeCreateContract.prototype.setFirstTokenBalance = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); + }; + TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 4, "") + ); + }; + TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getSecondTokenId() + ) + ); + }; + TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getSecondTokenId() + ) + ); + }; + TronWebProto.ExchangeCreateContract.prototype.setSecondTokenId = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); + }; + TronWebProto.ExchangeCreateContract.prototype.getSecondTokenBalance = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.ExchangeCreateContract.prototype.setSecondTokenBalance = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ExchangeInjectContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ExchangeInjectContract.toObject(opt_includeInstance, this); + }; + TronWebProto.ExchangeInjectContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + exchangeId: jspb.Message.getFieldWithDefault(msg, 2, 0), + tokenId: msg.getTokenId_asB64(), + quant: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ExchangeInjectContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ExchangeInjectContract(); + return TronWebProto.ExchangeInjectContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ExchangeInjectContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExchangeId(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setTokenId(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setQuant(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ExchangeInjectContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ExchangeInjectContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ExchangeInjectContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getExchangeId(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + f4 = message2.getTokenId_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getQuant(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + }; + TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ExchangeInjectContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.ExchangeInjectContract.prototype.getExchangeId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.ExchangeInjectContract.prototype.setExchangeId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.ExchangeInjectContract.prototype.getTokenId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.ExchangeInjectContract.prototype.getTokenId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getTokenId() + ) + ); + }; + TronWebProto.ExchangeInjectContract.prototype.getTokenId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getTokenId() + ) + ); + }; + TronWebProto.ExchangeInjectContract.prototype.setTokenId = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.ExchangeInjectContract.prototype.getQuant = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.ExchangeInjectContract.prototype.setQuant = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ExchangeWithdrawContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ExchangeWithdrawContract.toObject(opt_includeInstance, this); + }; + TronWebProto.ExchangeWithdrawContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + exchangeId: jspb.Message.getFieldWithDefault(msg, 2, 0), + tokenId: msg.getTokenId_asB64(), + quant: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ExchangeWithdrawContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ExchangeWithdrawContract(); + return TronWebProto.ExchangeWithdrawContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ExchangeWithdrawContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExchangeId(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setTokenId(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setQuant(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ExchangeWithdrawContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ExchangeWithdrawContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ExchangeWithdrawContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getExchangeId(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + f4 = message2.getTokenId_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getQuant(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + }; + TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ExchangeWithdrawContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.ExchangeWithdrawContract.prototype.getExchangeId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.ExchangeWithdrawContract.prototype.setExchangeId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.ExchangeWithdrawContract.prototype.getTokenId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.ExchangeWithdrawContract.prototype.getTokenId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getTokenId() + ) + ); + }; + TronWebProto.ExchangeWithdrawContract.prototype.getTokenId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getTokenId() + ) + ); + }; + TronWebProto.ExchangeWithdrawContract.prototype.setTokenId = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.ExchangeWithdrawContract.prototype.getQuant = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.ExchangeWithdrawContract.prototype.setQuant = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + if (jspb.Message.GENERATE_TO_OBJECT) { + TronWebProto.ExchangeTransactionContract.prototype.toObject = function(opt_includeInstance) { + return TronWebProto.ExchangeTransactionContract.toObject(opt_includeInstance, this); + }; + TronWebProto.ExchangeTransactionContract.toObject = function(includeInstance, msg) { + var obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + exchangeId: jspb.Message.getFieldWithDefault(msg, 2, 0), + tokenId: msg.getTokenId_asB64(), + quant: jspb.Message.getFieldWithDefault(msg, 4, 0), + expected: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; + }; + } + TronWebProto.ExchangeTransactionContract.deserializeBinary = function(bytes2) { + var reader = new jspb.BinaryReader(bytes2); + var msg = new TronWebProto.ExchangeTransactionContract(); + return TronWebProto.ExchangeTransactionContract.deserializeBinaryFromReader(msg, reader); + }; + TronWebProto.ExchangeTransactionContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setOwnerAddress(value); + break; + case 2: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExchangeId(value); + break; + case 3: + var value = ( + /** @type {!Uint8Array} */ + reader.readBytes() + ); + msg.setTokenId(value); + break; + case 4: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setQuant(value); + break; + case 5: + var value = ( + /** @type {number} */ + reader.readInt64() + ); + msg.setExpected(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + TronWebProto.ExchangeTransactionContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + TronWebProto.ExchangeTransactionContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + TronWebProto.ExchangeTransactionContract.serializeBinaryToWriter = function(message2, writer) { + var f4 = void 0; + f4 = message2.getOwnerAddress_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 1, + f4 + ); + } + f4 = message2.getExchangeId(); + if (f4 !== 0) { + writer.writeInt64( + 2, + f4 + ); + } + f4 = message2.getTokenId_asU8(); + if (f4.length > 0) { + writer.writeBytes( + 3, + f4 + ); + } + f4 = message2.getQuant(); + if (f4 !== 0) { + writer.writeInt64( + 4, + f4 + ); + } + f4 = message2.getExpected(); + if (f4 !== 0) { + writer.writeInt64( + 5, + f4 + ); + } + }; + TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 1, "") + ); + }; + TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getOwnerAddress() + ) + ); + }; + TronWebProto.ExchangeTransactionContract.prototype.setOwnerAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); + }; + TronWebProto.ExchangeTransactionContract.prototype.getExchangeId = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 2, 0) + ); + }; + TronWebProto.ExchangeTransactionContract.prototype.setExchangeId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); + }; + TronWebProto.ExchangeTransactionContract.prototype.getTokenId = function() { + return ( + /** @type {!(string|Uint8Array)} */ + jspb.Message.getFieldWithDefault(this, 3, "") + ); + }; + TronWebProto.ExchangeTransactionContract.prototype.getTokenId_asB64 = function() { + return ( + /** @type {string} */ + jspb.Message.bytesAsB64( + this.getTokenId() + ) + ); + }; + TronWebProto.ExchangeTransactionContract.prototype.getTokenId_asU8 = function() { + return ( + /** @type {!Uint8Array} */ + jspb.Message.bytesAsU8( + this.getTokenId() + ) + ); + }; + TronWebProto.ExchangeTransactionContract.prototype.setTokenId = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); + }; + TronWebProto.ExchangeTransactionContract.prototype.getQuant = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 4, 0) + ); + }; + TronWebProto.ExchangeTransactionContract.prototype.setQuant = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); + }; + TronWebProto.ExchangeTransactionContract.prototype.getExpected = function() { + return ( + /** @type {number} */ + jspb.Message.getFieldWithDefault(this, 5, 0) + ); + }; + TronWebProto.ExchangeTransactionContract.prototype.setExpected = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); + }; + goog.object.extend(exports, TronWebProto); +})(exchange_contract_pb); +const { Transaction: Transaction2, Permission, Key } = globalThis.TronWebProto; +const { TransferContract, FreezeBalanceContract, UnfreezeBalanceContract, WithdrawBalanceContract, FreezeBalanceV2Contract, UnfreezeBalanceV2Contract, WithdrawExpireUnfreezeContract, DelegateResourceContract, UnDelegateResourceContract } = globalThis.TronWebProto; +const { TransferAssetContract, ParticipateAssetIssueContract, AssetIssueContract, UpdateAssetContract } = globalThis.TronWebProto; +const { TriggerSmartContract, ClearABIContract, UpdateEnergyLimitContract, UpdateSettingContract, CreateSmartContract, SmartContract } = globalThis.TronWebProto; +const { ResourceCode: ResourceCode$1 } = globalThis.TronWebProto; +const { WitnessCreateContract, VoteWitnessContract } = globalThis.TronWebProto; +const { UpdateBrokerageContract } = globalThis.TronWebProto; +const { AccountCreateContract, AccountUpdateContract, SetAccountIdContract, AccountPermissionUpdateContract } = globalThis.TronWebProto; +const { ProposalCreateContract, ProposalDeleteContract, ProposalApproveContract } = globalThis.TronWebProto; +const { ExchangeCreateContract, ExchangeInjectContract, ExchangeWithdrawContract, ExchangeTransactionContract } = globalThis.TronWebProto; +const fromHexString = (hexString) => { + if (!hexString || hexString.length === 0) + return new Uint8Array([]); + return new Uint8Array(TronWeb.address.toHex(hexString).match(/.{1,2}/g).map((byte2) => parseInt(byte2, 16))); +}; +const stringToUint8Array = (hexString) => { + if (!hexString || hexString.length === 0) + return new Uint8Array([]); + return new Uint8Array((isHex(hexString) ? hexString : TronWeb.toHex(hexString)).replace(/^0x/, "").match(/.{1,2}/g).map((byte2) => parseInt(byte2, 16))); +}; +const flexToUint8Array = (str, visible) => { + if (!visible) + return stringToUint8Array(str.replace(/^0x/, "")); + return stringToUint8Array(TronWeb.fromUtf8(str).replace(/^0x/, "")); +}; +const sha3$1 = (string2, prefix = true) => { + return (prefix ? "0x" : "") + keccak256(Buffer.from(string2, "utf-8")).toString().substring(2); +}; +const buildCommonTransaction = (message2, contractType, typeName, permissionId) => { + const anyValue = new google_protobuf_any_pb.Any(); + anyValue.pack(message2.serializeBinary(), "protocol." + typeName); + const contract = new Transaction2.Contract(); + contract.setType(contractType); + contract.setParameter(anyValue); + if (permissionId) { + contract.setPermissionId(permissionId); + } + const raw = new Transaction2.raw(); + raw.addContract(contract); + const transaction2 = new Transaction2(); + transaction2.setRawData(raw); + return transaction2; +}; +const buildTransferContract = (value, options) => { + const { to_address, owner_address, amount } = value; + const transferContract = new TransferContract(); + transferContract.setToAddress(fromHexString(to_address)); + transferContract.setOwnerAddress(fromHexString(owner_address)); + transferContract.setAmount(amount); + return buildCommonTransaction(transferContract, Transaction2.Contract.ContractType.TRANSFERCONTRACT, "TransferContract", options.Permission_id); +}; +const buildTransferAssetContract = (value, options) => { + const { to_address, owner_address, amount, asset_name } = value; + const transferContract = new TransferAssetContract(); + transferContract.setToAddress(fromHexString(to_address)); + transferContract.setOwnerAddress(fromHexString(owner_address)); + transferContract.setAssetName(flexToUint8Array(asset_name, options.visible)); + transferContract.setAmount(amount); + return buildCommonTransaction(transferContract, Transaction2.Contract.ContractType.TRANSFERASSETCONTRACT, "TransferAssetContract", options.Permission_id); +}; +const buildParticipateAssetIssueContract = (value, options) => { + const pbObj = new ParticipateAssetIssueContract(); + pbObj.setToAddress(fromHexString(value.to_address)); + pbObj.setOwnerAddress(fromHexString(value.owner_address)); + pbObj.setAssetName(flexToUint8Array(value.asset_name, options.visible)); + pbObj.setAmount(value.amount); + return buildCommonTransaction(pbObj, Transaction2.Contract.ContractType.PARTICIPATEASSETISSUECONTRACT, "ParticipateAssetIssueContract", options.Permission_id); +}; +const buildTriggerSmartContract = (value, options) => { + const triggerSmartContract = new TriggerSmartContract(); + const { owner_address, contract_address, parameter = "", function_selector, call_value, call_token_value, token_id, data } = value; + triggerSmartContract.setOwnerAddress(fromHexString(owner_address)); + triggerSmartContract.setContractAddress(fromHexString(contract_address)); + triggerSmartContract.setCallValue(call_value); + if (data) { + triggerSmartContract.setData(stringToUint8Array(data)); + } else if (function_selector) { + const contractData = sha3$1(function_selector).substring(2, 10) + parameter; + triggerSmartContract.setData(stringToUint8Array(contractData)); + } + if (token_id) { + triggerSmartContract.setTokenId(token_id); + } + if (call_token_value) { + triggerSmartContract.setCallTokenValue(call_token_value); + } + return buildCommonTransaction(triggerSmartContract, Transaction2.Contract.ContractType.TRIGGERSMARTCONTRACT, "TriggerSmartContract", options.Permission_id); +}; +const buildFreezeBalanceContract = (value, options) => { + const freezeBalanceContract = new FreezeBalanceContract(); + const { owner_address, frozen_balance, frozen_duration, resource, receiver_address } = value; + freezeBalanceContract.setOwnerAddress(fromHexString(owner_address)); + freezeBalanceContract.setFrozenBalance(frozen_balance); + freezeBalanceContract.setFrozenDuration(frozen_duration); + if (resource) { + freezeBalanceContract.setResource(ResourceCode$1[resource]); + } + if (receiver_address) { + freezeBalanceContract.setReceiverAddress(fromHexString(receiver_address)); + } + return buildCommonTransaction(freezeBalanceContract, Transaction2.Contract.ContractType.FREEZEBALANCECONTRACT, "FreezeBalanceContract", options.Permission_id); +}; +const buildUnfreezeBalanceContract = (value, options) => { + const unfreezeBalanceContract = new UnfreezeBalanceContract(); + const { owner_address, resource, receiver_address } = value; + unfreezeBalanceContract.setOwnerAddress(fromHexString(owner_address)); + if (resource) { + unfreezeBalanceContract.setResource(ResourceCode$1[resource]); + } + if (receiver_address) { + unfreezeBalanceContract.setReceiverAddress(fromHexString(receiver_address)); + } + return buildCommonTransaction(unfreezeBalanceContract, Transaction2.Contract.ContractType.UNFREEZEBALANCECONTRACT, "UnfreezeBalanceContract", options.Permission_id); +}; +const buildWithdrawBalanceContract = (value, options) => { + const withdrawbalanceContract = new WithdrawBalanceContract(); + const { owner_address } = value; + withdrawbalanceContract.setOwnerAddress(fromHexString(owner_address)); + return buildCommonTransaction(withdrawbalanceContract, Transaction2.Contract.ContractType.WITHDRAWBALANCECONTRACT, "WithdrawBalanceContract", options.Permission_id); +}; +const buildFreezeBalanceV2Contract = (value, options) => { + const freezeBalanceV2Contract = new FreezeBalanceV2Contract(); + const { owner_address, frozen_balance, resource } = value; + freezeBalanceV2Contract.setOwnerAddress(fromHexString(owner_address)); + freezeBalanceV2Contract.setFrozenBalance(frozen_balance); + freezeBalanceV2Contract.setResource(ResourceCode$1[resource]); + return buildCommonTransaction(freezeBalanceV2Contract, Transaction2.Contract.ContractType.FREEZEBALANCEV2CONTRACT, "FreezeBalanceV2Contract", options.Permission_id); +}; +const buildCancelFreezeBalanceV2Contract = (value, options) => { + const withdrawExpireUnfreeze = new WithdrawExpireUnfreezeContract(); + const { owner_address } = value; + withdrawExpireUnfreeze.setOwnerAddress(fromHexString(owner_address)); + return buildCommonTransaction(withdrawExpireUnfreeze, Transaction2.Contract.ContractType.CANCELALLUNFREEZEV2CONTRACT, "CancelAllUnfreezeV2Contract", options.Permission_id); +}; +const buildUnfreezeBalanceV2Contract = (value, options) => { + const unfreezeBalanceV2Contract = new UnfreezeBalanceV2Contract(); + const { owner_address, unfreeze_balance, resource } = value; + unfreezeBalanceV2Contract.setOwnerAddress(fromHexString(owner_address)); + unfreezeBalanceV2Contract.setUnfreezeBalance(unfreeze_balance); + unfreezeBalanceV2Contract.setResource(ResourceCode$1[resource]); + return buildCommonTransaction(unfreezeBalanceV2Contract, Transaction2.Contract.ContractType.UNFREEZEBALANCEV2CONTRACT, "UnfreezeBalanceV2Contract", options.Permission_id); +}; +const buildDelegateResourceContract = (value, options) => { + const delegateResourceContract = new DelegateResourceContract(); + const { owner_address, receiver_address, balance, resource, lock = false, lock_period } = value; + delegateResourceContract.setOwnerAddress(fromHexString(owner_address)); + delegateResourceContract.setBalance(balance); + delegateResourceContract.setResource(ResourceCode$1[resource]); + delegateResourceContract.setLock(lock); + delegateResourceContract.setLockPeriod(lock_period); + delegateResourceContract.setReceiverAddress(fromHexString(receiver_address)); + return buildCommonTransaction(delegateResourceContract, Transaction2.Contract.ContractType.DELEGATERESOURCECONTRACT, "DelegateResourceContract", options.Permission_id); +}; +const buildUnDelegateResourceContract = (value, options) => { + const unDelegateResourceContract = new UnDelegateResourceContract(); + const { owner_address, receiver_address, balance, resource } = value; + unDelegateResourceContract.setOwnerAddress(fromHexString(owner_address)); + unDelegateResourceContract.setBalance(balance); + unDelegateResourceContract.setResource(ResourceCode$1[resource]); + unDelegateResourceContract.setReceiverAddress(fromHexString(receiver_address)); + return buildCommonTransaction(unDelegateResourceContract, Transaction2.Contract.ContractType.UNDELEGATERESOURCECONTRACT, "UnDelegateResourceContract", options.Permission_id); +}; +const buildWithdrawExpireUnfreezeContract = (value, options) => { + const withdrawExpireUnfreeze = new WithdrawExpireUnfreezeContract(); + const { owner_address } = value; + withdrawExpireUnfreeze.setOwnerAddress(fromHexString(owner_address)); + return buildCommonTransaction(withdrawExpireUnfreeze, Transaction2.Contract.ContractType.WITHDRAWEXPIREUNFREEZECONTRACT, "WithdrawExpireUnfreezeContract", options.Permission_id); +}; +const buildCreateWitness = (value, options) => { + const createWitnessContract = new WitnessCreateContract(); + const { owner_address, url } = value; + createWitnessContract.setOwnerAddress(fromHexString(owner_address)); + createWitnessContract.setUrl(stringToUint8Array(url.replace(/^0x/, ""))); + return buildCommonTransaction(createWitnessContract, Transaction2.Contract.ContractType.WITNESSCREATECONTRACT, "WitnessCreateContract", options.Permission_id); +}; +const buildVoteWitnessAccount = (value, options) => { + const voteWitnessContract = new VoteWitnessContract(); + const { owner_address, votes } = value; + voteWitnessContract.setOwnerAddress(fromHexString(owner_address)); + votes.forEach((voteItem) => { + const vote = new VoteWitnessContract.Vote(); + const { vote_address, vote_count } = voteItem; + vote.setVoteAddress(fromHexString(vote_address)); + const numberOfVotes = parseInt(vote_count); + vote.setVoteCount(numberOfVotes); + voteWitnessContract.addVotes(vote); + }); + return buildCommonTransaction(voteWitnessContract, Transaction2.Contract.ContractType.VOTEWITNESSCONTRACT, "VoteWitnessContract", options.Permission_id); +}; +const buildCreateSmartContract = (value, options) => { + const params = (value == null ? void 0 : value.new_contract) ? { + ...{ + owner_address: value.owner_address, + call_token_value: value.call_token_value, + token_id: value.token_id + }, + ...value.new_contract + } : value; + const { owner_address, consume_user_resource_percent, origin_energy_limit, abi: abi2, bytecode = "", parameter = "", call_value, call_token_value, token_id, name: contracName } = params; + let { origin_address } = params; + const createSmartContract = new CreateSmartContract(); + createSmartContract.setOwnerAddress(fromHexString(owner_address)); + if (token_id) { + createSmartContract.setTokenId(token_id); + } + if (call_token_value) { + createSmartContract.setCallTokenValue(call_token_value); + } + const smartContractBuilder = new SmartContract(); + if (abi2) { + let abiJson; + if (typeof abi2 === "string") { + abiJson = JSON.parse(abi2); + } else { + abiJson = (abi2 == null ? void 0 : abi2.entrys) || []; + } + const abiBuilder = new SmartContract.ABI(); + const buildEntryParam = (data) => { + const param = new SmartContract.ABI.Entry.Param(); + const { indexed, name: name2, type: type2 } = data; + if (indexed === true) { + param.setIndexed(true); + } + param.setName(name2); + param.setType(type2); + return param; + }; + const entryBuilders = abiJson.map((entry) => { + const { anonymous, constant, name: name2, inputs, outputs, type: type2, payable, stateMutability } = entry; + const entryBuilder = new SmartContract.ABI.Entry(); + entryBuilder.setAnonymous(anonymous); + entryBuilder.setConstant(constant); + entryBuilder.setName(name2); + if (inputs) { + entryBuilder.setInputsList(inputs.map((input) => buildEntryParam(input))); + } + if (outputs) { + entryBuilder.setOutputsList(outputs.map((output2) => buildEntryParam(output2))); + } + if (type2) { + entryBuilder.setType(SmartContract.ABI.Entry.EntryType[type2.toUpperCase()]); + } + entryBuilder.setPayable(payable); + if (stateMutability) { + entryBuilder.setStatemutability(SmartContract.ABI.Entry.StateMutabilityType[stateMutability.toUpperCase()]); + } + return entryBuilder; + }); + abiBuilder.setEntrysList(entryBuilders); + smartContractBuilder.setAbi(abiBuilder); + } + if (call_value) { + smartContractBuilder.setCallValue(call_value); + } + smartContractBuilder.setConsumeUserResourcePercent(consume_user_resource_percent); + smartContractBuilder.setOriginEnergyLimit(origin_energy_limit); + if (!origin_address) { + origin_address = owner_address; + } + smartContractBuilder.setOriginAddress(fromHexString(origin_address)); + if (bytecode) { + const bytecodeParameter = bytecode.replace(/^0x/, "") + parameter.replace(/^0x/, ""); + smartContractBuilder.setBytecode(stringToUint8Array(bytecodeParameter)); + } + smartContractBuilder.setName(contracName); + createSmartContract.setNewContract(smartContractBuilder); + return buildCommonTransaction(createSmartContract, Transaction2.Contract.ContractType.CREATESMARTCONTRACT, "CreateSmartContract", options.Permission_id); +}; +const buildClearABIContract = (value, options) => { + const { contract_address, owner_address } = value; + const clearABIContract = new ClearABIContract(); + clearABIContract.setOwnerAddress(fromHexString(owner_address)); + clearABIContract.setContractAddress(fromHexString(contract_address)); + return buildCommonTransaction(clearABIContract, Transaction2.Contract.ContractType.CLEARABICONTRACT, "ClearABIContract", options.Permission_id); +}; +const buildUpdateBrokerageContract = (value, options) => { + const { brokerage, owner_address } = value; + const updateBrokerageContract = new UpdateBrokerageContract(); + updateBrokerageContract.setOwnerAddress(fromHexString(owner_address)); + updateBrokerageContract.setBrokerage(brokerage); + return buildCommonTransaction(updateBrokerageContract, Transaction2.Contract.ContractType.UPDATEBROKERAGECONTRACT, "UpdateBrokerageContract", options.Permission_id); +}; +const buildAssetIssueContract = (value, options) => { + const { owner_address, name: name2, abbr, description: description2, url, total_supply, trx_num, num, start_time, end_time, precision, free_asset_net_limit, public_free_asset_net_limit, public_free_asset_net_usage = 0, public_latest_free_net_time = 0, vote_score = 0, frozen_supply } = value; + const assetIssueContract = new AssetIssueContract(); + assetIssueContract.setOwnerAddress(fromHexString(owner_address)); + if (name2) { + assetIssueContract.setName(stringToUint8Array(name2.replace(/^0x/, ""))); + } + if (abbr) { + assetIssueContract.setAbbr(stringToUint8Array(abbr.replace(/^0x/, ""))); + } + assetIssueContract.setTotalSupply(total_supply); + assetIssueContract.setNum(num); + assetIssueContract.setEndTime(end_time); + assetIssueContract.setStartTime(start_time); + assetIssueContract.setTrxNum(trx_num); + assetIssueContract.setVoteScore(vote_score); + if (precision) { + assetIssueContract.setPrecision(precision); + } + if (public_latest_free_net_time) { + assetIssueContract.setPublicLatestFreeNetTime(public_latest_free_net_time); + } + if (description2) { + assetIssueContract.setDescription(stringToUint8Array(description2.replace(/^0x/, ""))); + } + if (url) { + assetIssueContract.setUrl(stringToUint8Array(url.replace(/^0x/, ""))); + } + assetIssueContract.setPublicFreeAssetNetUsage(public_free_asset_net_usage); + assetIssueContract.setFreeAssetNetLimit(free_asset_net_limit); + assetIssueContract.setPublicFreeAssetNetLimit(public_free_asset_net_limit); + if (frozen_supply) { + const frozenSupplyContract = new AssetIssueContract.FrozenSupply(); + frozenSupplyContract.setFrozenAmount(frozen_supply.length ? frozen_supply[0].frozen_amount : frozen_supply.frozen_amount); + frozenSupplyContract.setFrozenDays(frozen_supply.length ? frozen_supply[0].frozen_days : frozen_supply.frozen_days); + assetIssueContract.addFrozenSupply(frozenSupplyContract); + } + return buildCommonTransaction(assetIssueContract, Transaction2.Contract.ContractType.ASSETISSUECONTRACT, "AssetIssueContract", options.Permission_id); +}; +const buildAccountCreateContract = (value, options) => { + const accountCreateContract = new AccountCreateContract(); + const { account_address, owner_address } = value; + accountCreateContract.setOwnerAddress(fromHexString(owner_address)); + accountCreateContract.setAccountAddress(fromHexString(account_address.replace(/^0x/, ""))); + return buildCommonTransaction(accountCreateContract, Transaction2.Contract.ContractType.ACCOUNTCREATECONTRACT, "AccountCreateContract", options.Permission_id); +}; +const buildAccountUpdateContract = (value, options) => { + const accountUpdateContract = new AccountUpdateContract(); + const { account_name, owner_address } = value; + accountUpdateContract.setOwnerAddress(fromHexString(owner_address)); + accountUpdateContract.setAccountName(stringToUint8Array(account_name.replace(/^0x/, ""))); + return buildCommonTransaction(accountUpdateContract, Transaction2.Contract.ContractType.ACCOUNTUPDATECONTRACT, "AccountUpdateContract", options.Permission_id); +}; +const buildSetAccountIdContract = (value, options) => { + const setAccountIdContract = new SetAccountIdContract(); + const { account_id, owner_address } = value; + setAccountIdContract.setOwnerAddress(fromHexString(owner_address)); + setAccountIdContract.setAccountId(stringToUint8Array(account_id.replace(/^0x/, ""))); + return buildCommonTransaction(setAccountIdContract, Transaction2.Contract.ContractType.SETACCOUNTIDCONTRACT, "SetAccountIdContract", options.Permission_id); +}; +const buildProposalCreateContract = (value, options) => { + const proposalCreateContract = new ProposalCreateContract(); + const { owner_address, parameters } = value; + proposalCreateContract.setOwnerAddress(fromHexString(owner_address)); + parameters.forEach((parameter) => { + proposalCreateContract.getParametersMap().set(parameter.key, parameter.value); + }); + return buildCommonTransaction(proposalCreateContract, Transaction2.Contract.ContractType.PROPOSALCREATECONTRACT, "ProposalCreateContract", options.Permission_id); +}; +const buildProposalDeleteContract = (value, options) => { + const proposalDeleteContract = new ProposalDeleteContract(); + const { owner_address, proposal_id } = value; + proposalDeleteContract.setOwnerAddress(fromHexString(owner_address)); + proposalDeleteContract.setProposalId(proposal_id); + return buildCommonTransaction(proposalDeleteContract, Transaction2.Contract.ContractType.PROPOSALDELETECONTRACT, "ProposalDeleteContract", options.Permission_id); +}; +const buildVoteProposalContract = (value, options) => { + const proposalVoteContract = new ProposalApproveContract(); + const { owner_address, proposal_id, is_add_approval } = value; + proposalVoteContract.setOwnerAddress(fromHexString(owner_address)); + proposalVoteContract.setProposalId(proposal_id); + proposalVoteContract.setIsAddApproval(is_add_approval); + return buildCommonTransaction(proposalVoteContract, Transaction2.Contract.ContractType.PROPOSALAPPROVECONTRACT, "ProposalApproveContract", options.Permission_id); +}; +const buildExchangeCreateContract = (value, options) => { + const exchangeCreateContract = new ExchangeCreateContract(); + const { owner_address, first_token_id, first_token_balance, second_token_id, second_token_balance } = value; + exchangeCreateContract.setOwnerAddress(fromHexString(owner_address)); + exchangeCreateContract.setFirstTokenId(flexToUint8Array(first_token_id, options.visible)); + exchangeCreateContract.setFirstTokenBalance(first_token_balance); + exchangeCreateContract.setSecondTokenId(flexToUint8Array(second_token_id, options.visible)); + exchangeCreateContract.setSecondTokenBalance(second_token_balance); + return buildCommonTransaction(exchangeCreateContract, Transaction2.Contract.ContractType.EXCHANGECREATECONTRACT, "ExchangeCreateContract", options.Permission_id); +}; +const buildExchangeInjectContract = (value, options) => { + const exchangeInjectContract = new ExchangeInjectContract(); + const { owner_address, exchange_id, token_id, quant } = value; + exchangeInjectContract.setOwnerAddress(fromHexString(owner_address)); + exchangeInjectContract.setExchangeId(exchange_id); + exchangeInjectContract.setTokenId(flexToUint8Array(token_id, options.visible)); + exchangeInjectContract.setQuant(quant); + return buildCommonTransaction(exchangeInjectContract, Transaction2.Contract.ContractType.EXCHANGEINJECTCONTRACT, "ExchangeInjectContract", options.Permission_id); +}; +const buildExchangeWithdrawContract = (value, options) => { + const exchangeWithdrawContract = new ExchangeWithdrawContract(); + const { owner_address, exchange_id, token_id, quant } = value; + exchangeWithdrawContract.setOwnerAddress(fromHexString(owner_address)); + exchangeWithdrawContract.setExchangeId(exchange_id); + exchangeWithdrawContract.setTokenId(flexToUint8Array(token_id, options.visible)); + exchangeWithdrawContract.setQuant(quant); + return buildCommonTransaction(exchangeWithdrawContract, Transaction2.Contract.ContractType.EXCHANGEWITHDRAWCONTRACT, "ExchangeWithdrawContract", options.Permission_id); +}; +const buildExchangeTransactionContract = (value, options) => { + const exchangeTransactionContract = new ExchangeTransactionContract(); + const { owner_address, exchange_id, token_id, quant, expected } = value; + exchangeTransactionContract.setOwnerAddress(fromHexString(owner_address)); + exchangeTransactionContract.setExchangeId(exchange_id); + exchangeTransactionContract.setTokenId(flexToUint8Array(token_id, options.visible)); + exchangeTransactionContract.setQuant(quant); + exchangeTransactionContract.setExpected(expected); + return buildCommonTransaction(exchangeTransactionContract, Transaction2.Contract.ContractType.EXCHANGETRANSACTIONCONTRACT, "ExchangeTransactionContract", options.Permission_id); +}; +const buildUpdateSettingContract = (value, options) => { + const updateSettingContract = new UpdateSettingContract(); + const { owner_address, contract_address, consume_user_resource_percent } = value; + updateSettingContract.setOwnerAddress(fromHexString(owner_address)); + updateSettingContract.setContractAddress(fromHexString(contract_address)); + updateSettingContract.setConsumeUserResourcePercent(consume_user_resource_percent); + return buildCommonTransaction(updateSettingContract, Transaction2.Contract.ContractType.UPDATESETTINGCONTRACT, "UpdateSettingContract", options.Permission_id); +}; +const buildUpdateEnergyLimitContract = (value, options) => { + const updateEnergyLimitContract = new UpdateEnergyLimitContract(); + const { owner_address, contract_address, origin_energy_limit } = value; + updateEnergyLimitContract.setOwnerAddress(fromHexString(owner_address)); + updateEnergyLimitContract.setContractAddress(fromHexString(contract_address)); + updateEnergyLimitContract.setOriginEnergyLimit(origin_energy_limit); + return buildCommonTransaction(updateEnergyLimitContract, Transaction2.Contract.ContractType.UPDATEENERGYLIMITCONTRACT, "UpdateEnergyLimitContract", options.Permission_id); +}; +const buildAccountPermissionUpdateContract = (value, options) => { + const accountPermissionUpdateContract = new AccountPermissionUpdateContract(); + const { owner_address, owner, witness, actives } = value; + accountPermissionUpdateContract.setOwnerAddress(fromHexString(owner_address)); + const getType = (type2) => { + if (isNaN(type2)) + return type2 === "Active" ? 2 : type2 === "Witness" ? 1 : 0; + return type2; + }; + const buildPermission = (data) => { + const permission = new Permission(); + const { type: type2, id: id2, permission_name, threshold, parentId, operations, keys: keys2 } = data; + permission.setType(getType(type2)); + permission.setId(id2); + permission.setPermissionName(permission_name); + permission.setThreshold(threshold); + if (parentId) { + permission.setParentId(parentId); + } + if (operations) { + permission.setOperations(stringToUint8Array(operations)); + } + if (keys2) { + permission.setKeysList(keys2.map((key2) => { + const keyBuilder = new Key(); + keyBuilder.setAddress(fromHexString(key2.address)); + keyBuilder.setWeight(key2.weight); + return keyBuilder; + })); + } + return permission; + }; + if (owner) { + accountPermissionUpdateContract.setOwner(buildPermission(owner)); + } + if (witness) { + accountPermissionUpdateContract.setWitness(buildPermission(witness)); + } + if (actives) { + if (Array.isArray(actives)) { + accountPermissionUpdateContract.setActivesList(actives.map((active) => buildPermission(active))); + } else { + accountPermissionUpdateContract.setActivesList([buildPermission(actives)]); + } + } + return buildCommonTransaction(accountPermissionUpdateContract, Transaction2.Contract.ContractType.ACCOUNTPERMISSIONUPDATECONTRACT, "AccountPermissionUpdateContract", options.Permission_id); +}; +const buildUpdateAssetContract = (value, options) => { + const updateAssetContract = new UpdateAssetContract(); + const { owner_address, description: description2, url, new_limit, new_public_limit } = value; + updateAssetContract.setOwnerAddress(fromHexString(owner_address)); + if (description2) { + updateAssetContract.setDescription(stringToUint8Array(description2.replace(/^0x/, ""))); + } + if (url) { + updateAssetContract.setUrl(stringToUint8Array(url.replace(/^0x/, ""))); + } + if (new_limit) { + updateAssetContract.setNewLimit(new_limit); + } + if (new_public_limit) { + updateAssetContract.setNewPublicLimit(new_public_limit); + } + return buildCommonTransaction(updateAssetContract, Transaction2.Contract.ContractType.UPDATEASSETCONTRACT, "UpdateAssetContract", options.Permission_id); +}; +const contractJsonToProtobuf = (contract, value, options) => { + switch (contract.type) { + case "TransferContract": + return buildTransferContract(value, options); + case "TransferAssetContract": + return buildTransferAssetContract(value, options); + case "ParticipateAssetIssueContract": + return buildParticipateAssetIssueContract(value, options); + case "TriggerSmartContract": + return buildTriggerSmartContract(value, options); + case "FreezeBalanceContract": + return buildFreezeBalanceContract(value, options); + case "UnfreezeBalanceContract": + return buildUnfreezeBalanceContract(value, options); + case "WithdrawBalanceContract": + return buildWithdrawBalanceContract(value, options); + case "FreezeBalanceV2Contract": + return buildFreezeBalanceV2Contract(value, options); + case "CancelAllUnfreezeV2Contract": + return buildCancelFreezeBalanceV2Contract(value, options); + case "UnfreezeBalanceV2Contract": + return buildUnfreezeBalanceV2Contract(value, options); + case "DelegateResourceContract": + return buildDelegateResourceContract(value, options); + case "UnDelegateResourceContract": + return buildUnDelegateResourceContract(value, options); + case "WithdrawExpireUnfreezeContract": + return buildWithdrawExpireUnfreezeContract(value, options); + case "WitnessCreateContract": + return buildCreateWitness(value, options); + case "VoteWitnessContract": + return buildVoteWitnessAccount(value, options); + case "CreateSmartContract": + return buildCreateSmartContract(value, options); + case "ClearABIContract": + return buildClearABIContract(value, options); + case "UpdateBrokerageContract": + return buildUpdateBrokerageContract(value, options); + case "AssetIssueContract": + return buildAssetIssueContract(value, options); + case "AccountCreateContract": + return buildAccountCreateContract(value, options); + case "AccountUpdateContract": + return buildAccountUpdateContract(value, options); + case "SetAccountIdContract": + return buildSetAccountIdContract(value, options); + case "ProposalCreateContract": + return buildProposalCreateContract(value, options); + case "ProposalDeleteContract": + return buildProposalDeleteContract(value, options); + case "ProposalApproveContract": + return buildVoteProposalContract(value, options); + case "ExchangeCreateContract": + return buildExchangeCreateContract(value, options); + case "ExchangeInjectContract": + return buildExchangeInjectContract(value, options); + case "ExchangeWithdrawContract": + return buildExchangeWithdrawContract(value, options); + case "ExchangeTransactionContract": + return buildExchangeTransactionContract(value, options); + case "UpdateSettingContract": + return buildUpdateSettingContract(value, options); + case "UpdateEnergyLimitContract": + return buildUpdateEnergyLimitContract(value, options); + case "AccountPermissionUpdateContract": + return buildAccountPermissionUpdateContract(value, options); + case "UpdateAssetContract": + return buildUpdateAssetContract(value, options); + } +}; +const txJsonToPb = (transaction2) => { + const rawData = transaction2["raw_data"]; + const contractJson = rawData.contract[0]; + const data = contractJson.parameter.value; + const options = { Permission_id: contractJson.Permission_id, visible: transaction2.visible }; + const transactionObj = contractJsonToProtobuf(contractJson, data, options); + const rawDataObj = transactionObj.getRawData(); + rawDataObj.setRefBlockBytes(stringToUint8Array(rawData.ref_block_bytes)); + rawDataObj.setRefBlockHash(stringToUint8Array(rawData.ref_block_hash)); + if (rawData.data) { + rawDataObj.setData(stringToUint8Array(rawData.data)); + } + if (rawData.fee_limit) { + rawDataObj.setFeeLimit(rawData.fee_limit); + } + if (rawData.expiration) { + rawDataObj.setExpiration(rawData.expiration); + } + if (rawData.timestamp) { + rawDataObj.setTimestamp(rawData.timestamp); + } + transactionObj.setRawData(rawDataObj); + return transactionObj; +}; +const txJsonToPbWithArgs = (transaction2, args = {}, options = {}) => { + const rawData = transaction2["raw_data"]; + const contractJson = rawData.contract[0]; + const transactionObj = contractJsonToProtobuf(contractJson, args, { + Permission_id: args == null ? void 0 : args.Permission_id + }); + const rawDataObj = transactionObj.getRawData(); + rawDataObj.setRefBlockBytes(stringToUint8Array(rawData.ref_block_bytes)); + rawDataObj.setRefBlockHash(stringToUint8Array(rawData.ref_block_hash)); + if (options.data) { + rawDataObj.setData(stringToUint8Array(options.data.replace(/^0x/, ""))); + } + if (options.fee_limit || args.fee_limit) { + rawDataObj.setFeeLimit(options.fee_limit || args.fee_limit); + } + if (rawData.expiration) { + rawDataObj.setExpiration(rawData.expiration); + } + if (rawData.timestamp) { + rawDataObj.setTimestamp(rawData.timestamp); + } + transactionObj.setRawData(rawDataObj); + return transactionObj; +}; +const compareTransaction = (transaction2, transactionPb) => { + const rawDataBytes = transactionPb.getRawData().serializeBinary(); + const rawDataHex = byteArray2hexStr(rawDataBytes); + const txID = sha256(rawDataBytes); + return rawDataHex.toLowerCase() === transaction2.raw_data_hex.toLowerCase() && txID.replace(/^0x/, "").toLowerCase() === transaction2.txID.replace(/^0x/, "").toLowerCase(); +}; +const txPbToRawDataHex = (pb2) => { + return byteArray2hexStr(pb2.getRawData().serializeBinary()); +}; +const txCheck = (transaction2) => { + const transactionPb = txJsonToPb(transaction2); + return compareTransaction(transaction2, transactionPb); +}; +const txCheckWithArgs = (transaction2, args, options) => { + const transactionPb = txJsonToPbWithArgs(transaction2, args, options); + return compareTransaction(transaction2, transactionPb); +}; +const txPbToTxID = (transactionPb) => { + const rawDataBytes = transactionPb.getRawData().serializeBinary(); + const txID = sha256(rawDataBytes); + return txID; +}; +const transaction = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + txCheck, + txCheckWithArgs, + txJsonToPb, + txJsonToPbWithArgs, + txPbToRawDataHex, + txPbToTxID +}, Symbol.toStringTag, { value: "Module" })); +function fromUtf8(value) { + return TronWeb.fromUtf8(value).replace(/^0x/, ""); +} +function deepCopyJson(json) { + return JSON.parse(JSON.stringify(json)); +} +function resultManager(transaction2, data, options) { + if (transaction2.Error) + throw new Error(transaction2.Error); + if (transaction2.result && transaction2.result.message) { + throw new Error(TronWeb.toUtf8(transaction2.result.message)); + } + const authResult = txCheckWithArgs(transaction2, data, options); + if (authResult) { + return transaction2; + } + throw new Error("Invalid transaction"); +} +function resultManagerTriggerSmartContract(transaction2, data, options) { + if (transaction2.Error) + throw new Error(transaction2.Error); + if (transaction2.result && transaction2.result.message) { + throw new Error(TronWeb.toUtf8(transaction2.result.message)); + } + if (!(options._isConstant || options.estimateEnergy)) { + const authResult = txCheckWithArgs(transaction2.transaction, data, options); + if (authResult) { + return transaction2; + } + throw new Error("Invalid transaction"); + } + return transaction2; +} +function genContractAddress(ownerAddress, txID) { + return "41" + keccak256(Buffer.from(txID + ownerAddress, "hex")).toString().substring(2).slice(24); +} +function getHeaderInfo(node2) { + return node2.request("wallet/getblock", { detail: false }, "post").then((data) => { + return { + ref_block_bytes: data.block_header.raw_data.number.toString(16).slice(-4).padStart(4, "0"), + ref_block_hash: data.blockID.slice(16, 32), + expiration: data.block_header.raw_data.timestamp + 60 * 1e3, + timestamp: data.block_header.raw_data.timestamp + }; + }); +} +function checkBlockHeader(options = {}) { + if (typeof options["ref_block_bytes"] === "undefined" && typeof options["ref_block_hash"] === "undefined" && typeof options["expiration"] === "undefined" && typeof options["timestamp"] === "undefined") { + return false; + } + if (typeof options["ref_block_bytes"] !== "string") { + throw new Error("Invalid ref_block_bytes provided."); + } + if (typeof options["ref_block_hash"] !== "string") { + throw new Error("Invalid ref_block_hash provided."); + } + if (typeof options["expiration"] !== "number") { + throw new Error("Invalid expiration provided."); + } + if (typeof options["timestamp"] !== "number") { + throw new Error("Invalid timestamp provided."); + } + return true; +} +async function createTransaction(tronWeb, type2, value, Permission_id, options = {}) { + const tx = { + visible: false, + txID: "", + raw_data_hex: "", + raw_data: { + contract: [ + { + parameter: { + value, + type_url: `type.googleapis.com/protocol.${type2}` + }, + type: type2 + } ], - os: [ - [ - // Windows - /microsoft (windows) (vista|xp)/i - // Windows (iTunes) - ], - [NAME, VERSION2], - [ - /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i - // Windows Phone - ], - [NAME, [VERSION2, strMapper, windowsVersionMap]], - [ - /windows nt 6\.2; (arm)/i, - // Windows RT - /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i, - /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i - ], - [[VERSION2, strMapper, windowsVersionMap], [NAME, "Windows"]], - [ - // iOS/macOS - /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, - // iOS - /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, - /cfnetwork\/.+darwin/i - ], - [[VERSION2, /_/g, "."], [NAME, "iOS"]], - [ - /(mac os x) ?([\w\. ]*)/i, - /(macintosh|mac_powerpc\b)(?!.+haiku)/i - // Mac OS - ], - [[NAME, MAC_OS], [VERSION2, /_/g, "."]], - [ - // Mobile OSes - /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i - // Android-x86/HarmonyOS - ], - [VERSION2, NAME], - [ - // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS - /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, - /(blackberry)\w*\/([\w\.]*)/i, - // Blackberry - /(tizen|kaios)[\/ ]([\w\.]+)/i, - // Tizen/KaiOS - /\((series40);/i - // Series 40 - ], - [NAME, VERSION2], - [ - /\(bb(10);/i - // BlackBerry 10 - ], - [VERSION2, [NAME, BLACKBERRY]], - [ - /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i - // Symbian - ], - [VERSION2, [NAME, "Symbian"]], - [ - /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i - // Firefox OS - ], - [VERSION2, [NAME, FIREFOX + " OS"]], - [ - /web0s;.+rt(tv)/i, - /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i - // WebOS - ], - [VERSION2, [NAME, "webOS"]], - [ - /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i - // watchOS - ], - [VERSION2, [NAME, "watchOS"]], - [ - // Google Chromecast - /crkey\/([\d\.]+)/i - // Google Chromecast - ], - [VERSION2, [NAME, CHROME + "cast"]], - [ - /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i - // Chromium OS - ], - [[NAME, CHROMIUM_OS], VERSION2], - [ - // Smart TVs - /panasonic;(viera)/i, - // Panasonic Viera - /(netrange)mmh/i, - // Netrange - /(nettv)\/(\d+\.[\w\.]+)/i, - // NetTV - // Console - /(nintendo|playstation) ([wids345portablevuch]+)/i, - // Nintendo/Playstation - /(xbox); +xbox ([^\);]+)/i, - // Microsoft Xbox (360, One, X, S, Series X, Series S) - // Other - /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, - // Joli/Palm - /(mint)[\/\(\) ]?(\w*)/i, - // Mint - /(mageia|vectorlinux)[; ]/i, - // Mageia/VectorLinux - /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, - // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire - /(hurd|linux) ?([\w\.]*)/i, - // Hurd/Linux - /(gnu) ?([\w\.]*)/i, - // GNU - /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, - // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly - /(haiku) (\w+)/i - // Haiku - ], - [NAME, VERSION2], - [ - /(sunos) ?([\w\.\d]*)/i - // Solaris - ], - [[NAME, "Solaris"], VERSION2], - [ - /((?:open)?solaris)[-\/ ]?([\w\.]*)/i, - // Solaris - /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, - // AIX - /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, - // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS - /(unix) ?([\w\.]*)/i - // UNIX - ], - [NAME, VERSION2] + ...checkBlockHeader(options) ? {} : await getHeaderInfo(tronWeb.fullNode), + ...options + } + }; + if (Permission_id) { + tx.raw_data.contract[0].Permission_id = Permission_id; + } + const pb2 = txJsonToPb(tx); + tx.txID = txPbToTxID(pb2).replace(/^0x/, ""); + tx.raw_data_hex = txPbToRawDataHex(pb2).toLowerCase(); + return tx; +} +function getTransactionOptions(options = {}) { + const ret = {}; + if (checkBlockHeader(options.blockHeader)) { + ret["ref_block_bytes"] = options.blockHeader["ref_block_bytes"]; + ret["ref_block_hash"] = options.blockHeader["ref_block_hash"]; + ret["expiration"] = options.blockHeader["expiration"]; + ret["timestamp"] = options.blockHeader["timestamp"]; + } + return ret; +} +class TransactionBuilder { + constructor(tronWeb) { + __publicField(this, "tronWeb"); + __publicField(this, "validator"); + if (!tronWeb || !(tronWeb instanceof TronWeb)) { + throw new Error("Expected instance of TronWeb"); + } + this.tronWeb = tronWeb; + this.validator = new Validator(); + } + async sendTrx(to2, amount = 0, from2 = this.tronWeb.defaultAddress.hex, options = {}) { + amount = parseInt(amount); + this.validator.notValid([ + { + name: "recipient", + type: "address", + value: to2 + }, + { + name: "origin", + type: "address", + value: from2 + }, + { + names: ["recipient", "origin"], + type: "notEqual", + msg: "Cannot transfer TRX to the same account" + }, + { + name: "amount", + type: "integer", + gt: 0, + value: amount + } + ]); + const data = { + to_address: toHex$1(to2), + owner_address: toHex$1(from2), + amount + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.TransferContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async sendToken(to2, amount = 0, tokenId, from2 = this.tronWeb.defaultAddress.hex, options = {}) { + amount = parseInt(amount); + this.validator.notValid([ + { + name: "recipient", + type: "address", + value: to2 + }, + { + name: "origin", + type: "address", + value: from2 + }, + { + names: ["recipient", "origin"], + type: "notEqual", + msg: "Cannot transfer tokens to the same account" + }, + { + name: "amount", + type: "integer", + gt: 0, + value: amount + }, + { + name: "token ID", + type: "tokenId", + value: tokenId + } + ]); + const data = { + to_address: toHex$1(to2), + owner_address: toHex$1(from2), + asset_name: fromUtf8(tokenId), + amount + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.TransferAssetContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async purchaseToken(issuerAddress, tokenId, amount = 0, buyer = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "buyer", + type: "address", + value: buyer + }, + { + name: "issuer", + type: "address", + value: issuerAddress + }, + { + names: ["buyer", "issuer"], + type: "notEqual", + msg: "Cannot purchase tokens from same account" + }, + { + name: "amount", + type: "integer", + gt: 0, + value: amount + }, + { + name: "token ID", + type: "tokenId", + value: tokenId + } + ]); + const data = { + to_address: toHex$1(issuerAddress), + owner_address: toHex$1(buyer), + asset_name: fromUtf8(tokenId), + amount: parseInt(amount) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ParticipateAssetIssueContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async freezeBalance(amount = 0, duration = 3, resource = "BANDWIDTH", ownerAddress = this.tronWeb.defaultAddress.hex, receiverAddress, options = {}) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: ownerAddress + }, + { + name: "receiver", + type: "address", + value: receiverAddress, + optional: true + }, + { + name: "amount", + type: "integer", + gt: 0, + value: amount + }, + { + name: "duration", + type: "integer", + gte: 3, + value: duration + }, + { + name: "resource", + type: "resource", + value: resource, + msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' + } + ]); + const data = { + owner_address: toHex$1(ownerAddress), + frozen_balance: parseInt(amount), + frozen_duration: parseInt(String(duration)) + }; + if (resource !== "BANDWIDTH") { + data.resource = resource; + } + if (isNotNullOrUndefined(receiverAddress) && toHex$1(receiverAddress) !== toHex$1(ownerAddress)) { + data.receiver_address = toHex$1(receiverAddress); + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.FreezeBalanceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async unfreezeBalance(resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, receiverAddress, options = {}) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + }, + { + name: "receiver", + type: "address", + value: receiverAddress, + optional: true + }, + { + name: "resource", + type: "resource", + value: resource, + msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' + } + ]); + const data = { + owner_address: toHex$1(address2) + }; + if (resource !== "BANDWIDTH") { + data.resource = resource; + } + if (isNotNullOrUndefined(receiverAddress) && toHex$1(receiverAddress) !== toHex$1(address2)) { + data.receiver_address = toHex$1(receiverAddress); + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.UnfreezeBalanceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async freezeBalanceV2(amount = 0, resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + }, + { + name: "amount", + type: "integer", + gt: 0, + value: amount + }, + { + name: "resource", + type: "resource", + value: resource, + msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' + } + ]); + const data = { + owner_address: toHex$1(address2), + frozen_balance: parseInt(amount) + }; + if (resource !== "BANDWIDTH") { + data.resource = resource; + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.FreezeBalanceV2Contract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async unfreezeBalanceV2(amount = 0, resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + }, + { + name: "amount", + type: "integer", + gt: 0, + value: amount + }, + { + name: "resource", + type: "resource", + value: resource, + msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' + } + ]); + const data = { + owner_address: toHex$1(address2), + unfreeze_balance: parseInt(amount) + }; + if (resource !== "BANDWIDTH") { + data.resource = resource; + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.UnfreezeBalanceV2Contract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async cancelUnfreezeBalanceV2(address2 = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + } + ]); + const data = { + owner_address: toHex$1(address2) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.CancelAllUnfreezeV2Contract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async delegateResource(amount = 0, receiverAddress, resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, lock = false, lockPeriod, options = {}) { + this.validator.notValid([ + { + name: "amount", + type: "integer", + gt: 0, + value: amount + }, + { + name: "resource", + type: "resource", + value: resource, + msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' + }, + { + name: "receiver", + type: "address", + value: receiverAddress + }, + { + name: "origin", + type: "address", + value: address2 + }, + { + name: "lock", + type: "boolean", + value: lock + }, + { + name: "lock period", + type: "integer", + gte: 0, + value: lockPeriod, + optional: true + } + ]); + if (toHex$1(receiverAddress) === toHex$1(address2)) { + throw new Error("Receiver address must not be the same as owner address"); + } + const data = { + owner_address: toHex$1(address2), + receiver_address: toHex$1(receiverAddress), + balance: parseInt(amount) + }; + if (resource !== "BANDWIDTH") { + data.resource = resource; + } + if (lock) { + data.lock = lock; + if (isNotNullOrUndefined(lockPeriod)) { + data.lock_period = lockPeriod; + } + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.DelegateResourceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async undelegateResource(amount = 0, receiverAddress, resource = "BANDWIDTH", address2 = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + }, + { + name: "receiver", + type: "address", + value: receiverAddress + }, + { + name: "amount", + type: "integer", + gt: 0, + value: amount + }, + { + name: "resource", + type: "resource", + value: resource, + msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' + } + ]); + if (toHex$1(receiverAddress) === toHex$1(address2)) { + throw new Error("Receiver address must not be the same as owner address"); + } + const data = { + owner_address: toHex$1(address2), + receiver_address: toHex$1(receiverAddress), + balance: parseInt(amount) + }; + if (resource !== "BANDWIDTH") { + data.resource = resource; + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.UnDelegateResourceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async withdrawExpireUnfreeze(address2 = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + } + ]); + const data = { + owner_address: toHex$1(address2) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.WithdrawExpireUnfreezeContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async withdrawBlockRewards(address2 = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + } + ]); + const data = { + owner_address: toHex$1(address2) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.WithdrawBalanceContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async applyForSR(address2 = this.tronWeb.defaultAddress.hex, url = "", options = {}) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + }, + { + name: "url", + type: "url", + value: url, + msg: "Invalid url provided" + }, + { + name: "url", + type: "string", + value: url, + lte: 256, + msg: "Invalid url provided" + } + ]); + const data = { + owner_address: toHex$1(address2), + url: fromUtf8(url) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.WitnessCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async vote(votes = {}, voterAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "voter", + type: "address", + value: voterAddress + }, + { + name: "votes", + type: "notEmptyObject", + value: votes + } + ]); + const entries = Object.entries(votes); + for (const [srAddress, voteCount] of entries) { + this.validator.notValid([ + { + name: "SR", + type: "address", + value: srAddress + }, + { + name: "vote count", + type: "integer", + gt: 0, + value: voteCount, + msg: "Invalid vote count provided for SR: " + srAddress + } + ]); + } + const voteList = entries.map(([srAddress, voteCount]) => { + return { + vote_address: toHex$1(srAddress), + vote_count: parseInt(voteCount) + }; + }); + const data = { + owner_address: toHex$1(voterAddress), + votes: voteList + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.VoteWitnessContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async createSmartContract(options = {}, issuerAddress = this.tronWeb.defaultAddress.hex) { + var _a3; + const feeLimit = options.feeLimit || this.tronWeb.feeLimit; + let userFeePercentage = options.userFeePercentage; + if (typeof userFeePercentage !== "number" && !userFeePercentage) { + userFeePercentage = 100; + } + const originEnergyLimit = options.originEnergyLimit || 1e7; + const callValue = options.callValue || 0; + const tokenValue = options.tokenValue; + const tokenId = options.tokenId || options.token_id; + let { abi: abi2 } = options; + const { parameters = [] } = options; + let parameter = ""; + const { bytecode = false, name: name2 = "" } = options; + if (abi2 && isString$1(abi2)) { + try { + abi2 = JSON.parse(abi2); + } catch { + throw new Error("Invalid options.abi provided"); + } + } + const newAbi = abi2; + let entries = newAbi; + if (newAbi.entrys) { + entries = newAbi.entrys; + } + if (!isArray$1(entries)) + throw new Error("Invalid options.abi provided"); + const payable = entries.some((func) => { + return func.type === "constructor" && "payable" === func.stateMutability.toLowerCase(); + }); + this.validator.notValid([ + { + name: "bytecode", + type: "hex", + value: bytecode + }, + { + name: "feeLimit", + type: "integer", + value: feeLimit, + gt: 0 + }, + { + name: "callValue", + type: "integer", + value: callValue, + gte: 0 + }, + { + name: "userFeePercentage", + type: "integer", + value: userFeePercentage, + gte: 0, + lte: 100 + }, + { + name: "originEnergyLimit", + type: "integer", + value: originEnergyLimit, + gte: 0, + lte: 1e7 + }, + { + name: "parameters", + type: "array", + value: parameters + }, + { + name: "issuer", + type: "address", + value: issuerAddress + }, + { + name: "tokenValue", + type: "integer", + value: tokenValue, + gte: 0, + optional: true + }, + { + name: "tokenId", + type: "integer", + value: tokenId, + gte: 0, + optional: true + } + ]); + if (!payable && (callValue > 0 || tokenValue > 0)) + throw new Error("When contract is not payable, options.callValue and options.tokenValue must be 0"); + const { rawParameter, funcABIV2, parametersV2 } = options; + if (rawParameter && isString$1(rawParameter)) { + parameter = rawParameter.replace(/^(0x)/, ""); + } else if (funcABIV2) { + parameter = encodeParamsV2ByABI(funcABIV2, parametersV2).replace(/^(0x)/, ""); + } else { + let constructorParams = entries.find((it2) => { + return it2.type === "constructor"; + }); + if (typeof constructorParams !== "undefined" && constructorParams) { + const abiCoder2 = new AbiCoder(); + const types2 = []; + const values = []; + constructorParams = constructorParams.inputs; + if (parameters.length != constructorParams.length) + throw new Error(`constructor needs ${constructorParams.length} but ${parameters.length} provided`); + for (let i2 = 0; i2 < parameters.length; i2++) { + let type2 = constructorParams[i2].type; + let value = parameters[i2]; + if (!type2 || !isString$1(type2) || !type2.length) + throw new Error("Invalid parameter type provided: " + type2); + const replaceAddressPrefix = (value2) => { + if (isArray$1(value2)) { + return value2.map((v6) => replaceAddressPrefix(v6)); + } + return toHex$1(value2).replace(ADDRESS_PREFIX_REGEX, "0x"); + }; + if (type2 === "address") + value = replaceAddressPrefix(value); + else if (((_a3 = type2.match(/^([^\x5b]*)(\x5b|$)/)) == null ? void 0 : _a3[0]) === "address[") + value = replaceAddressPrefix(value); + else if (/trcToken/.test(type2)) { + type2 = type2.replace(/trcToken/, "uint256"); + } + types2.push(type2); + values.push(value); + } + try { + parameter = abiCoder2.encode(types2, values).replace(/^(0x)/, ""); + } catch (ex2) { + throw new Error(ex2); + } + } else { + parameter = ""; + } + } + const args = { + owner_address: toHex$1(issuerAddress), + fee_limit: parseInt(feeLimit), + call_value: parseInt(callValue), + consume_user_resource_percent: userFeePercentage, + origin_energy_limit: originEnergyLimit, + abi: JSON.stringify(abi2), + bytecode, + parameter, + name: name2 + }; + if (isNotNullOrUndefined(tokenValue)) { + args.call_token_value = parseInt(tokenValue); + } + if (isNotNullOrUndefined(tokenId)) { + args.token_id = parseInt(tokenId); + } + const contract = {}; + contract.owner_address = args.owner_address; + if (isNotNullOrUndefined(args.call_token_value)) { + contract.call_token_value = args.call_token_value; + } + if (isNotNullOrUndefined(args.token_id)) { + contract.token_id = args.token_id; + } + const new_contract = contract.new_contract = {}; + if (args.abi) { + new_contract.abi = { + entrys: JSON.parse(args.abi) + }; + } else { + new_contract.abi = {}; + } + if (args.call_value) { + new_contract.call_value = args.call_value; + } + new_contract.consume_user_resource_percent = args.consume_user_resource_percent; + new_contract.origin_energy_limit = args.origin_energy_limit; + new_contract.origin_address = args.origin_address ?? args.owner_address; + if (args.bytecode + args.parameter) { + new_contract.bytecode = (args.bytecode + args.parameter).replace(/^0x/, ""); + } + if (isNotNullOrUndefined(args.name)) { + new_contract.name = args.name; + } + const transactionOptions = getTransactionOptions(options); + const tx = await createTransaction(this.tronWeb, ContractType.CreateSmartContract, contract, options == null ? void 0 : options.permissionId, { + ...transactionOptions, + fee_limit: args.fee_limit + }); + tx.contract_address = genContractAddress(args.owner_address, tx.txID); + return tx; + } + async triggerSmartContract(contractAddress, functionSelector, options, parameters, issuerAddress) { + var _a3; + const params = [ + contractAddress, + functionSelector, + options, + parameters, + issuerAddress + ]; + if (typeof params[2] !== "object") { + params[2] = { + feeLimit: params[2], + callValue: params[3] + }; + params.splice(3, 1); + } + if ((_a3 = params[2]) == null ? void 0 : _a3.txLocal) { + return this._triggerSmartContractLocal(...params); + } + return this._triggerSmartContract(...params); + } + async triggerConstantContract(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { + options._isConstant = true; + return this._triggerSmartContract(contractAddress, functionSelector, options, parameters, issuerAddress); + } + async triggerConfirmedConstantContract(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { + options._isConstant = true; + options.confirmed = true; + return this._triggerSmartContract(contractAddress, functionSelector, options, parameters, issuerAddress); + } + async estimateEnergy(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { + options.estimateEnergy = true; + const result = await this._triggerSmartContract(contractAddress, functionSelector, options, parameters, issuerAddress); + return result; + } + async deployConstantContract(options = { input: "", ownerAddress: "" }) { + const { input, ownerAddress, tokenId, tokenValue, callValue = 0 } = options; + this.validator.notValid([ + { + name: "input", + type: "not-empty-string", + value: input + }, + { + name: "callValue", + type: "integer", + value: callValue, + gte: 0 + }, + { + name: "owner", + type: "address", + value: ownerAddress + }, + { + name: "tokenValue", + type: "integer", + value: tokenValue, + gte: 0, + optional: true + }, + { + name: "tokenId", + type: "integer", + value: tokenId, + gte: 0, + optional: true + } + ]); + const args = { + data: input, + owner_address: toHex$1(ownerAddress), + call_value: callValue + }; + if (tokenId) { + args.token_id = tokenId; + } + if (tokenValue) { + args.call_token_value = tokenValue; + } + const pathInfo = `wallet${options.confirmed ? "solidity" : ""}/estimateenergy`; + const transaction2 = await this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(pathInfo, args, "post"); + if (transaction2.Error) + throw new Error(transaction2.Error); + if (transaction2.result && transaction2.result.message) { + throw new Error(this.tronWeb.toUtf8(transaction2.result.message)); + } + return transaction2; + } + _getTriggerSmartContractArgs(contractAddress, functionSelector, options, parameters, issuerAddress, tokenValue, tokenId, callValue, feeLimit) { + var _a3; + const args = { + contract_address: toHex$1(contractAddress), + owner_address: toHex$1(issuerAddress) + }; + if (functionSelector && isString$1(functionSelector)) { + functionSelector = functionSelector.replace(/\s*/g, ""); + let parameterStr; + if (parameters.length) { + const abiCoder2 = new AbiCoder(); + let types2 = []; + const values = []; + for (let i2 = 0; i2 < parameters.length; i2++) { + let { value } = parameters[i2]; + const { type: type2 } = parameters[i2]; + if (!type2 || !isString$1(type2) || !type2.length) + throw new Error("Invalid parameter type provided: " + type2); + const replaceAddressPrefix = (value2) => { + if (isArray$1(value2)) { + return value2.map((v6) => replaceAddressPrefix(v6)); + } + return toHex$1(value2).replace(ADDRESS_PREFIX_REGEX, "0x"); + }; + if (type2 === "address") + value = replaceAddressPrefix(value); + else if (((_a3 = type2.match(/^([^\x5b]*)(\x5b|$)/)) == null ? void 0 : _a3[0]) === "address[") + value = replaceAddressPrefix(value); + types2.push(type2); + values.push(value); + } + try { + types2 = types2.map((type2) => { + if (/trcToken/.test(type2)) { + type2 = type2.replace(/trcToken/, "uint256"); + } + return type2; + }); + parameterStr = abiCoder2.encode(types2, values).replace(/^(0x)/, ""); + } catch (ex2) { + throw new Error(ex2); + } + } else + parameterStr = ""; + if (options.funcABIV2) { + parameterStr = encodeParamsV2ByABI(options.funcABIV2, options.parametersV2).replace(/^(0x)/, ""); + } + if (options.shieldedParameter && isString$1(options.shieldedParameter)) { + parameterStr = options.shieldedParameter.replace(/^(0x)/, ""); + } + if (options.rawParameter && isString$1(options.rawParameter)) { + parameterStr = options.rawParameter.replace(/^(0x)/, ""); + } + args.function_selector = functionSelector; + args.parameter = parameterStr; + } else if (options.input) { + args.data = options.input; + } + args.call_value = parseInt(callValue); + if (isNotNullOrUndefined(tokenValue)) + args.call_token_value = parseInt(tokenValue); + if (isNotNullOrUndefined(tokenId)) + args.token_id = parseInt(tokenId); + if (!(options._isConstant || options.estimateEnergy)) { + args.fee_limit = parseInt(feeLimit); + } + if (options.permissionId) { + args.Permission_id = options.permissionId; + } + return args; + } + async _triggerSmartContractLocal(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { + const { tokenValue, tokenId, callValue, feeLimit } = Object.assign({ + callValue: 0, + feeLimit: this.tronWeb.feeLimit + }, options); + this.validator.notValid([ + { + name: "feeLimit", + type: "integer", + value: feeLimit, + gt: 0 + }, + { + name: "callValue", + type: "integer", + value: callValue, + gte: 0 + }, + { + name: "parameters", + type: "array", + value: parameters + }, + { + name: "contract", + type: "address", + value: contractAddress + }, + { + name: "issuer", + type: "address", + value: issuerAddress, + optional: true + }, + { + name: "tokenValue", + type: "integer", + value: tokenValue, + gte: 0, + optional: true + }, + { + name: "tokenId", + type: "integer", + value: tokenId, + gte: 0, + optional: true + } + ]); + const args = this._getTriggerSmartContractArgs(contractAddress, functionSelector, options, parameters, issuerAddress, tokenValue, tokenId, callValue, feeLimit); + if (args.function_selector) { + args.data = keccak256(Buffer.from(args.function_selector, "utf-8")).toString().substring(2, 10) + args.parameter; + } + const value = { + data: args.data, + owner_address: args.owner_address, + contract_address: args.contract_address + }; + if (args.call_value) { + value.call_value = args.call_value; + } + if (args.call_token_value) { + value.call_token_value = args.call_token_value; + } + if (args.token_id) { + value.token_id = args.token_id; + } + const transactionOptions = getTransactionOptions(options); + const transaction2 = await createTransaction(this.tronWeb, ContractType.TriggerSmartContract, value, options.permissionId, { + ...transactionOptions, + fee_limit: args.fee_limit + }); + return { + result: { + result: true + }, + transaction: transaction2 + }; + } + async _triggerSmartContract(contractAddress, functionSelector, options = {}, parameters = [], issuerAddress = this.tronWeb.defaultAddress.hex) { + const { tokenValue, tokenId, callValue, feeLimit } = Object.assign({ + callValue: 0, + feeLimit: this.tronWeb.feeLimit + }, options); + this.validator.notValid([ + { + name: "feeLimit", + type: "integer", + value: feeLimit, + gt: 0 + }, + { + name: "callValue", + type: "integer", + value: callValue, + gte: 0 + }, + { + name: "parameters", + type: "array", + value: parameters + }, + { + name: "contract", + type: "address", + value: contractAddress + }, + { + name: "issuer", + type: "address", + value: issuerAddress, + optional: true + }, + { + name: "tokenValue", + type: "integer", + value: tokenValue, + gte: 0, + optional: true + }, + { + name: "tokenId", + type: "integer", + value: tokenId, + gte: 0, + optional: true + } + ]); + const args = this._getTriggerSmartContractArgs(contractAddress, functionSelector, options, parameters, issuerAddress, tokenValue, tokenId, callValue, feeLimit); + let pathInfo = "triggersmartcontract"; + if (options._isConstant) { + pathInfo = "triggerconstantcontract"; + } else if (options.estimateEnergy) { + pathInfo = "estimateenergy"; + } + pathInfo = `wallet${options.confirmed ? "solidity" : ""}/${pathInfo}`; + const transaction2 = await this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(pathInfo, args, "post"); + return resultManagerTriggerSmartContract(transaction2, args, options); + } + async clearABI(contractAddress, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + if (!TronWeb.isAddress(contractAddress)) + throw new Error("Invalid contract address provided"); + if (!TronWeb.isAddress(ownerAddress)) + throw new Error("Invalid owner address provided"); + const data = { + contract_address: toHex$1(contractAddress), + owner_address: toHex$1(ownerAddress) + }; + if (this.tronWeb.trx.cache.contracts[contractAddress]) { + delete this.tronWeb.trx.cache.contracts[contractAddress]; + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ClearABIContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async updateBrokerage(brokerage, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + if (!isNotNullOrUndefined(brokerage)) + throw new Error("Invalid brokerage provided"); + if (!isInteger(brokerage) || brokerage < 0 || brokerage > 100) + throw new Error("Brokerage must be an integer between 0 and 100"); + if (!TronWeb.isAddress(ownerAddress)) + throw new Error("Invalid owner address provided"); + const data = { + brokerage: parseInt(brokerage), + owner_address: toHex$1(ownerAddress) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.UpdateBrokerageContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async createToken(options = {}, issuerAddress = this.tronWeb.defaultAddress.hex) { + const { + name: name2 = false, + abbreviation = false, + description: description2 = "", + url = false, + totalSupply = 0, + trxRatio = 1, + // How much TRX will `tokenRatio` cost + tokenRatio = 1, + // How many tokens will `trxRatio` afford + saleStart = Date.now(), + saleEnd = false, + freeBandwidth = 0, + // The creator's "donated" bandwidth for use by token holders + freeBandwidthLimit = 0, + // Out of `totalFreeBandwidth`, the amount each token holder get + frozenAmount = 0, + frozenDuration = 0, + // for now there is no default for the following values + voteScore, + precision + } = options; + this.validator.notValid([ + { + name: "Supply amount", + type: "positive-integer", + value: totalSupply + }, + { + name: "TRX ratio", + type: "positive-integer", + value: trxRatio + }, + { + name: "Token ratio", + type: "positive-integer", + value: tokenRatio + }, + { + name: "token abbreviation", + type: "string", + value: abbreviation, + lte: 32, + gt: 0 + }, + { + name: "token name", + type: "not-empty-string", + value: name2 + }, + { + name: "token description", + type: "string", + value: description2, + lte: 200 + }, + { + name: "token url", + type: "url", + value: url + }, + { + name: "token url", + type: "string", + value: url, + lte: 256 + }, + { + name: "issuer", + type: "address", + value: issuerAddress + }, + { + name: "sale start timestamp", + type: "integer", + value: saleStart, + gte: Date.now() + }, + { + name: "sale end timestamp", + type: "integer", + value: saleEnd, + gt: saleStart + }, + { + name: "Frozen supply", + type: "integer", + value: frozenAmount, + gte: 0 + }, + { + name: "Frozen duration", + type: "integer", + value: frozenDuration, + gte: 0 + } + ]); + if (isNotNullOrUndefined(voteScore) && (!isInteger(voteScore) || voteScore <= 0)) + throw new Error("voteScore must be a positive integer greater than 0"); + if (isNotNullOrUndefined(precision) && (!isInteger(precision) || precision < 0 || precision > 6)) + throw new Error("precision must be a positive integer >= 0 and <= 6"); + const data = { + owner_address: toHex$1(issuerAddress), + name: fromUtf8(name2), + abbr: fromUtf8(abbreviation), + description: fromUtf8(description2), + url: fromUtf8(url), + total_supply: parseInt(totalSupply), + trx_num: parseInt(trxRatio), + num: parseInt(tokenRatio), + start_time: parseInt(saleStart), + end_time: parseInt(saleEnd), + frozen_supply: [ + { + frozen_amount: parseInt(frozenAmount), + frozen_days: parseInt(frozenDuration) + } ] }; - var UAParser2 = function(ua2, extensions) { - if (typeof ua2 === OBJ_TYPE) { - extensions = ua2; - ua2 = undefined$1; + ["name", "abbr", "description", "url"].forEach((key2) => { + if (!data[key2]) { + delete data[key2]; + } + }); + if (!(parseInt(frozenAmount) > 0)) { + delete data.frozen_supply; + } + if (freeBandwidth && !isNaN(parseInt(freeBandwidth)) && parseInt(freeBandwidth) >= 0) { + data.free_asset_net_limit = parseInt(freeBandwidth); + } + if (freeBandwidthLimit && !isNaN(parseInt(freeBandwidthLimit)) && parseInt(freeBandwidthLimit) >= 0) { + data.public_free_asset_net_limit = parseInt(freeBandwidthLimit); + } + if (precision && !isNaN(parseInt(precision))) { + data.precision = parseInt(precision); + } + if (voteScore && !isNaN(parseInt(voteScore))) { + data.vote_score = parseInt(voteScore); + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.AssetIssueContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async createAccount(accountAddress, address2 = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "account", + type: "address", + value: accountAddress + }, + { + name: "origin", + type: "address", + value: address2 + } + ]); + const data = { + owner_address: toHex$1(address2), + account_address: toHex$1(accountAddress) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.AccountCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async updateAccount(accountName, address2 = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "Name", + type: "string", + lte: 200, + gt: 0, + value: accountName, + msg: "Invalid accountName" + }, + { + name: "origin", + type: "address", + value: address2 + } + ]); + const data = { + account_name: fromUtf8(accountName), + owner_address: toHex$1(address2) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.AccountUpdateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async setAccountId(accountId, address2 = this.tronWeb.defaultAddress.hex, options = {}) { + if (accountId && isString$1(accountId) && accountId.startsWith("0x")) { + accountId = accountId.slice(2); + } + this.validator.notValid([ + { + name: "accountId", + type: "hex", + value: accountId + }, + { + name: "accountId", + type: "string", + lte: 32, + gte: 8, + value: accountId + }, + { + name: "origin", + type: "address", + value: address2 + } + ]); + const data = { + account_id: accountId, + owner_address: toHex$1(address2) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.SetAccountIdContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async updateToken(options = {}, issuerAddress = this.tronWeb.defaultAddress.hex) { + const { + description: description2 = "", + url = false, + freeBandwidth = 0, + // The creator's "donated" bandwidth for use by token holders + freeBandwidthLimit = 0 + // Out of `totalFreeBandwidth`, the amount each token holder get + } = options; + this.validator.notValid([ + { + name: "token description", + type: "string", + value: description2, + lte: 200 + }, + { + name: "token url", + type: "url", + value: url + }, + { + name: "token url", + type: "string", + value: url, + lte: 256 + }, + { + name: "issuer", + type: "address", + value: issuerAddress + } + ]); + const data = { + owner_address: toHex$1(issuerAddress), + description: fromUtf8(description2), + url: fromUtf8(url) + }; + if (freeBandwidth && !isNaN(parseInt(freeBandwidth)) && parseInt(freeBandwidth) >= 0) { + data.new_limit = parseInt(freeBandwidth); + } + if (freeBandwidthLimit && !isNaN(parseInt(freeBandwidthLimit)) && parseInt(freeBandwidthLimit) >= 0) { + data.new_public_limit = parseInt(freeBandwidthLimit); + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.UpdateAssetContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async sendAsset(to2, amount = 0, tokenId, from2 = this.tronWeb.defaultAddress.hex, options = {}) { + return this.sendToken(to2, amount, tokenId, from2, options); + } + async purchaseAsset(issuerAddress, tokenId, amount = 0, buyer = this.tronWeb.defaultAddress.hex, options = {}) { + return this.purchaseToken(issuerAddress, tokenId, amount, buyer, options); + } + async createAsset(options, issuerAddress) { + return this.createToken(options, issuerAddress); + } + async updateAsset(options = {}, issuerAddress = this.tronWeb.defaultAddress.hex) { + return this.updateToken(options, issuerAddress); + } + /** + * Creates a proposal to modify the network. + * Can only be created by a current Super Representative. + */ + async createProposal(parameters, issuerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "issuer", + type: "address", + value: issuerAddress + } + ]); + const invalid = "Invalid proposal parameters provided"; + if (!parameters) + throw new Error(invalid); + const newParams = isArray$1(parameters) ? parameters : [parameters]; + for (const parameter of newParams) { + if (!isObject$2(parameter)) + throw new Error(invalid); + } + const data = { + owner_address: toHex$1(issuerAddress), + parameters: newParams + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ProposalCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + /** + * Deletes a network modification proposal that the owner issued. + * Only current Super Representative can vote on a proposal. + */ + async deleteProposal(proposalID, issuerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "issuer", + type: "address", + value: issuerAddress + }, + { + name: "proposalID", + type: "integer", + value: proposalID, + gte: 0 + } + ]); + const data = { + owner_address: toHex$1(issuerAddress), + proposal_id: parseInt(proposalID) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ProposalDeleteContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + /** + * Adds a vote to an issued network modification proposal. + * Only current Super Representative can vote on a proposal. + */ + async voteProposal(proposalID, isApproval = false, voterAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "voter", + type: "address", + value: voterAddress + }, + { + name: "proposalID", + type: "integer", + value: proposalID, + gte: 0 + }, + { + name: "has approval", + type: "boolean", + value: isApproval + } + ]); + const data = { + owner_address: toHex$1(voterAddress), + proposal_id: parseInt(proposalID), + is_add_approval: isApproval + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ProposalApproveContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + /** + * Create an exchange between a token and TRX. + * Token Name should be a CASE SENSITIVE string. + * PLEASE VERIFY THIS ON TRONSCAN. + */ + async createTRXExchange(tokenName, tokenBalance, trxBalance, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "owner", + type: "address", + value: ownerAddress + }, + { + name: "token name", + type: "not-empty-string", + value: tokenName + }, + { + name: "token balance", + type: "positive-integer", + value: tokenBalance + }, + { + name: "trx balance", + type: "positive-integer", + value: trxBalance + } + ]); + const data = { + owner_address: toHex$1(ownerAddress), + first_token_id: fromUtf8(tokenName), + first_token_balance: tokenBalance, + second_token_id: "5f", + // Constant for TRX. + second_token_balance: trxBalance + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ExchangeCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + /** + * Create an exchange between a token and another token. + * DO NOT USE THIS FOR TRX. + * Token Names should be a CASE SENSITIVE string. + * PLEASE VERIFY THIS ON TRONSCAN. + */ + async createTokenExchange(firstTokenName, firstTokenBalance, secondTokenName, secondTokenBalance, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "owner", + type: "address", + value: ownerAddress + }, + { + name: "first token name", + type: "not-empty-string", + value: firstTokenName + }, + { + name: "second token name", + type: "not-empty-string", + value: secondTokenName + }, + { + name: "first token balance", + type: "positive-integer", + value: firstTokenBalance + }, + { + name: "second token balance", + type: "positive-integer", + value: secondTokenBalance + } + ]); + const data = { + owner_address: toHex$1(ownerAddress), + first_token_id: fromUtf8(firstTokenName), + first_token_balance: firstTokenBalance, + second_token_id: fromUtf8(secondTokenName), + second_token_balance: secondTokenBalance + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ExchangeCreateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + /** + * Adds tokens into a bancor style exchange. + * Will add both tokens at market rate. + * Use "_" for the constant value for TRX. + */ + async injectExchangeTokens(exchangeID, tokenName, tokenAmount, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "owner", + type: "address", + value: ownerAddress + }, + { + name: "token name", + type: "not-empty-string", + value: tokenName + }, + { + name: "token amount", + type: "integer", + value: tokenAmount, + gte: 1 + }, + { + name: "exchangeID", + type: "integer", + value: exchangeID, + gte: 0 + } + ]); + const data = { + owner_address: toHex$1(ownerAddress), + exchange_id: parseInt(exchangeID), + token_id: fromUtf8(tokenName), + quant: parseInt(tokenAmount) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ExchangeInjectContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + /** + * Withdraws tokens from a bancor style exchange. + * Will withdraw at market rate both tokens. + * Use "_" for the constant value for TRX. + */ + async withdrawExchangeTokens(exchangeID, tokenName, tokenAmount, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "owner", + type: "address", + value: ownerAddress + }, + { + name: "token name", + type: "not-empty-string", + value: tokenName + }, + { + name: "token amount", + type: "integer", + value: tokenAmount, + gte: 1 + }, + { + name: "exchangeID", + type: "integer", + value: exchangeID, + gte: 0 + } + ]); + const data = { + owner_address: toHex$1(ownerAddress), + exchange_id: parseInt(exchangeID), + token_id: fromUtf8(tokenName), + quant: parseInt(tokenAmount) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ExchangeWithdrawContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + /** + * Trade tokens on a bancor style exchange. + * Expected value is a validation and used to cap the total amt of token 2 spent. + * Use "_" for the constant value for TRX. + */ + async tradeExchangeTokens(exchangeID, tokenName, tokenAmountSold, tokenAmountExpected, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "owner", + type: "address", + value: ownerAddress + }, + { + name: "token name", + type: "not-empty-string", + value: tokenName + }, + { + name: "tokenAmountSold", + type: "integer", + value: tokenAmountSold, + gte: 1 + }, + { + name: "tokenAmountExpected", + type: "integer", + value: tokenAmountExpected, + gte: 1 + }, + { + name: "exchangeID", + type: "integer", + value: exchangeID, + gte: 0 + } + ]); + const data = { + owner_address: toHex$1(ownerAddress), + exchange_id: parseInt(exchangeID), + token_id: TronWeb.fromAscii(tokenName).replace(/^0x/, ""), + quant: parseInt(tokenAmountSold), + expected: parseInt(tokenAmountExpected) + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.ExchangeTransactionContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + /** + * Update userFeePercentage. + */ + async updateSetting(contractAddress, userFeePercentage, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "owner", + type: "address", + value: ownerAddress + }, + { + name: "contract", + type: "address", + value: contractAddress + }, + { + name: "userFeePercentage", + type: "integer", + value: userFeePercentage, + gte: 0, + lte: 100 + } + ]); + const data = { + owner_address: toHex$1(ownerAddress), + contract_address: toHex$1(contractAddress), + consume_user_resource_percent: userFeePercentage + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.UpdateSettingContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + /** + * Update energy limit. + */ + async updateEnergyLimit(contractAddress, originEnergyLimit = 0, ownerAddress = this.tronWeb.defaultAddress.hex, options = {}) { + this.validator.notValid([ + { + name: "owner", + type: "address", + value: ownerAddress + }, + { + name: "contract", + type: "address", + value: contractAddress + }, + { + name: "originEnergyLimit", + type: "integer", + value: originEnergyLimit, + gte: 0, + lte: 1e7 + } + ]); + const data = { + owner_address: toHex$1(ownerAddress), + contract_address: toHex$1(contractAddress), + origin_energy_limit: originEnergyLimit + }; + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.UpdateEnergyLimitContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + checkPermissions(permissions, type2) { + if (permissions) { + if (permissions.type !== type2 || !permissions.permission_name || !isString$1(permissions.permission_name) || !isInteger(permissions.threshold) || permissions.threshold < 1 || !permissions.keys) { + return false; + } + for (const key2 of permissions.keys) { + if (!TronWeb.isAddress(key2.address) || !isInteger(key2.weight) || key2.weight > permissions.threshold || key2.weight < 1 || type2 === 2 && !permissions.operations) { + return false; + } + } + } + return true; + } + async updateAccountPermissions(ownerAddress = this.tronWeb.defaultAddress.hex, ownerPermission, witnessPermission, activesPermissions, options = {}) { + var _a3; + if (!TronWeb.isAddress(ownerAddress)) + throw new Error("Invalid ownerAddress provided"); + if (!this.checkPermissions(ownerPermission, 0)) { + throw new Error("Invalid ownerPermissions provided"); + } + if (!this.checkPermissions(witnessPermission, 1)) { + throw new Error("Invalid witnessPermissions provided"); + } + if (!Array.isArray(activesPermissions)) { + activesPermissions = [activesPermissions]; + } + for (const activesPermission of activesPermissions) { + if (!this.checkPermissions(activesPermission, 2)) { + throw new Error("Invalid activesPermissions provided"); + } + } + const data = { + owner_address: toHex$1(ownerAddress) + }; + if (ownerPermission) { + const _ownerPermissions = deepCopyJson(ownerPermission); + if ("type" in _ownerPermissions) { + delete _ownerPermissions.type; + } + _ownerPermissions.keys = (_a3 = _ownerPermissions.keys) == null ? void 0 : _a3.map(({ address: address2, weight }) => ({ + address: this.tronWeb.address.toHex(address2), + weight + })); + data.owner = _ownerPermissions; + } + if (witnessPermission) { + const _witnessPermissions = deepCopyJson(witnessPermission); + _witnessPermissions.type = "Witness"; + _witnessPermissions.keys = _witnessPermissions.keys.map(({ address: address2, weight }) => ({ + address: this.tronWeb.address.toHex(address2), + weight + })); + data.witness = _witnessPermissions; + } + if (activesPermissions) { + const _activesPermissions = deepCopyJson(activesPermissions); + _activesPermissions.forEach((activePermissions) => { + activePermissions.type = "Active"; + }); + _activesPermissions.forEach((_activesPermission) => { + _activesPermission.keys = _activesPermission.keys.map(({ address: address2, weight }) => ({ + address: this.tronWeb.address.toHex(address2), + weight + })); + }); + data.actives = _activesPermissions; + } + const transactionOptions = getTransactionOptions(options); + return createTransaction(this.tronWeb, ContractType.AccountPermissionUpdateContract, data, options == null ? void 0 : options.permissionId, transactionOptions); + } + async newTxID(transaction2, options = {}) { + if (options == null ? void 0 : options.txLocal) { + const contract = transaction2.raw_data.contract[0]; + try { + const tx = await createTransaction(this.tronWeb, contract.type, contract.parameter.value, contract.Permission_id, { + fee_limit: transaction2.raw_data.fee_limit, + data: transaction2.raw_data.data, + ref_block_bytes: transaction2.raw_data.ref_block_bytes, + ref_block_hash: transaction2.raw_data.ref_block_hash, + expiration: transaction2.raw_data.expiration, + timestamp: transaction2.raw_data.timestamp + }); + tx.signature = transaction2.signature; + tx.visible = transaction2.visible; + return tx; + } catch (e18) { + throw new Error("Error generating a new transaction id."); + } + } + try { + const res = await this.tronWeb.fullNode.request("wallet/getsignweight", transaction2, "post"); + if (typeof transaction2.visible === "boolean") { + res.transaction.transaction.visible = transaction2.visible; + } + return resultManager( + res.transaction.transaction, + { + ...transaction2.raw_data.contract[0].parameter.value, + Permission_id: transaction2.raw_data.contract[0].Permission_id + }, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + /* @ts-ignore */ + { data: transaction2.raw_data.data, fee_limit: transaction2.raw_data.fee_limit } + ); + } catch (e18) { + throw new Error("Error generating a new transaction id."); + } + } + async alterTransaction(transaction2, options = {}) { + if (Reflect.has(transaction2, "signature")) + throw new Error("You can not extend the expiration of a signed transaction."); + if (options.data) { + if (options.dataFormat !== "hex") + options.data = TronWeb.toHex(options.data); + options.data = options.data.replace(/^0x/, ""); + if (options.data.length === 0) + throw new Error("Invalid data provided"); + transaction2.raw_data.data = options.data; + } + if (options.extension) { + options.extension = parseInt(options.extension * 1e3); + if (isNaN(options.extension) || transaction2.raw_data.expiration + options.extension <= Date.now() + 3e3) + throw new Error("Invalid extension provided"); + transaction2.raw_data.expiration += options.extension; + } + return await this.newTxID(transaction2, { txLocal: options.txLocal }); + } + async extendExpiration(transaction2, extension, options = {}) { + return await this.alterTransaction(transaction2, { extension, txLocal: options == null ? void 0 : options.txLocal }); + } + async addUpdateData(transaction2, data, dataFormat = "utf8", options = {}) { + return this.alterTransaction(transaction2, { data, dataFormat, txLocal: options == null ? void 0 : options.txLocal }); + } +} +const TRX_MESSAGE_HEADER = "TRON Signed Message:\n32"; +const ETH_MESSAGE_HEADER = "Ethereum Signed Message:\n32"; +function toHex2(value) { + return TronWeb.address.toHex(value); +} +class Trx { + constructor(tronWeb) { + __publicField(this, "tronWeb"); + __publicField(this, "cache"); + __publicField(this, "validator"); + __publicField(this, "signMessage"); + __publicField(this, "sendAsset"); + __publicField(this, "send"); + __publicField(this, "sendTrx"); + __publicField(this, "broadcast"); + __publicField(this, "broadcastHex"); + __publicField(this, "signTransaction"); + this.tronWeb = tronWeb; + this.cache = { + contracts: {} + }; + this.validator = new Validator(); + this.signMessage = this.sign; + this.sendAsset = this.sendToken; + this.send = this.sendTransaction; + this.sendTrx = this.sendTransaction; + this.broadcast = this.sendRawTransaction; + this.broadcastHex = this.sendHexTransaction; + this.signTransaction = this.sign; + } + _parseToken(token2) { + return { + ...token2, + name: this.tronWeb.toUtf8(token2.name), + abbr: token2.abbr && this.tronWeb.toUtf8(token2.abbr), + description: token2.description && this.tronWeb.toUtf8(token2.description), + url: token2.url && this.tronWeb.toUtf8(token2.url) + }; + } + getCurrentBlock() { + return this.tronWeb.fullNode.request("wallet/getnowblock"); + } + getConfirmedCurrentBlock() { + return this.tronWeb.solidityNode.request("walletsolidity/getnowblock"); + } + async getBlock(block = this.tronWeb.defaultBlock) { + if (block === false) { + throw new Error("No block identifier provided"); + } + if (block == "earliest") + block = 0; + if (block == "latest") + return this.getCurrentBlock(); + if (isNaN(+block) && utils$3.isHex(block.toString())) + return this.getBlockByHash(block); + return this.getBlockByNumber(block); + } + async getBlockByHash(blockHash) { + const block = await this.tronWeb.fullNode.request("wallet/getblockbyid", { + value: blockHash + }, "post"); + if (!Object.keys(block).length) { + throw new Error("Block not found"); + } + return block; + } + async getBlockByNumber(blockID) { + if (!utils$3.isInteger(blockID) || blockID < 0) { + throw new Error("Invalid block number provided"); + } + return this.tronWeb.fullNode.request("wallet/getblockbynum", { + num: parseInt(blockID) + }, "post").then((block) => { + if (!Object.keys(block).length) { + throw new Error("Block not found"); + } + return block; + }); + } + async getBlockTransactionCount(block = this.tronWeb.defaultBlock) { + const { transactions = [] } = await this.getBlock(block); + return transactions.length; + } + async getTransactionFromBlock(block = this.tronWeb.defaultBlock, index2) { + const { transactions } = await this.getBlock(block); + if (!transactions) { + throw new Error("Transaction not found in block"); + } + if (index2 >= 0 && index2 < transactions.length) + return transactions[index2]; + else + throw new Error("Invalid transaction index provided"); + } + async getTransactionsFromBlock(block = this.tronWeb.defaultBlock) { + const { transactions } = await this.getBlock(block); + if (!transactions) { + throw new Error("Transaction not found in block"); + } + return transactions; + } + async getTransaction(transactionID) { + const transaction2 = await this.tronWeb.fullNode.request("wallet/gettransactionbyid", { + value: transactionID + }, "post"); + if (!Object.keys(transaction2).length) { + throw new Error("Transaction not found"); + } + return transaction2; + } + async getConfirmedTransaction(transactionID) { + const transaction2 = await this.tronWeb.solidityNode.request("walletsolidity/gettransactionbyid", { + value: transactionID + }, "post"); + if (!Object.keys(transaction2).length) { + throw new Error("Transaction not found"); + } + return transaction2; + } + getUnconfirmedTransactionInfo(transactionID) { + return this.tronWeb.fullNode.request("wallet/gettransactioninfobyid", { value: transactionID }, "post"); + } + getTransactionInfo(transactionID) { + return this.tronWeb.solidityNode.request("walletsolidity/gettransactioninfobyid", { value: transactionID }, "post"); + } + getTransactionsToAddress(address2 = this.tronWeb.defaultAddress.hex, limit = 30, offset2 = 0) { + return this.getTransactionsRelated(this.tronWeb.address.toHex(address2), "to", limit, offset2); + } + getTransactionsFromAddress(address2 = this.tronWeb.defaultAddress.hex, limit = 30, offset2 = 0) { + return this.getTransactionsRelated(this.tronWeb.address.toHex(address2), "from", limit, offset2); + } + async getTransactionsRelated(address2 = this.tronWeb.defaultAddress.hex, direction = "all", limit = 30, offset2 = 0) { + if (!["to", "from", "all"].includes(direction)) { + throw new Error('Invalid direction provided: Expected "to", "from" or "all"'); + } + if (direction == "all") { + const [from2, to2] = await Promise.all([ + this.getTransactionsRelated(address2, "from", limit, offset2), + this.getTransactionsRelated(address2, "to", limit, offset2) + ]); + return [ + ...from2.map((tx) => (tx.direction = "from", tx)), + ...to2.map((tx) => (tx.direction = "to", tx)) + ].sort((a3, b2) => { + return b2.raw_data.timestamp - a3.raw_data.timestamp; + }); + } + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + if (!utils$3.isInteger(limit) || limit < 0 || offset2 && limit < 1) { + throw new Error("Invalid limit provided"); + } + if (!utils$3.isInteger(offset2) || offset2 < 0) { + throw new Error("Invalid offset provided"); + } + address2 = this.tronWeb.address.toHex(address2); + return this.tronWeb.solidityNode.request(`walletextension/gettransactions${direction}this`, { + account: { + address: address2 + }, + offset: offset2, + limit + }, "post").then(({ transaction: transaction2 }) => { + return transaction2; + }); + } + async getAccount(address2 = this.tronWeb.defaultAddress.hex) { + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + address2 = this.tronWeb.address.toHex(address2); + return this.tronWeb.solidityNode.request("walletsolidity/getaccount", { + address: address2 + }, "post"); + } + getAccountById(id2) { + return this.getAccountInfoById(id2, { confirmed: true }); + } + async getAccountInfoById(id2, options) { + this.validator.notValid([ + { + name: "accountId", + type: "hex", + value: id2 + }, + { + name: "accountId", + type: "string", + lte: 32, + gte: 8, + value: id2 + } + ]); + if (id2.startsWith("0x")) { + id2 = id2.slice(2); + } + return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getaccountbyid`, { + account_id: id2 + }, "post"); + } + async getBalance(address2 = this.tronWeb.defaultAddress.hex) { + const { balance = 0 } = await this.getAccount(address2); + return balance; + } + async getUnconfirmedAccount(address2 = this.tronWeb.defaultAddress.hex) { + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + address2 = this.tronWeb.address.toHex(address2); + return this.tronWeb.fullNode.request("wallet/getaccount", { + address: address2 + }, "post"); + } + getUnconfirmedAccountById(id2) { + return this.getAccountInfoById(id2, { confirmed: false }); + } + async getUnconfirmedBalance(address2 = this.tronWeb.defaultAddress.hex) { + const { balance = 0 } = await this.getUnconfirmedAccount(address2); + return balance; + } + async getBandwidth(address2 = this.tronWeb.defaultAddress.hex) { + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + address2 = this.tronWeb.address.toHex(address2); + return this.tronWeb.fullNode.request("wallet/getaccountnet", { + address: address2 + }, "post").then(({ freeNetUsed = 0, freeNetLimit = 0, NetUsed = 0, NetLimit = 0 }) => { + return freeNetLimit - freeNetUsed + (NetLimit - NetUsed); + }); + } + async getTokensIssuedByAddress(address2 = this.tronWeb.defaultAddress.hex) { + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + address2 = this.tronWeb.address.toHex(address2); + return this.tronWeb.fullNode.request("wallet/getassetissuebyaccount", { + address: address2 + }, "post").then(({ assetIssue }) => { + if (!assetIssue) + return {}; + const tokens = assetIssue.map((token2) => { + return this._parseToken(token2); + }).reduce((tokens2, token2) => { + return tokens2[token2.name] = token2, tokens2; + }, {}); + return tokens; + }); + } + async getTokenFromID(tokenID) { + if (utils$3.isInteger(tokenID)) + tokenID = tokenID.toString(); + if (!utils$3.isString(tokenID) || !tokenID.length) { + throw new Error("Invalid token ID provided"); + } + return this.tronWeb.fullNode.request("wallet/getassetissuebyname", { + value: this.tronWeb.fromUtf8(tokenID) + }, "post").then((token2) => { + if (!token2.name) { + throw new Error("Token does not exist"); + } + return this._parseToken(token2); + }); + } + async listNodes() { + const { nodes = [] } = await this.tronWeb.fullNode.request("wallet/listnodes"); + return nodes.map(({ address: { host, port } }) => `${this.tronWeb.toUtf8(host)}:${port}`); + } + async getBlockRange(start = 0, end = 30) { + if (!utils$3.isInteger(start) || start < 0) { + throw new Error("Invalid start of range provided"); + } + if (!utils$3.isInteger(end) || end < start) { + throw new Error("Invalid end of range provided"); + } + if (end + 1 - start > 100) { + throw new Error("Invalid range size, which should be no more than 100."); + } + return this.tronWeb.fullNode.request("wallet/getblockbylimitnext", { + startNum: parseInt(start), + endNum: parseInt(end) + 1 + }, "post").then(({ block = [] }) => block); + } + async listSuperRepresentatives() { + const { witnesses = [] } = await this.tronWeb.fullNode.request("wallet/listwitnesses"); + return witnesses; + } + async listTokens(limit = 0, offset2 = 0) { + if (!utils$3.isInteger(limit) || limit < 0 || offset2 && limit < 1) { + throw new Error("Invalid limit provided"); + } + if (!utils$3.isInteger(offset2) || offset2 < 0) { + throw new Error("Invalid offset provided"); + } + if (!limit) { + return this.tronWeb.fullNode.request("wallet/getassetissuelist").then(({ assetIssue = [] }) => assetIssue.map((token2) => this._parseToken(token2))); + } + return this.tronWeb.fullNode.request("wallet/getpaginatedassetissuelist", { + offset: parseInt(offset2), + limit: parseInt(limit) + }, "post").then(({ assetIssue = [] }) => assetIssue.map((token2) => this._parseToken(token2))); + } + async timeUntilNextVoteCycle() { + const { num = -1 } = await this.tronWeb.fullNode.request("wallet/getnextmaintenancetime"); + if (num == -1) { + throw new Error("Failed to get time until next vote cycle"); + } + return Math.floor(num / 1e3); + } + async getContract(contractAddress) { + if (!this.tronWeb.isAddress(contractAddress)) { + throw new Error("Invalid contract address provided"); + } + if (this.cache.contracts[contractAddress]) { + return this.cache.contracts[contractAddress]; + } + contractAddress = this.tronWeb.address.toHex(contractAddress); + const contract = await this.tronWeb.fullNode.request("wallet/getcontract", { + value: contractAddress + }); + if (contract.Error) { + throw new Error("Contract does not exist"); + } + this.cache.contracts[contractAddress] = contract; + return contract; + } + ecRecover(transaction2) { + return Trx.ecRecover(transaction2); + } + static ecRecover(transaction2) { + var _a3; + if (!txCheck(transaction2)) { + throw new Error("Invalid transaction"); + } + if (!((_a3 = transaction2.signature) == null ? void 0 : _a3.length)) { + throw new Error("Transaction is not signed"); + } + if (transaction2.signature.length === 1) { + const tronAddress = ecRecover(transaction2.txID, transaction2.signature[0]); + return TronWeb.address.fromHex(tronAddress); + } + return transaction2.signature.map((sig) => { + const tronAddress = ecRecover(transaction2.txID, sig); + return TronWeb.address.fromHex(tronAddress); + }); + } + async verifyMessage(message2, signature2, address2 = this.tronWeb.defaultAddress.base58, useTronHeader = true) { + if (!utils$3.isHex(message2)) { + throw new Error("Expected hex message input"); + } + if (Trx.verifySignature(message2, address2, signature2, useTronHeader)) { + return true; + } + throw new Error("Signature does not match"); + } + static verifySignature(message2, address2, signature2, useTronHeader = true) { + message2 = message2.replace(/^0x/, ""); + const messageBytes = [ + ...toUtf8Bytes(useTronHeader ? TRX_MESSAGE_HEADER : ETH_MESSAGE_HEADER), + ...utils$3.code.hexStr2byteArray(message2) + ]; + const messageDigest = keccak256(new Uint8Array(messageBytes)); + const recovered = recoverAddress(messageDigest, Signature.from(`0x${signature2.replace(/^0x/, "")}`)); + const tronAddress = ADDRESS_PREFIX + recovered.substr(2); + const base58Address = TronWeb.address.fromHex(tronAddress); + return base58Address == TronWeb.address.fromHex(address2); + } + async verifyMessageV2(message2, signature2) { + return Trx.verifyMessageV2(message2, signature2); + } + static verifyMessageV2(message2, signature2) { + return utils$3.message.verifyMessage(message2, signature2); + } + verifyTypedData(domain, types2, value, signature2, address2 = this.tronWeb.defaultAddress.base58) { + if (Trx.verifyTypedData(domain, types2, value, signature2, address2)) + return true; + throw new Error("Signature does not match"); + } + static verifyTypedData(domain, types2, value, signature2, address2) { + const messageDigest = utils$3._TypedDataEncoder.hash(domain, types2, value); + const recovered = recoverAddress(messageDigest, Signature.from(`0x${signature2.replace(/^0x/, "")}`)); + const tronAddress = ADDRESS_PREFIX + recovered.substr(2); + const base58Address = TronWeb.address.fromHex(tronAddress); + return base58Address == TronWeb.address.fromHex(address2); + } + async sign(transaction2, privateKey = this.tronWeb.defaultPrivateKey, useTronHeader = true, multisig = false) { + if (utils$3.isString(transaction2)) { + if (!utils$3.isHex(transaction2)) { + throw new Error("Expected hex message input"); + } + return Trx.signString(transaction2, privateKey, useTronHeader); + } + if (!utils$3.isObject(transaction2)) { + throw new Error("Invalid transaction provided"); + } + if (!multisig && transaction2.signature) { + throw new Error("Transaction is already signed"); + } + if (!multisig) { + const address2 = this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(privateKey)).toLowerCase(); + if (address2 !== this.tronWeb.address.toHex(transaction2.raw_data.contract[0].parameter.value.owner_address)) { + throw new Error("Private key does not match address in transaction"); + } + if (!txCheck(transaction2)) { + throw new Error("Invalid transaction"); + } + } + return utils$3.crypto.signTransaction(privateKey, transaction2); + } + static signString(message2, privateKey, useTronHeader = true) { + message2 = message2.replace(/^0x/, ""); + const value = `0x${privateKey.replace(/^0x/, "")}`; + const signingKey = new SigningKey(value); + const messageBytes = [ + ...toUtf8Bytes(useTronHeader ? TRX_MESSAGE_HEADER : ETH_MESSAGE_HEADER), + ...utils$3.code.hexStr2byteArray(message2) + ]; + const messageDigest = keccak256(new Uint8Array(messageBytes)); + const signature2 = signingKey.sign(messageDigest); + const signatureHex = ["0x", signature2.r.substring(2), signature2.s.substring(2), Number(signature2.v).toString(16)].join(""); + return signatureHex; + } + /** + * sign message v2 for verified header length + * + * @param {message to be signed, should be Bytes or string} message + * @param {privateKey for signature} privateKey + * @param {reserved} options + */ + signMessageV2(message2, privateKey = this.tronWeb.defaultPrivateKey) { + return Trx.signMessageV2(message2, privateKey); + } + static signMessageV2(message2, privateKey) { + return utils$3.message.signMessage(message2, privateKey); + } + _signTypedData(domain, types2, value, privateKey = this.tronWeb.defaultPrivateKey) { + return Trx._signTypedData(domain, types2, value, privateKey); + } + static _signTypedData(domain, types2, value, privateKey) { + return utils$3.crypto._signTypedData(domain, types2, value, privateKey); + } + async multiSign(transaction2, privateKey = this.tronWeb.defaultPrivateKey, permissionId = 0) { + if (!utils$3.isObject(transaction2) || !transaction2.raw_data || !transaction2.raw_data.contract) { + throw new Error("Invalid transaction provided"); + } + if (!transaction2.raw_data.contract[0].Permission_id && permissionId > 0) { + transaction2.raw_data.contract[0].Permission_id = permissionId; + const address2 = this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(privateKey)).toLowerCase(); + const signWeight = await this.getSignWeight(transaction2, permissionId); + if (signWeight.result.code === "PERMISSION_ERROR") { + throw new Error(signWeight.result.message); + } + let foundKey = false; + signWeight.permission.keys.map((key2) => { + if (key2.address === address2) + foundKey = true; + }); + if (!foundKey) { + throw new Error(privateKey + " has no permission to sign"); + } + if (signWeight.approved_list && signWeight.approved_list.indexOf(address2) != -1) { + throw new Error(privateKey + " already sign transaction"); + } + if (signWeight.transaction && signWeight.transaction.transaction) { + transaction2 = signWeight.transaction.transaction; + if (permissionId > 0) { + transaction2.raw_data.contract[0].Permission_id = permissionId; + } + } else { + throw new Error("Invalid transaction provided"); + } + } + if (!txCheck(transaction2)) { + throw new Error("Invalid transaction"); + } + return utils$3.crypto.signTransaction(privateKey, transaction2); + } + async getApprovedList(transaction2) { + if (!utils$3.isObject(transaction2)) { + throw new Error("Invalid transaction provided"); + } + return this.tronWeb.fullNode.request("wallet/getapprovedlist", transaction2, "post"); + } + async getSignWeight(transaction2, permissionId) { + if (!utils$3.isObject(transaction2) || !transaction2.raw_data || !transaction2.raw_data.contract) + throw new Error("Invalid transaction provided"); + if (utils$3.isInteger(permissionId)) { + transaction2.raw_data.contract[0].Permission_id = parseInt(permissionId); + } else if (typeof transaction2.raw_data.contract[0].Permission_id !== "number") { + transaction2.raw_data.contract[0].Permission_id = 0; + } + return this.tronWeb.fullNode.request("wallet/getsignweight", transaction2, "post"); + } + async sendRawTransaction(signedTransaction) { + if (!utils$3.isObject(signedTransaction)) { + throw new Error("Invalid transaction provided"); + } + if (!signedTransaction.signature || !utils$3.isArray(signedTransaction.signature)) { + throw new Error("Transaction is not signed"); + } + const result = await this.tronWeb.fullNode.request("wallet/broadcasttransaction", signedTransaction, "post"); + return { + ...result, + transaction: signedTransaction + }; + } + async sendHexTransaction(signedHexTransaction) { + if (!utils$3.isHex(signedHexTransaction)) { + throw new Error("Invalid hex transaction provided"); + } + const params = { + transaction: signedHexTransaction + }; + const result = await this.tronWeb.fullNode.request("wallet/broadcasthex", params, "post"); + if (result.result) { + return { + ...result, + transaction: JSON.parse(result.transaction), + hexTransaction: signedHexTransaction + }; + } + return result; + } + async sendTransaction(to2, amount, options = {}) { + if (typeof options === "string") + options = { privateKey: options }; + if (!this.tronWeb.isAddress(to2)) { + throw new Error("Invalid recipient provided"); + } + if (!utils$3.isInteger(amount) || amount <= 0) { + throw new Error("Invalid amount provided"); + } + options = { + privateKey: this.tronWeb.defaultPrivateKey, + address: this.tronWeb.defaultAddress.hex, + ...options + }; + if (!options.privateKey && !options.address) { + throw new Error("Function requires either a private key or address to be set"); + } + const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; + const transaction2 = await this.tronWeb.transactionBuilder.sendTrx(to2, amount, address2); + const signedTransaction = await this.sign(transaction2, options.privateKey); + const result = await this.sendRawTransaction(signedTransaction); + return result; + } + async sendToken(to2, amount, tokenID, options = {}) { + if (typeof options === "string") + options = { privateKey: options }; + if (!this.tronWeb.isAddress(to2)) { + throw new Error("Invalid recipient provided"); + } + if (!utils$3.isInteger(amount) || amount <= 0) { + throw new Error("Invalid amount provided"); + } + if (utils$3.isInteger(tokenID)) + tokenID = tokenID.toString(); + if (!utils$3.isString(tokenID)) { + throw new Error("Invalid token ID provided"); + } + options = { + privateKey: this.tronWeb.defaultPrivateKey, + address: this.tronWeb.defaultAddress.hex, + ...options + }; + if (!options.privateKey && !options.address) { + throw new Error("Function requires either a private key or address to be set"); + } + const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; + const transaction2 = await this.tronWeb.transactionBuilder.sendToken(to2, amount, tokenID, address2); + const signedTransaction = await this.sign(transaction2, options.privateKey); + const result = await this.sendRawTransaction(signedTransaction); + return result; + } + /** + * Freezes an amount of TRX. + * Will give bandwidth OR Energy and TRON Power(voting rights) + * to the owner of the frozen tokens. + * + * @param amount - is the number of frozen trx + * @param duration - is the duration in days to be frozen + * @param resource - is the type, must be either "ENERGY" or "BANDWIDTH" + * @param options + */ + async freezeBalance(amount = 0, duration = 3, resource = "BANDWIDTH", options = {}, receiverAddress) { + if (typeof options === "string") + options = { privateKey: options }; + if (!["BANDWIDTH", "ENERGY"].includes(resource)) { + throw new Error('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'); + } + if (!utils$3.isInteger(amount) || amount <= 0) { + throw new Error("Invalid amount provided"); + } + if (!utils$3.isInteger(duration) || duration < 3) { + throw new Error("Invalid duration provided, minimum of 3 days"); + } + options = { + privateKey: this.tronWeb.defaultPrivateKey, + address: this.tronWeb.defaultAddress.hex, + ...options + }; + if (!options.privateKey && !options.address) { + throw new Error("Function requires either a private key or address to be set"); + } + const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; + const freezeBalance = await this.tronWeb.transactionBuilder.freezeBalance(amount, duration, resource, address2, receiverAddress); + const signedTransaction = await this.sign(freezeBalance, options.privateKey); + const result = await this.sendRawTransaction(signedTransaction); + return result; + } + /** + * Unfreeze TRX that has passed the minimum freeze duration. + * Unfreezing will remove bandwidth and TRON Power. + * + * @param resource - is the type, must be either "ENERGY" or "BANDWIDTH" + * @param options + */ + async unfreezeBalance(resource = "BANDWIDTH", options = {}, receiverAddress) { + if (typeof options === "string") + options = { privateKey: options }; + if (!["BANDWIDTH", "ENERGY"].includes(resource)) { + throw new Error('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'); + } + options = { + privateKey: this.tronWeb.defaultPrivateKey, + address: this.tronWeb.defaultAddress.hex, + ...options + }; + if (!options.privateKey && !options.address) { + throw new Error("Function requires either a private key or address to be set"); + } + const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; + const unfreezeBalance = await this.tronWeb.transactionBuilder.unfreezeBalance(resource, address2, receiverAddress); + const signedTransaction = await this.sign(unfreezeBalance, options.privateKey); + const result = await this.sendRawTransaction(signedTransaction); + return result; + } + /** + * Modify account name + * Note: Username is allowed to edit only once. + * + * @param privateKey - Account private Key + * @param accountName - name of the account + * + * @return modified Transaction Object + */ + async updateAccount(accountName, options = {}) { + if (typeof options === "string") + options = { privateKey: options }; + if (!utils$3.isString(accountName) || !accountName.length) { + throw new Error("Name must be a string"); + } + options = { + privateKey: this.tronWeb.defaultPrivateKey, + address: this.tronWeb.defaultAddress.hex, + ...options + }; + if (!options.privateKey && !options.address) + throw Error("Function requires either a private key or address to be set"); + const address2 = options.privateKey ? this.tronWeb.address.fromPrivateKey(options.privateKey) : options.address; + const updateAccount = await this.tronWeb.transactionBuilder.updateAccount(accountName, address2); + const signedTransaction = await this.sign(updateAccount, options.privateKey); + const result = await this.sendRawTransaction(signedTransaction); + return result; + } + /** + * Gets a network modification proposal by ID. + */ + async getProposal(proposalID) { + if (!utils$3.isInteger(proposalID) || proposalID < 0) { + throw new Error("Invalid proposalID provided"); + } + return this.tronWeb.fullNode.request("wallet/getproposalbyid", { + id: parseInt(proposalID) + }, "post"); + } + /** + * Lists all network modification proposals. + */ + async listProposals() { + const { proposals = [] } = await this.tronWeb.fullNode.request("wallet/listproposals", {}, "post"); + return proposals; + } + /** + * Lists all parameters available for network modification proposals. + */ + async getChainParameters() { + const { chainParameter = [] } = await this.tronWeb.fullNode.request("wallet/getchainparameters", {}, "post"); + return chainParameter; + } + /** + * Get the account resources + */ + async getAccountResources(address2 = this.tronWeb.defaultAddress.hex) { + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + return this.tronWeb.fullNode.request("wallet/getaccountresource", { + address: this.tronWeb.address.toHex(address2) + }, "post"); + } + /** + * Query the amount of resources of a specific resourceType delegated by fromAddress to toAddress + */ + async getDelegatedResourceV2(fromAddress = this.tronWeb.defaultAddress.hex, toAddress = this.tronWeb.defaultAddress.hex, options = { confirmed: true }) { + if (!this.tronWeb.isAddress(fromAddress)) { + throw new Error("Invalid address provided"); + } + if (!this.tronWeb.isAddress(toAddress)) { + throw new Error("Invalid address provided"); + } + return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getdelegatedresourcev2`, { + fromAddress: toHex2(fromAddress), + toAddress: toHex2(toAddress) + }, "post"); + } + /** + * Query the resource delegation index by an account + */ + async getDelegatedResourceAccountIndexV2(address2 = this.tronWeb.defaultAddress.hex, options = { confirmed: true }) { + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getdelegatedresourceaccountindexv2`, { + value: toHex2(address2) + }, "post"); + } + /** + * Query the amount of delegatable resources of the specified resource Type for target address, unit is sun. + */ + async getCanDelegatedMaxSize(address2 = this.tronWeb.defaultAddress.hex, resource = "BANDWIDTH", options = { confirmed: true }) { + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + this.validator.notValid([ + { + name: "resource", + type: "resource", + value: resource, + msg: 'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"' + } + ]); + return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getcandelegatedmaxsize`, { + owner_address: toHex2(address2), + type: resource === "ENERGY" ? 1 : 0 + }, "post"); + } + /** + * Remaining times of available unstaking API + */ + async getAvailableUnfreezeCount(address2 = this.tronWeb.defaultAddress.hex, options = { confirmed: true }) { + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getavailableunfreezecount`, { + owner_address: toHex2(address2) + }, "post"); + } + /** + * Query the withdrawable balance at the specified timestamp + */ + async getCanWithdrawUnfreezeAmount(address2 = this.tronWeb.defaultAddress.hex, timestamp = Date.now(), options = { confirmed: true }) { + if (!this.tronWeb.isAddress(address2)) { + throw new Error("Invalid address provided"); + } + if (!utils$3.isInteger(timestamp) || timestamp < 0) { + throw new Error("Invalid timestamp provided"); + } + return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getcanwithdrawunfreezeamount`, { + owner_address: toHex2(address2), + timestamp + }, "post"); + } + /** + * Get the exchange ID. + */ + async getExchangeByID(exchangeID) { + if (!utils$3.isInteger(exchangeID) || exchangeID < 0) { + throw new Error("Invalid exchangeID provided"); + } + return this.tronWeb.fullNode.request("wallet/getexchangebyid", { + id: exchangeID + }, "post"); + } + /** + * Lists the exchanges + */ + async listExchanges() { + return this.tronWeb.fullNode.request("wallet/listexchanges", {}, "post").then(({ exchanges = [] }) => exchanges); + } + /** + * Lists all network modification proposals. + */ + async listExchangesPaginated(limit = 10, offset2 = 0) { + return this.tronWeb.fullNode.request("wallet/getpaginatedexchangelist", { + limit, + offset: offset2 + }, "post").then(({ exchanges = [] }) => exchanges); + } + /** + * Get info about thre node + */ + async getNodeInfo() { + return this.tronWeb.fullNode.request("wallet/getnodeinfo", {}, "post"); + } + async getTokenListByName(tokenID) { + if (utils$3.isInteger(tokenID)) + tokenID = tokenID.toString(); + if (!utils$3.isString(tokenID) || !tokenID.length) { + throw new Error("Invalid token ID provided"); + } + return this.tronWeb.fullNode.request("wallet/getassetissuelistbyname", { + value: this.tronWeb.fromUtf8(tokenID) + }, "post").then((token2) => { + if (Array.isArray(token2.assetIssue)) { + return token2.assetIssue.map((t2) => this._parseToken(t2)); + } else if (!token2.name) { + throw new Error("Token does not exist"); + } + return this._parseToken(token2); + }); + } + getTokenByID(tokenID) { + if (utils$3.isInteger(tokenID)) + tokenID = tokenID.toString(); + if (!utils$3.isString(tokenID) || !tokenID.length) { + throw new Error("Invalid token ID provided"); + } + return this.tronWeb.fullNode.request("wallet/getassetissuebyid", { + value: tokenID + }, "post").then((token2) => { + if (!token2.name) { + throw new Error("Token does not exist"); + } + return this._parseToken(token2); + }); + } + async getReward(address2, options = {}) { + options.confirmed = true; + return this._getReward(address2, options); + } + async getUnconfirmedReward(address2, options = {}) { + options.confirmed = false; + return this._getReward(address2, options); + } + async getBrokerage(address2, options = {}) { + options.confirmed = true; + return this._getBrokerage(address2, options); + } + async getUnconfirmedBrokerage(address2, options = {}) { + options.confirmed = false; + return this._getBrokerage(address2, options); + } + async _getReward(address2 = this.tronWeb.defaultAddress.hex, options) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + } + ]); + const data = { + address: toHex2(address2) + }; + return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getReward`, data, "post").then((result = { reward: void 0 }) => { + if (typeof result.reward === "undefined") { + throw new Error("Not found."); + } + return result.reward; + }); + } + async _getBrokerage(address2 = this.tronWeb.defaultAddress.hex, options) { + this.validator.notValid([ + { + name: "origin", + type: "address", + value: address2 + } + ]); + const data = { + address: toHex2(address2) + }; + return this.tronWeb[options.confirmed ? "solidityNode" : "fullNode"].request(`wallet${options.confirmed ? "solidity" : ""}/getBrokerage`, data, "post").then((result = {}) => { + if (typeof result.brokerage === "undefined") { + throw new Error("Not found."); + } + return result.brokerage; + }); + } + async getBandwidthPrices() { + return this.tronWeb.fullNode.request("wallet/getbandwidthprices", {}, "post").then((result = {}) => { + if (typeof result.prices === "undefined") { + throw new Error("Not found."); + } + return result.prices; + }); + } + async getEnergyPrices() { + return this.tronWeb.fullNode.request("wallet/getenergyprices", {}, "post").then((result = {}) => { + if (typeof result.prices === "undefined") { + throw new Error("Not found."); + } + return result.prices; + }); + } +} +const getFunctionSelector = (abi2) => { + if ("stateMutability" in abi2) { + abi2.stateMutability = abi2.stateMutability ? abi2.stateMutability.toLowerCase() : "nonpayable"; + } + abi2.type = abi2.type ? abi2.type.toLowerCase() : ""; + if (abi2.type === "fallback" || abi2.type === "receive") + return "0x"; + const iface = new utils$3.ethersUtils.Interface([abi2]); + let obj; + if (abi2.type === "event") { + obj = iface.getEvent(abi2.name); + } else { + obj = iface.getFunction(abi2.name); + } + if (obj) { + return obj.format("sighash"); + } + throw new Error("unknown function"); +}; +const decodeOutput = (abi2, output2) => { + return decodeParamsV2ByABI(abi2, output2); +}; +class Method { + constructor(contract, abi2) { + __publicField(this, "tronWeb"); + __publicField(this, "contract"); + __publicField(this, "abi"); + __publicField(this, "name"); + __publicField(this, "inputs"); + __publicField(this, "outputs"); + __publicField(this, "functionSelector"); + __publicField(this, "signature"); + __publicField(this, "defaultOptions"); + this.tronWeb = contract.tronWeb; + this.contract = contract; + this.abi = abi2; + this.name = abi2.name || abi2.type; + this.inputs = abi2.inputs || []; + this.outputs = []; + if ("outputs" in abi2 && abi2.outputs) { + this.outputs = abi2.outputs; + } + this.functionSelector = getFunctionSelector(abi2); + this.signature = sha3(this.functionSelector, false).slice(0, 8); + this.defaultOptions = { + feeLimit: this.tronWeb.feeLimit, + callValue: 0, + userFeePercentage: 100, + shouldPollResponse: false + // Only used for sign() + }; + } + decodeInput(data) { + const abi2 = JSON.parse(JSON.stringify(this.abi)); + abi2.outputs = abi2.inputs; + return decodeOutput(abi2, "0x" + data); + } + onMethod(...args) { + let rawParameter = ""; + if (this.abi && !/event/i.test(this.abi.type)) { + rawParameter = encodeParamsV2ByABI(this.abi, args); + } + return { + call: async (options = {}) => { + options = { + ...options, + rawParameter + }; + return await this._call([], [], options); + }, + send: async (options = {}, privateKey = this.tronWeb.defaultPrivateKey) => { + options = { + ...options, + rawParameter + }; + return await this._send([], [], options, privateKey); + } + }; + } + async _call(types2, args, options = {}) { + if (types2.length !== args.length) { + throw new Error("Invalid argument count provided"); + } + if (!this.contract.address) { + throw new Error("Smart contract is missing address"); + } + if (!this.contract.deployed) { + throw new Error("Calling smart contracts requires you to load the contract first"); + } + if ("stateMutability" in this.abi) { + const { stateMutability } = this.abi; + if (stateMutability && !["pure", "view"].includes(stateMutability.toLowerCase())) { + throw new Error(`Methods with state mutability "${stateMutability}" must use send()`); + } + } + options = { + ...this.defaultOptions, + from: this.tronWeb.defaultAddress.hex, + ...options, + _isConstant: true + }; + const parameters = args.map((value, index2) => ({ + type: types2[index2], + value + })); + const transaction2 = await this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address, this.functionSelector, options, parameters, options.from ? this.tronWeb.address.toHex(options.from) : void 0); + if (!utils$3.hasProperty(transaction2, "constant_result")) { + throw new Error("Failed to execute"); + } + const len = transaction2.constant_result[0].length; + if (len === 0 || len % 64 === 8) { + let msg = "The call has been reverted or has thrown an error."; + if (len !== 0) { + msg += " Error message: "; + let msg2 = ""; + const chunk = transaction2.constant_result[0].substring(8); + for (let i2 = 0; i2 < len - 8; i2 += 64) { + msg2 += this.tronWeb.toUtf8(chunk.substring(i2, i2 + 64)); + } + msg += msg2.replace(/(\u0000|\u000b|\f)+/g, " ").replace(/ +/g, " ").replace(/\s+$/g, ""); + } + throw new Error(msg); + } + let output2 = decodeOutput(this.abi, "0x" + transaction2.constant_result[0]); + if (output2.length === 1 && Object.keys(output2).length === 1) { + output2 = output2[0]; + } + return output2; + } + async _send(types2, args, options = {}, privateKey = this.tronWeb.defaultPrivateKey) { + if (types2.length !== args.length) { + throw new Error("Invalid argument count provided"); + } + if (!this.contract.address) { + throw new Error("Smart contract is missing address"); + } + if (!this.contract.deployed) { + throw new Error("Calling smart contracts requires you to load the contract first"); + } + const { stateMutability } = this.abi; + if (["pure", "view"].includes(stateMutability.toLowerCase())) { + throw new Error(`Methods with state mutability "${stateMutability}" must use call()`); + } + if (!["payable"].includes(stateMutability.toLowerCase())) { + options.callValue = 0; + } + options = { + ...this.defaultOptions, + from: this.tronWeb.defaultAddress.hex, + ...options + }; + const parameters = args.map((value, index2) => ({ + type: types2[index2], + value + })); + const address2 = privateKey ? this.tronWeb.address.fromPrivateKey(privateKey) : this.tronWeb.defaultAddress.base58; + const transaction2 = await this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address, this.functionSelector, options, parameters, this.tronWeb.address.toHex(address2)); + if (!transaction2.result || !transaction2.result.result) { + throw new Error("Unknown error: " + JSON.stringify(transaction2, null, 2)); + } + const signedTransaction = await this.tronWeb.trx.sign(transaction2.transaction, privateKey); + if (!signedTransaction.signature) { + if (!privateKey) { + throw new Error("Transaction was not signed properly"); + } + throw new Error("Invalid private key provided"); + } + const broadcast = await this.tronWeb.trx.sendRawTransaction(signedTransaction); + if (broadcast.code) { + const err = { + error: broadcast.code, + message: broadcast.code + }; + if (broadcast.message) + err.message = this.tronWeb.toUtf8(broadcast.message); + const error = new Error(err.message); + error.error = broadcast.code; + throw error; + } + if (!options.shouldPollResponse) { + return signedTransaction.txID; + } + const checkResult = async (index2) => { + if (index2 === (options.pollTimes || 20)) { + const error = new Error("Cannot find result in solidity node"); + error.error = "Cannot find result in solidity node"; + error.transaction = signedTransaction; + throw error; + } + const output2 = await this.tronWeb.trx.getTransactionInfo(signedTransaction.txID); + if (!Object.keys(output2).length) { + await new Promise((r2) => setTimeout(r2, 3e3)); + return checkResult(index2 + 1); + } + if (output2.result && output2.result === "FAILED") { + const error = new Error(this.tronWeb.toUtf8(output2.resMessage)); + error.error = this.tronWeb.toUtf8(output2.resMessage); + error.transaction = signedTransaction; + error.output = output2; + throw error; + } + if (!utils$3.hasProperty(output2, "contractResult")) { + const error = new Error("Failed to execute: " + JSON.stringify(output2, null, 2)); + error.error = "Failed to execute: " + JSON.stringify(output2, null, 2); + error.transaction = signedTransaction; + error.output = output2; + throw error; + } + if (options.rawResponse) { + return output2; + } + let decoded = decodeOutput(this.abi, "0x" + output2.contractResult[0]); + if (decoded.length === 1 && Object.keys(decoded).length === 1) { + decoded = decoded[0]; + } + if (options.keepTxID) { + return [signedTransaction.txID, decoded]; + } + return decoded; + }; + return checkResult(0); + } +} +class Contract { + constructor(tronWeb, abi2 = [], address2) { + __publicField(this, "tronWeb"); + __publicField(this, "abi"); + __publicField(this, "address"); + __publicField(this, "eventListener"); + __publicField(this, "bytecode"); + __publicField(this, "deployed"); + __publicField(this, "lastBlock"); + __publicField(this, "methods"); + __publicField(this, "methodInstances"); + __publicField(this, "props"); + if (!tronWeb || !(tronWeb instanceof TronWeb)) + throw new Error("Expected instance of TronWeb"); + this.tronWeb = tronWeb; + this.address = address2; + this.abi = abi2; + this.eventListener = false; + this.bytecode = false; + this.deployed = false; + this.lastBlock = false; + this.methods = {}; + this.methodInstances = {}; + this.props = []; + if (utils$3.address.isAddress(address2)) { + this.deployed = true; + } else { + this.address = false; + } + this.loadAbi(abi2); + } + hasProperty(property) { + return this.hasOwnProperty(property) || this.__proto__.hasOwnProperty(property); + } + loadAbi(abi2) { + this.abi = abi2; + this.methods = {}; + this.props.forEach((prop) => delete this[prop]); + abi2.forEach((func) => { + if (!func.type || /constructor|error/i.test(func.type)) + return; + const method = new Method(this, func); + const methodCall = method.onMethod.bind(method); + const { name: name2, functionSelector, signature: signature2 } = method; + this.methods[name2] = methodCall; + this.methods[functionSelector] = methodCall; + this.methods[signature2] = methodCall; + this.methodInstances[name2] = method; + this.methodInstances[functionSelector] = method; + this.methodInstances[signature2] = method; + if (!this.hasProperty(name2)) { + this[name2] = methodCall; + this.props.push(name2); + } + if (!this.hasProperty(functionSelector)) { + this[functionSelector] = methodCall; + this.props.push(functionSelector); + } + if (!this.hasProperty(signature2)) { + this[signature2] = methodCall; + this.props.push(signature2); + } + }); + } + decodeInput(data) { + const methodName = data.substring(0, 8); + const inputData = data.substring(8); + if (!this.methodInstances[methodName]) + throw new Error("Contract method " + methodName + " not found"); + const methodInstance = this.methodInstances[methodName]; + return { + name: methodInstance.name, + params: this.methodInstances[methodName].decodeInput(inputData) + }; + } + async new(options, privateKey = this.tronWeb.defaultPrivateKey) { + const address2 = this.tronWeb.address.fromPrivateKey(privateKey); + const transaction2 = await this.tronWeb.transactionBuilder.createSmartContract(options, address2); + const signedTransaction = await this.tronWeb.trx.sign(transaction2, privateKey); + const contract = await this.tronWeb.trx.sendRawTransaction(signedTransaction); + if (contract.code) { + throw { + error: contract.code, + message: this.tronWeb.toUtf8(contract.message) + }; + } + await utils$3.sleep(3e3); + return this.at(signedTransaction.contract_address); + } + async at(contractAddress) { + try { + const contract = await this.tronWeb.trx.getContract(contractAddress); + if (!contract.contract_address) { + throw new Error("Unknown error: " + JSON.stringify(contract, null, 2)); + } + this.address = contract.contract_address; + this.bytecode = contract.bytecode; + this.deployed = true; + this.loadAbi(contract.abi ? contract.abi.entrys ? contract.abi.entrys : [] : []); + return this; + } catch (ex2) { + if (ex2.toString().includes("does not exist")) { + throw new Error("Contract has not been deployed on the network"); + } + throw new Error(ex2); + } + } +} +class Plugin { + constructor(tronWeb, options = {}) { + __publicField(this, "tronWeb"); + __publicField(this, "pluginNoOverride"); + __publicField(this, "disablePlugins"); + if (!tronWeb || !(tronWeb instanceof TronWeb)) + throw new Error("Expected instance of TronWeb"); + this.tronWeb = tronWeb; + this.pluginNoOverride = ["register"]; + this.disablePlugins = !!options.disablePlugins; + } + register(Plugin2, options) { + let pluginInterface = { + requires: "0.0.0", + components: {} + }; + const result = { + libs: [], + plugged: [], + skipped: [], + error: void 0 + }; + if (this.disablePlugins) { + result.error = "This instance of TronWeb has plugins disabled."; + return result; + } + const plugin = new Plugin2(this.tronWeb); + if (utils$3.isFunction(plugin.pluginInterface)) { + pluginInterface = plugin.pluginInterface(options); + } + if (semver.satisfies(TronWeb.version, pluginInterface.requires)) { + if (pluginInterface.fullClass) { + const className = plugin.constructor.name; + const classInstanceName = className.substring(0, 1).toLowerCase() + className.substring(1); + if (className !== classInstanceName) { + Object.assign(TronWeb, { + [className]: Plugin2 + }); + Object.assign(this.tronWeb, { + [classInstanceName]: plugin + }); + result.libs.push(className); + } + } else { + for (const component in pluginInterface.components) { + if (!this.tronWeb.hasOwnProperty(component)) { + continue; + } + const methods = pluginInterface.components[component]; + const pluginNoOverride = this.tronWeb[component].pluginNoOverride || []; + for (const method in methods) { + if (method === "constructor" || this.tronWeb[component][method] && (pluginNoOverride.includes(method) || // blacklisted methods + /^_/.test(method))) { + result.skipped.push(method); + continue; + } + this.tronWeb[component][method] = methods[method].bind(this.tronWeb[component]); + result.plugged.push(method); + } + } + } + } else { + throw new Error("The plugin is not compatible with this version of TronWeb"); + } + return result; + } +} +let Event$1 = class Event2 { + constructor(tronWeb) { + __publicField(this, "tronWeb"); + if (!tronWeb || !(tronWeb instanceof TronWeb)) + throw new Error("Expected instance of TronWeb"); + this.tronWeb = tronWeb; + } + setServer(eventServer, healthcheck = "healthcheck") { + if (!eventServer) + return this.tronWeb.eventServer = void 0; + if (utils$3.isString(eventServer)) + eventServer = new HttpProvider(eventServer); + if (!this.tronWeb.isValidProvider(eventServer)) + throw new Error("Invalid event server provided"); + this.tronWeb.eventServer = eventServer; + this.tronWeb.eventServer.isConnected = () => this.tronWeb.eventServer.request(healthcheck).then(() => true).catch(() => false); + } + async getEventsByContractAddress(contractAddress, options = {}) { + const newOptions = Object.assign({ + limit: 20 + }, options); + const { eventName, blockNumber, onlyUnconfirmed, onlyConfirmed, minBlockTimestamp, maxBlockTimestamp, orderBy, fingerprint } = newOptions; + let { limit } = newOptions; + if (!this.tronWeb.eventServer) { + throw new Error("No event server configured"); + } + if (!this.tronWeb.isAddress(contractAddress)) { + throw new Error("Invalid contract address provided"); + } + if (typeof minBlockTimestamp !== "undefined" && !utils$3.isInteger(minBlockTimestamp)) { + throw new Error("Invalid minBlockTimestamp provided"); + } + if (typeof maxBlockTimestamp !== "undefined" && !utils$3.isInteger(maxBlockTimestamp)) { + throw new Error("Invalid maxBlockTimestamp provided"); + } + if (utils$3.isInteger(limit) && limit > 200) { + console.warn("Defaulting to maximum accepted limit: 200"); + limit = 200; + } + const qs2 = {}; + if (eventName) + qs2.event_name = eventName; + if (blockNumber) + qs2.block_number = blockNumber; + if (typeof onlyUnconfirmed === "boolean") + qs2.only_unconfirmed = onlyUnconfirmed; + if (typeof onlyConfirmed === "boolean") + qs2.only_confirmed = onlyConfirmed; + if (minBlockTimestamp) + qs2.min_block_timestamp = minBlockTimestamp; + if (maxBlockTimestamp) + qs2.max_block_timestamp = maxBlockTimestamp; + if (orderBy) + qs2.order_by = orderBy; + if (fingerprint) + qs2.fingerprint = fingerprint; + if (utils$3.isInteger(limit)) + qs2.limit = limit; + const res = await this.tronWeb.eventServer.request(`v1/contracts/${this.tronWeb.address.fromHex(contractAddress)}/events?${new URLSearchParams(qs2).toString()}`); + if (res.success) { + return res; + } + throw new Error(res.error); + } + async getEventsByTransactionID(transactionID, options = {}) { + if (!this.tronWeb.eventServer) { + throw new Error("No event server configured"); + } + const qs2 = {}; + if (typeof options.only_unconfirmed === "boolean") { + qs2.only_unconfirmed = options.only_unconfirmed; + } + if (typeof options.only_confirmed === "boolean") { + qs2.only_confirmed = options.only_confirmed; + } + return this.tronWeb.eventServer.request(`v1/transactions/${transactionID}/events?${new URLSearchParams(qs2).toString()}`).then((res) => { + if (res.success) { + return res; + } + throw new Error(JSON.parse(res.error).message); + }); + } + async getEventsByBlockNumber(blockNumber, options = {}) { + if (!this.tronWeb.eventServer) { + throw new Error("No event server configured"); + } + const qs2 = {}; + if (typeof options.only_confirmed === "boolean") { + qs2.only_confirmed = options.only_confirmed; + } + if (options.limit) { + qs2.limit = options.limit; + } + if (options.fingerprint) { + qs2.fingerprint = options.fingerprint; + } + return this.tronWeb.eventServer.request(`v1/blocks/${blockNumber}/events?${new URLSearchParams(qs2).toString()}`).then((res) => { + if (res.success) { + return res; + } + throw new Error(res.error); + }); + } + async getEventsOfLatestBlock(options = {}) { + if (!this.tronWeb.eventServer) { + throw new Error("No event server configured"); + } + const qs2 = {}; + if (typeof options.only_confirmed === "boolean") { + qs2.only_confirmed = options.only_confirmed; + } + return this.tronWeb.eventServer.request(`v1/blocks/latest/events?${new URLSearchParams(qs2).toString()}`).then((res) => { + if (res.success) { + return res; + } + throw new Error(res.error); + }); + } +}; +const DEFAULT_VERSION = "4.7.1"; +const FEE_LIMIT = 15e7; +const version$1 = "6.0.0"; +function isValidOptions(options) { + return !!options && typeof options === "object" && (!!options.fullNode || !!options.fullHost); +} +const _TronWeb = class _TronWeb extends EventEmitter$1 { + constructor(options, solidityNode = "", eventServer, privateKey = "") { + super(); + __publicField(this, "providers"); + __publicField(this, "BigNumber"); + __publicField(this, "transactionBuilder"); + __publicField(this, "trx"); + __publicField(this, "plugin"); + __publicField(this, "event"); + __publicField(this, "version"); + __publicField(this, "utils"); + __publicField(this, "defaultBlock"); + __publicField(this, "defaultPrivateKey"); + __publicField(this, "defaultAddress"); + __publicField(this, "fullnodeVersion"); + __publicField(this, "feeLimit"); + __publicField(this, "fullNode"); + __publicField(this, "solidityNode"); + __publicField(this, "eventServer"); + __publicField(this, "address"); + __publicField(this, "sha3"); + __publicField(this, "toHex"); + __publicField(this, "toUtf8"); + __publicField(this, "fromUtf8"); + __publicField(this, "toAscii"); + __publicField(this, "fromAscii"); + __publicField(this, "toDecimal"); + __publicField(this, "fromDecimal"); + __publicField(this, "fromSun"); + __publicField(this, "toSun"); + __publicField(this, "toBigNumber"); + __publicField(this, "isAddress"); + __publicField(this, "createAccount"); + __publicField(this, "createRandom"); + __publicField(this, "fromMnemonic"); + let fullNode; + let headers = false; + let eventHeaders = false; + if (isValidOptions(options)) { + fullNode = options.fullNode || options.fullHost; + solidityNode = options.solidityNode || options.fullHost; + eventServer = options.eventServer || options.fullHost; + headers = options.headers || false; + eventHeaders = options.eventHeaders || headers; + privateKey = options.privateKey; + } else { + fullNode = options; + } + if (utils$3.isString(fullNode)) + fullNode = new providers.HttpProvider(fullNode); + if (utils$3.isString(solidityNode)) + solidityNode = new providers.HttpProvider(solidityNode); + if (utils$3.isString(eventServer)) + eventServer = new providers.HttpProvider(eventServer); + this.event = new Event$1(this); + this.transactionBuilder = new TransactionBuilder(this); + this.trx = new Trx(this); + this.plugin = new Plugin(this, { + disablePlugins: isValidOptions(options) ? options.disablePlugins : false + }); + this.utils = utils$3; + this.setFullNode(fullNode); + this.setSolidityNode(solidityNode); + this.setEventServer(eventServer); + this.providers = providers; + this.BigNumber = BigNumber; + this.defaultBlock = false; + this.defaultPrivateKey = false; + this.defaultAddress = { + hex: false, + base58: false + }; + this.version = _TronWeb.version; + this.sha3 = _TronWeb.sha3; + this.fromUtf8 = _TronWeb.fromUtf8; + this.address = _TronWeb.address; + this.toAscii = _TronWeb.toAscii; + this.toUtf8 = _TronWeb.toUtf8; + this.isAddress = _TronWeb.isAddress; + this.fromAscii = _TronWeb.fromAscii; + this.toHex = _TronWeb.toHex; + this.toBigNumber = _TronWeb.toBigNumber; + this.toDecimal = _TronWeb.toDecimal; + this.fromDecimal = _TronWeb.fromDecimal; + this.toSun = _TronWeb.toSun; + this.fromSun = _TronWeb.fromSun; + this.createAccount = _TronWeb.createAccount; + this.createRandom = _TronWeb.createRandom; + this.fromMnemonic = _TronWeb.fromMnemonic; + if (privateKey) + this.setPrivateKey(privateKey); + this.fullnodeVersion = DEFAULT_VERSION; + this.feeLimit = FEE_LIMIT; + if (headers) { + this.setFullNodeHeader(headers); + } + if (eventHeaders) { + this.setEventHeader(eventHeaders); + } + } + async getFullnodeVersion() { + try { + const nodeInfo = await this.trx.getNodeInfo(); + this.fullnodeVersion = nodeInfo.configNodeInfo.codeVersion; + if (this.fullnodeVersion.split(".").length === 2) { + this.fullnodeVersion += ".0"; + } + } catch (err) { + this.fullnodeVersion = DEFAULT_VERSION; + } + } + setDefaultBlock(blockID = false) { + if ([false, "latest", "earliest", 0].includes(blockID)) { + return this.defaultBlock = blockID; + } + if (!utils$3.isInteger(blockID) || !blockID) + throw new Error("Invalid block ID provided"); + return this.defaultBlock = Math.abs(blockID); + } + setPrivateKey(privateKey) { + try { + this.setAddress(_TronWeb.address.fromPrivateKey(privateKey)); + } catch { + throw new Error("Invalid private key provided"); + } + this.defaultPrivateKey = privateKey; + this.emit("privateKeyChanged", privateKey); + } + setAddress(address2) { + if (!_TronWeb.isAddress(address2)) + throw new Error("Invalid address provided"); + const hex = _TronWeb.address.toHex(address2); + const base582 = _TronWeb.address.fromHex(address2); + if (this.defaultPrivateKey && _TronWeb.address.fromPrivateKey(this.defaultPrivateKey) !== base582) + this.defaultPrivateKey = false; + this.defaultAddress = { + hex, + base58: base582 + }; + this.emit("addressChanged", { hex, base58: base582 }); + } + fullnodeSatisfies(version2) { + return semver.satisfies(this.fullnodeVersion, version2); + } + isValidProvider(provider) { + return Object.values(providers).some((knownProvider) => provider instanceof knownProvider); + } + setFullNode(fullNode) { + if (isString$1(fullNode)) + fullNode = new providers.HttpProvider(fullNode); + if (!this.isValidProvider(fullNode)) + throw new Error("Invalid full node provided"); + this.fullNode = fullNode; + this.fullNode.setStatusPage("wallet/getnowblock"); + } + setSolidityNode(solidityNode) { + if (utils$3.isString(solidityNode)) + solidityNode = new providers.HttpProvider(solidityNode); + if (!this.isValidProvider(solidityNode)) + throw new Error("Invalid solidity node provided"); + this.solidityNode = solidityNode; + this.solidityNode.setStatusPage("walletsolidity/getnowblock"); + } + setEventServer(eventServer, healthcheck) { + this.event.setServer(eventServer, healthcheck); + } + setHeader(headers = {}) { + const fullNode = new providers.HttpProvider(this.fullNode.host, 3e4, "", "", headers); + const solidityNode = new providers.HttpProvider(this.solidityNode.host, 3e4, "", "", headers); + const eventServer = new providers.HttpProvider(this.eventServer.host, 3e4, "", "", headers); + this.setFullNode(fullNode); + this.setSolidityNode(solidityNode); + this.setEventServer(eventServer); + } + setFullNodeHeader(headers = {}) { + const fullNode = new providers.HttpProvider(this.fullNode.host, 3e4, "", "", headers); + const solidityNode = new providers.HttpProvider(this.solidityNode.host, 3e4, "", "", headers); + this.setFullNode(fullNode); + this.setSolidityNode(solidityNode); + } + setEventHeader(headers = {}) { + const eventServer = new providers.HttpProvider(this.eventServer.host, 3e4, "", "", headers); + this.setEventServer(eventServer); + } + currentProviders() { + return { + fullNode: this.fullNode, + solidityNode: this.solidityNode, + eventServer: this.eventServer + }; + } + currentProvider() { + return this.currentProviders(); + } + getEventResult(...params) { + return this.event.getEventsByContractAddress(...params); + } + getEventByTransactionID(...params) { + return this.event.getEventsByTransactionID(...params); + } + contract(abi2 = [], address2) { + return new Contract(this, abi2, address2); + } + static get address() { + return { + fromHex(address2) { + return fromHex(address2); + }, + toHex(address2) { + return toHex$1(address2); + }, + toChecksumAddress(address2) { + return toChecksumAddress(address2); + }, + isChecksumAddress(address2) { + return isChecksumAddress(address2); + }, + fromPrivateKey(privateKey, strict = false) { + return fromPrivateKey(privateKey, strict); + } + }; + } + static sha3(string2, prefix = true) { + return (prefix ? "0x" : "") + keccak256(Buffer.from(string2, "utf-8")).toString().substring(2); + } + static toHex(val) { + if (utils$3.isBoolean(val)) + return _TronWeb.fromDecimal(+val); + if (utils$3.isBigNumber(val)) + return _TronWeb.fromDecimal(val); + if (typeof val === "object") + return _TronWeb.fromUtf8(JSON.stringify(val)); + if (utils$3.isString(val)) { + if (/^(-|)0x/.test(val)) + return val; + if (!isFinite(val) || /^\s*$/.test(val)) + return _TronWeb.fromUtf8(val); + } + const result = _TronWeb.fromDecimal(val); + if (result === "0xNaN") { + throw new Error("The passed value is not convertible to a hex string"); + } else { + return result; + } + } + static toUtf8(hex) { + if (utils$3.isHex(hex)) { + hex = hex.replace(/^0x/, ""); + return Buffer.from(hex, "hex").toString("utf8"); + } else { + throw new Error("The passed value is not a valid hex string"); + } + } + static fromUtf8(string2) { + if (!utils$3.isString(string2)) { + throw new Error("The passed value is not a valid utf-8 string"); + } + return "0x" + Buffer.from(string2, "utf8").toString("hex"); + } + static toAscii(hex) { + if (utils$3.isHex(hex)) { + let str = ""; + let i2 = 0; + const l2 = hex.length; + if (hex.substring(0, 2) === "0x") { + i2 = 2; + } + for (; i2 < l2; i2 += 2) { + const code2 = parseInt(hex.substr(i2, 2), 16); + str += String.fromCharCode(code2); + } + return str; + } else { + throw new Error("The passed value is not a valid hex string"); + } + } + static fromAscii(string2, padding2) { + if (!utils$3.isString(string2)) { + throw new Error("The passed value is not a valid utf-8 string"); + } + return "0x" + Buffer.from(string2, "ascii").toString("hex").padEnd(padding2, "0"); + } + static toDecimal(value) { + return _TronWeb.toBigNumber(value).toNumber(); + } + static fromDecimal(value) { + const number2 = _TronWeb.toBigNumber(value); + const result = number2.toString(16); + return number2.isLessThan(0) ? "-0x" + result.substr(1) : "0x" + result; + } + static fromSun(sun) { + const trx = _TronWeb.toBigNumber(sun).div(1e6); + return utils$3.isBigNumber(sun) ? trx : trx.toString(10); + } + static toSun(trx) { + const sun = _TronWeb.toBigNumber(trx).times(1e6); + return utils$3.isBigNumber(trx) ? sun : sun.toString(10); + } + static toBigNumber(amount = 0) { + if (utils$3.isBigNumber(amount)) + return amount; + if (utils$3.isString(amount) && /^(-|)0x/.test(amount)) + return new BigNumber(amount.replace("0x", ""), 16); + return new BigNumber(amount.toString(10), 10); + } + static isAddress(address2 = "") { + return isAddress(address2); + } + static async createAccount() { + const account = utils$3.accounts.generateAccount(); + return account; + } + static createRandom(...params) { + const account = utils$3.accounts.generateRandom(...params); + return account; + } + static fromMnemonic(...params) { + const account = utils$3.accounts.generateAccountWithMnemonic(...params); + return account; + } + async isConnected() { + return { + fullNode: await this.fullNode.isConnected(), + solidityNode: await this.solidityNode.isConnected(), + eventServer: this.eventServer && await this.eventServer.isConnected() + }; + } +}; +__publicField(_TronWeb, "version", version$1); +let TronWeb = _TronWeb; +function getAddress(address2) { + return TronWeb.address.toHex(address2).replace(ADDRESS_PREFIX_REGEX, "0x"); +} +function getTronAddress(address2) { + return TronWeb.address.toHex(address2); +} +const padding = new Uint8Array(32); +padding.fill(0); +const BN__1 = BigInt(-1); +const BN_0 = BigInt(0); +const BN_1 = BigInt(1); +const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); +function hexPadRight(value) { + const bytes2 = getBytes(value); + const padOffset = bytes2.length % 32; + if (padOffset) { + return concat([bytes2, padding.slice(padOffset)]); + } + return hexlify(bytes2); +} +const hexTrue = toBeHex(BN_1, 32); +const hexFalse = toBeHex(BN_0, 32); +const domainFieldTypes = { + name: "string", + version: "string", + chainId: "uint256", + verifyingContract: "address", + salt: "bytes32" +}; +const domainFieldNames = ["name", "version", "chainId", "verifyingContract", "salt"]; +function checkString(key2) { + return function(value) { + assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key2)}`, `domain.${key2}`, value); + return value; + }; +} +const domainChecks = { + name: checkString("name"), + version: checkString("version"), + chainId: function(_value2) { + const value = getBigInt(_value2, "domain.chainId"); + assertArgument(value >= 0, "invalid chain ID", "domain.chainId", _value2); + if (Number.isSafeInteger(value)) { + return Number(value); + } + return toQuantity(value); + }, + verifyingContract: function(value) { + try { + return getTronAddress(value).toLowerCase(); + } catch (error) { + } + assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); + }, + salt: function(value) { + const bytes2 = getBytes(value, "domain.salt"); + assertArgument(bytes2.length === 32, `invalid domain value "salt"`, "domain.salt", value); + return hexlify(bytes2); + } +}; +function getBaseEncoder(type2) { + { + const match = type2.match(/^(u?)int(\d*)$/); + if (match) { + const signed = match[1] === ""; + const width = parseInt(match[2] || "256"); + assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type2); + const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); + const boundsLower = signed ? (boundsUpper + BN_1) * BN__1 : BN_0; + return function(_value2) { + const value = getBigInt(_value2, "value"); + assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type2}`, "value", value); + return toBeHex(signed ? toTwos(value, 256) : value, 32); + }; + } + } + { + const match = type2.match(/^bytes(\d+)$/); + if (match) { + const width = parseInt(match[1]); + assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type2); + return function(value) { + const bytes2 = getBytes(value); + assertArgument(bytes2.length === width, `invalid length for ${type2}`, "value", value); + return hexPadRight(value); + }; + } + } + switch (type2) { + case "trcToken": + return getBaseEncoder("uint256"); + case "address": + return function(value) { + return zeroPadValue(getAddress(value), 32); + }; + case "bool": + return function(value) { + return !value ? hexFalse : hexTrue; + }; + case "bytes": + return function(value) { + return keccak256(value); + }; + case "string": + return function(value) { + return id(value); + }; + } + return null; +} +function encodeType(name2, fields) { + return `${name2}(${fields.map(({ name: name3, type: type2 }) => type2 + " " + name3).join(",")})`; +} +const _TypedDataEncoder = class _TypedDataEncoder { + /** + * Create a new **TypedDataEncoder** for %%types%%. + * + * This performs all necessary checking that types are valid and + * do not violate the [[link-eip-712]] structural constraints as + * well as computes the [[primaryType]]. + */ + constructor(types2) { + __privateAdd(this, _getEncoder2); + /** + * The primary type for the structured [[types]]. + * + * This is derived automatically from the [[types]], since no + * recursion is possible, once the DAG for the types is consturcted + * internally, the primary type must be the only remaining type with + * no parent nodes. + */ + __publicField(this, "primaryType"); + __privateAdd(this, _types2, void 0); + __privateAdd(this, _fullTypes2, void 0); + __privateAdd(this, _encoderCache2, void 0); + __privateSet(this, _types2, JSON.stringify(types2)); + __privateSet(this, _fullTypes2, /* @__PURE__ */ new Map()); + __privateSet(this, _encoderCache2, /* @__PURE__ */ new Map()); + const links = /* @__PURE__ */ new Map(); + const parents = /* @__PURE__ */ new Map(); + const subtypes = /* @__PURE__ */ new Map(); + Object.keys(types2).forEach((type2) => { + links.set(type2, /* @__PURE__ */ new Set()); + parents.set(type2, []); + subtypes.set(type2, /* @__PURE__ */ new Set()); + }); + for (const name2 in types2) { + const uniqueNames = /* @__PURE__ */ new Set(); + for (const field of types2[name2]) { + assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name2)}`, "types", types2); + uniqueNames.add(field.name); + const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1] || null; + assertArgument(baseType !== name2, `circular type reference to ${JSON.stringify(baseType)}`, "types", types2); + const encoder2 = getBaseEncoder(baseType); + if (encoder2) { + continue; + } + assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types2); + parents.get(baseType).push(name2); + links.get(name2).add(baseType); + } + } + const primaryTypes = Array.from(parents.keys()).filter((n5) => parents.get(n5).length === 0); + assertArgument(primaryTypes.length !== 0, "missing primary type", "types", types2); + assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t2) => JSON.stringify(t2)).join(", ")}`, "types", types2); + defineProperties(this, { primaryType: primaryTypes[0] }); + function checkCircular(type2, found) { + assertArgument(!found.has(type2), `circular type reference to ${JSON.stringify(type2)}`, "types", types2); + found.add(type2); + for (const child of links.get(type2)) { + if (!parents.has(child)) { + continue; + } + checkCircular(child, found); + for (const subtype of found) { + subtypes.get(subtype).add(child); + } + } + found.delete(type2); + } + checkCircular(this.primaryType, /* @__PURE__ */ new Set()); + for (const [name2, set2] of subtypes) { + const st2 = Array.from(set2); + st2.sort(); + __privateGet(this, _fullTypes2).set(name2, encodeType(name2, types2[name2]) + st2.map((t2) => encodeType(t2, types2[t2])).join("")); + } + } + /** + * The types. + */ + get types() { + return JSON.parse(__privateGet(this, _types2)); + } + /** + * Returnthe encoder for the specific %%type%%. + */ + getEncoder(type2) { + let encoder2 = __privateGet(this, _encoderCache2).get(type2); + if (!encoder2) { + encoder2 = __privateMethod(this, _getEncoder2, getEncoder_fn2).call(this, type2); + __privateGet(this, _encoderCache2).set(type2, encoder2); + } + return encoder2; + } + /** + * Return the full type for %%name%%. + */ + encodeType(name2) { + const result = __privateGet(this, _fullTypes2).get(name2); + assertArgument(result, `unknown type: ${JSON.stringify(name2)}`, "name", name2); + return result; + } + /** + * Return the encoded %%value%% for the %%type%%. + */ + encodeData(type2, value) { + return this.getEncoder(type2)(value); + } + /** + * Returns the hash of %%value%% for the type of %%name%%. + */ + hashStruct(name2, value) { + return keccak256(this.encodeData(name2, value)); + } + /** + * Return the fulled encoded %%value%% for the [[types]]. + */ + encode(value) { + return this.encodeData(this.primaryType, value); + } + /** + * Return the hash of the fully encoded %%value%% for the [[types]]. + */ + hash(value) { + return this.hashStruct(this.primaryType, value); + } + /** + * @_ignore: + */ + _visit(type2, value, callback) { + { + const encoder2 = getBaseEncoder(type2); + if (encoder2) { + return callback(type2, value); + } + } + const match = type2.match(/^(.*)(\x5b(\d*)\x5d)$/); + if (match) { + assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); + return value.map((v6) => this._visit(match[1], v6, callback)); + } + const fields = this.types[type2]; + if (fields) { + return fields.reduce((accum, { name: name2, type: type3 }) => { + accum[name2] = this._visit(type3, value[name2], callback); + return accum; + }, {}); + } + assertArgument(false, `unknown type: ${type2}`, "type", type2); + } + /** + * Call %%calback%% for each value in %%value%%, passing the type and + * component within %%value%%. + * + * This is useful for replacing addresses or other transformation that + * may be desired on each component, based on its type. + */ + visit(value, callback) { + return this._visit(this.primaryType, value, callback); + } + /** + * Create a new **TypedDataEncoder** for %%types%%. + */ + static from(types2) { + return new _TypedDataEncoder(types2); + } + /** + * Return the primary type for %%types%%. + */ + static getPrimaryType(types2) { + return _TypedDataEncoder.from(types2).primaryType; + } + /** + * Return the hashed struct for %%value%% using %%types%% and %%name%%. + */ + static hashStruct(name2, types2, value) { + return _TypedDataEncoder.from(types2).hashStruct(name2, value); + } + /** + * Return the domain hash for %%domain%%. + */ + static hashDomain(domain) { + const domainFields = []; + for (const name2 in domain) { + if (domain[name2] == null) { + continue; + } + const type2 = domainFieldTypes[name2]; + assertArgument(type2, `invalid typed-data domain key: ${JSON.stringify(name2)}`, "domain", domain); + domainFields.push({ name: name2, type: type2 }); + } + domainFields.sort((a3, b2) => { + return domainFieldNames.indexOf(a3.name) - domainFieldNames.indexOf(b2.name); + }); + return _TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); + } + /** + * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. + */ + static encode(domain, types2, value) { + return concat(["0x1901", _TypedDataEncoder.hashDomain(domain), _TypedDataEncoder.from(types2).hash(value)]); + } + /** + * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. + */ + static hash(domain, types2, value) { + return keccak256(_TypedDataEncoder.encode(domain, types2, value)); + } + // Replaces all address types with ENS names with their looked up address + /** + * Resolves to the value from resolving all addresses in %%value%% for + * %%types%% and the %%domain%%. + */ + static async resolveNames(domain, types2, value, resolveName) { + domain = Object.assign({}, domain); + for (const key2 in domain) { + if (domain[key2] == null) { + delete domain[key2]; + } + } + const ensCache = {}; + if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) { + ensCache[domain.verifyingContract] = "0x"; + } + const encoder2 = _TypedDataEncoder.from(types2); + encoder2.visit(value, (type2, value2) => { + if (type2 === "address" && !isHexString(value2, 20)) { + ensCache[value2] = "0x"; + } + return value2; + }); + for (const name2 in ensCache) { + ensCache[name2] = await resolveName(name2); + } + if (domain.verifyingContract && ensCache[domain.verifyingContract]) { + domain.verifyingContract = ensCache[domain.verifyingContract]; + } + value = encoder2.visit(value, (type2, value2) => { + if (type2 === "address" && ensCache[value2]) { + return ensCache[value2]; + } + return value2; + }); + return { domain, value }; + } + /** + * Returns the JSON-encoded payload expected by nodes which implement + * the JSON-RPC [[link-eip-712]] method. + */ + static getPayload(domain, types2, value) { + _TypedDataEncoder.hashDomain(domain); + const domainValues = {}; + const domainTypes = []; + domainFieldNames.forEach((name2) => { + const value2 = domain[name2]; + if (value2 == null) { + return; + } + domainValues[name2] = domainChecks[name2](value2); + domainTypes.push({ name: name2, type: domainFieldTypes[name2] }); + }); + const encoder2 = _TypedDataEncoder.from(types2); + const typesWithDomain = Object.assign({}, types2); + assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types2); + typesWithDomain.EIP712Domain = domainTypes; + encoder2.encode(value); + return { + types: typesWithDomain, + domain: domainValues, + primaryType: encoder2.primaryType, + message: encoder2.visit(value, (type2, value2) => { + if (type2.match(/^bytes(\d*)/)) { + return hexlify(getBytes(value2)); + } + if (type2.match(/^u?int/)) { + return getBigInt(value2).toString(); + } + switch (type2) { + case "trcToken": + return getBigInt(value2).toString(); + case "address": + return value2.toLowerCase(); + case "bool": + return !!value2; + case "string": + assertArgument(typeof value2 === "string", "invalid string", "value", value2); + return value2; + } + assertArgument(false, "unsupported type", "type", type2); + }) + }; + } +}; +_types2 = new WeakMap(); +_fullTypes2 = new WeakMap(); +_encoderCache2 = new WeakMap(); +_getEncoder2 = new WeakSet(); +getEncoder_fn2 = function(type2) { + { + const encoder2 = getBaseEncoder(type2); + if (encoder2) { + return encoder2; + } + } + const match = type2.match(/^(.*)(\x5b(\d*)\x5d)$/); + if (match) { + const subtype = match[1]; + const subEncoder = this.getEncoder(subtype); + return (value) => { + assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); + let result = value.map(subEncoder); + if (__privateGet(this, _fullTypes2).has(subtype)) { + result = result.map(keccak256); + } + return keccak256(concat(result)); + }; + } + const fields = this.types[type2]; + if (fields) { + const encodedType = id(__privateGet(this, _fullTypes2).get(type2)); + return (value) => { + const values = fields.map(({ name: name2, type: type3 }) => { + const result = this.getEncoder(type3)(value[name2]); + if (__privateGet(this, _fullTypes2).has(type3)) { + return keccak256(result); + } + return result; + }); + values.unshift(encodedType); + return concat(values); + }; + } + assertArgument(false, `unknown type: ${type2}`, "type", type2); +}; +let TypedDataEncoder = _TypedDataEncoder; +function normalizePrivateKeyBytes(priKeyBytes) { + return hexStr2byteArray(byteArray2hexStr(priKeyBytes).padStart(64, "0")); +} +function getBase58CheckAddress(addressBytes) { + const hash0 = SHA2563(addressBytes); + const hash1 = SHA2563(hash0); + let checkSum = hash1.slice(0, 4); + checkSum = addressBytes.concat(checkSum); + return encode58(checkSum); +} +function decodeBase58Address(base58Sting) { + if (typeof base58Sting != "string") + return false; + if (base58Sting.length <= 4) + return false; + let address2 = decode58(base58Sting); + if (base58Sting.length <= 4) + return false; + const len = address2.length; + const offset2 = len - 4; + const checkSum = address2.slice(offset2); + address2 = address2.slice(0, offset2); + const hash0 = SHA2563(address2); + const hash1 = SHA2563(hash0); + const checkSum1 = hash1.slice(0, 4); + if (checkSum[0] == checkSum1[0] && checkSum[1] == checkSum1[1] && checkSum[2] == checkSum1[2] && checkSum[3] == checkSum1[3]) { + return address2; + } + throw new Error("Invalid address provided"); +} +function signTransaction(priKeyBytes, transaction2) { + if (typeof priKeyBytes === "string") + priKeyBytes = hexStr2byteArray(priKeyBytes); + const txID = transaction2.txID; + const signature2 = ECKeySign(hexStr2byteArray(txID), priKeyBytes); + if (Array.isArray(transaction2.signature)) { + if (!transaction2.signature.includes(signature2)) + transaction2.signature.push(signature2); + } else + transaction2.signature = [signature2]; + return transaction2; +} +function ecRecover(signedData, signature2) { + signedData = "0x" + signedData.replace(/^0x/, ""); + signature2 = "0x" + signature2.replace(/^0x/, ""); + const recovered = recoverAddress(arrayify(signedData), Signature.from(signature2)); + const tronAddress = ADDRESS_PREFIX + recovered.substring(2); + return tronAddress; +} +function arrayToBase64String(a3) { + return btoa(String.fromCharCode(...a3)); +} +function signBytes(privateKey, contents) { + if (typeof privateKey === "string") + privateKey = hexStr2byteArray(privateKey); + const hashBytes = SHA2563(contents); + const signBytes2 = ECKeySign(hashBytes, privateKey); + return signBytes2; +} +function _signTypedData(domain, types2, value, privateKey) { + const key2 = `0x${privateKey.replace(/^0x/, "")}`; + const signingKey = new SigningKey(key2); + const messageDigest = TypedDataEncoder.hash(domain, types2, value); + const signature2 = signingKey.sign(messageDigest); + const signatureHex = ["0x", signature2.r.substring(2), signature2.s.substring(2), Number(signature2.v).toString(16)].join(""); + return signatureHex; +} +function getRowBytesFromTransactionBase64(base64Data) { + const bytesDecode = base64DecodeFromString(base64Data); + const transaction2 = globalThis.proto.protocol.Transaction.deserializeBinary(bytesDecode); + const raw = transaction2.getRawData(); + return raw.serializeBinary(); +} +function genPriKey() { + const priKey = secp256k1$1.utils.randomPrivateKey(); + let priKeyHex = byteArray2hexStr(priKey); + priKeyHex = priKeyHex.padStart(64, "0"); + return hexStr2byteArray(priKeyHex); +} +function computeAddress(pubBytes2) { + if (pubBytes2.length === 65) + pubBytes2 = pubBytes2.slice(1); + const hash3 = keccak256(new Uint8Array(pubBytes2)).toString().substring(2); + const addressHex = ADDRESS_PREFIX + hash3.substring(24); + return hexStr2byteArray(addressHex); +} +function getAddressFromPriKey(priKeyBytes) { + const pubBytes2 = getPubKeyFromPriKey(priKeyBytes); + return computeAddress(pubBytes2); +} +function decode58Check(addressStr) { + const decodeCheck = decode58(addressStr); + if (decodeCheck.length <= 4) + return false; + const decodeData2 = decodeCheck.slice(0, decodeCheck.length - 4); + const hash0 = SHA2563(decodeData2); + const hash1 = SHA2563(hash0); + if (hash1[0] === decodeCheck[decodeData2.length] && hash1[1] === decodeCheck[decodeData2.length + 1] && hash1[2] === decodeCheck[decodeData2.length + 2] && hash1[3] === decodeCheck[decodeData2.length + 3]) { + return decodeData2; + } + return false; +} +function isAddressValid(base58Str) { + if (typeof base58Str !== "string") + return false; + if (base58Str.length !== ADDRESS_SIZE) + return false; + let address2 = decode58(base58Str); + if (address2.length !== 25) + return false; + if (address2[0] !== ADDRESS_PREFIX_BYTE) + return false; + const checkSum = address2.slice(21); + address2 = address2.slice(0, 21); + const hash0 = SHA2563(address2); + const hash1 = SHA2563(hash0); + const checkSum1 = hash1.slice(0, 4); + if (checkSum[0] == checkSum1[0] && checkSum[1] == checkSum1[1] && checkSum[2] == checkSum1[2] && checkSum[3] == checkSum1[3]) { + return true; + } + return false; +} +function getBase58CheckAddressFromPriKeyBase64String(priKeyBase64String) { + const priKeyBytes = base64DecodeFromString(priKeyBase64String); + const pubBytes2 = getPubKeyFromPriKey(priKeyBytes); + const addressBytes = computeAddress(pubBytes2); + return getBase58CheckAddress(addressBytes); +} +function getHexStrAddressFromPriKeyBase64String(priKeyBase64String) { + const priKeyBytes = base64DecodeFromString(priKeyBase64String); + const pubBytes2 = getPubKeyFromPriKey(priKeyBytes); + const addressBytes = computeAddress(pubBytes2); + const addressHex = byteArray2hexStr(addressBytes); + return addressHex; +} +function getAddressFromPriKeyBase64String(priKeyBase64String) { + const priKeyBytes = base64DecodeFromString(priKeyBase64String); + const pubBytes2 = getPubKeyFromPriKey(priKeyBytes); + const addressBytes = computeAddress(pubBytes2); + const addressBase64 = base64EncodeToString(addressBytes); + return addressBase64; +} +function getPubKeyFromPriKey(priKeyBytes) { + const pubkey = secp256k1$1.ProjectivePoint.fromPrivateKey(new Uint8Array(normalizePrivateKeyBytes(priKeyBytes))); + const x3 = pubkey.x; + const y3 = pubkey.y; + const xHex = x3.toString(16).padStart(64, "0"); + const yHex = y3.toString(16).padStart(64, "0"); + const pubkeyHex = `04${xHex}${yHex}`; + const pubkeyBytes = hexStr2byteArray(pubkeyHex); + return pubkeyBytes; +} +function ECKeySign(hashBytes, priKeyBytes) { + const signature2 = secp256k1$1.sign(byteArray2hexStr(hashBytes), byteArray2hexStr(priKeyBytes)); + const r2 = signature2.r.toString(16); + const s2 = signature2.s.toString(16); + const v6 = signature2.recovery + 27; + return r2.padStart(64, "0") + s2.padStart(64, "0") + byte2hexStr(v6); +} +function SHA2563(msgBytes) { + const msgHex = byteArray2hexStr(msgBytes); + const hashHex = sha256("0x" + msgHex).replace(/^0x/, ""); + return hexStr2byteArray(hashHex); +} +function passwordToAddress(password) { + const com_priKeyBytes = base64DecodeFromString(password); + const com_addressBytes = getAddressFromPriKey(com_priKeyBytes); + return getBase58CheckAddress(com_addressBytes); +} +function pkToAddress(privateKey, strict = false) { + const com_priKeyBytes = hexStr2byteArray(privateKey, strict); + const com_addressBytes = getAddressFromPriKey(com_priKeyBytes); + return getBase58CheckAddress(com_addressBytes); +} +function sha3(string2, prefix = true) { + return (prefix ? "0x" : "") + keccak256(Buffer.from(string2, "utf-8")).toString().substring(2); +} +const crypto$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + ECKeySign, + SHA256: SHA2563, + _signTypedData, + arrayToBase64String, + computeAddress, + decode58Check, + decodeBase58Address, + ecRecover, + genPriKey, + getAddressFromPriKey, + getAddressFromPriKeyBase64String, + getBase58CheckAddress, + getBase58CheckAddressFromPriKeyBase64String, + getHexStrAddressFromPriKeyBase64String, + getPubKeyFromPriKey, + getRowBytesFromTransactionBase64, + isAddressValid, + passwordToAddress, + pkToAddress, + sha3, + signBytes, + signTransaction +}, Symbol.toStringTag, { value: "Module" })); +const INVALID_TRON_PATH_ERROR_MSG = "Invalid tron path provided"; +function generateAccount() { + const priKeyBytes = genPriKey(); + const pubKeyBytes = getPubKeyFromPriKey(priKeyBytes); + const addressBytes = getAddressFromPriKey(priKeyBytes); + const privateKey = byteArray2hexStr(priKeyBytes); + const publicKey2 = byteArray2hexStr(pubKeyBytes); + return { + privateKey, + publicKey: publicKey2, + address: { + base58: getBase58CheckAddress(addressBytes), + hex: byteArray2hexStr(addressBytes) + } + }; +} +function generateRandom(password = "", path = TRON_BIP39_PATH_INDEX_0, wordlist2) { + const account = HDNodeWallet.createRandom(password, path, wordlist2); + const result = { + mnemonic: account.mnemonic, + privateKey: account.privateKey, + publicKey: account.signingKey.publicKey, + address: pkToAddress(account.privateKey.replace(/^0x/, "")), + path: account.path + }; + return result; +} +function generateAccountWithMnemonic(mnemonic, path = TRON_BIP39_PATH_INDEX_0, password = "", wordlist2 = null) { + if (!String(path).match(/^m\/44\'\/195\'/)) { + throw new Error(INVALID_TRON_PATH_ERROR_MSG); + } + const account = HDNodeWallet.fromMnemonic(Mnemonic.fromPhrase(mnemonic, password, wordlist2), path); + const result = { + mnemonic: account.mnemonic, + privateKey: account.privateKey, + publicKey: account.signingKey.publicKey, + address: pkToAddress(account.privateKey.replace(/^0x/, "")) + }; + return result; +} +const accounts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + generateAccount, + generateAccountWithMnemonic, + generateRandom +}, Symbol.toStringTag, { value: "Module" })); +const TRON_MESSAGE_PREFIX = "TRON Signed Message:\n"; +function hashMessage(message2) { + if (typeof message2 === "string") { + message2 = toUtf8Bytes(message2); + } else if (Array.isArray(message2)) { + message2 = new Uint8Array(message2); + } + return keccak256(concat([toUtf8Bytes(TRON_MESSAGE_PREFIX), toUtf8Bytes(String(message2.length)), message2])); +} +function signMessage(message2, privateKey) { + if (!privateKey.match(/^0x/)) { + privateKey = "0x" + privateKey; + } + const signingKey = new SigningKey(privateKey); + const messageDigest = hashMessage(message2); + const signature2 = signingKey.sign(messageDigest); + return joinSignature(signature2); +} +function verifyMessage(message2, signature2) { + if (!signature2.match(/^0x/)) { + signature2 = "0x" + signature2; + } + const recovered = recoverAddress(hashMessage(message2), signature2); + const base58Address = getBase58CheckAddress(hexStr2byteArray(recovered.replace(/^0x/, ADDRESS_PREFIX))); + return base58Address; +} +const message = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + TRON_MESSAGE_PREFIX, + hashMessage, + signMessage, + verifyMessage +}, Symbol.toStringTag, { value: "Module" })); +const utils$2 = { + ...validations, + address, + code, + accounts, + base58, + bytes: bytes$1, + crypto: crypto$1, + abi, + message, + _TypedDataEncoder: TypedDataEncoder, + transaction, + ethersUtils +}; +const utils$3 = utils$2; +var ResourceCode; +(function(ResourceCode2) { + ResourceCode2[ResourceCode2["BANDWIDTH"] = 0] = "BANDWIDTH"; + ResourceCode2[ResourceCode2["ENERGY"] = 1] = "ENERGY"; + ResourceCode2[ResourceCode2["TRON_POWER"] = 2] = "TRON_POWER"; +})(ResourceCode || (ResourceCode = {})); +var TransactionSignWeight_response_code; +(function(TransactionSignWeight_response_code2) { + TransactionSignWeight_response_code2["ENOUGH_PERMISSION"] = "ENOUGH_PERMISSION"; + TransactionSignWeight_response_code2["NOT_ENOUGH_PERMISSION"] = "NOT_ENOUGH_PERMISSION"; + TransactionSignWeight_response_code2["SIGNATURE_FORMAT_ERROR"] = "SIGNATURE_FORMAT_ERROR"; + TransactionSignWeight_response_code2["COMPUTE_ADDRESS_ERROR"] = "COMPUTE_ADDRESS_ERROR"; + TransactionSignWeight_response_code2["PERMISSION_ERROR"] = "PERMISSION_ERROR"; + TransactionSignWeight_response_code2["OTHER_ERROR"] = "OTHER_ERROR"; +})(TransactionSignWeight_response_code || (TransactionSignWeight_response_code = {})); +var BroadcastReturn_response_code; +(function(BroadcastReturn_response_code2) { + BroadcastReturn_response_code2[BroadcastReturn_response_code2["SUCCESS"] = 0] = "SUCCESS"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["SIGERROR"] = 1] = "SIGERROR"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["CONTRACT_VALIDATE_ERROR"] = 2] = "CONTRACT_VALIDATE_ERROR"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["CONTRACT_EXE_ERROR"] = 3] = "CONTRACT_EXE_ERROR"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["BANDWITH_ERROR"] = 4] = "BANDWITH_ERROR"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["DUP_TRANSACTION_ERROR"] = 5] = "DUP_TRANSACTION_ERROR"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["TAPOS_ERROR"] = 6] = "TAPOS_ERROR"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["TOO_BIG_TRANSACTION_ERROR"] = 7] = "TOO_BIG_TRANSACTION_ERROR"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["TRANSACTION_EXPIRATION_ERROR"] = 8] = "TRANSACTION_EXPIRATION_ERROR"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["SERVER_BUSY"] = 9] = "SERVER_BUSY"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["NO_CONNECTION"] = 10] = "NO_CONNECTION"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["NOT_ENOUGH_EFFECTIVE_CONNECTION"] = 11] = "NOT_ENOUGH_EFFECTIVE_CONNECTION"; + BroadcastReturn_response_code2[BroadcastReturn_response_code2["OTHER_ERROR"] = 20] = "OTHER_ERROR"; +})(BroadcastReturn_response_code || (BroadcastReturn_response_code = {})); +var ProposalState; +(function(ProposalState2) { + ProposalState2[ProposalState2["PENDING"] = 0] = "PENDING"; + ProposalState2[ProposalState2["DISAPPROVED"] = 1] = "DISAPPROVED"; + ProposalState2[ProposalState2["APPROVED"] = 2] = "APPROVED"; + ProposalState2[ProposalState2["CANCELED"] = 3] = "CANCELED"; +})(ProposalState || (ProposalState = {})); +var NetworkType; +(function(NetworkType2) { + NetworkType2["Mainnet"] = "Mainnet"; + NetworkType2["Shasta"] = "Shasta"; + NetworkType2["Nile"] = "Nile"; + NetworkType2["Unknown"] = "Unknown"; +})(NetworkType || (NetworkType = {})); +var ChainNetwork; +(function(ChainNetwork2) { + ChainNetwork2["Mainnet"] = "Mainnet"; + ChainNetwork2["Shasta"] = "Shasta"; + ChainNetwork2["Nile"] = "Nile"; +})(ChainNetwork || (ChainNetwork = {})); +function isInBrowser() { + return typeof window !== "undefined" && typeof document !== "undefined" && typeof navigator !== "undefined"; +} +function isInMobileBrowser() { + return typeof navigator !== "undefined" && navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i); +} +var __awaiter$2 = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve) { + resolve(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e18) { + reject(e18); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e18) { + reject(e18); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function supportTron() { + return !!(window.tron && window.tron.isTronLink); +} +function supportTronLink() { + return !!(supportTron() || window.tronLink || window.tronWeb); +} +function isInTronLinkApp() { + return isInBrowser() && typeof window.iTron !== "undefined"; +} +function openTronLink({ dappIcon, dappName } = { dappIcon: "", dappName: "" }) { + if (!supportTronLink() && isInMobileBrowser() && !isInTronLinkApp()) { + let defaultDappName = "", defaultDappIcon = ""; + try { + defaultDappName = document.title; + const link = document.querySelector('link[rel*="icon"]'); + if (link) { + defaultDappIcon = new URL(link.getAttribute("href") || "", location.href).toString(); + } + } catch (e18) { + } + const { origin: origin2, pathname, search, hash: hash3 } = window.location; + const url = origin2 + pathname + search + (hash3.includes("?") ? hash3 : `${hash3}?_=1`); + const params = { + action: "open", + actionId: Date.now() + "", + callbackUrl: "http://someurl.com", + // no need callback + dappIcon: dappIcon || defaultDappIcon, + dappName: dappName || defaultDappName, + url, + protocol: "TronLink", + version: "1.0", + chainId: "0x2b6653dc" + }; + window.location.href = `tronlinkoutside://pull.activity?param=${encodeURIComponent(JSON.stringify(params))}`; + return true; + } + return false; +} +function waitTronwebReady(tronObj) { + return __awaiter$2(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + const interval = setInterval(() => { + if (tronObj.tronWeb) { + clearInterval(interval); + clearTimeout(timeout); + resolve(); + } + }, 50); + const timeout = setTimeout(() => { + clearInterval(interval); + reject("`window.tron.tronweb` is not ready."); + }, 2e3); + }); + }); +} +var __awaiter$1 = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve) { + resolve(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e18) { + reject(e18); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e18) { + reject(e18); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +const chainIdNetworkMap = { + "0x2b6653dc": NetworkType.Mainnet, + "0x94a9059e": NetworkType.Shasta, + "0xcd8690dc": NetworkType.Nile +}; +function getNetworkInfoByTronWeb(tronWeb) { + return __awaiter$1(this, void 0, void 0, function* () { + var _a3, _b2, _c2; + const { blockID = "" } = yield tronWeb.trx.getBlockByNumber(0); + const chainId = `0x${blockID.slice(-8)}`; + return { + networkType: chainIdNetworkMap[chainId] || NetworkType.Unknown, + chainId, + fullNode: ((_a3 = tronWeb.fullNode) === null || _a3 === void 0 ? void 0 : _a3.host) || "", + solidityNode: ((_b2 = tronWeb.solidityNode) === null || _b2 === void 0 ? void 0 : _b2.host) || "", + eventServer: ((_c2 = tronWeb.eventServer) === null || _c2 === void 0 ? void 0 : _c2.host) || "" + }; + }); +} +const TronLinkAdapterName = "TronLink"; +class TronLinkAdapter extends Adapter { + // record if first connect event has emitted or not + constructor(config2 = {}) { + super(); + this.name = TronLinkAdapterName; + this.url = "https://www.tronlink.org/"; + this.icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF0AAABdCAYAAADHcWrDAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABdoAMABAAAAAEAAABdAAAAAMkTBfIAAAFZaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9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qfs34UfM7J2B6NFVmDxLB6i92q0KkLtfcPhX0vSqq3H6geC/98RHg/VwL0MW8e/hjvVy/Xim34CVG+21h+ePawjAk4HDG1byFN4q+r/dQH74aaDGOtFvnw4wC+2BJzo8db/XnJc1Njr7EMua7DuJAdXXXTrq8fI2lpUyPvz8LSjjXLjCEXHIw8Ft8eu65sqmTkjok4K+AvNnyZH0Xsb+eO/wWrg46Do/7gYAAAAABJRU5ErkJggg=="; + this._readyState = isInBrowser() ? WalletReadyState.Loading : WalletReadyState.NotFound; + this._state = AdapterState.Loading; + this._supportNewTronProtocol = false; + this._tronLinkMessageHandler = (e18) => { + var _a3, _b2, _c2, _d2, _e3; + const message2 = (_a3 = e18.data) === null || _a3 === void 0 ? void 0 : _a3.message; + if (!message2) { + return; + } + if (message2.action === "accountsChanged") { + setTimeout(() => { + var _a4; + const preAddr = this.address || ""; + if ((_a4 = this._wallet) === null || _a4 === void 0 ? void 0 : _a4.ready) { + const address2 = message2.data.address; + this.setAddress(address2); + this.setState(AdapterState.Connected); + } else { + this.setAddress(null); + this.setState(AdapterState.Disconnect); + } + this.emit("accountsChanged", this.address || "", preAddr); + if (!preAddr && this.address) { + this.emit("connect", this.address); + } else if (preAddr && !this.address) { + this.emit("disconnect"); + } + }, 200); + } else if (message2.action === "setNode") { + this.emit("chainChanged", { chainId: ((_c2 = (_b2 = message2.data) === null || _b2 === void 0 ? void 0 : _b2.node) === null || _c2 === void 0 ? void 0 : _c2.chainId) || "" }); + } else if (message2.action === "connect") { + const address2 = ((_e3 = (_d2 = this._wallet.tronWeb) === null || _d2 === void 0 ? void 0 : _d2.defaultAddress) === null || _e3 === void 0 ? void 0 : _e3.base58) || ""; + this.setAddress(address2); + this.setState(AdapterState.Connected); + this.emit("connect", address2); + } else if (message2.action === "disconnect") { + this.setAddress(null); + this.setState(AdapterState.Disconnect); + this.emit("disconnect"); + } + }; + this._onChainChanged = (data) => { + this.emit("chainChanged", data); + }; + this._onAccountsChanged = () => { + var _a3, _b2, _c2; + const preAddr = this.address || ""; + const curAddr = ((_a3 = this._wallet) === null || _a3 === void 0 ? void 0 : _a3.tronWeb) && ((_c2 = (_b2 = this._wallet) === null || _b2 === void 0 ? void 0 : _b2.tronWeb.defaultAddress) === null || _c2 === void 0 ? void 0 : _c2.base58) || ""; + if (!curAddr) { + this.setAddress(null); + this.setState(AdapterState.Disconnect); + } else { + const address2 = curAddr; + this.setAddress(address2); + this.setState(AdapterState.Connected); + } + this.emit("accountsChanged", this.address || "", preAddr); + if (!preAddr && this.address) { + this.emit("connect", this.address); + } else if (preAddr && !this.address) { + this.emit("disconnect"); + } + }; + this._checkPromise = null; + this._updateWallet = () => { + var _a3, _b2, _c2, _d2, _e3, _f3, _g2, _h3; + let state = this.state; + let address2 = this.address; + if (isInMobileBrowser()) { + if (window.tronLink) { + this._wallet = window.tronLink; + } else { + this._wallet = { + ready: !!((_a3 = window.tronWeb) === null || _a3 === void 0 ? void 0 : _a3.defaultAddress), + tronWeb: window.tronWeb, + request: () => Promise.resolve(true) + }; + } + address2 = ((_c2 = (_b2 = this._wallet.tronWeb) === null || _b2 === void 0 ? void 0 : _b2.defaultAddress) === null || _c2 === void 0 ? void 0 : _c2.base58) || null; + state = address2 ? AdapterState.Connected : AdapterState.Disconnect; + } else if (window.tron && window.tron.isTronLink) { + this._supportNewTronProtocol = true; + this._wallet = window.tron; + this._listenTronEvent(); + address2 = this._wallet.tronWeb && ((_e3 = (_d2 = this._wallet.tronWeb) === null || _d2 === void 0 ? void 0 : _d2.defaultAddress) === null || _e3 === void 0 ? void 0 : _e3.base58) || null; + state = address2 ? AdapterState.Connected : AdapterState.Disconnect; + } else if (window.tronLink) { + this._wallet = window.tronLink; + this._listenTronLinkEvent(); + address2 = ((_g2 = (_f3 = this._wallet.tronWeb) === null || _f3 === void 0 ? void 0 : _f3.defaultAddress) === null || _g2 === void 0 ? void 0 : _g2.base58) || null; + state = this._wallet.ready ? AdapterState.Connected : AdapterState.Disconnect; + } else if (window.tronWeb) { + this._wallet = { + ready: window.tronWeb.ready, + tronWeb: window.tronWeb, + request: () => Promise.resolve(true) + }; + address2 = ((_h3 = this._wallet.tronWeb.defaultAddress) === null || _h3 === void 0 ? void 0 : _h3.base58) || null; + state = this._wallet.ready ? AdapterState.Connected : AdapterState.Disconnect; + } else { + this._wallet = null; + address2 = null; + state = AdapterState.NotFound; + } + if (isInMobileBrowser() && state === AdapterState.Disconnect) { + this.checkForWalletReadyForApp(); + } + this.setAddress(address2); + this.setState(state); + }; + this.checkReadyInterval = null; + const { checkTimeout = 30 * 1e3, dappIcon = "", dappName = "", openUrlWhenWalletNotFound = true, openTronLinkAppOnMobile = true } = config2; + if (typeof checkTimeout !== "number") { + throw new Error("[TronLinkAdapter] config.checkTimeout should be a number"); + } + this.config = { + checkTimeout, + openTronLinkAppOnMobile, + openUrlWhenWalletNotFound, + dappIcon, + dappName + }; + this._connecting = false; + this._wallet = null; + this._address = null; + if (!isInBrowser()) { + this._readyState = WalletReadyState.NotFound; + this.setState(AdapterState.NotFound); + return; + } + if (supportTron() || isInMobileBrowser() && (window.tronLink || window.tronWeb)) { + this._readyState = WalletReadyState.Found; + this._updateWallet(); + } else { + this._checkWallet().then(() => { + if (this.connected) { + this.emit("connect", this.address || ""); + } + }); + } + } + get address() { + return this._address; + } + get state() { + return this._state; + } + get readyState() { + return this._readyState; + } + get connecting() { + return this._connecting; + } + /** + * Get network information used by TronLink. + * @returns {Network} Current network information. + */ + network() { + return __awaiter$1(this, void 0, void 0, function* () { + var _a3; + try { + yield this._checkWallet(); + if (this.state !== AdapterState.Connected) + throw new WalletDisconnectedError2(); + const tronWeb = ((_a3 = this._wallet) === null || _a3 === void 0 ? void 0 : _a3.tronWeb) || window.tronWeb; + if (!tronWeb) + throw new WalletDisconnectedError2(); + try { + return yield getNetworkInfoByTronWeb(tronWeb); + } catch (e18) { + throw new WalletGetNetworkError(e18 === null || e18 === void 0 ? void 0 : e18.message, e18); + } + } catch (e18) { + this.emit("error", e18); + throw e18; + } + }); + } + connect() { + return __awaiter$1(this, void 0, void 0, function* () { + var _a3, _b2; + try { + this.checkIfOpenTronLink(); + if (this.connected || this.connecting) + return; + yield this._checkWallet(); + if (this.state === AdapterState.NotFound) { + if (this.config.openUrlWhenWalletNotFound !== false && isInBrowser()) { + window.open(this.url, "_blank"); + } + throw new WalletNotFoundError(); + } + if (!this._wallet) + return; + this._connecting = true; + if (this._supportNewTronProtocol) { + const wallet = this._wallet; + try { + const res = yield wallet.request({ method: "eth_requestAccounts" }); + const address2 = res[0]; + this.setAddress(address2); + this.setState(AdapterState.Connected); + this._listenTronEvent(); + if (!this._wallet.tronWeb) { + yield waitTronwebReady(this._wallet); + } + } catch (error) { + let message2 = (error === null || error === void 0 ? void 0 : error.message) || error || "Connect TronLink wallet failed."; + if (error.code === -32002) { + message2 = "The same DApp has already initiated a request to connect to TronLink wallet, and the pop-up window has not been closed."; + } + if (error.code === 4001) { + message2 = "The user rejected connection."; + } + throw new WalletConnectionError2(message2, error); + } + } else if (window.tronLink) { + const wallet = this._wallet; + try { + const res = yield wallet.request({ method: "tron_requestAccounts" }); + if (!res) { + throw new WalletConnectionError2("TronLink wallet is locked or no wallet account is avaliable."); + } + if (res.code === 4e3) { + throw new WalletConnectionError2("The same DApp has already initiated a request to connect to TronLink wallet, and the pop-up window has not been closed."); + } + if (res.code === 4001) { + throw new WalletConnectionError2("The user rejected connection."); + } + } catch (error) { + throw new WalletConnectionError2(error === null || error === void 0 ? void 0 : error.message, error); + } + const address2 = ((_a3 = wallet.tronWeb.defaultAddress) === null || _a3 === void 0 ? void 0 : _a3.base58) || ""; + this.setAddress(address2); + this.setState(AdapterState.Connected); + this._listenTronLinkEvent(); + } else if (window.tronWeb) { + const wallet = this._wallet; + const address2 = ((_b2 = wallet.tronWeb.defaultAddress) === null || _b2 === void 0 ? void 0 : _b2.base58) || ""; + this.setAddress(address2); + this.setState(AdapterState.Connected); + } else { + throw new WalletConnectionError2("Cannot connect wallet."); + } + this.connected && this.emit("connect", this.address || ""); + } catch (error) { + this.emit("error", error); + throw error; + } finally { + this._connecting = false; + } + }); + } + disconnect() { + return __awaiter$1(this, void 0, void 0, function* () { + if (this._supportNewTronProtocol) { + this._stopListenTronEvent(); + } else { + this._stopListenTronLinkEvent(); + } + if (this.state !== AdapterState.Connected) { + return; + } + this.setAddress(null); + this.setState(AdapterState.Disconnect); + this.emit("disconnect"); + }); + } + signTransaction(transaction2, privateKey) { + return __awaiter$1(this, void 0, void 0, function* () { + try { + const wallet = yield this.checkAndGetWallet(); + try { + return yield wallet.tronWeb.trx.sign(transaction2, privateKey); + } catch (error) { + if (error instanceof Error) { + throw new WalletSignTransactionError2(error.message, error); + } else { + throw new WalletSignTransactionError2(error, new Error(error)); + } + } + } catch (error) { + this.emit("error", error); + throw error; + } + }); + } + multiSign(transaction2, privateKey, permissionId) { + return __awaiter$1(this, void 0, void 0, function* () { + try { + const wallet = yield this.checkAndGetWallet(); + try { + return yield wallet.tronWeb.trx.multiSign(transaction2, privateKey, permissionId); + } catch (error) { + if (error instanceof Error) { + throw new WalletSignTransactionError2(error.message, error); + } else { + throw new WalletSignTransactionError2(error, new Error(error)); + } + } + } catch (error) { + this.emit("error", error); + throw error; + } + }); + } + signMessage(message2, privateKey) { + return __awaiter$1(this, void 0, void 0, function* () { + try { + const wallet = yield this.checkAndGetWallet(); + try { + return yield wallet.tronWeb.trx.signMessageV2(message2, privateKey); + } catch (error) { + if (error instanceof Error) { + throw new WalletSignMessageError2(error.message, error); + } else { + throw new WalletSignMessageError2(error, new Error(error)); + } + } + } catch (error) { + this.emit("error", error); + throw error; + } + }); + } + /** + * Switch to target chain. If current chain is the same as target chain, the call will success immediately. + * Available chainIds: + * - Mainnet: 0x2b6653dc + * - Shasta: 0x94a9059e + * - Nile: 0xcd8690dc + * @param chainId chainId + */ + switchChain(chainId) { + return __awaiter$1(this, void 0, void 0, function* () { + try { + yield this._checkWallet(); + if (this.state === AdapterState.NotFound) { + if (this.config.openUrlWhenWalletNotFound !== false && isInBrowser()) { + window.open(this.url, "_blank"); + } + throw new WalletNotFoundError(); + } + if (!this._supportNewTronProtocol) { + throw new WalletSwitchChainError("Current version of TronLink doesn't support switch chain operation."); + } + const wallet = this._wallet; + try { + yield wallet.request({ + method: "wallet_switchEthereumChain", + params: [{ chainId }] + }); + } catch (e18) { + throw new WalletSwitchChainError((e18 === null || e18 === void 0 ? void 0 : e18.message) || e18, e18 instanceof Error ? e18 : new Error(e18)); + } + } catch (error) { + this.emit("error", error); + throw error; + } + }); + } + checkAndGetWallet() { + return __awaiter$1(this, void 0, void 0, function* () { + this.checkIfOpenTronLink(); + yield this._checkWallet(); + if (this.state !== AdapterState.Connected) + throw new WalletDisconnectedError2(); + const wallet = this._wallet; + if (!wallet || !wallet.tronWeb) + throw new WalletDisconnectedError2(); + return wallet; + }); + } + _listenTronLinkEvent() { + this._stopListenTronLinkEvent(); + window.addEventListener("message", this._tronLinkMessageHandler); + } + _stopListenTronLinkEvent() { + window.removeEventListener("message", this._tronLinkMessageHandler); + } + checkIfOpenTronLink() { + const { dappName = "", dappIcon = "" } = this.config; + if (this.config.openTronLinkAppOnMobile === false) { + return; + } + if (openTronLink({ dappIcon, dappName })) { + throw new WalletNotFoundError(); + } + } + // following code is for TIP-1193 + _listenTronEvent() { + this._stopListenTronEvent(); + this._stopListenTronLinkEvent(); + const wallet = this._wallet; + wallet.on("chainChanged", this._onChainChanged); + wallet.on("accountsChanged", this._onAccountsChanged); + } + _stopListenTronEvent() { + const wallet = this._wallet; + wallet.removeListener("chainChanged", this._onChainChanged); + wallet.removeListener("accountsChanged", this._onAccountsChanged); + } + /** + * check if wallet exists by interval, the promise only resolve when wallet detected or timeout + * @returns if wallet exists + */ + _checkWallet() { + if (this.readyState === WalletReadyState.Found) { + return Promise.resolve(true); + } + if (this._checkPromise) { + return this._checkPromise; + } + const interval = 100; + const checkTronTimes = Math.floor(2e3 / interval); + const maxTimes = Math.floor(this.config.checkTimeout / interval); + let times = 0, timer2; + this._checkPromise = new Promise((resolve) => { + const check = () => { + times++; + const isSupport = times < checkTronTimes && !isInMobileBrowser() ? supportTron() : supportTronLink(); + if (isSupport || times > maxTimes) { + timer2 && clearInterval(timer2); + this._readyState = isSupport ? WalletReadyState.Found : WalletReadyState.NotFound; + this._updateWallet(); + this.emit("readyStateChanged", this.readyState); + resolve(isSupport); + } + }; + timer2 = setInterval(check, interval); + check(); + }); + return this._checkPromise; + } + checkForWalletReadyForApp() { + if (this.checkReadyInterval) { + return; + } + let times = 0; + const maxTimes = Math.floor(this.config.checkTimeout / 200); + const check = () => { + var _a3, _b2; + if (window.tronLink ? (_a3 = window.tronLink.tronWeb) === null || _a3 === void 0 ? void 0 : _a3.defaultAddress : (_b2 = window.tronWeb) === null || _b2 === void 0 ? void 0 : _b2.defaultAddress) { + this.checkReadyInterval && clearInterval(this.checkReadyInterval); + this.checkReadyInterval = null; + this._updateWallet(); + this.emit("connect", this.address || ""); + } else if (times > maxTimes) { + this.checkReadyInterval && clearInterval(this.checkReadyInterval); + this.checkReadyInterval = null; + } else { + times++; + } + }; + this.checkReadyInterval = setInterval(check, 200); + } + setAddress(address2) { + this._address = address2; + } + setState(state) { + const preState = this.state; + if (state !== preState) { + this._state = state; + this.emit("stateChanged", state); + } + } +} +var __awaiter = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve) { + resolve(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e18) { + reject(e18); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e18) { + reject(e18); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +const initialState = { + wallet: null, + address: null, + connected: false, + adapter: null +}; +const WalletProvider = function({ children, adapters: adaptersPro = null, onError = (error) => console.error(error), onReadyStateChanged, onConnect, onDisconnect, onAccountsChanged, onChainChanged, onAdapterChanged, localStorageKey = "tronAdapterName", autoConnect = true, disableAutoConnectOnLoad = false }) { + const [name2, setName] = useLocalStorage(localStorageKey, null); + const [{ wallet, connected, address: address2, adapter }, setState] = reactExports.useState(initialState); + const [connecting, setConnecting] = reactExports.useState(false); + const [disconnecting, setDisconnecting] = reactExports.useState(false); + const isConnecting = reactExports.useRef(false); + const isDisconnecting = reactExports.useRef(false); + const adapters2 = reactExports.useMemo(() => { + if (adaptersPro === null) { + return [new TronLinkAdapter()]; + } + return adaptersPro; + }, [adaptersPro]); + const [wallets2, setWallets] = reactExports.useState(() => adapters2.map((adapter2) => ({ + adapter: adapter2, + state: adapter2.state + }))); + reactExports.useEffect(function() { + setWallets((prevWallets) => adapters2.map((adapter2, index2) => { + const wallet2 = prevWallets[index2]; + if (wallet2 && wallet2.adapter === adapter2 && wallet2.state === adapter2.state) { + return wallet2; + } + return { + adapter: adapter2, + state: adapter2.state + }; + })); + function handleStateChange() { + setWallets((prevWallets) => { + const index2 = prevWallets.findIndex((wallet2) => wallet2.adapter === this); + if (index2 === -1) { + return prevWallets; + } + return prevWallets.map((wallet2, idx) => { + if (idx === index2) { + return Object.assign(Object.assign({}, wallet2), { state: wallet2.adapter.state }); + } + return wallet2; + }); + }); + } + adapters2.forEach((adapter2) => adapter2.on("stateChanged", handleStateChange, adapter2)); + return () => adapters2.forEach((adapter2) => adapter2.off("stateChanged", handleStateChange, adapter2)); + }, [adapters2]); + reactExports.useEffect(function() { + const wallet2 = name2 && wallets2.find((item) => item.adapter.name === name2); + if (wallet2) { + setState({ + wallet: wallet2, + adapter: wallet2.adapter, + connected: wallet2.adapter.connected, + address: wallet2.adapter.address + }); + } else { + setState(initialState); + } + }, [name2, wallets2]); + const preAdapter = reactExports.useRef(null); + reactExports.useEffect(function() { + if (adapter !== preAdapter.current) { + onAdapterChanged === null || onAdapterChanged === void 0 ? void 0 : onAdapterChanged(adapter); + preAdapter.current = adapter; + } + }, [adapter, onAdapterChanged]); + const handleConnect = reactExports.useCallback(function(addr) { + if (!adapter) { + return setName(null); + } + setState((state) => Object.assign(Object.assign({}, state), { connected: adapter.connected, address: adapter.address })); + onConnect === null || onConnect === void 0 ? void 0 : onConnect(addr); + }, [adapter, setName, onConnect]); + const handleError = reactExports.useCallback(function(error) { + onError(error); + return error; + }, [onError]); + const handleAccountChange = reactExports.useCallback(function(address3, preAddr) { + setState((state) => Object.assign(Object.assign({}, state), { address: address3 })); + onAccountsChanged === null || onAccountsChanged === void 0 ? void 0 : onAccountsChanged(address3, preAddr); + }, [onAccountsChanged]); + const handleDisconnect = reactExports.useCallback(function() { + onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect(); + }, [onDisconnect]); + const handleReadyStateChanged = reactExports.useCallback(function(readyState) { + onReadyStateChanged === null || onReadyStateChanged === void 0 ? void 0 : onReadyStateChanged(readyState); + }, [onReadyStateChanged]); + const handleChainChanged = reactExports.useCallback(function(chainData) { + onChainChanged === null || onChainChanged === void 0 ? void 0 : onChainChanged(chainData); + }, [onChainChanged]); + reactExports.useEffect(function() { + if (adapter) { + adapter.on("connect", handleConnect); + adapter.on("error", handleError); + adapter.on("accountsChanged", handleAccountChange); + adapter.on("chainChanged", handleChainChanged); + adapter.on("readyStateChanged", handleReadyStateChanged); + adapter.on("disconnect", handleDisconnect); + return () => { + adapter.off("connect", handleConnect); + adapter.off("error", handleError); + adapter.off("accountsChanged", handleAccountChange); + adapter.off("chainChanged", handleChainChanged); + adapter.off("readyStateChanged", handleReadyStateChanged); + adapter.off("disconnect", handleDisconnect); + }; + } + }, [ + adapter, + handleConnect, + handleError, + handleAccountChange, + handleChainChanged, + handleReadyStateChanged, + handleDisconnect + ]); + reactExports.useEffect(() => { + return () => { + adapter === null || adapter === void 0 ? void 0 : adapter.disconnect(); + }; + }, [adapter]); + const hasManuallySetName = reactExports.useRef(false); + reactExports.useEffect(function() { + const canAutoConnect = autoConnect && (!disableAutoConnectOnLoad || hasManuallySetName.current); + if (isConnecting.current || !canAutoConnect || !adapter || adapter.state !== AdapterState$1.Disconnect) { + return; + } + (function connect3() { + return __awaiter(this, void 0, void 0, function* () { + isConnecting.current = true; + setConnecting(true); + try { + yield adapter.connect(); + } catch (error) { + } finally { + setConnecting(false); + isConnecting.current = false; + } + }); + })(); + }, [isConnecting, autoConnect, adapter, setName, disableAutoConnectOnLoad]); + const select2 = reactExports.useCallback((name3) => { + hasManuallySetName.current = true; + setName(name3); + }, [setName]); + const connect2 = reactExports.useCallback(function() { + return __awaiter(this, void 0, void 0, function* () { + if (isConnecting.current || isDisconnecting.current || connected) { + return; + } + if (!adapter) + throw handleError(new WalletNotSelectedError2()); + isConnecting.current = true; + setConnecting(true); + try { + yield adapter.connect(); + } catch (error) { + setName(null); + throw error; + } finally { + setConnecting(false); + isConnecting.current = false; + } + }); + }, [isConnecting, isDisconnecting, adapter, connected, handleError, setName]); + const disconnect2 = reactExports.useCallback(function() { + return __awaiter(this, void 0, void 0, function* () { + if (isDisconnecting.current) + return; + if (!adapter) + return setName(null); + isDisconnecting.current = true; + setDisconnecting(true); + try { + yield adapter.disconnect(); + setName(null); + } catch (error) { + setName(null); + throw error; + } finally { + setDisconnecting(false); + isDisconnecting.current = false; + } + }); + }, [adapter, isDisconnecting, setName]); + const signTransaction2 = reactExports.useCallback(function(transaction2, privateKey) { + return __awaiter(this, void 0, void 0, function* () { + if (!adapter) + throw handleError(new WalletNotSelectedError2()); + return yield adapter.signTransaction(transaction2, privateKey); + }); + }, [adapter, handleError]); + const signMessage2 = reactExports.useCallback(function(message2, privateKey) { + return __awaiter(this, void 0, void 0, function* () { + if (!adapter) + throw handleError(new WalletNotSelectedError2()); + return yield adapter.signMessage(message2, privateKey); + }); + }, [adapter, handleError]); + return W$2.createElement(WalletContext.Provider, { value: { + disableAutoConnectOnLoad, + autoConnect, + wallets: wallets2, + wallet, + address: address2, + connecting, + connected, + disconnecting, + select: select2, + connect: connect2, + disconnect: disconnect2, + signTransaction: signTransaction2, + signMessage: signMessage2 + } }, children); +}; +var browser = {}; +var canPromise$1 = function() { + return typeof Promise === "function" && Promise.prototype && Promise.prototype.then; +}; +var qrcode = {}; +var utils$1 = {}; +let toSJISFunction; +const CODEWORDS_COUNT = [ + 0, + // Not used + 26, + 44, + 70, + 100, + 134, + 172, + 196, + 242, + 292, + 346, + 404, + 466, + 532, + 581, + 655, + 733, + 815, + 901, + 991, + 1085, + 1156, + 1258, + 1364, + 1474, + 1588, + 1706, + 1828, + 1921, + 2051, + 2185, + 2323, + 2465, + 2611, + 2761, + 2876, + 3034, + 3196, + 3362, + 3532, + 3706 +]; +utils$1.getSymbolSize = function getSymbolSize(version2) { + if (!version2) + throw new Error('"version" cannot be null or undefined'); + if (version2 < 1 || version2 > 40) + throw new Error('"version" should be in range from 1 to 40'); + return version2 * 4 + 17; +}; +utils$1.getSymbolTotalCodewords = function getSymbolTotalCodewords(version2) { + return CODEWORDS_COUNT[version2]; +}; +utils$1.getBCHDigit = function(data) { + let digit = 0; + while (data !== 0) { + digit++; + data >>>= 1; + } + return digit; +}; +utils$1.setToSJISFunction = function setToSJISFunction(f4) { + if (typeof f4 !== "function") { + throw new Error('"toSJISFunc" is not a valid function.'); + } + toSJISFunction = f4; +}; +utils$1.isKanjiModeEnabled = function() { + return typeof toSJISFunction !== "undefined"; +}; +utils$1.toSJIS = function toSJIS(kanji2) { + return toSJISFunction(kanji2); +}; +var errorCorrectionLevel = {}; +(function(exports) { + exports.L = { bit: 1 }; + exports.M = { bit: 0 }; + exports.Q = { bit: 3 }; + exports.H = { bit: 2 }; + function fromString2(string2) { + if (typeof string2 !== "string") { + throw new Error("Param is not a string"); + } + const lcStr = string2.toLowerCase(); + switch (lcStr) { + case "l": + case "low": + return exports.L; + case "m": + case "medium": + return exports.M; + case "q": + case "quartile": + return exports.Q; + case "h": + case "high": + return exports.H; + default: + throw new Error("Unknown EC Level: " + string2); + } + } + exports.isValid = function isValid2(level) { + return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4; + }; + exports.from = function from2(value, defaultValue) { + if (exports.isValid(value)) { + return value; + } + try { + return fromString2(value); + } catch (e18) { + return defaultValue; + } + }; +})(errorCorrectionLevel); +function BitBuffer$1() { + this.buffer = []; + this.length = 0; +} +BitBuffer$1.prototype = { + get: function(index2) { + const bufIndex = Math.floor(index2 / 8); + return (this.buffer[bufIndex] >>> 7 - index2 % 8 & 1) === 1; + }, + put: function(num, length) { + for (let i2 = 0; i2 < length; i2++) { + this.putBit((num >>> length - i2 - 1 & 1) === 1); + } + }, + getLengthInBits: function() { + return this.length; + }, + putBit: function(bit) { + const bufIndex = Math.floor(this.length / 8); + if (this.buffer.length <= bufIndex) { + this.buffer.push(0); + } + if (bit) { + this.buffer[bufIndex] |= 128 >>> this.length % 8; + } + this.length++; + } +}; +var bitBuffer = BitBuffer$1; +function BitMatrix$1(size2) { + if (!size2 || size2 < 1) { + throw new Error("BitMatrix size must be defined and greater than 0"); + } + this.size = size2; + this.data = new Uint8Array(size2 * size2); + this.reservedBit = new Uint8Array(size2 * size2); +} +BitMatrix$1.prototype.set = function(row, col, value, reserved) { + const index2 = row * this.size + col; + this.data[index2] = value; + if (reserved) + this.reservedBit[index2] = true; +}; +BitMatrix$1.prototype.get = function(row, col) { + return this.data[row * this.size + col]; +}; +BitMatrix$1.prototype.xor = function(row, col, value) { + this.data[row * this.size + col] ^= value; +}; +BitMatrix$1.prototype.isReserved = function(row, col) { + return this.reservedBit[row * this.size + col]; +}; +var bitMatrix = BitMatrix$1; +var alignmentPattern = {}; +(function(exports) { + const getSymbolSize3 = utils$1.getSymbolSize; + exports.getRowColCoords = function getRowColCoords(version2) { + if (version2 === 1) + return []; + const posCount = Math.floor(version2 / 7) + 2; + const size2 = getSymbolSize3(version2); + const intervals = size2 === 145 ? 26 : Math.ceil((size2 - 13) / (2 * posCount - 2)) * 2; + const positions = [size2 - 7]; + for (let i2 = 1; i2 < posCount - 1; i2++) { + positions[i2] = positions[i2 - 1] - intervals; + } + positions.push(6); + return positions.reverse(); + }; + exports.getPositions = function getPositions2(version2) { + const coords = []; + const pos = exports.getRowColCoords(version2); + const posLength = pos.length; + for (let i2 = 0; i2 < posLength; i2++) { + for (let j2 = 0; j2 < posLength; j2++) { + if (i2 === 0 && j2 === 0 || // top-left + i2 === 0 && j2 === posLength - 1 || // bottom-left + i2 === posLength - 1 && j2 === 0) { + continue; + } + coords.push([pos[i2], pos[j2]]); + } + } + return coords; + }; +})(alignmentPattern); +var finderPattern = {}; +const getSymbolSize2 = utils$1.getSymbolSize; +const FINDER_PATTERN_SIZE = 7; +finderPattern.getPositions = function getPositions(version2) { + const size2 = getSymbolSize2(version2); + return [ + // top-left + [0, 0], + // top-right + [size2 - FINDER_PATTERN_SIZE, 0], + // bottom-left + [0, size2 - FINDER_PATTERN_SIZE] + ]; +}; +var maskPattern = {}; +(function(exports) { + exports.Patterns = { + PATTERN000: 0, + PATTERN001: 1, + PATTERN010: 2, + PATTERN011: 3, + PATTERN100: 4, + PATTERN101: 5, + PATTERN110: 6, + PATTERN111: 7 + }; + const PenaltyScores = { + N1: 3, + N2: 3, + N3: 40, + N4: 10 + }; + exports.isValid = function isValid2(mask2) { + return mask2 != null && mask2 !== "" && !isNaN(mask2) && mask2 >= 0 && mask2 <= 7; + }; + exports.from = function from2(value) { + return exports.isValid(value) ? parseInt(value, 10) : void 0; + }; + exports.getPenaltyN1 = function getPenaltyN1(data) { + const size2 = data.size; + let points = 0; + let sameCountCol = 0; + let sameCountRow = 0; + let lastCol = null; + let lastRow = null; + for (let row = 0; row < size2; row++) { + sameCountCol = sameCountRow = 0; + lastCol = lastRow = null; + for (let col = 0; col < size2; col++) { + let module = data.get(row, col); + if (module === lastCol) { + sameCountCol++; + } else { + if (sameCountCol >= 5) + points += PenaltyScores.N1 + (sameCountCol - 5); + lastCol = module; + sameCountCol = 1; + } + module = data.get(col, row); + if (module === lastRow) { + sameCountRow++; + } else { + if (sameCountRow >= 5) + points += PenaltyScores.N1 + (sameCountRow - 5); + lastRow = module; + sameCountRow = 1; + } + } + if (sameCountCol >= 5) + points += PenaltyScores.N1 + (sameCountCol - 5); + if (sameCountRow >= 5) + points += PenaltyScores.N1 + (sameCountRow - 5); + } + return points; + }; + exports.getPenaltyN2 = function getPenaltyN2(data) { + const size2 = data.size; + let points = 0; + for (let row = 0; row < size2 - 1; row++) { + for (let col = 0; col < size2 - 1; col++) { + const last = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1); + if (last === 4 || last === 0) + points++; + } + } + return points * PenaltyScores.N2; + }; + exports.getPenaltyN3 = function getPenaltyN3(data) { + const size2 = data.size; + let points = 0; + let bitsCol = 0; + let bitsRow = 0; + for (let row = 0; row < size2; row++) { + bitsCol = bitsRow = 0; + for (let col = 0; col < size2; col++) { + bitsCol = bitsCol << 1 & 2047 | data.get(row, col); + if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) + points++; + bitsRow = bitsRow << 1 & 2047 | data.get(col, row); + if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) + points++; + } + } + return points * PenaltyScores.N3; + }; + exports.getPenaltyN4 = function getPenaltyN4(data) { + let darkCount = 0; + const modulesCount = data.data.length; + for (let i2 = 0; i2 < modulesCount; i2++) + darkCount += data.data[i2]; + const k2 = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10); + return k2 * PenaltyScores.N4; + }; + function getMaskAt(maskPattern2, i2, j2) { + switch (maskPattern2) { + case exports.Patterns.PATTERN000: + return (i2 + j2) % 2 === 0; + case exports.Patterns.PATTERN001: + return i2 % 2 === 0; + case exports.Patterns.PATTERN010: + return j2 % 3 === 0; + case exports.Patterns.PATTERN011: + return (i2 + j2) % 3 === 0; + case exports.Patterns.PATTERN100: + return (Math.floor(i2 / 2) + Math.floor(j2 / 3)) % 2 === 0; + case exports.Patterns.PATTERN101: + return i2 * j2 % 2 + i2 * j2 % 3 === 0; + case exports.Patterns.PATTERN110: + return (i2 * j2 % 2 + i2 * j2 % 3) % 2 === 0; + case exports.Patterns.PATTERN111: + return (i2 * j2 % 3 + (i2 + j2) % 2) % 2 === 0; + default: + throw new Error("bad maskPattern:" + maskPattern2); + } + } + exports.applyMask = function applyMask(pattern, data) { + const size2 = data.size; + for (let col = 0; col < size2; col++) { + for (let row = 0; row < size2; row++) { + if (data.isReserved(row, col)) + continue; + data.xor(row, col, getMaskAt(pattern, row, col)); + } + } + }; + exports.getBestMask = function getBestMask(data, setupFormatFunc) { + const numPatterns = Object.keys(exports.Patterns).length; + let bestPattern = 0; + let lowerPenalty = Infinity; + for (let p3 = 0; p3 < numPatterns; p3++) { + setupFormatFunc(p3); + exports.applyMask(p3, data); + const penalty = exports.getPenaltyN1(data) + exports.getPenaltyN2(data) + exports.getPenaltyN3(data) + exports.getPenaltyN4(data); + exports.applyMask(p3, data); + if (penalty < lowerPenalty) { + lowerPenalty = penalty; + bestPattern = p3; + } + } + return bestPattern; + }; +})(maskPattern); +var errorCorrectionCode = {}; +const ECLevel$1 = errorCorrectionLevel; +const EC_BLOCKS_TABLE = [ + // L M Q H + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 2, + 1, + 2, + 2, + 4, + 1, + 2, + 4, + 4, + 2, + 4, + 4, + 4, + 2, + 4, + 6, + 5, + 2, + 4, + 6, + 6, + 2, + 5, + 8, + 8, + 4, + 5, + 8, + 8, + 4, + 5, + 8, + 11, + 4, + 8, + 10, + 11, + 4, + 9, + 12, + 16, + 4, + 9, + 16, + 16, + 6, + 10, + 12, + 18, + 6, + 10, + 17, + 16, + 6, + 11, + 16, + 19, + 6, + 13, + 18, + 21, + 7, + 14, + 21, + 25, + 8, + 16, + 20, + 25, + 8, + 17, + 23, + 25, + 9, + 17, + 23, + 34, + 9, + 18, + 25, + 30, + 10, + 20, + 27, + 32, + 12, + 21, + 29, + 35, + 12, + 23, + 34, + 37, + 12, + 25, + 34, + 40, + 13, + 26, + 35, + 42, + 14, + 28, + 38, + 45, + 15, + 29, + 40, + 48, + 16, + 31, + 43, + 51, + 17, + 33, + 45, + 54, + 18, + 35, + 48, + 57, + 19, + 37, + 51, + 60, + 19, + 38, + 53, + 63, + 20, + 40, + 56, + 66, + 21, + 43, + 59, + 70, + 22, + 45, + 62, + 74, + 24, + 47, + 65, + 77, + 25, + 49, + 68, + 81 +]; +const EC_CODEWORDS_TABLE = [ + // L M Q H + 7, + 10, + 13, + 17, + 10, + 16, + 22, + 28, + 15, + 26, + 36, + 44, + 20, + 36, + 52, + 64, + 26, + 48, + 72, + 88, + 36, + 64, + 96, + 112, + 40, + 72, + 108, + 130, + 48, + 88, + 132, + 156, + 60, + 110, + 160, + 192, + 72, + 130, + 192, + 224, + 80, + 150, + 224, + 264, + 96, + 176, + 260, + 308, + 104, + 198, + 288, + 352, + 120, + 216, + 320, + 384, + 132, + 240, + 360, + 432, + 144, + 280, + 408, + 480, + 168, + 308, + 448, + 532, + 180, + 338, + 504, + 588, + 196, + 364, + 546, + 650, + 224, + 416, + 600, + 700, + 224, + 442, + 644, + 750, + 252, + 476, + 690, + 816, + 270, + 504, + 750, + 900, + 300, + 560, + 810, + 960, + 312, + 588, + 870, + 1050, + 336, + 644, + 952, + 1110, + 360, + 700, + 1020, + 1200, + 390, + 728, + 1050, + 1260, + 420, + 784, + 1140, + 1350, + 450, + 812, + 1200, + 1440, + 480, + 868, + 1290, + 1530, + 510, + 924, + 1350, + 1620, + 540, + 980, + 1440, + 1710, + 570, + 1036, + 1530, + 1800, + 570, + 1064, + 1590, + 1890, + 600, + 1120, + 1680, + 1980, + 630, + 1204, + 1770, + 2100, + 660, + 1260, + 1860, + 2220, + 720, + 1316, + 1950, + 2310, + 750, + 1372, + 2040, + 2430 +]; +errorCorrectionCode.getBlocksCount = function getBlocksCount(version2, errorCorrectionLevel2) { + switch (errorCorrectionLevel2) { + case ECLevel$1.L: + return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 0]; + case ECLevel$1.M: + return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 1]; + case ECLevel$1.Q: + return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 2]; + case ECLevel$1.H: + return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 3]; + default: + return void 0; + } +}; +errorCorrectionCode.getTotalCodewordsCount = function getTotalCodewordsCount(version2, errorCorrectionLevel2) { + switch (errorCorrectionLevel2) { + case ECLevel$1.L: + return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 0]; + case ECLevel$1.M: + return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 1]; + case ECLevel$1.Q: + return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 2]; + case ECLevel$1.H: + return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 3]; + default: + return void 0; + } +}; +var polynomial = {}; +var galoisField = {}; +const EXP_TABLE = new Uint8Array(512); +const LOG_TABLE = new Uint8Array(256); +(function initTables() { + let x3 = 1; + for (let i2 = 0; i2 < 255; i2++) { + EXP_TABLE[i2] = x3; + LOG_TABLE[x3] = i2; + x3 <<= 1; + if (x3 & 256) { + x3 ^= 285; + } + } + for (let i2 = 255; i2 < 512; i2++) { + EXP_TABLE[i2] = EXP_TABLE[i2 - 255]; + } +})(); +galoisField.log = function log(n5) { + if (n5 < 1) + throw new Error("log(" + n5 + ")"); + return LOG_TABLE[n5]; +}; +galoisField.exp = function exp(n5) { + return EXP_TABLE[n5]; +}; +galoisField.mul = function mul5(x3, y3) { + if (x3 === 0 || y3 === 0) + return 0; + return EXP_TABLE[LOG_TABLE[x3] + LOG_TABLE[y3]]; +}; +(function(exports) { + const GF = galoisField; + exports.mul = function mul6(p1, p22) { + const coeff = new Uint8Array(p1.length + p22.length - 1); + for (let i2 = 0; i2 < p1.length; i2++) { + for (let j2 = 0; j2 < p22.length; j2++) { + coeff[i2 + j2] ^= GF.mul(p1[i2], p22[j2]); + } + } + return coeff; + }; + exports.mod = function mod2(divident, divisor) { + let result = new Uint8Array(divident); + while (result.length - divisor.length >= 0) { + const coeff = result[0]; + for (let i2 = 0; i2 < divisor.length; i2++) { + result[i2] ^= GF.mul(divisor[i2], coeff); + } + let offset2 = 0; + while (offset2 < result.length && result[offset2] === 0) + offset2++; + result = result.slice(offset2); + } + return result; + }; + exports.generateECPolynomial = function generateECPolynomial(degree) { + let poly = new Uint8Array([1]); + for (let i2 = 0; i2 < degree; i2++) { + poly = exports.mul(poly, new Uint8Array([1, GF.exp(i2)])); + } + return poly; + }; +})(polynomial); +const Polynomial = polynomial; +function ReedSolomonEncoder$1(degree) { + this.genPoly = void 0; + this.degree = degree; + if (this.degree) + this.initialize(this.degree); +} +ReedSolomonEncoder$1.prototype.initialize = function initialize(degree) { + this.degree = degree; + this.genPoly = Polynomial.generateECPolynomial(this.degree); +}; +ReedSolomonEncoder$1.prototype.encode = function encode4(data) { + if (!this.genPoly) { + throw new Error("Encoder not initialized"); + } + const paddedData = new Uint8Array(data.length + this.degree); + paddedData.set(data); + const remainder = Polynomial.mod(paddedData, this.genPoly); + const start = this.degree - remainder.length; + if (start > 0) { + const buff = new Uint8Array(this.degree); + buff.set(remainder, start); + return buff; + } + return remainder; +}; +var reedSolomonEncoder = ReedSolomonEncoder$1; +var version = {}; +var mode = {}; +var versionCheck = {}; +versionCheck.isValid = function isValid(version2) { + return !isNaN(version2) && version2 >= 1 && version2 <= 40; +}; +var regex = {}; +const numeric = "[0-9]+"; +const alphanumeric = "[A-Z $%*+\\-./:]+"; +let kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+"; +kanji = kanji.replace(/u/g, "\\u"); +const byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+"; +regex.KANJI = new RegExp(kanji, "g"); +regex.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"); +regex.BYTE = new RegExp(byte, "g"); +regex.NUMERIC = new RegExp(numeric, "g"); +regex.ALPHANUMERIC = new RegExp(alphanumeric, "g"); +const TEST_KANJI = new RegExp("^" + kanji + "$"); +const TEST_NUMERIC = new RegExp("^" + numeric + "$"); +const TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$"); +regex.testKanji = function testKanji(str) { + return TEST_KANJI.test(str); +}; +regex.testNumeric = function testNumeric(str) { + return TEST_NUMERIC.test(str); +}; +regex.testAlphanumeric = function testAlphanumeric(str) { + return TEST_ALPHANUMERIC.test(str); +}; +(function(exports) { + const VersionCheck = versionCheck; + const Regex = regex; + exports.NUMERIC = { + id: "Numeric", + bit: 1 << 0, + ccBits: [10, 12, 14] + }; + exports.ALPHANUMERIC = { + id: "Alphanumeric", + bit: 1 << 1, + ccBits: [9, 11, 13] + }; + exports.BYTE = { + id: "Byte", + bit: 1 << 2, + ccBits: [8, 16, 16] + }; + exports.KANJI = { + id: "Kanji", + bit: 1 << 3, + ccBits: [8, 10, 12] + }; + exports.MIXED = { + bit: -1 + }; + exports.getCharCountIndicator = function getCharCountIndicator(mode2, version2) { + if (!mode2.ccBits) + throw new Error("Invalid mode: " + mode2); + if (!VersionCheck.isValid(version2)) { + throw new Error("Invalid version: " + version2); + } + if (version2 >= 1 && version2 < 10) + return mode2.ccBits[0]; + else if (version2 < 27) + return mode2.ccBits[1]; + return mode2.ccBits[2]; + }; + exports.getBestModeForData = function getBestModeForData(dataStr) { + if (Regex.testNumeric(dataStr)) + return exports.NUMERIC; + else if (Regex.testAlphanumeric(dataStr)) + return exports.ALPHANUMERIC; + else if (Regex.testKanji(dataStr)) + return exports.KANJI; + else + return exports.BYTE; + }; + exports.toString = function toString3(mode2) { + if (mode2 && mode2.id) + return mode2.id; + throw new Error("Invalid mode"); + }; + exports.isValid = function isValid2(mode2) { + return mode2 && mode2.bit && mode2.ccBits; + }; + function fromString2(string2) { + if (typeof string2 !== "string") { + throw new Error("Param is not a string"); + } + const lcStr = string2.toLowerCase(); + switch (lcStr) { + case "numeric": + return exports.NUMERIC; + case "alphanumeric": + return exports.ALPHANUMERIC; + case "kanji": + return exports.KANJI; + case "byte": + return exports.BYTE; + default: + throw new Error("Unknown mode: " + string2); + } + } + exports.from = function from2(value, defaultValue) { + if (exports.isValid(value)) { + return value; + } + try { + return fromString2(value); + } catch (e18) { + return defaultValue; + } + }; +})(mode); +(function(exports) { + const Utils2 = utils$1; + const ECCode2 = errorCorrectionCode; + const ECLevel2 = errorCorrectionLevel; + const Mode2 = mode; + const VersionCheck = versionCheck; + const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0; + const G18_BCH = Utils2.getBCHDigit(G18); + function getBestVersionForDataLength(mode2, length, errorCorrectionLevel2) { + for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { + if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, mode2)) { + return currentVersion; + } + } + return void 0; + } + function getReservedBitsCount(mode2, version2) { + return Mode2.getCharCountIndicator(mode2, version2) + 4; + } + function getTotalBitsFromDataArray(segments2, version2) { + let totalBits = 0; + segments2.forEach(function(data) { + const reservedBits = getReservedBitsCount(data.mode, version2); + totalBits += reservedBits + data.getBitsLength(); + }); + return totalBits; + } + function getBestVersionForMixedData(segments2, errorCorrectionLevel2) { + for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { + const length = getTotalBitsFromDataArray(segments2, currentVersion); + if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, Mode2.MIXED)) { + return currentVersion; + } + } + return void 0; + } + exports.from = function from2(value, defaultValue) { + if (VersionCheck.isValid(value)) { + return parseInt(value, 10); + } + return defaultValue; + }; + exports.getCapacity = function getCapacity(version2, errorCorrectionLevel2, mode2) { + if (!VersionCheck.isValid(version2)) { + throw new Error("Invalid QR Code version"); + } + if (typeof mode2 === "undefined") + mode2 = Mode2.BYTE; + const totalCodewords = Utils2.getSymbolTotalCodewords(version2); + const ecTotalCodewords = ECCode2.getTotalCodewordsCount(version2, errorCorrectionLevel2); + const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; + if (mode2 === Mode2.MIXED) + return dataTotalCodewordsBits; + const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode2, version2); + switch (mode2) { + case Mode2.NUMERIC: + return Math.floor(usableBits / 10 * 3); + case Mode2.ALPHANUMERIC: + return Math.floor(usableBits / 11 * 2); + case Mode2.KANJI: + return Math.floor(usableBits / 13); + case Mode2.BYTE: + default: + return Math.floor(usableBits / 8); + } + }; + exports.getBestVersionForData = function getBestVersionForData(data, errorCorrectionLevel2) { + let seg; + const ecl = ECLevel2.from(errorCorrectionLevel2, ECLevel2.M); + if (Array.isArray(data)) { + if (data.length > 1) { + return getBestVersionForMixedData(data, ecl); + } + if (data.length === 0) { + return 1; + } + seg = data[0]; + } else { + seg = data; + } + return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl); + }; + exports.getEncodedBits = function getEncodedBits2(version2) { + if (!VersionCheck.isValid(version2) || version2 < 7) { + throw new Error("Invalid QR Code version"); + } + let d4 = version2 << 12; + while (Utils2.getBCHDigit(d4) - G18_BCH >= 0) { + d4 ^= G18 << Utils2.getBCHDigit(d4) - G18_BCH; + } + return version2 << 12 | d4; + }; +})(version); +var formatInfo = {}; +const Utils$3 = utils$1; +const G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0; +const G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1; +const G15_BCH = Utils$3.getBCHDigit(G15); +formatInfo.getEncodedBits = function getEncodedBits(errorCorrectionLevel2, mask2) { + const data = errorCorrectionLevel2.bit << 3 | mask2; + let d4 = data << 10; + while (Utils$3.getBCHDigit(d4) - G15_BCH >= 0) { + d4 ^= G15 << Utils$3.getBCHDigit(d4) - G15_BCH; + } + return (data << 10 | d4) ^ G15_MASK; +}; +var segments = {}; +const Mode$4 = mode; +function NumericData(data) { + this.mode = Mode$4.NUMERIC; + this.data = data.toString(); +} +NumericData.getBitsLength = function getBitsLength(length) { + return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0); +}; +NumericData.prototype.getLength = function getLength2() { + return this.data.length; +}; +NumericData.prototype.getBitsLength = function getBitsLength2() { + return NumericData.getBitsLength(this.data.length); +}; +NumericData.prototype.write = function write(bitBuffer2) { + let i2, group, value; + for (i2 = 0; i2 + 3 <= this.data.length; i2 += 3) { + group = this.data.substr(i2, 3); + value = parseInt(group, 10); + bitBuffer2.put(value, 10); + } + const remainingNum = this.data.length - i2; + if (remainingNum > 0) { + group = this.data.substr(i2); + value = parseInt(group, 10); + bitBuffer2.put(value, remainingNum * 3 + 1); + } +}; +var numericData = NumericData; +const Mode$3 = mode; +const ALPHA_NUM_CHARS = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + " ", + "$", + "%", + "*", + "+", + "-", + ".", + "/", + ":" +]; +function AlphanumericData(data) { + this.mode = Mode$3.ALPHANUMERIC; + this.data = data; +} +AlphanumericData.getBitsLength = function getBitsLength3(length) { + return 11 * Math.floor(length / 2) + 6 * (length % 2); +}; +AlphanumericData.prototype.getLength = function getLength3() { + return this.data.length; +}; +AlphanumericData.prototype.getBitsLength = function getBitsLength4() { + return AlphanumericData.getBitsLength(this.data.length); +}; +AlphanumericData.prototype.write = function write2(bitBuffer2) { + let i2; + for (i2 = 0; i2 + 2 <= this.data.length; i2 += 2) { + let value = ALPHA_NUM_CHARS.indexOf(this.data[i2]) * 45; + value += ALPHA_NUM_CHARS.indexOf(this.data[i2 + 1]); + bitBuffer2.put(value, 11); + } + if (this.data.length % 2) { + bitBuffer2.put(ALPHA_NUM_CHARS.indexOf(this.data[i2]), 6); + } +}; +var alphanumericData = AlphanumericData; +var encodeUtf8$1 = function encodeUtf8(input) { + var result = []; + var size2 = input.length; + for (var index2 = 0; index2 < size2; index2++) { + var point5 = input.charCodeAt(index2); + if (point5 >= 55296 && point5 <= 56319 && size2 > index2 + 1) { + var second = input.charCodeAt(index2 + 1); + if (second >= 56320 && second <= 57343) { + point5 = (point5 - 55296) * 1024 + second - 56320 + 65536; + index2 += 1; + } + } + if (point5 < 128) { + result.push(point5); + continue; + } + if (point5 < 2048) { + result.push(point5 >> 6 | 192); + result.push(point5 & 63 | 128); + continue; + } + if (point5 < 55296 || point5 >= 57344 && point5 < 65536) { + result.push(point5 >> 12 | 224); + result.push(point5 >> 6 & 63 | 128); + result.push(point5 & 63 | 128); + continue; + } + if (point5 >= 65536 && point5 <= 1114111) { + result.push(point5 >> 18 | 240); + result.push(point5 >> 12 & 63 | 128); + result.push(point5 >> 6 & 63 | 128); + result.push(point5 & 63 | 128); + continue; + } + result.push(239, 191, 189); + } + return new Uint8Array(result).buffer; +}; +const encodeUtf82 = encodeUtf8$1; +const Mode$2 = mode; +function ByteData(data) { + this.mode = Mode$2.BYTE; + if (typeof data === "string") { + data = encodeUtf82(data); + } + this.data = new Uint8Array(data); +} +ByteData.getBitsLength = function getBitsLength5(length) { + return length * 8; +}; +ByteData.prototype.getLength = function getLength4() { + return this.data.length; +}; +ByteData.prototype.getBitsLength = function getBitsLength6() { + return ByteData.getBitsLength(this.data.length); +}; +ByteData.prototype.write = function(bitBuffer2) { + for (let i2 = 0, l2 = this.data.length; i2 < l2; i2++) { + bitBuffer2.put(this.data[i2], 8); + } +}; +var byteData = ByteData; +const Mode$1 = mode; +const Utils$2 = utils$1; +function KanjiData(data) { + this.mode = Mode$1.KANJI; + this.data = data; +} +KanjiData.getBitsLength = function getBitsLength7(length) { + return length * 13; +}; +KanjiData.prototype.getLength = function getLength5() { + return this.data.length; +}; +KanjiData.prototype.getBitsLength = function getBitsLength8() { + return KanjiData.getBitsLength(this.data.length); +}; +KanjiData.prototype.write = function(bitBuffer2) { + let i2; + for (i2 = 0; i2 < this.data.length; i2++) { + let value = Utils$2.toSJIS(this.data[i2]); + if (value >= 33088 && value <= 40956) { + value -= 33088; + } else if (value >= 57408 && value <= 60351) { + value -= 49472; + } else { + throw new Error( + "Invalid SJIS character: " + this.data[i2] + "\nMake sure your charset is UTF-8" + ); + } + value = (value >>> 8 & 255) * 192 + (value & 255); + bitBuffer2.put(value, 13); + } +}; +var kanjiData = KanjiData; +var dijkstra = { exports: {} }; +(function(module) { + var dijkstra2 = { + single_source_shortest_paths: function(graph, s2, d4) { + var predecessors = {}; + var costs = {}; + costs[s2] = 0; + var open = dijkstra2.PriorityQueue.make(); + open.push(s2, 0); + var closest, u2, v6, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit; + while (!open.empty()) { + closest = open.pop(); + u2 = closest.value; + cost_of_s_to_u = closest.cost; + adjacent_nodes = graph[u2] || {}; + for (v6 in adjacent_nodes) { + if (adjacent_nodes.hasOwnProperty(v6)) { + cost_of_e = adjacent_nodes[v6]; + cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; + cost_of_s_to_v = costs[v6]; + first_visit = typeof costs[v6] === "undefined"; + if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { + costs[v6] = cost_of_s_to_u_plus_cost_of_e; + open.push(v6, cost_of_s_to_u_plus_cost_of_e); + predecessors[v6] = u2; + } + } + } + } + if (typeof d4 !== "undefined" && typeof costs[d4] === "undefined") { + var msg = ["Could not find a path from ", s2, " to ", d4, "."].join(""); + throw new Error(msg); + } + return predecessors; + }, + extract_shortest_path_from_predecessor_list: function(predecessors, d4) { + var nodes = []; + var u2 = d4; + while (u2) { + nodes.push(u2); + predecessors[u2]; + u2 = predecessors[u2]; + } + nodes.reverse(); + return nodes; + }, + find_path: function(graph, s2, d4) { + var predecessors = dijkstra2.single_source_shortest_paths(graph, s2, d4); + return dijkstra2.extract_shortest_path_from_predecessor_list( + predecessors, + d4 + ); + }, + /** + * A very naive priority queue implementation. + */ + PriorityQueue: { + make: function(opts) { + var T9 = dijkstra2.PriorityQueue, t2 = {}, key2; + opts = opts || {}; + for (key2 in T9) { + if (T9.hasOwnProperty(key2)) { + t2[key2] = T9[key2]; + } + } + t2.queue = []; + t2.sorter = opts.sorter || T9.default_sorter; + return t2; + }, + default_sorter: function(a3, b2) { + return a3.cost - b2.cost; + }, + /** + * Add a new item to the queue and ensure the highest priority element + * is at the front of the queue. + */ + push: function(value, cost) { + var item = { value, cost }; + this.queue.push(item); + this.queue.sort(this.sorter); + }, + /** + * Return the highest priority element in the queue. + */ + pop: function() { + return this.queue.shift(); + }, + empty: function() { + return this.queue.length === 0; + } + } + }; + { + module.exports = dijkstra2; + } +})(dijkstra); +var dijkstraExports = dijkstra.exports; +(function(exports) { + const Mode2 = mode; + const NumericData2 = numericData; + const AlphanumericData2 = alphanumericData; + const ByteData2 = byteData; + const KanjiData2 = kanjiData; + const Regex = regex; + const Utils2 = utils$1; + const dijkstra2 = dijkstraExports; + function getStringByteLength(str) { + return unescape(encodeURIComponent(str)).length; + } + function getSegments(regex2, mode2, str) { + const segments2 = []; + let result; + while ((result = regex2.exec(str)) !== null) { + segments2.push({ + data: result[0], + index: result.index, + mode: mode2, + length: result[0].length + }); + } + return segments2; + } + function getSegmentsFromString(dataStr) { + const numSegs = getSegments(Regex.NUMERIC, Mode2.NUMERIC, dataStr); + const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode2.ALPHANUMERIC, dataStr); + let byteSegs; + let kanjiSegs; + if (Utils2.isKanjiModeEnabled()) { + byteSegs = getSegments(Regex.BYTE, Mode2.BYTE, dataStr); + kanjiSegs = getSegments(Regex.KANJI, Mode2.KANJI, dataStr); + } else { + byteSegs = getSegments(Regex.BYTE_KANJI, Mode2.BYTE, dataStr); + kanjiSegs = []; + } + const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs); + return segs.sort(function(s1, s2) { + return s1.index - s2.index; + }).map(function(obj) { + return { + data: obj.data, + mode: obj.mode, + length: obj.length + }; + }); + } + function getSegmentBitsLength(length, mode2) { + switch (mode2) { + case Mode2.NUMERIC: + return NumericData2.getBitsLength(length); + case Mode2.ALPHANUMERIC: + return AlphanumericData2.getBitsLength(length); + case Mode2.KANJI: + return KanjiData2.getBitsLength(length); + case Mode2.BYTE: + return ByteData2.getBitsLength(length); + } + } + function mergeSegments(segs) { + return segs.reduce(function(acc, curr) { + const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null; + if (prevSeg && prevSeg.mode === curr.mode) { + acc[acc.length - 1].data += curr.data; + return acc; + } + acc.push(curr); + return acc; + }, []); + } + function buildNodes(segs) { + const nodes = []; + for (let i2 = 0; i2 < segs.length; i2++) { + const seg = segs[i2]; + switch (seg.mode) { + case Mode2.NUMERIC: + nodes.push([ + seg, + { data: seg.data, mode: Mode2.ALPHANUMERIC, length: seg.length }, + { data: seg.data, mode: Mode2.BYTE, length: seg.length } + ]); + break; + case Mode2.ALPHANUMERIC: + nodes.push([ + seg, + { data: seg.data, mode: Mode2.BYTE, length: seg.length } + ]); + break; + case Mode2.KANJI: + nodes.push([ + seg, + { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) } + ]); + break; + case Mode2.BYTE: + nodes.push([ + { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) } + ]); + } + } + return nodes; + } + function buildGraph(nodes, version2) { + const table = {}; + const graph = { start: {} }; + let prevNodeIds = ["start"]; + for (let i2 = 0; i2 < nodes.length; i2++) { + const nodeGroup = nodes[i2]; + const currentNodeIds = []; + for (let j2 = 0; j2 < nodeGroup.length; j2++) { + const node2 = nodeGroup[j2]; + const key2 = "" + i2 + j2; + currentNodeIds.push(key2); + table[key2] = { node: node2, lastCount: 0 }; + graph[key2] = {}; + for (let n5 = 0; n5 < prevNodeIds.length; n5++) { + const prevNodeId = prevNodeIds[n5]; + if (table[prevNodeId] && table[prevNodeId].node.mode === node2.mode) { + graph[prevNodeId][key2] = getSegmentBitsLength(table[prevNodeId].lastCount + node2.length, node2.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node2.mode); + table[prevNodeId].lastCount += node2.length; + } else { + if (table[prevNodeId]) + table[prevNodeId].lastCount = node2.length; + graph[prevNodeId][key2] = getSegmentBitsLength(node2.length, node2.mode) + 4 + Mode2.getCharCountIndicator(node2.mode, version2); + } + } + } + prevNodeIds = currentNodeIds; + } + for (let n5 = 0; n5 < prevNodeIds.length; n5++) { + graph[prevNodeIds[n5]].end = 0; + } + return { map: graph, table }; + } + function buildSingleSegment(data, modesHint) { + let mode2; + const bestMode = Mode2.getBestModeForData(data); + mode2 = Mode2.from(modesHint, bestMode); + if (mode2 !== Mode2.BYTE && mode2.bit < bestMode.bit) { + throw new Error('"' + data + '" cannot be encoded with mode ' + Mode2.toString(mode2) + ".\n Suggested mode is: " + Mode2.toString(bestMode)); + } + if (mode2 === Mode2.KANJI && !Utils2.isKanjiModeEnabled()) { + mode2 = Mode2.BYTE; + } + switch (mode2) { + case Mode2.NUMERIC: + return new NumericData2(data); + case Mode2.ALPHANUMERIC: + return new AlphanumericData2(data); + case Mode2.KANJI: + return new KanjiData2(data); + case Mode2.BYTE: + return new ByteData2(data); + } + } + exports.fromArray = function fromArray(array2) { + return array2.reduce(function(acc, seg) { + if (typeof seg === "string") { + acc.push(buildSingleSegment(seg, null)); + } else if (seg.data) { + acc.push(buildSingleSegment(seg.data, seg.mode)); + } + return acc; + }, []); + }; + exports.fromString = function fromString2(data, version2) { + const segs = getSegmentsFromString(data, Utils2.isKanjiModeEnabled()); + const nodes = buildNodes(segs); + const graph = buildGraph(nodes, version2); + const path = dijkstra2.find_path(graph.map, "start", "end"); + const optimizedSegs = []; + for (let i2 = 1; i2 < path.length - 1; i2++) { + optimizedSegs.push(graph.table[path[i2]].node); + } + return exports.fromArray(mergeSegments(optimizedSegs)); + }; + exports.rawSplit = function rawSplit(data) { + return exports.fromArray( + getSegmentsFromString(data, Utils2.isKanjiModeEnabled()) + ); + }; +})(segments); +const Utils$1 = utils$1; +const ECLevel = errorCorrectionLevel; +const BitBuffer = bitBuffer; +const BitMatrix = bitMatrix; +const AlignmentPattern = alignmentPattern; +const FinderPattern = finderPattern; +const MaskPattern = maskPattern; +const ECCode = errorCorrectionCode; +const ReedSolomonEncoder = reedSolomonEncoder; +const Version = version; +const FormatInfo = formatInfo; +const Mode = mode; +const Segments = segments; +function setupFinderPattern(matrix, version2) { + const size2 = matrix.size; + const pos = FinderPattern.getPositions(version2); + for (let i2 = 0; i2 < pos.length; i2++) { + const row = pos[i2][0]; + const col = pos[i2][1]; + for (let r2 = -1; r2 <= 7; r2++) { + if (row + r2 <= -1 || size2 <= row + r2) + continue; + for (let c2 = -1; c2 <= 7; c2++) { + if (col + c2 <= -1 || size2 <= col + c2) + continue; + if (r2 >= 0 && r2 <= 6 && (c2 === 0 || c2 === 6) || c2 >= 0 && c2 <= 6 && (r2 === 0 || r2 === 6) || r2 >= 2 && r2 <= 4 && c2 >= 2 && c2 <= 4) { + matrix.set(row + r2, col + c2, true, true); + } else { + matrix.set(row + r2, col + c2, false, true); + } + } + } + } +} +function setupTimingPattern(matrix) { + const size2 = matrix.size; + for (let r2 = 8; r2 < size2 - 8; r2++) { + const value = r2 % 2 === 0; + matrix.set(r2, 6, value, true); + matrix.set(6, r2, value, true); + } +} +function setupAlignmentPattern(matrix, version2) { + const pos = AlignmentPattern.getPositions(version2); + for (let i2 = 0; i2 < pos.length; i2++) { + const row = pos[i2][0]; + const col = pos[i2][1]; + for (let r2 = -2; r2 <= 2; r2++) { + for (let c2 = -2; c2 <= 2; c2++) { + if (r2 === -2 || r2 === 2 || c2 === -2 || c2 === 2 || r2 === 0 && c2 === 0) { + matrix.set(row + r2, col + c2, true, true); + } else { + matrix.set(row + r2, col + c2, false, true); + } + } + } + } +} +function setupVersionInfo(matrix, version2) { + const size2 = matrix.size; + const bits = Version.getEncodedBits(version2); + let row, col, mod2; + for (let i2 = 0; i2 < 18; i2++) { + row = Math.floor(i2 / 3); + col = i2 % 3 + size2 - 8 - 3; + mod2 = (bits >> i2 & 1) === 1; + matrix.set(row, col, mod2, true); + matrix.set(col, row, mod2, true); + } +} +function setupFormatInfo(matrix, errorCorrectionLevel2, maskPattern2) { + const size2 = matrix.size; + const bits = FormatInfo.getEncodedBits(errorCorrectionLevel2, maskPattern2); + let i2, mod2; + for (i2 = 0; i2 < 15; i2++) { + mod2 = (bits >> i2 & 1) === 1; + if (i2 < 6) { + matrix.set(i2, 8, mod2, true); + } else if (i2 < 8) { + matrix.set(i2 + 1, 8, mod2, true); + } else { + matrix.set(size2 - 15 + i2, 8, mod2, true); + } + if (i2 < 8) { + matrix.set(8, size2 - i2 - 1, mod2, true); + } else if (i2 < 9) { + matrix.set(8, 15 - i2 - 1 + 1, mod2, true); + } else { + matrix.set(8, 15 - i2 - 1, mod2, true); + } + } + matrix.set(size2 - 8, 8, 1, true); +} +function setupData(matrix, data) { + const size2 = matrix.size; + let inc = -1; + let row = size2 - 1; + let bitIndex = 7; + let byteIndex = 0; + for (let col = size2 - 1; col > 0; col -= 2) { + if (col === 6) + col--; + while (true) { + for (let c2 = 0; c2 < 2; c2++) { + if (!matrix.isReserved(row, col - c2)) { + let dark = false; + if (byteIndex < data.length) { + dark = (data[byteIndex] >>> bitIndex & 1) === 1; + } + matrix.set(row, col - c2, dark); + bitIndex--; + if (bitIndex === -1) { + byteIndex++; + bitIndex = 7; + } + } + } + row += inc; + if (row < 0 || size2 <= row) { + row -= inc; + inc = -inc; + break; + } + } + } +} +function createData(version2, errorCorrectionLevel2, segments2) { + const buffer2 = new BitBuffer(); + segments2.forEach(function(data) { + buffer2.put(data.mode.bit, 4); + buffer2.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version2)); + data.write(buffer2); + }); + const totalCodewords = Utils$1.getSymbolTotalCodewords(version2); + const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); + const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; + if (buffer2.getLengthInBits() + 4 <= dataTotalCodewordsBits) { + buffer2.put(0, 4); + } + while (buffer2.getLengthInBits() % 8 !== 0) { + buffer2.putBit(0); + } + const remainingByte = (dataTotalCodewordsBits - buffer2.getLengthInBits()) / 8; + for (let i2 = 0; i2 < remainingByte; i2++) { + buffer2.put(i2 % 2 ? 17 : 236, 8); + } + return createCodewords(buffer2, version2, errorCorrectionLevel2); +} +function createCodewords(bitBuffer2, version2, errorCorrectionLevel2) { + const totalCodewords = Utils$1.getSymbolTotalCodewords(version2); + const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); + const dataTotalCodewords = totalCodewords - ecTotalCodewords; + const ecTotalBlocks = ECCode.getBlocksCount(version2, errorCorrectionLevel2); + const blocksInGroup2 = totalCodewords % ecTotalBlocks; + const blocksInGroup1 = ecTotalBlocks - blocksInGroup2; + const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks); + const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks); + const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1; + const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1; + const rs2 = new ReedSolomonEncoder(ecCount); + let offset2 = 0; + const dcData = new Array(ecTotalBlocks); + const ecData = new Array(ecTotalBlocks); + let maxDataSize = 0; + const buffer2 = new Uint8Array(bitBuffer2.buffer); + for (let b2 = 0; b2 < ecTotalBlocks; b2++) { + const dataSize = b2 < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2; + dcData[b2] = buffer2.slice(offset2, offset2 + dataSize); + ecData[b2] = rs2.encode(dcData[b2]); + offset2 += dataSize; + maxDataSize = Math.max(maxDataSize, dataSize); + } + const data = new Uint8Array(totalCodewords); + let index2 = 0; + let i2, r2; + for (i2 = 0; i2 < maxDataSize; i2++) { + for (r2 = 0; r2 < ecTotalBlocks; r2++) { + if (i2 < dcData[r2].length) { + data[index2++] = dcData[r2][i2]; + } + } + } + for (i2 = 0; i2 < ecCount; i2++) { + for (r2 = 0; r2 < ecTotalBlocks; r2++) { + data[index2++] = ecData[r2][i2]; + } + } + return data; +} +function createSymbol(data, version2, errorCorrectionLevel2, maskPattern2) { + let segments2; + if (Array.isArray(data)) { + segments2 = Segments.fromArray(data); + } else if (typeof data === "string") { + let estimatedVersion = version2; + if (!estimatedVersion) { + const rawSegments = Segments.rawSplit(data); + estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel2); + } + segments2 = Segments.fromString(data, estimatedVersion || 40); + } else { + throw new Error("Invalid data"); + } + const bestVersion = Version.getBestVersionForData(segments2, errorCorrectionLevel2); + if (!bestVersion) { + throw new Error("The amount of data is too big to be stored in a QR Code"); + } + if (!version2) { + version2 = bestVersion; + } else if (version2 < bestVersion) { + throw new Error( + "\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n" + ); + } + const dataBits = createData(version2, errorCorrectionLevel2, segments2); + const moduleCount = Utils$1.getSymbolSize(version2); + const modules = new BitMatrix(moduleCount); + setupFinderPattern(modules, version2); + setupTimingPattern(modules); + setupAlignmentPattern(modules, version2); + setupFormatInfo(modules, errorCorrectionLevel2, 0); + if (version2 >= 7) { + setupVersionInfo(modules, version2); + } + setupData(modules, dataBits); + if (isNaN(maskPattern2)) { + maskPattern2 = MaskPattern.getBestMask( + modules, + setupFormatInfo.bind(null, modules, errorCorrectionLevel2) + ); + } + MaskPattern.applyMask(maskPattern2, modules); + setupFormatInfo(modules, errorCorrectionLevel2, maskPattern2); + return { + modules, + version: version2, + errorCorrectionLevel: errorCorrectionLevel2, + maskPattern: maskPattern2, + segments: segments2 + }; +} +qrcode.create = function create2(data, options) { + if (typeof data === "undefined" || data === "") { + throw new Error("No input text"); + } + let errorCorrectionLevel2 = ECLevel.M; + let version2; + let mask2; + if (typeof options !== "undefined") { + errorCorrectionLevel2 = ECLevel.from(options.errorCorrectionLevel, ECLevel.M); + version2 = Version.from(options.version); + mask2 = MaskPattern.from(options.maskPattern); + if (options.toSJISFunc) { + Utils$1.setToSJISFunction(options.toSJISFunc); + } + } + return createSymbol(data, version2, errorCorrectionLevel2, mask2); +}; +var canvas = {}; +var utils = {}; +(function(exports) { + function hex2rgba(hex) { + if (typeof hex === "number") { + hex = hex.toString(); + } + if (typeof hex !== "string") { + throw new Error("Color should be defined as hex string"); + } + let hexCode = hex.slice().replace("#", "").split(""); + if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) { + throw new Error("Invalid hex color: " + hex); + } + if (hexCode.length === 3 || hexCode.length === 4) { + hexCode = Array.prototype.concat.apply([], hexCode.map(function(c2) { + return [c2, c2]; + })); + } + if (hexCode.length === 6) + hexCode.push("F", "F"); + const hexValue = parseInt(hexCode.join(""), 16); + return { + r: hexValue >> 24 & 255, + g: hexValue >> 16 & 255, + b: hexValue >> 8 & 255, + a: hexValue & 255, + hex: "#" + hexCode.slice(0, 6).join("") + }; + } + exports.getOptions = function getOptions(options) { + if (!options) + options = {}; + if (!options.color) + options.color = {}; + const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin; + const width = options.width && options.width >= 21 ? options.width : void 0; + const scale = options.scale || 4; + return { + width, + scale: width ? 4 : scale, + margin, + color: { + dark: hex2rgba(options.color.dark || "#000000ff"), + light: hex2rgba(options.color.light || "#ffffffff") + }, + type: options.type, + rendererOpts: options.rendererOpts || {} + }; + }; + exports.getScale = function getScale(qrSize, opts) { + return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale; + }; + exports.getImageWidth = function getImageWidth(qrSize, opts) { + const scale = exports.getScale(qrSize, opts); + return Math.floor((qrSize + opts.margin * 2) * scale); + }; + exports.qrToImageData = function qrToImageData(imgData, qr2, opts) { + const size2 = qr2.modules.size; + const data = qr2.modules.data; + const scale = exports.getScale(size2, opts); + const symbolSize = Math.floor((size2 + opts.margin * 2) * scale); + const scaledMargin = opts.margin * scale; + const palette = [opts.color.light, opts.color.dark]; + for (let i2 = 0; i2 < symbolSize; i2++) { + for (let j2 = 0; j2 < symbolSize; j2++) { + let posDst = (i2 * symbolSize + j2) * 4; + let pxColor = opts.color.light; + if (i2 >= scaledMargin && j2 >= scaledMargin && i2 < symbolSize - scaledMargin && j2 < symbolSize - scaledMargin) { + const iSrc = Math.floor((i2 - scaledMargin) / scale); + const jSrc = Math.floor((j2 - scaledMargin) / scale); + pxColor = palette[data[iSrc * size2 + jSrc] ? 1 : 0]; + } + imgData[posDst++] = pxColor.r; + imgData[posDst++] = pxColor.g; + imgData[posDst++] = pxColor.b; + imgData[posDst] = pxColor.a; + } + } + }; +})(utils); +(function(exports) { + const Utils2 = utils; + function clearCanvas(ctx, canvas2, size2) { + ctx.clearRect(0, 0, canvas2.width, canvas2.height); + if (!canvas2.style) + canvas2.style = {}; + canvas2.height = size2; + canvas2.width = size2; + canvas2.style.height = size2 + "px"; + canvas2.style.width = size2 + "px"; + } + function getCanvasElement() { + try { + return document.createElement("canvas"); + } catch (e18) { + throw new Error("You need to specify a canvas element"); + } + } + exports.render = function render2(qrData, canvas2, options) { + let opts = options; + let canvasEl = canvas2; + if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { + opts = canvas2; + canvas2 = void 0; + } + if (!canvas2) { + canvasEl = getCanvasElement(); + } + opts = Utils2.getOptions(opts); + const size2 = Utils2.getImageWidth(qrData.modules.size, opts); + const ctx = canvasEl.getContext("2d"); + const image = ctx.createImageData(size2, size2); + Utils2.qrToImageData(image.data, qrData, opts); + clearCanvas(ctx, canvasEl, size2); + ctx.putImageData(image, 0, 0); + return canvasEl; + }; + exports.renderToDataURL = function renderToDataURL(qrData, canvas2, options) { + let opts = options; + if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { + opts = canvas2; + canvas2 = void 0; + } + if (!opts) + opts = {}; + const canvasEl = exports.render(qrData, canvas2, opts); + const type2 = opts.type || "image/png"; + const rendererOpts = opts.rendererOpts || {}; + return canvasEl.toDataURL(type2, rendererOpts.quality); + }; +})(canvas); +var svgTag = {}; +const Utils = utils; +function getColorAttrib(color, attrib) { + const alpha2 = color.a / 255; + const str = attrib + '="' + color.hex + '"'; + return alpha2 < 1 ? str + " " + attrib + '-opacity="' + alpha2.toFixed(2).slice(1) + '"' : str; +} +function svgCmd(cmd, x3, y3) { + let str = cmd + x3; + if (typeof y3 !== "undefined") + str += " " + y3; + return str; +} +function qrToPath(data, size2, margin) { + let path = ""; + let moveBy = 0; + let newRow = false; + let lineLength = 0; + for (let i2 = 0; i2 < data.length; i2++) { + const col = Math.floor(i2 % size2); + const row = Math.floor(i2 / size2); + if (!col && !newRow) + newRow = true; + if (data[i2]) { + lineLength++; + if (!(i2 > 0 && col > 0 && data[i2 - 1])) { + path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0); + moveBy = 0; + newRow = false; + } + if (!(col + 1 < size2 && data[i2 + 1])) { + path += svgCmd("h", lineLength); + lineLength = 0; + } + } else { + moveBy++; + } + } + return path; +} +svgTag.render = function render(qrData, options, cb2) { + const opts = Utils.getOptions(options); + const size2 = qrData.modules.size; + const data = qrData.modules.data; + const qrcodesize = size2 + opts.margin * 2; + const bg2 = !opts.color.light.a ? "" : "'; + const path = "'; + const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"'; + const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" '; + const svgTag2 = '' + bg2 + path + "\n"; + if (typeof cb2 === "function") { + cb2(null, svgTag2); + } + return svgTag2; +}; +const canPromise = canPromise$1; +const QRCode$1 = qrcode; +const CanvasRenderer = canvas; +const SvgRenderer = svgTag; +function renderCanvas(renderFunc, canvas2, text, opts, cb2) { + const args = [].slice.call(arguments, 1); + const argsNum = args.length; + const isLastArgCb = typeof args[argsNum - 1] === "function"; + if (!isLastArgCb && !canPromise()) { + throw new Error("Callback required as last argument"); + } + if (isLastArgCb) { + if (argsNum < 2) { + throw new Error("Too few arguments provided"); + } + if (argsNum === 2) { + cb2 = text; + text = canvas2; + canvas2 = opts = void 0; + } else if (argsNum === 3) { + if (canvas2.getContext && typeof cb2 === "undefined") { + cb2 = opts; + opts = void 0; + } else { + cb2 = opts; + opts = text; + text = canvas2; + canvas2 = void 0; + } + } + } else { + if (argsNum < 1) { + throw new Error("Too few arguments provided"); + } + if (argsNum === 1) { + text = canvas2; + canvas2 = opts = void 0; + } else if (argsNum === 2 && !canvas2.getContext) { + opts = text; + text = canvas2; + canvas2 = void 0; + } + return new Promise(function(resolve, reject) { + try { + const data = QRCode$1.create(text, opts); + resolve(renderFunc(data, canvas2, opts)); + } catch (e18) { + reject(e18); + } + }); + } + try { + const data = QRCode$1.create(text, opts); + cb2(null, renderFunc(data, canvas2, opts)); + } catch (e18) { + cb2(e18); + } +} +browser.create = QRCode$1.create; +browser.toCanvas = renderCanvas.bind(null, CanvasRenderer.render); +browser.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL); +browser.toString = renderCanvas.bind(null, function(data, _3, opts) { + return SvgRenderer.render(data, opts); +}); +(function() { + try { + if (typeof document != "undefined") { + var elementStyle = document.createElement("style"); + elementStyle.appendChild(document.createTextNode('.wk_t59jcv0 {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n transition-property: background,color,opacity;\n transition-duration: 0.2s;\n text-decoration: none;\n}\n.wk_t59jcv0::before {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n.wk_t59jcv0::after {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}.wk_14j9dar0 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n outline: none;\n border: none;\n cursor: pointer;\n height: 56px;\n padding: 0 16px;\n font-size: 16px;\n font-weight: 500;\n line-height: 19px;\n}.wk_vno40y0 {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 32px;\n text-align: center;\n overflow: auto;\n}.wk_1rmpmq20 {\n display: flex;\n justify-content: center;\n margin-top: 32px;\n}.wk_qhb85j0 {\n font-weight: 600;\n display: flex;\n font-size: 24px;\n line-height: 29px;\n justify-content: center;\n text-align: center;\n}\n@media screen and (max-width: 767px) {\n .wk_qhb85j0 {\n font-size: 18px;\n line-height: 22px;\n }\n}@keyframes wk_107z37f3 {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.wk_107z37f0 {\n position: relative;\n width: 100px;\n height: 100px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.wk_107z37f1 {\n border-radius: 50%;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.wk_107z37f1 > * {\n width: 80px;\n height: 80px;\n}\n.wk_107z37f2 {\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n position: absolute;\n border: 2px solid var(--wk-colors-error);\n margin-top: 2px;\n}\n.wk_107z37f4 {\n animation: wk_107z37f3 1200ms linear infinite;\n position: absolute;\n left: 50%;\n transform-origin: 1px 50%;\n margin-top: 2px;\n}.wk_1nr7e5q0 {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n text-align: center;\n gap: 8px;\n overflow: hidden;\n}.wk_1cxzn9q0 {\n display: flex;\n max-width: 340px;\n font-size: 18px;\n text-align: center;\n line-height: 22px;\n font-weight: 400;\n color: var(--wk-colors-textSecondary);\n}.wk_ebg9wh0 {\n display: flex;\n font-size: 18px;\n font-weight: 500;\n line-height: 22px;\n align-items: center;\n justify-content: center;\n color: var(--wk-colors-error);\n gap: 4px;\n}.wk_pb4clz0 {\n font-size: 18px;\n font-weight: 500;\n line-height: 22px;\n}.wk_qfvtl91 {\n margin-top: 32px;\n}\n.wk_qfvtl92 {\n height: 56px;\n width: 100%;\n border-radius: var(--wk-radii-button);\n background: var(--wk-colors-buttonBackground);\n color: var(--wk-colors-buttonText);\n}\n.wk_qfvtl93 {\n margin-top: 40px;\n margin-bottom: -8px;\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_qfvtl92:hover {\n background: var(--wk-colors-buttonBackgroundHover);\n color: var(--wk-colors-buttonTextHover);\n }\n}\n@media screen {\n .wk_qfvtl92:active {\n background: var(--wk-colors-buttonBackgroundHover);\n color: var(--wk-colors-buttonTextHover);\n }\n}\n@media screen and (max-width: 767px) {\n .wk_qfvtl93 {\n margin-top: 24px;\n margin-bottom: -16px;\n }\n}.wk_1a9rgw50 {\n text-decoration: none;\n}\n.wk_1a9rgw50:visited {\n color: unset;\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_1a9rgw50:hover {\n color: var(--wk-colors-primaryActive);\n }\n}\n@media screen {\n .wk_1a9rgw50:active {\n color: var(--wk-colors-primaryActive);\n }\n}@keyframes wk_y1x8do0 {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes wk_y1x8do1 {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n.wk_y1x8do2 {\n animation: wk_y1x8do0 0.2s forwards;\n}\n.wk_y1x8do3 {\n animation: wk_y1x8do1 0.2s forwards;\n}@keyframes wk_1jpwxhg0 {\n 0% {\n opacity: 0;\n transform: translateY(-24px) scale(0.85);\n max-height: 0;\n }\n 100% {\n opacity: 1;\n transform: translateY(0) scale(1);\n max-height: 200px;\n }\n}\n@keyframes wk_1jpwxhg1 {\n 0% {\n opacity: 1;\n transform: scale(1);\n max-height: 200px;\n }\n 50% {\n opacity: 0;\n transform: scale(0.85);\n max-height: 0;\n }\n 100% {\n opacity: 0;\n transform: scale(0.85);\n max-height: 0;\n }\n}\n.wk_1jpwxhg2 {\n animation: wk_1jpwxhg0 0.4s forwards;\n transform-origin: 50% 50% 0px;\n}\n.wk_1jpwxhg3 {\n animation: wk_1jpwxhg1 0.4s forwards;\n transform-origin: 50% 50% 0px;\n}@keyframes wk_3li8yi0 {\n 0% {\n transform: translateY(40%);\n }\n 100% {\n transform: translateY(0%);\n }\n}\n@keyframes wk_3li8yi1 {\n 0% {\n transform: translateY(0%);\n }\n 100% {\n transform: translateY(40%);\n }\n}\n.wk_3li8yi2 {\n animation: wk_3li8yi0 0.2s forwards ease-out;\n transform-origin: bottom center;\n}\n.wk_3li8yi3 {\n animation: wk_3li8yi1 0.2s forwards ease-out;\n transform-origin: bottom center;\n}@keyframes wk_92eoeu0 {\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -100% 0;\n }\n}\n.wk_92eoeu1 {\n width: 100%;\n height: 100%;\n opacity: 0.1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n pointer-events: none;\n}\n.wk_92eoeu1::before {\n content: "";\n z-index: 3;\n position: absolute;\n inset: 0;\n background-position: initial;\n background-repeat: repeat;\n background-attachment: initial;\n background-origin: initial;\n background-clip: initial;\n background-color: initial;\n background-size: 1.888% 1.888%;\n background-image: radial-gradient(var(--wk-colors-qrCodeDot) 41%,transparent 41%);\n}\n.wk_92eoeu1::after {\n content: "";\n z-index: 5;\n position: absolute;\n inset: 0;\n transform: scale(2) rotate(45deg);\n background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 50%, rgb(255, 255, 255), rgba(255, 255, 255, 0));\n background-size: 200% 100%;\n animation: 1000ms linear 0s infinite normal both running wk_92eoeu0;\n}\n.wk_92eoeu2 {\n z-index: 4;\n position: absolute;\n background: var(--wk-colors-qrCodeDot);\n border-radius: 8px;\n width: 13.2%;\n height: 13.2%;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 0 3px var(--wk-colors-modalBackground);\n}\n.wk_92eoeu2::before {\n content: "";\n width: 71.4%;\n height: 71.4%;\n border-radius: 4px;\n border: 4px solid var(--wk-colors-modalBackground);\n}\n.wk_92eoeu2:nth-child(1) {\n left: 0;\n top: 0;\n}\n.wk_92eoeu2:nth-child(2) {\n right: 0;\n top: 0;\n}\n.wk_92eoeu2:nth-child(3) {\n left: 0;\n bottom: 0;\n}.wk_10yx5n50 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 240px;\n height: 240px;\n overflow: hidden;\n font-size: 0;\n border: 1px solid;\n border-color: var(--wk-colors-qrCodeBorder);\n border-radius: var(--wk-radii-qrCode);\n}\n.wk_10yx5n51 {\n width: 212px;\n height: 212px;\n position: relative;\n}\n.wk_10yx5n52 {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: inline-flex;\n border-radius: 12px;\n overflow: hidden;\n}\n.wk_10yx5n52 > * {\n width: 100%;\n height: 100%;\n}.wk_1j0944g0 {\n align-items: center;\n}\n.wk_1j0944g1 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n gap: 4px;\n cursor: pointer;\n}.wk_1dbgl2y0 {\n display: flex;\n align-items: flex-start;\n justify-content: center;\n height: 111px;\n flex-shrink: 0;\n}\n.wk_1dbgl2y1 {\n display: flex;\n align-items: center;\n flex-direction: column;\n justify-content: flex-start;\n padding: 8px 0;\n border-radius: 16px;\n gap: 8px;\n width: 100%;\n height: auto;\n color: var(--wk-colors-textSecondary);\n background: transparent;\n}\n.wk_1dbgl2y2 {\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n}\n.wk_1dbgl2y3 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 68px;\n height: 68px;\n border-radius: 16px;\n overflow: hidden;\n flex-shrink: 0;\n}\n.wk_1dbgl2y3 > * {\n width: 100%;\n height: 100%;\n}\n.wk_1dbgl2y4 {\n cursor: not-allowed;\n opacity: 0.3;\n}\n@media screen and (max-width: 767px) {\n .wk_1dbgl2y0 {\n height: 99px;\n }\n .wk_1dbgl2y2 {\n font-size: 12px;\n line-height: 15px;\n }\n .wk_1dbgl2y3 {\n width: 60px;\n height: 60px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_1dbgl2y1:hover {\n background: var(--wk-colors-walletOptionBackgroundHover);\n }\n .wk_1dbgl2y4:hover {\n background: transparent;\n }\n}\n@media screen {\n .wk_1dbgl2y1:active {\n background: var(--wk-colors-walletOptionBackgroundHover);\n }\n .wk_1dbgl2y4:active {\n background: transparent;\n }\n}.wk_cvot8n0 {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n row-gap: 24px;\n column-gap: 15px;\n}\n.wk_cvot8n1 {\n height: 50px;\n width: 100%;\n gap: 10px;\n border: 1px solid;\n border-radius: var(--wk-radii-noWalletButton);\n background: var(--wk-colors-noWalletButtonBackground);\n border-color: var(--wk-colors-noWalletButtonBorder);\n color: var(--wk-colors-noWalletButtonText);\n}\n@media screen and (max-width: 767px) {\n .wk_cvot8n0 {\n row-gap: 16px;\n column-gap: 4.5px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_cvot8n1:hover {\n background: var(--wk-colors-noWalletButtonBackgroundHover);\n color: var(--wk-colors-noWalletButtonTextHover);\n border-color: var(--wk-colors-noWalletButtonBorderHover);\n }\n}\n@media screen {\n .wk_cvot8n1:active {\n background: var(--wk-colors-noWalletButtonBackgroundHover);\n color: var(--wk-colors-noWalletButtonTextHover);\n border-color: var(--wk-colors-noWalletButtonBorderHover);\n }\n}.wk_1lg2shr0 {\n gap: 16px;\n}\n.wk_1lg2shr1 {\n display: flex;\n align-items: center;\n gap: 10px;\n font-size: 14px;\n font-weight: 400;\n}.wk_713zwr0 {\n height: 68px;\n padding-left: 20px;\n padding-right: 20px;\n border-radius: var(--wk-radii-walletOption);\n color: var(--wk-colors-walletOptionText);\n background: var(--wk-colors-walletOptionBackground);\n width: 100%;\n flex-shrink: 0;\n}\n.wk_713zwr1 {\n flex: 1;\n font-size: 18px;\n font-weight: 600;\n text-align: left;\n}\n.wk_713zwr2 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: var(--wk-radii-walletOptionIcon);\n overflow: hidden;\n}\n.wk_713zwr3 {\n cursor: not-allowed;\n opacity: 0.3;\n}\n.wk_713zwr2 > * {\n width: 100%;\n height: 100%;\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_713zwr0:hover {\n color: var(--wk-colors-walletOptionTextHover);\n background: var(--wk-colors-walletOptionBackgroundHover);\n }\n .wk_713zwr3:hover {\n color: var(--wk-colors-walletOptionText);\n background: var(--wk-colors-walletOptionBackground);\n }\n}\n@media screen {\n .wk_713zwr0:active {\n color: var(--wk-colors-walletOptionTextHover);\n background: var(--wk-colors-walletOptionBackgroundHover);\n }\n .wk_713zwr3:active {\n color: var(--wk-colors-walletOptionText);\n background: var(--wk-colors-walletOptionBackground);\n }\n}.wk_zqrn660 {\n margin-top: 8px;\n font-weight: 400;\n font-size: 14px;\n line-height: 17px;\n color: var(--wk-colors-textSecondary);\n text-align: center;\n}.wk_1sntu030 {\n position: fixed;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n z-index: var(--wk-zIndices-toast);\n padding: 8px;\n display: flex;\n flex-direction: column;\n align-items: center;\n pointer-events: none;\n width: 100%;\n color: var(--wk-colors-text);\n max-width: 500px;\n}\n.wk_1sntu031 {\n display: inline-flex;\n align-items: center;\n padding: 16px;\n margin: 8px;\n background: var(--wk-colors-toastBackground);\n position: relative;\n box-shadow: var(--wk-shadows-toast);\n border-radius: var(--wk-radii-toast);\n word-wrap: break-word;\n pointer-events: all;\n}\n.wk_1sntu032 {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.wk_1sntu033 {\n margin-left: 8px;\n font-weight: 500;\n font-size: 14px;\n line-height: 1.4;\n}.wk_1kzf8pa0 {\n position: absolute;\n background: var(--wk-colors-modalBackground);\n padding: 48px 24px;\n width: calc(100% - 32px);\n max-height: 100%;\n max-width: 484px;\n border-radius: var(--wk-radii-modal);\n display: flex;\n flex-direction: column;\n}\n@media screen and (max-width: 767px) {\n .wk_1kzf8pa0 {\n width: 100%;\n max-width: 100vw;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding-bottom: 40px;\n left: 0;\n bottom: 0;\n }\n}.wk_3qg8ds0 {\n z-index: var(--wk-zIndices-modal);\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--wk-colors-text);\n margin: 0;\n padding: 0;\n transition: all 0.3s;\n box-sizing: border-box;\n}\n.wk_3qg8ds1 {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: var(--wk-colors-modalOverlay);\n}\n@media screen and (max-width: 767px) {\n .wk_3qg8ds0 {\n align-items: flex-end;\n }\n}.wk_1bjpejd0 {\n width: 24px;\n height: 24px;\n border-radius: var(--wk-radii-navButton);\n padding: 0;\n background: transparent;\n color: var(--wk-colors-navButtonText);\n}\n@media (hover: hover) and (pointer: fine) {\n .wk_1bjpejd0:hover {\n background: var(--wk-colors-navButtonBackgroundHover);\n }\n}\n@media screen {\n .wk_1bjpejd0:active {\n background: var(--wk-colors-navButtonBackgroundHover);\n }\n}.wk_1nzgcmu0 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: absolute;\n top: 0;\n left: 0;\n padding: 24px 24px 0;\n width: 100%;\n}.wk_6fxksu0 {\n width: 100%;\n max-width: 484px;\n}\n.wk_6fxksu1 {\n position: relative;\n border: 1px solid;\n border-color: var(--wk-colors-border);\n box-shadow: var(--wk-shadows-normal);\n padding: 24px;\n width: 100%;\n max-width: unset;\n}')); + document.head.insertBefore(elementStyle, document.head.firstChild); + } + } catch (e18) { + console.error("vite-plugin-css-injected-by-js", e18); + } +})(); +function cx(...classNames) { + if (!classNames.length) + return; + return classNames.filter(Boolean).join(" "); +} +function cssVar(name2, type2 = "colors") { + return `var(--wk-${type2}-${name2.replace(/\./g, "-")})`; +} +function rgba(firstValue, secondValue, thirdValue, fourthValue = 1) { + var _a3; + if (typeof firstValue === "string") { + if (firstValue.startsWith("#")) { + const hexStr = firstValue.slice(1); + const formatStr = hexStr.length === 3 ? hexStr.replace(/[A-F\d]/gi, "$&$&") : hexStr; + const hexArr = (_a3 = formatStr.match(/.{2}/g)) == null ? void 0 : _a3.map((v6) => parseInt(v6, 16)); + if ((hexArr == null ? void 0 : hexArr.length) === 3) { + return rgba(hexArr[0], hexArr[1], hexArr[2], secondValue); } - if (!(this instanceof UAParser2)) { - return new UAParser2(ua2, extensions).getResult(); + } + } + return `rgba(${firstValue}, ${secondValue}, ${thirdValue}, ${fourthValue})`; +} +const radii = { + common: "8px", + modal: "12px", + navButton: "4px", + button: "var(--wk-radii-common)", + connectButton: "var(--wk-radii-common)", + disconnectButton: "var(--wk-radii-common)", + noWalletButton: "var(--wk-radii-common)", + walletOption: "var(--wk-radii-common)", + walletOptionIcon: "var(--wk-radii-common)", + chainOption: "var(--wk-radii-common)", + toast: "var(--wk-radii-common)", + qrCode: "var(--wk-radii-common)" +}; +const zIndices = { + modal: 1300, + toast: 1500 +}; +const base = { + light: { + colors: { + text: "#1E2026", + textSecondary: "#76808F", + primary: "#CC9D09", + primaryActive: "#F0B90B", + error: "#D9304E", + errorActive: "#B82942", + border: "#E6E8EA", + disabled: "#AEB4BC", + modalBackground: "#FFFFFF", + modalOverlay: "rgba(0, 0, 0, 0.5)", + buttonText: "var(--wk-colors-text)", + buttonTextHover: "var(--wk-colors-text)", + buttonBackground: "#f5f5f5", + buttonBackgroundHover: rgba("#F0B90B", 0.1), + connectButtonText: "var(--wk-colors-text)", + connectButtonTextHover: "var(--wk-colors-text)", + connectButtonBackground: "#f5f5f5", + connectButtonBackgroundHover: "#e6e8ea", + navButtonText: "var(--wk-colors-textSecondary)", + navButtonBackgroundHover: "var(--wk-colors-border)", + optionText: "var(--wk-colors-text)", + optionTextHover: "var(--wk-colors-text)", + optionBackground: "#f5f5f5", + optionBackgroundHover: rgba("#F0B90B", 0.1), + walletOptionText: "var(--wk-colors-optionText)", + walletOptionTextHover: "var(--wk-colors-optionTextHover)", + walletOptionBackground: "var(--wk-colors-optionBackground)", + walletOptionBackgroundHover: "var(--wk-colors-optionBackgroundHover)", + chainOptionText: "var(--wk-colors-optionText)", + chainOptionTextHover: "var(--wk-colors-optionTextHover)", + chainOptionBackground: "var(--wk-colors-optionBackground)", + chainOptionBackgroundHover: "var(--wk-colors-optionBackgroundHover)", + toastBackground: "var(--wk-colors-modalBackground)", + qrCodeDot: "var(--wk-colors-text)", + qrCodeBorder: "var(--wk-colors-border)", + noWalletButtonText: "var(--wk-colors-text)", + noWalletButtonTextHover: "var(--wk-colors-text)", + noWalletButtonBackground: "transparent", + noWalletButtonBackgroundHover: "var(--wk-colors-border)", + noWalletButtonBorder: "var(--wk-colors-border)", + noWalletButtonBorderHover: "var(--wk-colors-border)", + disconnectButtonBackgroundText: "var(--wk-colors-text)", + disconnectButtonBackgroundTextHover: "var(--wk-colors-text)", + disconnectButtonBackground: "transparent", + disconnectButtonBackgroundHover: "var(--wk-colors-border)", + disconnectButtonBorder: "var(--wk-colors-border)", + disconnectButtonBorderHover: "var(--wk-colors-border)" + }, + shadows: { + normal: "0px 4px 20px 0px rgba(0, 0, 0, 0.04)", + toast: "0px 4px 24px rgba(0, 0, 0, 0.08)" + }, + radii, + zIndices + }, + dark: { + colors: { + text: "#FFF", + textSecondary: "#76808F", + primary: "#CC9D09", + primaryActive: "#F0B90B", + error: "#D9304E", + errorActive: "#B82942", + border: "#2e323a", + disabled: "#5E6673", + modalBackground: "#1E2026", + modalOverlay: rgba("#000", 0.5), + buttonText: "var(--wk-colors-text)", + buttonTextHover: "var(--wk-colors-text)", + buttonBackground: "#14151a", + buttonBackgroundHover: rgba("#F0B90B", 0.1), + connectButtonText: "var(--wk-colors-text)", + connectButtonTextHover: "var(--wk-colors-text)", + connectButtonBackground: "#2b2f36", + connectButtonBackgroundHover: "#2e323a", + navButtonText: "var(--wk-colors-textSecondary)", + navButtonBackgroundHover: "var(--wk-colors-border)", + optionText: "var(--wk-colors-text)", + optionTextHover: "var(--wk-colors-text)", + optionBackground: "#14151a", + optionBackgroundHover: rgba("#F0B90B", 0.1), + walletOptionText: "var(--wk-colors-optionText)", + walletOptionTextHover: "var(--wk-colors-optionTextHover)", + walletOptionBackground: "var(--wk-colors-optionBackground)", + walletOptionBackgroundHover: "var(--wk-colors-optionBackgroundHover)", + chainOptionText: "var(--wk-colors-optionText)", + chainOptionTextHover: "var(--wk-colors-optionTextHover)", + chainOptionBackground: "var(--wk-colors-optionBackground)", + chainOptionBackgroundHover: "var(--wk-colors-optionBackgroundHover)", + toastBackground: "var(--wk-colors-modalBackground)", + qrCodeDot: "var(--wk-colors-text)", + qrCodeBorder: "var(--wk-colors-border)", + noWalletButtonText: "var(--wk-colors-text)", + noWalletButtonTextHover: "var(--wk-colors-text)", + noWalletButtonBackground: "transparent", + noWalletButtonBackgroundHover: "var(--wk-colors-border)", + noWalletButtonBorder: "var(--wk-colors-border)", + noWalletButtonBorderHover: "var(--wk-colors-border)", + disconnectButtonBackgroundText: "var(--wk-colors-text)", + disconnectButtonBackgroundTextHover: "var(--wk-colors-text)", + disconnectButtonBackground: "transparent", + disconnectButtonBackgroundHover: "var(--wk-colors-border)", + disconnectButtonBorder: "var(--wk-colors-border)", + disconnectButtonBorderHover: "var(--wk-colors-border)" + }, + shadows: { + normal: "0px 4px 20px 0px rgba(0, 0, 0, 0.04)", + toast: "0px 4px 24px rgba(0, 0, 0, 0.08)" + }, + radii, + zIndices + } +}; +function isObject(item) { + return item && typeof item === "object" && !Array.isArray(item) && item !== null; +} +function deepMerge(target, source) { + if (isObject(target) && isObject(source)) { + for (const key2 in source) { + if (isObject(source[key2])) { + if (!target[key2]) + Object.assign(target, { [key2]: {} }); + deepMerge(target[key2], source[key2]); + } else { + Object.assign(target, { [key2]: source[key2] }); } - var _navigator = typeof window2 !== UNDEF_TYPE && window2.navigator ? window2.navigator : undefined$1; - var _ua = ua2 || (_navigator && _navigator.userAgent ? _navigator.userAgent : EMPTY); - var _uach = _navigator && _navigator.userAgentData ? _navigator.userAgentData : undefined$1; - var _rgxmap = extensions ? extend2(regexes, extensions) : regexes; - var _isSelfNav = _navigator && _navigator.userAgent == _ua; - this.getBrowser = function() { - var _browser = {}; - _browser[NAME] = undefined$1; - _browser[VERSION2] = undefined$1; - rgxMapper.call(_browser, _ua, _rgxmap.browser); - _browser[MAJOR] = majorize(_browser[VERSION2]); - if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) { - _browser[NAME] = "Brave"; - } - return _browser; - }; - this.getCPU = function() { - var _cpu = {}; - _cpu[ARCHITECTURE] = undefined$1; - rgxMapper.call(_cpu, _ua, _rgxmap.cpu); - return _cpu; - }; - this.getDevice = function() { - var _device = {}; - _device[VENDOR] = undefined$1; - _device[MODEL] = undefined$1; - _device[TYPE] = undefined$1; - rgxMapper.call(_device, _ua, _rgxmap.device); - if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) { - _device[TYPE] = MOBILE; + } + } + return target; +} +const ThemeContext = W$2.createContext({}); +function useTheme() { + return reactExports.useContext(ThemeContext); +} +const themeMap = { + base +}; +function ThemeProvider(props) { + const { variant = "base", mode: mode2 = "auto", theme, children } = props; + const styleContent = reactExports.useMemo(() => { + const lightTheme = deepMerge(themeMap[variant].light ?? theme, (theme == null ? void 0 : theme.light) ?? theme); + const darkTheme = deepMerge(themeMap[variant].dark ?? theme, (theme == null ? void 0 : theme.dark) ?? theme); + const lightCssVars = createCssVars(lightTheme, "--wk-light"); + const darkCssVars = createCssVars(darkTheme, "--wk-dark"); + const lightPointer = createPointer(lightCssVars); + const darkPointer = createPointer(darkCssVars); + const lightCssVarsContent = createStyleContent(lightCssVars); + const darkCssVarsContent = createStyleContent(darkCssVars); + const lightPointerContent = createStyleContent(lightPointer); + const darkPointerContent = createStyleContent(darkPointer); + if (mode2 === "light") { + return `body { + ${lightPointerContent}; + ${lightCssVarsContent}; + }`; + } + if (mode2 === "dark") { + return `body { + ${darkPointerContent}; + ${darkCssVarsContent}; + }`; + } + if (mode2 === "auto") { + return `body { + ${lightCssVarsContent}; + ${darkCssVarsContent}; + #binanceW3W-wrapper .shadow-inner { + box-sizing: border-box; } - if (_isSelfNav && _device[MODEL] == "Macintosh" && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) { - _device[MODEL] = "iPad"; - _device[TYPE] = TABLET; + @media (prefers-color-scheme: light) { + ${lightPointerContent}; } - return _device; - }; - this.getEngine = function() { - var _engine = {}; - _engine[NAME] = undefined$1; - _engine[VERSION2] = undefined$1; - rgxMapper.call(_engine, _ua, _rgxmap.engine); - return _engine; - }; - this.getOS = function() { - var _os = {}; - _os[NAME] = undefined$1; - _os[VERSION2] = undefined$1; - rgxMapper.call(_os, _ua, _rgxmap.os); - if (_isSelfNav && !_os[NAME] && _uach && _uach.platform && _uach.platform != "Unknown") { - _os[NAME] = _uach.platform.replace(/chrome os/i, CHROMIUM_OS).replace(/macos/i, MAC_OS); + @media (prefers-color-scheme: dark) { + ${darkPointerContent}; } - return _os; - }; - this.getResult = function() { - return { - ua: this.getUA(), - browser: this.getBrowser(), - engine: this.getEngine(), - os: this.getOS(), - device: this.getDevice(), - cpu: this.getCPU() - }; - }; - this.getUA = function() { - return _ua; - }; - this.setUA = function(ua3) { - _ua = typeof ua3 === STR_TYPE && ua3.length > UA_MAX_LENGTH ? trim2(ua3, UA_MAX_LENGTH) : ua3; - return this; - }; - this.setUA(_ua); - return this; - }; - UAParser2.VERSION = LIBVERSION; - UAParser2.BROWSER = enumerize([NAME, VERSION2, MAJOR]); - UAParser2.CPU = enumerize([ARCHITECTURE]); - UAParser2.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]); - UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION2]); - { - if (module.exports) { - exports = module.exports = UAParser2; - } - exports.UAParser = UAParser2; + }`; } - var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto); - if ($ && !$.ua) { - var parser = new UAParser2(); - $.ua = parser.getResult(); - $.ua.get = function() { - return parser.getUA(); + return ""; + }, [theme, mode2, variant]); + const [colorMode, setColorMode] = reactExports.useState("light"); + reactExports.useEffect(() => { + if (mode2 === "auto") { + const matchMedia = window.matchMedia("(prefers-color-scheme: dark)"); + const onChange = () => { + const cm = matchMedia.matches ? "dark" : "light"; + setColorMode(cm); }; - $.ua.set = function(ua2) { - parser.setUA(ua2); - var result = parser.getResult(); - for (var prop in result) { - $.ua[prop] = result[prop]; - } + onChange(); + matchMedia.addEventListener("change", onChange); + return () => { + matchMedia.removeEventListener("change", onChange); }; + } else { + setColorMode(mode2); } - })(typeof window === "object" ? window : commonjsGlobal); -})(uaParser, uaParser.exports); -var uaParserExports = uaParser.exports; -const UAParser = /* @__PURE__ */ getDefaultExportFromCjs$1(uaParserExports); -class InMemoryStorage { - static getInstance() { - if (!InMemoryStorage.instance) { - InMemoryStorage.instance = new InMemoryStorage(); - } - return InMemoryStorage.instance; - } - constructor() { - Object.defineProperty(this, "storage", { - enumerable: true, - configurable: true, - writable: true, - value: {} + }, [mode2]); + const value = reactExports.useMemo(() => { + return { + colorMode + }; + }, [colorMode]); + return /* @__PURE__ */ jsxRuntimeExports.jsxs(ThemeContext.Provider, { value, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("style", { children: styleContent }), + children + ] }); +} +function createCssVars(theme, prefix = "") { + const cssVars = {}; + const walk2 = (input, prefix2 = "") => { + Object.entries(input).forEach(([key2, value]) => { + const varName = `${prefix2}-${key2}`; + if (typeof value !== "object") { + cssVars[varName] = value; + } else { + walk2(value, varName); + } }); + }; + walk2(theme, prefix); + return cssVars; +} +function createStyleContent(cssVars) { + return Object.entries(cssVars).map(([key2, value]) => { + return `${key2}: ${value}`; + }).join(";"); +} +function createPointer(cssVars) { + const pointers = {}; + Object.keys(cssVars).forEach((item) => { + const key2 = item.replace(/\-light|\-dark/g, ""); + const value = `var(${item})`; + pointers[key2] = value; + }); + return pointers; +} +const WalletKitContext = W$2.createContext({}); +function useWalletKit() { + return reactExports.useContext(WalletKitContext); +} +function EvmWalletProvider(props) { + const { children } = props; + const { evmConfig } = useWalletKit(); + if (!evmConfig) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }); } - get length() { - return Object.keys(this.storage).length; + return /* @__PURE__ */ jsxRuntimeExports.jsx(WagmiProvider, { config: evmConfig.wagmiConfig, reconnectOnMount: evmConfig.autoConnect, children }); +} +class CustomEventEmitter { + constructor() { + __publicField(this, "listenersMap"); + __publicField(this, "EVM_CONNECT_ERROR", "EVM_CONNECT_ERROR"); + __publicField(this, "EVM_CONNECT_SETTLE", "EVM_CONNECT_SETTLE"); + __publicField(this, "SOLANA_WALLET_ERROR", "SOLANA_WALLET_ERROR"); + __publicField(this, "TRON_WALLET_ERROR", "TRON_WALLET_ERROR"); + this.listenersMap = {}; } - clear() { - this.storage = {}; + on(event, cb2) { + if (!this.listenersMap[event]) + this.listenersMap[event] = []; + this.listenersMap[event].push(cb2); } - getItem(key2) { - return this.storage[key2] ?? null; + emit(event, ...params) { + const listener = this.listenersMap[event]; + if (listener) { + listener.forEach((cb2) => cb2(...params)); + } } - key(index2) { - const keys2 = Object.keys(this.storage); - if (index2 < 0 || index2 >= keys2.length) { - return null; + off(event, cb2) { + const listeners3 = this.listenersMap[event]; + if (listeners3) { + const index2 = listeners3.findIndex((item) => item === cb2); + if (index2 > -1) { + listeners3.splice(index2); + } } - return keys2[index2] ?? null; } - removeItem(key2) { - delete this.storage[key2]; +} +const EventEmitter = new CustomEventEmitter(); +function SolanaWalletProvider(props) { + const { children } = props; + const { solanaConfig } = useWalletKit(); + const onError = reactExports.useCallback((error) => { + EventEmitter.emit(EventEmitter.SOLANA_WALLET_ERROR, error); + }, []); + if (!solanaConfig) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }); } - setItem(key2, value) { - this.storage[key2] = value; + return /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectionProvider, { endpoint: solanaConfig.rpcUrl, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + WalletProvider$1, + { + wallets: solanaConfig.adapters, + onError, + autoConnect: solanaConfig.autoConnect, + children + } + ) }); +} +const ToastManager = { + listeners: [], + toastList: [], + autoIncreaseId: 0, + add(options) { + const toastId = this.autoIncreaseId++; + this.toastList.unshift({ + toastId, + ...options + }); + this.notify(); + return toastId; + }, + remove(toastId) { + const index2 = this.toastList.findIndex((item) => item.toastId === toastId); + if (index2 > -1) { + this.toastList.splice(index2, 1); + this.notify(); + } + }, + notify() { + this.listeners.forEach((fn2) => { + fn2([...this.toastList]); + }); + }, + subscribe(fn2) { + this.listeners.push(fn2); + }, + unsubscribe(fn2) { + const index2 = this.listeners.findIndex((item) => item === fn2); + if (index2 > -1) { + this.listeners.splice(index2, 1); + } } +}; +const toast = (props) => { + const { variant = "info", duration = 3e3, ...restProps } = props; + return ToastManager.add({ + variant, + duration, + ...restProps + }); +}; +toast.info = (props) => { + return toast({ variant: "info", ...props }); +}; +toast.error = (props) => { + return toast({ variant: "error", ...props }); +}; +function getDefaultConfig(config2) { + const { options, evmConfig, solanaConfig, tronConfig } = config2; + return { + options: { + title: "Connect Wallet", + disclaimer: void 0, + gridLayoutThreshold: 6, + useGridLayoutOnMobile: true, + hideNoWalletCTA: false, + hideOfficialWalletConnectCTA: true, + walletDownloadUrl: `https://trustwallet.com/`, + closeModalAfterSwitchingNetwork: false, + closeModalAfterConnected: true, + closeModalOnEsc: true, + closeModalOnOverlayClick: true, + openModalOnWrongNetwork: false, + onError(_err, description2) { + if (description2) { + toast.error({ + description: description2 + }); + } + }, + ...options + }, + evmConfig, + solanaConfig, + tronConfig + }; } -function openLink(href, target = "_self") { - console.log(`open link self: ${href}`); - window.open(href, target, "noopener noreferrer"); +const RouteContext = W$2.createContext({}); +function useRouter() { + return reactExports.useContext(RouteContext); +} +var CONNECT_STATUS = /* @__PURE__ */ ((CONNECT_STATUS2) => { + CONNECT_STATUS2["CONNECTED"] = "connected"; + CONNECT_STATUS2["CONNECTING"] = "connecting"; + CONNECT_STATUS2["FAILED"] = "failed"; + CONNECT_STATUS2["REJECTED"] = "rejected"; + CONNECT_STATUS2["NOTCONNECTED"] = "notconnected"; + CONNECT_STATUS2["UNAVAILABLE"] = "unavailable"; + return CONNECT_STATUS2; +})(CONNECT_STATUS || {}); +var clsBox = "wk_t59jcv0"; +const Box = W$2.forwardRef((props, ref) => { + const { as: as2 = "div", className, ...restProps } = props; + return W$2.createElement(as2, { + ref, + className: cx(clsBox, className), + ...restProps + }); +}); +Box.displayName = "Box"; +var clsButton$1 = "wk_14j9dar0"; +const Button = W$2.forwardRef((props, ref) => { + const { className, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { ref, as: "button", className: cx("wk-button", clsButton$1, className), ...restProps }); +}); +Button.displayName = "Button"; +var clsModalBody = "wk_vno40y0"; +function ModalBody(props) { + const { className, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-modal-body", clsModalBody, className), ...restProps }); } -function openLinkBlank(href) { - console.log(`open link blank: ${href}`); - openLink(href, "_blank"); +var clsModalFooter = "wk_1rmpmq20"; +function ModalFooter(props) { + const { className, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-modal-footer", clsModalFooter, className), ...restProps }); } -function openDeeplinkWithFallback(href, fallback) { - const doFallback = () => { - if (isBrowser("safari") || isOS("android") && isBrowser("firefox")) { - return; - } - fallback(); - }; - const fallbackTimeout = setTimeout(() => doFallback(), 200); - window.addEventListener("blur", () => clearTimeout(fallbackTimeout), { once: true }); - openLink(href, "_self"); +var clsModalHeader = "wk_qhb85j0"; +function ModalHeader(props) { + const { className, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-modal-header", clsModalHeader, className), ...restProps }); } -function getWindow() { - if (typeof window !== "undefined") { - return window; - } - return void 0; +function CircleLoadingIcon(props) { + const { thickness, endColor, ...restProps } = props; + const startStopColor = cssVar("modalBackground"); + const endStopColor = endColor ?? cssVar("primaryActive"); + return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "52", height: "102", viewBox: "0 0 52 102", fill: "none", ...restProps, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M1 101C28.6142 101 51 78.6142 51 51C51 23.3858 28.6142 1 1 1", + stroke: "url(#paint0_linear_1252_60553)", + strokeWidth: thickness, + strokeLinecap: "round" + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs( + "linearGradient", + { + id: "paint0_linear_1252_60553", + x1: "1", + y1: "1", + x2: "0.999999", + y2: "101", + gradientUnits: "userSpaceOnUse", + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("stop", { stopColor: startStopColor }), + /* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "1", stopColor: endStopColor }) + ] + } + ) }) + ] }); } -function tryGetLocalStorage() { - if (isLocalStorageAvailable()) { - return localStorage; - } - if (isNodeJs()) { - throw new Error("`localStorage` is unavailable, but it is required"); - } - return InMemoryStorage.getInstance(); +var clsContainer$3 = "wk_107z37f0"; +var clsErrorCircle = "wk_107z37f2"; +var clsLoading = "wk_107z37f4"; +var clsLogo = "wk_107z37f1"; +function ConnectSpinner(props) { + const { + className, + isLoading = false, + isError: isError2 = false, + thickness = 2, + loadingColor, + children, + ...restProps + } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: cx("wk-connect-spinner", clsContainer$3, className), ...restProps, children: [ + isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(CircleLoadingIcon, { className: clsLoading, thickness, endColor: loadingColor }), + isError2 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsErrorCircle }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsLogo, children }) + ] }); } -function isLocalStorageAvailable() { - try { - return typeof localStorage !== "undefined"; - } catch { - return false; - } +var clsContent$2 = "wk_1nr7e5q0"; +function Content(props) { + const { className, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-content", clsContent$2, className), ...restProps }); } -function isNodeJs() { - return typeof process !== "undefined" && process.versions != null && process.versions.node != null; +var clsDescription = "wk_1cxzn9q0"; +function Description(props) { + const { className, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-description", clsDescription, className), ...restProps }); } -function getUserAgent() { - var _a3, _b2, _c2; - const results = new UAParser().getResult(); - const osName = (_a3 = results.os.name) == null ? void 0 : _a3.toLowerCase(); - const deviceModel = (_b2 = results.device.model) == null ? void 0 : _b2.toLowerCase(); - let os2; - switch (true) { - case deviceModel === "ipad": - os2 = "ipad"; - break; - case osName === "ios": - os2 = "ios"; - break; - case osName === "android": - os2 = "android"; - break; - case osName === "mac os": - os2 = "macos"; - break; - case osName === "linux": - os2 = "linux"; - break; - case (osName == null ? void 0 : osName.includes("windows")): - os2 = "windows"; - break; - } - const browserName = (_c2 = results.browser.name) == null ? void 0 : _c2.toLowerCase(); - let browser2; - switch (true) { - case browserName === "chrome": - browser2 = "chrome"; - break; - case browserName === "firefox": - browser2 = "firefox"; - break; - case (browserName == null ? void 0 : browserName.includes("safari")): - browser2 = "safari"; - break; - case (browserName == null ? void 0 : browserName.includes("opera")): - browser2 = "opera"; - break; - } - return { - os: os2, - browser: browser2 - }; +const AlertIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 15", fill: "none", ...props, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M1.63937 12.5331L7.6704 2.47023C8.04617 1.84325 8.95383 1.84326 9.3296 2.47023L15.3606 12.5331C15.7475 13.1787 15.283 14 14.531 14H2.46897C1.71695 14 1.25246 13.1787 1.63937 12.5331Z", + stroke: "currentColor", + strokeLinecap: "round", + strokeLinejoin: "round" + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M9.5 11.7231C9.5 12.2754 9.05228 12.7231 8.5 12.7231C7.94772 12.7231 7.5 12.2754 7.5 11.7231C7.5 11.1709 7.94772 10.7231 8.5 10.7231C9.05228 10.7231 9.5 11.1709 9.5 11.7231Z", + fill: "currentColor" + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M7.6684 5.65882C7.63842 5.15178 8.01942 4.72314 8.50008 4.72314C8.98075 4.72314 9.36174 5.15178 9.33176 5.65882L9.12831 9.09936C9.10757 9.44999 8.83247 9.72314 8.50008 9.72314C8.16769 9.72314 7.89259 9.44999 7.87186 9.09936L7.6684 5.65882Z", + fill: "currentColor" + } + ) + ] }); +}; +var clsErrorTitle = "wk_ebg9wh0"; +function ErrorTitle(props) { + const { className, children, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: cx("wk-error-title", clsErrorTitle, className), ...restProps, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(AlertIcon, {}), + children + ] }); } -function isOS(...os2) { - return os2.includes(getUserAgent().os); +var clsInfoTitle = "wk_pb4clz0"; +function InfoTitle(props) { + const { className, children, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-info-title", clsInfoTitle, className), ...restProps, children }); } -function isBrowser(...browser2) { - return browser2.includes(getUserAgent().browser); +function useWalletDownloadUrl(urls) { + const { options } = useWalletKit(); + const url = reactExports.useMemo(() => { + const url2 = urls.default ?? options.walletDownloadUrl; + return url2; + }, [options.walletDownloadUrl, urls.default]); + return url; } -let initParams = {}; -try { - let locationHash = location.hash.toString(); - initParams = urlParseHashParams(locationHash); -} catch (e18) { +function useWalletLogos(walletLogos) { + const { colorMode } = useTheme(); + const logos = reactExports.useMemo(() => { + const { default: defaultLogos, transparent: transparentLogos } = walletLogos ?? {}; + const defaultLogo = (defaultLogos == null ? void 0 : defaultLogos[colorMode]) ?? defaultLogos; + const transparentLogo = (transparentLogos == null ? void 0 : transparentLogos[colorMode]) ?? transparentLogos ?? defaultLogo; + return { + default: defaultLogo, + transparent: transparentLogo + }; + }, [colorMode, walletLogos]); + return logos; } -let tmaPlatform = "unknown"; -if (initParams == null ? void 0 : initParams.tgWebAppPlatform) { - tmaPlatform = initParams.tgWebAppPlatform ?? "unknown"; +var clsButton = "wk_qfvtl92"; +var clsContent$1 = "wk_qfvtl90"; +var clsFooter = "wk_qfvtl93"; +var clsGap = "wk_qfvtl91"; +const ConnectModalContext = W$2.createContext({}); +function useConnectModal() { + return reactExports.useContext(ConnectModalContext); } -if (tmaPlatform === "unknown") { - const window2 = getWindow(); - tmaPlatform = ((_p = (_o2 = window2 == null ? void 0 : window2.Telegram) == null ? void 0 : _o2.WebApp) == null ? void 0 : _p.platform) ?? "unknown"; +function useAutoCloseConnectModal(isConnected) { + const { options, selectedWallet } = useWalletKit(); + const router = useRouter(); + const { onClose } = useConnectModal(); + reactExports.useEffect(() => { + var _a3; + if (router.route !== ViewRoutes.HOME && isConnected) { + (_a3 = options.onConnected) == null ? void 0 : _a3.call(options, { + wallet: selectedWallet + }); + if (options.closeModalAfterConnected) { + onClose(); + } + } + }, [isConnected, router.route, options.closeModalAfterConnected]); } -let webAppVersion = "6.0"; -if (initParams == null ? void 0 : initParams.tgWebAppVersion) { - webAppVersion = initParams.tgWebAppVersion; +function TemplateConnectingView(props) { + const { status, runConnect, onTryAgain, wallet, isConnected } = props; + const { log: log2 } = useWalletKit(); + const logos = useWalletLogos(wallet.logos); + const downloadUrl = useWalletDownloadUrl(wallet.downloadUrls); + reactExports.useEffect(() => { + log2("[ConnectingView]", `name: ${wallet == null ? void 0 : wallet.name}, status: ${status}`); + if (status === CONNECT_STATUS.UNAVAILABLE) + return; + const connectTimeout = setTimeout(runConnect, 600); + return () => { + clearTimeout(connectTimeout); + }; + }, []); + const isError2 = [ + CONNECT_STATUS.FAILED, + CONNECT_STATUS.NOTCONNECTED, + CONNECT_STATUS.REJECTED + ].includes(status); + const isLoading = status === CONNECT_STATUS.CONNECTING; + useAutoCloseConnectModal(isConnected); + return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(ModalHeader, { children: wallet == null ? void 0 : wallet.name }), + /* @__PURE__ */ jsxRuntimeExports.jsxs(ModalBody, { className: clsContent$1, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectSpinner, { isLoading, isError: isError2, loadingColor: wallet.spinnerColor, children: logos.transparent }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsGap }), + status === CONNECT_STATUS.FAILED && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorTitle, { children: "Connection Failed" }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Description, { children: "Sorry, something went wrong. Please try connecting again." }) + ] }), + status === CONNECT_STATUS.REJECTED && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(InfoTitle, { children: "Request Cancelled" }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Description, { children: "You cancelled the request. Click above to try again." }) + ] }), + status === CONNECT_STATUS.CONNECTING && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(InfoTitle, { children: "Requesting Connection" }), + /* @__PURE__ */ jsxRuntimeExports.jsxs(Description, { children: [ + "Open the ", + wallet.name, + " ", + isMobile() ? "app" : "browser extension", + " to connect your wallet." + ] }) + ] }), + status === CONNECT_STATUS.CONNECTED && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(InfoTitle, { children: "Already Connected" }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Description, { children: "It is now okay to close this popup" }) + ] }), + status === CONNECT_STATUS.NOTCONNECTED && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs(ErrorTitle, { children: [ + "Login to ", + wallet.name + ] }), + /* @__PURE__ */ jsxRuntimeExports.jsxs(Description, { children: [ + "To continue, please login to your ", + wallet.name, + " extension." + ] }) + ] }), + status === CONNECT_STATUS.UNAVAILABLE && /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs(InfoTitle, { children: [ + "Install ", + wallet.name + ] }), + /* @__PURE__ */ jsxRuntimeExports.jsxs(Description, { children: [ + "To connect your ", + wallet.name, + ", install the browser extension." + ] }) + ] }) + ] }), + (status === CONNECT_STATUS.FAILED || status === CONNECT_STATUS.REJECTED) && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { className: clsFooter, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { className: cx("wk-retry-button", clsButton), onClick: onTryAgain, children: "Try Again" }) }), + status === CONNECT_STATUS.UNAVAILABLE && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { className: clsFooter, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + Button, + { + className: cx("wk-download-button", clsButton), + as: "a", + href: downloadUrl, + target: "_blank", + rel: "noopener", + children: "Install the Extension" + } + ) }) + ] }); } -if (!webAppVersion) { - const window2 = getWindow(); - webAppVersion = ((_r3 = (_q = window2 == null ? void 0 : window2.Telegram) == null ? void 0 : _q.WebApp) == null ? void 0 : _r3.version) ?? "6.0"; +function useIsConnected() { + const { address: address2 } = useAccount(); + return !!address2; } -function isTmaPlatform(...platforms) { - return platforms.includes(tmaPlatform); +function useWalletConnector(id2) { + const connectors = useConnectors(); + return connectors.find((item) => item.id === id2); } -function isInTMA() { +function evmCommonErrorHandler(props) { var _a3; - return tmaPlatform !== "unknown" || !!((_a3 = getWindow()) == null ? void 0 : _a3.TelegramWebviewProxy); + const { log: log2, handler, error } = props; + let text = ""; + if (error) { + if (error.code) { + switch (error.code) { + case 4902: + if (isIOS() && trustWallet().isInstalled()) { + text = "Not supported chainId"; + } + break; + } + } + let description2 = text || ((_a3 = error.cause) == null ? void 0 : _a3.message) || error.message; + if (description2 == null ? void 0 : description2.includes("Connection request reset")) { + description2 = void 0; + } + if (description2 == null ? void 0 : description2.includes("[binance-w3w] User closed modal")) { + description2 = "Use rejected the request"; + } + if (isMobile() && binanceWeb3Wallet().isInstalled()) { + if ((description2 == null ? void 0 : description2.includes("Request failed: The JSON sent is not a valid Request object.")) || (description2 == null ? void 0 : description2.includes("Adaptor not found: eip155"))) { + description2 = "Please update to the latest version of the Binance app and try again later."; + } + } + log2("[WalletError]", error); + handler == null ? void 0 : handler(error, description2); + } } -function isInTelegramBrowser() { - var _a3; - const isTelegramWebview = !!((_a3 = getWindow()) == null ? void 0 : _a3.TelegramWebview); - return (isInTMA() || isTelegramWebview) && tmaPlatform === "unknown"; +let timer; +function useEvmConnect(props) { + const { log: log2, options, evmConfig } = useWalletKit(); + const connectProps = { + chainId: evmConfig == null ? void 0 : evmConfig.initialChainId + }; + const { connect: connect2, connectAsync, connectors, ...restProps } = useConnect({ + ...props, + mutation: { + ...props == null ? void 0 : props.mutation, + onSettled(data, error, ...params) { + clearTimeout(timer); + timer = setTimeout(() => { + var _a3, _b2; + EventEmitter.emit(EventEmitter.EVM_CONNECT_SETTLE, data, error, ...params); + (_b2 = (_a3 = props == null ? void 0 : props.mutation) == null ? void 0 : _a3.onSettled) == null ? void 0 : _b2.call(_a3, data, error, ...params); + if (error) { + evmCommonErrorHandler({ + log: log2, + handler: options.onError, + error + }); + } + }, 100); + } + } + }); + return { + connect: ({ ...opts }) => { + return connect2({ + ...connectProps, + ...opts + }); + }, + connectAsync: async ({ ...opts }) => { + return await connectAsync({ + ...connectProps, + ...opts + }); + }, + connectors, + ...restProps + }; } -function sendOpenTelegramLink(link, fallback) { - const url = new URL(link); - if (url.protocol !== "http:" && url.protocol !== "https:") { - if (fallback) { - return fallback(); +function useConnectingStatus(props = {}) { + const { initialStatus } = props; + const { selectedWallet, evmConfig, options, action } = useWalletKit(); + const defaultStatus = selectedWallet.isInstalled() ? CONNECT_STATUS.CONNECTING : CONNECT_STATUS.UNAVAILABLE; + const [status, setStatus] = reactExports.useState(initialStatus ?? defaultStatus); + const { connect: connect2 } = useEvmConnect(); + reactExports.useEffect(() => { + const onSettled = (data, error) => { + var _a3; + if (error) { + if (error.code) { + switch (error.code) { + case -32002: + setStatus(CONNECT_STATUS.NOTCONNECTED); + break; + case 4001: + setStatus(CONNECT_STATUS.REJECTED); + break; + default: + setStatus(CONNECT_STATUS.FAILED); + break; + } + } else { + if (error.message) { + switch (error.message) { + case "User rejected request": + setStatus(CONNECT_STATUS.REJECTED); + break; + default: + setStatus(CONNECT_STATUS.FAILED); + break; + } + } + } + } else if (data) { + if ((evmConfig == null ? void 0 : evmConfig.initialChainId) && data.chainId === evmConfig.initialChainId && action === "add-network") { + (_a3 = options.onChainAlreadyAdded) == null ? void 0 : _a3.call(options, { + wallet: selectedWallet, + chainId: data.chainId + }); + } + } + }; + EventEmitter.on(EventEmitter.EVM_CONNECT_SETTLE, onSettled); + return () => { + EventEmitter.off(EventEmitter.EVM_CONNECT_SETTLE, onSettled); + }; + }, [action, evmConfig == null ? void 0 : evmConfig.initialChainId, options, selectedWallet]); + return { + status, + connect: connect2, + setStatus + }; +} +function EvmConnectingView() { + const { selectedWallet } = useWalletKit(); + const isConnected = useIsConnected(); + const selectedConnector = useWalletConnector(selectedWallet.id); + const { connect: connect2, status, setStatus } = useConnectingStatus(); + const runConnect = reactExports.useCallback(() => { + if (!selectedWallet.isInstalled()) + return; + if (selectedConnector) { + setStatus(CONNECT_STATUS.CONNECTING); + connect2({ connector: selectedConnector }); + } else { + setStatus(CONNECT_STATUS.UNAVAILABLE); } - throw new Error(`Url protocol is not supported: ${url}`); - } - if (url.hostname !== "t.me") { - if (fallback) { - return fallback(); + }, [connect2, selectedConnector, selectedWallet, setStatus]); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + TemplateConnectingView, + { + status, + runConnect, + onTryAgain: runConnect, + wallet: selectedWallet, + isConnected } - throw new Error(`Url host is not supported: ${url}`); - } - const pathFull = url.pathname + url.search; - if (isIframe() || versionAtLeast("6.1")) { - postEvent("web_app_open_tg_link", { path_full: pathFull }); - } else { - openLinkBlank("https://t.me" + pathFull); - } + ); } -function isIframe() { - try { - const window2 = getWindow(); - if (!window2) { - return false; +var clsLink = "wk_1a9rgw50"; +const Link = (props) => { + const { className, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx( + Box, + { + as: "a", + className: cx("wk-link", clsLink, className), + target: "_blank", + rel: "noopener", + ...restProps } - return window2.parent != null && window2 !== window2.parent; - } catch (e18) { - return false; - } -} -function postEvent(eventType, eventData) { - try { - const window2 = getWindow(); - if (!window2) { - throw new Error(`Can't post event to parent window: window is not defined`); + ); +}; +Link.displayName = "Link"; +const ForwardIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "21", height: "20", viewBox: "0 0 21 20", fill: "currentColor", ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M9.49408 3.57709C9.81951 3.25165 10.3472 3.25165 10.6726 3.57709L16.5059 9.41042C16.8314 9.73586 16.8314 10.2635 16.5059 10.5889L10.6726 16.4223C10.3472 16.7477 9.81951 16.7477 9.49408 16.4223C9.16864 16.0968 9.16864 15.5692 9.49408 15.2438L13.9048 10.833H5.08333C4.6231 10.833 4.25 10.4599 4.25 9.99967C4.25 9.53944 4.6231 9.16634 5.08333 9.16634H13.9048L9.49408 4.7556C9.16864 4.43016 9.16864 3.90252 9.49408 3.57709Z" } - if (window2.TelegramWebviewProxy !== void 0) { - window2.TelegramWebviewProxy.postEvent(eventType, JSON.stringify(eventData)); - } else if (window2.external && "notify" in window2.external) { - window2.external.notify(JSON.stringify({ eventType, eventData })); - } else if (isIframe()) { - const trustedTarget = "*"; - const message2 = JSON.stringify({ eventType, eventData }); - window2.parent.postMessage(message2, trustedTarget); - } else { - throw new Error(`Can't post event to TMA`); + ) }); +}; +var clsFadeIn = "wk_y1x8do2"; +var clsFadeOut = "wk_y1x8do3"; +var clsToastSlideIn = "wk_1jpwxhg2"; +var clsToastSlideOut = "wk_1jpwxhg3"; +var clsModalSlideIn = "wk_3li8yi2"; +var clsModalSlideOut = "wk_3li8yi3"; +const animationMap = { + fade: [clsFadeOut, clsFadeIn], + "toast-slide": [clsToastSlideOut, clsToastSlideIn], + "modal-slide": [clsModalSlideOut, clsModalSlideIn] +}; +const Transition = (props) => { + const { in: show, children, variant = "fade", onExit } = props; + const { className, onAnimationEnd, ...restProps } = children.props; + const [isMounted, setIsMounted] = reactExports.useState(show); + reactExports.useEffect(() => { + if (show) { + setIsMounted(true); } - } catch (e18) { - console.log(`Can't post event to parent window: ${e18}`); - } -} -function urlParseHashParams(locationHash) { - locationHash = locationHash.replace(/^#/, ""); - let params = {}; - if (!locationHash.length) { - return params; - } - if (locationHash.indexOf("=") < 0 && locationHash.indexOf("?") < 0) { - params._path = urlSafeDecode(locationHash); - return params; - } - let qIndex = locationHash.indexOf("?"); - if (qIndex >= 0) { - let pathParam = locationHash.substr(0, qIndex); - params._path = urlSafeDecode(pathParam); - locationHash = locationHash.substr(qIndex + 1); - } - let query_params = urlParseQueryString(locationHash); - for (let k2 in query_params) { - params[k2] = query_params[k2]; - } - return params; -} -function urlSafeDecode(urlencoded) { - try { - urlencoded = urlencoded.replace(/\+/g, "%20"); - return decodeURIComponent(urlencoded); - } catch (e18) { - return urlencoded; - } -} -function urlParseQueryString(queryString2) { - let params = {}; - if (!queryString2.length) { - return params; - } - let queryStringParams = queryString2.split("&"); - let i3, param, paramName, paramValue; - for (i3 = 0; i3 < queryStringParams.length; i3++) { - param = queryStringParams[i3].split("="); - paramName = urlSafeDecode(param[0]); - paramValue = param[1] == null ? null : urlSafeDecode(param[1]); - params[paramName] = paramValue; + }, [show]); + const onPlayEnd = (e18) => { + onAnimationEnd == null ? void 0 : onAnimationEnd(e18); + if (!show) { + onExit == null ? void 0 : onExit(); + setIsMounted(false); + } + }; + if (!isMounted) { + return null; } - return params; + return W$2.cloneElement(children, { + className: cx(animationMap[variant][Number(show)], className), + onAnimationEnd: onPlayEnd, + ...restProps + }); +}; +function generateMatrix(value, errorCorrectionLevel2) { + const arr = Array.prototype.slice.call( + browser.create(value, { errorCorrectionLevel: errorCorrectionLevel2 }).modules.data, + 0 + ); + const sqrt = Math.sqrt(arr.length); + return arr.reduce( + (rows, key2, index2) => (index2 % sqrt === 0 ? rows.push([key2]) : rows[rows.length - 1].push(key2)) && rows, + [] + ); } -function versionCompare(v12, v22) { - if (typeof v12 !== "string") - v12 = ""; - if (typeof v22 !== "string") - v22 = ""; - let v1List = v12.replace(/^\s+|\s+$/g, "").split("."); - let v2List = v22.replace(/^\s+|\s+$/g, "").split("."); - let a3, i3, p1, p22; - a3 = Math.max(v1List.length, v2List.length); - for (i3 = 0; i3 < a3; i3++) { - p1 = parseInt(v1List[i3]) || 0; - p22 = parseInt(v2List[i3]) || 0; - if (p1 === p22) - continue; - if (p1 > p22) - return 1; - return -1; - } - return 0; +function QRCode(props) { + const { className, ecl = "M", clearSize = 40, size: size2 = 212, uri } = props; + const dots = reactExports.useMemo(() => { + const dots2 = []; + const matrix = generateMatrix(uri, ecl); + const cellSize = size2 / matrix.length; + const qrList = [ + { x: 0, y: 0 }, + { x: 1, y: 0 }, + { x: 0, y: 1 } + ]; + qrList.forEach(({ x: x3, y: y3 }) => { + const x1 = (matrix.length - 7) * cellSize * x3; + const y1 = (matrix.length - 7) * cellSize * y3; + for (let i2 = 0; i2 < 3; i2++) { + const width = cellSize * (7 - i2 * 2); + const r2 = [8, 4, 0][i2]; + dots2.push( + /* @__PURE__ */ jsxRuntimeExports.jsx( + "rect", + { + fill: i2 % 2 === 0 ? "var(--wk-colors-qrCodeDot)" : "var(--wk-colors-modalBackground)", + height: width, + width, + rx: r2, + ry: r2, + x: x1 + cellSize * i2, + y: y1 + cellSize * i2 + }, + `${i2}-${x3}-${y3}` + ) + ); + } + }); + const clearArenaSize = Math.ceil(clearSize / cellSize) + 4; + const matrixMiddleStart = matrix.length / 2 - clearArenaSize / 2; + const matrixMiddleEnd = matrix.length / 2 + clearArenaSize / 2 - 1; + matrix.forEach((row, i2) => { + row.forEach((_3, j2) => { + if (matrix[i2][j2]) { + if (!(i2 < 7 && j2 < 7 || i2 > matrix.length - 8 && j2 < 7 || i2 < 7 && j2 > matrix.length - 8)) { + if (!(i2 > matrixMiddleStart && i2 < matrixMiddleEnd && j2 > matrixMiddleStart && j2 < matrixMiddleEnd)) { + dots2.push( + /* @__PURE__ */ jsxRuntimeExports.jsx( + "circle", + { + cx: i2 * cellSize + cellSize / 2, + cy: j2 * cellSize + cellSize / 2, + fill: "var(--wk-colors-qrCodeDot)", + r: cellSize / 3 + }, + `circle-${i2}-${j2}` + ) + ); + } + } + } + }); + }); + return dots2; + }, [ecl, clearSize, size2, uri]); + return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, height: "100%", width: "100%", viewBox: `0 0 ${size2} ${size2}`, children: dots }); } -function versionAtLeast(ver) { - return versionCompare(webAppVersion, ver) >= 0; +var clsContainer$2 = "wk_92eoeu1"; +var clsCorner = "wk_92eoeu2"; +function QRCodePlaceHolder() { + return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: clsContainer$2, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { as: "span", className: clsCorner }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { as: "span", className: clsCorner }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { as: "span", className: clsCorner }) + ] }); } -function isTelegramUrl(link) { - if (!link) { - return false; - } - const url = new URL(link); - return url.protocol === "tg:" || url.hostname === "t.me"; +var clsQrCodeContainer = "wk_10yx5n50"; +var clsQrCodeLogo = "wk_10yx5n52"; +var clsQrCodeWrapper = "wk_10yx5n51"; +function CustomQRCode(props) { + const { className, logo, logoSize = 44, value, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-qrcode", clsQrCodeContainer, className), ...restProps, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: clsQrCodeWrapper, children: [ + value ? /* @__PURE__ */ jsxRuntimeExports.jsx(Transition, { in: !!value, children: /* @__PURE__ */ jsxRuntimeExports.jsx(QRCode, { uri: value }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(QRCodePlaceHolder, {}), + /* @__PURE__ */ jsxRuntimeExports.jsx( + Box, + { + className: cx("wk-qrcode-logo", clsQrCodeLogo), + style: { + width: logoSize, + height: logoSize, + opacity: value ? 1 : 0.3 + }, + children: logo + } + ) + ] }) }); } -function encodeTelegramUrlParameters(parameters) { - return parameters.replaceAll(".", "%2E").replaceAll("-", "%2D").replaceAll("_", "%5F").replaceAll("&", "-").replaceAll("=", "__").replaceAll("%", "--"); +var clsContainer$1 = "wk_1j0944g0"; +var clsOfficialButton = "wk_1j0944g1"; +function TemplateQRCodeView(props) { + const { wallet, qrCodeUri, onClickOpenWcModal, isConnected, isWalletConnect: isWalletConnect2 } = props; + const { options } = useWalletKit(); + const logos = useWalletLogos(wallet == null ? void 0 : wallet.logos); + useAutoCloseConnectModal(isConnected); + return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(ModalHeader, { children: "Scan with your phone" }), + /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: cx("wk-scan-qrcode", clsContainer$1), children: /* @__PURE__ */ jsxRuntimeExports.jsx(CustomQRCode, { value: qrCodeUri, logo: logos.default }) }), + isWalletConnect2 && !(options == null ? void 0 : options.hideOfficialWalletConnectCTA) && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs( + Link, + { + className: cx("wk-official-wc-button", clsOfficialButton), + onClick: onClickOpenWcModal, + children: [ + "Open the official WalletConnect modal", + /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardIcon, {}) + ] + } + ) }) + ] }); } -function addReturnStrategy(url, strategy) { - let returnStrategy; - if (typeof strategy === "string") { - returnStrategy = strategy; - } else { - returnStrategy = isInTMA() ? strategy.twaReturnUrl || strategy.returnStrategy : "stay"; - } - const newUrl = addQueryParameter(url, "ret", returnStrategy); - if (!isTelegramUrl(url)) { - return newUrl; - } - const lastParam = newUrl.slice(newUrl.lastIndexOf("&") + 1); - return newUrl.slice(0, newUrl.lastIndexOf("&")) + "-" + encodeTelegramUrlParameters(lastParam); +function useWalletConnectConnector() { + const connectors = useConnectors(); + return connectors.find((item) => isWalletConnect(item.id)); } -function redirectToTelegram(universalLink, startapp, options) { - options = { ...options }; - const directLinkUrl = new URL(universalLink); - if (!directLinkUrl.searchParams.has("startapp")) { - directLinkUrl.searchParams.append("startapp", startapp); - } - if (isInTelegramBrowser()) { - openLink(directLinkUrl.toString()); - } else if (isInTMA()) { - if (isTmaPlatform("ios", "macos", "tdesktop", "web")) { - options.returnStrategy = "back"; - const linkWitStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); - sendOpenTelegramLink(linkWitStrategy); - } else if (isTmaPlatform("weba")) { - sendOpenTelegramLink(addReturnStrategy(directLinkUrl.toString(), options)); - } else { - openLinkBlank(addReturnStrategy(directLinkUrl.toString(), options)); - } - } else { - if (isOS("ios")) { - if (options.returnStrategy === "back") { - if (isBrowser("safari")) { - options.returnStrategy = "back"; - } else if (isBrowser("chrome")) { - options.returnStrategy = "googlechrome://"; - } else if (isBrowser("firefox")) { - options.returnStrategy = "firefox://"; - } else if (isBrowser("opera")) { - options.returnStrategy = "opera-http://"; - } else { - options.returnStrategy = location.href; - } - } - const isChrome = isBrowser("chrome"); - const isFirefox = isBrowser("firefox"); - const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect; - if (useDeepLink) { - const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); - const deepLink = convertToTGDeepLink(linkWithStrategy); - openDeeplinkWithFallback(deepLink, () => openLink(linkWithStrategy)); - } else { - const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); - openLink(linkWithStrategy); - } - } else if (isOS("android")) { - options.returnStrategy = "back"; - const isChrome = isBrowser("chrome"); - const isFirefox = isBrowser("firefox"); - const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect; - if (useDeepLink) { - const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); - const deepLink = convertToTGDeepLink(linkWithStrategy); - openDeeplinkWithFallback(deepLink, () => openLinkBlank(linkWithStrategy)); - } else { - const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); - openLinkBlank(linkWithStrategy); +function useWalletConnectUri(props = {}) { + const { enabled = true, refreshUriOnError = true } = props; + const { connectAsync } = useEvmConnect(); + const { log: log2 } = useWalletKit(); + const connector = useWalletConnectConnector(); + const isConnected = useIsConnected(); + const [wcUri, setWcUri] = reactExports.useState(); + reactExports.useEffect(() => { + if (isConnected || !connector || !enabled) + return; + const onUpdateWcUri = ({ type: type2, data }) => { + if (type2 === "display_uri") { + setWcUri(data); } - } else if (isOS("ipad")) { - if (options.returnStrategy === "back") { - if (isBrowser("safari")) { - options.returnStrategy = "back"; - } else if (isBrowser("chrome")) { - options.returnStrategy = "googlechrome://"; - } else if (isBrowser("firefox")) { - options.returnStrategy = "firefox://"; - } else if (isBrowser("opera")) { - options.returnStrategy = "opera-http://"; - } else { - options.returnStrategy = location.href; + }; + const connectWallet = async () => { + try { + log2("[WcUri]", "connecting"); + const provider = await (connector == null ? void 0 : connector.getProvider()); + provider.rpc.showQrModal = false; + await connectAsync({ connector }); + } catch (error) { + if ((error == null ? void 0 : error.code) === 4001 && refreshUriOnError) { + connectWallet(); } } - const isChrome = isBrowser("chrome"); - const isFirefox = isBrowser("firefox"); - const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect; - const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); - if (useDeepLink) { - const deepLink = convertToTGDeepLink(linkWithStrategy); - openDeeplinkWithFallback(deepLink, () => openLinkBlank(linkWithStrategy)); - } else { - openLinkBlank(linkWithStrategy); - } - } else if (isOS("macos", "windows", "linux")) { - options.returnStrategy = "back"; - options.twaReturnUrl = void 0; - const linkWithStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy); - if (options.forceRedirect) { - openLinkBlank(linkWithStrategy); - } else { - const deepLink = convertToTGDeepLink(linkWithStrategy); - openDeeplinkWithFallback(deepLink, () => openLinkBlank(linkWithStrategy)); + }; + connectWallet(); + connector.emitter.on("message", onUpdateWcUri); + return () => { + connector == null ? void 0 : connector.emitter.off("message", onUpdateWcUri); + }; + }, [isConnected, enabled, refreshUriOnError]); + return { + wcUri + }; +} +function useWalletConnectModal() { + const { connectAsync } = useEvmConnect(); + const connectModal = useConnectModal(); + const { log: log2 } = useWalletKit(); + const [isOpen, setIsOpen] = reactExports.useState(false); + reactExports.useEffect(() => { + if (isOpen) { + const timer2 = setTimeout(() => { + connectModal.onClose(); + }, 800); + return () => { + clearTimeout(timer2); + }; + } + }, [connectModal, isOpen]); + const connector = useWalletConnectConnector(); + return { + isOpen, + onOpen: async () => { + document.body.style.setProperty("--wcm-z-index", "2147483647"); + const provider = await (connector == null ? void 0 : connector.getProvider()); + provider.rpc.showQrModal = true; + if (connector) { + setIsOpen(true); + try { + await connectAsync({ connector }); + } catch (err) { + log2("[OpenWcModal]", err); + } + setIsOpen(false); } - } else { - openLinkBlank(addReturnStrategy(directLinkUrl.toString(), options)); } - } -} -function addQueryParameter(url, key2, value) { - const parsed = new URL(url); - parsed.searchParams.append(key2, value); - return parsed.toString(); -} -function convertToTGDeepLink(directLink) { - const parsed = new URL(directLink); - const [, domain, appname] = parsed.pathname.split("/"); - const startapp = parsed.searchParams.get("startapp"); - return `tg://resolve?domain=${domain}&appname=${appname}&startapp=${startapp}`; -} -const PROD_TG_MINI_WALLET_URL = "https://t.me/codexfieldbot/wallet?mode=compact"; -const TEST_TG_MINI_WALLET_URL = "https://t.me/codexfield_test_bot/wallet?mode=compact"; -const LOCAL_DEBUG_KEY = "_cfw_debug"; -const LOCAL_RETURN_URL_KEY = "_cfw_return_url"; -const MEM_WALLET_OPEN_OPTION = "mem_cfw_wallet_open_option"; -const ACTION_WC_PAIR = "wc_pair"; -const ACTION_WC_MSG = "wc_msg"; -function base64urlEncode(content) { - return btoa(content).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); + }; } -function setToStorage(key2, value) { - tryGetLocalStorage().setItem(key2, value ?? ""); +function EvmQRCodeView() { + var _a3; + const { selectedWallet } = useWalletKit(); + const { wcUri } = useWalletConnectUri(); + const wcModal = useWalletConnectModal(); + const qrCodeUri = wcUri && (((_a3 = selectedWallet.getUri) == null ? void 0 : _a3.call(selectedWallet, wcUri)) ?? wcUri); + const isConnected = useIsConnected(); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + TemplateQRCodeView, + { + wallet: selectedWallet, + qrCodeUri, + onClickOpenWcModal: wcModal.onOpen, + isConnected, + isWalletConnect: isWalletConnect(selectedWallet.id) + } + ); } -function getFromStorage(key2) { - return tryGetLocalStorage().getItem(key2); +function EvmUriConnectingView() { + const { selectedWallet } = useWalletKit(); + const isConnected = useIsConnected(); + const { status, setStatus } = useConnectingStatus({ + initialStatus: CONNECT_STATUS.CONNECTING + }); + const { wcUri } = useWalletConnectUri({ + enabled: status !== CONNECT_STATUS.CONNECTING, + refreshUriOnError: false + }); + const onTryAgain = () => { + setStatus(CONNECT_STATUS.CONNECTING); + const walletUri = selectedWallet.getUri(wcUri); + openLink(walletUri); + }; + return /* @__PURE__ */ jsxRuntimeExports.jsx( + TemplateConnectingView, + { + isConnected, + status, + runConnect: () => void 0, + onTryAgain, + wallet: selectedWallet + } + ); } -function genStartappParams(action, data, returnUrl) { - const params = { - action, - data, - returnUrl, - openOption: getWalletOpenOption() +function useSolanaConnect() { + const { solanaConfig } = useWalletKit(); + const { select: select2, wallets: adapters2, connected } = useWallet$1(); + const connect2 = reactExports.useCallback( + async ({ adapterName }) => { + var _a3; + select2(adapterName); + if (!(solanaConfig == null ? void 0 : solanaConfig.autoConnect)) { + const adapter = (_a3 = adapters2.find((item) => item.adapter.name === adapterName)) == null ? void 0 : _a3.adapter; + if (adapter) { + await adapter.connect(); + } + } + }, + [adapters2, select2, solanaConfig == null ? void 0 : solanaConfig.autoConnect] + ); + return { + connect: connect2, + isConnected: connected }; - return base64urlEncode(JSON.stringify(params)); -} -function openTgMiniWalletForConnect(wcUrl, returnUrl, debug) { - setToStorage(LOCAL_RETURN_URL_KEY, returnUrl); - setToStorage(LOCAL_DEBUG_KEY, debug ? "true" : "false"); - const universalLink = debug ? TEST_TG_MINI_WALLET_URL : PROD_TG_MINI_WALLET_URL; - const startParams = genStartappParams(ACTION_WC_PAIR, wcUrl, returnUrl); - redirectToTelegram(universalLink, startParams, { - returnStrategy: "back", - twaReturnUrl: returnUrl, - forceRedirect: false - }); } -function openTgMiniWalletForMsg(method, returnUrl, debug) { - const openOption = getWalletOpenOption(); - if (openOption === "stay" || openOption === "connect_and_sign" && method === "personal_sign") { - console.log(`no need open wallet for openOption: ${openOption}`); - return; - } - let _returnUrl; - if (returnUrl === void 0 || returnUrl.length === 0) { - _returnUrl = getFromStorage(LOCAL_RETURN_URL_KEY) ?? void 0; - } else { - _returnUrl = returnUrl; - } - let _debug; - if (debug === void 0) { - _debug = getFromStorage(LOCAL_DEBUG_KEY) === "true"; - } else { - _debug = debug; +function solanaCommonErrorHandler(props) { + const { log: log2, handler, error } = props; + if (error) { + const description2 = error.message || error.name; + log2("[WalletError]", error); + handler == null ? void 0 : handler(error, description2); } - const universalLink = _debug ? TEST_TG_MINI_WALLET_URL : PROD_TG_MINI_WALLET_URL; - const startParams = genStartappParams(ACTION_WC_MSG, (/* @__PURE__ */ new Date()).getTime().toString(), _returnUrl); - redirectToTelegram(universalLink, startParams, { - returnStrategy: "back", - twaReturnUrl: _returnUrl, - forceRedirect: false - }); } -function getWalletOpenOption() { - const option = InMemoryStorage.getInstance().getItem(MEM_WALLET_OPEN_OPTION); - if (option === void 0 || option === null || option.length === 0) - return "auto"; - return option; +function SolanaConnectingView() { + const { log: log2, selectedWallet, options } = useWalletKit(); + const [status, setStatus] = reactExports.useState( + selectedWallet.isInstalled() ? CONNECT_STATUS.CONNECTING : CONNECT_STATUS.UNAVAILABLE + ); + const { isConnected, connect: connect2 } = useSolanaConnect(); + reactExports.useEffect(() => { + const onError = (error) => { + let message2 = ""; + if (error.message.includes("Error Calling Method: requestAccounts") || error.message.includes("rejected")) { + message2 = "User rejected the request"; + setStatus(CONNECT_STATUS.REJECTED); + } else { + setStatus(CONNECT_STATUS.FAILED); + } + solanaCommonErrorHandler({ + log: log2, + handler: options.onError, + error: { + message: message2 + } + }); + }; + EventEmitter.on(EventEmitter.SOLANA_WALLET_ERROR, onError); + return () => { + EventEmitter.off(EventEmitter.SOLANA_WALLET_ERROR, onError); + }; + }, [options.onError, log2]); + const runConnect = reactExports.useCallback(async () => { + if (!selectedWallet.isInstalled()) + return; + setStatus(CONNECT_STATUS.CONNECTING); + connect2({ + adapterName: selectedWallet.adapterName + }); + }, [connect2, selectedWallet]); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + TemplateConnectingView, + { + status, + runConnect, + onTryAgain: runConnect, + wallet: selectedWallet, + isConnected + } + ); } -const REQUIRED_METHODS = ["eth_sendTransaction", "personal_sign"]; -const OPTIONAL_METHODS = [ - "eth_accounts", - "eth_requestAccounts", - "eth_sendRawTransaction", - "eth_sign", - "eth_signTransaction", - "eth_signTypedData", - "eth_signTypedData_v3", - "eth_signTypedData_v4", - "eth_sendTransaction", - "personal_sign", - "wallet_switchEthereumChain", - "wallet_addEthereumChain", - "wallet_getPermissions", - "wallet_requestPermissions", - "wallet_registerOnboarding", - "wallet_watchAsset", - "wallet_scanQRCode", - "wallet_sendCalls", - "wallet_getCapabilities", - "wallet_getCallsStatus", - "wallet_showCallsStatus" -]; -const LAUNCH_WALLET_METHODS = [ - "eth_sendRawTransaction", - "eth_sign", - "eth_signTransaction", - "eth_signTypedData", - "eth_signTypedData_v3", - "eth_signTypedData_v4", - "eth_sendTransaction", - "personal_sign" -]; -const REQUIRED_EVENTS = ["chainChanged", "accountsChanged"]; -const OPTIONAL_EVENTS = [ - "chainChanged", - "accountsChanged", - "message", - "disconnect", - "connect" -]; -const PROTOCOL = "wc"; -const WC_VERSION = 2; -const CONTEXT = "ethereum_provider"; -const STORAGE_KEY = `${PROTOCOL}@${WC_VERSION}:${CONTEXT}:`; -const RPC_URL = "https://rpc.walletconnect.com/v1/"; -function getEthereumChainId(chains) { - var _a3; - return Number((_a3 = chains[0]) == null ? void 0 : _a3.split(":")[1]); +function SolanaQRCodeView() { + return null; } -function toHexChainId(chainId) { - return `0x${chainId.toString(16)}`; +const MOBILE_MEDIA = "screen and (max-width: 767px)"; +function useMediaQuery(query) { + const [isMatched, setIsMatched] = reactExports.useState(false); + reactExports.useEffect(() => { + const onChange = () => { + const isMatched2 = window.matchMedia(query).matches; + setIsMatched(isMatched2); + }; + onChange(); + const matchMedia = window.matchMedia(query); + matchMedia.addEventListener("change", onChange); + return () => { + matchMedia.removeEventListener("change", onChange); + }; + }, [query]); + return isMatched; } -function buildNamespaces(params) { - const { chains, optionalChains, methods, optionalMethods, events: events2, optionalEvents, rpcMap } = params; - if (!Er$2(chains)) { - throw new Error("Invalid chains"); - } - const required = { - chains, - methods: methods || REQUIRED_METHODS, - events: events2 || REQUIRED_EVENTS, - // @ts-ignore - rpcMap: { - ...chains.length ? { [getEthereumChainId(chains)]: rpcMap[getEthereumChainId(chains)] } : {} - } - }; - const eventsRequiringPermissions = events2 == null ? void 0 : events2.filter((event) => !REQUIRED_EVENTS.includes(event)); - const methodsRequiringPermissions = methods == null ? void 0 : methods.filter((event) => !REQUIRED_METHODS.includes(event)); - if (!optionalChains && !optionalEvents && !optionalMethods && !(eventsRequiringPermissions == null ? void 0 : eventsRequiringPermissions.length) && !(methodsRequiringPermissions == null ? void 0 : methodsRequiringPermissions.length)) { - return { required: chains.length ? required : void 0 }; - } - const shouldIncludeRequiredChains = (eventsRequiringPermissions == null ? void 0 : eventsRequiringPermissions.length) && (methodsRequiringPermissions == null ? void 0 : methodsRequiringPermissions.length) || !optionalChains; - const optional2 = { - chains: [ - ...new Set(shouldIncludeRequiredChains ? required.chains.concat(optionalChains || []) : optionalChains) - ], - methods: [ - ...new Set(required.methods.concat((optionalMethods == null ? void 0 : optionalMethods.length) ? optionalMethods : OPTIONAL_METHODS)) - ], - events: [ - ...new Set(required.events.concat((optionalEvents == null ? void 0 : optionalEvents.length) ? optionalEvents : OPTIONAL_EVENTS)) - ], - rpcMap - }; +const useResponsive = () => { + const isMobileLayout = useMediaQuery(MOBILE_MEDIA); return { - required: chains.length ? required : void 0, - optional: optionalChains.length ? optional2 : void 0 + isMobileLayout + }; +}; +const WalletIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: 24, height: 24, viewBox: "0 0 40 40", fill: "currentColor", ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M4.16669 12.5C4.16669 9.73858 6.40526 7.5 9.16669 7.5H30.8334C33.5948 7.5 35.8334 9.73858 35.8334 12.5V27.5C35.8334 30.2614 33.5948 32.5 30.8334 32.5H9.16669C6.40526 32.5 4.16669 30.2614 4.16669 27.5V12.5ZM9.16669 10.8333C8.24621 10.8333 7.50002 11.5795 7.50002 12.5V27.5C7.50002 28.4205 8.24621 29.1667 9.16669 29.1667H30.8334C31.7538 29.1667 32.5 28.4205 32.5 27.5V26.4583H24.1667C20.5998 26.4583 17.7084 23.5668 17.7084 20C17.7084 16.4332 20.5998 13.5417 24.1667 13.5417H32.5V12.5C32.5 11.5795 31.7538 10.8333 30.8334 10.8333H9.16669ZM32.5 16.4583H24.1667C22.2107 16.4583 20.625 18.044 20.625 20C20.625 21.956 22.2107 23.5417 24.1667 23.5417H32.5V16.4583ZM26.6667 20C26.6667 21.1506 25.7339 22.0833 24.5834 22.0833C23.4328 22.0833 22.5 21.1506 22.5 20C22.5 18.8494 23.4328 17.9167 24.5834 17.9167C25.7339 17.9167 26.6667 18.8494 26.6667 20Z" + } + ) }); +}; +var clsWalletOption$1 = "wk_1dbgl2y1"; +var clsWalletOptionDisabled$1 = "wk_1dbgl2y4"; +var clsWalletOptionIcon$1 = "wk_1dbgl2y3"; +var clsWalletOptionName$1 = "wk_1dbgl2y2"; +var clsWalletOptionWrapper = "wk_1dbgl2y0"; +const Text = (props) => { + const { ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { as: "p", ...restProps }); +}; +Text.displayName = "Text"; +function useWalletRender(props) { + const { wallet, layout, clickRef, defaultRender } = props; + const { colorMode } = useTheme(); + const logos = useWalletLogos(wallet.logos); + const renderOptions = { + layout, + colorMode, + wallet: { + id: wallet.id, + walletType: wallet.walletType, + name: wallet.name, + logo: layout === "grid" ? logos.default : logos.transparent, + isDisabled: wallet.isDisabled, + isVisible: wallet.isVisible + }, + onClick(e18) { + var _a3; + (_a3 = clickRef.current) == null ? void 0 : _a3.call(clickRef, wallet.id, e18); + } }; + const render2 = wallet.render ?? defaultRender; + return render2 == null ? void 0 : render2(renderOptions); } -class EthereumProvider { - constructor() { - Object.defineProperty(this, "events", { - enumerable: true, - configurable: true, - writable: true, - value: new eventsExports.EventEmitter() - }); - Object.defineProperty(this, "namespace", { - enumerable: true, - configurable: true, - writable: true, - value: "eip155" - }); - Object.defineProperty(this, "accounts", { - enumerable: true, - configurable: true, - writable: true, - value: [] - }); - Object.defineProperty(this, "signer", { - enumerable: true, - configurable: true, - writable: true, - value: void 0 - }); - Object.defineProperty(this, "chainId", { - enumerable: true, - configurable: true, - writable: true, - value: 1 - }); - Object.defineProperty(this, "modal", { - enumerable: true, - configurable: true, - writable: true, - value: void 0 - }); - Object.defineProperty(this, "rpc", { - enumerable: true, - configurable: true, - writable: true, - value: void 0 - }); - Object.defineProperty(this, "on", { - enumerable: true, - configurable: true, - writable: true, - value: (event, listener) => { - this.events.on(event, listener); - return this; +function SetEvmWalletClickRef(props) { + const { clickRef } = props; + const { log: log2, options, evmConfig, setSelectedWallet } = useWalletKit(); + const { disconnect: disconnect2 } = useDisconnect(); + const wcModal = useWalletConnectModal(); + const connectModal = useConnectModal(); + const router = useRouter(); + const { connect: connect2 } = useEvmConnect(); + const connectors = useConnectors(); + const timerRef = reactExports.useRef(); + clickRef.current = (walletId, e18) => { + var _a3; + const wallet = evmConfig.wallets.find((item) => item.id === walletId); + const connector = connectors.find((item) => item.id === walletId); + const pass = (_a3 = options.onClickWallet) == null ? void 0 : _a3.call(options, wallet, e18); + if (pass === false) + return; + log2("[ClickWallet]", `ethereum:`, typeof window.ethereum); + log2("[ClickWallet]", `installed:`, wallet.isInstalled()); + const jumpTo = (viewRoute) => { + setSelectedWallet(wallet); + if (connectModal.isOpen) { + router.push(viewRoute); + } else { + connectModal.onOpen({ + viewRoute + }); } - }); - Object.defineProperty(this, "once", { - enumerable: true, - configurable: true, - writable: true, - value: (event, listener) => { - this.events.once(event, listener); - return this; + }; + const jumpToQRCodeView = () => { + var _a4; + const qrCodeUri = wallet.getUri("xxx"); + if (qrCodeUri) { + jumpTo(ViewRoutes.EVM_QRCODE); + } else { + (_a4 = options.onError) == null ? void 0 : _a4.call( + options, + new Error(`The wallet does not support QR code`), + `The wallet does not support QR code` + ); } - }); - Object.defineProperty(this, "removeListener", { - enumerable: true, - configurable: true, - writable: true, - value: (event, listener) => { - this.events.removeListener(event, listener); - return this; + }; + const jumpToConnectingView = () => { + jumpTo(ViewRoutes.EVM_CONNECTING); + }; + const jumpToDeepLink = () => { + var _a4; + const deepLink = wallet.getDeepLink(); + if (deepLink) { + openLink(deepLink); + } else { + (_a4 = options.onError) == null ? void 0 : _a4.call( + options, + new Error(`The wallet does not support deeplink`), + `The wallet does not support deeplink` + ); } - }); - Object.defineProperty(this, "off", { - enumerable: true, - configurable: true, - writable: true, - value: (event, listener) => { - this.events.off(event, listener); - return this; + }; + const jumpToUriConnectingView = () => { + var _a4; + const wcUri = getEvmGlobalData().homeViewWalletConnectUri; + if (wcUri) { + const connectUri = wallet.getUri(wcUri); + if (connectUri) { + openLink(connectUri); + jumpTo(ViewRoutes.EVM_URI_CONNECTING); + } else { + (_a4 = options.onError) == null ? void 0 : _a4.call( + options, + new Error(`The wallet does not support URI connection`), + `The wallet does not support URI connection` + ); + } } - }); - Object.defineProperty(this, "parseAccount", { - enumerable: true, - configurable: true, - writable: true, - value: (payload) => { - return this.isCompatibleChainId(payload) ? this.parseAccountId(payload).address : payload; + }; + disconnect2(); + clearTimeout(timerRef.current); + const isBinanceWeb3Wallet = binanceWeb3Wallet().id === walletId; + const delay2 = isBinanceWeb3Wallet ? 0 : 300; + timerRef.current = setTimeout(() => { + if (isBinanceWeb3Wallet) { + connect2({ + connector + }); + setTimeout(() => { + connectModal.onClose(); + }, 500); + return; } - }); - this.signer = {}; - this.rpc = {}; - } - static async init(opts) { - const provider = new EthereumProvider(); - await provider.initialize(opts); - return provider; - } - async request(args, expiry) { - console.log(`request method ${args.method}`); - if (LAUNCH_WALLET_METHODS.includes(args.method)) { - openTgMiniWalletForMsg(args.method); - } - return await this.signer.request(args, this.formatChainId(this.chainId), expiry); - } - sendAsync(args, callback, expiry) { - this.signer.sendAsync(args, callback, this.formatChainId(this.chainId), expiry); - } - get connected() { - if (!this.signer.client) - return false; - return this.signer.client.core.relayer.connected; - } - get connecting() { - if (!this.signer.client) - return false; - return this.signer.client.core.relayer.connecting; - } - async enable() { - if (!this.session) - await this.connect(); - const accounts2 = await this.request({ method: "eth_requestAccounts" }); - return accounts2; - } - async connect(opts) { - if (!this.signer.client) { - throw new Error("Provider not initialized. Call init() first"); - } - this.loadConnectOpts(opts); - const { required, optional: optional2 } = buildNamespaces(this.rpc); - try { - const session = await new Promise(async (resolve, reject) => { - var _a3; - if (this.rpc.showQrModal) { - (_a3 = this.modal) == null ? void 0 : _a3.subscribeModal((state) => { - if (!state.open && !this.signer.session) { - this.signer.abortPairingAttempt(); - reject(new Error("Connection request reset. Please try again.")); - } - }); + if (isTMA()) { + if ([uxuyWallet().id, codexFieldWallet().id].includes(walletId)) { + jumpToConnectingView(); + return; } - await this.signer.connect({ - namespaces: { - ...required && { - [this.namespace]: required - } - }, - ...optional2 && { - optionalNamespaces: { - [this.namespace]: optional2 - } - }, - pairingTopic: opts == null ? void 0 : opts.pairingTopic - }).then((session2) => { - resolve(session2); - }).catch((error) => { - reject(new Error(error.message)); + if (isMobile()) { + if (isWalletConnect(walletId)) { + wcModal.onOpen(); + } else { + jumpToUriConnectingView(); + } + } else { + jumpToQRCodeView(); + } + } else if (isMobile()) { + if (wallet.isInstalled()) { + if (isWalletConnect(walletId)) { + wcModal.onOpen(); + } else { + jumpToConnectingView(); + } + } else { + jumpToDeepLink(); + } + } else { + if (wallet.showQRCode) { + jumpToQRCodeView(); + } else { + if (isWalletConnect(walletId)) { + wcModal.onOpen(); + } else { + jumpToConnectingView(); + } + } + } + }, delay2); + }; + return null; +} +function SetSolanaWalletClickRef(props) { + const { clickRef } = props; + const { log: log2, options, setSelectedWallet, solanaConfig } = useWalletKit(); + const { disconnect: disconnect2 } = useWallet$1(); + const { connect: connect2 } = useSolanaConnect(); + const connectModal = useConnectModal(); + const router = useRouter(); + const timerRef = reactExports.useRef(); + clickRef.current = (walletId, e18) => { + var _a3; + const wallet = solanaConfig.wallets.find((item) => item.id === walletId); + const pass = (_a3 = options.onClickWallet) == null ? void 0 : _a3.call(options, wallet, e18); + if (pass === false) + return; + log2("[ClickWallet]", `wallet:`, wallet); + log2("[ClickWallet]", `installed:`, wallet.isInstalled()); + const jumpTo = (viewRoute) => { + setSelectedWallet(wallet); + if (connectModal.isOpen) { + router.push(viewRoute); + } else { + connectModal.onOpen({ + viewRoute }); - }); - if (!session) - return; - const accounts2 = zo(session.namespaces, [this.namespace]); - this.setChainIds(this.rpc.chains.length ? this.rpc.chains : accounts2); - this.setAccounts(accounts2); - this.events.emit("connect", { chainId: toHexChainId(this.chainId) }); - } catch (error) { - this.signer.logger.error(error); - throw error; - } finally { - if (this.modal) - this.modal.closeModal(); - } - } - async authenticate(params) { - if (!this.signer.client) { - throw new Error("Provider not initialized. Call init() first"); - } - this.loadConnectOpts({ - chains: params == null ? void 0 : params.chains - }); - try { - const result = await new Promise(async (resolve, reject) => { - var _a3; - if (this.rpc.showQrModal) { - (_a3 = this.modal) == null ? void 0 : _a3.subscribeModal((state) => { - if (!state.open && !this.signer.session) { - this.signer.abortPairingAttempt(); - reject(new Error("Connection request reset. Please try again.")); - } + } + }; + const jumpToConnectingView = () => { + jumpTo(ViewRoutes.SOLANA_CONNECTING); + }; + disconnect2(); + clearTimeout(timerRef.current); + timerRef.current = setTimeout(() => { + if (isMobile()) { + const deeplink = wallet.getDeepLink(); + if (wallet.isInstalled()) { + jumpToConnectingView(); + } else if (deeplink) { + openLink(deeplink); + } else { + connect2({ + adapterName: wallet.adapterName }); } - await this.signer.authenticate({ - ...params, - chains: this.rpc.chains - }).then((result2) => { - resolve(result2); - }).catch((error) => { - reject(new Error(error.message)); + } else { + jumpToConnectingView(); + } + }, 300); + }; + return null; +} +function useTronConnect() { + const { select: select2, wallets: adapters2, connected } = useWallet(); + const [isConnected, setIsConnected] = reactExports.useState(connected); + const connect2 = reactExports.useCallback( + async ({ adapterName, chainId }) => { + var _a3; + select2(adapterName); + const finalChainId = typeof chainId === "number" ? `0x${chainId.toString(16)}` : chainId; + const adapter = (_a3 = adapters2.find((item) => item.adapter.name === adapterName)) == null ? void 0 : _a3.adapter; + if (adapter) { + await adapter.connect(); + setIsConnected(true); + if (finalChainId && !isMobile()) { + await (adapter == null ? void 0 : adapter.switchChain(finalChainId)); + } + } + }, + [adapters2, select2] + ); + return { + connect: connect2, + isConnected + }; +} +function SetTronWalletClickRef(props) { + const { clickRef } = props; + const { log: log2, options, setSelectedWallet, tronConfig } = useWalletKit(); + const { disconnect: disconnect2 } = useWallet(); + const { connect: connect2 } = useTronConnect(); + const connectModal = useConnectModal(); + const router = useRouter(); + const timerRef = reactExports.useRef(); + clickRef.current = (walletId, e18) => { + var _a3; + const wallet = tronConfig.wallets.find((item) => item.id === walletId); + const pass = (_a3 = options.onClickWallet) == null ? void 0 : _a3.call(options, wallet, e18); + if (pass === false) + return; + log2("[ClickWallet]", `wallet:`, wallet); + log2("[ClickWallet]", `installed:`, wallet.isInstalled()); + const jumpTo = (viewRoute) => { + setSelectedWallet(wallet); + if (connectModal.isOpen) { + router.push(viewRoute); + } else { + connectModal.onOpen({ + viewRoute }); - }); - const session = result.session; - if (session) { - const accounts2 = zo(session.namespaces, [this.namespace]); - this.setChainIds(this.rpc.chains.length ? this.rpc.chains : accounts2); - this.setAccounts(accounts2); - this.events.emit("connect", { chainId: toHexChainId(this.chainId) }); } - return result; - } catch (error) { - this.signer.logger.error(error); - throw error; - } finally { - if (this.modal) - this.modal.closeModal(); - } - } - async disconnect() { - if (this.session) { - await this.signer.disconnect(); - } - this.reset(); - } - get isWalletConnect() { - return true; - } - get session() { - return this.signer.session; - } - // ---------- Protected --------------------------------------------- // - registerEventListeners() { - this.signer.on("session_event", (payload) => { - const { params } = payload; - const { event } = params; - if (event.name === "accountsChanged") { - this.accounts = this.parseAccounts(event.data); - this.events.emit("accountsChanged", this.accounts); - } else if (event.name === "chainChanged") { - this.setChainId(this.formatChainId(event.data)); + }; + const jumpToConnectingView = () => { + jumpTo(ViewRoutes.TRON_CONNECTING); + }; + disconnect2(); + clearTimeout(timerRef.current); + timerRef.current = setTimeout(() => { + if (isMobile()) { + if (wallet.isInstalled()) { + jumpToConnectingView(); + } else { + connect2({ + adapterName: wallet.adapterName + }); + } } else { - this.events.emit(event.name, event.data); + jumpToConnectingView(); } - this.events.emit("session_event", payload); - }); - this.signer.on("chainChanged", (chainId) => { - const chain = parseInt(chainId); - this.chainId = chain; - this.events.emit("chainChanged", toHexChainId(this.chainId)); - this.persist(); - }); - this.signer.on("session_update", (payload) => { - this.events.emit("session_update", payload); - }); - this.signer.on("session_delete", (payload) => { - this.reset(); - this.events.emit("session_delete", payload); - this.events.emit("disconnect", { - ...tr$2("USER_DISCONNECTED"), - data: payload.topic, - name: "USER_DISCONNECTED" - }); - }); - this.signer.on("display_uri", (uri) => { - openTgMiniWalletForConnect(uri, this.rpc.returnUrl, this.rpc.debug); - }); - } - switchEthereumChain(chainId) { - this.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId: chainId.toString(16) }] - }); - } - isCompatibleChainId(chainId) { - return typeof chainId === "string" ? chainId.startsWith(`${this.namespace}:`) : false; + }, 300); + }; + return null; +} +function SetWalletClickRef(props) { + const { wallet, clickRef } = props; + if (wallet.walletType === "evm") { + return /* @__PURE__ */ jsxRuntimeExports.jsx(SetEvmWalletClickRef, { clickRef }); } - formatChainId(chainId) { - return `${this.namespace}:${chainId}`; + if (wallet.walletType === "solana") { + return /* @__PURE__ */ jsxRuntimeExports.jsx(SetSolanaWalletClickRef, { clickRef }); } - parseChainId(chainId) { - return Number(chainId.split(":")[1]); + if (wallet.walletType === "tron") { + return /* @__PURE__ */ jsxRuntimeExports.jsx(SetTronWalletClickRef, { clickRef }); } - setChainIds(chains) { - const compatible = chains.filter((x3) => this.isCompatibleChainId(x3)); - const chainIds = compatible.map((c2) => this.parseChainId(c2)); - if (chainIds.length) { - this.chainId = chainIds[0] ?? 1; - this.events.emit("chainChanged", toHexChainId(this.chainId)); - this.persist(); +} +function WalletOption$1(props) { + const { wallet } = props; + const clickRef = reactExports.useRef(); + const component = useWalletRender({ + wallet, + layout: "grid", + clickRef, + defaultRender: ({ wallet: wallet2, onClick }) => { + const { isDisabled, name: name2, logo } = wallet2; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-wallet-option-wrapper", clsWalletOptionWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsxs( + Button, + { + className: cx( + "wk-wallet-option", + clsWalletOption$1, + isDisabled ? clsWalletOptionDisabled$1 : void 0 + ), + onClick: isDisabled ? void 0 : onClick, + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-wallet-option-logo", clsWalletOptionIcon$1), children: logo }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: cx("wk-wallet-option-name", clsWalletOptionName$1), children: name2 }) + ] + } + ) }); } - } - setChainId(chain) { - if (this.isCompatibleChainId(chain)) { - const chainId = this.parseChainId(chain); - this.chainId = chainId; - this.switchEthereumChain(chainId); + }); + return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(SetWalletClickRef, { wallet, clickRef }), + component + ] }); +} +var clsNoWalletButton = "wk_cvot8n1"; +var clsWallets$1 = "wk_cvot8n0"; +function GridLayout(props) { + const { visibleWallets } = props; + const { options } = useWalletKit(); + return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: cx("wk-wallets", clsWallets$1), "data-layout": "grid", children: visibleWallets == null ? void 0 : visibleWallets.map((w2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(WalletOption$1, { wallet: w2 }, index2)) }), + !options.hideNoWalletCTA && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs( + Button, + { + as: "a", + className: cx("wk-nowallet-button", clsNoWalletButton), + href: options.walletDownloadUrl, + target: "_blank", + rel: "noopener", + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(WalletIcon, {}), + "I don’t have a wallet" + ] + } + ) }) + ] }); +} +var clsNoWalletLink = "wk_1lg2shr1"; +var clsWallets = "wk_1lg2shr0"; +var clsWalletOption = "wk_713zwr0"; +var clsWalletOptionDisabled = "wk_713zwr3"; +var clsWalletOptionIcon = "wk_713zwr2"; +var clsWalletOptionName = "wk_713zwr1"; +function WalletOption(props) { + const { wallet } = props; + const clickRef = reactExports.useRef(); + const component = useWalletRender({ + wallet, + layout: "list", + clickRef, + defaultRender: ({ wallet: wallet2, onClick }) => { + const { isDisabled, name: name2, logo } = wallet2; + return /* @__PURE__ */ jsxRuntimeExports.jsxs( + Button, + { + className: cx( + "wk-wallet-option", + clsWalletOption, + isDisabled ? clsWalletOptionDisabled : void 0 + ), + onClick: isDisabled ? void 0 : onClick, + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: cx("wk-wallet-option-name", clsWalletOptionName), children: name2 }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-wallet-option-logo", clsWalletOptionIcon), children: logo }) + ] + } + ); } - } - parseAccountId(account) { - const [namespace, reference, address2] = account.split(":"); - const chainId = `${namespace}:${reference}`; - return { chainId, address: address2 ?? "" }; - } - setAccounts(accounts2) { - this.accounts = accounts2.filter((x3) => this.parseChainId(this.parseAccountId(x3).chainId) === this.chainId).map((x3) => this.parseAccountId(x3).address); - this.events.emit("accountsChanged", this.accounts); - } - getRpcConfig(opts) { - const requiredChains = (opts == null ? void 0 : opts.chains) ?? []; - const optionalChains = (opts == null ? void 0 : opts.optionalChains) ?? []; - const allChains = requiredChains.concat(optionalChains); - if (!allChains.length) - throw new Error("No chains specified in either `chains` or `optionalChains`"); - const requiredMethods = requiredChains.length ? (opts == null ? void 0 : opts.methods) || REQUIRED_METHODS : []; - const requiredEvents = requiredChains.length ? (opts == null ? void 0 : opts.events) || REQUIRED_EVENTS : []; - const optionalMethods = (opts == null ? void 0 : opts.optionalMethods) || []; - const optionalEvents = (opts == null ? void 0 : opts.optionalEvents) || []; - const rpcMap = (opts == null ? void 0 : opts.rpcMap) || this.buildRpcMap(allChains, opts.projectId); - const qrModalOptions = (opts == null ? void 0 : opts.qrModalOptions) || void 0; - return { - chains: requiredChains == null ? void 0 : requiredChains.map((chain) => this.formatChainId(chain)), - optionalChains: optionalChains.map((chain) => this.formatChainId(chain)), - methods: requiredMethods, - events: requiredEvents, - optionalMethods, - optionalEvents, - rpcMap, - showQrModal: Boolean(opts == null ? void 0 : opts.showQrModal), - qrModalOptions, - projectId: opts.projectId, - metadata: opts.metadata, - returnUrl: opts.returnUrl, - debug: opts.debug - }; - } - buildRpcMap(chains, projectId) { - const map = {}; - chains.forEach((chain) => { - map[chain] = this.getRpcUrl(chain, projectId); - }); - return map; - } - async initialize(opts) { - this.rpc = this.getRpcConfig(opts); - this.chainId = this.rpc.chains.length ? getEthereumChainId(this.rpc.chains) : getEthereumChainId(this.rpc.optionalChains); - this.signer = await Ev.init({ - projectId: this.rpc.projectId, - metadata: this.rpc.metadata, - disableProviderPing: opts.disableProviderPing, - relayUrl: opts.relayUrl, - storageOptions: opts.storageOptions + }); + return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(SetWalletClickRef, { wallet, clickRef }), + component + ] }); +} +function ListLayout(props) { + const { visibleWallets } = props; + const { options } = useWalletKit(); + return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: cx("wk-wallets", clsWallets), "data-layout": "list", children: visibleWallets == null ? void 0 : visibleWallets.map((w2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(WalletOption, { wallet: w2 }, index2)) }), + !options.hideNoWalletCTA && /* @__PURE__ */ jsxRuntimeExports.jsx(ModalFooter, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs( + Link, + { + className: cx("wk-nowallet-link", clsNoWalletLink), + href: options.walletDownloadUrl, + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(WalletIcon, {}), + "I don’t have a wallet" + ] + } + ) }) + ] }); +} +var clsDisclaimer = "wk_zqrn660"; +function EvmHomeViewWalletConnectUriProvider() { + const { wcUri } = useWalletConnectUri({ + refreshUriOnError: false + }); + setEvmGlobalData({ + homeViewWalletConnectUri: wcUri + }); + return null; +} +function HomeView() { + const { wallets: wallets2, options } = useWalletKit(); + const { isMobileLayout } = useResponsive(); + const visibleWallets = reactExports.useMemo(() => { + const visibleWallets2 = wallets2.filter((wallet) => { + const isVisible = wallet.isVisible !== false && (isBrowser() && isAndroid() && wallet.platforms.includes("browser-android") || isBrowser() && isIOS() && wallet.platforms.includes("browser-ios") || isBrowser() && isPC() && wallet.platforms.includes("browser-pc") || isTMA() && isAndroid() && wallet.platforms.includes("tg-android") || isTMA() && isIOS() && wallet.platforms.includes("tg-ios") || isTMA() && isPC() && wallet.platforms.includes("tg-pc")); + return isVisible; }); - this.registerEventListeners(); - await this.loadPersistedSession(); - } - loadConnectOpts(opts) { - if (!opts) - return; - const { chains, optionalChains, rpcMap } = opts; - if (chains && Er$2(chains)) { - this.rpc.chains = chains.map((chain) => this.formatChainId(chain)); - chains.forEach((chain) => { - this.rpc.rpcMap[chain] = (rpcMap == null ? void 0 : rpcMap[chain]) || this.getRpcUrl(chain); - }); - } - if (optionalChains && Er$2(optionalChains)) { - this.rpc.optionalChains = []; - this.rpc.optionalChains = optionalChains == null ? void 0 : optionalChains.map((chain) => this.formatChainId(chain)); - optionalChains.forEach((chain) => { - this.rpc.rpcMap[chain] = (rpcMap == null ? void 0 : rpcMap[chain]) || this.getRpcUrl(chain); - }); - } - } - getRpcUrl(chainId, projectId) { - var _a3; - const providedRpc = (_a3 = this.rpc.rpcMap) == null ? void 0 : _a3[chainId]; - return providedRpc || `${RPC_URL}?chainId=eip155:${chainId}&projectId=${projectId || this.rpc.projectId}`; - } - async loadPersistedSession() { - if (!this.session) - return; - try { - const chainId = await this.signer.client.core.storage.getItem(`${STORAGE_KEY}/chainId`); - const namespace = this.session.namespaces[`${this.namespace}:${chainId}`] ? this.session.namespaces[`${this.namespace}:${chainId}`] : this.session.namespaces[this.namespace]; - this.setChainIds(chainId ? [this.formatChainId(chainId)] : namespace == null ? void 0 : namespace.accounts); - this.setAccounts(namespace == null ? void 0 : namespace.accounts); - } catch (error) { - this.signer.logger.error("Failed to load persisted session, clearing state..."); - this.signer.logger.error(error); - await this.disconnect().catch((error2) => this.signer.logger.warn(error2)); - } - } - reset() { - this.chainId = 1; - this.accounts = []; + return visibleWallets2; + }, [wallets2]); + const useGridLayout = visibleWallets.length >= options.gridLayoutThreshold || isMobileLayout && options.useGridLayoutOnMobile; + const needPreCreateWcUri = isTMA() && isMobile(); + return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(ModalHeader, { children: options.title }), + options.disclaimer && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-disclaimer", clsDisclaimer), children: options.disclaimer }), + useGridLayout ? /* @__PURE__ */ jsxRuntimeExports.jsx(GridLayout, { visibleWallets }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ListLayout, { visibleWallets }), + needPreCreateWcUri && /* @__PURE__ */ jsxRuntimeExports.jsx(EvmHomeViewWalletConnectUriProvider, {}) + ] }); +} +function tronCommonErrorHandler(props) { + const { log: log2, handler, error } = props; + if (error) { + const description2 = error.message || error.name; + log2("[WalletError]", error); + handler == null ? void 0 : handler(error, description2); } - persist() { - if (!this.session) +} +function TronConnectingView() { + const { log: log2, selectedWallet, options, tronConfig } = useWalletKit(); + const [status, setStatus] = reactExports.useState( + selectedWallet.isInstalled() ? CONNECT_STATUS.CONNECTING : CONNECT_STATUS.UNAVAILABLE + ); + const { connect: connect2, isConnected } = useTronConnect(); + reactExports.useEffect(() => { + const onError = (error) => { + let message2 = ""; + if (error.message.includes("rejected")) { + message2 = "User rejected the request"; + setStatus(CONNECT_STATUS.REJECTED); + } else { + setStatus(CONNECT_STATUS.FAILED); + } + tronCommonErrorHandler({ + log: log2, + handler: options.onError, + error: { + message: message2 + } + }); + }; + EventEmitter.on(EventEmitter.TRON_WALLET_ERROR, onError); + return () => { + EventEmitter.off(EventEmitter.TRON_WALLET_ERROR, onError); + }; + }, [options.onError, log2]); + const runConnect = reactExports.useCallback(async () => { + if (!selectedWallet.isInstalled()) return; - this.signer.client.core.storage.setItem(`${STORAGE_KEY}/chainId`, this.chainId); - } - parseAccounts(payload) { - if (typeof payload === "string" || payload instanceof String) { - return [this.parseAccount(payload)]; + setStatus(CONNECT_STATUS.CONNECTING); + connect2({ + adapterName: selectedWallet.adapterName, + chainId: tronConfig == null ? void 0 : tronConfig.initialChainId + }); + }, [connect2, selectedWallet, tronConfig == null ? void 0 : tronConfig.initialChainId]); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + TemplateConnectingView, + { + status, + runConnect, + onTryAgain: runConnect, + wallet: selectedWallet, + isConnected } - return payload.map((account) => this.parseAccount(account)); - } + ); } -const EthereumProvider$1 = EthereumProvider; -codexFieldWallet$1.type = "codexFieldWallet"; -function codexFieldWallet$1(parameters) { - const isNewChainsStale = parameters.isNewChainsStale ?? true; - let provider_; - let providerPromise; - const NAMESPACE = "eip155"; - let accountsChanged; - let chainChanged; - let connect2; - let displayUri; - let sessionDelete; - let disconnect2; - return createConnector((config2) => ({ - id: "codex-field-wallet", - name: "CodexFieldWallet", - type: codexFieldWallet$1.type, - async setup() { - const provider = await this.getProvider().catch(() => null); - if (!provider) - return; - if (!connect2) { - connect2 = this.onConnect.bind(this); - provider.on("connect", connect2); - } - if (!sessionDelete) { - sessionDelete = this.onSessionDelete.bind(this); - provider.on("session_delete", sessionDelete); +var ViewRoutes = /* @__PURE__ */ ((ViewRoutes2) => { + ViewRoutes2["HOME"] = "HOME"; + ViewRoutes2["EVM_CONNECTING"] = "EVM_CONNECTING"; + ViewRoutes2["EVM_QRCODE"] = "EVM_QRCODE"; + ViewRoutes2["EVM_URI_CONNECTING"] = "EVM_URI_CONNECTING"; + ViewRoutes2["SOLANA_CONNECTING"] = "SOLANA_CONNECTING"; + ViewRoutes2["SOLANA_QRCODE"] = "SOLANA_QRCODE"; + ViewRoutes2["TRON_CONNECTING"] = "TRON_CONNECTING"; + return ViewRoutes2; +})(ViewRoutes || {}); +function RouteProvider(props) { + const { children } = props; + const [route, setRoute] = reactExports.useState(""); + const { current: history } = reactExports.useRef([]); + const view = reactExports.useMemo(() => { + switch (route) { + case "HOME": + return /* @__PURE__ */ jsxRuntimeExports.jsx(HomeView, {}); + case "EVM_CONNECTING": + return /* @__PURE__ */ jsxRuntimeExports.jsx(EvmConnectingView, {}); + case "EVM_QRCODE": + return /* @__PURE__ */ jsxRuntimeExports.jsx(EvmQRCodeView, {}); + case "EVM_URI_CONNECTING": + return /* @__PURE__ */ jsxRuntimeExports.jsx(EvmUriConnectingView, {}); + case "SOLANA_CONNECTING": + return /* @__PURE__ */ jsxRuntimeExports.jsx(SolanaConnectingView, {}); + case "SOLANA_QRCODE": + return /* @__PURE__ */ jsxRuntimeExports.jsx(SolanaQRCodeView, {}); + case "TRON_CONNECTING": + return /* @__PURE__ */ jsxRuntimeExports.jsx(TronConnectingView, {}); + } + return null; + }, [route]); + const back = reactExports.useCallback(() => { + history.pop(); + const nextRoute = history[history.length - 1]; + if (nextRoute) { + setRoute(nextRoute); + } + }, [history]); + const push = reactExports.useCallback( + (nextRoute) => { + if (history[history.length - 1] !== nextRoute) { + history.push(nextRoute); + setRoute(nextRoute); } }, - async connect({ chainId, ...rest } = {}) { - var _a3, _b2; - try { - const provider = await this.getProvider(); - if (!provider) - throw new ProviderNotFoundError(); - if (!displayUri) { - displayUri = this.onDisplayUri; - provider.on("display_uri", displayUri); - } - let targetChainId = chainId; - if (!targetChainId) { - const state = await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem("state")) ?? {}; - const isChainSupported = config2.chains.some((x3) => x3.id === state.chainId); - if (isChainSupported) - targetChainId = state.chainId; - else - targetChainId = (_b2 = config2.chains[0]) == null ? void 0 : _b2.id; - } - if (!targetChainId) - throw new Error("No chains found on connector."); - const isChainsStale = await this.isChainsStale(); - if (provider.session && isChainsStale) - await provider.disconnect(); - if (!provider.session || isChainsStale) { - const optionalChains = config2.chains.filter((chain) => chain.id !== targetChainId).map((optionalChain) => optionalChain.id); - await provider.connect({ - optionalChains: [targetChainId, ...optionalChains], - ..."pairingTopic" in rest ? { pairingTopic: rest.pairingTopic } : {} - }); - this.setRequestedChainsIds(config2.chains.map((x3) => x3.id)); - } - const accounts2 = (await provider.enable()).map((x3) => getAddress$2(x3)); - const currentChainId = await this.getChainId(); - if (displayUri) { - provider.removeListener("display_uri", displayUri); - displayUri = void 0; - } - if (connect2) { - provider.removeListener("connect", connect2); - connect2 = void 0; - } - if (!accountsChanged) { - accountsChanged = this.onAccountsChanged.bind(this); - provider.on("accountsChanged", accountsChanged); - } - if (!chainChanged) { - chainChanged = this.onChainChanged.bind(this); - provider.on("chainChanged", chainChanged); - } - if (!disconnect2) { - disconnect2 = this.onDisconnect.bind(this); - provider.on("disconnect", disconnect2); - } - if (!sessionDelete) { - sessionDelete = this.onSessionDelete.bind(this); - provider.on("session_delete", sessionDelete); - } - return { accounts: accounts2, chainId: currentChainId }; - } catch (error) { - if (/(user rejected|connection request reset)/i.test(error == null ? void 0 : error.message)) { - throw new UserRejectedRequestError(error); - } - throw error; + [history] + ); + const replace = reactExports.useCallback( + (nextRoute) => { + if (history[history.length - 1] !== nextRoute) { + history[history.length - 1] = nextRoute; + setRoute(nextRoute); } }, - async disconnect() { - const provider = await this.getProvider(); - try { - await (provider == null ? void 0 : provider.disconnect()); - } catch (error) { - if (!/No matching key/i.test(error.message)) - throw error; - } finally { - if (chainChanged) { - provider == null ? void 0 : provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; - } - if (disconnect2) { - provider == null ? void 0 : provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; + [history] + ); + const reset = reactExports.useCallback(() => { + history.length = 0; + }, [history]); + const value = reactExports.useMemo(() => { + return { + route, + view, + back, + push, + replace, + reset, + history + }; + }, [back, history, view, push, replace, reset, route]); + return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteContext.Provider, { value, children }); +} +function useDisclosure() { + const [isOpen, setIsOpen] = reactExports.useState(false); + const onOpen = reactExports.useCallback(() => { + setIsOpen(true); + }, []); + const onClose = reactExports.useCallback(() => { + setIsOpen(false); + }, []); + return { + isOpen, + onOpen, + onClose + }; +} +function ConnectModalProvider(props) { + const { children } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(WithRouter, { children }) }); +} +function WithRouter(props) { + const { children } = props; + const { setAction, evmConfig, tronConfig, options } = useWalletKit(); + const { isOpen, onClose, onOpen } = useDisclosure(); + const router = useRouter(); + const value = reactExports.useMemo(() => { + return { + isOpen, + onClose() { + onClose(); + setTimeout(() => { + router.reset(); + }, 300); + }, + onOpen(params = {}) { + var _a3, _b2; + router.push(params.viewRoute ?? ViewRoutes.HOME); + setAction(params.action); + if (evmConfig && params.initialChainId) { + evmConfig.initialChainId = params.initialChainId; } - if (!connect2) { - connect2 = this.onConnect.bind(this); - provider == null ? void 0 : provider.on("connect", connect2); + if (evmConfig && ((_a3 = params.evmConfig) == null ? void 0 : _a3.initialChainId)) { + evmConfig.initialChainId = params.evmConfig.initialChainId; } - if (accountsChanged) { - provider == null ? void 0 : provider.removeListener("accountsChanged", accountsChanged); - accountsChanged = void 0; + if (tronConfig && ((_b2 = params.tronConfig) == null ? void 0 : _b2.initialChainId)) { + tronConfig.initialChainId = params.tronConfig.initialChainId; } - if (sessionDelete) { - provider == null ? void 0 : provider.removeListener("session_delete", sessionDelete); - sessionDelete = void 0; + if (params.onConnected) { + options.onConnected = params.onConnected; } - this.setRequestedChainsIds([]); - } - }, - async getAccounts() { - const provider = await this.getProvider(); - return provider.accounts.map((x3) => getAddress$2(x3)); - }, - async getProvider({ chainId } = {}) { - var _a3; - async function initProvider() { - const optionalChains = config2.chains.map((x3) => x3.id); - if (!optionalChains.length) - return; - return await EthereumProvider$1.init({ - ...parameters, - disableProviderPing: true, - optionalChains, - projectId: parameters.projectId, - rpcMap: Object.fromEntries(config2.chains.map((chain) => { - const [url] = extractRpcUrls({ - chain, - transports: config2.transports - }); - return [chain.id, url]; - })), - showQrModal: parameters.showQrModal ?? true, - returnUrl: parameters.returnUrl, - debug: parameters.debug - }); - } - if (!provider_) { - if (!providerPromise) - providerPromise = initProvider(); - provider_ = await providerPromise; - provider_ == null ? void 0 : provider_.events.setMaxListeners(Number.POSITIVE_INFINITY); + onOpen(); } - if (chainId) - await ((_a3 = this.switchChain) == null ? void 0 : _a3.call(this, { chainId })); - return provider_; - }, - async getChainId() { - const provider = await this.getProvider(); - return provider.chainId; - }, - async isAuthorized() { - try { - const [accounts2, provider] = await Promise.all([ - this.getAccounts(), - this.getProvider() - ]); - if (!accounts2.length) - return false; - const isChainsStale = await this.isChainsStale(); - if (isChainsStale && provider.session) { - await provider.disconnect().catch(() => { - }); - return false; - } - return true; - } catch { - return false; + }; + }, [evmConfig, isOpen, onClose, onOpen, options, router, setAction, tronConfig]); + return /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectModalContext.Provider, { value, children }); +} +const Portal = (props) => { + const { children } = props; + const portal = reactExports.useRef(); + const [, forceUpdate] = reactExports.useState({}); + reactExports.useEffect(() => { + const host = document.body; + portal.current = document.createElement("div"); + portal.current.setAttribute("class", "wk-portal"); + host.appendChild(portal.current); + forceUpdate({}); + const portalNode = portal.current; + return () => { + if (host.contains(portalNode)) { + host.removeChild(portalNode); } - }, - async switchChain({ addEthereumChainParameter, chainId }) { - var _a3, _b2, _c2; - const provider = await this.getProvider(); - if (!provider) - throw new ProviderNotFoundError(); - const chain = config2.chains.find((x3) => x3.id === chainId); - if (!chain) - throw new SwitchChainError(new ChainNotConfiguredError()); - try { - await Promise.all([ - new Promise((resolve) => { - const listener = ({ chainId: currentChainId }) => { - if (currentChainId === chainId) { - config2.emitter.off("change", listener); - resolve(); - } - }; - config2.emitter.on("change", listener); - }), - provider.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId: numberToHex(chainId) }] - }) - ]); - const requestedChains = await this.getRequestedChainsIds(); - this.setRequestedChainsIds([...requestedChains, chainId]); - return chain; - } catch (err) { - const error = err; - if (/(user rejected)/i.test(error.message)) - throw new UserRejectedRequestError(error); - try { - let blockExplorerUrls; - if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) - blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; - else - blockExplorerUrls = ((_a3 = chain.blockExplorers) == null ? void 0 : _a3.default.url) ? [(_b2 = chain.blockExplorers) == null ? void 0 : _b2.default.url] : []; - let rpcUrls; - if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) - rpcUrls = addEthereumChainParameter.rpcUrls; - else - rpcUrls = [...chain.rpcUrls.default.http]; - const addEthereumChain = { - blockExplorerUrls, - chainId: numberToHex(chainId), - chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, - iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, - nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, - rpcUrls - }; - await provider.request({ - method: "wallet_addEthereumChain", - params: [addEthereumChain] - }); - const requestedChains = await this.getRequestedChainsIds(); - this.setRequestedChainsIds([...requestedChains, chainId]); - return chain; - } catch (error2) { - throw new UserRejectedRequestError(error2); - } + }; + }, []); + return portal.current ? reactDomExports.createPortal(children, portal.current) : null; +}; +Portal.displayName = "Portal"; +var clsContainer = "wk_1sntu031"; +var clsDescWrapper = "wk_1sntu033"; +var clsIconWrapper = "wk_1sntu032"; +var clsToastRoot = "wk_1sntu030"; +const ErrorIcon = (props) => { + const errorColor = cssVar("error"); + return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", ...props, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M18.3333 10.0001C18.3333 14.6025 14.6024 18.3334 9.99999 18.3334C5.39762 18.3334 1.66666 14.6025 1.66666 10.0001C1.66666 5.39771 5.39762 1.66675 9.99999 1.66675C14.6024 1.66675 18.3333 5.39771 18.3333 10.0001Z", + fill: errorColor } - }, - onAccountsChanged(accounts2) { - if (accounts2.length === 0) - this.onDisconnect(); - else - config2.emitter.emit("change", { - accounts: accounts2.map((x3) => getAddress$2(x3)) - }); - }, - onChainChanged(chain) { - const chainId = Number(chain); - config2.emitter.emit("change", { chainId }); - }, - async onConnect(connectInfo) { - const chainId = Number(connectInfo.chainId); - const accounts2 = await this.getAccounts(); - config2.emitter.emit("connect", { accounts: accounts2, chainId }); - }, - async onDisconnect(_error) { - this.setRequestedChainsIds([]); - config2.emitter.emit("disconnect"); - const provider = await this.getProvider(); - if (accountsChanged) { - provider.removeListener("accountsChanged", accountsChanged); - accountsChanged = void 0; + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M13.5503 7.41394C13.8166 7.14767 13.8166 6.71597 13.5503 6.4497C13.284 6.18343 12.8523 6.18343 12.5861 6.4497L10 8.90372L7.41394 6.4497C7.14767 6.18343 6.71597 6.18343 6.4497 6.4497C6.18343 6.71597 6.18343 7.14767 6.4497 7.41394L8.90372 10L6.4497 12.5861C6.18343 12.8523 6.18343 13.284 6.4497 13.5503C6.71597 13.8166 7.14767 13.8166 7.41394 13.5503L10 11.0963L12.5861 13.5503C12.8523 13.8166 13.284 13.8166 13.5503 13.5503C13.8166 13.284 13.8166 12.8523 13.5503 12.5861L11.0963 10L13.5503 7.41394Z", + fill: "white" } - if (chainChanged) { - provider.removeListener("chainChanged", chainChanged); - chainChanged = void 0; + ) + ] }); +}; +const InfoIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", ...props, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M18.3333 10.0001C18.3333 14.6025 14.6024 18.3334 9.99999 18.3334C5.39762 18.3334 1.66666 14.6025 1.66666 10.0001C1.66666 5.39771 5.39762 1.66675 9.99999 1.66675C14.6024 1.66675 18.3333 5.39771 18.3333 10.0001Z", + fill: "#5F8BFF" } - if (disconnect2) { - provider.removeListener("disconnect", disconnect2); - disconnect2 = void 0; + ), + /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "10", cy: "5.41675", r: "1.25", fill: "white" }), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + d: "M10.579 7.55143L7.87065 7.8755C7.65964 7.89895 7.5 8.07731 7.5 8.28962V8.75002C7.5 8.98014 7.68931 9.15814 7.91392 9.20817C8.47131 9.33231 8.95833 9.73515 8.95833 10.4167V12.9167C8.95833 13.5982 8.47131 14.0011 7.91392 14.1252C7.68931 14.1752 7.5 14.3532 7.5 14.5834V15C7.5 15.2301 7.68655 15.4167 7.91667 15.4167H12.0833C12.3135 15.4167 12.5 15.2301 12.5 15V14.5834C12.5 14.3532 12.3107 14.1752 12.0861 14.1252C11.5287 14.0011 11.0417 13.5982 11.0417 12.9167V7.96525C11.0417 7.71691 10.8258 7.52401 10.579 7.55143Z", + fill: "white" } - if (sessionDelete) { - provider.removeListener("session_delete", sessionDelete); - sessionDelete = void 0; + ) + ] }); +}; +const iconMap = { + info: /* @__PURE__ */ jsxRuntimeExports.jsx(InfoIcon, {}), + error: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorIcon, {}) +}; +function ToastComponent(props) { + const { variant = "info", description: description2, duration, toastId } = props; + const [show, setShow] = reactExports.useState(true); + const [delay2, setDelay] = reactExports.useState(duration); + reactExports.useEffect(() => { + if (delay2) { + const timer2 = setTimeout(() => { + setShow(false); + }, delay2); + return () => { + clearTimeout(timer2); + }; + } + }, [delay2]); + const onExit = () => { + ToastManager.remove(toastId); + }; + const onMouseEnter = () => { + setDelay(void 0); + }; + const onMouseLeave = () => { + setDelay(duration); + }; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Transition, { in: show, variant: "toast-slide", onExit, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: "wk-toast", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: clsContainer, onMouseEnter, onMouseLeave, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsIconWrapper, children: iconMap[variant] }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: clsDescWrapper, children: description2 }) + ] }) }) }); +} +const ToastProvider = () => { + const [toastList, setToastList] = reactExports.useState([]); + reactExports.useEffect(() => { + const update5 = (newList) => { + setToastList(newList); + }; + ToastManager.subscribe(update5); + return () => { + ToastManager.unsubscribe(update5); + }; + }, []); + return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: toastList.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-toast-container", clsToastRoot), children: toastList.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(ToastComponent, { ...item }, item.toastId)) }) }) }); +}; +ToastProvider.displayName = "ToastProvider"; +const ProfileModalContext = W$2.createContext({}); +function ProfileModalProvider(props) { + const { children } = props; + const { isOpen, onClose, onOpen } = useDisclosure(); + const value = reactExports.useMemo(() => { + return { + isOpen, + onClose, + onOpen + }; + }, [isOpen, onClose, onOpen]); + return /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileModalContext.Provider, { value, children }); +} +function TronWalletProvider(props) { + const { children } = props; + const { tronConfig } = useWalletKit(); + reactExports.useMemo(() => { + try { + if (typeof window !== "undefined" && !(tronConfig == null ? void 0 : tronConfig.autoConnect)) { + window.localStorage.removeItem("tronAdapterName"); } - if (!connect2) { - connect2 = this.onConnect.bind(this); - provider.on("connect", connect2); + } catch (err) { + console.log(err); + } + }, [tronConfig == null ? void 0 : tronConfig.autoConnect]); + const onError = reactExports.useCallback((error) => { + EventEmitter.emit(EventEmitter.TRON_WALLET_ERROR, error); + }, []); + if (!tronConfig) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }); + } + return /* @__PURE__ */ jsxRuntimeExports.jsx( + WalletProvider, + { + adapters: tronConfig.adapters, + autoConnect: false, + onError, + children + } + ); +} +function WalletKitProvider(props) { + const { config: config2, children, theme, mode: mode2, debugMode = false } = props; + reactExports.useMemo(() => { + global.Buffer = global.Buffer || buffer.Buffer; + }, []); + const finalConfig = reactExports.useMemo(() => { + var _a3, _b2, _c2; + const finalConfig2 = getDefaultConfig(config2); + const wallets22 = []; + const evmWallets = (_a3 = finalConfig2.evmConfig) == null ? void 0 : _a3.wallets; + const solanaWallets = (_b2 = finalConfig2.solanaConfig) == null ? void 0 : _b2.wallets; + const tronWallets = (_c2 = finalConfig2.tronConfig) == null ? void 0 : _c2.wallets; + if (evmWallets) + wallets22.push(...evmWallets); + if (solanaWallets) + wallets22.push(...solanaWallets); + if (tronWallets) + wallets22.push(...tronWallets); + return { + ...finalConfig2, + wallets: wallets22 + }; + }, [config2]); + const [action, setAction] = reactExports.useState(); + const [selectedWallet, setSelectedWallet] = reactExports.useState({}); + const [wallets2, setWallets] = reactExports.useState(finalConfig.wallets); + const value = reactExports.useMemo(() => { + return { + ...finalConfig, + log: debugMode ? console.log : () => void 0, + action, + setAction, + selectedWallet, + setSelectedWallet, + wallets: wallets2, + setWallets + }; + }, [action, debugMode, finalConfig, selectedWallet, wallets2]); + return /* @__PURE__ */ jsxRuntimeExports.jsx(WalletKitContext.Provider, { value, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ThemeProvider, { mode: mode2, theme, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(ToastProvider, {}), + /* @__PURE__ */ jsxRuntimeExports.jsx(EvmWalletProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SolanaWalletProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TronWalletProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectModalProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileModalProvider, { children }) }) }) }) }) + ] }) }); +} +var clsModalContent = "wk_1kzf8pa0"; +function ModalContent(props) { + const { className, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: cx("wk-modal-content", clsModalContent, className), ...restProps }); +} +function useKeyDown(props = {}) { + const { key: key2 = "Enter", enabled = true, handler } = props; + reactExports.useEffect(() => { + if (!enabled) { + return; + } + const onKeyDown = (e18) => { + if (e18.code === key2) { + handler == null ? void 0 : handler(); } + }; + window.addEventListener("keydown", onKeyDown); + return () => { + window.removeEventListener("keydown", onKeyDown); + }; + }, [enabled, handler, key2]); +} +function useScrollLock(isLocked = false) { + reactExports.useEffect(() => { + if (!isLocked) { + return; + } + const originalOverflow = document.documentElement.style.overflow; + document.documentElement.style.overflow = "hidden"; + return () => { + document.documentElement.style.overflow = originalOverflow; + }; + }, [isLocked]); +} +var clsModal$1 = "wk_3qg8ds0"; +var clsModalOverlay = "wk_3qg8ds1"; +function Modal(props) { + const { + className, + isOpen, + onClose, + children, + contentClassName, + closeOnEsc = true, + closeOnOverlayClick = true, + ...restProps + } = props; + useKeyDown({ + key: "Escape", + enabled: isOpen && closeOnEsc, + handler() { + onClose(); + } + }); + useScrollLock(isOpen); + const { isMobileLayout } = useResponsive(); + const { colorMode } = useTheme(); + return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Transition, { in: isOpen, variant: "fade", children: /* @__PURE__ */ jsxRuntimeExports.jsxs( + Box, + { + className: cx("wk-modal", clsModal$1, className), + style: { + colorScheme: colorMode + }, + ...restProps, + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + Box, + { + className: cx("wk-modal-overlay", clsModalOverlay), + onClick: () => closeOnOverlayClick && onClose() + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx(Transition, { in: isOpen, variant: isMobileLayout ? "modal-slide" : void 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalContent, { className: contentClassName, children }) }) + ] + } + ) }) }); +} +var clsIconButton = "wk_1bjpejd0"; +const IconButton = (props) => { + const { className, icon, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { className: cx("wk-icon-button", clsIconButton, className), ...restProps, children: icon }); +}; +IconButton.displayName = "IconButton"; +const BackIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "20", height: "20", viewBox: "0 0 40 40", fill: "currentColor", ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M24.5118 8.82165C25.1627 9.47253 25.1627 10.5278 24.5118 11.1787L15.6904 20.0002L24.5118 28.8217C25.1627 29.4725 25.1627 30.5278 24.5118 31.1787C23.861 31.8295 22.8057 31.8295 22.1548 31.1787L12.1548 21.1787C11.5039 20.5278 11.5039 19.4725 12.1548 18.8217L22.1548 8.82165C22.8057 8.17078 23.861 8.17078 24.5118 8.82165Z" + } + ) }); +}; +const CloseIcon = (props) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "20", height: "20", viewBox: "0 0 40 40", fill: "currentColor", ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + "path", + { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12.0119 9.51184C11.361 8.86097 10.3057 8.86097 9.65484 9.51184C9.00397 10.1627 9.00397 11.218 9.65484 11.8689L17.643 19.857L9.51187 27.9882C8.86099 28.639 8.86099 29.6943 9.51187 30.3452C10.1627 30.9961 11.218 30.9961 11.8689 30.3452L20 22.214L27.9218 30.1358C28.5726 30.7867 29.6279 30.7867 30.2788 30.1358C30.9297 29.4849 30.9297 28.4296 30.2788 27.7788L22.357 19.857L30.1358 12.0783C30.7867 11.4274 30.7867 10.3721 30.1358 9.72123C29.4849 9.07036 28.4297 9.07036 27.7788 9.72123L20 17.5L12.0119 9.51184Z" + } + ) }); +}; +var clsNavbar = "wk_1nzgcmu0"; +function Navbar(props) { + const { className, showBack, onBack, onClose, ...restProps } = props; + return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: cx("wk-navbar", clsNavbar, className), ...restProps, children: [ + showBack && /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { className: "wk-navbar-back-button", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(BackIcon, {}), onClick: onBack }), + /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { style: { flex: 1 } }), + /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { className: "wk-navbar-close-button", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseIcon, {}), onClick: onClose }) + ] }); +} +function ConnectModal() { + const { options } = useWalletKit(); + const { isOpen, onClose } = useConnectModal(); + const { view, history, back } = useRouter(); + const showBack = history.length > 1; + return /* @__PURE__ */ jsxRuntimeExports.jsxs( + Modal, + { + className: "wk-connect-modal", + isOpen, + onClose, + closeOnEsc: options == null ? void 0 : options.closeModalOnEsc, + closeOnOverlayClick: options == null ? void 0 : options.closeModalOnOverlayClick, + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, { showBack, onBack: back, onClose }), + view + ] + } + ); +} +const mainnet = /* @__PURE__ */ defineChain({ + id: 1, + name: "Ethereum", + nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, + rpcUrls: { + default: { + http: ["https://cloudflare-eth.com"] + } + }, + blockExplorers: { + default: { + name: "Etherscan", + url: "https://etherscan.io", + apiUrl: "https://api.etherscan.io/api" + } + }, + contracts: { + ensRegistry: { + address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" }, - onDisplayUri(uri) { - }, - onSessionDelete() { - this.onDisconnect(); - }, - getNamespaceChainsIds() { - var _a3, _b2, _c2; - if (!provider_) - return []; - const chainIds = (_c2 = (_b2 = (_a3 = provider_.session) == null ? void 0 : _a3.namespaces[NAMESPACE]) == null ? void 0 : _b2.accounts) == null ? void 0 : _c2.map((account) => Number.parseInt(account.split(":")[1] || "")); - return chainIds ?? []; - }, - async getRequestedChainsIds() { - var _a3; - return await ((_a3 = config2.storage) == null ? void 0 : _a3.getItem(this.requestedChainsStorageKey)) ?? []; - }, - /** - * Checks if the target chains match the chains that were - * initially requested by the connector for the WalletConnect session. - * If there is a mismatch, this means that the chains on the connector - * are considered stale, and need to be revalidated at a later point (via - * connection). - * - * There may be a scenario where a dapp adds a chain to the - * connector later on, however, this chain will not have been approved or rejected - * by the wallet. In this case, the chain is considered stale. - */ - async isChainsStale() { - if (!isNewChainsStale) - return false; - const connectorChains = config2.chains.map((x3) => x3.id); - const namespaceChains = this.getNamespaceChainsIds(); - if (namespaceChains.length && !namespaceChains.some((id2) => connectorChains.includes(id2))) - return false; - const requestedChains = await this.getRequestedChainsIds(); - return !connectorChains.every((id2) => requestedChains.includes(id2)); - }, - async setRequestedChainsIds(chains) { - var _a3; - await ((_a3 = config2.storage) == null ? void 0 : _a3.setItem(this.requestedChainsStorageKey, chains)); + ensUniversalResolver: { + address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67", + blockCreated: 19258213 }, - get requestedChainsStorageKey() { - return `${this.id}.requestedChains`; + multicall3: { + address: "0xca11bde05977b3631167028862be2a173976ca11", + blockCreated: 14353601 } - })); -} + } +}); function MetaMaskTransparentIcon(props) { return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", ...props, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -121131,7 +121349,7 @@ function coinbaseWallet(props = {}) { if (connectorOptions && "headlessMode" in connectorOptions && !connectorOptions.headlessMode) { return true; } - return !!getProvider$2(); + return !!getProvider$1(); }, getDeepLink() { return `https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`; @@ -121152,220 +121370,11 @@ function coinbaseWallet(props = {}) { ...restProps }; } -function getProvider$2() { +function getProvider$1() { if (typeof window === "undefined") return; return getEvmInjectedProvider("isCoinbaseWallet") || window.coinbaseWalletExtension; } -const CodexFieldWalletTransparentIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx(CodexFieldWalletIcon, { ...props }); -}; -const CodexFieldWalletIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs( - "svg", - { - width: "61", - height: "60", - viewBox: "0 0 61 60", - fill: "none", - xmlnsXlink: "http://www.w3.org/1999/xlink", - ...props, - children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M0.5 16C0.5 7.16344 7.66344 0 16.5 0H44.5C53.3366 0 60.5 7.16344 60.5 16V44C60.5 52.8366 53.3366 60 44.5 60H16.5C7.66344 60 0.5 52.8366 0.5 44V16Z", - fill: "#0051FE" - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "mask", - { - id: "mask0_32496_5645", - style: { - maskType: "alpha" - }, - maskUnits: "userSpaceOnUse", - x: "0", - y: "0", - width: "61", - height: "60", - children: /* @__PURE__ */ jsxRuntimeExports.jsx( - "path", - { - d: "M0.5 16C0.5 7.16344 7.66344 0 16.5 0H44.5C53.3366 0 60.5 7.16344 60.5 16V44C60.5 52.8366 53.3366 60 44.5 60H16.5C7.66344 60 0.5 52.8366 0.5 44V16Z", - fill: "#0051FE" - } - ) - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx("g", { mask: "url(#mask0_32496_5645)", children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "-1", y: "-1", width: "62", height: "62", fill: "url(#pattern0_32496_5645)" }) }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("defs", { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx( - "pattern", - { - id: "pattern0_32496_5645", - patternContentUnits: "objectBoundingBox", - width: "1", - height: "1", - children: /* @__PURE__ */ jsxRuntimeExports.jsx("use", { xlinkHref: "#image0_32496_5645", transform: "scale(0.002)" }) - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "image", - { - id: "image0_32496_5645", - width: "500", - height: "500", - xlinkHref: "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ZxZx3tMLAw2vTUnPAvS31ryKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAgoAoqAIqAIKAKKgCKgCCgCioAioAj8f4rA/wFAraGm797I1wAAAABJRU5ErkJggg==" - } - ) - ] }) - ] - } - ); -}; -const codexFieldWalletConfig = { - name: "CodexField Wallet", - logos: { - default: /* @__PURE__ */ jsxRuntimeExports.jsx(CodexFieldWalletIcon, {}), - transparent: /* @__PURE__ */ jsxRuntimeExports.jsx(CodexFieldWalletTransparentIcon, {}) - }, - downloadUrls: { - default: "https://t.me/codexfieldbot" - }, - spinnerColor: "#1098FC" -}; -function codexFieldWallet(props = {}) { - const { connectorOptions, ...restProps } = props; - return { - ...codexFieldWalletConfig, - id: "codexFieldWallet", - walletType: "evm", - showQRCode: false, - platforms: ["tg-android", "tg-ios", "tg-pc"], - isInstalled() { - return true; - }, - getDeepLink() { - return void 0; - }, - getUri(uri) { - return void 0; - }, - getCreateConnectorFn() { - const { walletConnectProjectId } = getEvmGlobalData(); - if (!walletConnectProjectId) { - throw new Error("walletConnectProjectId is required."); - } - return codexFieldWallet$1({ - projectId: walletConnectProjectId, - ...connectorOptions - }); - }, - ...restProps - }; -} -const UXUYWalletTransparentIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx(UXUYWalletIcon, { ...props }); -}; -const UXUYWalletIcon = (props) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs( - "svg", - { - width: "60", - height: "60", - viewBox: "0 0 60 60", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - xmlnsXlink: "http://www.w3.org/1999/xlink", - ...props, - children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: "60", height: "60", fill: "url(#pattern0_33502_70485)" }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("defs", { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx( - "pattern", - { - id: "pattern0_33502_70485", - patternContentUnits: "objectBoundingBox", - width: "1", - height: "1", - children: /* @__PURE__ */ jsxRuntimeExports.jsx("use", { xlinkHref: "#image0_33502_70485", transform: "scale(0.00833333)" }) - } - ), - /* @__PURE__ */ jsxRuntimeExports.jsx( - "image", - { - id: "image0_33502_70485", - width: "120", - height: "120", - xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABqnSURBVH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gqe8C5zqISH6soyPeTm+vQR1VC7Ka70wmD919ru8D5zt4cnLsB7FY9wDFNTejjqoDJUHIJTq463z7eAqxktF1gE5XJ7m6MERG1ZYL7eSpMuro0ee2cG9BHVUB5sILuYwAPGJqauyhWCzONdvbUMeKgcbcfaSWb/C6v2eCGUTyIFnX00IYbHhFUUcFwa4QW8uH7vB1FIqALvN5GCWvAqljaYhBjk24Y8yej8QykEhs2EEJij2oE10myAAGu0H3oUj4UtFng1T2UCzWuZ9ioFy0tA51tV0iMLG4B1h4bzJ5ZBDLQMkqUVhtU3/ZVpfo5UCOs5SyXbgvmUyWJFRcllKjROIKIjq/g07/FtTJvhCSJBT7TTPwUDL57CBKjLLXkinJDm02jDwHSjaRD5fQtV8J/HwhyRKqpgpZw6ZpDAH5wWIMJz/4f5E1kJHX3XWBAAAAAElFTkSuQmCC" - } - ) - ] }) - ] - } - ); -}; -const uxuyWalletConfig = { - name: "UXUY Wallet", - logos: { - default: /* @__PURE__ */ jsxRuntimeExports.jsx(UXUYWalletIcon, {}), - transparent: /* @__PURE__ */ jsxRuntimeExports.jsx(UXUYWalletTransparentIcon, {}) - }, - downloadUrls: { - default: "https://uxuy.com/" - }, - spinnerColor: "#1098FC" -}; -function uxuyWallet(props = {}) { - const { connectorOptions, ...restProps } = props; - return { - ...uxuyWalletConfig, - id: "uxuyWallet", - walletType: "evm", - showQRCode: false, - platforms: ["tg-android", "tg-ios", "tg-pc"], - isInstalled() { - return true; - }, - getDeepLink() { - return void 0; - }, - getUri(uri) { - return void 0; - }, - getCreateConnectorFn() { - return injected({ - shimDisconnect: true, - target: { - id: uxuyWallet().id, - name: uxuyWallet().name, - async provider() { - return await getProvider(); - } - }, - ...connectorOptions - }); - }, - ...restProps - }; -} -async function getProvider() { - if (typeof window === "undefined") - return; - try { - const { WalletTgSdk } = (await __vitePreload(() => import("./index.es-07d215c7.js"), true ? [] : void 0, import.meta.url)).default; - const { ethereum } = new WalletTgSdk({ - metaData: { - hostname: window.location.hostname - } - }); - return ethereum; - } catch (err) { - console.error(err); - } -} function defaultEvmConfig(params) { const { autoConnect = false, @@ -121486,7 +121495,7 @@ export { eM as E, decode$4 as F, G$1 as G, - et$1 as H, + et as H, ef$2 as I, rx as J, rD as K, @@ -121507,7 +121516,7 @@ export { getAugmentedNamespace as Z, _BN as _, ep as a, - bnExports$1 as a0, + bnExports as a0, safeBufferExports as a1, inherits_browserExports as a2, eventsExports as a3, @@ -121519,7 +121528,7 @@ export { Ev as a9, __vitePreload as aa, Nr$1 as ab, - browser$2 as ac, + browser as ac, ed as b, reactExports as c, eh as d, @@ -121535,7 +121544,7 @@ export { commonjsGlobal as n, eD as o, ej as p, - q$1 as q, + q$3 as q, rm as r, rl as s, rd as t, diff --git a/assets/index-2bfd47a8.js b/assets/index-9916bcea.js similarity index 99% rename from assets/index-2bfd47a8.js rename to assets/index-9916bcea.js index 0d2a5e9..74d5332 100644 --- a/assets/index-2bfd47a8.js +++ b/assets/index-9916bcea.js @@ -1,4 +1,4 @@ -import { O, e as ea$2, Q as Q$2, z as z$1, a as ep$1, r as rm, b as ed$1, m, W as W$1, c as reactExports, d as eh$1, f as createRoot, g as rP, h as rT, i as rj, j as rC, k as getDefaultExportFromCjs, l as rh, _ as _BN, n as commonjsGlobal, o as eD, p as ej, q as q$1, s as rl, t as rd, u as rp, v as r_, w as rA, x as rS, y as rs, A as W$2, B as rN, C as rc, D as rf, G as G$1, E as eM, F as decode, H as et$1, I as ef$1, J as rx, K as rD, L as ey$1, M as ev$1, N as ee$1, P as eC } from "./index-29dd1816.js"; +import { O, e as ea$2, Q as Q$2, z as z$1, a as ep$1, r as rm, b as ed$1, m, W as W$1, c as reactExports, d as eh$1, f as createRoot, g as rP, h as rT, i as rj, j as rC, k as getDefaultExportFromCjs, l as rh, _ as _BN, n as commonjsGlobal, o as eD, p as ej, q as q$1, s as rl, t as rd, u as rp, v as r_, w as rA, x as rS, y as rs, A as W$2, B as rN, C as rc, D as rf, G as G$1, E as eM, F as decode, H as et$1, I as ef$1, J as rx, K as rD, L as ey$1, M as ev$1, N as ee$1, P as eC } from "./index-8ce158e3.js"; function e$6(e2, t3, r2, n11, i2, o2, s2) { try { var u2 = e2[o2](s2); diff --git a/assets/index-7d1c2b92.js b/assets/index-bb743c74.js similarity index 99% rename from assets/index-7d1c2b92.js rename to assets/index-bb743c74.js index 49dd60b..beaa0e1 100644 --- a/assets/index-7d1c2b92.js +++ b/assets/index-bb743c74.js @@ -1,4 +1,4 @@ -import { aa as __vitePreload } from "./index-29dd1816.js"; +import { aa as __vitePreload } from "./index-8ce158e3.js"; const t = Symbol(); const s = Object.getPrototypeOf, c = /* @__PURE__ */ new WeakMap(), l = (e) => e && (c.has(e) ? c.get(e) : s(e) === Object.prototype || s(e) === Array.prototype), y = (e) => l(e) && e[t] || null, h = (e, t2 = true) => { c.set(e, t2); @@ -791,7 +791,7 @@ class WalletConnectModal { } async initUi() { if (typeof window !== "undefined") { - await __vitePreload(() => import("./index-b5a591a5.js"), true ? ["./index-b5a591a5.js","./index-29dd1816.js","./index-51b56c12.css"] : void 0, import.meta.url); + await __vitePreload(() => import("./index-6bb4a9ca.js"), true ? ["./index-6bb4a9ca.js","./index-8ce158e3.js","./index-51b56c12.css"] : void 0, import.meta.url); const modal = document.createElement("wcm-modal"); document.body.insertAdjacentElement("beforeend", modal); OptionsCtrl.setIsUiLoaded(true); diff --git a/assets/index-41d2f1d2.js b/assets/index-bc91246c.js similarity index 99% rename from assets/index-41d2f1d2.js rename to assets/index-bc91246c.js index 9d3723e..45542f6 100644 --- a/assets/index-41d2f1d2.js +++ b/assets/index-bc91246c.js @@ -1,4 +1,4 @@ -import { n as commonjsGlobal, a0 as bnExports, a1 as safeBufferExports, a2 as inherits_browserExports, Z as getAugmentedNamespace, a3 as eventsExports, a4 as buffer, a5 as require$$3, a6 as eventemitter3Exports, k as getDefaultExportFromCjs } from "./index-29dd1816.js"; +import { n as commonjsGlobal, a0 as bnExports, a1 as safeBufferExports, a2 as inherits_browserExports, Z as getAugmentedNamespace, a3 as eventsExports, a4 as buffer, a5 as require$$3, a6 as eventemitter3Exports, k as getDefaultExportFromCjs } from "./index-8ce158e3.js"; import { p as preact_module, a as clsx_m, b as hooks_module } from "./hooks.module-2202d2c9.js"; function _mergeNamespaces(n, m) { for (var i = 0; i < m.length; i++) { diff --git a/assets/index-87e4afbf.js b/assets/index-e4bea0fb.js similarity index 99% rename from assets/index-87e4afbf.js rename to assets/index-e4bea0fb.js index 5afd557..35ffffd 100644 --- a/assets/index-87e4afbf.js +++ b/assets/index-e4bea0fb.js @@ -1,4 +1,4 @@ -import { R as Hash, S as createView, T as exists$1, U as toBytes, V as output$1, X as wrapConstructor, Y as rotr, Z as getAugmentedNamespace, k as getDefaultExportFromCjs, $ as bytesToHex, O } from "./index-29dd1816.js"; +import { R as Hash, S as createView, T as exists$1, U as toBytes, V as output$1, X as wrapConstructor, Y as rotr, Z as getAugmentedNamespace, k as getDefaultExportFromCjs, $ as bytesToHex, O } from "./index-8ce158e3.js"; import { q, _, c as clsx, h, y } from "./hooks.module-2202d2c9.js"; const crypto$1 = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; const crypto$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ diff --git a/assets/index.es-3fcdcded.js b/assets/index.es-c3bc7551.js similarity index 98% rename from assets/index.es-3fcdcded.js rename to assets/index.es-c3bc7551.js index 5825ca2..ba407bf 100644 --- a/assets/index.es-3fcdcded.js +++ b/assets/index.es-c3bc7551.js @@ -1,4 +1,4 @@ -import { a3 as eventsExports, a7 as Wo, a8 as er, a9 as Ev, aa as __vitePreload, ab as Nr } from "./index-29dd1816.js"; +import { a3 as eventsExports, a7 as Wo, a8 as er, a9 as Ev, aa as __vitePreload, ab as Nr } from "./index-8ce158e3.js"; const R = "wc", T = "ethereum_provider", $ = `${R}@2:${T}:`, j = "https://rpc.walletconnect.org/v1/", u = ["eth_sendTransaction", "personal_sign"], y = ["eth_accounts", "eth_requestAccounts", "eth_sendRawTransaction", "eth_sign", "eth_signTransaction", "eth_signTypedData", "eth_signTypedData_v3", "eth_signTypedData_v4", "eth_sendTransaction", "personal_sign", "wallet_switchEthereumChain", "wallet_addEthereumChain", "wallet_getPermissions", "wallet_requestPermissions", "wallet_registerOnboarding", "wallet_watchAsset", "wallet_scanQRCode", "wallet_sendCalls", "wallet_getCapabilities", "wallet_getCallsStatus", "wallet_showCallsStatus"], g = ["chainChanged", "accountsChanged"], b = ["chainChanged", "accountsChanged", "message", "disconnect", "connect"]; var q = Object.defineProperty, N = Object.defineProperties, D = Object.getOwnPropertyDescriptors, M = Object.getOwnPropertySymbols, U = Object.prototype.hasOwnProperty, Q = Object.prototype.propertyIsEnumerable, O = (r, t, s) => t in r ? q(r, t, { enumerable: true, configurable: true, writable: true, value: s }) : r[t] = s, p = (r, t) => { for (var s in t || (t = {})) @@ -171,7 +171,7 @@ class C { if (this.rpc = this.getRpcConfig(t), this.chainId = this.rpc.chains.length ? m(this.rpc.chains) : m(this.rpc.optionalChains), this.signer = await Ev.init({ projectId: this.rpc.projectId, metadata: this.rpc.metadata, disableProviderPing: t.disableProviderPing, relayUrl: t.relayUrl, storageOptions: t.storageOptions, customStoragePrefix: t.customStoragePrefix, telemetryEnabled: t.telemetryEnabled }), this.registerEventListeners(), await this.loadPersistedSession(), this.rpc.showQrModal) { let s; try { - const { WalletConnectModal: i } = await __vitePreload(() => import("./index-7d1c2b92.js").then((n) => n.i), true ? ["./index-7d1c2b92.js","./index-29dd1816.js","./index-51b56c12.css"] : void 0, import.meta.url); + const { WalletConnectModal: i } = await __vitePreload(() => import("./index-bb743c74.js").then((n) => n.i), true ? ["./index-bb743c74.js","./index-8ce158e3.js","./index-51b56c12.css"] : void 0, import.meta.url); s = i; } catch { throw new Error("To use QR modal, please install @walletconnect/modal package"); diff --git a/index.html b/index.html index a0432d0..f1f3169 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ WalletKit Vite Example - +