From f015f488db5c42f51f2851a6bcd710e17e7f59af Mon Sep 17 00:00:00 2001 From: Sebastian Pape Date: Sat, 11 Nov 2023 09:45:57 +0400 Subject: [PATCH] v12.3.10: replace deprecated polygon RPC (pokt) --- dist/esm/index.bundle.js | 2 +- dist/umd/index.bundle.js | 2 +- package.evm.json | 4 ++-- package.json | 4 ++-- package.solana.json | 4 ++-- yarn.lock | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/esm/index.bundle.js b/dist/esm/index.bundle.js index 00337aef..866f2a6a 100644 --- a/dist/esm/index.bundle.js +++ b/dist/esm/index.bundle.js @@ -6,7 +6,7 @@ O=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="functio /*! safe-buffer. MIT License. Feross Aboukhadijeh */ !function(e,t){var n=Cn,r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=o),o.prototype=Object.create(r.prototype),i(r,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(Vn,Vn.exports);var Hn=Vn.exports.Buffer;var Gn=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var d=0,h=o-1;(0!==l||d>>0,c[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;var f=Hn.allocUnsafe(r+(o-p));f.fill(0,0,r);for(var y=r;p!==o;)f[y++]=c[p++];return f}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=Hn.from(t)),!Hn.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var d=t[i],h=0,p=u-1;(0!==d||h>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=u-r;f!==u&&0===l[f];)f++;for(var y=s.repeat(n);f>6*n)+r];n>0;){var o=t>>6*(n-1);i.push(128|63&o),n-=1}return i}}Kn.prototype={decode:function(e,t){var n;n="object"===z(e)&&e instanceof ArrayBuffer?new Uint8Array(e):"object"===z(e)&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=Zn(t),this._streaming||(this._decoder=new er({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var r,i=new Jn(n),o=[];!i.endOfStream()&&-1!==(r=this._decoder.handler(i,i.read()));)null!==r&&(Array.isArray(r)?o.push.apply(o,r):o.push(r));if(!this._streaming){do{if(-1===(r=this._decoder.handler(i,i.read())))break;null!==r&&(Array.isArray(r)?o.push.apply(o,r):o.push(r))}while(!i.endOfStream());this._decoder=null}return o.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===o[0]?(this._BOMseen=!0,o.shift()):this._BOMseen=!0)),function(e){for(var t="",n=0;n>10),56320+(1023&r)))}return t}(o)}},$n.prototype={encode:function(e,t){e=e?String(e):"",t=Zn(t),this._streaming||(this._encoder=new tr(this._options)),this._streaming=Boolean(t.stream);for(var n,r=[],i=new Jn(function(e){for(var t=String(e),n=t.length,r=0,i=[];r57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(r===n-1)i.push(65533);else{var a=e.charCodeAt(r+1);if(56320<=a&&a<=57343){var s=1023&o,u=1023&a;i.push(65536+(s<<10)+u),r+=1}else i.push(65533)}r+=1}return i}(e));!i.endOfStream()&&-1!==(n=this._encoder.handler(i,i.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);if(!this._streaming){for(;-1!==(n=this._encoder.handler(i,i.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);this._encoder=null}return new Uint8Array(r)}};var nr=j(Object.freeze({__proto__:null,TextEncoder:$n,TextDecoder:Kn})),rr=x&&x.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),ir=x&&x.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),or=x&&x.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":z(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},ar=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&rr(t,e,n);return ir(t,e),t},sr=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fn,"__esModule",{value:!0});var ur=Fn.deserializeUnchecked=Er=Fn.deserialize=wr=Fn.serialize=Fn.BinaryReader=Fn.BinaryWriter=Fn.BorshError=Fn.baseDecode=Fn.baseEncode=void 0,cr=sr(jn.exports),lr=sr(Gn),dr=ar(nr),hr=new("function"!=typeof TextDecoder?dr.TextDecoder:TextDecoder)("utf-8",{fatal:!0});Fn.baseEncode=function(e){return"string"==typeof e&&(e=Te.from(e,"utf8")),lr.default.encode(Te.from(e))},Fn.baseDecode=function(e){return Te.from(lr.default.decode(e))};var pr=function(e){Q(n,G(Error));var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,e)).fieldPath=[],r.originalMessage=e,r}return U(n,[{key:"addToFieldPath",value:function(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}]),n}();Fn.BorshError=pr;var fr=function(){function e(){R(this,e),this.buf=Te.alloc(1024),this.length=0}return U(e,[{key:"maybeResize",value:function(){this.buf.length<16+this.length&&(this.buf=Te.concat([this.buf,Te.alloc(1024)]))}},{key:"writeU8",value:function(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}},{key:"writeU16",value:function(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}},{key:"writeU32",value:function(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}},{key:"writeU64",value:function(e){this.maybeResize(),this.writeBuffer(Te.from(new cr.default(e).toArray("le",8)))}},{key:"writeU128",value:function(e){this.maybeResize(),this.writeBuffer(Te.from(new cr.default(e).toArray("le",16)))}},{key:"writeU256",value:function(e){this.maybeResize(),this.writeBuffer(Te.from(new cr.default(e).toArray("le",32)))}},{key:"writeU512",value:function(e){this.maybeResize(),this.writeBuffer(Te.from(new cr.default(e).toArray("le",64)))}},{key:"writeBuffer",value:function(e){this.buf=Te.concat([Te.from(this.buf.subarray(0,this.length)),e,Te.alloc(1024)]),this.length+=e.length}},{key:"writeString",value:function(e){this.maybeResize();var t=Te.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}},{key:"writeFixedArray",value:function(e){this.writeBuffer(Te.from(e))}},{key:"writeArray",value:function(e,t){this.maybeResize(),this.writeU32(e.length);var n,r=se(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.maybeResize(),t(i)}}catch(e){r.e(e)}finally{r.f()}}},{key:"toArray",value:function(){return this.buf.subarray(0,this.length)}}]),e}();function yr(e,t,n){var r=n.value;n.value=function(){try{for(var e=arguments.length,t=new Array(e),n=0;n=0)throw new pr("Reached the end of buffer when deserializing")}throw e}}}Fn.BinaryWriter=fr;var mr=function(){function e(t){R(this,e),this.buf=t,this.offset=0}return U(e,[{key:"readU8",value:function(){var e=this.buf.readUInt8(this.offset);return this.offset+=1,e}},{key:"readU16",value:function(){var e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}},{key:"readU32",value:function(){var e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}},{key:"readU64",value:function(){var e=this.readBuffer(8);return new cr.default(e,"le")}},{key:"readU128",value:function(){var e=this.readBuffer(16);return new cr.default(e,"le")}},{key:"readU256",value:function(){var e=this.readBuffer(32);return new cr.default(e,"le")}},{key:"readU512",value:function(){var e=this.readBuffer(64);return new cr.default(e,"le")}},{key:"readBuffer",value:function(e){if(this.offset+e>this.buf.length)throw new pr("Expected buffer length ".concat(e," isn't within bounds"));var t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}},{key:"readString",value:function(){var e=this.readU32(),t=this.readBuffer(e);try{return hr.decode(t)}catch(e){throw new pr("Error decoding UTF-8 string: ".concat(e))}}},{key:"readFixedArray",value:function(e){return new Uint8Array(this.readBuffer(e))}},{key:"readArray",value:function(e){for(var t=this.readU32(),n=Array(),r=0;r2&&void 0!==arguments[2]?arguments[2]:fr,r=new n;return br(e,t,r),r.toArray()};function Mr(e,t,n,r){try{if("string"==typeof n)return r["read".concat(gr(n))]();if(n instanceof Array){if("number"==typeof n[0])return r.readFixedArray(n[0]);if("number"==typeof n[1]){for(var i=[],o=0;o=r.values.length)throw new pr("Enum index: ".concat(l," is out of range"));var d=ee(r.values[l],2),h=d[0];return new t(W({},h,Mr(e,h,d[1],n)))}throw new pr("Unexpected schema kind: ".concat(r.kind," for ").concat(t.constructor.name))}var Er=Fn.deserialize=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:mr,i=new r(n),o=Ar(e,t,i);if(i.offset3&&void 0!==arguments[3]?arguments[3]:mr,i=new r(n);return Ar(e,t,i)};var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.s16=Tr.s8=Tr.nu64be=Tr.u48be=Tr.u40be=Tr.u32be=Tr.u24be=Tr.u16be=hi=Tr.nu64=Tr.u48=Tr.u40=di=Tr.u32=Tr.u24=li=Tr.u16=ci=Tr.u8=ui=Tr.offset=Tr.greedy=Tr.Constant=Tr.UTF8=Tr.CString=Tr.Blob=Tr.Boolean=Tr.BitField=Tr.BitStructure=Tr.VariantLayout=Tr.Union=Tr.UnionLayoutDiscriminator=Tr.UnionDiscriminator=Tr.Structure=Tr.Sequence=Tr.DoubleBE=Tr.Double=Tr.FloatBE=Tr.Float=Tr.NearInt64BE=Tr.NearInt64=Tr.NearUInt64BE=Tr.NearUInt64=Tr.IntBE=Tr.Int=Tr.UIntBE=Tr.UInt=Tr.OffsetLayout=Tr.GreedyCount=Tr.ExternalLayout=Tr.bindConstructorLayout=Tr.nameWithProperty=Tr.Layout=Tr.uint8ArrayToBuffer=Tr.checkUint8Array=void 0,Tr.constant=Tr.utf8=Tr.cstr=mi=Tr.blob=Tr.unionLayoutDiscriminator=Tr.union=yi=Tr.seq=Tr.bits=fi=Tr.struct=Tr.f64be=Tr.f64=Tr.f32be=Tr.f32=Tr.ns64be=Tr.s48be=Tr.s40be=Tr.s32be=Tr.s24be=Tr.s16be=pi=Tr.ns64=Tr.s48=Tr.s40=Tr.s32=Tr.s24=void 0;var Nr=Cn;function Ir(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function kr(e){return Ir(e),Nr.Buffer.from(e.buffer,e.byteOffset,e.length)}Tr.checkUint8Array=Ir,Tr.uint8ArrayToBuffer=kr;var Lr=function(){function e(t,n){if(R(this,e),!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=n}return U(e,[{key:"makeDestinationObject",value:function(){return{}}},{key:"getSpan",value:function(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function xr(e,t){return t.property?e+"["+t.property+"]":e}Tr.Layout=Lr,Tr.nameWithProperty=xr,Tr.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(e,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Lr))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var Sr=function(e){Q(n,Lr);var t=X(n);function n(){return R(this,n),t.apply(this,arguments)}return U(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}();Tr.ExternalLayout=Sr;var jr=function(e){Q(n,Sr);var t=X(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1?arguments[1]:void 0;if(R(this,n),!Number.isInteger(r)||0>=r)throw new TypeError("elementSpan must be a (positive) integer");return(e=t.call(this,-1,i)).elementSpan=r,e}return U(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ir(e);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}();Tr.GreedyCount=jr;var Cr=function(e){Q(n,Sr);var t=X(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;if(R(this,n),!(e instanceof Lr))throw new TypeError("layout must be a Layout");if(!Number.isInteger(i))throw new TypeError("offset must be integer or undefined");return(r=t.call(this,e.span,o||e.property)).layout=e,r.offset=i,r}return U(n,[{key:"isCount",value:function(){return this.layout instanceof Dr||this.layout instanceof Or}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.layout.encode(e,t,n+this.offset)}}]),n}();Tr.OffsetLayout=Cr;var Dr=function(e){Q(n,Lr);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return kr(e).readUIntLE(t,this.span)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return kr(t).writeUIntLE(e,n,this.span),this.span}}]),n}();Tr.UInt=Dr;var Or=function(e){Q(n,Lr);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return kr(e).readUIntBE(t,this.span)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return kr(t).writeUIntBE(e,n,this.span),this.span}}]),n}();Tr.UIntBE=Or;var zr=function(e){Q(n,Lr);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return kr(e).readIntLE(t,this.span)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return kr(t).writeIntLE(e,n,this.span),this.span}}]),n}();Tr.Int=zr;var _r=function(e){Q(n,Lr);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return kr(e).readIntBE(t,this.span)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return kr(t).writeIntBE(e,n,this.span),this.span}}]),n}();Tr.IntBE=_r;var Pr=Math.pow(2,32);function Rr(e){var t=Math.floor(e/Pr);return{hi32:t,lo32:e-t*Pr}}function Br(e,t){return e*Pr+t}var Ur=function(e){Q(n,Lr);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=kr(e),r=n.readUInt32LE(t),i=n.readUInt32LE(t+4);return Br(i,r)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Rr(e),i=kr(t);return i.writeUInt32LE(r.lo32,n),i.writeUInt32LE(r.hi32,n+4),8}}]),n}();Tr.NearUInt64=Ur;var Wr=function(e){Q(n,Lr);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=kr(e),r=n.readUInt32BE(t),i=n.readUInt32BE(t+4);return Br(r,i)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Rr(e),i=kr(t);return i.writeUInt32BE(r.hi32,n),i.writeUInt32BE(r.lo32,n+4),8}}]),n}();Tr.NearUInt64BE=Wr;var Qr=function(e){Q(n,Lr);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=kr(e),r=n.readUInt32LE(t),i=n.readInt32LE(t+4);return Br(i,r)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Rr(e),i=kr(t);return i.writeUInt32LE(r.lo32,n),i.writeInt32LE(r.hi32,n+4),8}}]),n}();Tr.NearInt64=Qr;var Yr=function(e){Q(n,Lr);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=kr(e),r=n.readInt32BE(t),i=n.readUInt32BE(t+4);return Br(r,i)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Rr(e),i=kr(t);return i.writeInt32BE(r.hi32,n),i.writeUInt32BE(r.lo32,n+4),8}}]),n}();Tr.NearInt64BE=Yr;var Fr=function(e){Q(n,Lr);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return kr(e).readFloatLE(t)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return kr(t).writeFloatLE(e,n),4}}]),n}();Tr.Float=Fr;var Vr=function(e){Q(n,Lr);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return kr(e).readFloatBE(t)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return kr(t).writeFloatBE(e,n),4}}]),n}();Tr.FloatBE=Vr;var Hr=function(e){Q(n,Lr);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return kr(e).readDoubleLE(t)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return kr(t).writeDoubleLE(e,n),8}}]),n}();Tr.Double=Hr;var Gr=function(e){Q(n,Lr);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return kr(e).readDoubleBE(t)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return kr(t).writeDoubleBE(e,n),8}}]),n}();Tr.DoubleBE=Gr;var qr=function(e){Q(n,Lr);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Lr))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Sr&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(r instanceof Sr)&&01&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var n=0,r=this.count;if(r instanceof Sr&&(r=r.decode(e,t)),01&&void 0!==arguments[1]?arguments[1]:0,n=[],r=0,i=this.count;for(i instanceof Sr&&(i=i.decode(e,t));r2&&void 0!==arguments[2]?arguments[2]:0,r=this.elementLayout,i=e.reduce((function(e,i){return e+r.encode(i,t,n+e)}),0);return this.count instanceof Sr&&this.count.encode(e.length,t,n),i}}]),n}();Tr.Sequence=qr;var Zr=function(e){Q(n,Lr);var t=X(n);function n(e,r,i){var o;if(R(this,n),!Array.isArray(e)||!e.reduce((function(e,t){return e&&t instanceof Lr}),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof r&&void 0===i&&(i=r,r=void 0);var a,s=se(e);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(0>u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(e){s.e(e)}finally{s.f()}var c=-1;try{c=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(e){}return(o=t.call(this,c,r)).fields=e,o.decodePrefixes=!!i,o}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var n=0;try{n=this.fields.reduce((function(n,r){var i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(e){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ir(e);var n,r=this.makeDestinationObject(),i=se(this.fields);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(void 0!==o.property&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"encode",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=r,o=0,a=0,s=se(this.fields);try{for(s.s();!(n=s.n()).done;){var u=n.value,c=u.span;if(a=0c&&(c=u.getSpan(t,r)))}o=r,r+=c}}catch(e){s.e(e)}finally{s.f()}return o+a-i}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=se(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;void 0!==i.property&&0i.span?n=-1:0<=n&&(n+=i.span)}}catch(e){r.e(e)}finally{r.f()}}}]),n}();Tr.Structure=Zr;var Jr=function(){function e(t){R(this,e),this.property=t}return U(e,[{key:"decode",value:function(e,t){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(e,t,n){throw new Error("UnionDiscriminator is abstract")}}]),e}();Tr.UnionDiscriminator=Jr;var Xr=function(e){Q(n,Jr);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Sr&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,r||e.property||"variant")).layout=e,i}return U(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}();Tr.UnionLayoutDiscriminator=Xr;var Kr=function(e){Q(n,Lr);var t=X(n);function n(e,r,i){var o,a;if(R(this,n),e instanceof Dr||e instanceof Or)a=new Xr(new Cr(e));else if(e instanceof Sr&&e.isCount())a=new Xr(e);else{if(!(e instanceof Jr))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");a=e}if(void 0===r&&(r=null),!(null===r||r instanceof Lr))throw new TypeError("defaultLayout must be null or a Layout");if(null!==r){if(0>r.span)throw new Error("defaultLayout must have constant span");void 0===r.property&&(r=r.replicate("content"))}var s=-1;r&&0<=(s=r.span)&&(e instanceof Dr||e instanceof Or)&&(s+=a.layout.span),(o=t.call(this,s,i)).discriminator=a,o.usesPrefixDiscriminator=e instanceof Dr||e instanceof Or,o.defaultLayout=r,o.registry={};var u=o.defaultGetSourceVariant.bind(Z(o));return o.getSourceVariant=function(e){return u(e)},o.configGetSourceVariant=function(e){u=e.bind(this)},o}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.discriminator,i=r.decode(e,n),o=this.registry[i];if(void 0===o){var a=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=r.layout.span),(t=this.makeDestinationObject())[r.property]=i,t[a.property]=a.decode(e,n+s)}else t=o.decode(e,n);return t}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getSourceVariant(e);if(void 0===r){var i=this.discriminator,o=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,n),a+o.encode(e[o.property],t,n+a)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new $r(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t=e instanceof Uint8Array?this.discriminator.decode(e,n):e,this.registry[t]}}]),n}();Tr.Union=Kr;var $r=function(e){Q(n,Lr);var t=X(n);function n(e,r,i,o){var a;if(R(this,n),!(e instanceof Kr))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof i&&void 0===o&&(o=i,i=null),i){if(!(i instanceof Lr))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof o)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=i?i.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(a=t.call(this,s,o)).union=e,a.variant=r,a.layout=i||null,a}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);var r=0;return this.layout&&(r=this.layout.getSpan(e,t+n)),n+r}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}();function ei(e){return 0>e&&(e+=4294967296),e}Tr.VariantLayout=$r;var ti=function(e){Q(n,Lr);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Dr||e instanceof Or))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof r&&void 0===i&&(i=r,r=!1),41&&void 0!==arguments[1]?arguments[1]:0,n=this.makeDestinationObject(),r=this.word.decode(e,t);this._packedSetValue(r);var i,o=se(this.fields);try{for(o.s();!(i=o.n()).done;){var a=i.value;void 0!==a.property&&(n[a.property]=a.decode(e))}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.word.decode(t,n);this._packedSetValue(r);var i,o=se(this.fields);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(void 0!==a.property){var s=e[a.property];void 0!==s&&a.encode(s)}}}catch(e){o.e(e)}finally{o.f()}return this.word.encode(this._packedGetValue(),t,n)}},{key:"addField",value:function(e,t){var n=new ni(this,e,t);return this.fields.push(n),n}},{key:"addBoolean",value:function(e){var t=new ri(this,e);return this.fields.push(t),t}},{key:"fieldFor",value:function(e){if("string"!=typeof e)throw new TypeError("property must be string");var t,n=se(this.fields);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.property===e)return r}}catch(e){n.e(e)}finally{n.f()}}}]),n}();Tr.BitStructure=ti;var ni=function(){function e(t,n,r){if(R(this,e),!(t instanceof ti))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");var i=8*t.span,o=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+o>i)throw new Error("bits too long for span remainder ("+(i-o)+" of "+i+" remain)");this.container=t,this.bits=n,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if("number"!=typeof e||!Number.isInteger(e)||e!==ei(e&this.valueMask))throw new TypeError(xr("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=ei(e<n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.span;return 0>n&&(n=this.length.decode(e,t)),kr(e).slice(t,t+n)}},{key:"encode",value:function(e,t,n){var r=this.length;if(this.length instanceof Sr&&(r=e.length),!(e instanceof Uint8Array&&r===e.length))throw new TypeError(xr("Blob.encode",this)+" requires (length "+r+") Uint8Array as src");if(n+r>t.length)throw new RangeError("encoding overruns Uint8Array");var i=kr(e);return kr(t).write(i.toString("hex"),n,r,"hex"),this.length instanceof Sr&&this.length.encode(r,t,n),r}}]),n}();Tr.Blob=ii;var oi=function(e){Q(n,Lr);var t=X(n);function n(e){return R(this,n),t.call(this,-1,e)}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ir(e);for(var n=t;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.getSpan(e,t);return kr(e).slice(t,t+n-1).toString("utf-8")}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;"string"!=typeof e&&(e=String(e));var r=Nr.Buffer.from(e,"utf8"),i=r.length;if(n+i>t.length)throw new RangeError("encoding overruns Buffer");var o=kr(t);return r.copy(o,n),o[n+i]=0,i+1}}]),n}();Tr.CString=oi;var ai=function(e){Q(n,Lr);var t=X(n);function n(e,r){var i;if(R(this,n),"string"==typeof e&&void 0===r&&(r=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=t.call(this,-1,r)).maxSpan=e,i}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ir(e),e.length-t}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan2&&void 0!==arguments[2]?arguments[2]:0;"string"!=typeof e&&(e=String(e));var r=Nr.Buffer.from(e,"utf8"),i=r.length;if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return r.copy(kr(t),n),i}}]),n}();Tr.UTF8=ai;var si=function(e){Q(n,Lr);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,0,r)).value=e,i}return U(n,[{key:"decode",value:function(e,t){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}();Tr.Constant=si,Tr.greedy=function(e,t){return new jr(e,t)};var ui=Tr.offset=function(e,t,n){return new Cr(e,t,n)},ci=Tr.u8=function(e){return new Dr(1,e)},li=Tr.u16=function(e){return new Dr(2,e)};Tr.u24=function(e){return new Dr(3,e)};var di=Tr.u32=function(e){return new Dr(4,e)};Tr.u40=function(e){return new Dr(5,e)},Tr.u48=function(e){return new Dr(6,e)};var hi=Tr.nu64=function(e){return new Ur(e)};Tr.u16be=function(e){return new Or(2,e)},Tr.u24be=function(e){return new Or(3,e)},Tr.u32be=function(e){return new Or(4,e)},Tr.u40be=function(e){return new Or(5,e)},Tr.u48be=function(e){return new Or(6,e)},Tr.nu64be=function(e){return new Wr(e)},Tr.s8=function(e){return new zr(1,e)},Tr.s16=function(e){return new zr(2,e)},Tr.s24=function(e){return new zr(3,e)},Tr.s32=function(e){return new zr(4,e)},Tr.s40=function(e){return new zr(5,e)},Tr.s48=function(e){return new zr(6,e)};var pi=Tr.ns64=function(e){return new Qr(e)};Tr.s16be=function(e){return new _r(2,e)},Tr.s24be=function(e){return new _r(3,e)},Tr.s32be=function(e){return new _r(4,e)},Tr.s40be=function(e){return new _r(5,e)},Tr.s48be=function(e){return new _r(6,e)},Tr.ns64be=function(e){return new Yr(e)},Tr.f32=function(e){return new Fr(e)},Tr.f32be=function(e){return new Vr(e)},Tr.f64=function(e){return new Hr(e)},Tr.f64be=function(e){return new Gr(e)};var fi=Tr.struct=function(e,t,n){return new Zr(e,t,n)};Tr.bits=function(e,t,n){return new ti(e,t,n)};var yi=Tr.seq=function(e,t,n){return new qr(e,t,n)};Tr.union=function(e,t,n){return new Kr(e,t,n)},Tr.unionLayoutDiscriminator=function(e,t){return new Xr(e,t)};var mi=Tr.blob=function(e,t){return new ii(e,t)};Tr.cstr=function(e){return new oi(e)},Tr.utf8=function(e,t){return new ai(e,t)},Tr.constant=function(e,t){return new si(e,t)};var gi={};Object.defineProperty(gi,"__esModule",{value:!0});var vi=gi.toBigIntLE=function(e){var t=Te.from(e);t.reverse();var n=t.toString("hex");return 0===n.length?BigInt(0):BigInt("0x".concat(n))};gi.toBigIntBE=function(e){var t=e.toString("hex");return 0===t.length?BigInt(0):BigInt("0x".concat(t))};var bi=gi.toBufferLE=function(e,t){var n=e.toString(16),r=Te.from(n.padStart(2*t,"0").slice(0,2*t),"hex");return r.reverse(),r};gi.toBufferBE=function(e,t){var n=e.toString(16);return Te.from(n.padStart(2*t,"0").slice(0,2*t),"hex")};var wi=["message"],Mi=O().mark(Li),Ai=function(e){Q(n,G(TypeError));var t=X(n);function n(e,r){var i,o;R(this,n);var a=e.message,s=q(e,wi),u=e.path,c=0===u.length?a:"At path: "+u.join(".")+" -- "+a;return i=t.call(this,c),Object.assign(Z(i),s),i.name=i.constructor.name,i.failures=function(){var t;return null!=(t=o)?t:o=[e].concat(te(r()))},i}return U(n)}();function Ei(e){return Ti(e)&&"function"==typeof e[Symbol.iterator]}function Ti(e){return"object"===z(e)&&null!=e}function Ni(e){return"string"==typeof e?JSON.stringify(e):""+e}function Ii(e){var t=e.next(),n=t.done,r=t.value;return n?void 0:r}function ki(e,t,n,r){if(!0!==e){!1===e?e={}:"string"==typeof e&&(e={message:e});var i=t.path,o=t.branch,a=n.type,s=e,u=s.refinement,c=s.message,l=void 0===c?"Expected a value of type `"+a+"`"+(u?" with refinement `"+u+"`":"")+", but received: `"+Ni(r)+"`":c;return D(D({value:r,type:a,refinement:u,key:i[i.length-1],path:i,branch:o},e),{},{message:l})}}function Li(e,t,n,r){var i,o,a,s;return O().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:Ei(e)||(e=[e]),i=se(e),u.prev=2,i.s();case 4:if((o=i.n()).done){u.next=12;break}if(a=o.value,!(s=ki(a,t,n,r))){u.next=10;break}return u.next=10,s;case 10:u.next=4;break;case 12:u.next=17;break;case 14:u.prev=14,u.t0=u.catch(2),i.e(u.t0);case 17:return u.prev=17,i.f(),u.finish(17);case 20:case"end":return u.stop()}}),Mi,null,[[2,14,17,20]])}function xi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return O().mark((function r(){var i,o,a,s,u,c,l,d,h,p,f,y,m,g,v,b,w,M,A,E,T,N,I,k,L,x,S;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=n.path,o=void 0===i?[]:i,a=n.branch,s=void 0===a?[e]:a,u=n.coerce,c=void 0!==u&&u,l=n.mask,d=void 0!==l&&l,h={path:o,branch:s},c&&(e=t.coercer(e,h),d&&"type"!==t.type&&Ti(t.schema)&&Ti(e)&&!Array.isArray(e)))for(p in e)void 0===t.schema[p]&&delete e[p];f=!0,y=se(t.validator(e,h)),r.prev=5,y.s();case 7:if((m=y.n()).done){r.next=14;break}return g=m.value,f=!1,r.next=12,[g,void 0];case 12:r.next=7;break;case 14:r.next=19;break;case 16:r.prev=16,r.t0=r.catch(5),y.e(r.t0);case 19:return r.prev=19,y.f(),r.finish(19);case 22:v=se(t.entries(e,h)),r.prev=23,v.s();case 25:if((b=v.n()).done){r.next=52;break}w=ee(b.value,3),M=w[0],A=w[1],E=w[2],T=xi(A,E,{path:void 0===M?o:[].concat(te(o),[M]),branch:void 0===M?s:[].concat(te(s),[A]),coerce:c,mask:d}),N=se(T),r.prev=29,N.s();case 31:if((I=N.n()).done){r.next=42;break}if(!(k=I.value)[0]){r.next=39;break}return f=!1,r.next=37,[k[0],void 0];case 37:r.next=40;break;case 39:c&&(A=k[1],void 0===M?e=A:e instanceof Map?e.set(M,A):e instanceof Set?e.add(A):Ti(e)&&(e[M]=A));case 40:r.next=31;break;case 42:r.next=47;break;case 44:r.prev=44,r.t1=r.catch(29),N.e(r.t1);case 47:return r.prev=47,N.f(),r.finish(47);case 50:r.next=25;break;case 52:r.next=57;break;case 54:r.prev=54,r.t2=r.catch(23),v.e(r.t2);case 57:return r.prev=57,v.f(),r.finish(57);case 60:if(!f){r.next=79;break}L=se(t.refiner(e,h)),r.prev=62,L.s();case 64:if((x=L.n()).done){r.next=71;break}return S=x.value,f=!1,r.next=69,[S,void 0];case 69:r.next=64;break;case 71:r.next=76;break;case 73:r.prev=73,r.t3=r.catch(62),L.e(r.t3);case 76:return r.prev=76,L.f(),r.finish(76);case 79:if(!f){r.next=82;break}return r.next=82,[void 0,e];case 82:case"end":return r.stop()}}),r,null,[[5,16,19,22],[23,54,57,60],[29,44,47,50],[62,73,76,79]])}))()}var Si,ji=function(){function e(t){var n=this;R(this,e);var r=t.type,i=t.schema,o=t.validator,a=t.refiner,s=t.coercer,u=void 0===s?function(e){return e}:s,c=t.entries,l=void 0===c?O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})):c;this.type=r,this.schema=i,this.entries=l,this.coercer=u,this.validator=o?function(e,t){return Li(o(e,t),t,n,e)}:function(){return[]},this.refiner=a?function(e,t){return Li(a(e,t),t,n,e)}:function(){return[]}}return U(e,[{key:"assert",value:function(e){return Ci(e,this)}},{key:"create",value:function(e){return Di(e,this)}},{key:"is",value:function(e){return Oi(e,this)}},{key:"mask",value:function(e){return function(e,t){var n=zi(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}(e,this)}},{key:"validate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return zi(e,this,t)}}]),e}();function Ci(e,t){var n=zi(e,t);if(n[0])throw n[0]}function Di(e,t){var n=zi(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}function Oi(e,t){return!zi(e,t)[0]}function zi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=xi(e,t,n),i=Ii(r);if(i[0]){var o=new Ai(i[0],O().mark((function e(){var t,n,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=se(r),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if(!(i=n.value)[0]){e.next=8;break}return e.next=8,i[0];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])})));return[o,void 0]}var a=i[1];return[void 0,a]}function _i(e,t){return new ji({type:e,schema:null,validator:t})}function Pi(e){return new ji({type:"array",schema:e,entries:O().mark((function t(n){var r,i,o,a,s;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e||!Array.isArray(n)){t.next=18;break}r=se(n.entries()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=ee(i.value,2),a=o[0],s=o[1],t.next=8,[a,s,e];case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[2,12,15,18]])})),coercer:function(e){return Array.isArray(e)?e.slice():e},validator:function(e){return Array.isArray(e)||"Expected an array value, but received: "+Ni(e)}})}function Ri(){return _i("boolean",(function(e){return"boolean"==typeof e}))}function Bi(e){return _i("instance",(function(t){return t instanceof e||"Expected a `"+e.name+"` instance, but received: "+Ni(t)}))}function Ui(e){var t=Ni(e),n=z(e);return new ji({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:function(n){return n===e||"Expected the literal `"+t+"`, but received: "+Ni(n)}})}function Wi(e){return new ji(D(D({},e),{},{validator:function(t,n){return null===t||e.validator(t,n)},refiner:function(t,n){return null===t||e.refiner(t,n)}}))}function Qi(){return _i("number",(function(e){return"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Ni(e)}))}function Yi(e){return new ji(D(D({},e),{},{validator:function(t,n){return void 0===t||e.validator(t,n)},refiner:function(t,n){return void 0===t||e.refiner(t,n)}}))}function Fi(e,t){return new ji({type:"record",schema:null,entries:O().mark((function n(r){var i,o;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Ti(r)){n.next=11;break}n.t0=O().keys(r);case 2:if((n.t1=n.t0()).done){n.next=11;break}return i=n.t1.value,o=r[i],n.next=7,[i,i,e];case 7:return n.next=9,[i,o,t];case 9:n.next=2;break;case 11:case"end":return n.stop()}}),n)})),validator:function(e){return Ti(e)||"Expected an object, but received: "+Ni(e)}})}function Vi(){return _i("string",(function(e){return"string"==typeof e||"Expected a string, but received: "+Ni(e)}))}function Hi(e){var t=_i("never",(function(){return!1}));return new ji({type:"tuple",schema:null,entries:O().mark((function n(r){var i,o;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=9;break}i=Math.max(e.length,r.length),o=0;case 3:if(!(o1&&void 0!==arguments[1]?arguments[1]:0,n=(ro[e[t+0]]+ro[e[t+1]]+ro[e[t+2]]+ro[e[t+3]]+"-"+ro[e[t+4]]+ro[e[t+5]]+"-"+ro[e[t+6]]+ro[e[t+7]]+"-"+ro[e[t+8]]+ro[e[t+9]]+"-"+ro[e[t+10]]+ro[e[t+11]]+ro[e[t+12]]+ro[e[t+13]]+ro[e[t+14]]+ro[e[t+15]]).toLowerCase();if(!eo(n))throw TypeError("Stringified UUID is invalid");return n}var ao=0,so=0;function uo(e){if(!eo(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function co(e,t,n){function r(e,r,i,o){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n>>9<<4)+1}function ho(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function po(e,t,n,r,i,o){return ho((a=ho(ho(t,e),ho(r,o)))<<(s=i)|a>>>32-s,n);var a,s}function fo(e,t,n,r,i,o,a){return po(t&n|~t&r,e,t,i,o,a)}function yo(e,t,n,r,i,o,a){return po(t&r|n&~r,e,t,i,o,a)}function mo(e,t,n,r,i,o,a){return po(t^n^r,e,t,i,o,a)}function go(e,t,n,r,i,o,a){return po(n^(t|~r),e,t,i,o,a)}var vo=co("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n>5]>>>i%32&255,a=parseInt(r.charAt(o>>>4&15)+r.charAt(15&o),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[r/8])<>>32-t}var Mo=co("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i>>0;b=v,v=g,g=wo(m,30)>>>0,m=y,y=A}n[0]=n[0]+y>>>0,n[1]=n[1]+m>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var Ao=j(Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,i=t||new Array(16),o=(e=e||{}).node||to,a=void 0!==e.clockseq?e.clockseq:no;if(null==o||null==a){var s=e.random||(e.rng||Ki)();null==o&&(o=to=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=no=16383&(s[6]<<8|s[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:so+1,l=u-ao+(c-so)/1e4;if(l<0&&void 0===e.clockseq&&(a=a+1&16383),(l<0||u>ao)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ao=u,so=c,no=a;var d=(1e4*(268435455&(u+=122192928e5))+c)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=255&d;var h=u/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var p=0;p<6;++p)i[r+p]=o[p];return t||oo(i)},v3:vo,v4:function(e,t,n){var r=(e=e||{}).random||(e.rng||Ki)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return oo(r)},v5:Mo,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!eo(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:eo,stringify:oo,parse:uo})),Eo=Ao.v4,To=function(e,t,n,r){if("string"!=typeof e)throw new TypeError(e+" must be a string");var i="number"==typeof(r=r||{}).version?r.version:2;if(1!==i&&2!==i)throw new TypeError(i+" must be 1 or 2");var o={method:e};if(2===i&&(o.jsonrpc="2.0"),t){if("object"!==z(t)&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");o.params=t}if(void 0===n){var a="function"==typeof r.generator?r.generator:function(){return Eo()};o.id=a(o,r)}else 2===i&&null===n?r.notificationIdNull&&(o.id=null):o.id=n;return o},No=Ao.v4,Io=To,ko=function e(t,n){if(!(this instanceof e))return new e(t,n);n||(n={}),this.options={reviver:void 0!==n.reviver?n.reviver:null,replacer:void 0!==n.replacer?n.replacer:null,generator:void 0!==n.generator?n.generator:function(){return No()},version:void 0!==n.version?n.version:2,notificationIdNull:"boolean"==typeof n.notificationIdNull&&n.notificationIdNull},this.callServer=t},Lo=ko;ko.prototype.request=function(e,t,n,r){var i=this,o=null,a=Array.isArray(e)&&"function"==typeof t;if(1===this.options.version&&a)throw new TypeError("JSON-RPC 1.0 does not support batching");var s,u=!a&&e&&"object"===z(e)&&"function"==typeof t;if(a||u)r=t,o=e;else{"function"==typeof n&&(r=n,n=void 0);var c="function"==typeof r;try{o=Io(e,t,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(e){if(c)return r(e);throw e}if(!c)return o}try{s=JSON.stringify(o,this.options.replacer)}catch(e){return r(e)}return this.callServer(s,(function(e,t){i._parseResponse(e,t,r)})),o},ko.prototype._parseResponse=function(e,t,n){if(e)n(e);else{if(!t)return n();var r;try{r=JSON.parse(t,this.options.reviver)}catch(e){return n(e)}if(3===n.length){if(Array.isArray(r)){var i=function(e){return void 0!==e.error};return n(null,r.filter(i),r.filter((function(e){return!i(e)})))}return n(null,r.error,r.result)}n(null,r)}};var xo,So=Lo,jo={},Co={exports:{}};(xo=Co).exports=function(e){return e&&e.__esModule?e:{default:e}},xo.exports.__esModule=!0,xo.exports.default=xo.exports;var Do,Oo,zo,_o,Po={exports:{}},Ro={exports:{}};function Bo(){return Do||(Do=1,function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Ro)),Ro.exports}function Uo(){return Oo||(Oo=1,function(e){var t=Bo().default;function n(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ -e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new I(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return L()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=h(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=d;var p={};function f(){}function y(){}function m(){}var g={};l(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(k([])));b&&b!==i&&o.call(b,s)&&(g=b);var w=m.prototype=f.prototype=Object.create(g);function M(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,n){function r(i,a,s,u){var c=h(e[i],e,a);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==t(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var i;this._invoke=function(e,t){function o(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(o,o):o()}}function E(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function k(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Po)),Po.exports}var Wo,Qo={exports:{}};var Yo,Fo={exports:{}};function Vo(){return Yo||(Yo=1,function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(Fo)),Fo.exports}var Ho,Go={exports:{}};function qo(){return Ho||(Ho=1,function(e){function t(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(0,o.default)(this,f);var a=r.autoconnect,s=void 0===a||a,u=r.reconnect,c=void 0===u||u,l=r.reconnect_interval,d=void 0===l?1e3:l,y=r.max_reconnects,m=void 0===y?5:y,g=h(r,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(t=p.call(this)).webSocketFactory=e,t.queue={},t.rpc_id=0,t.address=n,t.autoconnect=s,t.ready=!1,t.reconnect=c,t.reconnect_timer_id=void 0,t.reconnect_interval=d,t.max_reconnects=m,t.rest_options=g,t.current_reconnects=0,t.generate_request_id=i||function(){return++t.rpc_id},t.autoconnect&&t._connect(t.address,Object.assign({autoconnect:t.autoconnect,reconnect:t.reconnect,reconnect_interval:t.reconnect_interval,max_reconnects:t.max_reconnects},t.rest_options)),t}return(0,a.default)(f,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(e,t,n,r){var o=this;return r||"object"!==(0,i.default)(n)||(r=n,n=null),new Promise((function(i,a){if(!o.ready)return a(new Error("socket not ready"));var s=o.generate_request_id(e,t),u={jsonrpc:"2.0",method:e,params:t||null,id:s};o.socket.send(JSON.stringify(u),r,(function(e){if(e)return a(e);o.queue[s]={promise:[i,a]},n&&(o.queue[s].timeout=setTimeout((function(){delete o.queue[s],a(new Error("reply timeout"))}),n))}))}))}},{key:"login",value:(l=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("rpc.login",t);case 2:if(r=e.sent){e.next=5;break}throw new Error("authentication failed");case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"listMethods",value:(c=(0,r.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("__listMethods");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"notify",value:function(e,t){var n=this;return new Promise((function(r,i){if(!n.ready)return i(new Error("socket not ready"));var o={jsonrpc:"2.0",method:e,params:t||null};n.socket.send(JSON.stringify(o),(function(e){if(e)return i(e);r()}))}))}},{key:"subscribe",value:(u=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.on",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed subscribing to an event '"+t+"' with: "+r[t]);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"unsubscribe",value:(t=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.off",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed unsubscribing from an event with: "+r);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"close",value:function(e,t){this.socket.close(e||1e3,t)}},{key:"_connect",value:function(e,t){var n=this;clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",(function(){n.ready=!0,n.emit("open"),n.current_reconnects=0})),this.socket.addEventListener("message",(function(e){var t=e.data;t instanceof ArrayBuffer&&(t=Te.from(t).toString());try{t=JSON.parse(t)}catch(e){return}if(t.notification&&n.listeners(t.notification).length){if(!Object.keys(t.params).length)return n.emit(t.notification);var r=[t.notification];if(t.params.constructor===Object)r.push(t.params);else for(var i=0;in.current_reconnects||0===n.max_reconnects)&&(n.reconnect_timer_id=setTimeout((function(){return n._connect(e,t)}),n.reconnect_interval)))}))}}]),f}(l.EventEmitter);e.default=p}(jo);var pa=S(jo),fa={};!function(e){var t=Co.exports;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){return new u(e,t)};var n=t(Vo()),r=t(qo()),i=t(ea()),o=t(aa()),a=t(ca());function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,a.default)(e);if(t){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}var u=function(e){(0,i.default)(o,e);var t=s(o);function o(e,r,i){var a;return(0,n.default)(this,o),(a=t.call(this)).socket=new window.WebSocket(e,i),a.socket.onopen=function(){return a.emit("open")},a.socket.onmessage=function(e){return a.emit("message",e.data)},a.socket.onerror=function(e){return a.emit("error",e)},a.socket.onclose=function(e){a.emit("close",e.code,e.reason)},a}return(0,r.default)(o,[{key:"send",value:function(e,t,n){var r=n||t;try{this.socket.send(e),r()}catch(e){r(e)}}},{key:"close",value:function(e,t){this.socket.close(e,t)}},{key:"addEventListener",value:function(e,t,n){this.socket.addEventListener(e,t,n)}}]),o}(ha().EventEmitter)}(fa);for(var ya=S(fa),ma=[],ga=[],va=[],ba=BigInt(0),wa=BigInt(1),Ma=BigInt(2),Aa=BigInt(7),Ea=BigInt(256),Ta=BigInt(113),Na=0,Ia=wa,ka=1,La=0;Na<24;Na++){var xa=[La,(2*ka+3*La)%5];ka=xa[0],La=xa[1],ma.push(2*(5*La+ka)),ga.push((Na+1)*(Na+2)/2%64);for(var Sa=ba,ja=0;ja<7;ja++)(Ia=(Ia<>Aa)*Ta)%Ea)&Ma&&(Sa^=wa<<(wa<32?At.rotlBH(e,t,n):At.rotlSH(e,t,n)},_a=function(e,t,n){return n>32?At.rotlBL(e,t,n):At.rotlSL(e,t,n)};var Pa=function(e){Q(n,mt);var t=X(n);function n(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(R(this,n),(o=t.call(this)).blockLen=e,o.suffix=r,o.outputLen=i,o.enableXOF=a,o.rounds=s,o.pos=0,o.posOut=0,o.finished=!1,o.destroyed=!1,dt.number(i),0>=o.blockLen||o.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");return o.state=new Uint8Array(200),o.state32=ht(o.state),o}return U(n,[{key:"keccak",value:function(){!function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24,n=new Uint32Array(10),r=24-t;r<24;r++){for(var i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(var o=0;o<10;o+=2)for(var a=(o+8)%10,s=(o+2)%10,u=n[s],c=n[s+1],l=za(u,c,1)^n[a],d=_a(u,c,1)^n[a+1],h=0;h<50;h+=10)e[o+h]^=l,e[o+h+1]^=d;for(var p=e[2],f=e[3],y=0;y<24;y++){var m=ga[y],g=za(p,f,m),v=_a(p,f,m),b=ma[y];p=e[b],f=e[b+1],e[b]=g,e[b+1]=v}for(var w=0;w<50;w+=10){for(var M=0;M<10;M++)n[M]=e[w+M];for(var A=0;A<10;A++)e[w+A]^=~n[(A+2)%10]&n[(A+4)%10]}e[0]^=Da[r],e[1]^=Oa[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}},{key:"update",value:function(e){dt.exists(this);for(var t=this.blockLen,n=this.state,r=(e=yt(e)).length,i=0;i=n&&this.keccak();var o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}},{key:"xofInto",value:function(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}},{key:"xof",value:function(e){return dt.number(e),this.xofInto(new Uint8Array(e))}},{key:"digestInto",value:function(e){if(dt.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}},{key:"digest",value:function(){return this.digestInto(new Uint8Array(this.outputLen))}},{key:"destroy",value:function(){this.destroyed=!0,this.state.fill(0)}},{key:"_cloneInto",value:function(e){var t=this.blockLen,r=this.suffix,i=this.outputLen,o=this.rounds,a=this.enableXOF;return e||(e=new n(t,r,i,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}}]),n}(),Ra=function(e,t,n){return gt((function(){return new Pa(t,e,n)}))};Ra(6,144,28),Ra(6,136,32),Ra(6,104,48),Ra(6,72,64),Ra(1,144,28);var Ba=Ra(1,136,32);Ra(1,104,48),Ra(1,72,64);var Ua=function(e,t,n){return i=function(e,t){return r(t).update(yt(e)).digest()},o=(r=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Pa(t,e,void 0===r.dkLen?n:r.dkLen,!0)})({}),i.outputLen=o.outputLen,i.blockLen=o.blockLen,i.create=function(e){return r(e)},i;var r,i,o};Ua(31,168,16),Ua(31,136,32);var Wa=function(e){Q(n,mt);var t=X(n);function n(e,r){var i;R(this,n),(i=t.call(this)).finished=!1,i.destroyed=!1,dt.hash(e);var o=yt(r);if(i.iHash=e.create(),"function"!=typeof i.iHash.update)throw new TypeError("Expected instance of class which extends utils.Hash");i.blockLen=i.iHash.blockLen,i.outputLen=i.iHash.outputLen;var a=i.blockLen,s=new Uint8Array(a);s.set(o.length>a?e.create().update(o).digest():o);for(var u=0;ua,h=l>a;if(d&&(c=t-c),h&&(l=t-l),c>a||l>a)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:h,k2:l}};function Ka(e){var t=qa.a,n=qa.b,r=Es(e*e),i=Es(r*e);return Es(i+t*e+n)}var $a=qa.a===Ya,es=function(e){Q(n,G(Error));var t=X(n);function n(e){return R(this,n),t.call(this,e)}return U(n)}();function ts(e){if(!(e instanceof ns))throw new TypeError("JacobianPoint expected")}var ns=function(){function e(t,n,r){R(this,e),this.x=t,this.y=n,this.z=r}return U(e,[{key:"equals",value:function(e){ts(e);var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=Es(r*r),u=Es(a*a),c=Es(t*u),l=Es(i*s),d=Es(Es(n*a)*u),h=Es(Es(o*r)*s);return c===l&&d===h}},{key:"negate",value:function(){return new e(this.x,Es(-this.y),this.z)}},{key:"double",value:function(){var t=this.x,n=this.y,r=this.z,i=Es(t*t),o=Es(n*n),a=Es(o*o),s=t+o,u=Es(Va*(Es(s*s)-i-a)),c=Es(Ha*i),l=Es(c*c),d=Es(l-Va*u);return new e(d,Es(c*(u-d)-Ga*a),Es(Va*n*r))}},{key:"add",value:function(t){ts(t);var n=this.x,r=this.y,i=this.z,o=t.x,a=t.y,s=t.z;if(o===Ya||a===Ya)return this;if(n===Ya||r===Ya)return t;var u=Es(i*i),c=Es(s*s),l=Es(n*c),d=Es(o*u),h=Es(Es(r*s)*c),p=Es(Es(a*i)*u),f=Es(d-l),y=Es(p-h);if(f===Ya)return y===Ya?this.double():e.ZERO;var m=Es(f*f),g=Es(f*m),v=Es(l*m),b=Es(y*y-g-Va*v);return new e(b,Es(y*(v-b)-h*g),Es(i*s*f))}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiplyUnsafe",value:function(t){var n=e.ZERO;if("bigint"==typeof t&&t===Ya)return n;var r=As(t);if(r===Fa)return this;if(!$a){for(var i=n,o=this;r>Ya;)r&Fa&&(i=i.add(o)),o=o.double(),r>>=Fa;return i}for(var a=Xa(r),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,d=n,h=n,p=this;u>Ya||l>Ya;)u&Fa&&(d=d.add(p)),l&Fa&&(h=h.add(p)),p=p.double(),u>>=Fa,l>>=Fa;return s&&(d=d.negate()),c&&(h=h.negate()),h=new e(Es(h.x*Ja),h.y,h.z),d.add(h)}},{key:"precomputeWindow",value:function(e){for(var t=$a?128/e+1:256/e+1,n=[],r=this,i=r,o=0;o>=d,f>u&&(f-=l,t+=Fa);var y=p,m=p+Math.abs(f)-1,g=h%2!=0,v=f<0;0===f?a=a.add(rs(g,i[y])):o=o.add(rs(v,i[m]))}return{p:o,f:a}}},{key:"multiply",value:function(t,n){var r,i,o=As(t);if($a){var a=Xa(o),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,d=this.wNAF(u,n),h=d.p,p=d.f,f=this.wNAF(l,n),y=f.p,m=f.f;h=rs(s,h),y=new e(Es((y=rs(c,y)).x*Ja),y.y,y.z),r=h.add(y),i=p.add(m)}else{var g=this.wNAF(o,n);r=g.p,i=g.f}return e.normalizeZ([r,i])[0]}},{key:"toAffine",value:function(t){var n=this.x,r=this.y,i=this.z,o=this.equals(e.ZERO);null==t&&(t=o?Ga:Ns(i));var a=t,s=Es(a*a),u=Es(s*a),c=Es(n*s),l=Es(r*u),d=Es(i*a);if(o)return os.ZERO;if(d!==Fa)throw new Error("invZ was invalid");return new os(c,l)}}],[{key:"fromAffine",value:function(t){if(!(t instanceof os))throw new TypeError("JacobianPoint#fromAffine: expected Point");return t.equals(os.ZERO)?e.ZERO:new e(t.x,t.y,Fa)}},{key:"toAffineBatch",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qa.P,n=new Array(e.length),r=Ns(e.reduce((function(e,r,i){return r===Ya?e:(n[i]=e,Es(e*r,t))}),Fa),t);return e.reduceRight((function(e,r,i){return r===Ya?e:(n[i]=Es(e*n[i],t),Es(e*r,t))}),r),n}(e.map((function(e){return e.z})));return e.map((function(e,n){return e.toAffine(t[n])}))}},{key:"normalizeZ",value:function(t){return e.toAffineBatch(t).map(e.fromAffine)}}]),e}();function rs(e,t){var n=t.negate();return e?n:t}ns.BASE=new ns(qa.Gx,qa.Gy,Fa),ns.ZERO=new ns(Ya,Fa,Ya);var is=new WeakMap,os=function(){function e(t,n){R(this,e),this.x=t,this.y=n}return U(e,[{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,is.delete(this)}},{key:"hasEvenY",value:function(){return this.y%Va===Ya}},{key:"toRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return bs(this.toHex(e))}},{key:"toHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=ys(this.x);if(e){var n=this.hasEvenY()?"02":"03";return"".concat(n).concat(t)}return"04".concat(t).concat(ys(this.y))}},{key:"toHexX",value:function(){return this.toHex(!0).slice(2)}},{key:"toRawX",value:function(){return this.toRawBytes(!0).slice(1)}},{key:"assertValidity",value:function(){var e="Point is not on elliptic curve",t=this.x,n=this.y;if(!Ss(t)||!Ss(n))throw new Error(e);var r=Es(n*n);if(Es(r-Ka(t))!==Ya)throw new Error(e)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(this.x,Es(-this.y))}},{key:"double",value:function(){return ns.fromAffine(this).double().toAffine()}},{key:"add",value:function(e){return ns.fromAffine(this).add(ns.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return ns.fromAffine(this).multiply(e,this).toAffine()}},{key:"multiplyAndAddUnsafe",value:function(t,n,r){var i=ns.fromAffine(this),o=n===Ya||n===Fa||this!==e.BASE?i.multiplyUnsafe(n):i.multiply(n),a=ns.fromAffine(t).multiplyUnsafe(r),s=o.add(a);return s.equals(ns.ZERO)?void 0:s.toAffine()}}],[{key:"fromCompressedHex",value:function(t){var n=32===t.length,r=ws(n?t:t.subarray(1));if(!Ss(r))throw new Error("Point is not on curve");var i=function(e){var t=qa.P,n=BigInt(6),r=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),s=BigInt(88),u=e*e*e%t,c=u*u*e%t,l=Ts(c,Ha)*c%t,d=Ts(l,Ha)*c%t,h=Ts(d,Va)*u%t,p=Ts(h,r)*h%t,f=Ts(p,i)*p%t,y=Ts(f,a)*f%t,m=Ts(y,s)*y%t,g=Ts(m,a)*f%t,v=Ts(g,Ha)*c%t,b=Ts(v,o)*p%t,w=Ts(b,n)*u%t,M=Ts(w,Va);if(M*M%t!==e)throw new Error("Cannot find square root");return M}(Ka(r)),o=(i&Fa)===Fa;n?o&&(i=Es(-i)):1==(1&t[0])!==o&&(i=Es(-i));var a=new e(r,i);return a.assertValidity(),a}},{key:"fromUncompressedHex",value:function(t){var n=new e(ws(t.subarray(1,33)),ws(t.subarray(33,65)));return n.assertValidity(),n}},{key:"fromHex",value:function(e){var t=Ms(e),n=t.length,r=t[0];if(32===n)return this.fromCompressedHex(t);if(33===n&&(2===r||3===r))return this.fromCompressedHex(t);if(65===n&&4===r)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-".concat(33," compressed bytes or ").concat(65," uncompressed bytes, not ").concat(n))}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(Cs(t))}},{key:"fromSignature",value:function(t,n,r){var i=function(e){if(e instanceof us)return e.assertValidity(),e;try{return us.fromDER(e)}catch(t){return us.fromCompact(e)}}(n),o=i.r,a=i.s;if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");var s=ks(Ms(t)),u=qa.n,c=2===r||3===r?o+u:o,l=Ns(c,u),d=Es(-s*l,u),h=Es(a*l,u),p=1&r?"03":"02",f=e.fromHex(p+ys(c)),y=e.BASE.multiplyAndAddUnsafe(f,d,h);if(!y)throw new Error("Cannot recover signature: point at infinify");return y.assertValidity(),y}}]),e}();function as(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function ss(e){if(e.length<2||2!==e[0])throw new Error("Invalid signature integer tag: ".concat(ds(e)));var t=e[1],n=e.subarray(2,t+2);if(!t||n.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===n[0]&&n[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:ws(n),left:e.subarray(t+2)}}os.BASE=new os(qa.Gx,qa.Gy),os.ZERO=new os(Ya,Ya);var us=function(){function e(t,n){R(this,e),this.r=t,this.s=n,this.assertValidity()}return U(e,[{key:"assertValidity",value:function(){var e=this.r,t=this.s;if(!xs(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!xs(t))throw new Error("Invalid Signature: s must be 0 < s < n")}},{key:"hasHighS",value:function(){var e=qa.n>>Fa;return this.s>e}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,Es(-this.s,qa.n)):this}},{key:"toDERRawBytes",value:function(){return bs(this.toDERHex())}},{key:"toDERHex",value:function(){var e=as(gs(this.s)),t=as(gs(this.r)),n=e.length/2,r=t.length/2,i=gs(n),o=gs(r),a=gs(r+n+4);return"30".concat(a,"02").concat(o).concat(t,"02").concat(i).concat(e)}},{key:"toRawBytes",value:function(){return this.toDERRawBytes()}},{key:"toHex",value:function(){return this.toDERHex()}},{key:"toCompactRawBytes",value:function(){return bs(this.toCompactHex())}},{key:"toCompactHex",value:function(){return ys(this.r)+ys(this.s)}}],[{key:"fromCompact",value:function(t){var n=t instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof t&&!n)throw new TypeError("".concat(r,": Expected string or Uint8Array"));var i=n?ds(t):t;if(128!==i.length)throw new Error("".concat(r,": Expected 64-byte hex"));return new e(vs(i.slice(0,64)),vs(i.slice(64,128)))}},{key:"fromDER",value:function(t){var n=t instanceof Uint8Array;if("string"!=typeof t&&!n)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");var r=function(e){if(e.length<2||48!=e[0])throw new Error("Invalid signature tag: ".concat(ds(e)));if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");var t=ss(e.subarray(2)),n=t.data,r=ss(t.left),i=r.data,o=r.left;if(o.length)throw new Error("Invalid signature: left bytes after parsing: ".concat(ds(o)));return{r:n,s:i}}(n?t:bs(t));return new e(r.r,r.s)}},{key:"fromHex",value:function(e){return this.fromDER(e)}}]),e}();function cs(){for(var e=arguments.length,t=new Array(e),n=0;n0)return BigInt(e);if("bigint"==typeof e&&xs(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Es(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qa.P,n=e%t;return n>=Ya?n:t+n}function Ts(e,t){for(var n=qa.P,r=e;t-- >Ya;)r*=r,r%=n;return r}function Ns(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qa.P;if(e===Ya||t<=Ya)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var n=Es(e,t),r=t,i=Ya,o=Fa;n!==Ya;){var a=r/n,s=r%n,u=i-o*a;r=n,n=s,i=o,o=u}var c=r;if(c!==Fa)throw new Error("invert: does not exist");return Es(i,t)}function Is(e){var t=8*e.length-256,n=ws(e);return t>0?n>>BigInt(t):n}function ks(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Is(e);if(t)return n;var r=qa.n;return n>=r?n-r:n}var Ls=function(){function e(t,n){if(R(this,e),this.hashLen=t,this.qByteLen=n,"number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof n||n<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(t).fill(1),this.k=new Uint8Array(t).fill(0),this.counter=0}var t,n;return U(e,[{key:"hmac",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}},{key:"reseed",value:(n=P(O().mark((function e(){var t,n=arguments;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:new Uint8Array,e.next=3,this.hmac(this.v,Uint8Array.from([0]),t);case 3:return this.k=e.sent,e.next=6,this.hmac(this.v);case 6:if(this.v=e.sent,0!==t.length){e.next=9;break}return e.abrupt("return");case 9:return e.next=11,this.hmac(this.v,Uint8Array.from([1]),t);case 11:return this.k=e.sent,e.next=14,this.hmac(this.v);case 14:this.v=e.sent;case 15:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reseedSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}},{key:"generate",value:(t=P(O().mark((function e(){var t,n,r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.incr(),t=0,n=[];case 3:if(!(t3&&void 0!==arguments[3])||arguments[3],i=qa.n,o=ks(e,!0);if(xs(o)){var a=Ns(o,i),s=os.BASE.multiply(o),u=Es(s.x,i);if(u!==Ya){var c=Es(a*Es(t+n*u,i),i);if(c!==Ya){var l=new us(u,c),d=(s.x===l.r?0:2)|Number(s.y&Fa);return r&&l.hasHighS()&&(l=l.normalizeS(),d^=1),{sig:l,recovery:d}}}}}function Cs(e){var t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=vs(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=ws(e)}if(!xs(t))throw new Error("Expected private key: 0 < key < n");return t}function Ds(e){return ws(e.length>32?e.slice(0,32):e)}function Os(e){var t=Ds(e),n=Es(t,qa.n);return zs(n1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return ms(Es(ws(e),qa.n-Fa)+Fa)},randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(Us.web)return Us.web.getRandomValues(new Uint8Array(e));if(Us.node){var t=Us.node.randomBytes;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return Qs.hashToPrivateKey(Qs.randomBytes(40))},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:os.BASE,n=t===os.BASE?t:new os(t.x,t.y);return n._setWindowSize(e),n.multiply(Ha),n},sha256:function(){var e=P(O().mark((function e(){var t,n,r,i,o,a,s=arguments;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=s.length,n=new Array(t),r=0;r1?n-1:0),i=1;i1?i-1:0),a=1;a1?r-1:0),o=1;o32)throw new Error("Invalid public key input")}return t}return U(a,[{key:"equals",value:function(e){return this._bn.eq(e._bn)}},{key:"toBase58",value:function(){return _n.encode(this.toBytes())}},{key:"toJSON",value:function(){return this.toBase58()}},{key:"toBytes",value:function(){var e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}},{key:"toBuffer",value:function(){var e=this._bn.toArrayLike(Te);if(32===e.length)return e;var t=Te.alloc(32);return e.copy(t,32-e.length),t}},{key:t,get:function(){return"PublicKey(".concat(this.toString(),")")}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"unique",value:function(){var e=new a(ru);return ru+=1,new a(e.toBuffer())}},{key:"createWithSeed",value:(i=P(O().mark((function e(t,n,r){var i,o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Te.concat([t.toBuffer(),Te.from(n),r.toBuffer()]),o=Yn(i),e.abrupt("return",new a(o));case 3:case"end":return e.stop()}}),e)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"createProgramAddressSync",value:function(e,t){var n=Te.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");n=Te.concat([n,$s(e)])})),n=Te.concat([n,t.toBuffer(),Te.from("ProgramDerivedAddress")]);var r=Yn(n);if(Js(r))throw new Error("Invalid seeds, address must fall off the curve");return new a(r)}},{key:"createProgramAddress",value:(r=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.createProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"findProgramAddressSync",value:function(e,t){for(var n,r=255;0!=r;){try{var i=e.concat(Te.from([r]));n=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;r--;continue}return[n,r]}throw new Error("Unable to find a viable program address nonce")}},{key:"findProgramAddress",value:(n=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.findProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"isOnCurve",value:function(e){return Js(new a(e).toBytes())}}]),a}(0,Symbol.toStringTag);iu.default=new iu("11111111111111111111111111111111"),nu.set(iu,{kind:"struct",fields:[["_bn","u256"]]});var ou=function(){function e(t){if(R(this,e),this._publicKey=void 0,this._secretKey=void 0,t){var n=$s(t);if(64!==t.length)throw new Error("bad secret key size");this._publicKey=n.slice(32,64),this._secretKey=n.slice(0,32)}else this._secretKey=$s(Gs()),this._publicKey=$s(Zs(this._secretKey))}return U(e,[{key:"publicKey",get:function(){return new iu(this._publicKey)}},{key:"secretKey",get:function(){return Te.concat([this._secretKey,this._publicKey],64)}}]),e}(),au=new iu("BPFLoader1111111111111111111111111111111111"),su=function(e){Q(n,G(Error));var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: block height exceeded."))).signature=void 0,r.signature=e,r}return U(n)}();Object.defineProperty(su.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var uu=function(e){Q(n,G(Error));var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,"Transaction was not confirmed in ".concat(r.toFixed(2)," seconds. It is ")+"unknown if it succeeded or failed. Check signature "+"".concat(e," using the Solana Explorer or CLI tools."))).signature=void 0,i.signature=e,i}return U(n)}();Object.defineProperty(uu.prototype,"name",{value:"TransactionExpiredTimeoutError"});var cu=function(e){Q(n,G(Error));var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: the nonce is no longer valid."))).signature=void 0,r.signature=e,r}return U(n)}();Object.defineProperty(cu.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});var lu=function(){function e(t,n){R(this,e),this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=n}return U(e,[{key:"keySegments",value:function(){var e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}},{key:"get",value:function(e){var t,n=se(this.keySegments());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e256)throw new Error("Account index overflow encountered during compilation");var t=new Map;this.keySegments().flat().forEach((function(e,n){t.set(e.toBase58(),n)}));var n=function(e){var n=t.get(e.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return e.map((function(e){return{programIdIndex:n(e.programId),accountKeyIndexes:e.keys.map((function(e){return n(e.pubkey)})),data:e.data}}))}}]),e}(),du=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return mi(32,e)},hu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature";return mi(64,e)},pu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",t=fi([di("length"),di("lengthPadding"),mi(ui(di(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=function(e,t){return n(e,t).chars.toString()},i.encode=function(e,t,n){var i={chars:Te.from(e,"utf8")};return r(i,t,n)},i.alloc=function(e){return di().span+di().span+Te.from(e,"utf8").length},i};function fu(e,t){var n=function e(n){if(n.span>=0)return n.span;if("function"==typeof n.alloc)return n.alloc(t[n.property]);if("count"in n&&"elementLayout"in n){var r=t[n.property];if(Array.isArray(r))return r.length*e(n.elementLayout)}else if("fields"in n)return fu({layout:n},t[n.property]);return 0},r=0;return e.layout.fields.forEach((function(e){r+=n(e)})),r}function yu(e){for(var t=0,n=0;;){var r=e.shift();if(t|=(127&r)<<7*n,n+=1,0==(128&r))break}return t}function mu(e,t){for(var n=t;;){var r=127&n;if(0==(n>>=7)){e.push(r);break}r|=128,e.push(r)}}function gu(e,t){if(!e)throw new Error(t||"Assertion failed")}var vu,bu=function(){function e(t,n){R(this,e),this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=n}return U(e,[{key:"getMessageComponents",value:function(){var e=te(this.keyMetaMap.entries());gu(e.length<=256,"Max static account keys length exceeded");var t=e.filter((function(e){var t=ee(e,2)[1];return t.isSigner&&t.isWritable})),n=e.filter((function(e){var t=ee(e,2)[1];return t.isSigner&&!t.isWritable})),r=e.filter((function(e){var t=ee(e,2)[1];return!t.isSigner&&t.isWritable})),i=e.filter((function(e){var t=ee(e,2)[1];return!t.isSigner&&!t.isWritable})),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};return gu(t.length>0,"Expected at least one writable signer key"),gu(ee(t[0],1)[0]===this.payer.toBase58(),"Expected first writable signer key to be the fee payer"),[o,[].concat(te(t.map((function(e){var t=ee(e,1)[0];return new iu(t)}))),te(n.map((function(e){var t=ee(e,1)[0];return new iu(t)}))),te(r.map((function(e){var t=ee(e,1)[0];return new iu(t)}))),te(i.map((function(e){var t=ee(e,1)[0];return new iu(t)}))))]}},{key:"extractTableLookup",value:function(e){var t=ee(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&e.isWritable})),2),n=t[0],r=t[1],i=ee(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&!e.isWritable})),2),o=i[0],a=i[1];if(0!==n.length||0!==o.length)return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:o},{writable:r,readonly:a}]}},{key:"drainKeysFoundInLookupTable",value:function(e,t){var n,r=this,i=new Array,o=new Array,a=se(this.keyMetaMap.entries());try{var s=function(){var a=ee(n.value,2),s=a[0],u=a[1];if(t(u)){var c=new iu(s),l=e.findIndex((function(e){return e.equals(c)}));l>=0&&(gu(l<256,"Max lookup table index exceeded"),i.push(l),o.push(c),r.keyMetaMap.delete(s))}};for(a.s();!(n=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return[i,o]}}],[{key:"compile",value:function(t,n){var r=new Map,i=function(e){var t=e.toBase58(),n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},o=i(n);o.isSigner=!0,o.isWritable=!0;var a,s=se(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;i(u.programId).isInvoked=!0;var c,l=se(u.keys);try{for(l.s();!(c=l.n()).done;){var d=c.value,h=i(d.pubkey);h.isSigner||(h.isSigner=d.isSigner),h.isWritable||(h.isWritable=d.isWritable)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){s.e(e)}finally{s.f()}return new e(n,r)}}]),e}(),wu=function(){function e(t){var n=this;R(this,e),this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((function(e){return new iu(e)})),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((function(e){return n.indexToProgramIds.set(e.programIdIndex,n.accountKeys[e.programIdIndex])}))}return U(e,[{key:"version",get:function(){return"legacy"}},{key:"staticAccountKeys",get:function(){return this.accountKeys}},{key:"compiledInstructions",get:function(){return this.instructions.map((function(e){return{programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:_n.decode(e.data)}}))}},{key:"addressTableLookups",get:function(){return[]}},{key:"getAccountKeys",value:function(){return new lu(this.staticAccountKeys)}},{key:"isAccountSigner",value:function(e){return e=this.header.numRequiredSignatures?e-t0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new lu(this.staticAccountKeys,t)}},{key:"isAccountSigner",value:function(e){return e=n?e-n=this.header.numRequiredSignatures?e-t0?this.signatures[0].signature:null}},{key:"toJSON",value:function(){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((function(e){return e.toJSON()})),signers:this.signatures.map((function(e){return e.publicKey.toJSON()}))}}},{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(var r=0;r-1?(a[n].isWritable=a[n].isWritable||e.isWritable,a[n].isSigner=a[n].isSigner||e.isSigner):a.push(e)})),a.sort((function(e,t){return e.isSigner!==t.isSigner?e.isSigner?-1:1:e.isWritable!==t.isWritable?e.isWritable?-1:1:e.pubkey.toBase58().localeCompare(t.pubkey.toBase58())}));var s=a.findIndex((function(e){return e.pubkey.equals(n)}));if(s>-1){var u=ee(a.splice(s,1),1)[0];u.isSigner=!0,u.isWritable=!0,a.unshift(u)}else a.unshift({pubkey:n,isSigner:!0,isWritable:!0});var c,l=se(this.signatures);try{var d=function(){var e=c.value,t=a.findIndex((function(t){return t.pubkey.equals(e.publicKey)}));if(!(t>-1))throw new Error("unknown signer: ".concat(e.publicKey.toString()));a[t].isSigner||(a[t].isSigner=!0,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."))};for(l.s();!(c=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}var h=0,p=0,f=0,y=[],m=[];a.forEach((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;n?(y.push(t.toString()),h+=1,r||(p+=1)):(m.push(t.toString()),r||(f+=1))}));var g=y.concat(m),v=t.map((function(e){var t=e.data,n=e.programId;return{programIdIndex:g.indexOf(n.toString()),accounts:e.keys.map((function(e){return g.indexOf(e.pubkey.toString())})),data:_n.encode(t)}}));return v.forEach((function(e){gu(e.programIdIndex>=0),e.accounts.forEach((function(e){return gu(e>=0)}))})),new wu({header:{numRequiredSignatures:h,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:f},accountKeys:g,recentBlockhash:e,instructions:v})}},{key:"_compile",value:function(){var e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length&&this.signatures.every((function(e,n){return t[n].equals(e.publicKey)})))return e;return this.signatures=t.map((function(e){return{signature:null,publicKey:e}})),e}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"getEstimatedFee",value:(t=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getFeeForMessage(this.compileMessage());case 2:return e.abrupt("return",e.sent.value);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setSigners",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),o=1;o ").concat(1232)),i}},{key:"keys",get:function(){return gu(1===this.instructions.length),this.instructions[0].keys.map((function(e){return e.pubkey}))}},{key:"programId",get:function(){return gu(1===this.instructions.length),this.instructions[0].programId}},{key:"data",get:function(){return gu(1===this.instructions.length),this.instructions[0].data}}],[{key:"from",value:function(t){for(var n=te(t),r=yu(n),i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:[],r=new e;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),n.forEach((function(e,n){var i={signature:e==_n.encode(Eu)?null:_n.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)})),t.instructions.forEach((function(e){var n=e.accounts.map((function(e){var n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some((function(e){return e.publicKey.toString()===n.toString()}))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));r.instructions.push(new Tu({keys:n,programId:t.accountKeys[e.programIdIndex],data:_n.decode(e.data)}))})),r._message=t,r._json=r.toJSON(),r}}]),e}(),Iu=function(){function e(t){R(this,e),this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}return U(e,[{key:"compileToLegacyMessage",value:function(){return wu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}},{key:"compileToV0Message",value:function(e){return Mu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}],[{key:"decompile",value:function(t,n){var r=t.header,i=t.compiledInstructions,o=t.recentBlockhash,a=r.numRequiredSignatures,s=r.numReadonlySignedAccounts,u=r.numReadonlyUnsignedAccounts,c=a-s;gu(c>0,"Message header is invalid");var l=t.staticAccountKeys.length-a-u;gu(l>=0,"Message header is invalid");var d=t.getAccountKeys(n),h=d.get(0);if(void 0===h)throw new Error("Failed to decompile message because no account keys were found");var p,f=[],y=se(i);try{for(y.s();!(p=y.n()).done;){var m,g=p.value,v=[],b=se(g.accountKeyIndexes);try{for(b.s();!(m=b.n()).done;){var w=m.value,M=d.get(w);if(void 0===M)throw new Error("Failed to find key for account key index ".concat(w));var A=void 0;A=w=0,"Cannot sign with non signer key ".concat(e.publicKey.toBase58())),n.signatures[o]=Xs(r,e.secretKey)};for(o.s();!(t=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}}},{key:"addSignature",value:function(e,t){gu(64===t.byteLength,"Signature must be 64 bytes long");var n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((function(t){return t.equals(e)}));gu(n>=0,"Can not add signature; `".concat(e.toBase58(),"` is not required to sign this transaction")),this.signatures[n]=t}}],[{key:"deserialize",value:function(t){for(var n=te(t),r=[],i=yu(n),o=0;o=0?e.layout.span:fu(e,t),r=Te.alloc(n),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,r),r}function Wu(e,t){var n;try{n=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(n.instruction!==e.index)throw new Error("invalid instruction; instruction index mismatch ".concat(n.instruction," != ").concat(e.index));return n}var Qu,Yu=hi("lamportsPerSignature"),Fu=fi([di("version"),di("state"),du("authorizedPubkey"),du("nonce"),fi([Yu],"feeCalculator")]),Vu=Fu.span,Hu=function(){function e(t){R(this,e),this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}return U(e,null,[{key:"fromAccountData",value:function(t){var n=Fu.decode($s(t),0);return new e({authorizedPubkey:new iu(n.authorizedPubkey),nonce:new iu(n.nonce).toString(),feeCalculator:n.feeCalculator})}}]),e}(),Gu=(Qu=8,function(e){var t=mi(Qu,e),n=function(e){return{decode:e.decode.bind(e),encode:e.encode.bind(e)}}(t),r=n.encode,i=n.decode,o=t;return o.decode=function(e,t){var n=i(e,t);return vi(Te.from(n))},o.encode=function(e,t,n){var i=bi(e,Qu);return r(i,t,n)},o}),qu=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=di("instruction").decode(e.data),r=0,i=Object.entries(Zu);r0?s:1,space:a.length,programId:o}));case 17:if(null===c){t.next=20;break}return t.next=20,Pu(n,c,[r,i],{commitment:"confirmed"});case 20:l=fi([di("instruction"),di("offset"),di("bytesLength"),di("bytesLengthPadding"),yi(ci("byte"),ui(di(),-8),"bytes")]),d=e.chunkSize,h=0,p=a,f=[];case 25:if(!(p.length>0)){t.next=39;break}if(y=p.slice(0,d),m=Te.alloc(d+16),l.encode({instruction:0,offset:h,bytes:y,bytesLength:0,bytesLengthPadding:0},m),g=(new Nu).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:m}),f.push(Pu(n,g,[r,i],{commitment:"confirmed"})),!n._rpcEndpoint.includes("solana.com")){t.next=35;break}return t.next=35,Bu(250);case 35:h+=d,p=p.slice(d),t.next=25;break;case 39:return t.next=41,Promise.all(f);case 41:return v=fi([di("instruction")]),b=Te.alloc(v.span),v.encode({instruction:1},b),w=(new Nu).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0},{pubkey:Cu,isSigner:!1,isWritable:!1}],programId:o,data:b}),t.next=47,Pu(n,w,[r,i],{commitment:"confirmed"});case 47:return t.abrupt("return",!0);case 48:case"end":return t.stop()}}),t)}))),function(e,n,r,i,o){return t.apply(this,arguments)})}]),e}();Xu.chunkSize=932;var Ku=new iu("BPFLoader2111111111111111111111111111111111"),$u=function(){function e(){R(this,e)}return U(e,null,[{key:"getMinNumSignatures",value:function(e){return Xu.getMinNumSignatures(e)}},{key:"load",value:function(e,t,n,r,i){return Xu.load(e,t,n,i,r)}}]),e}(),ec=Object.prototype.toString,tc=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function nc(e,t){var n,r,i,o,a,s,u;if(!0===e)return"true";if(!1===e)return"false";switch(z(e)){case"object":if(null===e)return null;if(e.toJSON&&"function"==typeof e.toJSON)return nc(e.toJSON(),t);if("[object Array]"===(u=ec.call(e))){for(i="[",r=e.length-1,n=0;n-1&&(i+=nc(e[n],!0)),i+"]"}if("[object Object]"===u){for(r=(o=tc(e).sort()).length,i="",n=0;n1;)e/=2,t++;return t}var oc=function(){function e(t,n,r,i,o){R(this,e),this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=n,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=o}return U(e,[{key:"getEpoch",value:function(e){return this.getEpochAndSlotIndex(e)[0]}},{key:"getEpochAndSlotIndex",value:function(e){if(e>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,1+(e|=e>>32))}(e+32+1))-ic(32)-1;return[t,e-(this.getSlotsInEpoch(t)-32)]}var n=e-this.firstNormalSlot,r=Math.floor(n/this.slotsPerEpoch);return[this.firstNormalEpoch+r,n%this.slotsPerEpoch]}},{key:"getFirstSlotInEpoch",value:function(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}},{key:"getLastSlotInEpoch",value:function(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}},{key:"getSlotsInEpoch",value:function(e){return e0&&(i.until=a.signatures[a.signatures.length-1].toString()),e.next=22;break;case 15:if(e.prev=15,e.t0=e.catch(8),!(e.t0 instanceof Error&&e.t0.message.includes("skipped"))){e.next=21;break}return e.abrupt("continue",4);case 21:throw e.t0;case 22:e.next=4;break;case 24:return e.next=26,this.getSlot("finalized");case 26:s=e.sent;case 27:if("before"in i){e.next=47;break}if(!(++r>s)){e.next=31;break}return e.abrupt("break",47);case 31:return e.prev=31,e.next=34,this.getConfirmedBlockSignatures(r);case 34:(u=e.sent).signatures.length>0&&(i.before=u.signatures[u.signatures.length-1].toString()),e.next=45;break;case 38:if(e.prev=38,e.t1=e.catch(31),!(e.t1 instanceof Error&&e.t1.message.includes("skipped"))){e.next=44;break}return e.abrupt("continue",27);case 44:throw e.t1;case 45:e.next=27;break;case 47:return e.next=49,this.getConfirmedSignaturesForAddress2(t,i);case 49:return c=e.sent,e.abrupt("return",c.map((function(e){return e.signature})));case 51:case"end":return e.stop()}}),e,this,[[8,15],[31,38]])}))),function(e,t,n){return E.apply(this,arguments)})},{key:"getConfirmedSignaturesForAddress2",value:(A=P(O().mark((function e(t,n,r){var i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getConfirmedSignaturesForAddress2",i);case 3:if(o=e.sent,!("error"in(a=Di(o,nl)))){e.next=7;break}throw new sc(a.error,"failed to get confirmed signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return A.apply(this,arguments)})},{key:"getSignaturesForAddress",value:(M=P(O().mark((function e(t,n,r){var i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getSignaturesForAddress",i);case 3:if(o=e.sent,!("error"in(a=Di(o,rl)))){e.next=7;break}throw new sc(a.error,"failed to get signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return M.apply(this,arguments)})},{key:"getAddressLookupTable",value:(w=P(O().mark((function e(t,n){var r,i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=new lc({key:t,state:lc.deserialize(o.data)})),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getNonceAndContext",value:(b=P(O().mark((function e(t,n){var r,i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=Hu.fromAccountData(o.data)),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getNonce",value:(v=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNonceAndContext(t,n).then((function(e){return e.value})).catch((function(e){throw new Error("failed to get nonce for account "+t.toBase58()+": "+e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"requestAirdrop",value:(g=P(O().mark((function e(t,n){var r,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("requestAirdrop",[t.toBase58(),n]);case 2:if(r=e.sent,!("error"in(i=Di(r,ql)))){e.next=6;break}throw new sc(i.error,"airdrop to ".concat(t.toBase58()," failed"));case 6:return e.abrupt("return",i.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"_blockhashWithExpiryBlockHeight",value:(m=P(O().mark((function e(t){var n,r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=10;break}case 1:if(!this._pollingBlockhash){e.next=6;break}return e.next=4,Bu(100);case 4:e.next=1;break;case 6:if(n=Date.now()-this._blockhashInfo.lastFetch,r=n>=3e4,null===this._blockhashInfo.latestBlockhash||r){e.next=10;break}return e.abrupt("return",this._blockhashInfo.latestBlockhash);case 10:return e.next=12,this._pollNewBlockhash();case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"_pollNewBlockhash",value:(y=P(O().mark((function e(){var t,n,r,i,o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._pollingBlockhash=!0,e.prev=1,t=Date.now(),n=this._blockhashInfo.latestBlockhash,r=n?n.blockhash:null,i=0;case 6:if(!(i<50)){e.next=18;break}return e.next=9,this.getLatestBlockhash("finalized");case 9:if(o=e.sent,r===o.blockhash){e.next=13;break}return this._blockhashInfo={latestBlockhash:o,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e.abrupt("return",o);case 13:return e.next=15,Bu(200);case 15:i++,e.next=6;break;case 18:throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-t,"ms"));case 19:return e.prev=19,this._pollingBlockhash=!1,e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[1,,19,22]])}))),function(){return y.apply(this,arguments)})},{key:"getStakeMinimumDelegation",value:(f=P(O().mark((function e(t){var n,r,i,o,a,s;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=mc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,"base64",i),e.next=4,this._rpcRequest("getStakeMinimumDelegation",o);case 4:if(a=e.sent,!("error"in(s=Di(a,wc(Qi()))))){e.next=8;break}throw new sc(s.error,"failed to get stake minimum delegation");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"simulateTransaction",value:(p=P(O().mark((function e(t,n,r){var i,o,a,s,u,c,l,d,h,p,f,y,m,g,v,b,w,M,A,E,T,N,I,k,L,x;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("message"in t)){e.next=17;break}if(i=t.serialize(),o=Te.from(i).toString("base64"),!Array.isArray(n)&&void 0===r){e.next=6;break}throw new Error("Invalid arguments");case 6:return(a=n||{}).encoding="base64","commitment"in a||(a.commitment=this.commitment),s=[o,a],e.next=12,this._rpcRequest("simulateTransaction",s);case 12:if(u=e.sent,!("error"in(c=Di(u,Oc)))){e.next=16;break}throw new Error("failed to simulate transaction: "+c.error.message);case 16:return e.abrupt("return",c.result);case 17:if(t instanceof Nu?(d=t,(l=new Nu).feePayer=d.feePayer,l.instructions=t.instructions,l.nonceInfo=d.nonceInfo,l.signatures=d.signatures):(l=Nu.populate(t))._message=l._json=void 0,void 0===n||Array.isArray(n)){e.next=20;break}throw new Error("Invalid arguments");case 20:if(h=n,!l.nonceInfo||!h){e.next=25;break}(p=l).sign.apply(p,te(h)),e.next=45;break;case 25:f=this._disableBlockhashCaching;case 26:return e.next=28,this._blockhashWithExpiryBlockHeight(f);case 28:if(m=e.sent,l.lastValidBlockHeight=m.lastValidBlockHeight,l.recentBlockhash=m.blockhash,h){e.next=33;break}return e.abrupt("break",45);case 33:if((y=l).sign.apply(y,te(h)),l.signature){e.next=36;break}throw new Error("!signature");case 36:if(g=l.signature.toString("base64"),this._blockhashInfo.simulatedSignatures.includes(g)||this._blockhashInfo.transactionSignatures.includes(g)){e.next=42;break}return this._blockhashInfo.simulatedSignatures.push(g),e.abrupt("break",45);case 42:f=!0;case 43:e.next=26;break;case 45:return v=l._compile(),b=v.serialize(),w=l._serialize(b),M=w.toString("base64"),A={encoding:"base64",commitment:this.commitment},r&&(E=(Array.isArray(r)?r:v.nonProgramIds()).map((function(e){return e.toBase58()})),A.accounts={encoding:"base64",addresses:E}),h&&(A.sigVerify=!0),T=[M,A],e.next=55,this._rpcRequest("simulateTransaction",T);case 55:if(N=e.sent,!("error"in(I=Di(N,Oc)))){e.next=60;break}throw"data"in I.error&&(k=I.error.data.logs)&&Array.isArray(k)&&(x=(L="\n ")+k.join(L),console.error(I.error.message,x)),new ac("failed to simulate transaction: "+I.error.message,k);case 60:return e.abrupt("return",I.result);case 61:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"sendTransaction",value:(h=P(O().mark((function e(t,n,r){var i,o,a,s,u,c;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("version"in t)){e.next=7;break}if(!n||!Array.isArray(n)){e.next=3;break}throw new Error("Invalid arguments");case 3:return i=t.serialize(),e.next=6,this.sendRawTransaction(i,n);case 6:return e.abrupt("return",e.sent);case 7:if(void 0!==n&&Array.isArray(n)){e.next=9;break}throw new Error("Invalid arguments");case 9:if(o=n,!t.nonceInfo){e.next=14;break}t.sign.apply(t,te(o)),e.next=32;break;case 14:a=this._disableBlockhashCaching;case 15:return e.next=17,this._blockhashWithExpiryBlockHeight(a);case 17:if(s=e.sent,t.lastValidBlockHeight=s.lastValidBlockHeight,t.recentBlockhash=s.blockhash,t.sign.apply(t,te(o)),t.signature){e.next=23;break}throw new Error("!signature");case 23:if(u=t.signature.toString("base64"),this._blockhashInfo.transactionSignatures.includes(u)){e.next=29;break}return this._blockhashInfo.transactionSignatures.push(u),e.abrupt("break",32);case 29:a=!0;case 30:e.next=15;break;case 32:return c=t.serialize(),e.next=35,this.sendRawTransaction(c,r);case 35:return e.abrupt("return",e.sent);case 36:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"sendRawTransaction",value:(d=P(O().mark((function e(t,n){var r,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=$s(t).toString("base64"),e.next=3,this.sendEncodedTransaction(r,n);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"sendEncodedTransaction",value:(l=P(O().mark((function e(t,n){var r,i,o,a,s,u,c;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={encoding:"base64"},i=n&&n.skipPreflight,o=n&&n.preflightCommitment||this.commitment,n&&null!=n.maxRetries&&(r.maxRetries=n.maxRetries),n&&null!=n.minContextSlot&&(r.minContextSlot=n.minContextSlot),i&&(r.skipPreflight=i),o&&(r.preflightCommitment=o),a=[t,r],e.next=10,this._rpcRequest("sendTransaction",a);case 10:if(s=e.sent,!("error"in(u=Di(s,Zl)))){e.next=15;break}throw"data"in u.error&&(c=u.error.data.logs),new ac("failed to send transaction: "+u.error.message,c);case 15:return e.abrupt("return",u.result);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"_wsOnOpen",value:function(){var e=this;this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((function(){P(O().mark((function t(){return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._rpcWebSocket.notify("ping");case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})))()}),5e3),this._updateSubscriptions()}},{key:"_wsOnError",value:function(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}},{key:"_wsOnClose",value:function(e){var t=this;this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((function(e){var n=ee(e,2),r=n[0],i=n[1];t._setSubscription(r,D(D({},i),{},{state:"pending"}))}))):this._updateSubscriptions()}},{key:"_setSubscription",value:function(e,t){var n,r=null===(n=this._subscriptionsByHash[e])||void 0===n?void 0:n.state;if(this._subscriptionsByHash[e]=t,r!==t.state){var i=this._subscriptionStateChangeCallbacksByHash[e];i&&i.forEach((function(e){try{e(t.state)}catch(e){}}))}}},{key:"_onSubscriptionStateChange",value:function(e,t){var n,r=this,i=this._subscriptionHashByClientSubscriptionId[e];if(null==i)return function(){};var o=(n=this._subscriptionStateChangeCallbacksByHash)[i]||(n[i]=new Set);return o.add(t),function(){o.delete(t),0===o.size&&delete r._subscriptionStateChangeCallbacksByHash[i]}}},{key:"_updateSubscriptions",value:(c=P(O().mark((function e(){var t,n,r=this;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==Object.keys(this._subscriptionsByHash).length){e.next=3;break}return this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((function(){r._rpcWebSocketIdleTimeout=null;try{r._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log("Error when closing socket connection: ".concat(e.message))}}),500)),e.abrupt("return");case 3:if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),this._rpcWebSocketConnected){e.next=7;break}return this._rpcWebSocket.connect(),e.abrupt("return");case 7:return t=this._rpcWebSocketGeneration,n=function(){return t===r._rpcWebSocketGeneration},e.next=11,Promise.all(Object.keys(this._subscriptionsByHash).map(function(){var e=P(O().mark((function e(t){var i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(i=r._subscriptionsByHash[t])){e.next=3;break}return e.abrupt("return");case 3:e.t0=i.state,e.next="pending"===e.t0||"unsubscribed"===e.t0?6:"subscribed"===e.t0?15:19;break;case 6:if(0!==i.callbacks.size){e.next=12;break}return delete r._subscriptionsByHash[t],"unsubscribed"===i.state&&delete r._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],e.next=11,r._updateSubscriptions();case 11:return e.abrupt("return");case 12:return e.next=14,P(O().mark((function e(){var o,a,s;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.args,a=i.method,e.prev=1,r._setSubscription(t,D(D({},i),{},{state:"subscribing"})),e.next=5,r._rpcWebSocket.call(a,o);case 5:return s=e.sent,r._setSubscription(t,D(D({},i),{},{serverSubscriptionId:s,state:"subscribed"})),r._subscriptionCallbacksByServerSubscriptionId[s]=i.callbacks,e.next=10,r._updateSubscriptions();case 10:e.next=20;break;case 12:if(e.prev=12,e.t0=e.catch(1),e.t0 instanceof Error&&console.error("".concat(a," error for argument"),o,e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,D(D({},i),{},{state:"pending"})),e.next=20,r._updateSubscriptions();case 20:case"end":return e.stop()}}),e,null,[[1,12]])})))();case 14:return e.abrupt("break",19);case 15:if(0!==i.callbacks.size){e.next=18;break}return e.next=18,P(O().mark((function e(){var o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=i.serverSubscriptionId,a=i.unsubscribeMethod,!r._subscriptionsAutoDisposedByRpc.has(o)){e.next=5;break}r._subscriptionsAutoDisposedByRpc.delete(o),e.next=21;break;case 5:return r._setSubscription(t,D(D({},i),{},{state:"unsubscribing"})),r._setSubscription(t,D(D({},i),{},{state:"unsubscribing"})),e.prev=7,e.next=10,r._rpcWebSocket.call(a,[o]);case 10:e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(7),e.t0 instanceof Error&&console.error("".concat(a," error:"),e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,D(D({},i),{},{state:"subscribed"})),e.next=20,r._updateSubscriptions();case 20:return e.abrupt("return");case 21:return r._setSubscription(t,D(D({},i),{},{state:"unsubscribed"})),e.next=24,r._updateSubscriptions();case 24:case"end":return e.stop()}}),e,null,[[7,12]])})))();case 18:return e.abrupt("break",19);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 11:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_handleServerNotification",value:function(e,t){var n=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==n&&n.forEach((function(e){try{e.apply(void 0,te(t))}catch(e){console.error(e)}}))}},{key:"_wsOnAccountNotification",value:function(e){var t=Di(e,il),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_makeSubscription",value:function(e,t){var n=this,r=this._nextClientSubscriptionId++,i=rc([e.method,t]),o=this._subscriptionsByHash[i];return void 0===o?this._subscriptionsByHash[i]=D(D({},e),{},{args:t,callbacks:new Set([e.callback]),state:"pending"}):o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=P(O().mark((function t(){var o;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return delete n._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete n._subscriptionHashByClientSubscriptionId[r],gu(void 0!==(o=n._subscriptionsByHash[i]),"Could not find a `Subscription` when tearing down client subscription #".concat(r)),o.callbacks.delete(e.callback),t.next=7,n._updateSubscriptions();case 7:case"end":return t.stop()}}),t)}))),this._updateSubscriptions(),r}},{key:"onAccountChange",value:function(e,t,n){var r=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},r)}},{key:"removeAccountChangeListener",value:(u=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_wsOnProgramAccountNotification",value:function(e){var t=Di(e,al),n=t.result,r=t.subscription;this._handleServerNotification(r,[{accountId:n.value.pubkey,accountInfo:n.value.account},n.context])}},{key:"onProgramAccountChange",value:function(e,t,n,r){var i=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",r?{filters:r}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}},{key:"removeProgramAccountChangeListener",value:(s=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"program account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"onLogs",value:function(e,t,n){var r=this._buildArgs(["object"===z(e)?{mentions:[e.toString()]}:e],n||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},r)}},{key:"removeOnLogsListener",value:(a=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"logs");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_wsOnLogsNotification",value:function(e){var t=Di(e,Xl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_wsOnSlotNotification",value:function(e){var t=Di(e,ul),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotChange",value:function(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}},{key:"removeSlotChangeListener",value:(o=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_wsOnSlotUpdatesNotification",value:function(e){var t=Di(e,ll),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotUpdate",value:function(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}},{key:"removeSlotUpdateListener",value:(i=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot update");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_unsubscribeClientSubscription",value:(r=P(O().mark((function e(t,n){var r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t])){e.next=6;break}return e.next=4,r();case 4:e.next=7;break;case 6:console.warn("Ignored unsubscribe request because an active subscription with id "+"`".concat(t,"` for '").concat(n,"' events ")+"could not be found.");case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"_buildArgs",value:function(e,t,n,r){var i=t||this._commitment;if(i||n||r){var o={};n&&(o.encoding=n),i&&(o.commitment=i),r&&(o=Object.assign(o,r)),e.push(o)}return e}},{key:"_buildArgsAtLeastConfirmed",value:function(e,t,n,r){var i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,n,r)}},{key:"_wsOnSignatureNotification",value:function(e){var t=Di(e,dl),n=t.result,r=t.subscription;"receivedSignature"!==n.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===n.value?[{type:"received"},n.context]:[{type:"status",result:n.value},n.context])}},{key:"onSignature",value:function(e,t,n){var r=this,i=this._buildArgs([e],n||this._commitment||"finalized"),o=this._makeSubscription({callback:function(e,n){if("status"===e.type){t(e.result,n);try{r.removeSignatureListener(o)}catch(e){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return o}},{key:"onSignatureWithOptions",value:function(e,t,n){var r=this,i=D(D({},n),{},{commitment:n&&n.commitment||this._commitment||"finalized"}),o=i.commitment,a=q(i,Hs),s=this._buildArgs([e],o,void 0,a),u=this._makeSubscription({callback:function(e,n){t(e,n);try{r.removeSignatureListener(u)}catch(e){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return u}},{key:"removeSignatureListener",value:(n=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"signature result");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_wsOnRootNotification",value:function(e){var t=Di(e,hl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onRootChange",value:function(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}},{key:"removeRootChangeListener",value:(t=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"root change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),ed=function(){function e(t){R(this,e),this._keypair=void 0,this._keypair=null!=t?t:qs()}return U(e,[{key:"publicKey",get:function(){return new iu(this._keypair.publicKey)}},{key:"secretKey",get:function(){return new Uint8Array(this._keypair.secretKey)}}],[{key:"generate",value:function(){return new e(qs())}},{key:"fromSecretKey",value:function(t,n){if(64!==t.byteLength)throw new Error("bad secret key size");var r=t.slice(32,64);if(!n||!n.skipValidation)for(var i=t.slice(0,32),o=Zs(i),a=0;a<32;a++)if(r[a]!==o[a])throw new Error("provided secretKey is invalid");return new e({publicKey:r,secretKey:t})}},{key:"fromSeed",value:function(t){var n=Zs(t),r=new Uint8Array(64);return r.set(t),r.set(n,32),new e({publicKey:n,secretKey:r})}}]),e}(),td=Object.freeze({CreateLookupTable:{index:0,layout:fi([di("instruction"),Gu("recentSlot"),ci("bumpSeed")])},FreezeLookupTable:{index:1,layout:fi([di("instruction")])},ExtendLookupTable:{index:2,layout:fi([di("instruction"),Gu(),yi(du(),ui(di(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:fi([di("instruction")])},CloseLookupTable:{index:4,layout:fi([di("instruction")])}}),nd=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=di("instruction").decode(e.data),r=0,i=Object.entries(td);r2?e.keys[2].pubkey:void 0,addresses:t.map((function(e){return new iu(e)}))}}},{key:"decodeCloseLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}},{key:"decodeFreezeLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"decodeDeactivateLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(rd.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}},{key:"checkKeysLength",value:function(e,t){if(e.length1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{},i=_s(e,t,r.extraEntropy),o=i.seed,a=i.m,s=i.d,u=new Ls(32,32);for(u.reseedSync(o);!(n=js(u.generateSync(),a,s,r.canonical));)u.reseedSync();return Ps(n,r)}(e,t,{der:!1,recovered:!0})};Qs.isValidPrivateKey;var ld=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return os.fromPrivateKey(e).toRawBytes(t)},dd=fi([ci("numSignatures"),li("signatureOffset"),ci("signatureInstructionIndex"),li("ethAddressOffset"),ci("ethAddressInstructionIndex"),li("messageDataOffset"),li("messageDataSize"),ci("messageInstructionIndex"),mi(20,"ethAddress"),mi(64,"signature"),ci("recoveryId")]),hd=function(){function e(){R(this,e)}return U(e,null,[{key:"publicKeyToEthAddress",value:function(e){gu(64===e.length,"Public key must be ".concat(64," bytes but received ").concat(e.length," bytes"));try{return Te.from(Ba($s(e))).slice(-20)}catch(e){throw new Error("Error constructing Ethereum address: ".concat(e))}}},{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,i=t.signature,o=t.recoveryId,a=t.instructionIndex;return e.createInstructionWithEthAddress({ethAddress:e.publicKeyToEthAddress(n),message:r,signature:i,recoveryId:o,instructionIndex:a})}},{key:"createInstructionWithEthAddress",value:function(t){var n,r=t.ethAddress,i=t.message,o=t.signature,a=t.recoveryId,s=t.instructionIndex,u=void 0===s?0:s;gu(20===(n="string"==typeof r?r.startsWith("0x")?Te.from(r.substr(2),"hex"):Te.from(r,"hex"):r).length,"Address must be ".concat(20," bytes but received ").concat(n.length," bytes"));var c=12+n.length,l=c+o.length+1,d=Te.alloc(dd.span+i.length);return dd.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:u,ethAddressOffset:12,ethAddressInstructionIndex:u,messageDataOffset:l,messageDataSize:i.length,messageInstructionIndex:u,signature:$s(o),ethAddress:$s(n),recoveryId:a},d),d.fill($s(i),dd.span),new Tu({keys:[],programId:e.programId,data:d})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;gu(32===t.length,"Private key must be ".concat(32," bytes but received ").concat(t.length," bytes"));try{var i=$s(t),o=ld(i,!1).slice(1),a=Te.from(Ba($s(n))),s=ee(cd(a,i),2),u=s[0],c=s[1];return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:u,recoveryId:c,instructionIndex:r})}catch(e){throw new Error("Error creating instruction; ".concat(e))}}}]),e}();hd.programId=new iu("KeccakSecp256k11111111111111111111111111111");var pd=new iu("StakeConfig11111111111111111111111111111111"),fd=U((function e(t,n){R(this,e),this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=n})),yd=U((function e(t,n,r){R(this,e),this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=n,this.custodian=r}));yd.default=new yd(0,0,iu.default);var md=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=di("instruction").decode(e.data),r=0,i=Object.entries(gd);r3&&(i.custodianPubkey=e.keys[3].pubkey),i}},{key:"decodeAuthorizeWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Wu(gd.AuthorizeWithSeed,e.data),n=t.newAuthorized,r=t.stakeAuthorizationType,i=t.authoritySeed,o=t.authorityOwner,a={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:i,authorityOwner:new iu(o),newAuthorizedPubkey:new iu(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(a.custodianPubkey=e.keys[3].pubkey),a}},{key:"decodeSplit",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Wu(gd.Split,e.data).lamports;return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}},{key:"decodeMerge",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Wu(gd.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}},{key:"decodeWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);var t=Wu(gd.Withdraw,e.data).lamports,n={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(n.custodianPubkey=e.keys[5].pubkey),n}},{key:"decodeDeactivate",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Wu(gd.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(bd.programId))throw new Error("invalid instruction; programId is not StakeProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length0&&void 0!==arguments[0]?arguments[0]:"authorized";return fi([du("staker"),du("withdrawer")],e)}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return fi([pi("unixTimestamp"),pi("epoch"),du("custodian")],e)}()])},Authorize:{index:1,layout:fi([di("instruction"),du("newAuthorized"),di("stakeAuthorizationType")])},Delegate:{index:2,layout:fi([di("instruction")])},Split:{index:3,layout:fi([di("instruction"),pi("lamports")])},Withdraw:{index:4,layout:fi([di("instruction"),pi("lamports")])},Deactivate:{index:5,layout:fi([di("instruction")])},Merge:{index:7,layout:fi([di("instruction")])},AuthorizeWithSeed:{index:8,layout:fi([di("instruction"),du("newAuthorized"),di("stakeAuthorizationType"),pu("authoritySeed"),du("authorityOwner")])}}),vd=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),bd=function(){function e(){R(this,e)}return U(e,null,[{key:"initialize",value:function(e){var t=e.stakePubkey,n=e.authorized,r=e.lockup||yd.default,i=Uu(gd.Initialize,{authorized:{staker:$s(n.staker.toBuffer()),withdrawer:$s(n.withdrawer.toBuffer())},lockup:{unixTimestamp:r.unixTimestamp,epoch:r.epoch,custodian:$s(r.custodian.toBuffer())}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Cu,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new Tu(o)}},{key:"createAccountWithSeed",value:function(e){var t=new Nu;t.add(Ju.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"createAccount",value:function(e){var t=new Nu;t.add(Ju.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"delegate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.votePubkey,i=Uu(gd.Delegate);return(new Nu).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:_u,isSigner:!1,isWritable:!1},{pubkey:pd,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"authorize",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.stakeAuthorizationType,o=e.custodianPubkey,a=Uu(gd.Authorize,{newAuthorized:$s(r.toBuffer()),stakeAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Nu).add({keys:s,programId:this.programId,data:a})}},{key:"authorizeWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorityBase,r=e.authoritySeed,i=e.authorityOwner,o=e.newAuthorizedPubkey,a=e.stakeAuthorizationType,s=e.custodianPubkey,u=Uu(gd.AuthorizeWithSeed,{newAuthorized:$s(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:r,authorityOwner:$s(i.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:Lu,isSigner:!1,isWritable:!1}];return s&&c.push({pubkey:s,isSigner:!1,isWritable:!1}),(new Nu).add({keys:c,programId:this.programId,data:u})}},{key:"splitInstruction",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.lamports,o=Uu(gd.Split,{lamports:i});return new Tu({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}},{key:"split",value:function(e){var t=new Nu;return t.add(Ju.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}},{key:"splitWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.basePubkey,o=e.seed,a=e.lamports,s=new Nu;return s.add(Ju.allocate({accountPubkey:r,basePubkey:i,seed:o,space:this.space,programId:this.programId})),s.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:a}))}},{key:"merge",value:function(e){var t=e.stakePubkey,n=e.sourceStakePubKey,r=e.authorizedPubkey,i=Uu(gd.Merge);return(new Nu).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:_u,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"withdraw",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.toPubkey,i=e.lamports,o=e.custodianPubkey,a=Uu(gd.Withdraw,{lamports:i}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:_u,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Nu).add({keys:s,programId:this.programId,data:a})}},{key:"deactivate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=Uu(gd.Deactivate);return(new Nu).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}]),e}();bd.programId=new iu("Stake11111111111111111111111111111111111111"),bd.space=200;var wd=U((function e(t,n,r,i){R(this,e),this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=n,this.authorizedWithdrawer=r,this.commission=i})),Md=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=di("instruction").decode(e.data),r=0,i=Object.entries(Ad);r0&&void 0!==arguments[0]?arguments[0]:"voteInit";return fi([du("nodePubkey"),du("authorizedVoter"),du("authorizedWithdrawer"),ci("commission")],e)}()])},Authorize:{index:1,layout:fi([di("instruction"),du("newAuthorized"),di("voteAuthorizationType")])},Withdraw:{index:3,layout:fi([di("instruction"),pi("lamports")])},AuthorizeWithSeed:{index:10,layout:fi([di("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteAuthorizeWithSeedArgs";return fi([di("voteAuthorizationType"),du("currentAuthorityDerivedKeyOwnerPubkey"),pu("currentAuthorityDerivedKeySeed"),du("newAuthorized")],e)}()])}}),Ed=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Td=function(){function e(){R(this,e)}return U(e,null,[{key:"initializeAccount",value:function(e){var t=e.votePubkey,n=e.nodePubkey,r=e.voteInit,i=Uu(Ad.InitializeAccount,{voteInit:{nodePubkey:$s(r.nodePubkey.toBuffer()),authorizedVoter:$s(r.authorizedVoter.toBuffer()),authorizedWithdrawer:$s(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Cu,isSigner:!1,isWritable:!1},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Tu(o)}},{key:"createAccount",value:function(e){var t=new Nu;return t.add(Ju.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}},{key:"authorize",value:function(e){var t=e.votePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.voteAuthorizationType,o=Uu(Ad.Authorize,{newAuthorized:$s(r.toBuffer()),voteAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Nu).add({keys:a,programId:this.programId,data:o})}},{key:"authorizeWithSeed",value:function(e){var t=e.currentAuthorityDerivedKeyBasePubkey,n=e.currentAuthorityDerivedKeyOwnerPubkey,r=e.currentAuthorityDerivedKeySeed,i=e.newAuthorizedPubkey,o=e.voteAuthorizationType,a=e.votePubkey,s=Uu(Ad.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:$s(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:$s(i.toBuffer()),voteAuthorizationType:o.index}}),u=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new Nu).add({keys:u,programId:this.programId,data:s})}},{key:"withdraw",value:function(e){var t=e.votePubkey,n=e.authorizedWithdrawerPubkey,r=e.lamports,i=e.toPubkey,o=Uu(Ad.Withdraw,{lamports:r}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Nu).add({keys:a,programId:this.programId,data:o})}},{key:"safeWithdraw",value:function(t,n,r){if(t.lamports>n-r)throw new Error("Withdraw will leave vote account with insuffcient funds.");return e.withdraw(t)}}]),e}();Td.programId=new iu("Vote111111111111111111111111111111111111111"),Td.space=3731;var Nd=new iu("Va1idator1nfo111111111111111111111111111111"),Id=Gi({name:Vi(),website:Yi(Vi()),details:Yi(Vi()),keybaseUsername:Yi(Vi())}),kd=function(){function e(t,n){R(this,e),this.key=void 0,this.info=void 0,this.key=t,this.info=n}return U(e,null,[{key:"fromConfigData",value:function(t){var n=te(t);if(2!==yu(n))return null;for(var r=[],i=0;i<2;i++){var o=new iu(n.slice(0,32)),a=1===(n=n.slice(32)).slice(0,1)[0];n=n.slice(1),r.push({publicKey:o,isSigner:a})}if(r[0].publicKey.equals(Nd)&&r[1].isSigner){var s=pu().decode(Te.from(n)),u=JSON.parse(s);return Ci(u,Id),new e(r[1].publicKey,u)}return null}}]),e}(),Ld=new iu("Vote111111111111111111111111111111111111111"),xd=fi([du("nodePubkey"),du("authorizedWithdrawer"),ci("commission"),hi(),yi(fi([hi("slot"),di("confirmationCount")]),ui(di(),-8),"votes"),ci("rootSlotValid"),hi("rootSlot"),hi(),yi(fi([hi("epoch"),du("authorizedVoter")]),ui(di(),-8),"authorizedVoters"),fi([yi(fi([du("authorizedPubkey"),hi("epochOfLastAuthorizedSwitch"),hi("targetEpoch")]),32,"buf"),hi("idx"),ci("isEmpty")],"priorVoters"),hi(),yi(fi([hi("epoch"),hi("credits"),hi("prevCredits")]),ui(di(),-8),"epochCredits"),fi([hi("slot"),hi("timestamp")],"lastTimestamp")]),Sd=function(){function e(t){R(this,e),this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}return U(e,null,[{key:"fromAccountData",value:function(t){var n=xd.decode($s(t),4),r=n.rootSlot;return n.rootSlotValid||(r=null),new e({nodePubkey:new iu(n.nodePubkey),authorizedWithdrawer:new iu(n.authorizedWithdrawer),commission:n.commission,votes:n.votes,rootSlot:r,authorizedVoters:n.authorizedVoters.map(jd),priorVoters:Dd(n.priorVoters),epochCredits:n.epochCredits,lastTimestamp:n.lastTimestamp})}}]),e}();function jd(e){var t=e.authorizedVoter;return{epoch:e.epoch,authorizedVoter:new iu(t)}}function Cd(e){var t=e.authorizedPubkey,n=e.epochOfLastAuthorizedSwitch,r=e.targetEpoch;return{authorizedPubkey:new iu(t),epochOfLastAuthorizedSwitch:n,targetEpoch:r}}function Dd(e){var t=e.buf,n=e.idx;return e.isEmpty?[]:[].concat(te(t.slice(n+1).map(Cd)),te(t.slice(0,n).map(Cd)))}var Od={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function zd(){return(zd=P(O().mark((function e(t,n,r,i){var o,a,s,u,c,l,d;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(o=r,a=i):a=r,s=a&&{skipPreflight:a.skipPreflight,preflightCommitment:a.preflightCommitment||a.commitment,minContextSlot:a.minContextSlot},e.next=4,t.sendRawTransaction(n,s);case 4:return u=e.sent,c=a&&a.commitment,l=o?t.confirmTransaction(o,c):t.confirmTransaction(u,c),e.next=9,l;case 9:if(!(d=e.sent.value).err){e.next=12;break}throw new Error("Raw transaction ".concat(u," failed (").concat(JSON.stringify(d),")"));case 12:return e.abrupt("return",u);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _d=j(Object.freeze({__proto__:null,Account:ou,AddressLookupTableAccount:lc,AddressLookupTableInstruction:nd,AddressLookupTableProgram:rd,Authorized:fd,BLOCKHASH_CACHE_TIMEOUT_MS:3e4,BPF_LOADER_DEPRECATED_PROGRAM_ID:au,BPF_LOADER_PROGRAM_ID:Ku,BpfLoader:$u,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:od,ComputeBudgetInstruction:id,ComputeBudgetProgram:ad,Connection:$l,Ed25519Program:ud,Enum:tu,EpochSchedule:oc,FeeCalculatorLayout:Yu,Keypair:ed,LAMPORTS_PER_SOL:1e9,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:td,Loader:Xu,Lockup:yd,MAX_SEED_LENGTH:32,Message:wu,MessageAccountKeys:lu,MessageV0:Mu,NONCE_ACCOUNT_LENGTH:Vu,NonceAccount:Hu,PACKET_DATA_SIZE:1232,PUBLIC_KEY_LENGTH:32,PublicKey:iu,SIGNATURE_LENGTH_IN_BYTES:64,SOLANA_SCHEMA:nu,STAKE_CONFIG_ID:pd,STAKE_INSTRUCTION_LAYOUTS:gd,SYSTEM_INSTRUCTION_LAYOUTS:Zu,SYSVAR_CLOCK_PUBKEY:Lu,SYSVAR_EPOCH_SCHEDULE_PUBKEY:xu,SYSVAR_INSTRUCTIONS_PUBKEY:Su,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:ju,SYSVAR_RENT_PUBKEY:Cu,SYSVAR_REWARDS_PUBKEY:Du,SYSVAR_SLOT_HASHES_PUBKEY:Ou,SYSVAR_SLOT_HISTORY_PUBKEY:zu,SYSVAR_STAKE_HISTORY_PUBKEY:_u,Secp256k1Program:hd,SendTransactionError:ac,SolanaJSONRPCError:sc,SolanaJSONRPCErrorCode:{JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016},StakeAuthorizationLayout:vd,StakeInstruction:md,StakeProgram:bd,Struct:eu,SystemInstruction:qu,SystemProgram:Ju,Transaction:Nu,TransactionExpiredBlockheightExceededError:su,TransactionExpiredNonceInvalidError:cu,TransactionExpiredTimeoutError:uu,TransactionInstruction:Tu,TransactionMessage:Iu,get TransactionStatus(){return vu},VALIDATOR_INFO_KEY:Nd,VERSION_PREFIX_MASK:127,VOTE_PROGRAM_ID:Ld,ValidatorInfo:kd,VersionedMessage:Au,VersionedTransaction:ku,VoteAccount:Sd,VoteAuthorizationLayout:Ed,VoteInit:wd,VoteInstruction:Md,VoteProgram:Td,clusterApiUrl:function(e,t){var n=!1===t?"http":"https";if(!e)return Od[n].devnet;var r=Od[n][e];if(!r)throw new Error("Unknown ".concat(n," cluster: ").concat(e));return r},sendAndConfirmRawTransaction:function(e,t,n,r){return zd.apply(this,arguments)},sendAndConfirmTransaction:Pu})),Pd={};Object.defineProperty(Pd,"__esModule",{value:!0});var Rd={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"},Bd=function(e){Q(n,G(Error));var t=X(n);function n(){var e;R(this,n);for(var r=arguments.length,i=new Array(r),o=0;o=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");var t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}function Fd(){return Wd(this,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}function Vd(){return Wd(this,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}var Hd;function Gd(e,t){return Wd(this,void 0,void 0,O().mark((function n(){var r,i,o,a,s;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=JSON.stringify(e),i=Yd(e.id),o=new Uint8Array(12),crypto.getRandomValues(o),n.next=6,crypto.subtle.encrypt(Zd(i,o),t,(new TextEncoder).encode(r));case 6:return a=n.sent,(s=new Uint8Array(i.byteLength+o.byteLength+a.byteLength)).set(new Uint8Array(i),0),s.set(new Uint8Array(o),i.byteLength),s.set(new Uint8Array(a),i.byteLength+o.byteLength),n.abrupt("return",s);case 12:case"end":return n.stop()}}),n)})))}function qd(e,t){return Wd(this,void 0,void 0,O().mark((function n(){var r,i,o,a,s,u;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.slice(0,4),i=e.slice(4,16),o=e.slice(16),n.next=5,crypto.subtle.decrypt(Zd(r,i),t,o);case 5:if(a=n.sent,s=Jd().decode(a),u=JSON.parse(s),!Object.hasOwnProperty.call(u,"error")){n.next=10;break}throw new Ud(u.id,u.error.code,u.error.message);case 10:return n.abrupt("return",u);case 11:case"end":return n.stop()}}),n)})))}function Zd(e,t){return{additionalData:e,iv:t,name:"AES-GCM",tagLength:128}}function Jd(){return void 0===Hd&&(Hd=new TextDecoder("utf-8")),Hd}function Xd(e,t,n){return Wd(this,void 0,void 0,O().mark((function r(){var i,o,a,s,u,c,l;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Promise.all([crypto.subtle.exportKey("raw",t),crypto.subtle.importKey("raw",e,{name:"ECDH",namedCurve:"P-256"},!1,[])]);case 2:return i=r.sent,o=ee(i,2),a=o[0],s=o[1],r.next=8,crypto.subtle.deriveBits({name:"ECDH",public:s},n,256);case 8:return u=r.sent,r.next=11,crypto.subtle.importKey("raw",u,"HKDF",!1,["deriveKey"]);case 11:return c=r.sent,r.next=14,crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(a),info:new Uint8Array},c,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"]);case 14:return l=r.sent,r.abrupt("return",l);case 16:case"end":return r.stop()}}),r)})))}function Kd(e){if(e<49152||e>65535)throw new Bd(Rd.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,"Association port number must be between 49152 and 65535. ".concat(e," given."),{port:e});return e}function $d(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i1?e.shift():e[0]}}(),u=1,c=0,l={__type:"disconnected"},n.abrupt("return",new Promise((function(t,n){var h,p,f,y={},m=function e(){return Wd(d,void 0,void 0,O().mark((function t(){var n,r;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("connecting"===l.__type){t.next=3;break}return console.warn("Expected adapter state to be `connecting` at the moment the websocket opens. "+"Got `".concat(l.__type,"`.")),t.abrupt("return");case 3:return n=l.associationKeypair,h.removeEventListener("open",e),t.next=7,Vd();case 7:return r=t.sent,t.t0=h,t.next=11,Qd(r.publicKey,n.privateKey);case 11:t.t1=t.sent,t.t0.send.call(t.t0,t.t1),l={__type:"hello_req_sent",associationPublicKey:n.publicKey,ecdhPrivateKey:r.privateKey};case 14:case"end":return t.stop()}}),t)})))},g=function(e){e.wasClean?l={__type:"disconnected"}:n(new Bd(Rd.ERROR_SESSION_CLOSED,"The wallet session dropped unexpectedly (".concat(e.code,": ").concat(e.reason,")."),{closeEvent:e})),p()},v=function(e){return Wd(d,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p(),!(Date.now()-a>=uh)){e.next=5;break}n(new Bd(Rd.ERROR_SESSION_TIMEOUT,"Failed to connect to the wallet websocket on port ".concat(i,"."))),e.next=8;break;case 5:return e.next=7,new Promise((function(e){var t=s();f=window.setTimeout(e,t)}));case 7:w();case 8:case"end":return e.stop()}}),e)})))},b=function(r){return Wd(d,void 0,void 0,O().mark((function i(){var o,a,s,d,f,m,g,v;return O().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.data.arrayBuffer();case 2:o=i.sent,i.t0=l.__type,i.next="connected"===i.t0?6:"hello_req_sent"===i.t0?30:51;break;case 6:if(i.prev=6,a=o.slice(0,4),(s=new DataView(a).getUint32(0,!1))===c+1){i.next=11;break}throw new Error("Encrypted message has invalid sequence number");case 11:return c=s,i.next=14,qd(o,l.sharedSecret);case 14:d=i.sent,f=y[d.id],delete y[d.id],f.resolve(d.result),i.next=29;break;case 20:if(i.prev=20,i.t1=i.catch(6),!(i.t1 instanceof Ud)){i.next=28;break}m=y[i.t1.jsonRpcMessageId],delete y[i.t1.jsonRpcMessageId],m.reject(i.t1),i.next=29;break;case 28:throw i.t1;case 29:return i.abrupt("break",51);case 30:return i.next=32,Xd(o,l.associationPublicKey,l.ecdhPrivateKey);case 32:return g=i.sent,l={__type:"connected",sharedSecret:g},v=new Proxy({},{get:function(e,t){if(null==e[t]){var n=t.toString().replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())})).toLowerCase();e[t]=function(e){return Wd(this,void 0,void 0,O().mark((function r(){var i;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=u++,r.t0=h,r.next=4,Gd({id:i,jsonrpc:"2.0",method:n,params:null!=e?e:{}},g);case 4:return r.t1=r.sent,r.t0.send.call(r.t0,r.t1),r.abrupt("return",new Promise((function(e,n){y[i]={resolve:function(r){switch(t){case"authorize":case"reauthorize":var i=r.wallet_uri_base;if(null!=i)try{lh(i)}catch(e){return void n(e)}}e(r)},reject:n}})));case 7:case"end":return r.stop()}}),r)})))}}return e[t]},defineProperty:function(){return!1},deleteProperty:function(){return!1}}),i.prev=35,i.t2=t,i.next=39,e(v);case 39:i.t3=i.sent,(0,i.t2)(i.t3),i.next=46;break;case 43:i.prev=43,i.t4=i.catch(35),n(i.t4);case 46:return i.prev=46,p(),h.close(),i.finish(46);case 50:return i.abrupt("break",51);case 51:case"end":return i.stop()}}),i,null,[[6,20],[35,43,46,50]])})))},w=function(){p&&p(),l={__type:"connecting",associationKeypair:r},void 0===a&&(a=Date.now()),(h=new WebSocket(o,["com.solana.mobilewalletadapter.v1"])).addEventListener("open",m),h.addEventListener("close",g),h.addEventListener("error",v),h.addEventListener("message",b),p=function(){window.clearTimeout(f),h.removeEventListener("open",m),h.removeEventListener("close",g),h.removeEventListener("error",v),h.removeEventListener("message",b)}};w()})));case 13:case"end":return n.stop()}}),n)})))};var dh=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var d=0,h=o-1;(0!==l||d>>0,c[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var f=new Uint8Array(r+(o-p)),y=r;p!==o;)f[y++]=c[p++];return f}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var d=t[i],h=0,p=u-1;(0!==d||h>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=u-r;f!==u&&0===l[f];)f++;for(var y=s.repeat(n);fthis.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function Th(e,t){return t.property?e+"["+t.property+"]":e}Ah.Layout=Eh,Ah.nameWithProperty=Th,Ah.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Eh))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var Nh=function(e){Q(n,Eh);var t=X(n);function n(){return R(this,n),t.apply(this,arguments)}return U(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}(),Ih=function(e){Q(n,Nh);var t=X(n);function n(e,r){var i;if(R(this,n),void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");return(i=t.call(this,-1,r)).elementSpan=e,i}return U(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}(),kh=function(e){Q(n,Nh);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Eh))throw new TypeError("layout must be a Layout");if(void 0===r)r=0;else if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");return(o=t.call(this,e.span,i||e.property)).layout=e,o.offset=r,o}return U(n,[{key:"isCount",value:function(){return this.layout instanceof Lh||this.layout instanceof xh}},{key:"decode",value:function(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)}}]),n}(),Lh=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntLE(e,n,this.span),this.span}}]),n}(),xh=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntBE(e,n,this.span),this.span}}]),n}(),Sh=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntLE(e,n,this.span),this.span}}]),n}(),jh=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntBE(e,n,this.span),this.span}}]),n}(),Ch=Math.pow(2,32);function Dh(e){var t=Math.floor(e/Ch);return{hi32:t,lo32:e-t*Ch}}function Oh(e,t){return e*Ch+t}var zh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Oh(e.readUInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Dh(e);return t.writeUInt32LE(r.lo32,n),t.writeUInt32LE(r.hi32,n+4),8}}]),n}(),_h=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Oh(e.readUInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Dh(e);return t.writeUInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(),Ph=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Oh(e.readInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Dh(e);return t.writeUInt32LE(r.lo32,n),t.writeInt32LE(r.hi32,n+4),8}}]),n}(),Rh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Oh(e.readInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Dh(e);return t.writeInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(),Bh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatLE(e,n),4}}]),n}(),Uh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatBE(e,n),4}}]),n}(),Wh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleLE(e,n),8}}]),n}(),Qh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleBE(e,n),8}}]),n}(),Yh=function(e){Q(n,Eh);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Eh))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Nh&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(r instanceof Nh)&&0u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(e){s.e(e)}finally{s.f()}var c=-1;try{c=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(e){}return(o=t.call(this,c,r)).fields=e,o.decodePrefixes=!!i,o}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;try{n=this.fields.reduce((function(n,r){var i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(e){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n,r=this.makeDestinationObject(),i=se(this.fields);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(void 0!==o.property&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r,i=n,o=0,a=0,s=se(this.fields);try{for(s.s();!(r=s.n()).done;){var u=r.value,c=u.span;if(a=0c&&(c=u.getSpan(t,n)))}o=n,n+=c}}catch(e){s.e(e)}finally{s.f()}return o+a-i}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=se(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;void 0!==i.property&&0i.span?n=-1:0<=n&&(n+=i.span)}}catch(e){r.e(e)}finally{r.f()}}}]),n}(),Vh=function(){function e(t){R(this,e),this.property=t}return U(e,[{key:"decode",value:function(){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(){throw new Error("UnionDiscriminator is abstract")}}]),e}(),Hh=function(e){Q(n,Vh);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Nh&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,r||e.property||"variant")).layout=e,i}return U(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}(),Gh=function(e){Q(n,Eh);var t=X(n);function n(e,r,i){var o;R(this,n);var a=e instanceof Lh||e instanceof xh;if(a)e=new Hh(new kh(e));else if(e instanceof Nh&&e.isCount())e=new Hh(e);else if(!(e instanceof Vh))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===r&&(r=null),!(null===r||r instanceof Eh))throw new TypeError("defaultLayout must be null or a Layout");if(null!==r){if(0>r.span)throw new Error("defaultLayout must have constant span");void 0===r.property&&(r=r.replicate("content"))}var s=-1;r&&0<=(s=r.span)&&a&&(s+=e.layout.span),(o=t.call(this,s,i)).discriminator=e,o.usesPrefixDiscriminator=a,o.defaultLayout=r,o.registry={};var u=o.defaultGetSourceVariant.bind(Z(o));return o.getSourceVariant=function(e){return u(e)},o.configGetSourceVariant=function(e){u=e.bind(this)},o}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e,t){var n;void 0===t&&(t=0);var r=this.discriminator,i=r.decode(e,t),o=this.registry[i];if(void 0===o){var a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=r.layout.span),(n=this.makeDestinationObject())[r.property]=i,n[o.property]=this.defaultLayout.decode(e,t+a)}else n=o.decode(e,t);return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.getSourceVariant(e);if(void 0===r){var i=this.discriminator,o=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,n),a+o.encode(e[o.property],t,n+a)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new qh(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(e,t){var n=e;return Te.isBuffer(e)&&(void 0===t&&(t=0),n=this.discriminator.decode(e,t)),this.registry[n]}}]),n}(),qh=function(e){Q(n,Eh);var t=X(n);function n(e,r,i,o){var a;if(R(this,n),!(e instanceof Gh))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof i&&void 0===o&&(o=i,i=null),i){if(!(i instanceof Eh))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof o)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=i?i.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(a=t.call(this,s,o)).union=e,a.variant=r,a.layout=i||null,a}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(e,t+n)}},{key:"decode",value:function(e,t){var n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}();function Zh(e){return 0>e&&(e+=4294967296),e}var Jh=function(e){Q(n,Eh);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Lh||e instanceof xh))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof r&&void 0===i&&(i=r,r=void 0),4=n)throw new TypeError("bits must be positive integer");var i=8*t.span,o=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+o>i)throw new Error("bits too long for span remainder ("+(i-o)+" of "+i+" remain)");this.container=t,this.bits=n,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if(!Number.isInteger(e)||e!==Zh(e&this.valueMask))throw new TypeError(Th("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=Zh(e<n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=this.span;return 0>n&&(n=this.length.decode(e,t)),e.slice(t,t+n)}},{key:"encode",value:function(e,t,n){var r=this.length;if(this.length instanceof Nh&&(r=e.length),!Te.isBuffer(e)||r!==e.length)throw new TypeError(Th("Blob.encode",this)+" requires (length "+r+") Buffer as src");if(n+r>t.length)throw new RangeError("encoding overruns Buffer");return t.write(e.toString("hex"),n,r,"hex"),this.length instanceof Nh&&this.length.encode(r,t,n),r}}]),n}(),ep=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,-1,e)}return U(n,[{key:"getSpan",value:function(e,t){if(!Te.isBuffer(e))throw new TypeError("b must be a Buffer");void 0===t&&(t=0);for(var n=t;nt.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),t[n+i]=0,i+1}}]),n}(),tp=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),"string"==typeof e&&void 0===r&&(r=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=t.call(this,-1,r)).maxSpan=e,i}return U(n,[{key:"getSpan",value:function(e,t){if(!Te.isBuffer(e))throw new TypeError("b must be a Buffer");return void 0===t&&(t=0),e.length-t}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),i}}]),n}(),np=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,0,r)).value=e,i}return U(n,[{key:"decode",value:function(e,t,n){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}();Ah.ExternalLayout=Nh,Ah.GreedyCount=Ih,Ah.OffsetLayout=kh,Ah.UInt=Lh,Ah.UIntBE=xh,Ah.Int=Sh,Ah.IntBE=jh,Ah.Float=Bh,Ah.FloatBE=Uh,Ah.Double=Wh,Ah.DoubleBE=Qh,Ah.Sequence=Yh,Ah.Structure=Fh,Ah.UnionDiscriminator=Vh,Ah.UnionLayoutDiscriminator=Hh,Ah.Union=Gh,Ah.VariantLayout=qh,Ah.BitStructure=Jh,Ah.BitField=Xh,Ah.Boolean=Kh,Ah.Blob=$h,Ah.CString=ep,Ah.UTF8=tp,Ah.Constant=np,Ah.greedy=function(e,t){return new Ih(e,t)},Ah.offset=function(e,t,n){return new kh(e,t,n)},Ah.u8=function(e){return new Lh(1,e)},Ah.u16=function(e){return new Lh(2,e)},Ah.u24=function(e){return new Lh(3,e)},Ah.u32=function(e){return new Lh(4,e)},Ah.u40=function(e){return new Lh(5,e)},Ah.u48=function(e){return new Lh(6,e)},Ah.nu64=function(e){return new zh(e)},Ah.u16be=function(e){return new xh(2,e)},Ah.u24be=function(e){return new xh(3,e)},Ah.u32be=function(e){return new xh(4,e)},Ah.u40be=function(e){return new xh(5,e)},Ah.u48be=function(e){return new xh(6,e)},Ah.nu64be=function(e){return new _h(e)},Ah.s8=function(e){return new Sh(1,e)},Ah.s16=function(e){return new Sh(2,e)},Ah.s24=function(e){return new Sh(3,e)},Ah.s32=function(e){return new Sh(4,e)},Ah.s40=function(e){return new Sh(5,e)},Ah.s48=function(e){return new Sh(6,e)},Ah.ns64=function(e){return new Ph(e)},Ah.s16be=function(e){return new jh(2,e)},Ah.s24be=function(e){return new jh(3,e)},Ah.s32be=function(e){return new jh(4,e)},Ah.s40be=function(e){return new jh(5,e)},Ah.s48be=function(e){return new jh(6,e)},Ah.ns64be=function(e){return new Rh(e)},Ah.f32=function(e){return new Bh(e)},Ah.f32be=function(e){return new Uh(e)},Ah.f64=function(e){return new Wh(e)},Ah.f64be=function(e){return new Qh(e)},Ah.struct=function(e,t,n){return new Fh(e,t,n)},Ah.bits=function(e,t,n){return new Jh(e,t,n)};var rp=Ah.seq=function(e,t,n){return new Yh(e,t,n)};Ah.union=function(e,t,n){return new Gh(e,t,n)},Ah.unionLayoutDiscriminator=function(e,t){return new Hh(e,t)},Ah.blob=function(e,t){return new $h(e,t)},Ah.cstr=function(e){return new ep(e)},Ah.utf8=function(e,t){return new tp(e,t)},Ah.const=function(e,t){return new np(e,t)};var ip={},op={exports:{}};!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===z(e)?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Cn.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===z(e))return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=s(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var d=["","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"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return m(e,t,n)}Math.imul||(y=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?f(this,e,t):n<1024?m(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new T(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function N(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(w,b),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new N(e)},r(N,T),N.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},N.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},N.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},N.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(op,x),function(e){var t=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.map=e.array=e.rustEnum=e.str=e.vecU8=e.tagged=e.vec=e.bool=e.option=e.publicKey=e.i128=e.u128=e.i64=e.u64=e.struct=e.f64=e.f32=e.i32=e.u32=e.i16=e.u16=e.i8=e.u8=void 0;var n=Ah,r=_d,i=t(op.exports),o=Ah;Object.defineProperty(e,"u8",{enumerable:!0,get:function(){return o.u8}}),Object.defineProperty(e,"i8",{enumerable:!0,get:function(){return o.s8}}),Object.defineProperty(e,"u16",{enumerable:!0,get:function(){return o.u16}}),Object.defineProperty(e,"i16",{enumerable:!0,get:function(){return o.s16}}),Object.defineProperty(e,"u32",{enumerable:!0,get:function(){return o.u32}}),Object.defineProperty(e,"i32",{enumerable:!0,get:function(){return o.s32}}),Object.defineProperty(e,"f32",{enumerable:!0,get:function(){return o.f32}}),Object.defineProperty(e,"f64",{enumerable:!0,get:function(){return o.f64}}),Object.defineProperty(e,"struct",{enumerable:!0,get:function(){return o.struct}});var a=function(e){Q(r,e);var t=X(r);function r(e,i,o){var a;return R(this,r),(a=t.call(this,e,o)).blob=n.blob(e),a.signed=i,a}return U(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new i.default(this.blob.decode(e,t),10,"le");return this.signed?n.fromTwos(8*this.span).clone():n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.signed&&(e=e.toTwos(8*this.span)),this.blob.encode(e.toArrayLike(Te,"le",this.span),t,n)}}]),r}(n.Layout);function s(e){return new a(8,!1,e)}e.u64=s,e.i64=function(e){return new a(8,!0,e)},e.u128=function(e){return new a(16,!1,e)},e.i128=function(e){return new a(16,!0,e)};var u=function(e){Q(n,e);var t=X(n);function n(e,r,i,o){var a;return R(this,n),(a=t.call(this,e.span,o)).layout=e,a.decoder=r,a.encoder=i,a}return U(n,[{key:"decode",value:function(e,t){return this.decoder(this.layout.decode(e,t))}},{key:"encode",value:function(e,t,n){return this.layout.encode(this.encoder(e),t,n)}},{key:"getSpan",value:function(e,t){return this.layout.getSpan(e,t)}}]),n}(n.Layout);e.publicKey=function(e){return new u(n.blob(32),(function(e){return new r.PublicKey(e)}),(function(e){return e.toBuffer()}),e)};var c=function(e){Q(r,e);var t=X(r);function r(e,i){var o;return R(this,r),(o=t.call(this,-1,i)).layout=e,o.discriminator=n.u8(),o}return U(r,[{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null==e?this.discriminator.encode(0,t,n):(this.discriminator.encode(1,t,n),this.layout.encode(e,t,n+1)+1)}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return null;if(1===n)return this.layout.decode(e,t+1);throw new Error("Invalid option "+this.property)}},{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return 1;if(1===n)return this.layout.getSpan(e,t+1)+1;throw new Error("Invalid option "+this.property)}}]),r}(n.Layout);function l(e){if(0===e)return!1;if(1===e)return!0;throw new Error("Invalid bool: "+e)}function d(e){return e?1:0}function h(e){var t=n.u32("length"),r=n.struct([t,n.blob(n.offset(t,-t.span),"data")]);return new u(r,(function(e){return e.data}),(function(e){return{data:e}}),e)}e.option=function(e,t){return new c(e,t)},e.bool=function(e){return new u(n.u8(),l,d,e)},e.vec=function(e,t){var r=n.u32("length"),i=n.struct([r,n.seq(e,n.offset(r,-r.span),"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),t)},e.tagged=function(e,t,r){var i=n.struct([s("tag"),t.replicate("data")]);return new u(i,(function(t){var n=t.tag,r=t.data;if(!n.eq(e))throw new Error("Invalid tag, expected: "+e.toString("hex")+", got: "+n.toString("hex"));return r}),(function(t){return{tag:e,data:t}}),r)},e.vecU8=h,e.str=function(e){return new u(h(),(function(e){return e.toString("utf-8")}),(function(e){return Te.from(e,"utf-8")}),e)},e.rustEnum=function(e,t,r){var i=n.union(null!=r?r:n.u8(),t);return e.forEach((function(e,t){return i.addVariant(t,e,e.property)})),i},e.array=function(e,t,r){var i=n.struct([n.seq(e,t,"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),r)};var p=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;return R(this,n),(o=t.call(this,e.span+r.span,i)).keyLayout=e,o.valueLayout=r,o}return U(n,[{key:"decode",value:function(e,t){return t=t||0,[this.keyLayout.decode(e,t),this.valueLayout.decode(e,t+this.keyLayout.getSpan(e,t))]}},{key:"encode",value:function(e,t,n){n=n||0;var r=this.keyLayout.encode(e[0],t,n);return r+this.valueLayout.encode(e[1],t,n+r)}},{key:"getSpan",value:function(e,t){return this.keyLayout.getSpan(e,t)+this.valueLayout.getSpan(e,t)}}]),n}(n.Layout);e.map=function(e,t,r){var i=n.u32("length"),o=n.struct([i,n.seq(new p(e,t),n.offset(i,-i.span),"values")]);return new u(o,(function(e){var t=e.values;return new Map(t)}),(function(e){return{values:Array.from(e.entries())}}),r)}}(ip),ue.Web3MobileWallet;var ap=ue.transact,sp=Cn.Buffer,up=jn.exports,cp=ip.struct([ip.publicKey("mint"),ip.publicKey("owner"),ip.u64("amount"),ip.u32("delegateOption"),ip.publicKey("delegate"),ip.u8("state"),ip.u32("isNativeOption"),ip.u64("isNative"),ip.u64("delegatedAmount"),ip.u32("closeAuthorityOption"),ip.publicKey("closeAuthority")]);ip.array;var lp=ip.bool,dp=ip.i128;ip.i16;var hp=ip.i32,pp=ip.i64;ip.i8,ip.map;var fp=ip.option,yp=ip.publicKey,mp=ip.rustEnum,gp=ip.str,vp=ip.struct;ip.tagged;var bp=ip.u128,wp=ip.u16,Mp=ip.u32,Ap=ip.u64,Ep=ip.u8,Tp=ip.vec;ip.vecU8;const Np="data:image/svg+xml;base64,PHN2ZyB4bWxucz0i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320b78e3967134febbe.svg";var kp={name:"bsc",id:"0x38",networkId:"56",namespace:"eip155",platform:"evm",label:"BNB Smart Chain",fullName:"BNB Smart Chain Mainnet",logo:Np,logoBackgroundColor:"#000000",logoWhiteBackground:Np,currency:{name:"BNB",symbol:"BNB",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Ip},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png"},stables:{usd:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955"]},explorer:"https://bscscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://bscscan.com/tx/${e.id||e}`:t?`https://bscscan.com/token/${t}`:n?`https://bscscan.com/address/${n}`:void 0,endpoints:["https://bsc-dataseed.binance.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed3.defibit.io"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"BNB",name:"Binance Coin",decimals:18,logo:Ip,type:"NATIVE"},{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",name:"Wrapped BNB",decimals:18,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png",type:"20"},{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",name:"Tether USD",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png",type:"20"},{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",name:"USD Coin",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d/logo.png",type:"20"},{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:"ETH",name:"Ethereum Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x2170Ed0880ac9A755fd29B2688956BD959F933F8/logo.png",type:"20"},{address:"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",symbol:"Cake",name:"PancakeSwap Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",type:"20"},{address:"0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",symbol:"BTCB",name:"BTCB Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Lp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAADxdJREFUeJztXVtzFMcVplwuP8VVeYmf7HJ+RKqSl/AQP6X8H+yqXUEIjhMnQY5jO9oVCIzA5mowdzAYG4xAGAyWLC5G3IyDL8gOASUYKrarYGZWC7qi23b6692VV6uZ7e6ZnT3di07VV6JUaLfnnG+6z+lz+vScOXUoL6SzP52/2PtlQ9p7piHlLU2k3P2JJqcjkXLO8589/OdN/tPjvx8VEP8Wv+sp/J8O/A3+Fp+Bz8JnUj/XrPjIwjT7ybxm57fJlLsy2eR2cwPe4QZksYB/Nr4D34XvxHdTP/8DJ+k0e4S/lb9Jpr2WZJNzgRtjPDaDS4DvFmPgY8GYMDZq/dStNKQzv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fdIWEhSriIoEsKm6BzqGrqnt7StgpS3LAc7to+MIqntMvM/HD9CtcW9+uWBdssUxxDk+dPGiHocSoFNT1nyZiIOmloWIJqMQ6tF6+7oi9gnEZpE9O4bmwc1Bh2RxfjUkv21sT+7AIHg1396NS5CksC2LSAnoqmaJnVqJSCWLeoLZJSEYophjeewpXUpBtYpN5WW1AnQSWyWPaQKGc7Y32lRtHJvhhQ7cxrp+64NElJw3OW3URqB76522qpVu2yw4vWLTMbTohne7I5/YqUfBIUZbTiWHMjx/ttAHNR8kwVn2fJOKeogYxGZOu/b5/FnJt6vJ9yyyI8tYZvhejF25LcusVBa0N0OPO5ObWWJsGKO0FdushBckRdDqFP1u0fSYsss5vluMgY8FY7IuYVMPgrbn6H2PCxBEJBHn9Tf8s4UHz78L3zmj5fqsmCG4DAk3YiWbvGfFvYgpdz888EJL/J7Chdkerk8XEP8Wv+vJzyo8EsHf8L/FZ+Czpi5YqjP5P2ey0rAsl+yGAAAAAElFTkSuQmCC",xp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png";var Sp={name:"ethereum",id:"0x1",networkId:"1",namespace:"eip155",platform:"evm",label:"Ethereum",fullName:"Ethereum Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbC1vcGFjaXR5Oi42MDJ9LnN0MCwuc3Qxe2ZpbGw6I2ZmZn08L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik01MTEuNCA3My4zdjMxNS41TDc3OCA1MDggNTExLjQgNzMuM3oiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNTExLjQgNz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uMSAyNTkuNy0zNjUuOC0yNTkuNyAxNTMuNnoiIGZpbGw9IiMzYzNjM2IiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNDk5LjggOTIyLjVWNzEwLjNMMjQwLjUgNTU2LjdsMjU5LjMgMzY1Ljh6Ii8+PHBhdGggZD0ibTQ5OS44IDY2MSAyNTkuNy0xNTMuNS0yNTkuNy0xMTcuOFY2NjF6IiBmaWxsPSIjMTQxNDE0Ii8+PHBhdGggZD0iTTI0MC41IDUwNy41IDQ5OS44IDY2MVYzODkuN0wyNDAuNSA1MDcuNXoiIGZpbGw9IiMzOTM5MzkiLz48L3N2Zz4K",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Lp},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",logo:xp,logoBackgroundColor:"#FFFFFF"},stables:{usd:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"]},explorer:"https://etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://etherscan.io/tx/${e.id||e}`:t?`https://etherscan.io/token/${t}`:n?`https://etherscan.io/address/${n}`:void 0,endpoints:["https://rpc.ankr.com/eth","https://eth.llamarpc.com","https://ethereum.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Lp,type:"NATIVE"},{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:xp,type:"20"},{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c/logo.png",type:"20"},{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x853d955aCEf822Db058eb8505911ED77F175b99e",symbol:"FRAX",name:"Frax",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x853d955aCEf822Db058eb8505911ED77F175b99e/logo.png",type:"20"},{address:"0x956F47F50A910163D8BF957Cf5846D573E7f87CA",symbol:"FEI",name:"Fei USD",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x956F47F50A910163D8BF957Cf5846D573E7f87CA/logo.png",type:"20"},{address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const jp="https://assets.spooky.fi/tokens/wFTM.png";var Cp={name:"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uNCA0LjIgMjEuMSA0LjIgMjkuMSAwbDE0NS45LTc3LjJoLjUtLjVsLTE0NS45LTc3LjJ6bTE2OS4xIDcuNCA5IDUuOCAxLjYgMS4xYzIuNiAxLjYgNC44IDMuMiA2LjkgNC4yIDIyLjIgMTQuOCAzMC4xIDMxLjIgMzAuMSA2NXYxLjFoLTIyLjdjMC0xNC44LTEuNi0yNC44LTUuMy0zMS43LTIuNi01LjgtNi45LTEwLTE0LjgtMTUuM2wtLjUtLjVjLTEuNi0xLjEtMy43LTIuMS01LjgtMy43bC0yLjYtMS42LTguNS00LjggMTIuNi0xOS42eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==",currency:{name:"Fantom",symbol:"FTM",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:"https://assets.spooky.fi/tokens/FTM.png"},wrapped:{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",logo:jp},stables:{usd:["0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf","0x1B6382DBDEa11d97f24495C9A90b7c88469134a4"]},explorer:"https://ftmscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://ftmscan.com/tx/${e.id||e}`:t?`https://ftmscan.com/token/${t}`:n?`https://ftmscan.com/address/${n}`:void 0,endpoints:["https://rpc.ftm.tools","https://fantom.publicnode.com","https://rpc2.fantom.network"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"FTM",name:"Fantom",decimals:18,logo:"https://assets.spooky.fi/tokens/FTM.png",type:"NATIVE"},{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",symbol:"WFTM",name:"Wrapped Fantom",decimals:18,logo:jp,type:"20"},{address:"0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf",symbol:"lzUSDC",name:"LayerZero USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"},{address:"0x1B6382DBDEa11d97f24495C9A90b7c88469134a4",symbol:"axlUSDC",name:"Axelar Wrapped USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Dp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/info/logo.png",Op="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/assets/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270/logo.png";var zp={name:"polygon",id:"0x89",networkId:"137",namespace:"eip155",label:"Polygon (POS)",fullName:"Polygon (POS) Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0xMzEuNSA0NTkuM2MtMTQuNCA5LjYtMjQgMjQtMjQgNDMuMnYxOTQuNGMwIDE5LjIgOS42IDM2IDI0IDQzLjJsMTY1LjYgOTZjMTQuNCA5LjYgMzMuNiA5LjYgNDggMGwxNjUuNi05NmMxNC40LTkuNiAyNC0yNCAyNC00My4ydi02OS42bC03Ni44LTQzLjJ2NjQuOGMwIDE5LjItOS42IDM2LTI0IDQzLjJsLTg2LjQgNTIuOGMtMTQuNCA5LjYtMzMuNiA5LjYtNDggMGwtODYuNC01MC40Yy0xNC40LTkuNi0yNC0yNC0yNC00My4yVjU1MC41YzAtMTkuMiA5LjYtMzYgMjQtNDMuMmw4OC44LTUwLjRjMTQuNC05LjYgMzMuNi05LjYgNDggMGwxMTIuOCA2NC44IDc2LjggNDUuNiAxMTIuOCA2NC44YzE0LjQgOS42IDMzLjYgOS42IDQ4IDBsMTY4LTk2YzE0LjQtOS42IDI0LTI0IDI0LTQzLjJ2LTE5MmMwLTE0LjQtOS42LTMxLjItMjQtNDAuOGwtMTY4LTk2Yy0xNC40LTkuNi0zM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kuMiAxMTkuNSA2OGMxNi40IDkuNCAzNS4yIDkuNCA1MS42IDBMODkwLjIgNTM0YzE2LjQtOS40IDI1LjgtMjUuOCAyNS44LTQ2LjlWMjgzLjJjMC0xNi40LTkuNC0zMi44LTI1LjgtNDIuMkw3MTIuMSAxMzcuOWMtMTYuNC05LjQtMzUuMi05LjQtNTEuNiAwTDQ4NC43IDI0MWMtMTYuNCA5LjQtMjUuOCAyNS44LTI1LjggNDYuOXY3NWw4MiA0OS4ydi03Mi43YzAtMjEuMSA5LjQtMzcuNSAyNS44LTQ2LjlsOTMuOC01Ni4zYzE2LjQtOS40IDM1LjItOS40IDUxLjYgMGw5My44IDUzLjljMTQuMSA5LjQgMjUuOCAyNS44IDI1LjggNDYuOXYxMDhjMCAyMS4xLTExLjcgMzcuNS0yNS44IDQ2LjlsLTkzLjggNTYuM2MtMTQuMSA5LjQtMzUuMiA5LjQtNTEuNiAwTDU0MSA0NzUuNGwtODItNDYuOS0xMjQuMi03Mi43Yy0xNC4xLTkuNC0zNS4yLTkuNC01MS42IDAtLjEuMS0xNzEuMiAxMDMuMi0xNzMuNSAxMDMuMnoiIGZpbGw9IiM4MjQ3ZTUiLz48L3N2Zz4=",currency:{name:"Polygon",symbol:"MATIC",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Dp},wrapped:{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",logo:Op},stables:{usd:["0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"]},explorer:"https://polygonscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://polygonscan.com/tx/${e.id||e}`:t?`https://polygonscan.com/token/${t}`:n?`https://polygonscan.com/address/${n}`:void 0,endpoints:["https://polygon-rpc.com","https://poly-rpc.gateway.pokt.network","https://polygon.llamarpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"MATIC",name:"Polygon",decimals:18,logo:Dp,type:"NATIVE"},{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",symbol:"WMATIC",name:"Wrapped Matic",decimals:18,logo:Op,type:"20"},{address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xf6261529C6C2fBEB313aB25cDEcD243613b40EB5",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const _p="data:image/svg+xml;base64,PHN2ZyB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y00LjktNC45LTEyLjItNy4zLTE3LjEtNy4zSDEyNS4zYy0xMi4yIDAtMTcuMSAxNC43LTkuOCAyMkwyMzggNTY3LjNjNC45IDQuOSAxMi4yIDcuMyAxNy4xIDcuM2g2MTkuN2MxMi4yIDAgMTcuMS0xNC43IDkuOC0yMkw3NjIuMSA0MzAuMXoiIGZpbGw9InVybCgjU1ZHSURfMDAwMDAwMDc0MDk4NzczNjMxMDQ5ODE2MzAwMDAwMTUxMzM3MDU1NzA2ODAwOTc3MDlfKSIvPjwvc3ZnPgo=",Pp="https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png";var Rp={name:"solana",networkId:"solana",namespace:"solana",label:"Solana",fullName:"Solana Mainnet Beta",logo:_p,logoBackgroundColor:"#000000",logoWhiteBackground:_p,currency:{name:"Solana",symbol:"SOL",decimals:9,address:"11111111111111111111111111111111",logo:Pp},wrapped:{address:"So11111111111111111111111111111111111111112",logo:Pp},stables:{usd:["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"]},explorer:"https://solscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://solscan.io/tx/${e.id||e}`:t?`https://solscan.io/token/${t}`:n?`https://solscan.io/address/${n}`:void 0,endpoints:["https://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","https://mainnet-beta.solflare.network","https://solana-mainnet.rpc.extrnode.com"],sockets:["wss://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","wss://mainnet-beta.solflare.network"],tokens:[{address:"11111111111111111111111111111111",symbol:"SOL",name:"Solana",decimals:9,logo:Pp,type:"NATIVE"},{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://img.raydium.io/icon/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.png",type:"SPL"},{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",name:"USDT",decimals:6,logo:"https://img.raydium.io/icon/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB.png",type:"SPL"},{address:"7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",symbol:"stSOL",name:"Lido Staked SOL",decimals:9,logo:"https://img.raydium.io/icon/7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj.png",type:"SPL"},{address:"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",symbol:"BONK",name:"BONK",decimals:5,logo:"https://img.raydium.io/icon/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263.png",type:"SPL"},{address:"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",symbol:"SAMO",name:"Samoyed Coin",decimals:9,logo:"https://img.raydium.io/icon/7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU.png",type:"SPL"},{address:"DePay1miDBPWXs6PVQrdC5Vch2jemgEPaiyXLNLLa2NF",symbol:"DEPAY",name:"DePay",decimals:9,logo:"https://depay.com/favicon.png",type:"SPL"}],zero:"0",maxInt:"340282366920938463463374607431768211455"};const Bp="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDF7ZmlsbDojMjEzMTQ3fTwvc3R5bGU+PHBhdGggZD0iTTkyIDkyaDgxNnY4MTZIOTJWOTJ6IiBmaWxsPSJub25lIi8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTE2NS44IDM0MC4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gMTczYzkuNSA1LjUgMjAuMiA4LjIgMzEgOC4yczIxLjItMi42IDMxLTguMmwyOTkuNi0xNzNjMTkuMi0xMS4xIDMxLTMxLjMgMzEtNTMuNXYtMzQ2YzAtMjIuMi0xMS44LTQyLjQtMzEtNTMuNWwtMjk5LjktMTczYy05LjUtNS41LTIwLjItOC4yLTMxLTguMmguM3oiIGZpbGw9IiM5ZGNjZWQiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJtMzAxLjUgODAzLjIgMjcuOC03NS43IDU1LjUgNDYtNTEuOSA0Ny43LTMxLjQtMTh6Ii8+PHBhdGggZD0iTTQ3NC41IDMwMi4yaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOEwyMjIuOSA3NTcuNWw3OC42IDQ1LjRMNDgxLjEgMzExYzEuNi00LjYtMS42LTkuMS02LjItOS4xbC0uNC4zem0xMzMuMiAwaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOGwtMTg2IDUwOS44IDc4LjYgNDUuNEw2MTMuOSAzMTFjMS42LTQuNi0xLjYtOS4xLTYuMi05LjF2LjN6IiBmaWxsPSIjZmZmIi8+PC9zdmc+Cg==";var Up={name:"arbitrum",id:"0xa4b1",networkId:"42161",namespace:"eip155",platform:"evm",label:"Arbitrum",fullName:"Arbitrum One",logo:Bp,logoBackgroundColor:"#2b354d",logoWhiteBackground:Bp,currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Sp.currency.logo},wrapped:{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",logo:Sp.wrapped.logo},stables:{usd:["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"]},explorer:"https://arbiscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://arbiscan.io/tx/${e.id||e}`:t?`https://arbiscan.io/token/${t}`:n?`https://arbiscan.io/address/${n}`:void 0,endpoints:["https://arbitrum.blockpi.network/v1/rpc/public","https://arbitrum-one.publicnode.com","https://endpoints.omniatech.io/v1/arbitrum/one/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Sp.currency.logo,type:"NATIVE"},{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Sp.wrapped.logo,type:"20"},{address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8/logo.png",type:"20"},{address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1/logo.png",type:"20"},{address:"0x912CE59144191C1204E64559FE8253a0e49E6548",symbol:"ARB",name:"Arbitrum",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x912CE59144191C1204E64559FE8253a0e49E6548/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Wp="https://traderjoexyz.com/static/media/avalanche.7c81486190237e87e238c029fd746008.svg",Qp="https://raw.githubusercontent.com/traderjoe-xyz/joe-tokenlists/main/logos/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7/logo.png";var Yp={name:"avalanche",id:"0xa86a",networkId:"43114",namespace:"eip155",platform:"evm",label:"Avalanche",fullName:"Avalanche C-Chain",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0zNTkuMSA3NTEuMWgtOTUuM2MtMjAgMC0yOS45IDAtMzYtMy44LTYuNi00LjMtMTAuNC0xMS4zLTEwLjktMTguOS0uMy03LjEgNC42LTE1LjggMTQuNC0zM2wyMzUtNDE0LjNjMTAuMS0xNy42IDE1LjEtMjYuNCAyMS40LTI5LjYgNi45LTMuNSAxNS4xLTMuNSAyMS45IDAgNi40IDMuMyAxMS40IDEyIDIxLjQgMjkuNmw0OC40IDg0LjMuMi41YzEwLjggMTguOSAxNi4zIDI4LjUgMTguNiAzOC41IDIuNiAxMC45IDIuNiAyMi42IDAgMzMuNS0yLjQgMTAuMS03LjggMTkuOC0xOC44IDM4LjlMNDU2LjIgNjk0LjlsLS4zLjVjLTEwLjggMTktMTYuMyAyOC43LTI0LjEgMzYtOC4zIDgtMTguMyAxMy43LTI5LjMgMTYuOS05LjkgMi44LTIxLjEgMi44LTQzLjQgMi44em0yNDAuMyAwaDEzNi40YzIwLjIgMCAzMC4yIDAgMzYuMy00IDYuNi00LjMgMTAuNi0xMS4zIDEwLjktMTkuMS4zLTYuOS00LjUtMTUuMi0xMy45LTMxLjZsLTEtMS43TDY5OS44IDU3OGwtLjgtMS4yYy05LjYtMTYuMy0xNC40LTI0LjUtMjAuNy0yNy42LTYuOS0zLjYtMTUtMy42LTIxLjcgMC02LjIgMy4zLTExLjMgMTEuOC0yMS4zIDI5bC02OC4xIDExNi45LS4yLjNjLTEwLjEgMTcuMi0xNSAyNS44LTE0LjUgMzIuOC41IDcuNyA0LjUgMTQuOSAxMC45IDE5IDUuNyAzLjkgMTUuOCAzL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MtOC40LTE0LjItMTIuNi0yMS4zLTE4LTI0LjEtNi0zLTEzLjEtMy0xOSAwLTUuNSAyLjgtOS45IDEwLjMtMTguNiAyNS4zbC01OS40IDEwMi0uMi40Yy04LjcgMTUtMTMgMjIuNS0xMi43IDI4LjcuNCA2LjcgMy45IDEyLjkgOS42IDE2LjYgNSAzLjMgMTMuOCAzLjMgMzEuNCAzLjN6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2U4NDE0MiIvPjwvc3ZnPg==",currency:{name:"Avalanche",symbol:"AVAX",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Wp},wrapped:{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",logo:Qp},stables:{usd:["0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7","0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"]},explorer:"https://snowtrace.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://snowtrace.io/tx/${e.id||e}`:t?`https://snowtrace.io/token/${t}`:n?`https://snowtrace.io/address/${n}`:void 0,endpoints:["https://avalanche.public-rpc.com","https://avalanche.blockpi.network/v1/rpc/public","https://avax.meowrpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"AVAX",name:"Avalanche",decimals:18,logo:Wp,type:"NATIVE"},{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",symbol:"WAVAX",name:"Wrapped AVAX",decimals:18,logo:Qp,type:"20"},{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7/logo.png",type:"20"},{address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E/logo.png",type:"20"},{address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70/logo.png",type:"20"},{address:"0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Fp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAC7CAMAAAAKTh9YAAAAYFBMVEVHcEz////////////////////////////////////j++ma6qVj5nsl5lAK4zpA6mXO79aD8Zyr87uCvq0J2TkItEkOhl4EeVsKzSwLrxMNtQpjsZG42dEeuxyF2oU6wzjPwJjeAAAACnRSTlMAEUB9r9j/YO+Kf6/iMwAABD1JREFUeAHU1EESQjEMAlBIAq33v7ArV7+OLss7AZOB4IDVI/kW0nQRf+Ca7QvNwg/s7VtpGJP8oPFNybdT4aidoPHEcYZn6ymnEEOjH8KPk0zeTI+DLacpfMhpxKTGnFtDB9o8/Jisw8uxh1/OtGIrYw9Ah9pEOVWhnaoxTvWCnErR2Z3rzX59JMYOAkEYXr1gRJfIzP1PalbOpZm2aEf+tcKnCCz7bS37si/7si/7si/7si/7srvRHAE5kJHdbV4wkn076Q9RMMLu04fYnceT/An9JnhMkr19Ezwvvvee73ieOL1dfdN15yQlwas2S7vbgTn4iLfaDO0emIPPeLtgZt+AOfhcQHJGdieYg88VLG9k98AUfG7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n9UeNQgiTUehB+Mit01/qWv+yPLohfQKoExDCWHrq0iR0sv7IXu3g+ARC9TyEMEn0ZHT1EmPjD23FwfExBOplfathCJEnWken5cXTk9MbvUlrscdklBd5oWumPX2kv6QPgDaZtqzVXuxkdHwYvtLR42EZ6UXqOog81n7s1faPP6k/0xNyIEokigJX4Yx+/Up0GnqbkceSiT1GS5UFvUwZYEx/5n36ixzW/8SgjPyiqeicrHC+sgGAmtGRvx1dMtph4NW+AiZycfiu2QTRAAAAAElFTkSuQmCC";var Hp={name:"gnosis",id:"0x64",networkId:"100",namespace:"eip155",label:"Gnosis",fullName:"Gnosis Chain",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbDojZmZmfTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MCIgZD0iTTMzMS45IDU1Ni41YzIzLjUgMCA0Ni40LTcuOCA2NS0yMi4yTDI0OCAzODUuNGMtMzUuOSA0Ni40LTI3LjQgMTEyLjkgMTguOSAxNDguOCAxOC42IDE0IDQxLjUgMjEuOSA2NSAyMS45di40em00NDIuMy0xMDYuMWMwLTIzLjUtNy44LTQ2LjQtMjIuMi02NUw2MDMuMiA1MzQuMmM0Ni40IDM1LjkgMTEyLjkgMjcuNCAxNDguOC0xOC45IDE0LjMtMTguNiAyMi4yLTQxLjQgMjIuMi02NC45eiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Im04NDkuMiAyODguNS02NS45IDY1LjljNTIuOSA2My42IDQ0LjcgMTU4LTE4LjkgMjExLjItNTUuNiA0Ni43LTEzNi42IDQ2LjctMTkyLjIgMEw1MDAgNjM3LjdsLTcyLjEtNzIuMWMtNjMuNiA1Mi45LTE1OCA0NC43LTIx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EeE","0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83"]},explorer:"https://gnosisscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://gnosisscan.io/tx/${e.id||e}`:t?`https://gnosisscan.io/token/${t}`:n?`https://gnosisscan.io/address/${n}`:void 0,endpoints:["https://rpc.gnosis.gateway.fm","https://rpc.gnosischain.com","https://gnosis.blockpi.network/v1/rpc/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"xDAI",name:"xDAI",decimals:18,logo:Fp,type:"NATIVE"},{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",symbol:"WXDAI",name:"Wrapped XDAI",decimals:18,logo:Vp,type:"20"},{address:"0x4ECaBa5870353805a9F068101A40E0f32ed605C6",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",symbol:"GNO",name:"Gnosis",decimals:18,logo:"https://cdn.sushi.com/image/upload/f_auto,c_limit,w_16,q_auto/tokens/100/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb.jpg",type:"20"},{address:"0xD057604A14982FE8D88c5fC25Aac3267eA142a08",symbol:"HOPR",name:"HOPR",decimals:18,logo:"https://hoprnet.org/assets/icons/hopr_icon.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var Gp={name:"optimism",id:"0xa",networkId:"10",namespace:"eip155",label:"Optimism",fullName:"Optimism",logo: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ggMi4xaDQxYzIuMiAwIDQuMS0uNyA1LjctMi4xIDEuOC0xLjQgMi45LTMuMiAzLjMtNS40bDEzLjktNjZoNDAuN2MyNS45IDAgNDYuNS01LjUgNjEuOC0xNi42IDE1LjUtMTEuMSAyNS43LTI4LjEgMzAuNy01MS4yIDIuNC0xMS43IDIuMy0yMS44LS4zLTMwLjQtMi42LTguOC03LjItMTYuMi0xMy45LTIyLTYuNi01LjgtMTUtMTAuMS0yNS0xMy05LjgtMi44LTIwLjktNC4yLTMzLjItNC4yaC04MC4yYy0yIDAtMy45LjctNS43IDIuMS0xLjggMS40LTIuOSAzLjItMy4zIDUuNEw1MDkgNjAzLjVjLS40IDIuMiAwIDQgMS4yIDUuNXptMTExLjItMTEzLjFoLTM0LjdsMTEuOC01NGgzNi4yYzcuMiAwIDEyLjYgMS4yIDE2IDMuNiAzLjYgMi40IDUuNyA1LjYgNi4zIDkuNi42IDQgLjQgOC42LS42IDEzLjktMiA5LTYuMyAxNS44LTEzIDIwLjItNi40IDQuNS0xMy44IDYuNy0yMiA2Ljd6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2ZmMDQyMCIvPjwvc3ZnPg==",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Sp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Sp.wrapped.logo},stables:{usd:["0x94b008aA00579c1307B0EF2c499aD98a8ce58e58","0x7F5c764cBc14f9669B88837ca1490cCa17c31607"]},explorer:"https://optimistic.etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://optimistic.etherscan.io/tx/${e.id||e}`:t?`https://optimistic.etherscan.io/token/${t}`:n?`https://optimistic.etherscan.io/address/${n}`:void 0,endpoints:["https://optimism.blockpi.network/v1/rpc/public","https://optimism.meowrpc.com","https://optimism.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Sp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Sp.wrapped.logo,type:"20"},{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58/logo.png",type:"20"},{address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x7F5c764cBc14f9669B88837ca1490cCa17c31607/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x4200000000000000000000000000000000000042",symbol:"OP",name:"Optimism",decimals:18,logo:"https://user-images.githubusercontent.com/1300064/219575413-d7990d69-1d21-44ef-a2b1-e9c682c79802.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var qp={name:"base",id:"0x2105",networkId:"8453",namespace:"eip155",label:"Base",fullName:"Base",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguNiA4NDJDNjg4IDg0MiA4NDIgNjg4LjkgODQyIDQ5OS41UzY4OCAxNTcgNDk4LjYgMTU3QzMxOSAxNTcgMTcxLjIgMjk1LjEgMTU3IDQ3MC4zaDQ1My4xdjU3LjVIMTU3QzE3MiA3MDMuOSAzMTkgODQyIDQ5OC42IDg0MnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",logoBackgroundColor:"#0052FF",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguOSA4NDVDNjkwLjEgODQ1IDg0NSA2OTAuMyA4NDUgNDk5LjVTNjkwLjEgMTU0IDQ5OC45IDE1NEMzMTcuNiAxNTQgMTY4LjggMjkzLjMgMTU0IDQ3MC41aDQ1Ny40djU4LjFIMTU0QzE2OC44IDcwNS44IDMxNy42IDg0NSA0OTguOSA4NDV6IiBmaWxsPSIjMDA1MmZmIi8+PC9zdmc+",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Sp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Sp.wrapped.logo},stables:{usd:["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"]},explorer:"https://basescan.org",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://basescan.org/tx/${e.id||e}`:t?`https://basescan.org/token/${t}`:n?`https://basescan.org/address/${n}`:void 0,endpoints:["https://base.blockpi.network/v1/rpc/public","https://base.meowrpc.com","https://mainnet.base.org"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Sp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Sp.wrapped.logo,type:"20"},{address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",symbol:"USDbC",name:"USD Base Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Zp=[Sp,kp,zp,Rp,Cp,Up,Yp,Hp,Gp,qp];var Jp={ethereum:Sp,bsc:kp,polygon:zp,solana:Rp,fantom:Cp,arbitrum:Up,avalanche:Yp,gnosis:Hp,optimism:Gp,base:qp,all:Zp,findById:function(e){let t=e;return t.match("0x0")&&(t=t.replace(/0x0+/,"0x")),Zp.find((e=>e.id&&e.id.toLowerCase()==t.toLowerCase()))},findByNetworkId:function(e){return e=e.toString(),Zp.find((t=>t.networkId==e))},findByName:function(e){return Zp.find((t=>t.name==e))}},Xp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $p(e){var t={exports:{}};return e(t,t.exports),t.exports}for(var ef=function(e){var t=lf(e),n=t[0],r=t[1];return 3*(n+r)/4-r},tf=function(e){var t,n,r=lf(e),i=r[0],o=r[1],a=new af(function(e,t,n){return 3*(t+n)/4-n}(0,i,o)),s=0,u=o>0?i-4:i;for(n=0;n>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=of[e.charCodeAt(n)]<<2|of[e.charCodeAt(n+1)]>>4,a[s++]=255&t);1===o&&(t=of[e.charCodeAt(n)]<<10|of[e.charCodeAt(n+1)]<<4|of[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},nf=function(e){for(var t,n=e.length,r=n%3,i=[],o=16383,a=0,s=n-r;as?s:a+o));1===r?(t=e[n-1],i.push(rf[t>>2]+rf[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(rf[t>>10]+rf[t>>4&63]+rf[t<<2&63]+"="));return i.join("")},rf=[],of=[],af="undefined"!=typeof Uint8Array?Uint8Array:Array,sf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uf=0,cf=sf.length;uf0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function df(e,t,n){for(var r,i,o=[],a=t;a>18&63]+rf[i>>12&63]+rf[i>>6&63]+rf[63&i]);return o.join("")}of["-".charCodeAt(0)]=62,of["_".charCodeAt(0)]=63;var hf={byteLength:ef,toByteArray:tf,fromByteArray:nf},pf=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},ff=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=f,a/=256,c-=8);e[n+p-f]|=128*y},yf=$p((function(e,t){var n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},t.INSPECT_MAX_BYTES=50;var r=2147483647;function i(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|h(e,t),r=i(n),a=r.write(e,t);a!==n&&(r=r.slice(0,a));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(R(e,Uint8Array)){var t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(R(e,ArrayBuffer)||e&&R(e.buffer,ArrayBuffer))return l(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(R(e,SharedArrayBuffer)||e&&R(e.buffer,SharedArrayBuffer)))return l(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,n);var a=function(e){if(o.isBuffer(e)){var t=0|d(e.length),n=i(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||B(e.length)?i(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return s(e),i(e<0?0:0|d(e))}function c(e){for(var t=e.length<0?0:0|d(e.length),n=i(t),r=0;r=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||R(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return _(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var d=!0,h=0;hi&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?hf.fromByteArray(e):hf.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?o.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else{if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,n,r,i){if(R(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(a,s),c=this.slice(r,i),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":case"latin1":case"binary":return b(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function S(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function C(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,4),ff(e,t,n,r,23,4),n+4}function D(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,8),ff(e,t,n,r,52,8),n+8}o.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),pf(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),pf(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),pf(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),pf(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||S(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r)||S(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,n){return C(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return C(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function _(e){return hf.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function P(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function R(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function B(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()})),mf=$p((function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:yf.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=s(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var d=["","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"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return m(e,t,n)}Math.imul||(y=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?f(this,e,t):n<1024?m(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new T(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function N(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(w,b),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new N(e)},r(N,T),N.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},N.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},N.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},N.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,Xp)})); +e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new I(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return L()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=h(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=d;var p={};function f(){}function y(){}function m(){}var g={};l(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(k([])));b&&b!==i&&o.call(b,s)&&(g=b);var w=m.prototype=f.prototype=Object.create(g);function M(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,n){function r(i,a,s,u){var c=h(e[i],e,a);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==t(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var i;this._invoke=function(e,t){function o(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(o,o):o()}}function E(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function k(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Po)),Po.exports}var Wo,Qo={exports:{}};var Yo,Fo={exports:{}};function Vo(){return Yo||(Yo=1,function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(Fo)),Fo.exports}var Ho,Go={exports:{}};function qo(){return Ho||(Ho=1,function(e){function t(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(0,o.default)(this,f);var a=r.autoconnect,s=void 0===a||a,u=r.reconnect,c=void 0===u||u,l=r.reconnect_interval,d=void 0===l?1e3:l,y=r.max_reconnects,m=void 0===y?5:y,g=h(r,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(t=p.call(this)).webSocketFactory=e,t.queue={},t.rpc_id=0,t.address=n,t.autoconnect=s,t.ready=!1,t.reconnect=c,t.reconnect_timer_id=void 0,t.reconnect_interval=d,t.max_reconnects=m,t.rest_options=g,t.current_reconnects=0,t.generate_request_id=i||function(){return++t.rpc_id},t.autoconnect&&t._connect(t.address,Object.assign({autoconnect:t.autoconnect,reconnect:t.reconnect,reconnect_interval:t.reconnect_interval,max_reconnects:t.max_reconnects},t.rest_options)),t}return(0,a.default)(f,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(e,t,n,r){var o=this;return r||"object"!==(0,i.default)(n)||(r=n,n=null),new Promise((function(i,a){if(!o.ready)return a(new Error("socket not ready"));var s=o.generate_request_id(e,t),u={jsonrpc:"2.0",method:e,params:t||null,id:s};o.socket.send(JSON.stringify(u),r,(function(e){if(e)return a(e);o.queue[s]={promise:[i,a]},n&&(o.queue[s].timeout=setTimeout((function(){delete o.queue[s],a(new Error("reply timeout"))}),n))}))}))}},{key:"login",value:(l=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("rpc.login",t);case 2:if(r=e.sent){e.next=5;break}throw new Error("authentication failed");case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"listMethods",value:(c=(0,r.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("__listMethods");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"notify",value:function(e,t){var n=this;return new Promise((function(r,i){if(!n.ready)return i(new Error("socket not ready"));var o={jsonrpc:"2.0",method:e,params:t||null};n.socket.send(JSON.stringify(o),(function(e){if(e)return i(e);r()}))}))}},{key:"subscribe",value:(u=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.on",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed subscribing to an event '"+t+"' with: "+r[t]);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"unsubscribe",value:(t=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.off",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed unsubscribing from an event with: "+r);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"close",value:function(e,t){this.socket.close(e||1e3,t)}},{key:"_connect",value:function(e,t){var n=this;clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",(function(){n.ready=!0,n.emit("open"),n.current_reconnects=0})),this.socket.addEventListener("message",(function(e){var t=e.data;t instanceof ArrayBuffer&&(t=Te.from(t).toString());try{t=JSON.parse(t)}catch(e){return}if(t.notification&&n.listeners(t.notification).length){if(!Object.keys(t.params).length)return n.emit(t.notification);var r=[t.notification];if(t.params.constructor===Object)r.push(t.params);else for(var i=0;in.current_reconnects||0===n.max_reconnects)&&(n.reconnect_timer_id=setTimeout((function(){return n._connect(e,t)}),n.reconnect_interval)))}))}}]),f}(l.EventEmitter);e.default=p}(jo);var pa=S(jo),fa={};!function(e){var t=Co.exports;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){return new u(e,t)};var n=t(Vo()),r=t(qo()),i=t(ea()),o=t(aa()),a=t(ca());function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,a.default)(e);if(t){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}var u=function(e){(0,i.default)(o,e);var t=s(o);function o(e,r,i){var a;return(0,n.default)(this,o),(a=t.call(this)).socket=new window.WebSocket(e,i),a.socket.onopen=function(){return a.emit("open")},a.socket.onmessage=function(e){return a.emit("message",e.data)},a.socket.onerror=function(e){return a.emit("error",e)},a.socket.onclose=function(e){a.emit("close",e.code,e.reason)},a}return(0,r.default)(o,[{key:"send",value:function(e,t,n){var r=n||t;try{this.socket.send(e),r()}catch(e){r(e)}}},{key:"close",value:function(e,t){this.socket.close(e,t)}},{key:"addEventListener",value:function(e,t,n){this.socket.addEventListener(e,t,n)}}]),o}(ha().EventEmitter)}(fa);for(var ya=S(fa),ma=[],ga=[],va=[],ba=BigInt(0),wa=BigInt(1),Ma=BigInt(2),Aa=BigInt(7),Ea=BigInt(256),Ta=BigInt(113),Na=0,Ia=wa,ka=1,La=0;Na<24;Na++){var xa=[La,(2*ka+3*La)%5];ka=xa[0],La=xa[1],ma.push(2*(5*La+ka)),ga.push((Na+1)*(Na+2)/2%64);for(var Sa=ba,ja=0;ja<7;ja++)(Ia=(Ia<>Aa)*Ta)%Ea)&Ma&&(Sa^=wa<<(wa<32?At.rotlBH(e,t,n):At.rotlSH(e,t,n)},_a=function(e,t,n){return n>32?At.rotlBL(e,t,n):At.rotlSL(e,t,n)};var Pa=function(e){Q(n,mt);var t=X(n);function n(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(R(this,n),(o=t.call(this)).blockLen=e,o.suffix=r,o.outputLen=i,o.enableXOF=a,o.rounds=s,o.pos=0,o.posOut=0,o.finished=!1,o.destroyed=!1,dt.number(i),0>=o.blockLen||o.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");return o.state=new Uint8Array(200),o.state32=ht(o.state),o}return U(n,[{key:"keccak",value:function(){!function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24,n=new Uint32Array(10),r=24-t;r<24;r++){for(var i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(var o=0;o<10;o+=2)for(var a=(o+8)%10,s=(o+2)%10,u=n[s],c=n[s+1],l=za(u,c,1)^n[a],d=_a(u,c,1)^n[a+1],h=0;h<50;h+=10)e[o+h]^=l,e[o+h+1]^=d;for(var p=e[2],f=e[3],y=0;y<24;y++){var m=ga[y],g=za(p,f,m),v=_a(p,f,m),b=ma[y];p=e[b],f=e[b+1],e[b]=g,e[b+1]=v}for(var w=0;w<50;w+=10){for(var M=0;M<10;M++)n[M]=e[w+M];for(var A=0;A<10;A++)e[w+A]^=~n[(A+2)%10]&n[(A+4)%10]}e[0]^=Da[r],e[1]^=Oa[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}},{key:"update",value:function(e){dt.exists(this);for(var t=this.blockLen,n=this.state,r=(e=yt(e)).length,i=0;i=n&&this.keccak();var o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}},{key:"xofInto",value:function(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}},{key:"xof",value:function(e){return dt.number(e),this.xofInto(new Uint8Array(e))}},{key:"digestInto",value:function(e){if(dt.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}},{key:"digest",value:function(){return this.digestInto(new Uint8Array(this.outputLen))}},{key:"destroy",value:function(){this.destroyed=!0,this.state.fill(0)}},{key:"_cloneInto",value:function(e){var t=this.blockLen,r=this.suffix,i=this.outputLen,o=this.rounds,a=this.enableXOF;return e||(e=new n(t,r,i,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}}]),n}(),Ra=function(e,t,n){return gt((function(){return new Pa(t,e,n)}))};Ra(6,144,28),Ra(6,136,32),Ra(6,104,48),Ra(6,72,64),Ra(1,144,28);var Ba=Ra(1,136,32);Ra(1,104,48),Ra(1,72,64);var Ua=function(e,t,n){return i=function(e,t){return r(t).update(yt(e)).digest()},o=(r=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Pa(t,e,void 0===r.dkLen?n:r.dkLen,!0)})({}),i.outputLen=o.outputLen,i.blockLen=o.blockLen,i.create=function(e){return r(e)},i;var r,i,o};Ua(31,168,16),Ua(31,136,32);var Wa=function(e){Q(n,mt);var t=X(n);function n(e,r){var i;R(this,n),(i=t.call(this)).finished=!1,i.destroyed=!1,dt.hash(e);var o=yt(r);if(i.iHash=e.create(),"function"!=typeof i.iHash.update)throw new TypeError("Expected instance of class which extends utils.Hash");i.blockLen=i.iHash.blockLen,i.outputLen=i.iHash.outputLen;var a=i.blockLen,s=new Uint8Array(a);s.set(o.length>a?e.create().update(o).digest():o);for(var u=0;ua,h=l>a;if(d&&(c=t-c),h&&(l=t-l),c>a||l>a)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:h,k2:l}};function Ka(e){var t=qa.a,n=qa.b,r=Es(e*e),i=Es(r*e);return Es(i+t*e+n)}var $a=qa.a===Ya,es=function(e){Q(n,G(Error));var t=X(n);function n(e){return R(this,n),t.call(this,e)}return U(n)}();function ts(e){if(!(e instanceof ns))throw new TypeError("JacobianPoint expected")}var ns=function(){function e(t,n,r){R(this,e),this.x=t,this.y=n,this.z=r}return U(e,[{key:"equals",value:function(e){ts(e);var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=Es(r*r),u=Es(a*a),c=Es(t*u),l=Es(i*s),d=Es(Es(n*a)*u),h=Es(Es(o*r)*s);return c===l&&d===h}},{key:"negate",value:function(){return new e(this.x,Es(-this.y),this.z)}},{key:"double",value:function(){var t=this.x,n=this.y,r=this.z,i=Es(t*t),o=Es(n*n),a=Es(o*o),s=t+o,u=Es(Va*(Es(s*s)-i-a)),c=Es(Ha*i),l=Es(c*c),d=Es(l-Va*u);return new e(d,Es(c*(u-d)-Ga*a),Es(Va*n*r))}},{key:"add",value:function(t){ts(t);var n=this.x,r=this.y,i=this.z,o=t.x,a=t.y,s=t.z;if(o===Ya||a===Ya)return this;if(n===Ya||r===Ya)return t;var u=Es(i*i),c=Es(s*s),l=Es(n*c),d=Es(o*u),h=Es(Es(r*s)*c),p=Es(Es(a*i)*u),f=Es(d-l),y=Es(p-h);if(f===Ya)return y===Ya?this.double():e.ZERO;var m=Es(f*f),g=Es(f*m),v=Es(l*m),b=Es(y*y-g-Va*v);return new e(b,Es(y*(v-b)-h*g),Es(i*s*f))}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiplyUnsafe",value:function(t){var n=e.ZERO;if("bigint"==typeof t&&t===Ya)return n;var r=As(t);if(r===Fa)return this;if(!$a){for(var i=n,o=this;r>Ya;)r&Fa&&(i=i.add(o)),o=o.double(),r>>=Fa;return i}for(var a=Xa(r),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,d=n,h=n,p=this;u>Ya||l>Ya;)u&Fa&&(d=d.add(p)),l&Fa&&(h=h.add(p)),p=p.double(),u>>=Fa,l>>=Fa;return s&&(d=d.negate()),c&&(h=h.negate()),h=new e(Es(h.x*Ja),h.y,h.z),d.add(h)}},{key:"precomputeWindow",value:function(e){for(var t=$a?128/e+1:256/e+1,n=[],r=this,i=r,o=0;o>=d,f>u&&(f-=l,t+=Fa);var y=p,m=p+Math.abs(f)-1,g=h%2!=0,v=f<0;0===f?a=a.add(rs(g,i[y])):o=o.add(rs(v,i[m]))}return{p:o,f:a}}},{key:"multiply",value:function(t,n){var r,i,o=As(t);if($a){var a=Xa(o),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,d=this.wNAF(u,n),h=d.p,p=d.f,f=this.wNAF(l,n),y=f.p,m=f.f;h=rs(s,h),y=new e(Es((y=rs(c,y)).x*Ja),y.y,y.z),r=h.add(y),i=p.add(m)}else{var g=this.wNAF(o,n);r=g.p,i=g.f}return e.normalizeZ([r,i])[0]}},{key:"toAffine",value:function(t){var n=this.x,r=this.y,i=this.z,o=this.equals(e.ZERO);null==t&&(t=o?Ga:Ns(i));var a=t,s=Es(a*a),u=Es(s*a),c=Es(n*s),l=Es(r*u),d=Es(i*a);if(o)return os.ZERO;if(d!==Fa)throw new Error("invZ was invalid");return new os(c,l)}}],[{key:"fromAffine",value:function(t){if(!(t instanceof os))throw new TypeError("JacobianPoint#fromAffine: expected Point");return t.equals(os.ZERO)?e.ZERO:new e(t.x,t.y,Fa)}},{key:"toAffineBatch",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qa.P,n=new Array(e.length),r=Ns(e.reduce((function(e,r,i){return r===Ya?e:(n[i]=e,Es(e*r,t))}),Fa),t);return e.reduceRight((function(e,r,i){return r===Ya?e:(n[i]=Es(e*n[i],t),Es(e*r,t))}),r),n}(e.map((function(e){return e.z})));return e.map((function(e,n){return e.toAffine(t[n])}))}},{key:"normalizeZ",value:function(t){return e.toAffineBatch(t).map(e.fromAffine)}}]),e}();function rs(e,t){var n=t.negate();return e?n:t}ns.BASE=new ns(qa.Gx,qa.Gy,Fa),ns.ZERO=new ns(Ya,Fa,Ya);var is=new WeakMap,os=function(){function e(t,n){R(this,e),this.x=t,this.y=n}return U(e,[{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,is.delete(this)}},{key:"hasEvenY",value:function(){return this.y%Va===Ya}},{key:"toRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return bs(this.toHex(e))}},{key:"toHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=ys(this.x);if(e){var n=this.hasEvenY()?"02":"03";return"".concat(n).concat(t)}return"04".concat(t).concat(ys(this.y))}},{key:"toHexX",value:function(){return this.toHex(!0).slice(2)}},{key:"toRawX",value:function(){return this.toRawBytes(!0).slice(1)}},{key:"assertValidity",value:function(){var e="Point is not on elliptic curve",t=this.x,n=this.y;if(!Ss(t)||!Ss(n))throw new Error(e);var r=Es(n*n);if(Es(r-Ka(t))!==Ya)throw new Error(e)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(this.x,Es(-this.y))}},{key:"double",value:function(){return ns.fromAffine(this).double().toAffine()}},{key:"add",value:function(e){return ns.fromAffine(this).add(ns.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return ns.fromAffine(this).multiply(e,this).toAffine()}},{key:"multiplyAndAddUnsafe",value:function(t,n,r){var i=ns.fromAffine(this),o=n===Ya||n===Fa||this!==e.BASE?i.multiplyUnsafe(n):i.multiply(n),a=ns.fromAffine(t).multiplyUnsafe(r),s=o.add(a);return s.equals(ns.ZERO)?void 0:s.toAffine()}}],[{key:"fromCompressedHex",value:function(t){var n=32===t.length,r=ws(n?t:t.subarray(1));if(!Ss(r))throw new Error("Point is not on curve");var i=function(e){var t=qa.P,n=BigInt(6),r=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),s=BigInt(88),u=e*e*e%t,c=u*u*e%t,l=Ts(c,Ha)*c%t,d=Ts(l,Ha)*c%t,h=Ts(d,Va)*u%t,p=Ts(h,r)*h%t,f=Ts(p,i)*p%t,y=Ts(f,a)*f%t,m=Ts(y,s)*y%t,g=Ts(m,a)*f%t,v=Ts(g,Ha)*c%t,b=Ts(v,o)*p%t,w=Ts(b,n)*u%t,M=Ts(w,Va);if(M*M%t!==e)throw new Error("Cannot find square root");return M}(Ka(r)),o=(i&Fa)===Fa;n?o&&(i=Es(-i)):1==(1&t[0])!==o&&(i=Es(-i));var a=new e(r,i);return a.assertValidity(),a}},{key:"fromUncompressedHex",value:function(t){var n=new e(ws(t.subarray(1,33)),ws(t.subarray(33,65)));return n.assertValidity(),n}},{key:"fromHex",value:function(e){var t=Ms(e),n=t.length,r=t[0];if(32===n)return this.fromCompressedHex(t);if(33===n&&(2===r||3===r))return this.fromCompressedHex(t);if(65===n&&4===r)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-".concat(33," compressed bytes or ").concat(65," uncompressed bytes, not ").concat(n))}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(Cs(t))}},{key:"fromSignature",value:function(t,n,r){var i=function(e){if(e instanceof us)return e.assertValidity(),e;try{return us.fromDER(e)}catch(t){return us.fromCompact(e)}}(n),o=i.r,a=i.s;if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");var s=ks(Ms(t)),u=qa.n,c=2===r||3===r?o+u:o,l=Ns(c,u),d=Es(-s*l,u),h=Es(a*l,u),p=1&r?"03":"02",f=e.fromHex(p+ys(c)),y=e.BASE.multiplyAndAddUnsafe(f,d,h);if(!y)throw new Error("Cannot recover signature: point at infinify");return y.assertValidity(),y}}]),e}();function as(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function ss(e){if(e.length<2||2!==e[0])throw new Error("Invalid signature integer tag: ".concat(ds(e)));var t=e[1],n=e.subarray(2,t+2);if(!t||n.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===n[0]&&n[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:ws(n),left:e.subarray(t+2)}}os.BASE=new os(qa.Gx,qa.Gy),os.ZERO=new os(Ya,Ya);var us=function(){function e(t,n){R(this,e),this.r=t,this.s=n,this.assertValidity()}return U(e,[{key:"assertValidity",value:function(){var e=this.r,t=this.s;if(!xs(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!xs(t))throw new Error("Invalid Signature: s must be 0 < s < n")}},{key:"hasHighS",value:function(){var e=qa.n>>Fa;return this.s>e}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,Es(-this.s,qa.n)):this}},{key:"toDERRawBytes",value:function(){return bs(this.toDERHex())}},{key:"toDERHex",value:function(){var e=as(gs(this.s)),t=as(gs(this.r)),n=e.length/2,r=t.length/2,i=gs(n),o=gs(r),a=gs(r+n+4);return"30".concat(a,"02").concat(o).concat(t,"02").concat(i).concat(e)}},{key:"toRawBytes",value:function(){return this.toDERRawBytes()}},{key:"toHex",value:function(){return this.toDERHex()}},{key:"toCompactRawBytes",value:function(){return bs(this.toCompactHex())}},{key:"toCompactHex",value:function(){return ys(this.r)+ys(this.s)}}],[{key:"fromCompact",value:function(t){var n=t instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof t&&!n)throw new TypeError("".concat(r,": Expected string or Uint8Array"));var i=n?ds(t):t;if(128!==i.length)throw new Error("".concat(r,": Expected 64-byte hex"));return new e(vs(i.slice(0,64)),vs(i.slice(64,128)))}},{key:"fromDER",value:function(t){var n=t instanceof Uint8Array;if("string"!=typeof t&&!n)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");var r=function(e){if(e.length<2||48!=e[0])throw new Error("Invalid signature tag: ".concat(ds(e)));if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");var t=ss(e.subarray(2)),n=t.data,r=ss(t.left),i=r.data,o=r.left;if(o.length)throw new Error("Invalid signature: left bytes after parsing: ".concat(ds(o)));return{r:n,s:i}}(n?t:bs(t));return new e(r.r,r.s)}},{key:"fromHex",value:function(e){return this.fromDER(e)}}]),e}();function cs(){for(var e=arguments.length,t=new Array(e),n=0;n0)return BigInt(e);if("bigint"==typeof e&&xs(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Es(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qa.P,n=e%t;return n>=Ya?n:t+n}function Ts(e,t){for(var n=qa.P,r=e;t-- >Ya;)r*=r,r%=n;return r}function Ns(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qa.P;if(e===Ya||t<=Ya)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var n=Es(e,t),r=t,i=Ya,o=Fa;n!==Ya;){var a=r/n,s=r%n,u=i-o*a;r=n,n=s,i=o,o=u}var c=r;if(c!==Fa)throw new Error("invert: does not exist");return Es(i,t)}function Is(e){var t=8*e.length-256,n=ws(e);return t>0?n>>BigInt(t):n}function ks(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Is(e);if(t)return n;var r=qa.n;return n>=r?n-r:n}var Ls=function(){function e(t,n){if(R(this,e),this.hashLen=t,this.qByteLen=n,"number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof n||n<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(t).fill(1),this.k=new Uint8Array(t).fill(0),this.counter=0}var t,n;return U(e,[{key:"hmac",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}},{key:"reseed",value:(n=P(O().mark((function e(){var t,n=arguments;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:new Uint8Array,e.next=3,this.hmac(this.v,Uint8Array.from([0]),t);case 3:return this.k=e.sent,e.next=6,this.hmac(this.v);case 6:if(this.v=e.sent,0!==t.length){e.next=9;break}return e.abrupt("return");case 9:return e.next=11,this.hmac(this.v,Uint8Array.from([1]),t);case 11:return this.k=e.sent,e.next=14,this.hmac(this.v);case 14:this.v=e.sent;case 15:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reseedSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}},{key:"generate",value:(t=P(O().mark((function e(){var t,n,r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.incr(),t=0,n=[];case 3:if(!(t3&&void 0!==arguments[3])||arguments[3],i=qa.n,o=ks(e,!0);if(xs(o)){var a=Ns(o,i),s=os.BASE.multiply(o),u=Es(s.x,i);if(u!==Ya){var c=Es(a*Es(t+n*u,i),i);if(c!==Ya){var l=new us(u,c),d=(s.x===l.r?0:2)|Number(s.y&Fa);return r&&l.hasHighS()&&(l=l.normalizeS(),d^=1),{sig:l,recovery:d}}}}}function Cs(e){var t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=vs(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=ws(e)}if(!xs(t))throw new Error("Expected private key: 0 < key < n");return t}function Ds(e){return ws(e.length>32?e.slice(0,32):e)}function Os(e){var t=Ds(e),n=Es(t,qa.n);return zs(n1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return ms(Es(ws(e),qa.n-Fa)+Fa)},randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(Us.web)return Us.web.getRandomValues(new Uint8Array(e));if(Us.node){var t=Us.node.randomBytes;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return Qs.hashToPrivateKey(Qs.randomBytes(40))},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:os.BASE,n=t===os.BASE?t:new os(t.x,t.y);return n._setWindowSize(e),n.multiply(Ha),n},sha256:function(){var e=P(O().mark((function e(){var t,n,r,i,o,a,s=arguments;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=s.length,n=new Array(t),r=0;r1?n-1:0),i=1;i1?i-1:0),a=1;a1?r-1:0),o=1;o32)throw new Error("Invalid public key input")}return t}return U(a,[{key:"equals",value:function(e){return this._bn.eq(e._bn)}},{key:"toBase58",value:function(){return _n.encode(this.toBytes())}},{key:"toJSON",value:function(){return this.toBase58()}},{key:"toBytes",value:function(){var e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}},{key:"toBuffer",value:function(){var e=this._bn.toArrayLike(Te);if(32===e.length)return e;var t=Te.alloc(32);return e.copy(t,32-e.length),t}},{key:t,get:function(){return"PublicKey(".concat(this.toString(),")")}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"unique",value:function(){var e=new a(ru);return ru+=1,new a(e.toBuffer())}},{key:"createWithSeed",value:(i=P(O().mark((function e(t,n,r){var i,o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Te.concat([t.toBuffer(),Te.from(n),r.toBuffer()]),o=Yn(i),e.abrupt("return",new a(o));case 3:case"end":return e.stop()}}),e)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"createProgramAddressSync",value:function(e,t){var n=Te.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");n=Te.concat([n,$s(e)])})),n=Te.concat([n,t.toBuffer(),Te.from("ProgramDerivedAddress")]);var r=Yn(n);if(Js(r))throw new Error("Invalid seeds, address must fall off the curve");return new a(r)}},{key:"createProgramAddress",value:(r=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.createProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"findProgramAddressSync",value:function(e,t){for(var n,r=255;0!=r;){try{var i=e.concat(Te.from([r]));n=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;r--;continue}return[n,r]}throw new Error("Unable to find a viable program address nonce")}},{key:"findProgramAddress",value:(n=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.findProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"isOnCurve",value:function(e){return Js(new a(e).toBytes())}}]),a}(0,Symbol.toStringTag);iu.default=new iu("11111111111111111111111111111111"),nu.set(iu,{kind:"struct",fields:[["_bn","u256"]]});var ou=function(){function e(t){if(R(this,e),this._publicKey=void 0,this._secretKey=void 0,t){var n=$s(t);if(64!==t.length)throw new Error("bad secret key size");this._publicKey=n.slice(32,64),this._secretKey=n.slice(0,32)}else this._secretKey=$s(Gs()),this._publicKey=$s(Zs(this._secretKey))}return U(e,[{key:"publicKey",get:function(){return new iu(this._publicKey)}},{key:"secretKey",get:function(){return Te.concat([this._secretKey,this._publicKey],64)}}]),e}(),au=new iu("BPFLoader1111111111111111111111111111111111"),su=function(e){Q(n,G(Error));var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: block height exceeded."))).signature=void 0,r.signature=e,r}return U(n)}();Object.defineProperty(su.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var uu=function(e){Q(n,G(Error));var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,"Transaction was not confirmed in ".concat(r.toFixed(2)," seconds. It is ")+"unknown if it succeeded or failed. Check signature "+"".concat(e," using the Solana Explorer or CLI tools."))).signature=void 0,i.signature=e,i}return U(n)}();Object.defineProperty(uu.prototype,"name",{value:"TransactionExpiredTimeoutError"});var cu=function(e){Q(n,G(Error));var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: the nonce is no longer valid."))).signature=void 0,r.signature=e,r}return U(n)}();Object.defineProperty(cu.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});var lu=function(){function e(t,n){R(this,e),this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=n}return U(e,[{key:"keySegments",value:function(){var e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}},{key:"get",value:function(e){var t,n=se(this.keySegments());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e256)throw new Error("Account index overflow encountered during compilation");var t=new Map;this.keySegments().flat().forEach((function(e,n){t.set(e.toBase58(),n)}));var n=function(e){var n=t.get(e.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return e.map((function(e){return{programIdIndex:n(e.programId),accountKeyIndexes:e.keys.map((function(e){return n(e.pubkey)})),data:e.data}}))}}]),e}(),du=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return mi(32,e)},hu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature";return mi(64,e)},pu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",t=fi([di("length"),di("lengthPadding"),mi(ui(di(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=function(e,t){return n(e,t).chars.toString()},i.encode=function(e,t,n){var i={chars:Te.from(e,"utf8")};return r(i,t,n)},i.alloc=function(e){return di().span+di().span+Te.from(e,"utf8").length},i};function fu(e,t){var n=function e(n){if(n.span>=0)return n.span;if("function"==typeof n.alloc)return n.alloc(t[n.property]);if("count"in n&&"elementLayout"in n){var r=t[n.property];if(Array.isArray(r))return r.length*e(n.elementLayout)}else if("fields"in n)return fu({layout:n},t[n.property]);return 0},r=0;return e.layout.fields.forEach((function(e){r+=n(e)})),r}function yu(e){for(var t=0,n=0;;){var r=e.shift();if(t|=(127&r)<<7*n,n+=1,0==(128&r))break}return t}function mu(e,t){for(var n=t;;){var r=127&n;if(0==(n>>=7)){e.push(r);break}r|=128,e.push(r)}}function gu(e,t){if(!e)throw new Error(t||"Assertion failed")}var vu,bu=function(){function e(t,n){R(this,e),this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=n}return U(e,[{key:"getMessageComponents",value:function(){var e=te(this.keyMetaMap.entries());gu(e.length<=256,"Max static account keys length exceeded");var t=e.filter((function(e){var t=ee(e,2)[1];return t.isSigner&&t.isWritable})),n=e.filter((function(e){var t=ee(e,2)[1];return t.isSigner&&!t.isWritable})),r=e.filter((function(e){var t=ee(e,2)[1];return!t.isSigner&&t.isWritable})),i=e.filter((function(e){var t=ee(e,2)[1];return!t.isSigner&&!t.isWritable})),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};return gu(t.length>0,"Expected at least one writable signer key"),gu(ee(t[0],1)[0]===this.payer.toBase58(),"Expected first writable signer key to be the fee payer"),[o,[].concat(te(t.map((function(e){var t=ee(e,1)[0];return new iu(t)}))),te(n.map((function(e){var t=ee(e,1)[0];return new iu(t)}))),te(r.map((function(e){var t=ee(e,1)[0];return new iu(t)}))),te(i.map((function(e){var t=ee(e,1)[0];return new iu(t)}))))]}},{key:"extractTableLookup",value:function(e){var t=ee(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&e.isWritable})),2),n=t[0],r=t[1],i=ee(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&!e.isWritable})),2),o=i[0],a=i[1];if(0!==n.length||0!==o.length)return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:o},{writable:r,readonly:a}]}},{key:"drainKeysFoundInLookupTable",value:function(e,t){var n,r=this,i=new Array,o=new Array,a=se(this.keyMetaMap.entries());try{var s=function(){var a=ee(n.value,2),s=a[0],u=a[1];if(t(u)){var c=new iu(s),l=e.findIndex((function(e){return e.equals(c)}));l>=0&&(gu(l<256,"Max lookup table index exceeded"),i.push(l),o.push(c),r.keyMetaMap.delete(s))}};for(a.s();!(n=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return[i,o]}}],[{key:"compile",value:function(t,n){var r=new Map,i=function(e){var t=e.toBase58(),n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},o=i(n);o.isSigner=!0,o.isWritable=!0;var a,s=se(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;i(u.programId).isInvoked=!0;var c,l=se(u.keys);try{for(l.s();!(c=l.n()).done;){var d=c.value,h=i(d.pubkey);h.isSigner||(h.isSigner=d.isSigner),h.isWritable||(h.isWritable=d.isWritable)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){s.e(e)}finally{s.f()}return new e(n,r)}}]),e}(),wu=function(){function e(t){var n=this;R(this,e),this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((function(e){return new iu(e)})),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((function(e){return n.indexToProgramIds.set(e.programIdIndex,n.accountKeys[e.programIdIndex])}))}return U(e,[{key:"version",get:function(){return"legacy"}},{key:"staticAccountKeys",get:function(){return this.accountKeys}},{key:"compiledInstructions",get:function(){return this.instructions.map((function(e){return{programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:_n.decode(e.data)}}))}},{key:"addressTableLookups",get:function(){return[]}},{key:"getAccountKeys",value:function(){return new lu(this.staticAccountKeys)}},{key:"isAccountSigner",value:function(e){return e=this.header.numRequiredSignatures?e-t0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new lu(this.staticAccountKeys,t)}},{key:"isAccountSigner",value:function(e){return e=n?e-n=this.header.numRequiredSignatures?e-t0?this.signatures[0].signature:null}},{key:"toJSON",value:function(){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((function(e){return e.toJSON()})),signers:this.signatures.map((function(e){return e.publicKey.toJSON()}))}}},{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(var r=0;r-1?(a[n].isWritable=a[n].isWritable||e.isWritable,a[n].isSigner=a[n].isSigner||e.isSigner):a.push(e)})),a.sort((function(e,t){return e.isSigner!==t.isSigner?e.isSigner?-1:1:e.isWritable!==t.isWritable?e.isWritable?-1:1:e.pubkey.toBase58().localeCompare(t.pubkey.toBase58())}));var s=a.findIndex((function(e){return e.pubkey.equals(n)}));if(s>-1){var u=ee(a.splice(s,1),1)[0];u.isSigner=!0,u.isWritable=!0,a.unshift(u)}else a.unshift({pubkey:n,isSigner:!0,isWritable:!0});var c,l=se(this.signatures);try{var d=function(){var e=c.value,t=a.findIndex((function(t){return t.pubkey.equals(e.publicKey)}));if(!(t>-1))throw new Error("unknown signer: ".concat(e.publicKey.toString()));a[t].isSigner||(a[t].isSigner=!0,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."))};for(l.s();!(c=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}var h=0,p=0,f=0,y=[],m=[];a.forEach((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;n?(y.push(t.toString()),h+=1,r||(p+=1)):(m.push(t.toString()),r||(f+=1))}));var g=y.concat(m),v=t.map((function(e){var t=e.data,n=e.programId;return{programIdIndex:g.indexOf(n.toString()),accounts:e.keys.map((function(e){return g.indexOf(e.pubkey.toString())})),data:_n.encode(t)}}));return v.forEach((function(e){gu(e.programIdIndex>=0),e.accounts.forEach((function(e){return gu(e>=0)}))})),new wu({header:{numRequiredSignatures:h,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:f},accountKeys:g,recentBlockhash:e,instructions:v})}},{key:"_compile",value:function(){var e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length&&this.signatures.every((function(e,n){return t[n].equals(e.publicKey)})))return e;return this.signatures=t.map((function(e){return{signature:null,publicKey:e}})),e}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"getEstimatedFee",value:(t=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getFeeForMessage(this.compileMessage());case 2:return e.abrupt("return",e.sent.value);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setSigners",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),o=1;o ").concat(1232)),i}},{key:"keys",get:function(){return gu(1===this.instructions.length),this.instructions[0].keys.map((function(e){return e.pubkey}))}},{key:"programId",get:function(){return gu(1===this.instructions.length),this.instructions[0].programId}},{key:"data",get:function(){return gu(1===this.instructions.length),this.instructions[0].data}}],[{key:"from",value:function(t){for(var n=te(t),r=yu(n),i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:[],r=new e;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),n.forEach((function(e,n){var i={signature:e==_n.encode(Eu)?null:_n.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)})),t.instructions.forEach((function(e){var n=e.accounts.map((function(e){var n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some((function(e){return e.publicKey.toString()===n.toString()}))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));r.instructions.push(new Tu({keys:n,programId:t.accountKeys[e.programIdIndex],data:_n.decode(e.data)}))})),r._message=t,r._json=r.toJSON(),r}}]),e}(),Iu=function(){function e(t){R(this,e),this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}return U(e,[{key:"compileToLegacyMessage",value:function(){return wu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}},{key:"compileToV0Message",value:function(e){return Mu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}],[{key:"decompile",value:function(t,n){var r=t.header,i=t.compiledInstructions,o=t.recentBlockhash,a=r.numRequiredSignatures,s=r.numReadonlySignedAccounts,u=r.numReadonlyUnsignedAccounts,c=a-s;gu(c>0,"Message header is invalid");var l=t.staticAccountKeys.length-a-u;gu(l>=0,"Message header is invalid");var d=t.getAccountKeys(n),h=d.get(0);if(void 0===h)throw new Error("Failed to decompile message because no account keys were found");var p,f=[],y=se(i);try{for(y.s();!(p=y.n()).done;){var m,g=p.value,v=[],b=se(g.accountKeyIndexes);try{for(b.s();!(m=b.n()).done;){var w=m.value,M=d.get(w);if(void 0===M)throw new Error("Failed to find key for account key index ".concat(w));var A=void 0;A=w=0,"Cannot sign with non signer key ".concat(e.publicKey.toBase58())),n.signatures[o]=Xs(r,e.secretKey)};for(o.s();!(t=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}}},{key:"addSignature",value:function(e,t){gu(64===t.byteLength,"Signature must be 64 bytes long");var n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((function(t){return t.equals(e)}));gu(n>=0,"Can not add signature; `".concat(e.toBase58(),"` is not required to sign this transaction")),this.signatures[n]=t}}],[{key:"deserialize",value:function(t){for(var n=te(t),r=[],i=yu(n),o=0;o=0?e.layout.span:fu(e,t),r=Te.alloc(n),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,r),r}function Wu(e,t){var n;try{n=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(n.instruction!==e.index)throw new Error("invalid instruction; instruction index mismatch ".concat(n.instruction," != ").concat(e.index));return n}var Qu,Yu=hi("lamportsPerSignature"),Fu=fi([di("version"),di("state"),du("authorizedPubkey"),du("nonce"),fi([Yu],"feeCalculator")]),Vu=Fu.span,Hu=function(){function e(t){R(this,e),this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}return U(e,null,[{key:"fromAccountData",value:function(t){var n=Fu.decode($s(t),0);return new e({authorizedPubkey:new iu(n.authorizedPubkey),nonce:new iu(n.nonce).toString(),feeCalculator:n.feeCalculator})}}]),e}(),Gu=(Qu=8,function(e){var t=mi(Qu,e),n=function(e){return{decode:e.decode.bind(e),encode:e.encode.bind(e)}}(t),r=n.encode,i=n.decode,o=t;return o.decode=function(e,t){var n=i(e,t);return vi(Te.from(n))},o.encode=function(e,t,n){var i=bi(e,Qu);return r(i,t,n)},o}),qu=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=di("instruction").decode(e.data),r=0,i=Object.entries(Zu);r0?s:1,space:a.length,programId:o}));case 17:if(null===c){t.next=20;break}return t.next=20,Pu(n,c,[r,i],{commitment:"confirmed"});case 20:l=fi([di("instruction"),di("offset"),di("bytesLength"),di("bytesLengthPadding"),yi(ci("byte"),ui(di(),-8),"bytes")]),d=e.chunkSize,h=0,p=a,f=[];case 25:if(!(p.length>0)){t.next=39;break}if(y=p.slice(0,d),m=Te.alloc(d+16),l.encode({instruction:0,offset:h,bytes:y,bytesLength:0,bytesLengthPadding:0},m),g=(new Nu).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:m}),f.push(Pu(n,g,[r,i],{commitment:"confirmed"})),!n._rpcEndpoint.includes("solana.com")){t.next=35;break}return t.next=35,Bu(250);case 35:h+=d,p=p.slice(d),t.next=25;break;case 39:return t.next=41,Promise.all(f);case 41:return v=fi([di("instruction")]),b=Te.alloc(v.span),v.encode({instruction:1},b),w=(new Nu).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0},{pubkey:Cu,isSigner:!1,isWritable:!1}],programId:o,data:b}),t.next=47,Pu(n,w,[r,i],{commitment:"confirmed"});case 47:return t.abrupt("return",!0);case 48:case"end":return t.stop()}}),t)}))),function(e,n,r,i,o){return t.apply(this,arguments)})}]),e}();Xu.chunkSize=932;var Ku=new iu("BPFLoader2111111111111111111111111111111111"),$u=function(){function e(){R(this,e)}return U(e,null,[{key:"getMinNumSignatures",value:function(e){return Xu.getMinNumSignatures(e)}},{key:"load",value:function(e,t,n,r,i){return Xu.load(e,t,n,i,r)}}]),e}(),ec=Object.prototype.toString,tc=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function nc(e,t){var n,r,i,o,a,s,u;if(!0===e)return"true";if(!1===e)return"false";switch(z(e)){case"object":if(null===e)return null;if(e.toJSON&&"function"==typeof e.toJSON)return nc(e.toJSON(),t);if("[object Array]"===(u=ec.call(e))){for(i="[",r=e.length-1,n=0;n-1&&(i+=nc(e[n],!0)),i+"]"}if("[object Object]"===u){for(r=(o=tc(e).sort()).length,i="",n=0;n1;)e/=2,t++;return t}var oc=function(){function e(t,n,r,i,o){R(this,e),this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=n,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=o}return U(e,[{key:"getEpoch",value:function(e){return this.getEpochAndSlotIndex(e)[0]}},{key:"getEpochAndSlotIndex",value:function(e){if(e>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,1+(e|=e>>32))}(e+32+1))-ic(32)-1;return[t,e-(this.getSlotsInEpoch(t)-32)]}var n=e-this.firstNormalSlot,r=Math.floor(n/this.slotsPerEpoch);return[this.firstNormalEpoch+r,n%this.slotsPerEpoch]}},{key:"getFirstSlotInEpoch",value:function(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}},{key:"getLastSlotInEpoch",value:function(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}},{key:"getSlotsInEpoch",value:function(e){return e0&&(i.until=a.signatures[a.signatures.length-1].toString()),e.next=22;break;case 15:if(e.prev=15,e.t0=e.catch(8),!(e.t0 instanceof Error&&e.t0.message.includes("skipped"))){e.next=21;break}return e.abrupt("continue",4);case 21:throw e.t0;case 22:e.next=4;break;case 24:return e.next=26,this.getSlot("finalized");case 26:s=e.sent;case 27:if("before"in i){e.next=47;break}if(!(++r>s)){e.next=31;break}return e.abrupt("break",47);case 31:return e.prev=31,e.next=34,this.getConfirmedBlockSignatures(r);case 34:(u=e.sent).signatures.length>0&&(i.before=u.signatures[u.signatures.length-1].toString()),e.next=45;break;case 38:if(e.prev=38,e.t1=e.catch(31),!(e.t1 instanceof Error&&e.t1.message.includes("skipped"))){e.next=44;break}return e.abrupt("continue",27);case 44:throw e.t1;case 45:e.next=27;break;case 47:return e.next=49,this.getConfirmedSignaturesForAddress2(t,i);case 49:return c=e.sent,e.abrupt("return",c.map((function(e){return e.signature})));case 51:case"end":return e.stop()}}),e,this,[[8,15],[31,38]])}))),function(e,t,n){return E.apply(this,arguments)})},{key:"getConfirmedSignaturesForAddress2",value:(A=P(O().mark((function e(t,n,r){var i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getConfirmedSignaturesForAddress2",i);case 3:if(o=e.sent,!("error"in(a=Di(o,nl)))){e.next=7;break}throw new sc(a.error,"failed to get confirmed signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return A.apply(this,arguments)})},{key:"getSignaturesForAddress",value:(M=P(O().mark((function e(t,n,r){var i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getSignaturesForAddress",i);case 3:if(o=e.sent,!("error"in(a=Di(o,rl)))){e.next=7;break}throw new sc(a.error,"failed to get signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return M.apply(this,arguments)})},{key:"getAddressLookupTable",value:(w=P(O().mark((function e(t,n){var r,i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=new lc({key:t,state:lc.deserialize(o.data)})),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getNonceAndContext",value:(b=P(O().mark((function e(t,n){var r,i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=Hu.fromAccountData(o.data)),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getNonce",value:(v=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNonceAndContext(t,n).then((function(e){return e.value})).catch((function(e){throw new Error("failed to get nonce for account "+t.toBase58()+": "+e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"requestAirdrop",value:(g=P(O().mark((function e(t,n){var r,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("requestAirdrop",[t.toBase58(),n]);case 2:if(r=e.sent,!("error"in(i=Di(r,ql)))){e.next=6;break}throw new sc(i.error,"airdrop to ".concat(t.toBase58()," failed"));case 6:return e.abrupt("return",i.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"_blockhashWithExpiryBlockHeight",value:(m=P(O().mark((function e(t){var n,r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=10;break}case 1:if(!this._pollingBlockhash){e.next=6;break}return e.next=4,Bu(100);case 4:e.next=1;break;case 6:if(n=Date.now()-this._blockhashInfo.lastFetch,r=n>=3e4,null===this._blockhashInfo.latestBlockhash||r){e.next=10;break}return e.abrupt("return",this._blockhashInfo.latestBlockhash);case 10:return e.next=12,this._pollNewBlockhash();case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"_pollNewBlockhash",value:(y=P(O().mark((function e(){var t,n,r,i,o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._pollingBlockhash=!0,e.prev=1,t=Date.now(),n=this._blockhashInfo.latestBlockhash,r=n?n.blockhash:null,i=0;case 6:if(!(i<50)){e.next=18;break}return e.next=9,this.getLatestBlockhash("finalized");case 9:if(o=e.sent,r===o.blockhash){e.next=13;break}return this._blockhashInfo={latestBlockhash:o,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e.abrupt("return",o);case 13:return e.next=15,Bu(200);case 15:i++,e.next=6;break;case 18:throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-t,"ms"));case 19:return e.prev=19,this._pollingBlockhash=!1,e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[1,,19,22]])}))),function(){return y.apply(this,arguments)})},{key:"getStakeMinimumDelegation",value:(f=P(O().mark((function e(t){var n,r,i,o,a,s;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=mc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,"base64",i),e.next=4,this._rpcRequest("getStakeMinimumDelegation",o);case 4:if(a=e.sent,!("error"in(s=Di(a,wc(Qi()))))){e.next=8;break}throw new sc(s.error,"failed to get stake minimum delegation");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"simulateTransaction",value:(p=P(O().mark((function e(t,n,r){var i,o,a,s,u,c,l,d,h,p,f,y,m,g,v,b,w,M,A,E,T,N,I,k,L,x;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("message"in t)){e.next=17;break}if(i=t.serialize(),o=Te.from(i).toString("base64"),!Array.isArray(n)&&void 0===r){e.next=6;break}throw new Error("Invalid arguments");case 6:return(a=n||{}).encoding="base64","commitment"in a||(a.commitment=this.commitment),s=[o,a],e.next=12,this._rpcRequest("simulateTransaction",s);case 12:if(u=e.sent,!("error"in(c=Di(u,Oc)))){e.next=16;break}throw new Error("failed to simulate transaction: "+c.error.message);case 16:return e.abrupt("return",c.result);case 17:if(t instanceof Nu?(d=t,(l=new Nu).feePayer=d.feePayer,l.instructions=t.instructions,l.nonceInfo=d.nonceInfo,l.signatures=d.signatures):(l=Nu.populate(t))._message=l._json=void 0,void 0===n||Array.isArray(n)){e.next=20;break}throw new Error("Invalid arguments");case 20:if(h=n,!l.nonceInfo||!h){e.next=25;break}(p=l).sign.apply(p,te(h)),e.next=45;break;case 25:f=this._disableBlockhashCaching;case 26:return e.next=28,this._blockhashWithExpiryBlockHeight(f);case 28:if(m=e.sent,l.lastValidBlockHeight=m.lastValidBlockHeight,l.recentBlockhash=m.blockhash,h){e.next=33;break}return e.abrupt("break",45);case 33:if((y=l).sign.apply(y,te(h)),l.signature){e.next=36;break}throw new Error("!signature");case 36:if(g=l.signature.toString("base64"),this._blockhashInfo.simulatedSignatures.includes(g)||this._blockhashInfo.transactionSignatures.includes(g)){e.next=42;break}return this._blockhashInfo.simulatedSignatures.push(g),e.abrupt("break",45);case 42:f=!0;case 43:e.next=26;break;case 45:return v=l._compile(),b=v.serialize(),w=l._serialize(b),M=w.toString("base64"),A={encoding:"base64",commitment:this.commitment},r&&(E=(Array.isArray(r)?r:v.nonProgramIds()).map((function(e){return e.toBase58()})),A.accounts={encoding:"base64",addresses:E}),h&&(A.sigVerify=!0),T=[M,A],e.next=55,this._rpcRequest("simulateTransaction",T);case 55:if(N=e.sent,!("error"in(I=Di(N,Oc)))){e.next=60;break}throw"data"in I.error&&(k=I.error.data.logs)&&Array.isArray(k)&&(x=(L="\n ")+k.join(L),console.error(I.error.message,x)),new ac("failed to simulate transaction: "+I.error.message,k);case 60:return e.abrupt("return",I.result);case 61:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"sendTransaction",value:(h=P(O().mark((function e(t,n,r){var i,o,a,s,u,c;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("version"in t)){e.next=7;break}if(!n||!Array.isArray(n)){e.next=3;break}throw new Error("Invalid arguments");case 3:return i=t.serialize(),e.next=6,this.sendRawTransaction(i,n);case 6:return e.abrupt("return",e.sent);case 7:if(void 0!==n&&Array.isArray(n)){e.next=9;break}throw new Error("Invalid arguments");case 9:if(o=n,!t.nonceInfo){e.next=14;break}t.sign.apply(t,te(o)),e.next=32;break;case 14:a=this._disableBlockhashCaching;case 15:return e.next=17,this._blockhashWithExpiryBlockHeight(a);case 17:if(s=e.sent,t.lastValidBlockHeight=s.lastValidBlockHeight,t.recentBlockhash=s.blockhash,t.sign.apply(t,te(o)),t.signature){e.next=23;break}throw new Error("!signature");case 23:if(u=t.signature.toString("base64"),this._blockhashInfo.transactionSignatures.includes(u)){e.next=29;break}return this._blockhashInfo.transactionSignatures.push(u),e.abrupt("break",32);case 29:a=!0;case 30:e.next=15;break;case 32:return c=t.serialize(),e.next=35,this.sendRawTransaction(c,r);case 35:return e.abrupt("return",e.sent);case 36:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"sendRawTransaction",value:(d=P(O().mark((function e(t,n){var r,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=$s(t).toString("base64"),e.next=3,this.sendEncodedTransaction(r,n);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"sendEncodedTransaction",value:(l=P(O().mark((function e(t,n){var r,i,o,a,s,u,c;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={encoding:"base64"},i=n&&n.skipPreflight,o=n&&n.preflightCommitment||this.commitment,n&&null!=n.maxRetries&&(r.maxRetries=n.maxRetries),n&&null!=n.minContextSlot&&(r.minContextSlot=n.minContextSlot),i&&(r.skipPreflight=i),o&&(r.preflightCommitment=o),a=[t,r],e.next=10,this._rpcRequest("sendTransaction",a);case 10:if(s=e.sent,!("error"in(u=Di(s,Zl)))){e.next=15;break}throw"data"in u.error&&(c=u.error.data.logs),new ac("failed to send transaction: "+u.error.message,c);case 15:return e.abrupt("return",u.result);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"_wsOnOpen",value:function(){var e=this;this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((function(){P(O().mark((function t(){return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._rpcWebSocket.notify("ping");case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})))()}),5e3),this._updateSubscriptions()}},{key:"_wsOnError",value:function(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}},{key:"_wsOnClose",value:function(e){var t=this;this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((function(e){var n=ee(e,2),r=n[0],i=n[1];t._setSubscription(r,D(D({},i),{},{state:"pending"}))}))):this._updateSubscriptions()}},{key:"_setSubscription",value:function(e,t){var n,r=null===(n=this._subscriptionsByHash[e])||void 0===n?void 0:n.state;if(this._subscriptionsByHash[e]=t,r!==t.state){var i=this._subscriptionStateChangeCallbacksByHash[e];i&&i.forEach((function(e){try{e(t.state)}catch(e){}}))}}},{key:"_onSubscriptionStateChange",value:function(e,t){var n,r=this,i=this._subscriptionHashByClientSubscriptionId[e];if(null==i)return function(){};var o=(n=this._subscriptionStateChangeCallbacksByHash)[i]||(n[i]=new Set);return o.add(t),function(){o.delete(t),0===o.size&&delete r._subscriptionStateChangeCallbacksByHash[i]}}},{key:"_updateSubscriptions",value:(c=P(O().mark((function e(){var t,n,r=this;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==Object.keys(this._subscriptionsByHash).length){e.next=3;break}return this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((function(){r._rpcWebSocketIdleTimeout=null;try{r._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log("Error when closing socket connection: ".concat(e.message))}}),500)),e.abrupt("return");case 3:if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),this._rpcWebSocketConnected){e.next=7;break}return this._rpcWebSocket.connect(),e.abrupt("return");case 7:return t=this._rpcWebSocketGeneration,n=function(){return t===r._rpcWebSocketGeneration},e.next=11,Promise.all(Object.keys(this._subscriptionsByHash).map(function(){var e=P(O().mark((function e(t){var i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(i=r._subscriptionsByHash[t])){e.next=3;break}return e.abrupt("return");case 3:e.t0=i.state,e.next="pending"===e.t0||"unsubscribed"===e.t0?6:"subscribed"===e.t0?15:19;break;case 6:if(0!==i.callbacks.size){e.next=12;break}return delete r._subscriptionsByHash[t],"unsubscribed"===i.state&&delete r._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],e.next=11,r._updateSubscriptions();case 11:return e.abrupt("return");case 12:return e.next=14,P(O().mark((function e(){var o,a,s;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.args,a=i.method,e.prev=1,r._setSubscription(t,D(D({},i),{},{state:"subscribing"})),e.next=5,r._rpcWebSocket.call(a,o);case 5:return s=e.sent,r._setSubscription(t,D(D({},i),{},{serverSubscriptionId:s,state:"subscribed"})),r._subscriptionCallbacksByServerSubscriptionId[s]=i.callbacks,e.next=10,r._updateSubscriptions();case 10:e.next=20;break;case 12:if(e.prev=12,e.t0=e.catch(1),e.t0 instanceof Error&&console.error("".concat(a," error for argument"),o,e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,D(D({},i),{},{state:"pending"})),e.next=20,r._updateSubscriptions();case 20:case"end":return e.stop()}}),e,null,[[1,12]])})))();case 14:return e.abrupt("break",19);case 15:if(0!==i.callbacks.size){e.next=18;break}return e.next=18,P(O().mark((function e(){var o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=i.serverSubscriptionId,a=i.unsubscribeMethod,!r._subscriptionsAutoDisposedByRpc.has(o)){e.next=5;break}r._subscriptionsAutoDisposedByRpc.delete(o),e.next=21;break;case 5:return r._setSubscription(t,D(D({},i),{},{state:"unsubscribing"})),r._setSubscription(t,D(D({},i),{},{state:"unsubscribing"})),e.prev=7,e.next=10,r._rpcWebSocket.call(a,[o]);case 10:e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(7),e.t0 instanceof Error&&console.error("".concat(a," error:"),e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,D(D({},i),{},{state:"subscribed"})),e.next=20,r._updateSubscriptions();case 20:return e.abrupt("return");case 21:return r._setSubscription(t,D(D({},i),{},{state:"unsubscribed"})),e.next=24,r._updateSubscriptions();case 24:case"end":return e.stop()}}),e,null,[[7,12]])})))();case 18:return e.abrupt("break",19);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 11:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_handleServerNotification",value:function(e,t){var n=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==n&&n.forEach((function(e){try{e.apply(void 0,te(t))}catch(e){console.error(e)}}))}},{key:"_wsOnAccountNotification",value:function(e){var t=Di(e,il),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_makeSubscription",value:function(e,t){var n=this,r=this._nextClientSubscriptionId++,i=rc([e.method,t]),o=this._subscriptionsByHash[i];return void 0===o?this._subscriptionsByHash[i]=D(D({},e),{},{args:t,callbacks:new Set([e.callback]),state:"pending"}):o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=P(O().mark((function t(){var o;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return delete n._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete n._subscriptionHashByClientSubscriptionId[r],gu(void 0!==(o=n._subscriptionsByHash[i]),"Could not find a `Subscription` when tearing down client subscription #".concat(r)),o.callbacks.delete(e.callback),t.next=7,n._updateSubscriptions();case 7:case"end":return t.stop()}}),t)}))),this._updateSubscriptions(),r}},{key:"onAccountChange",value:function(e,t,n){var r=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},r)}},{key:"removeAccountChangeListener",value:(u=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_wsOnProgramAccountNotification",value:function(e){var t=Di(e,al),n=t.result,r=t.subscription;this._handleServerNotification(r,[{accountId:n.value.pubkey,accountInfo:n.value.account},n.context])}},{key:"onProgramAccountChange",value:function(e,t,n,r){var i=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",r?{filters:r}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}},{key:"removeProgramAccountChangeListener",value:(s=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"program account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"onLogs",value:function(e,t,n){var r=this._buildArgs(["object"===z(e)?{mentions:[e.toString()]}:e],n||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},r)}},{key:"removeOnLogsListener",value:(a=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"logs");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_wsOnLogsNotification",value:function(e){var t=Di(e,Xl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_wsOnSlotNotification",value:function(e){var t=Di(e,ul),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotChange",value:function(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}},{key:"removeSlotChangeListener",value:(o=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_wsOnSlotUpdatesNotification",value:function(e){var t=Di(e,ll),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotUpdate",value:function(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}},{key:"removeSlotUpdateListener",value:(i=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot update");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_unsubscribeClientSubscription",value:(r=P(O().mark((function e(t,n){var r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t])){e.next=6;break}return e.next=4,r();case 4:e.next=7;break;case 6:console.warn("Ignored unsubscribe request because an active subscription with id "+"`".concat(t,"` for '").concat(n,"' events ")+"could not be found.");case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"_buildArgs",value:function(e,t,n,r){var i=t||this._commitment;if(i||n||r){var o={};n&&(o.encoding=n),i&&(o.commitment=i),r&&(o=Object.assign(o,r)),e.push(o)}return e}},{key:"_buildArgsAtLeastConfirmed",value:function(e,t,n,r){var i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,n,r)}},{key:"_wsOnSignatureNotification",value:function(e){var t=Di(e,dl),n=t.result,r=t.subscription;"receivedSignature"!==n.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===n.value?[{type:"received"},n.context]:[{type:"status",result:n.value},n.context])}},{key:"onSignature",value:function(e,t,n){var r=this,i=this._buildArgs([e],n||this._commitment||"finalized"),o=this._makeSubscription({callback:function(e,n){if("status"===e.type){t(e.result,n);try{r.removeSignatureListener(o)}catch(e){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return o}},{key:"onSignatureWithOptions",value:function(e,t,n){var r=this,i=D(D({},n),{},{commitment:n&&n.commitment||this._commitment||"finalized"}),o=i.commitment,a=q(i,Hs),s=this._buildArgs([e],o,void 0,a),u=this._makeSubscription({callback:function(e,n){t(e,n);try{r.removeSignatureListener(u)}catch(e){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return u}},{key:"removeSignatureListener",value:(n=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"signature result");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_wsOnRootNotification",value:function(e){var t=Di(e,hl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onRootChange",value:function(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}},{key:"removeRootChangeListener",value:(t=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"root change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),ed=function(){function e(t){R(this,e),this._keypair=void 0,this._keypair=null!=t?t:qs()}return U(e,[{key:"publicKey",get:function(){return new iu(this._keypair.publicKey)}},{key:"secretKey",get:function(){return new Uint8Array(this._keypair.secretKey)}}],[{key:"generate",value:function(){return new e(qs())}},{key:"fromSecretKey",value:function(t,n){if(64!==t.byteLength)throw new Error("bad secret key size");var r=t.slice(32,64);if(!n||!n.skipValidation)for(var i=t.slice(0,32),o=Zs(i),a=0;a<32;a++)if(r[a]!==o[a])throw new Error("provided secretKey is invalid");return new e({publicKey:r,secretKey:t})}},{key:"fromSeed",value:function(t){var n=Zs(t),r=new Uint8Array(64);return r.set(t),r.set(n,32),new e({publicKey:n,secretKey:r})}}]),e}(),td=Object.freeze({CreateLookupTable:{index:0,layout:fi([di("instruction"),Gu("recentSlot"),ci("bumpSeed")])},FreezeLookupTable:{index:1,layout:fi([di("instruction")])},ExtendLookupTable:{index:2,layout:fi([di("instruction"),Gu(),yi(du(),ui(di(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:fi([di("instruction")])},CloseLookupTable:{index:4,layout:fi([di("instruction")])}}),nd=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=di("instruction").decode(e.data),r=0,i=Object.entries(td);r2?e.keys[2].pubkey:void 0,addresses:t.map((function(e){return new iu(e)}))}}},{key:"decodeCloseLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}},{key:"decodeFreezeLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"decodeDeactivateLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(rd.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}},{key:"checkKeysLength",value:function(e,t){if(e.length1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{},i=_s(e,t,r.extraEntropy),o=i.seed,a=i.m,s=i.d,u=new Ls(32,32);for(u.reseedSync(o);!(n=js(u.generateSync(),a,s,r.canonical));)u.reseedSync();return Ps(n,r)}(e,t,{der:!1,recovered:!0})};Qs.isValidPrivateKey;var ld=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return os.fromPrivateKey(e).toRawBytes(t)},dd=fi([ci("numSignatures"),li("signatureOffset"),ci("signatureInstructionIndex"),li("ethAddressOffset"),ci("ethAddressInstructionIndex"),li("messageDataOffset"),li("messageDataSize"),ci("messageInstructionIndex"),mi(20,"ethAddress"),mi(64,"signature"),ci("recoveryId")]),hd=function(){function e(){R(this,e)}return U(e,null,[{key:"publicKeyToEthAddress",value:function(e){gu(64===e.length,"Public key must be ".concat(64," bytes but received ").concat(e.length," bytes"));try{return Te.from(Ba($s(e))).slice(-20)}catch(e){throw new Error("Error constructing Ethereum address: ".concat(e))}}},{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,i=t.signature,o=t.recoveryId,a=t.instructionIndex;return e.createInstructionWithEthAddress({ethAddress:e.publicKeyToEthAddress(n),message:r,signature:i,recoveryId:o,instructionIndex:a})}},{key:"createInstructionWithEthAddress",value:function(t){var n,r=t.ethAddress,i=t.message,o=t.signature,a=t.recoveryId,s=t.instructionIndex,u=void 0===s?0:s;gu(20===(n="string"==typeof r?r.startsWith("0x")?Te.from(r.substr(2),"hex"):Te.from(r,"hex"):r).length,"Address must be ".concat(20," bytes but received ").concat(n.length," bytes"));var c=12+n.length,l=c+o.length+1,d=Te.alloc(dd.span+i.length);return dd.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:u,ethAddressOffset:12,ethAddressInstructionIndex:u,messageDataOffset:l,messageDataSize:i.length,messageInstructionIndex:u,signature:$s(o),ethAddress:$s(n),recoveryId:a},d),d.fill($s(i),dd.span),new Tu({keys:[],programId:e.programId,data:d})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;gu(32===t.length,"Private key must be ".concat(32," bytes but received ").concat(t.length," bytes"));try{var i=$s(t),o=ld(i,!1).slice(1),a=Te.from(Ba($s(n))),s=ee(cd(a,i),2),u=s[0],c=s[1];return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:u,recoveryId:c,instructionIndex:r})}catch(e){throw new Error("Error creating instruction; ".concat(e))}}}]),e}();hd.programId=new iu("KeccakSecp256k11111111111111111111111111111");var pd=new iu("StakeConfig11111111111111111111111111111111"),fd=U((function e(t,n){R(this,e),this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=n})),yd=U((function e(t,n,r){R(this,e),this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=n,this.custodian=r}));yd.default=new yd(0,0,iu.default);var md=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=di("instruction").decode(e.data),r=0,i=Object.entries(gd);r3&&(i.custodianPubkey=e.keys[3].pubkey),i}},{key:"decodeAuthorizeWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Wu(gd.AuthorizeWithSeed,e.data),n=t.newAuthorized,r=t.stakeAuthorizationType,i=t.authoritySeed,o=t.authorityOwner,a={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:i,authorityOwner:new iu(o),newAuthorizedPubkey:new iu(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(a.custodianPubkey=e.keys[3].pubkey),a}},{key:"decodeSplit",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Wu(gd.Split,e.data).lamports;return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}},{key:"decodeMerge",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Wu(gd.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}},{key:"decodeWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);var t=Wu(gd.Withdraw,e.data).lamports,n={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(n.custodianPubkey=e.keys[5].pubkey),n}},{key:"decodeDeactivate",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Wu(gd.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(bd.programId))throw new Error("invalid instruction; programId is not StakeProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length0&&void 0!==arguments[0]?arguments[0]:"authorized";return fi([du("staker"),du("withdrawer")],e)}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return fi([pi("unixTimestamp"),pi("epoch"),du("custodian")],e)}()])},Authorize:{index:1,layout:fi([di("instruction"),du("newAuthorized"),di("stakeAuthorizationType")])},Delegate:{index:2,layout:fi([di("instruction")])},Split:{index:3,layout:fi([di("instruction"),pi("lamports")])},Withdraw:{index:4,layout:fi([di("instruction"),pi("lamports")])},Deactivate:{index:5,layout:fi([di("instruction")])},Merge:{index:7,layout:fi([di("instruction")])},AuthorizeWithSeed:{index:8,layout:fi([di("instruction"),du("newAuthorized"),di("stakeAuthorizationType"),pu("authoritySeed"),du("authorityOwner")])}}),vd=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),bd=function(){function e(){R(this,e)}return U(e,null,[{key:"initialize",value:function(e){var t=e.stakePubkey,n=e.authorized,r=e.lockup||yd.default,i=Uu(gd.Initialize,{authorized:{staker:$s(n.staker.toBuffer()),withdrawer:$s(n.withdrawer.toBuffer())},lockup:{unixTimestamp:r.unixTimestamp,epoch:r.epoch,custodian:$s(r.custodian.toBuffer())}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Cu,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new Tu(o)}},{key:"createAccountWithSeed",value:function(e){var t=new Nu;t.add(Ju.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"createAccount",value:function(e){var t=new Nu;t.add(Ju.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"delegate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.votePubkey,i=Uu(gd.Delegate);return(new Nu).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:_u,isSigner:!1,isWritable:!1},{pubkey:pd,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"authorize",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.stakeAuthorizationType,o=e.custodianPubkey,a=Uu(gd.Authorize,{newAuthorized:$s(r.toBuffer()),stakeAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Nu).add({keys:s,programId:this.programId,data:a})}},{key:"authorizeWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorityBase,r=e.authoritySeed,i=e.authorityOwner,o=e.newAuthorizedPubkey,a=e.stakeAuthorizationType,s=e.custodianPubkey,u=Uu(gd.AuthorizeWithSeed,{newAuthorized:$s(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:r,authorityOwner:$s(i.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:Lu,isSigner:!1,isWritable:!1}];return s&&c.push({pubkey:s,isSigner:!1,isWritable:!1}),(new Nu).add({keys:c,programId:this.programId,data:u})}},{key:"splitInstruction",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.lamports,o=Uu(gd.Split,{lamports:i});return new Tu({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}},{key:"split",value:function(e){var t=new Nu;return t.add(Ju.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}},{key:"splitWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.basePubkey,o=e.seed,a=e.lamports,s=new Nu;return s.add(Ju.allocate({accountPubkey:r,basePubkey:i,seed:o,space:this.space,programId:this.programId})),s.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:a}))}},{key:"merge",value:function(e){var t=e.stakePubkey,n=e.sourceStakePubKey,r=e.authorizedPubkey,i=Uu(gd.Merge);return(new Nu).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:_u,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"withdraw",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.toPubkey,i=e.lamports,o=e.custodianPubkey,a=Uu(gd.Withdraw,{lamports:i}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:_u,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Nu).add({keys:s,programId:this.programId,data:a})}},{key:"deactivate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=Uu(gd.Deactivate);return(new Nu).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}]),e}();bd.programId=new iu("Stake11111111111111111111111111111111111111"),bd.space=200;var wd=U((function e(t,n,r,i){R(this,e),this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=n,this.authorizedWithdrawer=r,this.commission=i})),Md=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=di("instruction").decode(e.data),r=0,i=Object.entries(Ad);r0&&void 0!==arguments[0]?arguments[0]:"voteInit";return fi([du("nodePubkey"),du("authorizedVoter"),du("authorizedWithdrawer"),ci("commission")],e)}()])},Authorize:{index:1,layout:fi([di("instruction"),du("newAuthorized"),di("voteAuthorizationType")])},Withdraw:{index:3,layout:fi([di("instruction"),pi("lamports")])},AuthorizeWithSeed:{index:10,layout:fi([di("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteAuthorizeWithSeedArgs";return fi([di("voteAuthorizationType"),du("currentAuthorityDerivedKeyOwnerPubkey"),pu("currentAuthorityDerivedKeySeed"),du("newAuthorized")],e)}()])}}),Ed=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Td=function(){function e(){R(this,e)}return U(e,null,[{key:"initializeAccount",value:function(e){var t=e.votePubkey,n=e.nodePubkey,r=e.voteInit,i=Uu(Ad.InitializeAccount,{voteInit:{nodePubkey:$s(r.nodePubkey.toBuffer()),authorizedVoter:$s(r.authorizedVoter.toBuffer()),authorizedWithdrawer:$s(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Cu,isSigner:!1,isWritable:!1},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Tu(o)}},{key:"createAccount",value:function(e){var t=new Nu;return t.add(Ju.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}},{key:"authorize",value:function(e){var t=e.votePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.voteAuthorizationType,o=Uu(Ad.Authorize,{newAuthorized:$s(r.toBuffer()),voteAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Nu).add({keys:a,programId:this.programId,data:o})}},{key:"authorizeWithSeed",value:function(e){var t=e.currentAuthorityDerivedKeyBasePubkey,n=e.currentAuthorityDerivedKeyOwnerPubkey,r=e.currentAuthorityDerivedKeySeed,i=e.newAuthorizedPubkey,o=e.voteAuthorizationType,a=e.votePubkey,s=Uu(Ad.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:$s(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:$s(i.toBuffer()),voteAuthorizationType:o.index}}),u=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:Lu,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new Nu).add({keys:u,programId:this.programId,data:s})}},{key:"withdraw",value:function(e){var t=e.votePubkey,n=e.authorizedWithdrawerPubkey,r=e.lamports,i=e.toPubkey,o=Uu(Ad.Withdraw,{lamports:r}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Nu).add({keys:a,programId:this.programId,data:o})}},{key:"safeWithdraw",value:function(t,n,r){if(t.lamports>n-r)throw new Error("Withdraw will leave vote account with insuffcient funds.");return e.withdraw(t)}}]),e}();Td.programId=new iu("Vote111111111111111111111111111111111111111"),Td.space=3731;var Nd=new iu("Va1idator1nfo111111111111111111111111111111"),Id=Gi({name:Vi(),website:Yi(Vi()),details:Yi(Vi()),keybaseUsername:Yi(Vi())}),kd=function(){function e(t,n){R(this,e),this.key=void 0,this.info=void 0,this.key=t,this.info=n}return U(e,null,[{key:"fromConfigData",value:function(t){var n=te(t);if(2!==yu(n))return null;for(var r=[],i=0;i<2;i++){var o=new iu(n.slice(0,32)),a=1===(n=n.slice(32)).slice(0,1)[0];n=n.slice(1),r.push({publicKey:o,isSigner:a})}if(r[0].publicKey.equals(Nd)&&r[1].isSigner){var s=pu().decode(Te.from(n)),u=JSON.parse(s);return Ci(u,Id),new e(r[1].publicKey,u)}return null}}]),e}(),Ld=new iu("Vote111111111111111111111111111111111111111"),xd=fi([du("nodePubkey"),du("authorizedWithdrawer"),ci("commission"),hi(),yi(fi([hi("slot"),di("confirmationCount")]),ui(di(),-8),"votes"),ci("rootSlotValid"),hi("rootSlot"),hi(),yi(fi([hi("epoch"),du("authorizedVoter")]),ui(di(),-8),"authorizedVoters"),fi([yi(fi([du("authorizedPubkey"),hi("epochOfLastAuthorizedSwitch"),hi("targetEpoch")]),32,"buf"),hi("idx"),ci("isEmpty")],"priorVoters"),hi(),yi(fi([hi("epoch"),hi("credits"),hi("prevCredits")]),ui(di(),-8),"epochCredits"),fi([hi("slot"),hi("timestamp")],"lastTimestamp")]),Sd=function(){function e(t){R(this,e),this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}return U(e,null,[{key:"fromAccountData",value:function(t){var n=xd.decode($s(t),4),r=n.rootSlot;return n.rootSlotValid||(r=null),new e({nodePubkey:new iu(n.nodePubkey),authorizedWithdrawer:new iu(n.authorizedWithdrawer),commission:n.commission,votes:n.votes,rootSlot:r,authorizedVoters:n.authorizedVoters.map(jd),priorVoters:Dd(n.priorVoters),epochCredits:n.epochCredits,lastTimestamp:n.lastTimestamp})}}]),e}();function jd(e){var t=e.authorizedVoter;return{epoch:e.epoch,authorizedVoter:new iu(t)}}function Cd(e){var t=e.authorizedPubkey,n=e.epochOfLastAuthorizedSwitch,r=e.targetEpoch;return{authorizedPubkey:new iu(t),epochOfLastAuthorizedSwitch:n,targetEpoch:r}}function Dd(e){var t=e.buf,n=e.idx;return e.isEmpty?[]:[].concat(te(t.slice(n+1).map(Cd)),te(t.slice(0,n).map(Cd)))}var Od={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function zd(){return(zd=P(O().mark((function e(t,n,r,i){var o,a,s,u,c,l,d;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(o=r,a=i):a=r,s=a&&{skipPreflight:a.skipPreflight,preflightCommitment:a.preflightCommitment||a.commitment,minContextSlot:a.minContextSlot},e.next=4,t.sendRawTransaction(n,s);case 4:return u=e.sent,c=a&&a.commitment,l=o?t.confirmTransaction(o,c):t.confirmTransaction(u,c),e.next=9,l;case 9:if(!(d=e.sent.value).err){e.next=12;break}throw new Error("Raw transaction ".concat(u," failed (").concat(JSON.stringify(d),")"));case 12:return e.abrupt("return",u);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _d=j(Object.freeze({__proto__:null,Account:ou,AddressLookupTableAccount:lc,AddressLookupTableInstruction:nd,AddressLookupTableProgram:rd,Authorized:fd,BLOCKHASH_CACHE_TIMEOUT_MS:3e4,BPF_LOADER_DEPRECATED_PROGRAM_ID:au,BPF_LOADER_PROGRAM_ID:Ku,BpfLoader:$u,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:od,ComputeBudgetInstruction:id,ComputeBudgetProgram:ad,Connection:$l,Ed25519Program:ud,Enum:tu,EpochSchedule:oc,FeeCalculatorLayout:Yu,Keypair:ed,LAMPORTS_PER_SOL:1e9,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:td,Loader:Xu,Lockup:yd,MAX_SEED_LENGTH:32,Message:wu,MessageAccountKeys:lu,MessageV0:Mu,NONCE_ACCOUNT_LENGTH:Vu,NonceAccount:Hu,PACKET_DATA_SIZE:1232,PUBLIC_KEY_LENGTH:32,PublicKey:iu,SIGNATURE_LENGTH_IN_BYTES:64,SOLANA_SCHEMA:nu,STAKE_CONFIG_ID:pd,STAKE_INSTRUCTION_LAYOUTS:gd,SYSTEM_INSTRUCTION_LAYOUTS:Zu,SYSVAR_CLOCK_PUBKEY:Lu,SYSVAR_EPOCH_SCHEDULE_PUBKEY:xu,SYSVAR_INSTRUCTIONS_PUBKEY:Su,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:ju,SYSVAR_RENT_PUBKEY:Cu,SYSVAR_REWARDS_PUBKEY:Du,SYSVAR_SLOT_HASHES_PUBKEY:Ou,SYSVAR_SLOT_HISTORY_PUBKEY:zu,SYSVAR_STAKE_HISTORY_PUBKEY:_u,Secp256k1Program:hd,SendTransactionError:ac,SolanaJSONRPCError:sc,SolanaJSONRPCErrorCode:{JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016},StakeAuthorizationLayout:vd,StakeInstruction:md,StakeProgram:bd,Struct:eu,SystemInstruction:qu,SystemProgram:Ju,Transaction:Nu,TransactionExpiredBlockheightExceededError:su,TransactionExpiredNonceInvalidError:cu,TransactionExpiredTimeoutError:uu,TransactionInstruction:Tu,TransactionMessage:Iu,get TransactionStatus(){return vu},VALIDATOR_INFO_KEY:Nd,VERSION_PREFIX_MASK:127,VOTE_PROGRAM_ID:Ld,ValidatorInfo:kd,VersionedMessage:Au,VersionedTransaction:ku,VoteAccount:Sd,VoteAuthorizationLayout:Ed,VoteInit:wd,VoteInstruction:Md,VoteProgram:Td,clusterApiUrl:function(e,t){var n=!1===t?"http":"https";if(!e)return Od[n].devnet;var r=Od[n][e];if(!r)throw new Error("Unknown ".concat(n," cluster: ").concat(e));return r},sendAndConfirmRawTransaction:function(e,t,n,r){return zd.apply(this,arguments)},sendAndConfirmTransaction:Pu})),Pd={};Object.defineProperty(Pd,"__esModule",{value:!0});var Rd={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"},Bd=function(e){Q(n,G(Error));var t=X(n);function n(){var e;R(this,n);for(var r=arguments.length,i=new Array(r),o=0;o=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");var t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}function Fd(){return Wd(this,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}function Vd(){return Wd(this,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}var Hd;function Gd(e,t){return Wd(this,void 0,void 0,O().mark((function n(){var r,i,o,a,s;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=JSON.stringify(e),i=Yd(e.id),o=new Uint8Array(12),crypto.getRandomValues(o),n.next=6,crypto.subtle.encrypt(Zd(i,o),t,(new TextEncoder).encode(r));case 6:return a=n.sent,(s=new Uint8Array(i.byteLength+o.byteLength+a.byteLength)).set(new Uint8Array(i),0),s.set(new Uint8Array(o),i.byteLength),s.set(new Uint8Array(a),i.byteLength+o.byteLength),n.abrupt("return",s);case 12:case"end":return n.stop()}}),n)})))}function qd(e,t){return Wd(this,void 0,void 0,O().mark((function n(){var r,i,o,a,s,u;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.slice(0,4),i=e.slice(4,16),o=e.slice(16),n.next=5,crypto.subtle.decrypt(Zd(r,i),t,o);case 5:if(a=n.sent,s=Jd().decode(a),u=JSON.parse(s),!Object.hasOwnProperty.call(u,"error")){n.next=10;break}throw new Ud(u.id,u.error.code,u.error.message);case 10:return n.abrupt("return",u);case 11:case"end":return n.stop()}}),n)})))}function Zd(e,t){return{additionalData:e,iv:t,name:"AES-GCM",tagLength:128}}function Jd(){return void 0===Hd&&(Hd=new TextDecoder("utf-8")),Hd}function Xd(e,t,n){return Wd(this,void 0,void 0,O().mark((function r(){var i,o,a,s,u,c,l;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Promise.all([crypto.subtle.exportKey("raw",t),crypto.subtle.importKey("raw",e,{name:"ECDH",namedCurve:"P-256"},!1,[])]);case 2:return i=r.sent,o=ee(i,2),a=o[0],s=o[1],r.next=8,crypto.subtle.deriveBits({name:"ECDH",public:s},n,256);case 8:return u=r.sent,r.next=11,crypto.subtle.importKey("raw",u,"HKDF",!1,["deriveKey"]);case 11:return c=r.sent,r.next=14,crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(a),info:new Uint8Array},c,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"]);case 14:return l=r.sent,r.abrupt("return",l);case 16:case"end":return r.stop()}}),r)})))}function Kd(e){if(e<49152||e>65535)throw new Bd(Rd.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,"Association port number must be between 49152 and 65535. ".concat(e," given."),{port:e});return e}function $d(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i1?e.shift():e[0]}}(),u=1,c=0,l={__type:"disconnected"},n.abrupt("return",new Promise((function(t,n){var h,p,f,y={},m=function e(){return Wd(d,void 0,void 0,O().mark((function t(){var n,r;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("connecting"===l.__type){t.next=3;break}return console.warn("Expected adapter state to be `connecting` at the moment the websocket opens. "+"Got `".concat(l.__type,"`.")),t.abrupt("return");case 3:return n=l.associationKeypair,h.removeEventListener("open",e),t.next=7,Vd();case 7:return r=t.sent,t.t0=h,t.next=11,Qd(r.publicKey,n.privateKey);case 11:t.t1=t.sent,t.t0.send.call(t.t0,t.t1),l={__type:"hello_req_sent",associationPublicKey:n.publicKey,ecdhPrivateKey:r.privateKey};case 14:case"end":return t.stop()}}),t)})))},g=function(e){e.wasClean?l={__type:"disconnected"}:n(new Bd(Rd.ERROR_SESSION_CLOSED,"The wallet session dropped unexpectedly (".concat(e.code,": ").concat(e.reason,")."),{closeEvent:e})),p()},v=function(e){return Wd(d,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p(),!(Date.now()-a>=uh)){e.next=5;break}n(new Bd(Rd.ERROR_SESSION_TIMEOUT,"Failed to connect to the wallet websocket on port ".concat(i,"."))),e.next=8;break;case 5:return e.next=7,new Promise((function(e){var t=s();f=window.setTimeout(e,t)}));case 7:w();case 8:case"end":return e.stop()}}),e)})))},b=function(r){return Wd(d,void 0,void 0,O().mark((function i(){var o,a,s,d,f,m,g,v;return O().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.data.arrayBuffer();case 2:o=i.sent,i.t0=l.__type,i.next="connected"===i.t0?6:"hello_req_sent"===i.t0?30:51;break;case 6:if(i.prev=6,a=o.slice(0,4),(s=new DataView(a).getUint32(0,!1))===c+1){i.next=11;break}throw new Error("Encrypted message has invalid sequence number");case 11:return c=s,i.next=14,qd(o,l.sharedSecret);case 14:d=i.sent,f=y[d.id],delete y[d.id],f.resolve(d.result),i.next=29;break;case 20:if(i.prev=20,i.t1=i.catch(6),!(i.t1 instanceof Ud)){i.next=28;break}m=y[i.t1.jsonRpcMessageId],delete y[i.t1.jsonRpcMessageId],m.reject(i.t1),i.next=29;break;case 28:throw i.t1;case 29:return i.abrupt("break",51);case 30:return i.next=32,Xd(o,l.associationPublicKey,l.ecdhPrivateKey);case 32:return g=i.sent,l={__type:"connected",sharedSecret:g},v=new Proxy({},{get:function(e,t){if(null==e[t]){var n=t.toString().replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())})).toLowerCase();e[t]=function(e){return Wd(this,void 0,void 0,O().mark((function r(){var i;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=u++,r.t0=h,r.next=4,Gd({id:i,jsonrpc:"2.0",method:n,params:null!=e?e:{}},g);case 4:return r.t1=r.sent,r.t0.send.call(r.t0,r.t1),r.abrupt("return",new Promise((function(e,n){y[i]={resolve:function(r){switch(t){case"authorize":case"reauthorize":var i=r.wallet_uri_base;if(null!=i)try{lh(i)}catch(e){return void n(e)}}e(r)},reject:n}})));case 7:case"end":return r.stop()}}),r)})))}}return e[t]},defineProperty:function(){return!1},deleteProperty:function(){return!1}}),i.prev=35,i.t2=t,i.next=39,e(v);case 39:i.t3=i.sent,(0,i.t2)(i.t3),i.next=46;break;case 43:i.prev=43,i.t4=i.catch(35),n(i.t4);case 46:return i.prev=46,p(),h.close(),i.finish(46);case 50:return i.abrupt("break",51);case 51:case"end":return i.stop()}}),i,null,[[6,20],[35,43,46,50]])})))},w=function(){p&&p(),l={__type:"connecting",associationKeypair:r},void 0===a&&(a=Date.now()),(h=new WebSocket(o,["com.solana.mobilewalletadapter.v1"])).addEventListener("open",m),h.addEventListener("close",g),h.addEventListener("error",v),h.addEventListener("message",b),p=function(){window.clearTimeout(f),h.removeEventListener("open",m),h.removeEventListener("close",g),h.removeEventListener("error",v),h.removeEventListener("message",b)}};w()})));case 13:case"end":return n.stop()}}),n)})))};var dh=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var d=0,h=o-1;(0!==l||d>>0,c[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var f=new Uint8Array(r+(o-p)),y=r;p!==o;)f[y++]=c[p++];return f}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var d=t[i],h=0,p=u-1;(0!==d||h>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=u-r;f!==u&&0===l[f];)f++;for(var y=s.repeat(n);fthis.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function Th(e,t){return t.property?e+"["+t.property+"]":e}Ah.Layout=Eh,Ah.nameWithProperty=Th,Ah.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Eh))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var Nh=function(e){Q(n,Eh);var t=X(n);function n(){return R(this,n),t.apply(this,arguments)}return U(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}(),Ih=function(e){Q(n,Nh);var t=X(n);function n(e,r){var i;if(R(this,n),void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");return(i=t.call(this,-1,r)).elementSpan=e,i}return U(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}(),kh=function(e){Q(n,Nh);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Eh))throw new TypeError("layout must be a Layout");if(void 0===r)r=0;else if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");return(o=t.call(this,e.span,i||e.property)).layout=e,o.offset=r,o}return U(n,[{key:"isCount",value:function(){return this.layout instanceof Lh||this.layout instanceof xh}},{key:"decode",value:function(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)}}]),n}(),Lh=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntLE(e,n,this.span),this.span}}]),n}(),xh=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntBE(e,n,this.span),this.span}}]),n}(),Sh=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntLE(e,n,this.span),this.span}}]),n}(),jh=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntBE(e,n,this.span),this.span}}]),n}(),Ch=Math.pow(2,32);function Dh(e){var t=Math.floor(e/Ch);return{hi32:t,lo32:e-t*Ch}}function Oh(e,t){return e*Ch+t}var zh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Oh(e.readUInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Dh(e);return t.writeUInt32LE(r.lo32,n),t.writeUInt32LE(r.hi32,n+4),8}}]),n}(),_h=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Oh(e.readUInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Dh(e);return t.writeUInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(),Ph=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Oh(e.readInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Dh(e);return t.writeUInt32LE(r.lo32,n),t.writeInt32LE(r.hi32,n+4),8}}]),n}(),Rh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Oh(e.readInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Dh(e);return t.writeInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(),Bh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatLE(e,n),4}}]),n}(),Uh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatBE(e,n),4}}]),n}(),Wh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleLE(e,n),8}}]),n}(),Qh=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleBE(e,n),8}}]),n}(),Yh=function(e){Q(n,Eh);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Eh))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Nh&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(r instanceof Nh)&&0u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(e){s.e(e)}finally{s.f()}var c=-1;try{c=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(e){}return(o=t.call(this,c,r)).fields=e,o.decodePrefixes=!!i,o}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;try{n=this.fields.reduce((function(n,r){var i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(e){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n,r=this.makeDestinationObject(),i=se(this.fields);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(void 0!==o.property&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r,i=n,o=0,a=0,s=se(this.fields);try{for(s.s();!(r=s.n()).done;){var u=r.value,c=u.span;if(a=0c&&(c=u.getSpan(t,n)))}o=n,n+=c}}catch(e){s.e(e)}finally{s.f()}return o+a-i}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=se(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;void 0!==i.property&&0i.span?n=-1:0<=n&&(n+=i.span)}}catch(e){r.e(e)}finally{r.f()}}}]),n}(),Vh=function(){function e(t){R(this,e),this.property=t}return U(e,[{key:"decode",value:function(){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(){throw new Error("UnionDiscriminator is abstract")}}]),e}(),Hh=function(e){Q(n,Vh);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Nh&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,r||e.property||"variant")).layout=e,i}return U(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}(),Gh=function(e){Q(n,Eh);var t=X(n);function n(e,r,i){var o;R(this,n);var a=e instanceof Lh||e instanceof xh;if(a)e=new Hh(new kh(e));else if(e instanceof Nh&&e.isCount())e=new Hh(e);else if(!(e instanceof Vh))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===r&&(r=null),!(null===r||r instanceof Eh))throw new TypeError("defaultLayout must be null or a Layout");if(null!==r){if(0>r.span)throw new Error("defaultLayout must have constant span");void 0===r.property&&(r=r.replicate("content"))}var s=-1;r&&0<=(s=r.span)&&a&&(s+=e.layout.span),(o=t.call(this,s,i)).discriminator=e,o.usesPrefixDiscriminator=a,o.defaultLayout=r,o.registry={};var u=o.defaultGetSourceVariant.bind(Z(o));return o.getSourceVariant=function(e){return u(e)},o.configGetSourceVariant=function(e){u=e.bind(this)},o}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e,t){var n;void 0===t&&(t=0);var r=this.discriminator,i=r.decode(e,t),o=this.registry[i];if(void 0===o){var a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=r.layout.span),(n=this.makeDestinationObject())[r.property]=i,n[o.property]=this.defaultLayout.decode(e,t+a)}else n=o.decode(e,t);return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.getSourceVariant(e);if(void 0===r){var i=this.discriminator,o=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,n),a+o.encode(e[o.property],t,n+a)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new qh(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(e,t){var n=e;return Te.isBuffer(e)&&(void 0===t&&(t=0),n=this.discriminator.decode(e,t)),this.registry[n]}}]),n}(),qh=function(e){Q(n,Eh);var t=X(n);function n(e,r,i,o){var a;if(R(this,n),!(e instanceof Gh))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof i&&void 0===o&&(o=i,i=null),i){if(!(i instanceof Eh))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof o)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=i?i.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(a=t.call(this,s,o)).union=e,a.variant=r,a.layout=i||null,a}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(e,t+n)}},{key:"decode",value:function(e,t){var n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}();function Zh(e){return 0>e&&(e+=4294967296),e}var Jh=function(e){Q(n,Eh);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Lh||e instanceof xh))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof r&&void 0===i&&(i=r,r=void 0),4=n)throw new TypeError("bits must be positive integer");var i=8*t.span,o=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+o>i)throw new Error("bits too long for span remainder ("+(i-o)+" of "+i+" remain)");this.container=t,this.bits=n,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if(!Number.isInteger(e)||e!==Zh(e&this.valueMask))throw new TypeError(Th("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=Zh(e<n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=this.span;return 0>n&&(n=this.length.decode(e,t)),e.slice(t,t+n)}},{key:"encode",value:function(e,t,n){var r=this.length;if(this.length instanceof Nh&&(r=e.length),!Te.isBuffer(e)||r!==e.length)throw new TypeError(Th("Blob.encode",this)+" requires (length "+r+") Buffer as src");if(n+r>t.length)throw new RangeError("encoding overruns Buffer");return t.write(e.toString("hex"),n,r,"hex"),this.length instanceof Nh&&this.length.encode(r,t,n),r}}]),n}(),ep=function(e){Q(n,Eh);var t=X(n);function n(e){return R(this,n),t.call(this,-1,e)}return U(n,[{key:"getSpan",value:function(e,t){if(!Te.isBuffer(e))throw new TypeError("b must be a Buffer");void 0===t&&(t=0);for(var n=t;nt.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),t[n+i]=0,i+1}}]),n}(),tp=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;if(R(this,n),"string"==typeof e&&void 0===r&&(r=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=t.call(this,-1,r)).maxSpan=e,i}return U(n,[{key:"getSpan",value:function(e,t){if(!Te.isBuffer(e))throw new TypeError("b must be a Buffer");return void 0===t&&(t=0),e.length-t}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),i}}]),n}(),np=function(e){Q(n,Eh);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,0,r)).value=e,i}return U(n,[{key:"decode",value:function(e,t,n){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}();Ah.ExternalLayout=Nh,Ah.GreedyCount=Ih,Ah.OffsetLayout=kh,Ah.UInt=Lh,Ah.UIntBE=xh,Ah.Int=Sh,Ah.IntBE=jh,Ah.Float=Bh,Ah.FloatBE=Uh,Ah.Double=Wh,Ah.DoubleBE=Qh,Ah.Sequence=Yh,Ah.Structure=Fh,Ah.UnionDiscriminator=Vh,Ah.UnionLayoutDiscriminator=Hh,Ah.Union=Gh,Ah.VariantLayout=qh,Ah.BitStructure=Jh,Ah.BitField=Xh,Ah.Boolean=Kh,Ah.Blob=$h,Ah.CString=ep,Ah.UTF8=tp,Ah.Constant=np,Ah.greedy=function(e,t){return new Ih(e,t)},Ah.offset=function(e,t,n){return new kh(e,t,n)},Ah.u8=function(e){return new Lh(1,e)},Ah.u16=function(e){return new Lh(2,e)},Ah.u24=function(e){return new Lh(3,e)},Ah.u32=function(e){return new Lh(4,e)},Ah.u40=function(e){return new Lh(5,e)},Ah.u48=function(e){return new Lh(6,e)},Ah.nu64=function(e){return new zh(e)},Ah.u16be=function(e){return new xh(2,e)},Ah.u24be=function(e){return new xh(3,e)},Ah.u32be=function(e){return new xh(4,e)},Ah.u40be=function(e){return new xh(5,e)},Ah.u48be=function(e){return new xh(6,e)},Ah.nu64be=function(e){return new _h(e)},Ah.s8=function(e){return new Sh(1,e)},Ah.s16=function(e){return new Sh(2,e)},Ah.s24=function(e){return new Sh(3,e)},Ah.s32=function(e){return new Sh(4,e)},Ah.s40=function(e){return new Sh(5,e)},Ah.s48=function(e){return new Sh(6,e)},Ah.ns64=function(e){return new Ph(e)},Ah.s16be=function(e){return new jh(2,e)},Ah.s24be=function(e){return new jh(3,e)},Ah.s32be=function(e){return new jh(4,e)},Ah.s40be=function(e){return new jh(5,e)},Ah.s48be=function(e){return new jh(6,e)},Ah.ns64be=function(e){return new Rh(e)},Ah.f32=function(e){return new Bh(e)},Ah.f32be=function(e){return new Uh(e)},Ah.f64=function(e){return new Wh(e)},Ah.f64be=function(e){return new Qh(e)},Ah.struct=function(e,t,n){return new Fh(e,t,n)},Ah.bits=function(e,t,n){return new Jh(e,t,n)};var rp=Ah.seq=function(e,t,n){return new Yh(e,t,n)};Ah.union=function(e,t,n){return new Gh(e,t,n)},Ah.unionLayoutDiscriminator=function(e,t){return new Hh(e,t)},Ah.blob=function(e,t){return new $h(e,t)},Ah.cstr=function(e){return new ep(e)},Ah.utf8=function(e,t){return new tp(e,t)},Ah.const=function(e,t){return new np(e,t)};var ip={},op={exports:{}};!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===z(e)?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Cn.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===z(e))return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=s(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var d=["","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"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return m(e,t,n)}Math.imul||(y=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?f(this,e,t):n<1024?m(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new T(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function N(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(w,b),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new N(e)},r(N,T),N.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},N.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},N.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},N.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(op,x),function(e){var t=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.map=e.array=e.rustEnum=e.str=e.vecU8=e.tagged=e.vec=e.bool=e.option=e.publicKey=e.i128=e.u128=e.i64=e.u64=e.struct=e.f64=e.f32=e.i32=e.u32=e.i16=e.u16=e.i8=e.u8=void 0;var n=Ah,r=_d,i=t(op.exports),o=Ah;Object.defineProperty(e,"u8",{enumerable:!0,get:function(){return o.u8}}),Object.defineProperty(e,"i8",{enumerable:!0,get:function(){return o.s8}}),Object.defineProperty(e,"u16",{enumerable:!0,get:function(){return o.u16}}),Object.defineProperty(e,"i16",{enumerable:!0,get:function(){return o.s16}}),Object.defineProperty(e,"u32",{enumerable:!0,get:function(){return o.u32}}),Object.defineProperty(e,"i32",{enumerable:!0,get:function(){return o.s32}}),Object.defineProperty(e,"f32",{enumerable:!0,get:function(){return o.f32}}),Object.defineProperty(e,"f64",{enumerable:!0,get:function(){return o.f64}}),Object.defineProperty(e,"struct",{enumerable:!0,get:function(){return o.struct}});var a=function(e){Q(r,e);var t=X(r);function r(e,i,o){var a;return R(this,r),(a=t.call(this,e,o)).blob=n.blob(e),a.signed=i,a}return U(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new i.default(this.blob.decode(e,t),10,"le");return this.signed?n.fromTwos(8*this.span).clone():n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.signed&&(e=e.toTwos(8*this.span)),this.blob.encode(e.toArrayLike(Te,"le",this.span),t,n)}}]),r}(n.Layout);function s(e){return new a(8,!1,e)}e.u64=s,e.i64=function(e){return new a(8,!0,e)},e.u128=function(e){return new a(16,!1,e)},e.i128=function(e){return new a(16,!0,e)};var u=function(e){Q(n,e);var t=X(n);function n(e,r,i,o){var a;return R(this,n),(a=t.call(this,e.span,o)).layout=e,a.decoder=r,a.encoder=i,a}return U(n,[{key:"decode",value:function(e,t){return this.decoder(this.layout.decode(e,t))}},{key:"encode",value:function(e,t,n){return this.layout.encode(this.encoder(e),t,n)}},{key:"getSpan",value:function(e,t){return this.layout.getSpan(e,t)}}]),n}(n.Layout);e.publicKey=function(e){return new u(n.blob(32),(function(e){return new r.PublicKey(e)}),(function(e){return e.toBuffer()}),e)};var c=function(e){Q(r,e);var t=X(r);function r(e,i){var o;return R(this,r),(o=t.call(this,-1,i)).layout=e,o.discriminator=n.u8(),o}return U(r,[{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null==e?this.discriminator.encode(0,t,n):(this.discriminator.encode(1,t,n),this.layout.encode(e,t,n+1)+1)}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return null;if(1===n)return this.layout.decode(e,t+1);throw new Error("Invalid option "+this.property)}},{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return 1;if(1===n)return this.layout.getSpan(e,t+1)+1;throw new Error("Invalid option "+this.property)}}]),r}(n.Layout);function l(e){if(0===e)return!1;if(1===e)return!0;throw new Error("Invalid bool: "+e)}function d(e){return e?1:0}function h(e){var t=n.u32("length"),r=n.struct([t,n.blob(n.offset(t,-t.span),"data")]);return new u(r,(function(e){return e.data}),(function(e){return{data:e}}),e)}e.option=function(e,t){return new c(e,t)},e.bool=function(e){return new u(n.u8(),l,d,e)},e.vec=function(e,t){var r=n.u32("length"),i=n.struct([r,n.seq(e,n.offset(r,-r.span),"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),t)},e.tagged=function(e,t,r){var i=n.struct([s("tag"),t.replicate("data")]);return new u(i,(function(t){var n=t.tag,r=t.data;if(!n.eq(e))throw new Error("Invalid tag, expected: "+e.toString("hex")+", got: "+n.toString("hex"));return r}),(function(t){return{tag:e,data:t}}),r)},e.vecU8=h,e.str=function(e){return new u(h(),(function(e){return e.toString("utf-8")}),(function(e){return Te.from(e,"utf-8")}),e)},e.rustEnum=function(e,t,r){var i=n.union(null!=r?r:n.u8(),t);return e.forEach((function(e,t){return i.addVariant(t,e,e.property)})),i},e.array=function(e,t,r){var i=n.struct([n.seq(e,t,"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),r)};var p=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;return R(this,n),(o=t.call(this,e.span+r.span,i)).keyLayout=e,o.valueLayout=r,o}return U(n,[{key:"decode",value:function(e,t){return t=t||0,[this.keyLayout.decode(e,t),this.valueLayout.decode(e,t+this.keyLayout.getSpan(e,t))]}},{key:"encode",value:function(e,t,n){n=n||0;var r=this.keyLayout.encode(e[0],t,n);return r+this.valueLayout.encode(e[1],t,n+r)}},{key:"getSpan",value:function(e,t){return this.keyLayout.getSpan(e,t)+this.valueLayout.getSpan(e,t)}}]),n}(n.Layout);e.map=function(e,t,r){var i=n.u32("length"),o=n.struct([i,n.seq(new p(e,t),n.offset(i,-i.span),"values")]);return new u(o,(function(e){var t=e.values;return new Map(t)}),(function(e){return{values:Array.from(e.entries())}}),r)}}(ip),ue.Web3MobileWallet;var ap=ue.transact,sp=Cn.Buffer,up=jn.exports,cp=ip.struct([ip.publicKey("mint"),ip.publicKey("owner"),ip.u64("amount"),ip.u32("delegateOption"),ip.publicKey("delegate"),ip.u8("state"),ip.u32("isNativeOption"),ip.u64("isNative"),ip.u64("delegatedAmount"),ip.u32("closeAuthorityOption"),ip.publicKey("closeAuthority")]);ip.array;var lp=ip.bool,dp=ip.i128;ip.i16;var hp=ip.i32,pp=ip.i64;ip.i8,ip.map;var fp=ip.option,yp=ip.publicKey,mp=ip.rustEnum,gp=ip.str,vp=ip.struct;ip.tagged;var bp=ip.u128,wp=ip.u16,Mp=ip.u32,Ap=ip.u64,Ep=ip.u8,Tp=ip.vec;ip.vecU8;const Np="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0yOTkuMyAyMzcuNSA1MDAgMTIybDIwMC43IDExNS41LTczLjUgNDIuNkw1MDAgMjA4LjJsLTEyNy4xIDcxLjktNzMuNi00Mi42em00MDEuNCAxNDYtNzMuNS00Mi42LTEyNy4xIDczTDM3MyAzNDAuNGwtNzMuNSA0My4xdjg1LjdsMTI3LjEgNzN2MTQ1LjRsNzMuNSA0My4xIDczLjUtNDMuMVY1NDIuMWwxMjcuMS03M3YtODUuNnptMCAyMzIuMXYtODUuN2wtNzMuNSA0Mi42djg1LjdjLS4xLS42IDczLjUtNDIuNiA3My41LTQyLjZ6bTUxLjkgMjkuMy0xMjcuMSA3M3Y4NS43TDgyNi4xIDY4OFY0NTYuNGwtNzMuNSA0My4xdjE0NS40em0tNzMuNS0zMzQuNCA3My41IDQzLjF2ODUuN2w3My41LTQzLjF2LTg1LjdsLTczLjUtNDMuMS03My41IDQzLjF6TTQyNi41IDc0OS40djg1LjdsNzMuNSA0My4xIDczLjUtNDMuMXYtODUuN2wtNzMuNSA0Mi03My41LTQyek0yOTkuMyA2MTUuNmw3My41IDQzLjF2LTg2LjJMMjk5LjMgNTMwdjg1LjZ6bTEyNy4yLTMwNS4xIDczLjUgNDMuMSA3My41LTQzLjEtNzMuNS00Mi42YzAtLjUtNzMuNSA0Mi42LTczLjUgNDIuNnptLTE3OS4xIDQzLjEgNzMuNS00My4xLTczLjUtNDMuMS03My41IDQzLjF2ODUuN2w3My41IDQzLjF2LTg1Ljd6bTAgMTQ1LjQtNzMuNS00Mi42VjY4OGwyMDAuNyAxMTUuNXYtODUuN2wtMTI3LjEtNzNjLS4xLjEtLjEtMTQ1LjgtLjEtMTQ1Ljh6IiBmaWxsPSIjZjBiOTBiIi8+PC9zdmc+",Ip="https://app.uniswap.org/static/media/bnb-logo.797868eb94521320b78e3967134febbe.svg";var kp={name:"bsc",id:"0x38",networkId:"56",namespace:"eip155",platform:"evm",label:"BNB Smart Chain",fullName:"BNB Smart Chain Mainnet",logo:Np,logoBackgroundColor:"#000000",logoWhiteBackground:Np,currency:{name:"BNB",symbol:"BNB",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Ip},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png"},stables:{usd:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955"]},explorer:"https://bscscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://bscscan.com/tx/${e.id||e}`:t?`https://bscscan.com/token/${t}`:n?`https://bscscan.com/address/${n}`:void 0,endpoints:["https://bsc-dataseed.binance.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed3.defibit.io"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"BNB",name:"Binance Coin",decimals:18,logo:Ip,type:"NATIVE"},{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",name:"Wrapped BNB",decimals:18,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png",type:"20"},{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",name:"Tether USD",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png",type:"20"},{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",name:"USD Coin",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d/logo.png",type:"20"},{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:"ETH",name:"Ethereum Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x2170Ed0880ac9A755fd29B2688956BD959F933F8/logo.png",type:"20"},{address:"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",symbol:"Cake",name:"PancakeSwap Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",type:"20"},{address:"0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",symbol:"BTCB",name:"BTCB Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Lp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAADxdJREFUeJztXVtzFMcVplwuP8VVeYmf7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vz6AA2isX4kPxS4JyjfkgdVKoikhHgrfctC/m4bao+9ZfLwpbMEwlDGkupoFIVUSUCtJ80v7qnDB5sE6vxi5Jsdp+2yR9AFdCoTxVREAEwaxjTy08JfN3nNqmJ8adIkHJb6R9cHbt9qoiCCIBOJNTj1QFsUVPjQ/ha8xCPNfdRP7wOcFmUjAC7j9hR3TNlfG4D2KLmBCiQ4JFEyu2iVoIqyquIyglgT3VPAVz3gSXetZJEq/tossm9TK4MRbSWVBGVEwDtXqjHpwqhc657UuMXZUF64DHuiPRSK0UVOLJdTgCcPKIelzrcXuic2u7TJNmSfdIWEhSriIoEsKm6BzqGrqnt7StgpS3LAc7to+MIqntMvM/HD9CtcW9+uWBdssUxxDk+dPGiHocSoFNT1nyZiIOmloWIJqMQ6tF6+7oi9gnEZpE9O4bmwc1Bh2RxfjUkv21sT+7AIHg1396NS5CksC2LSAnoqmaJnVqJSCWLeoLZJSEYophjeewpXUpBtYpN5WW1AnQSWyWPaQKGc7Y32lRtHJvhhQ7cxrp+64NElJw3OW3URqB76522qpVu2yw4vWLTMbTohne7I5/YqUfBIUZbTiWHMjx/ttAHNR8kwVn2fJOKeogYxGZOu/b5/FnJt6vJ9yyyI8tYZvhejF25LcusVBa0N0OPO5ObWWJsGKO0FdushBckRdDqFP1u0fSYsss5vluMgY8FY7IuYVMPgrbn6H2PCxBEJBHn9Tf8s4UHz78L3zmj5fqsmCG4DAk3YiWbvGfFvYgpdz888EJL/J7Chdkerk8XEP8Wv+vJzyo8EsHf8L/FZ+Czpi5YqjP5P2ey0rAsl+yGAAAAAElFTkSuQmCC",xp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png";var Sp={name:"ethereum",id:"0x1",networkId:"1",namespace:"eip155",platform:"evm",label:"Ethereum",fullName:"Ethereum Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJ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wIiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGU+LnN0MXtmaWxsOiM4YzhjOGN9PC9zdHlsZT48cGF0aCBkPSJtNDk5LjggNzcuNS01LjUgMTl2NTU5LjFsNS41IDUuNSAyNTkuNy0xNTMuNUw0OTkuOCA3Ny41eiIgZmlsbD0iIzM0MzQzNCIvPjxwYXRoIGNsYXNzPSJzdDEiIGQ9Im00OTkuOCA3Ny41LTI1OS4zIDQzMEw0OTkuOCA2NjFWNzcuNXoiLz48cGF0aCBkPSJtNDk5LjggNzEwLjMtMi45IDR2MTk5LjFsMi45IDkuMSAyNTkuNy0zNjUuOC0yNTkuNyAxNTMuNnoiIGZpbGw9IiMzYzNjM2IiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNDk5LjggOTIyLjVWNzEwLjNMMjQwLjUgNTU2LjdsMjU5LjMgMzY1Ljh6Ii8+PHBhdGggZD0ibTQ5OS44IDY2MSAyNTkuNy0xNTMuNS0yNTkuNy0xMTcuOFY2NjF6IiBmaWxsPSIjMTQxNDE0Ii8+PHBhdGggZD0iTTI0MC41IDUwNy41IDQ5OS44IDY2MVYzODkuN0wyNDAuNSA1MDcuNXoiIGZpbGw9IiMzOTM5MzkiLz48L3N2Zz4K",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Lp},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",logo:xp,logoBackgroundColor:"#FFFFFF"},stables:{usd:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"]},explorer:"https://etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://etherscan.io/tx/${e.id||e}`:t?`https://etherscan.io/token/${t}`:n?`https://etherscan.io/address/${n}`:void 0,endpoints:["https://rpc.ankr.com/eth","https://eth.llamarpc.com","https://ethereum.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Lp,type:"NATIVE"},{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:xp,type:"20"},{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c/logo.png",type:"20"},{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x853d955aCEf822Db058eb8505911ED77F175b99e",symbol:"FRAX",name:"Frax",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x853d955aCEf822Db058eb8505911ED77F175b99e/logo.png",type:"20"},{address:"0x956F47F50A910163D8BF957Cf5846D573E7f87CA",symbol:"FEI",name:"Fei USD",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x956F47F50A910163D8BF957Cf5846D573E7f87CA/logo.png",type:"20"},{address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const jp="https://assets.spooky.fi/tokens/wFTM.png";var Cp={name:"fantom",id:"0xfa",networkId:"250",namespace:"eip155",label:"Fantom",fullName:"Fantom Opera",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00NjcgMTM1LjVjMTgtOS4zIDQ1LjEtOS4zIDYzIDBsMTgzLjQgOTdjMTAuNyA2LjEgMTYuNiAxNCAxOCAyMy4zdjQ4Ni42YzAgOS4zLTYuMSAxOS4yLTE4IDI1LjJsLTE4My4yIDk3Yy0xOCA5LjMtNDUuMSA5LjMtNjMgMGwtMTgzLjMtOTdjLTExLjktNi4xLTE3LjItMTUuOS0xOC0yNS4yVjI1NS43Yy43LTguNyA2LjctMTcuMiAxNy4yLTIzLjNMNDY3IDEzNS41em0yMzUuOCAzODkuNy0xNzIuNiA5MC45Yy0xOCA5LjMtNDUuMSA5LjMtNjMgMGwtMTcxLjktOTAuM3YyMTQuNGwxNzEuOSA5MC4zYzEwIDUuMyAyMC42IDEwLjcgMzEuMiAxMS4zaC43YzEwIDAgMjAtNS4zIDMwLjUtMTBsMTc0LTkyLjMtLjgtMjE0LjN6TTIzNy4zIDczMS4xYzAgMTguNiAyIDMxLjIgNi43IDM5LjggMy4zIDcuMyA4LjcgMTIuNiAxOC42I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djE1Ny41YzEuMS0uNSAyLjEtLjUgMy4yLTEuMWwxNDUuOS03Ny4yaC41LS41bC0xNDUuOS03OC4yYy0xLjEtLjUtMi4xLTEtMy4yLTF6TTY2MS44IDMzM2wtMTMxLjEgNjguNyAxMzEuMSA2OC43VjMzM3ptLTMyNC42IDB2MTM4bDEzMS4xLTY4LjdjMC0uMS0xMzEuMS02OS4zLTEzMS4xLTY5LjN6bTE3Ny4xLTEwMi4xYy03LjQtNC4yLTIxLjEtNC4yLTI5LjEgMGwtMTQ1LjkgNzcuMmgtLjUuNWwxNDUuOSA3Ny4yYzcuNCA0LjIgMjEuMSA0LjIgMjkuMSAwbDE0NS45LTc3LjJoLjUtLjVsLTE0NS45LTc3LjJ6bTE2OS4xIDcuNCA5IDUuOCAxLjYgMS4xYzIuNiAxLjYgNC44IDMuMiA2LjkgNC4yIDIyLjIgMTQuOCAzMC4xIDMxLjIgMzAuMSA2NXYxLjFoLTIyLjdjMC0xNC44LTEuNi0yNC44LTUuMy0zMS43LTIuNi01LjgtNi45LTEwLTE0LjgtMTUuM2wtLjUtLjVjLTEuNi0xLjEtMy43LTIuMS01LjgtMy43bC0yLjYtMS42LTguNS00LjggMTIuNi0xOS42eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==",currency:{name:"Fantom",symbol:"FTM",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:"https://assets.spooky.fi/tokens/FTM.png"},wrapped:{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",logo:jp},stables:{usd:["0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf","0x1B6382DBDEa11d97f24495C9A90b7c88469134a4"]},explorer:"https://ftmscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://ftmscan.com/tx/${e.id||e}`:t?`https://ftmscan.com/token/${t}`:n?`https://ftmscan.com/address/${n}`:void 0,endpoints:["https://rpc.ftm.tools","https://fantom.publicnode.com","https://rpc2.fantom.network"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"FTM",name:"Fantom",decimals:18,logo:"https://assets.spooky.fi/tokens/FTM.png",type:"NATIVE"},{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",symbol:"WFTM",name:"Wrapped Fantom",decimals:18,logo:jp,type:"20"},{address:"0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf",symbol:"lzUSDC",name:"LayerZero USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"},{address:"0x1B6382DBDEa11d97f24495C9A90b7c88469134a4",symbol:"axlUSDC",name:"Axelar Wrapped USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Dp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/info/logo.png",Op="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/assets/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270/logo.png";var zp={name:"polygon",id:"0x89",networkId:"137",namespace:"eip155",label:"Polygon (POS)",fullName:"Polygon (POS) Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0xMzEuNSA0NTkuM2MtMTQuNCA5LjYtMjQgMjQtMjQgNDMuMnYxOTQuNGMwIDE5LjIgOS42IDM2IDI0IDQzLjJsMTY1LjYgOTZjMTQuNCA5LjYgMzMuNiA5LjYgNDggMGwxNjUuNi05NmMxNC40LTkuNiAyNC0yNCAyNC00My4ydi02OS42bC03Ni44LTQzLjJ2NjQuOGMwIDE5LjItOS42IDM2LTI0IDQzLjJsLTg2LjQgNTIuOGMtMTQuNCA5LjY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B1d8E8eF31E21C99d1Db9A6444d3ADf1270",logo:Op},stables:{usd:["0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"]},explorer:"https://polygonscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://polygonscan.com/tx/${e.id||e}`:t?`https://polygonscan.com/token/${t}`:n?`https://polygonscan.com/address/${n}`:void 0,endpoints:["https://polygon-rpc.com","https://polygon-pokt.nodies.app","https://polygon.llamarpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"MATIC",name:"Polygon",decimals:18,logo:Dp,type:"NATIVE"},{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",symbol:"WMATIC",name:"Wrapped Matic",decimals:18,logo:Op,type:"20"},{address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xf6261529C6C2fBEB313aB25cDEcD243613b40EB5",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const _p="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDF7ZmlsbDp1cmwoI1NWR0lEXzAwMDAwMDE5Njc2ODQzODE5NzI3MzAwODIwMDAwMDA1OTQ3NjMyODMzODYxMjM4OTE3Xyl9LnN0MntmaWxsOnVybCgjU1ZHSURfMDAwMDAwNjQzMjA1MjE4MTcxODM4NzM1NjAwMDAwMDMxNzkyNDIxNTkzMzkwODM5NjdfKX08L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMV8iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iODE1Ljg1NiIgeTE9IjcwLjgyNCIgeDI9IjM4OC4zMzYiIHkyPSItNzQ4LjA1MiIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDE5MS40MzUpIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiMwMGZmYTMiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNkYzFmZmYiLz48L2xpbmVhckdyYWRpZW50PjxwYXRoIGQ9Ik0yMzcuOSA2NTcuOWM0Lj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z0idXNlclNwYWNlT25Vc2UiIHgxPSI3MjAuOTIzIiB5MT0iMTE1Ljg3IiB4Mj0iMjkzLjQwNiIgeTI9Ii03MDMuMDAzIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIC0xIDAgMTkxLjQzNSkiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzAwZmZhMyIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2RjMWZmZiIvPjwvbGluZWFyR3JhZGllbnQ+PHBhdGggZD0iTTc2Mi4xIDQzMC4xYy00LjktNC45LTEyLjItNy4zLTE3LjEtNy4zSDEyNS4zYy0xMi4yIDAtMTcuMSAxNC43LTkuOCAyMkwyMzggNTY3LjNjNC45IDQuOSAxMi4yIDcuMyAxNy4xIDcuM2g2MTkuN2MxMi4yIDAgMTcuMS0xNC43IDkuOC0yMkw3NjIuMSA0MzAuMXoiIGZpbGw9InVybCgjU1ZHSURfMDAwMDAwMDc0MDk4NzczNjMxMDQ5ODE2MzAwMDAwMTUxMzM3MDU1NzA2ODAwOTc3MDlfKSIvPjwvc3ZnPgo=",Pp="https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png";var Rp={name:"solana",networkId:"solana",namespace:"solana",label:"Solana",fullName:"Solana Mainnet Beta",logo:_p,logoBackgroundColor:"#000000",logoWhiteBackground:_p,currency:{name:"Solana",symbol:"SOL",decimals:9,address:"11111111111111111111111111111111",logo:Pp},wrapped:{address:"So11111111111111111111111111111111111111112",logo:Pp},stables:{usd:["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"]},explorer:"https://solscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://solscan.io/tx/${e.id||e}`:t?`https://solscan.io/token/${t}`:n?`https://solscan.io/address/${n}`:void 0,endpoints:["https://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","https://mainnet-beta.solflare.network","https://solana-mainnet.rpc.extrnode.com"],sockets:["wss://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","wss://mainnet-beta.solflare.network"],tokens:[{address:"11111111111111111111111111111111",symbol:"SOL",name:"Solana",decimals:9,logo:Pp,type:"NATIVE"},{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://img.raydium.io/icon/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.png",type:"SPL"},{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",name:"USDT",decimals:6,logo:"https://img.raydium.io/icon/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB.png",type:"SPL"},{address:"7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",symbol:"stSOL",name:"Lido Staked SOL",decimals:9,logo:"https://img.raydium.io/icon/7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj.png",type:"SPL"},{address:"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",symbol:"BONK",name:"BONK",decimals:5,logo:"https://img.raydium.io/icon/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263.png",type:"SPL"},{address:"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",symbol:"SAMO",name:"Samoyed Coin",decimals:9,logo:"https://img.raydium.io/icon/7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU.png",type:"SPL"},{address:"DePay1miDBPWXs6PVQrdC5Vch2jemgEPaiyXLNLLa2NF",symbol:"DEPAY",name:"DePay",decimals:9,logo:"https://depay.com/favicon.png",type:"SPL"}],zero:"0",maxInt:"340282366920938463463374607431768211455"};const Bp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E3M2MtMS42IDEtMy42IDEuNi01LjUgMS42cy0zLjktLjYtNS41LTEuNmwtMjk5LjYtMTczYy0zLjYtMi01LjUtNS45LTUuNS05LjhWMzI2LjdjMC0zLjkgMi4zLTcuOCA1LjUtOS44bDI5OS42LTE3M2MxLjYtMSAzLjYtMS42IDUuNS0xLjZ2LjN6bTAtNTAuNmMtMTAuOCAwLTIxLjIgMi42LTMxIDguMmwtMjk5LjYgMTczYy0xOS4yIDExLjEtMzEgMzEuMy0zMSA1My41djM0NmMwIDIyLjIgMTEuOCA0Mi40IDMxIDUzLjVsMjk5LjYgMTczYzkuNSA1LjUgMjAuMiA4LjIgMzEgOC4yczIxLjItMi42IDMxLTguMmwyOTkuNi0xNzNjMTkuMi0xMS4xIDMxLTMxLjMgMzEtNTMuNXYtMzQ2YzAtMjIuMi0xMS44LTQyLjQtMzEtNTMuNWwtMjk5LjktMTczYy05LjUtNS41LTIwLjItOC4yLTMxLTguMmguM3oiIGZpbGw9IiM5ZGNjZWQiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJtMzAxLjUgODAzLjIgMjcuOC03NS43IDU1LjUgNDYtNTEuOSA0Ny43LTMxLjQtMTh6Ii8+PHBhdGggZD0iTTQ3NC41IDMwMi4yaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOEwyMjIuOSA3NTcuNWw3OC42IDQ1LjRMNDgxLjEgMzExYzEuNi00LjYtMS42LTkuMS02LjItOS4xbC0uNC4zem0xMzMuMiAwaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOGwtMTg2IDUwOS44IDc4LjYgNDUuNEw2MTMuOSAzMTFjMS42LTQuNi0xLjYtOS4xLTYuMi05LjF2LjN6IiBmaWxsPSIjZmZmIi8+PC9zdmc+Cg==";var Up={name:"arbitrum",id:"0xa4b1",networkId:"42161",namespace:"eip155",platform:"evm",label:"Arbitrum",fullName:"Arbitrum One",logo:Bp,logoBackgroundColor:"#2b354d",logoWhiteBackground:Bp,currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Sp.currency.logo},wrapped:{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",logo:Sp.wrapped.logo},stables:{usd:["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"]},explorer:"https://arbiscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://arbiscan.io/tx/${e.id||e}`:t?`https://arbiscan.io/token/${t}`:n?`https://arbiscan.io/address/${n}`:void 0,endpoints:["https://arbitrum.blockpi.network/v1/rpc/public","https://arbitrum-one.publicnode.com","https://endpoints.omniatech.io/v1/arbitrum/one/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Sp.currency.logo,type:"NATIVE"},{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Sp.wrapped.logo,type:"20"},{address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8/logo.png",type:"20"},{address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1/logo.png",type:"20"},{address:"0x912CE59144191C1204E64559FE8253a0e49E6548",symbol:"ARB",name:"Arbitrum",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x912CE59144191C1204E64559FE8253a0e49E6548/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Wp="https://traderjoexyz.com/static/media/avalanche.7c81486190237e87e238c029fd746008.svg",Qp="https://raw.githubusercontent.com/traderjoe-xyz/joe-tokenlists/main/logos/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7/logo.png";var Yp={name:"avalanche",id:"0xa86a",networkId:"43114",namespace:"eip155",platform:"evm",label:"Avalanche",fullName:"Avalanche C-Chain",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0zNTkuMSA3NTEuMWgtOTUuM2MtMjAgMC0yOS45IDAtMzYtMy44LTYuNi00LjMtMTAuNC0xMS4zLTEwLjktMTguOS0uMy03LjEgNC42LTE1LjggMTQuNC0zM2wyMzUtNDE0LjNjMTAuMS0xNy42IDE1LjEtMjYuNCAyMS40LTI5LjYgNi45LTMuNSAxNS4xLTMuNSAyMS45IDAgNi40IDMuMyAxMS40IDEyIDIxLjQgMjkuNmw0OC40IDg0LjMuMi41YzEwLjggMTguOSAxNi4zIDI4LjUgMTguNiAzOC41IDIuNiAxMC45IDIuNiAyMi42IDAgMzMuNS0yLjQgMTAuMS03LjggMTkuOC0xOC44IDM4LjlMNDU2LjIgNjk0LjlsLS4zLjVjLTEwLjggMTktMTYuMyAyOC43LTI0LjEgMzYtOC4zIDgtMTguMyAxMy43LTI5LjMgMTYuOS05LjkgMi44LTIxLjEgMi44LTQzLjQgMi44em0yNDAuMyAwaDEzNi40YzIwLjIgMCAzMC4yIDAgMzYu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DkuNiAyLjMgMTkuNiAwIDI5LjItMi4xIDguOC02LjggMTcuMi0xNi40IDM0TDQ2My42IDYyMS4ybC0uMy41Yy05LjUgMTYuNi0xNC4zIDI1LTIxIDMxLjQtNy4zIDYuOS0xNiAxMi0yNS41IDE0LjgtOC43IDIuNC0xOC41IDIuNC0zOC4xIDIuNHptMjA5LjggMGgxMTljMTcuNiAwIDI2LjQgMCAzMS43LTMuNSA1LjctMy43IDkuMi05LjkgOS42LTE2LjYuMy02LTMuOS0xMy4zLTEyLjItMjcuNWwtLjktMS41LTU5LjYtMTAyLS43LTEuMWMtOC40LTE0LjItMTIuNi0yMS4zLTE4LTI0LjEtNi0zLTEzLjEtMy0xOSAwLTUuNSAyLjgtOS45IDEwLjMtMTguNiAyNS4zbC01OS40IDEwMi0uMi40Yy04LjcgMTUtMTMgMjIuNS0xMi43IDI4LjcuNCA2LjcgMy45IDEyLjkgOS42IDE2LjYgNSAzLjMgMTMuOCAzLjMgMzEuNCAzLjN6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2U4NDE0MiIvPjwvc3ZnPg==",currency:{name:"Avalanche",symbol:"AVAX",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Wp},wrapped:{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",logo:Qp},stables:{usd:["0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7","0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"]},explorer:"https://snowtrace.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://snowtrace.io/tx/${e.id||e}`:t?`https://snowtrace.io/token/${t}`:n?`https://snowtrace.io/address/${n}`:void 0,endpoints:["https://avalanche.public-rpc.com","https://avalanche.blockpi.network/v1/rpc/public","https://avax.meowrpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"AVAX",name:"Avalanche",decimals:18,logo:Wp,type:"NATIVE"},{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",symbol:"WAVAX",name:"Wrapped AVAX",decimals:18,logo:Qp,type:"20"},{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7/logo.png",type:"20"},{address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E/logo.png",type:"20"},{address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70/logo.png",type:"20"},{address:"0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Fp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAC7CAMAAAAKTh9YAAAAYFBMVEVHcEz////////////////////////////////////j++ma6qVj5nsl5lAK4zpA6mXO79aD8Zyr87uCvq0J2TkItEkOhl4EeVsKzSwLrxMNtQpjsZG42dEeuxyF2oU6wzjPwJjeAAAACnRSTlMAEUB9r9j/YO+Kf6/iMwAABD1JREFUeAHU1EESQjEMAlBIAq33v7ArV7+OLss7AZOB4IDV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DYhfOkNiFMyj2OQhhvzkPIeYhhO105zr28G0IYTsVfuRBYQZC2C7EjKdn7RK7sJ+HaQ+lKHaZtwu7lWhkn5mk0GV0Fzabps4r6+xh+AqEsNdx+k8l9gAnIFMZYaNQH0c682I0mFdip6lMGP4KQthGhdPxmyunCwSYhIzuwjZlvBC/uRK7jO7CNkqHPjM5F/9x9YlgNLqHcq6MsAB1fPrFiep3rY6dRncvPAYhuKvTsV/zQef+MYedDyr9GDAGITii6cvpyeO1727kwI9f048FRyEEK+EJnJl8rN7fNL54oxwco5NnIAQX1GsZDafhat0bj44PwlMn9UeNQgiTUehB+Mit01/qWv+yPLohfQKoExDCWHrq0iR0sv7IXu3g+ARC9TyEMEn0ZHT1EmPjD23FwfExBOplfathCJEnWken5cXTk9MbvUlrscdklBd5oWumPX2kv6QPgDaZtqzVXuxkdHwYvtLR42EZ6UXqOog81n7s1faPP6k/0xNyIEokigJX4Yx+/Up0GnqbkceSiT1GS5UFvUwZYEx/5n36ixzW/8SgjPyiqeicrHC+sgGAmtGRvx1dMtph4NW+AiZycfiu2QTRAAAAAElFTkSuQmCC";var Hp={name:"gnosis",id:"0x64",networkId:"100",namespace:"eip155",label:"Gnosis",fullName:"Gnosis Chain",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbDojZmZmfTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MCIgZD0iTTMzMS45IDU1Ni41YzIzLjUgMCA0Ni40LTcuOCA2NS0yMi4yTDI0OCAzODUuNGMtMzUuOSA0Ni40LTI3LjQgMTEyLjkgMTguOSAxNDguOCAxOC42IDE0IDQxLjUgMjEuOSA2NSAyMS45di40em00NDIuMy0xMDYuMWMwLTIzLj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TAwIDEyOWM5OS43IDAgMTkyLjUgMzguNiAyNjIuNSAxMDguNUw1MDAgNTAwIDIzNy41IDIzNy41QzMwNy4yIDE2Ny4yIDQwMC4zIDEyOSA1MDAgMTI5eiIvPjwvc3ZnPgo=",currency:{name:"xDAI",symbol:"xDAI",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Fp},wrapped:{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",logo:Vp},stables:{usd:["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83"]},explorer:"https://gnosisscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://gnosisscan.io/tx/${e.id||e}`:t?`https://gnosisscan.io/token/${t}`:n?`https://gnosisscan.io/address/${n}`:void 0,endpoints:["https://rpc.gnosis.gateway.fm","https://rpc.gnosischain.com","https://gnosis.blockpi.network/v1/rpc/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"xDAI",name:"xDAI",decimals:18,logo:Fp,type:"NATIVE"},{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",symbol:"WXDAI",name:"Wrapped XDAI",decimals:18,logo:Vp,type:"20"},{address:"0x4ECaBa5870353805a9F068101A40E0f32ed605C6",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",symbol:"GNO",name:"Gnosis",decimals:18,logo:"https://cdn.sushi.com/image/upload/f_auto,c_limit,w_16,q_auto/tokens/100/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb.jpg",type:"20"},{address:"0xD057604A14982FE8D88c5fC25Aac3267eA142a08",symbol:"HOPR",name:"HOPR",decimals:18,logo:"https://hoprnet.org/assets/icons/hopr_icon.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var Gp={name:"optimism",id:"0xa",networkId:"10",namespace:"eip155",label:"Optimism",fullName:"Optimism",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00ODcuMSAzOTUuN2MtNS4yLTE1LjgtMTMuMi0zMS43LTI2LjQtNDIuMi0xMy4yLTEwLjUtMjYuNC0yMS4yLTQ0LjktMjYuNC0xOC41LTUuMi0zNy04LTU4LjEtOC00Ny41IDAtODcuMSAxMC41LTExNi4xIDM0LjQtMjkgMjMuOC00Ny41IDU4LjEtNjAuNyAxMDIuOS0yLjYgMTUuOC04IDI5LTEwLjUgNDQuOS0yLjYgMTMuMi01LjIgMjktOCA0Mi4yLTIuNiAyMy44LTIuNiA0Mi4yIDIuNiA2MC43IDUuMiAxNS44IDEzLjIgMzEuNyAyNi40IDQyLjIgMTMuMiAxMC41IDI2LjQgMjEuMiA0NC45IDI2LjQgMTguNCA1LjIgMzcgOCA1OC4xIDggNDcuNSAwIDg3LjEtMTAuNSAxMTYuMS0zNC40czQ3LjUtNTguMSA2MC43LTEwMi45YzIuNi0xMy4yIDUuMi0yOSAxMC41LTQyLjIgMi42LTEzLjIgNS4yLTI5IDgtNDQuOSAyLjgtMjMuOCAyLjgtNDQuOC0yLjYtNjAuN3ptLTkyLjQgNjAuOGMtMi42IDEzLjItNS4yID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.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Sp.wrapped.logo},stables:{usd:["0x94b008aA00579c1307B0EF2c499aD98a8ce58e58","0x7F5c764cBc14f9669B88837ca1490cCa17c31607"]},explorer:"https://optimistic.etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://optimistic.etherscan.io/tx/${e.id||e}`:t?`https://optimistic.etherscan.io/token/${t}`:n?`https://optimistic.etherscan.io/address/${n}`:void 0,endpoints:["https://optimism.blockpi.network/v1/rpc/public","https://optimism.meowrpc.com","https://optimism.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Sp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Sp.wrapped.logo,type:"20"},{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58/logo.png",type:"20"},{address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x7F5c764cBc14f9669B88837ca1490cCa17c31607/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x4200000000000000000000000000000000000042",symbol:"OP",name:"Optimism",decimals:18,logo:"https://user-images.githubusercontent.com/1300064/219575413-d7990d69-1d21-44ef-a2b1-e9c682c79802.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var qp={name:"base",id:"0x2105",networkId:"8453",namespace:"eip155",label:"Base",fullName:"Base",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguNiA4NDJDNjg4IDg0MiA4NDIgNjg4LjkgODQyIDQ5OS41UzY4OCAxNTcgNDk4LjYgMTU3QzMxOSAxNTcgMTcxLjIgMjk1LjEgMTU3IDQ3MC4zaDQ1My4xdjU3LjVIMTU3QzE3MiA3MDMuOSAzMTkgODQyIDQ5OC42IDg0MnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",logoBackgroundColor:"#0052FF",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguOSA4NDVDNjkwLjEgODQ1IDg0NSA2OTAuMyA4NDUgNDk5LjVTNjkwLjEgMTU0IDQ5OC45IDE1NEMzMTcuNiAxNTQgMTY4LjggMjkzLjMgMTU0IDQ3MC41aDQ1Ny40djU4LjFIMTU0QzE2OC44IDcwNS44IDMxNy42IDg0NSA0OTguOSA4NDV6IiBmaWxsPSIjMDA1MmZmIi8+PC9zdmc+",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Sp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Sp.wrapped.logo},stables:{usd:["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"]},explorer:"https://basescan.org",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://basescan.org/tx/${e.id||e}`:t?`https://basescan.org/token/${t}`:n?`https://basescan.org/address/${n}`:void 0,endpoints:["https://base.blockpi.network/v1/rpc/public","https://base.meowrpc.com","https://mainnet.base.org"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Sp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Sp.wrapped.logo,type:"20"},{address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",symbol:"USDbC",name:"USD Base Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Zp=[Sp,kp,zp,Rp,Cp,Up,Yp,Hp,Gp,qp];var Jp={ethereum:Sp,bsc:kp,polygon:zp,solana:Rp,fantom:Cp,arbitrum:Up,avalanche:Yp,gnosis:Hp,optimism:Gp,base:qp,all:Zp,findById:function(e){let t=e;return t.match("0x0")&&(t=t.replace(/0x0+/,"0x")),Zp.find((e=>e.id&&e.id.toLowerCase()==t.toLowerCase()))},findByNetworkId:function(e){return e=e.toString(),Zp.find((t=>t.networkId==e))},findByName:function(e){return Zp.find((t=>t.name==e))}},Xp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $p(e){var t={exports:{}};return e(t,t.exports),t.exports}for(var ef=function(e){var t=lf(e),n=t[0],r=t[1];return 3*(n+r)/4-r},tf=function(e){var t,n,r=lf(e),i=r[0],o=r[1],a=new af(function(e,t,n){return 3*(t+n)/4-n}(0,i,o)),s=0,u=o>0?i-4:i;for(n=0;n>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=of[e.charCodeAt(n)]<<2|of[e.charCodeAt(n+1)]>>4,a[s++]=255&t);1===o&&(t=of[e.charCodeAt(n)]<<10|of[e.charCodeAt(n+1)]<<4|of[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},nf=function(e){for(var t,n=e.length,r=n%3,i=[],o=16383,a=0,s=n-r;as?s:a+o));1===r?(t=e[n-1],i.push(rf[t>>2]+rf[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(rf[t>>10]+rf[t>>4&63]+rf[t<<2&63]+"="));return i.join("")},rf=[],of=[],af="undefined"!=typeof Uint8Array?Uint8Array:Array,sf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uf=0,cf=sf.length;uf0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function df(e,t,n){for(var r,i,o=[],a=t;a>18&63]+rf[i>>12&63]+rf[i>>6&63]+rf[63&i]);return o.join("")}of["-".charCodeAt(0)]=62,of["_".charCodeAt(0)]=63;var hf={byteLength:ef,toByteArray:tf,fromByteArray:nf},pf=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},ff=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=f,a/=256,c-=8);e[n+p-f]|=128*y},yf=$p((function(e,t){var n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},t.INSPECT_MAX_BYTES=50;var r=2147483647;function i(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|h(e,t),r=i(n),a=r.write(e,t);a!==n&&(r=r.slice(0,a));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(R(e,Uint8Array)){var t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(R(e,ArrayBuffer)||e&&R(e.buffer,ArrayBuffer))return l(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(R(e,SharedArrayBuffer)||e&&R(e.buffer,SharedArrayBuffer)))return l(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,n);var a=function(e){if(o.isBuffer(e)){var t=0|d(e.length),n=i(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||B(e.length)?i(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return s(e),i(e<0?0:0|d(e))}function c(e){for(var t=e.length<0?0:0|d(e.length),n=i(t),r=0;r=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||R(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return _(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var d=!0,h=0;hi&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?hf.fromByteArray(e):hf.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?o.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else{if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,n,r,i){if(R(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(a,s),c=this.slice(r,i),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":case"latin1":case"binary":return b(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function S(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function C(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,4),ff(e,t,n,r,23,4),n+4}function D(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,8),ff(e,t,n,r,52,8),n+8}o.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),pf(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),pf(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),pf(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),pf(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||S(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r)||S(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,n){return C(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return C(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function _(e){return hf.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function P(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function R(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function B(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()})),mf=$p((function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:yf.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=s(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var d=["","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"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return m(e,t,n)}Math.imul||(y=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?f(this,e,t):n<1024?m(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new T(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function N(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(w,b),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new N(e)},r(N,T),N.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},N.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},N.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},N.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,Xp)})); /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */let gf=!1,vf=!1;const bf={debug:1,default:2,info:2,warning:3,error:4,off:5};let wf=bf.default,Mf=null;const Af=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Ef,Tf;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Ef||(Ef={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Tf||(Tf={}));const Nf="0123456789abcdef";class If{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==bf[n]&&this.throwArgumentError("invalid log level name","logLevel",e),wf>bf[n]||console.log.apply(console,t)}debug(...e){this._log(If.levels.DEBUG,e)}info(...e){this._log(If.levels.INFO,e)}warn(...e){this._log(If.levels.WARNING,e)}makeError(e,t,n){if(vf)return this.makeError("censored error",t,{});t||(t=If.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e>4],n+=Nf[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(t){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const i=e;let o="";switch(t){case Tf.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case Tf.CALL_EXCEPTION:case Tf.INSUFFICIENT_FUNDS:case Tf.MISSING_NEW:case Tf.NONCE_EXPIRED:case Tf.REPLACEMENT_UNDERPRICED:case Tf.TRANSACTION_REPLACED:case Tf.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(n).forEach((function(e){a[e]=n[e]})),a}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,If.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){Af&&this.throwError("platform missing String.prototype.normalize",If.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Af})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,If.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,If.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",et&&this.throwError("too many arguments"+n,If.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",If.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",If.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",If.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Mf||(Mf=new If("logger/5.7.0")),Mf}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",If.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),gf){if(!e)return;this.globalLogger().throwError("error censorship permanent",If.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}vf=!!e,gf=!!t}static setLogLevel(e){const t=bf[e.toLowerCase()];null!=t?wf=t:If.globalLogger().warn("invalid log level - "+e)}static from(e){return new If(e)}}If.errors=Tf,If.levels=Ef;const kf=new If("bytes/5.7.0");function Lf(e){return!!e.toHexString}function xf(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return xf(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Sf(e){return Pf(e)&&!(e.length%2)||Cf(e)}function jf(e){return"number"==typeof e&&e==e&&e%1==0}function Cf(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!jf(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Df(e,t){if(t||(t={}),"number"==typeof e){kf.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),xf(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Lf(e)&&(e=e.toHexString()),Pf(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":kf.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;eDf(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),xf(r)}function zf(e){let t=Df(e);if(0===t.length)return t;let n=0;for(;nt&&kf.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),xf(n)}function Pf(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function Rf(e,t){if(t||(t={}),"number"==typeof e){kf.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t="0123456789abcdef"[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Lf(e))return e.toHexString();if(Pf(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":kf.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(Cf(e)){let t="0x";for(let n=0;n>4]+"0123456789abcdef"[15&r]}return t}return kf.throwArgumentError("invalid hexlify value","value",e)}function Bf(e){if("string"!=typeof e)e=Rf(e);else if(!Pf(e)||e.length%2)return null;return(e.length-2)/2}function Uf(e,t,n){return"string"!=typeof e?e=Rf(e):(!Pf(e)||e.length%2)&&kf.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function Wf(e){let t="0x";return e.forEach((e=>{t+=Rf(e).substring(2)})),t}function Qf(e){const t=function(e){"string"!=typeof e&&(e=Rf(e));Pf(e)||kf.throwArgumentError("invalid hex string","value",e);e=e.substring(2);let t=0;for(;t2*t+2&&kf.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Ff(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Sf(e)){let n=Df(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=Rf(n.slice(0,32)),t.s=Rf(n.slice(32,64))):65===n.length?(t.r=Rf(n.slice(0,32)),t.s=Rf(n.slice(32,64)),t.v=n[64]):kf.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:kf.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=Rf(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=_f(Df(t._vs),32);t._vs=Rf(n);const r=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&kf.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const i=Rf(n);null==t.s?t.s=i:t.s!==i&&kf.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?kf.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&kf.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Pf(t.r)?t.r=Yf(t.r,32):kf.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Pf(t.s)?t.s=Yf(t.s,32):kf.throwArgumentError("signature missing or invalid s","signature",e);const n=Df(t.s);n[0]>=128&&kf.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const r=Rf(n);t._vs&&(Pf(t._vs)||kf.throwArgumentError("signature invalid _vs","signature",e),t._vs=Yf(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&kf.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}var Vf=mf.BN;const Hf=new If("bignumber/5.7.0"),Gf={};let qf=!1;class Zf{constructor(e,t){e!==Gf&&Hf.throwError("cannot call constructor directly; use BigNumber.from",If.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Xf(Kf(this).fromTwos(e))}toTwos(e){return Xf(Kf(this).toTwos(e))}abs(){return"-"===this._hex[0]?Zf.from(this._hex.substring(1)):this}add(e){return Xf(Kf(this).add(Kf(e)))}sub(e){return Xf(Kf(this).sub(Kf(e)))}div(e){return Zf.from(e).isZero()&&$f("division-by-zero","div"),Xf(Kf(this).div(Kf(e)))}mul(e){return Xf(Kf(this).mul(Kf(e)))}mod(e){const t=Kf(e);return t.isNeg()&&$f("division-by-zero","mod"),Xf(Kf(this).umod(t))}pow(e){const t=Kf(e);return t.isNeg()&&$f("negative-power","pow"),Xf(Kf(this).pow(t))}and(e){const t=Kf(e);return(this.isNegative()||t.isNeg())&&$f("unbound-bitwise-result","and"),Xf(Kf(this).and(t))}or(e){const t=Kf(e);return(this.isNegative()||t.isNeg())&&$f("unbound-bitwise-result","or"),Xf(Kf(this).or(t))}xor(e){const t=Kf(e);return(this.isNegative()||t.isNeg())&&$f("unbound-bitwise-result","xor"),Xf(Kf(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&$f("negative-width","mask"),Xf(Kf(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&$f("negative-width","shl"),Xf(Kf(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&$f("negative-width","shr"),Xf(Kf(this).shrn(e))}eq(e){return Kf(this).eq(Kf(e))}lt(e){return Kf(this).lt(Kf(e))}lte(e){return Kf(this).lte(Kf(e))}gt(e){return Kf(this).gt(Kf(e))}gte(e){return Kf(this).gte(Kf(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Kf(this).isZero()}toNumber(){try{return Kf(this).toNumber()}catch(e){$f("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Hf.throwError("this platform does not support BigInt",If.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?qf||(qf=!0,Hf.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Hf.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",If.errors.UNEXPECTED_ARGUMENT,{}):Hf.throwError("BigNumber.toString does not accept parameters",If.errors.UNEXPECTED_ARGUMENT,{})),Kf(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Zf)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Zf(Gf,Jf(e)):e.match(/^-?[0-9]+$/)?new Zf(Gf,Jf(new Vf(e))):Hf.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&$f("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&$f("overflow","BigNumber.from",e),Zf.from(String(e));const t=e;if("bigint"==typeof t)return Zf.from(t.toString());if(Cf(t))return Zf.from(Rf(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Zf.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Pf(e)||"-"===e[0]&&Pf(e.substring(1))))return Zf.from(e)}return Hf.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Jf(e){if("string"!=typeof e)return Jf(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Hf.throwArgumentError("invalid hex","value",e),"0x00"===(e=Jf(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Xf(e){return Zf.from(Jf(e))}function Kf(e){const t=Zf.from(e).toHexString();return"-"===t[0]?new Vf("-"+t.substring(3),16):new Vf(t.substring(2),16)}function $f(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),Hf.throwError(e,If.errors.NUMERIC_FAULT,r)}const ey=new If("bignumber/5.7.0"),ty={},ny=Zf.from(0),ry=Zf.from(-1);function iy(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),ey.throwError(e,If.errors.NUMERIC_FAULT,i)}let oy="0";for(;oy.length<256;)oy+=oy;function ay(e){if("number"!=typeof e)try{e=Zf.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+oy.substring(0,e):ey.throwArgumentError("invalid decimal size","decimals",e)}function sy(e,t){null==t&&(t=0);const n=ay(t),r=(e=Zf.from(e)).lt(ny);r&&(e=e.mul(ry));let i=e.mod(n).toString();for(;i.length2&&ey.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>n.length-1&&iy("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?r:(typeof e[t]!==n&&ey.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&ey.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&ey.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new cy(ty,t,n,r)}}class ly{constructor(e,t,n,r){e!==ty&&ey.throwError("cannot use FixedNumber constructor; use FixedNumber.from",If.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&ey.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=uy(this._value,this.format.decimals),n=uy(e._value,e.format.decimals);return ly.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=uy(this._value,this.format.decimals),n=uy(e._value,e.format.decimals);return ly.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=uy(this._value,this.format.decimals),n=uy(e._value,e.format.decimals);return ly.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=uy(this._value,this.format.decimals),n=uy(e._value,e.format.decimals);return ly.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ly.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(dy.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ly.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(dy.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&ey.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=ly.from("1"+oy.substring(0,e),this.format),r=hy.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&ey.throwArgumentError("invalid byte width","width",e);return Yf(Zf.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ly.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||function(e){return null!=e&&(Zf.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Pf(e)||"bigint"==typeof e||Cf(e))}(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),ly.fromString(sy(e,t),cy.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=cy.from(t),r=uy(e,n.decimals);!n.signed&&r.lt(ny)&&iy("unsigned value cannot be negative","overflow","value",e);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=Yf(i,n.width/8));const o=sy(r,n.decimals);return new ly(ty,i,o,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=cy.from(t);if(Df(e).length>n.width/8)throw new Error("overflow");let r=Zf.from(e);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),o=sy(r,n.decimals);return new ly(ty,i,o,n)}static from(e,t){if("string"==typeof e)return ly.fromString(e,t);if(Cf(e))return ly.fromBytes(e,t);try{return ly.fromValue(e,0,t)}catch(e){if(e.code!==If.errors.INVALID_ARGUMENT)throw e}return ey.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const dy=ly.from(1),hy=ly.from("0.5");var py=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const fy=new If("properties/5.7.0");function yy(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function my(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function gy(e){return py(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function vy(e){const t={};for(const n in e)t[n]=e[n];return t}const by={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function wy(e){if(null==e||by[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;nAy(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&yy(t,n,Ay(r))}return t}return fy.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Ay(e){return My(e)}class Ey{constructor(e){for(const t in e)this[t]=Ay(e[t])}}const Ty=new If("abi/5.7.0"),Ny={};let Iy={calldata:!0,memory:!0,storage:!0},ky={calldata:!0,memory:!0};function Ly(e,t){if("bytes"===e||"string"===e){if(Iy[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&ky[t])return!0;return(Iy[t]||"payable"===t)&&Ty.throwArgumentError("invalid modifier","name",t),!1}function xy(e,t){for(let n in t)yy(e,n,t[n])}const Sy=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),jy=new RegExp(/^(.*)\[([0-9]*)\]$/);class Cy{constructor(e,t){e!==Ny&&Ty.throwError("use fromString",If.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),xy(this,t);let n=this.type.match(jy);xy(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Cy.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Sy.sighash),Sy[e]||Ty.throwArgumentError("invalid format type","format",e),e===Sy.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Sy.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Sy.full?", ":",")+")"):t+=this.type,e!==Sy.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Sy.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Cy.fromString(e,t):Cy.fromObject(e)}static fromObject(e){return Cy.isParamType(e)?e:new Cy(Ny,{name:e.name||null,type:Yy(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Cy.fromObject):null})}static fromString(e,t){return n=function(e,t){let n=e;function r(t){Ty.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let n=0;nCy.fromString(e,t)))}class Oy{constructor(e,t){e!==Ny&&Ty.throwError("use a static from method",If.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),xy(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Oy.isFragment(e)?e:"string"==typeof e?Oy.fromString(e):Oy.fromObject(e)}static fromObject(e){if(Oy.isFragment(e))return e;switch(e.type){case"function":return Uy.fromObject(e);case"event":return zy.fromObject(e);case"constructor":return By.fromObject(e);case"error":return Qy.fromObject(e);case"fallback":case"receive":return null}return Ty.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?zy.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Uy.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?By.fromString(e.trim()):"error"===e.split(" ")[0]?Qy.fromString(e.substring(5).trim()):Ty.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class zy extends Oy{format(e){if(e||(e=Sy.sighash),Sy[e]||Ty.throwArgumentError("invalid format type","format",e),e===Sy.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Sy.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Sy.full?", ":",")+") ",e!==Sy.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?zy.fromString(e):zy.fromObject(e)}static fromObject(e){if(zy.isEventFragment(e))return e;"event"!==e.type&&Ty.throwArgumentError("invalid event object","value",e);const t={name:Vy(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Cy.fromObject):[],type:"event"};return new zy(Ny,t)}static fromString(e){let t=e.match(Hy);t||Ty.throwArgumentError("invalid event string","value",e);let n=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:Ty.warn("unknown modifier: "+e)}})),zy.fromObject({name:t[1].trim(),anonymous:n,inputs:Dy(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function _y(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&Ty.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||Ty.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Zf.from(n[1]),n[0]):e}function Py(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Ry(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Ty.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Ty.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Ty.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Ty.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Ty.throwArgumentError("unable to determine stateMutability","value",e),t}class By extends Oy{format(e){if(e||(e=Sy.sighash),Sy[e]||Ty.throwArgumentError("invalid format type","format",e),e===Sy.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Sy.sighash&&Ty.throwError("cannot format a constructor for sighash",If.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Sy.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?By.fromString(e):By.fromObject(e)}static fromObject(e){if(By.isConstructorFragment(e))return e;"constructor"!==e.type&&Ty.throwArgumentError("invalid constructor object","value",e);let t=Ry(e);t.constant&&Ty.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Cy.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Zf.from(e.gas):null};return new By(Ny,n)}static fromString(e){let t={type:"constructor"},n=(e=_y(e,t)).match(Hy);return n&&"constructor"===n[1].trim()||Ty.throwArgumentError("invalid constructor string","value",e),t.inputs=Dy(n[2].trim(),!1),Py(n[3].trim(),t),By.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Uy extends By{format(e){if(e||(e=Sy.sighash),Sy[e]||Ty.throwArgumentError("invalid format type","format",e),e===Sy.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Sy.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Sy.full?", ":",")+") ",e!==Sy.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Uy.fromString(e):Uy.fromObject(e)}static fromObject(e){if(Uy.isFunctionFragment(e))return e;"function"!==e.type&&Ty.throwArgumentError("invalid function object","value",e);let t=Ry(e);const n={type:e.type,name:Vy(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Cy.fromObject):[],outputs:e.outputs?e.outputs.map(Cy.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Zf.from(e.gas):null};return new Uy(Ny,n)}static fromString(e){let t={type:"function"},n=(e=_y(e,t)).split(" returns ");n.length>2&&Ty.throwArgumentError("invalid function string","value",e);let r=n[0].match(Hy);if(r||Ty.throwArgumentError("invalid function signature","value",e),t.name=r[1].trim(),t.name&&Vy(t.name),t.inputs=Dy(r[2],!1),Py(r[3].trim(),t),n.length>1){let r=n[1].match(Hy);""==r[1].trim()&&""==r[3].trim()||Ty.throwArgumentError("unexpected tokens","value",e),t.outputs=Dy(r[2],!1)}else t.outputs=[];return Uy.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Wy(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Ty.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Qy extends Oy{format(e){if(e||(e=Sy.sighash),Sy[e]||Ty.throwArgumentError("invalid format type","format",e),e===Sy.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Sy.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Sy.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Qy.fromString(e):Qy.fromObject(e)}static fromObject(e){if(Qy.isErrorFragment(e))return e;"error"!==e.type&&Ty.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Vy(e.name),inputs:e.inputs?e.inputs.map(Cy.fromObject):[]};return Wy(new Qy(Ny,t))}static fromString(e){let t={type:"error"},n=e.match(Hy);return n||Ty.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Vy(t.name),t.inputs=Dy(n[2],!1),Wy(Qy.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Yy(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Fy=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Vy(e){return e&&e.match(Fy)||Ty.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Hy=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Gy=new If("abi/5.7.0");class qy{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){Gy.throwArgumentError(e,this.localName,t)}}class Zy{constructor(e){yy(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Wf(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Of(e._data))}writeBytes(e){let t=Df(e);const n=t.length%this.wordSize;return n&&(t=Of([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=Df(Zf.from(e));return t.length>this.wordSize&&Gy.throwError("value out-of-bounds",If.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Of([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class Jy{constructor(e,t,n,r){yy(this,"_data",Df(e)),yy(this,"wordSize",t||32),yy(this,"_coerceFunc",n),yy(this,"allowLoose",r),this._offset=0}get data(){return Rf(this._data)}get consumed(){return this._offset}static coerce(e,t){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):Jy.coerce(e,t)}_peekBytes(e,t,n){let r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?r=t:Gy.throwError("data out-of-bounds",If.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}subReader(e){return new Jy(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}readValue(){return Zf.from(this.readBytes(this.wordSize))}}var Xy=$p((function(e){!function(){var t="input is invalid type",n="object"==typeof window,r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof k&&k.versions&&k.versions.node?r=Xp:i&&(r=self);var o=!r.JS_SHA3_NO_COMMON_JS&&e.exports,a=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),u=[4,1024,262144,67108864],c=[0,8,16,24],l=[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],d=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],f={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var y=function(e,t,n){return function(r){return new j(e,t,e).update(r)[n]()}},m=function(e,t,n){return function(r,i){return new j(e,t,i).update(r)[n]()}},g=function(e,t,n){return function(t,r,i,o){return A["cshake"+e].update(t,r,i,o)[n]()}},v=function(e,t,n){return function(t,r,i,o){return A["kmac"+e].update(t,r,i,o)[n]()}},b=function(e,t,n,r){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function C(e,t,n){j.call(this,e,t,n)}j.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var i,o,s=this.blocks,u=this.byteCount,l=e.length,d=this.blockCount,h=0,p=this.s;h>2]|=e[h]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(s[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(this.start=i-u,this.block=s[d],i=0;i>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},j.prototype.encodeString=function(e){var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var i=0,o=e.length;if(n)i=o;else for(var s=0;s=57344?i+=3:(u=65536+((1023&u)<<10|1023&e.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(e),i},j.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];a%t==0&&(D(n),o=0)}return i&&(e=n[o],u+=s[e>>4&15]+s[15&e],i>1&&(u+=s[e>>12&15]+s[e>>8&15]),i>2&&(u+=s[e>>20&15]+s[e>>16&15])),u},j.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n==0&&D(r)}return o&&(e=s<<2,t=r[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},C.prototype=new j,C.prototype.finalize=function(){return this.encode(this.outputBits,!0),j.prototype.finalize.call(this)};var D=function(e){var t,n,r,i,o,a,s,u,c,d,h,p,f,y,m,g,v,b,w,M,A,E,T,N,I,k,L,x,S,j,C,D,O,z,_,P,R,B,U,W,Q,Y,F,V,H,G,q,Z,J,X,K,$,ee,te,ne,re,ie,oe,ae,se,ue,ce,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(p=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),n=(f=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|c>>>31),n=o^(c<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(d<<1|h>>>31),n=s^(h<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(p<<1|f>>>31),n=c^(f<<1|p>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(i<<1|o>>>31),n=h^(o<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,y=e[0],m=e[1],G=e[11]<<4|e[10]>>>28,q=e[10]<<4|e[11]>>>28,x=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,F=e[41]<<18|e[40]>>>14,z=e[2]<<1|e[3]>>>31,_=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,j=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,P=e[14]<<6|e[15]>>>26,R=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,K=e[35]<<15|e[34]>>>17,D=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,N=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,M=e[36]<<21|e[37]>>>11,A=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,H=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,L=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,W=e[38]<<8|e[39]>>>24,Q=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=y^~g&b,e[1]=m^~v&w,e[10]=N^~k&x,e[11]=I^~L&S,e[20]=z^~P&B,e[21]=_^~R&U,e[30]=V^~G&Z,e[31]=H^~q&J,e[40]=te^~re&oe,e[41]=ne^~ie&ae,e[2]=g^~b&M,e[3]=v^~w&A,e[12]=k^~x&j,e[13]=L^~S&C,e[22]=P^~B&W,e[23]=R^~U&Q,e[32]=G^~Z&X,e[33]=q^~J&K,e[42]=re^~oe&se,e[43]=ie^~ae&ue,e[4]=b^~M&E,e[5]=w^~A&T,e[14]=x^~j&D,e[15]=S^~C&O,e[24]=B^~W&Y,e[25]=U^~Q&F,e[34]=Z^~X&$,e[35]=J^~K&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&le,e[6]=M^~E&y,e[7]=A^~T&m,e[16]=j^~D&N,e[17]=C^~O&I,e[26]=W^~Y&z,e[27]=Q^~F&_,e[36]=X^~$&V,e[37]=K^~ee&H,e[46]=se^~ce&te,e[47]=ue^~le&ne,e[8]=E^~y&g,e[9]=T^~m&v,e[18]=D^~N&k,e[19]=O^~I&L,e[28]=Y^~z&P,e[29]=F^~_&R,e[38]=$^~V&G,e[39]=ee^~H&q,e[48]=ce^~te&re,e[49]=le^~ne&ie,e[0]^=l[r],e[1]^=l[r+1]};if(o)e.exports=A;else for(T=0;T>=8;return t}function tm(e,t,n){let r=0;for(let i=0;it+1+r&&$y.throwError("child data too short",If.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function om(e,t){if(0===e.length&&$y.throwError("data too short",If.errors.BUFFER_OVERRUN,{}),e[t]>=248){const n=e[t]-247;t+1+n>e.length&&$y.throwError("data short segment too short",If.errors.BUFFER_OVERRUN,{});const r=tm(e,t+1,n);return t+1+n+r>e.length&&$y.throwError("data long segment too short",If.errors.BUFFER_OVERRUN,{}),im(e,t,t+1+n,n+r)}if(e[t]>=192){const n=e[t]-192;return t+1+n>e.length&&$y.throwError("data array too short",If.errors.BUFFER_OVERRUN,{}),im(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;t+1+n>e.length&&$y.throwError("data array too short",If.errors.BUFFER_OVERRUN,{});const r=tm(e,t+1,n);t+1+n+r>e.length&&$y.throwError("data array too short",If.errors.BUFFER_OVERRUN,{});return{consumed:1+n+r,result:Rf(e.slice(t+1+n,t+1+n+r))}}if(e[t]>=128){const n=e[t]-128;t+1+n>e.length&&$y.throwError("data too short",If.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:Rf(e.slice(t+1,t+1+n))}}return{consumed:1,result:Rf(e[t])}}function am(e){const t=Df(e),n=om(t,0);return n.consumed!==t.length&&$y.throwArgumentError("invalid rlp data","data",e),n.result}const sm=new If("address/5.7.0");function um(e){Pf(e,20)||sm.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);const r=Df(Ky(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&r[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const cm={};for(let e=0;e<10;e++)cm[String(e)]=String(e);for(let e=0;e<26;e++)cm[String.fromCharCode(65+e)]=String(10+e);const lm=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function dm(e){let t=null;if("string"!=typeof e&&sm.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=um(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&sm.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>cm[e])).join("");for(;t.length>=lm;){let e=t.substring(0,lm);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}(e)&&sm.throwArgumentError("bad icap checksum","address",e),n=e.substring(4),t=new Vf(n,36).toString(16);t.length<40;)t="0"+t;t=um("0x"+t)}else sm.throwArgumentError("invalid address","address",e);var n;return t}function hm(e){let t=null;try{t=dm(e.from)}catch(t){sm.throwArgumentError("missing from address","transaction",e)}return dm(Uf(Ky(rm([t,zf(Df(Zf.from(e.nonce).toHexString()))])),12))}class pm extends qy{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=dm(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return dm(Yf(e.readValue().toHexString(),20))}}class fm extends qy{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const ym=new If("abi/5.7.0");function mm(e,t,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let e={};r=t.map((t=>{const r=t.localName;return r||ym.throwError("cannot encode object for signature with missing names",If.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]&&ym.throwError("cannot encode object for signature with duplicate names",If.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]=!0,n[r]}))}else ym.throwArgumentError("invalid tuple value","tuple",n);t.length!==r.length&&ym.throwArgumentError("types/value length mismatch","tuple",n);let i=new Zy(e.wordSize),o=new Zy(e.wordSize),a=[];t.forEach(((e,t)=>{let n=r[t];if(e.dynamic){let t=o.length;e.encode(o,n);let r=i.writeUpdatableValue();a.push((e=>{r(e+t)}))}else e.encode(i,n)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function gm(e,t){let n=[],r=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let n=e.readValue(),o=r.subReader(n.toNumber());try{i=t.decode(o)}catch(e){if(e.code===If.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===If.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&n.push(i)}));const i=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let r=e.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[t];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let e=0;e{throw t}})}return Object.freeze(n)}class vm extends qy{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;ne._data.length&&ym.throwError("insufficient data length",If.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let e=0;e>6==2;r++)e++;return e}return e===jm.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Sm||(Sm={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(jm||(jm={}));const Dm=Object.freeze({error:function(e,t,n,r,i){return xm.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:Cm,replace:function(e,t,n,r,i){return e===jm.OVERLONG?(r.push(i),0):(r.push(65533),Cm(e,t,n))}});function Om(e,t){null==t&&(t=Dm.error),e=Df(e);const n=[];let r=0;for(;r>7==0){n.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){r+=t(128==(192&i)?jm.UNEXPECTED_CONTINUE:jm.BAD_PREFIX,r-1,e,n);continue}o=3,a=65535}if(r-1+o>=e.length){r+=t(jm.OVERRUN,r-1,e,n);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?r+=t(jm.OUT_OF_RANGE,r-1-o,e,n,s):s>=55296&&s<=57343?r+=t(jm.UTF16_SURROGATE,r-1-o,e,n,s):s<=a?r+=t(jm.OVERLONG,r-1-o,e,n,s):n.push(s))}return n}function zm(e,t=Sm.current){t!=Sm.current&&(xm.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&r)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return Df(n)}function _m(e,t){return Om(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}class Pm extends wm{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,zm(t))}decode(e){return _m(super.decode(e))}}class Rm extends qy{constructor(e,t){let n=!1;const r=[];e.forEach((e=>{e.dynamic&&(n=!0),r.push(e.type)}));super("tuple","tuple("+r.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[r]))})),Object.freeze(e)}encode(e,t){return mm(e,this.coders,t)}decode(e){return e.coerce(this.name,gm(e,this.coders))}}const Bm=new If("abi/5.7.0"),Um=new RegExp(/^bytes([0-9]*)$/),Wm=new RegExp(/^(u?int)([0-9]*)$/);const Qm=new class{constructor(e){yy(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new pm(e.name);case"bool":return new bm(e.name);case"string":return new Pm(e.name);case"bytes":return new Mm(e.name);case"array":return new vm(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Rm((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Em(e.name)}let t=e.type.match(Wm);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!=0)&&Bm.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Lm(n/8,"int"===t[1],e.name)}if(t=e.type.match(Um),t){let n=parseInt(t[1]);return(0===n||n>32)&&Bm.throwArgumentError("invalid bytes length","param",e),new Am(n,e.name)}return Bm.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Jy(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Zy(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Cy.from(e))));return new Rm(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Bm.throwError("types/values length mismatch",If.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(Cy.from(e)))),r=new Rm(n,"_"),i=this._getWriter();return r.encode(i,t),i.data}decode(e,t,n){const r=e.map((e=>this._getCoder(Cy.from(e))));return new Rm(r,"_").decode(this._getReader(Df(t),n))}};function Ym(e){return Ky(zm(e))}function Fm(e){e=atob(e);const t=[];for(let n=0;n0&&Array.isArray(e)?i(e,t-1):n.push(e)}))};return i(e,t),n}function Gm(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),i=1,o=[0,1];for(let e=1;e>--u&1}const d=Math.pow(2,31),h=d>>>1,p=h>>1,f=d-1;let y=0;for(let e=0;e<31;e++)y=y<<1|l();let m=[],g=0,v=d;for(;;){let e=Math.floor(((y-g+1)*i-1)/v),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e>>1|l(),a=a<<1^h,s=(s^h)<<1|h|1;g=a,v=1+s-a}let b=r-4;return m.map((t=>{switch(t-b){case 3:return b+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return b+256+(e[s++]<<8|e[s++]);case 1:return b+e[s++];default:return t-1}}))}(e))}function qm(e){return 1&e?~e>>1:e>>1}function Zm(e,t){let n=Array(e);for(let r=0,i=-1;rt[e])):n}function Km(e,t,n){let r=Array(e).fill(void 0).map((()=>[]));for(let i=0;ir[t].push(e)));return r}function $m(e,t){let n=1+t(),r=t(),i=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(n)}return t}(t);return Hm(Km(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*r;return[o+t*n,a.map((e=>e+i))]}))})))}function eg(e,t){return Km(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const tg=Gm(Fm("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/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CUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),ng=new Set(Xm(tg)),rg=new Set(Xm(tg)),ig=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push($m(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(eg(n,e))}return function(e){const t={};for(let n=0;ne-t));return function n(){let r=[];for(;;){let i=Xm(e,t);if(0==i.length)break;r.push({set:new Set(i),node:n()})}r.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:r,valid:o,fe0f:a,save:1==i,check:2==i}}()}(tg);function ag(e){return function(e,t=Sm.current){return Om(zm(e,t))}(e)}function sg(e){return e.filter((e=>65039!=e))}function ug(e){for(let t of e.split(".")){let e=ag(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function cg(e){return ug(function(e,t){let n=ag(e).reverse(),r=[];for(;n.length;){let e=lg(n);if(e){r.push(...t(e));continue}let i=n.pop();if(ng.has(i)){r.push(i);continue}if(rg.has(i))continue;let o=ig[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);r.push(...o)}return ug(function(e){return e.normalize("NFC")}(String.fromCodePoint(...r)))}(e,sg))}function lg(e,t){var n;let r,i,o=og,a=[],s=e.length;for(t&&(t.length=0);s;){let u=e[--s];if(o=null===(n=o.branches.find((e=>e.set.has(u))))||void 0===n?void 0:n.node,!o)break;if(o.save)i=u;else if(o.check&&u===i)break;a.push(u),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(r=a.slice(),2==o.valid&&r.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return r}const dg=new If("hash/5.7.0"),hg=new Uint8Array(32);function pg(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function fg(e){const t=zm(cg(e)),n=[];if(0===e.length)return n;let r=0;for(let e=0;e=t.length)throw new Error("invalid ENS name; empty component");return n.push(pg(t.slice(r))),n}function yg(e){"string"!=typeof e&&dg.throwArgumentError("invalid ENS name; not a string","name",e);let t=hg;const n=fg(e);for(;n.length;)t=Ky(Of([t,Ky(n.pop())]));return Rf(t)}hg.fill(0);var mg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const gg=new If("hash/5.7.0"),vg=new Uint8Array(32);vg.fill(0);const bg=Zf.from(-1),wg=Zf.from(0),Mg=Zf.from(1),Ag=Zf.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Eg=Yf(Mg.toHexString(),32),Tg=Yf(wg.toHexString(),32),Ng={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Ig=["name","version","chainId","verifyingContract","salt"];function kg(e){return function(t){return"string"!=typeof t&&gg.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const Lg={name:kg("name"),version:kg("version"),chainId:function(e){try{return Zf.from(e).toString()}catch(e){}return gg.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return dm(e).toLowerCase()}catch(e){}return gg.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Df(e);if(32!==t.length)throw new Error("bad length");return Rf(t)}catch(e){}return gg.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function xg(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const n=""===t[1],r=parseInt(t[2]||"256");(r%8!=0||r>256||t[2]&&t[2]!==String(r))&&gg.throwArgumentError("invalid numeric width","type",e);const i=Ag.mask(n?r-1:r),o=n?i.add(Mg).mul(bg):wg;return function(t){const n=Zf.from(t);return(n.lt(o)||n.gt(i))&&gg.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),Yf(n.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return(0===n||n>32||t[1]!==String(n))&&gg.throwArgumentError("invalid bytes width","type",e),function(t){return Df(t).length!==n&&gg.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Df(e),n=t.length%32;return n?Wf([t,vg.slice(n)]):Rf(t)}(t)}}}switch(e){case"address":return function(e){return Yf(dm(e),32)};case"bool":return function(e){return e?Eg:Tg};case"bytes":return function(e){return Ky(e)};case"string":return function(e){return Ym(e)}}return null}function Sg(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class jg{constructor(e){yy(this,"types",Object.freeze(Ay(e))),yy(this,"_encoderCache",{}),yy(this,"_types",{});const t={},n={},r={};Object.keys(e).forEach((e=>{t[e]={},n[e]=[],r[e]={}}));for(const r in e){const i={};e[r].forEach((o=>{i[o.name]&&gg.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===r&&gg.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);xg(a)||(n[a]||gg.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),n[a].push(r),t[r][a]=!0)}))}const i=Object.keys(n).filter((e=>0===n[e].length));0===i.length?gg.throwArgumentError("missing primary type","types",e):i.length>1&&gg.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),yy(this,"primaryType",i[0]),function i(o,a){a[o]&&gg.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{n[e]&&(i(e,a),Object.keys(a).forEach((t=>{r[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in r){const n=Object.keys(r[t]);n.sort(),this._types[t]=Sg(t,e[t])+n.map((t=>Sg(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=xg(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],n=this.getEncoder(e),r=parseInt(t[3]);return t=>{r>=0&&t.length!==r&&gg.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(n);return this._types[e]&&(i=i.map(Ky)),Ky(Wf(i))}}const n=this.types[e];if(n){const t=Ym(this._types[e]);return e=>{const r=n.map((({name:t,type:n})=>{const r=this.getEncoder(n)(e[t]);return this._types[n]?Ky(r):r}));return r.unshift(t),Wf(r)}}return gg.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||gg.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Ky(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(xg(e))return n(e,t);const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const e=r[1],i=parseInt(r[3]);return i>=0&&t.length!==i&&gg.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,n)))}const i=this.types[e];return i?i.reduce(((e,{name:r,type:i})=>(e[r]=this._visit(i,t[r],n),e)),{}):gg.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new jg(e)}static getPrimaryType(e){return jg.from(e).primaryType}static hashStruct(e,t,n){return jg.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){const r=Ng[n];r||gg.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:r})}return t.sort(((e,t)=>Ig.indexOf(e.name)-Ig.indexOf(t.name))),jg.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return Wf(["0x1901",jg.hashDomain(e),jg.from(t).hash(n)])}static hash(e,t,n){return Ky(jg.encode(e,t,n))}static resolveNames(e,t,n,r){return mg(this,void 0,void 0,(function*(){e=vy(e);const i={};e.verifyingContract&&!Pf(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=jg.from(t);o.visit(n,((e,t)=>("address"!==e||Pf(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield r(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=o.visit(n,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:n}}))}static getPayload(e,t,n){jg.hashDomain(e);const r={},i=[];Ig.forEach((t=>{const n=e[t];null!=n&&(r[t]=Lg[t](n),i.push({name:t,type:Ng[t]}))}));const o=jg.from(t),a=vy(t);return a.EIP712Domain?gg.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(n),{types:a,domain:r,primaryType:o.primaryType,message:o.visit(n,((e,t)=>{if(e.match(/^bytes(\d*)/))return Rf(Df(t));if(e.match(/^u?int/))return Zf.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&gg.throwArgumentError("invalid string","value",t),t}return gg.throwArgumentError("unsupported type","type",e)}))}}}const Cg=new If("abi/5.7.0");class Dg extends Ey{}class Og extends Ey{}class zg extends Ey{}class _g extends Ey{static isIndexed(e){return!(!e||!e._isIndexed)}}const Pg={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Rg(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return n.error=t,n}class Bg{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,yy(this,"fragments",t.map((e=>Oy.from(e))).filter((e=>null!=e))),yy(this,"_abiCoder",my(new.target,"getAbiCoder")()),yy(this,"functions",{}),yy(this,"errors",{}),yy(this,"events",{}),yy(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void Cg.warn("duplicate definition - constructor"):void yy(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let n=e.format();t[n]?Cg.warn("duplicate definition - "+n):t[n]=e})),this.deploy||yy(this,"deploy",By.from({payable:!1,type:"constructor"})),yy(this,"_isInterface",!0)}format(e){e||(e=Sy.full),e===Sy.sighash&&Cg.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Sy.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Qm}static getAddress(e){return dm(e)}static getSighash(e){return Uf(Ym(e.format()),0,4)}static getEventTopic(e){return Ym(e.format())}getFunction(e){if(Pf(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Cg.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===n.length?Cg.throwArgumentError("no matching function","name",t):n.length>1&&Cg.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}const t=this.functions[Uy.fromString(e).format()];return t||Cg.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Pf(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Cg.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===n.length?Cg.throwArgumentError("no matching event","name",t):n.length>1&&Cg.throwArgumentError("multiple matching events","name",t),this.events[n[0]]}const t=this.events[zy.fromString(e).format()];return t||Cg.throwArgumentError("no matching event","signature",e),t}getError(e){if(Pf(e)){const t=my(this.constructor,"getSighash");for(const n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}Cg.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===n.length?Cg.throwArgumentError("no matching error","name",t):n.length>1&&Cg.throwArgumentError("multiple matching errors","name",t),this.errors[n[0]]}const t=this.errors[Uy.fromString(e).format()];return t||Cg.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return my(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),my(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const n=Df(t);return Rf(n.slice(0,4))!==this.getSighash(e)&&Cg.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Rf(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Rf(Of([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const n=Df(t);return Rf(n.slice(0,4))!==this.getSighash(e)&&Cg.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Rf(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Rf(Of([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let n=Df(t),r=null,i="",o=null,a=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(e){}break;case 4:{const e=Rf(n.slice(0,4)),t=Pg[e];if(t)o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.signature,t.reason&&(r=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return Cg.throwError("call revert exception"+i,If.errors.CALL_EXCEPTION,{method:e.format(),data:Rf(t),errorArgs:o,errorName:a,errorSignature:s,reason:r})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Rf(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Cg.throwError("too many arguments for "+e.format(),If.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let n=[];e.anonymous||n.push(this.getEventTopic(e));const r=(e,t)=>"string"===e.type?Ym(t):"bytes"===e.type?Ky(Rf(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Zf.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),Yf(Rf(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?Cg.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((e=>r(o,e)))):n.push(r(o,t)):null!=t&&Cg.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const n=[],r=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Cg.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)n.push(Ym(a));else if("bytes"===e.type)n.push(Ky(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([e.type],[a]))}else r.push(e),i.push(a)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(e,t,n){if("string"==typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){let t=this.getEventTopic(e);Pf(n[0],32)&&n[0].toLowerCase()===t||Cg.throwError("fragment/topic mismatch",If.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(r.push(Cy.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(r.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=n?this._abiCoder.decode(r,Of(n)):null,s=this._abiCoder.decode(i,t,!0),u=[],c=0,l=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)u[t]=new _g({_isIndexed:!0,hash:null});else if(o[t])u[t]=new _g({_isIndexed:!0,hash:a[l++]});else try{u[t]=a[l++]}catch(e){u[t]=e}else try{u[t]=s[c++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){const n=u[t];n instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw Rg(`property ${JSON.stringify(e.name)}`,n)}}):u[e.name]=n}}));for(let e=0;e{throw Rg(`index ${e}`,t)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Og({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Zf.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Dg({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=Rf(e);let n=this.getError(t.substring(0,10).toLowerCase());return n?new zg({args:this._abiCoder.decode(n.inputs,"0x"+t.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var Ug=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const Wg=new If("abstract-provider/5.7.0");class Qg extends Ey{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Yg{constructor(){Wg.checkAbstract(new.target,Yg),yy(this,"_isProvider",!0)}getFeeData(){return Ug(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield gy({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let n=null,r=null,i=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,i=Zf.from("1500000000"),r=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:n,maxFeePerGas:r,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Fg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const Vg=new If("abstract-signer/5.7.0"),Hg=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Gg=[If.errors.INSUFFICIENT_FUNDS,If.errors.NONCE_EXPIRED,If.errors.REPLACEMENT_UNDERPRICED];class qg{constructor(){Vg.checkAbstract(new.target,qg),yy(this,"_isSigner",!0)}getBalance(e){return Fg(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Fg(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Fg(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield gy(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Fg(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield gy(this.checkTransaction(e));return yield this.provider.call(n,t)}))}sendTransaction(e){return Fg(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),n=yield this.signTransaction(t);return yield this.provider.sendTransaction(n)}))}getChainId(){return Fg(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Fg(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Fg(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Fg(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Hg.indexOf(t)&&Vg.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=vy(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Vg.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Fg(this,void 0,void 0,(function*(){const t=yield gy(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Fg(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Vg.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const n=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!n?0!==t.type&&1!==t.type||!n||Vg.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Vg.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(n&&Vg.throwError("network does not support EIP-1559",If.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Vg.throwError("failed to get consistent fee data",If.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Gg.indexOf(e.code)>=0)throw e;return Vg.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",If.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Vg.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield gy(t)}))}_checkProvider(e){this.provider||Vg.throwError("missing provider",If.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class Zg extends qg{constructor(e,t){super(),yy(this,"address",e),yy(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Vg.throwError(e,If.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Zg(this.address,e)}}var Jg=Xg;function Xg(e,t){if(!e)throw new Error(t||"Assertion failed")}Xg.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var Kg=[],$g=[],ev="undefined"!=typeof Uint8Array?Uint8Array:Array,tv=!1;function nv(){tv=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t>18&63]+Kg[i>>12&63]+Kg[i>>6&63]+Kg[63&i]);return o.join("")}function iv(e){var t;tv||nv();for(var n=e.length,r=n%3,i="",o=[],a=16383,s=0,u=n-r;su?u:s+a));return 1===r?(t=e[n-1],i+=Kg[t>>2],i+=Kg[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=Kg[t>>10],i+=Kg[t>>4&63],i+=Kg[t<<2&63],i+="="),o.push(i),o.join("")}function ov(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)}function av(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=f,a/=256,c-=8);e[n+p-f]|=128*y}var sv={}.toString,uv=Array.isArray||function(e){return"[object Array]"==sv.call(e)};function cv(){return dv.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function lv(e,t){if(cv()=cv())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+cv().toString(16)+" bytes");return 0|e}function gv(e){return!(null==e||!e._isBuffer)}function vv(e,t){if(gv(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Fv(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Vv(e).length;default:if(r)return Fv(e).length;t=(""+t).toLowerCase(),r=!0}}function bv(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Dv(this,t,n);case"utf8":case"utf-8":return Sv(this,t,n);case"ascii":return jv(this,t,n);case"latin1":case"binary":return Cv(this,t,n);case"base64":return xv(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ov(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function wv(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Mv(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=dv.from(t,r)),gv(t))return 0===t.length?-1:Av(e,t,n,r,i);if("number"==typeof t)return t&=255,dv.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Av(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Av(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var d=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function xv(e,t,n){return 0===t&&n===e.length?iv(e):iv(e.slice(t,n))}function Sv(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},dv.prototype.compare=function(e,t,n,r,i){if(!gv(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=e.slice(t,n),l=0;li)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return Ev(this,e,t,n);case"utf8":case"utf-8":return Tv(this,e,t,n);case"ascii":return Nv(this,e,t,n);case"latin1":case"binary":return Iv(this,e,t,n);case"base64":return kv(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lv(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},dv.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jv(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function _v(e,t,n,r,i,o){if(!gv(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Pv(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function Rv(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function Bv(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Uv(e,t,n,r,i){return i||Bv(e,0,n,4),av(e,t,n,r,23,4),n+4}function Wv(e,t,n,r,i){return i||Bv(e,0,n,8),av(e,t,n,r,52,8),n+8}dv.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},dv.prototype.readUInt8=function(e,t){return t||zv(e,1,this.length),this[e]},dv.prototype.readUInt16LE=function(e,t){return t||zv(e,2,this.length),this[e]|this[e+1]<<8},dv.prototype.readUInt16BE=function(e,t){return t||zv(e,2,this.length),this[e]<<8|this[e+1]},dv.prototype.readUInt32LE=function(e,t){return t||zv(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},dv.prototype.readUInt32BE=function(e,t){return t||zv(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},dv.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||zv(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},dv.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||zv(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},dv.prototype.readInt8=function(e,t){return t||zv(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},dv.prototype.readInt16LE=function(e,t){t||zv(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},dv.prototype.readInt16BE=function(e,t){t||zv(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},dv.prototype.readInt32LE=function(e,t){return t||zv(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},dv.prototype.readInt32BE=function(e,t){return t||zv(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},dv.prototype.readFloatLE=function(e,t){return t||zv(e,4,this.length),ov(this,e,!0,23,4)},dv.prototype.readFloatBE=function(e,t){return t||zv(e,4,this.length),ov(this,e,!1,23,4)},dv.prototype.readDoubleLE=function(e,t){return t||zv(e,8,this.length),ov(this,e,!0,52,8)},dv.prototype.readDoubleBE=function(e,t){return t||zv(e,8,this.length),ov(this,e,!1,52,8)},dv.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||_v(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},dv.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,1,255,0),dv.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},dv.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,2,65535,0),dv.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Pv(this,e,t,!0),t+2},dv.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,2,65535,0),dv.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Pv(this,e,t,!1),t+2},dv.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,4,4294967295,0),dv.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Rv(this,e,t,!0),t+4},dv.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,4,4294967295,0),dv.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Rv(this,e,t,!1),t+4},dv.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);_v(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},dv.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);_v(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},dv.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,1,127,-128),dv.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},dv.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,2,32767,-32768),dv.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Pv(this,e,t,!0),t+2},dv.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,2,32767,-32768),dv.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Pv(this,e,t,!1),t+2},dv.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,4,2147483647,-2147483648),dv.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Rv(this,e,t,!0),t+4},dv.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||_v(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),dv.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Rv(this,e,t,!1),t+4},dv.prototype.writeFloatLE=function(e,t,n){return Uv(this,e,t,!0,n)},dv.prototype.writeFloatBE=function(e,t,n){return Uv(this,e,t,!1,n)},dv.prototype.writeDoubleLE=function(e,t,n){return Wv(this,e,t,!0,n)},dv.prototype.writeDoubleBE=function(e,t,n){return Wv(this,e,t,!1,n)},dv.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!dv.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Vv(e){return function(e){var t,n,r,i,o,a;tv||nv();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new ev(3*s/4-o),r=o>0?s-4:s;var u=0;for(t=0,n=0;t>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=$g[e.charCodeAt(t)]<<2|$g[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=$g[e.charCodeAt(t)]<<10|$g[e.charCodeAt(t+1)]<<4|$g[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Qv,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Hv(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Gv(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var qv=function(e){return e instanceof dv},Zv=$p((function(e,t){var n=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],r=0;r=a)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}})),u=i[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(n)?r.showHidden=n:n&&t._extend(r,n),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),u(r,e,r.depth)}function a(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function s(e,t){return e}function u(e,n,r){if(e.customInspect&&n&&M(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=u(e,i,r)),i}var o=function(e,t){if(m(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(f(t))return e.stylize(""+t,"number");if(h(t))return e.stylize(""+t,"boolean");if(p(t))return e.stylize("null","null")}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),0===a.length){if(M(n)){var v=n.name?": "+n.name:"";return e.stylize("[Function"+v+"]","special")}if(g(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(b(n))return e.stylize(Date.prototype.toString.call(n),"date");if(w(n))return c(n)}var A,E="",T=!1,N=["{","}"];(d(n)&&(T=!0,N=["[","]"]),M(n))&&(E=" [Function"+(n.name?": "+n.name:"")+"]");return g(n)&&(E=" "+RegExp.prototype.toString.call(n)),b(n)&&(E=" "+Date.prototype.toUTCString.call(n)),w(n)&&(E=" "+c(n)),0!==a.length||T&&0!=n.length?r<0?g(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),A=T?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(A,E,N)):N[0]+E+N[1]}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,r,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),I(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=p(n)?u(e,c.value,null):u(e,c.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),m(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function p(e){return null===e}function f(e){return"number"==typeof e}function y(e){return"string"==typeof e}function m(e){return void 0===e}function g(e){return v(e)&&"[object RegExp]"===A(e)}function v(e){return"object"==typeof e&&null!==e}function b(e){return v(e)&&"[object Date]"===A(e)}function w(e){return v(e)&&("[object Error]"===A(e)||e instanceof Error)}function M(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(m(r)&&(r=k.env.NODE_DEBUG||""),e=e.toUpperCase(),!i[e])if(new RegExp("\\b"+e+"\\b","i").test(r)){var n=k.pid;i[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=h,t.isNull=p,t.isNullOrUndefined=function(e){return null==e},t.isNumber=f,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=m,t.isRegExp=g,t.isObject=v,t.isDate=b,t.isError=w,t.isFunction=M,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=qv;var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":");return[e.getDate(),T[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",N(),t.format.apply(t,arguments))},t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t._extend=function(e,t){if(!t||!v(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}})),Jv=$p((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}}));function Xv(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function Kv(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function $v(e){return 1===e.length?"0"+e:e}function eb(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var tb={inherits:$p((function(e){try{var t=Zv;if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=Jv}})),toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,n[r++]=63&o|128):Xv(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i>>0}return o},split32:function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,n){return e+t+n>>>0},sum32_4:function(e,t,n,r){return e+t+n+r>>>0},sum32_5:function(e,t,n,r,i){return e+t+n+r+i>>>0},sum64:function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o>>0,e[t+1]=o},sum64_hi:function(e,t,n,r){return(t+r>>>0>>0},sum64_lo:function(e,t,n,r){return t+r>>>0},sum64_4_hi:function(e,t,n,r,i,o,a,s){var u=0,c=t;return u+=(c=c+r>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0},sum64_5_hi:function(e,t,n,r,i,o,a,s,u,c){var l=0,d=t;return l+=(d=d+r>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,n,r,i,o,a,s,u,c){return t+r+o+s+c>>>0},rotr64_hi:function(e,t,n){return(t<<32-n|e>>>n)>>>0},rotr64_lo:function(e,t,n){return(e<<32-n|t>>>n)>>>0},shr64_hi:function(e,t,n){return e>>>n},shr64_lo:function(e,t,n){return(e<<32-n|t>>>n)>>>0}};function nb(){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}var rb=nb;nb.prototype.update=function(e,t){if(e=tb.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=tb.join32(e,0,e.length-n,this.endian);for(var r=0;r>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o>>3},g1_256:function(e){return ob(e,17)^ob(e,19)^e>>>10}},lb=tb.rotl32,db=tb.sum32,hb=tb.sum32_5,pb=cb.ft_1,fb=ib.BlockHash,yb=[1518500249,1859775393,2400959708,3395469782];function mb(){if(!(this instanceof mb))return new mb;fb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}tb.inherits(mb,fb);var gb=mb;mb.blockSize=512,mb.outSize=160,mb.hmacStrength=80,mb.padLength=64,mb.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;rthis.blockSize&&(e=(new this.Hash).update(e).digest()),Jg(e.length<=this.blockSize);for(var t=e.length;t>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),jw=kw((function(e,t){var n=t;n.assert=Lw,n.toArray=Sw.toArray,n.zero2=Sw.zero2,n.toHex=Sw.toHex,n.encode=Sw.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[0].push(a),s=0==(1&c)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new mf(e,"hex","le")}})),Cw=jw.getNAF,Dw=jw.getJSF,Ow=jw.assert;function zw(e,t){this.type=e,this.p=new mf(t.p,16),this.red=t.prime?mf.red(t.prime):mf.mont(this.p),this.zero=new mf(0).toRed(this.red),this.one=new mf(1).toRed(this.red),this.two=new mf(2).toRed(this.red),this.n=t.n&&new mf(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var _w=zw;function Pw(e,t){this.curve=e,this.type=t,this.precomputed=null}zw.prototype.point=function(){throw new Error("Not implemented")},zw.prototype.validate=function(){throw new Error("Not implemented")},zw.prototype._fixedNafMul=function(e,t){Ow(e.precomputed);var n=e._getDoubles(),r=Cw(t,1,this._bitLength),i=(1<=o;u--)a=(a<<1)+r[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];Ow(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},zw.prototype._wnafMulAdd=function(e,t,n,r,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,d=0;for(o=0;o=1;o-=2){var p=o-1,f=o;if(1===u[p]&&1===u[f]){var y=[t[p],null,null,t[f]];0===t[p].y.cmp(t[f].y)?(y[1]=t[p].add(t[f]),y[2]=t[p].toJ().mixedAdd(t[f].neg())):0===t[p].y.cmp(t[f].y.redNeg())?(y[1]=t[p].toJ().mixedAdd(t[f]),y[2]=t[p].add(t[f].neg())):(y[1]=t[p].toJ().mixedAdd(t[f]),y[2]=t[p].toJ().mixedAdd(t[f].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=Dw(n[p],n[f]);for(d=Math.max(g[0].length,d),l[p]=new Array(d),l[f]=new Array(d),a=0;a=0;o--){for(var A=0;o>=0;){var E=!0;for(a=0;a=0&&A++,w=w.dblp(A),o<0)break;for(a=0;a0?s=c[a][T-1>>1]:T<0&&(s=c[a][-T-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},Pw.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i=0&&(o=t,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},Uw.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),c=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},Uw.prototype.pointFromX=function(e,t){(e=new mf(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},Uw.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},Uw.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Qw.prototype.isInfinity=function(){return this.inf},Qw.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},Qw.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Qw.prototype.getX=function(){return this.x.fromRed()},Qw.prototype.getY=function(){return this.y.fromRed()},Qw.prototype.mul=function(e){return e=new mf(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Qw.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},Qw.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},Qw.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Qw.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},Qw.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Rw(Yw,_w.BasePoint),Uw.prototype.jpoint=function(e,t,n){return new Yw(this,e,t,n)},Yw.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},Yw.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Yw.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),d=r.redMul(c),h=u.redSqr().redIAdd(l).redISub(d).redISub(d),p=u.redMul(d.redISub(h)).redISub(o.redMul(l)),f=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,p,f)},Yw.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=n.redMul(u),d=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(d)).redISub(i.redMul(c)),p=this.z.redMul(a);return this.curve.jpoint(d,h,p)},Yw.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},Yw.prototype.inspect=function(){return this.isInfinity()?"":""},Yw.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Fw=kw((function(e,t){var n=t;n.base=_w,n.short=Ww,n.mont=null,n.edwards=null})),Vw=kw((function(e,t){var n,r=t,i=jw.assert;function o(e){"short"===e.type?this.curve=new Fw.short(e):"edwards"===e.type?this.curve=new Fw.edwards(e):this.curve=new Fw.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new o(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Iw.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Iw.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Iw.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Iw.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Iw.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Iw.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Iw.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(e){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Iw.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function Hw(e){if(!(this instanceof Hw))return new Hw(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Sw.toArray(e.entropy,e.entropyEnc||"hex"),n=Sw.toArray(e.nonce,e.nonceEnc||"hex"),r=Sw.toArray(e.pers,e.persEnc||"hex");Lw(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var Gw=Hw;Hw.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},Hw.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=Sw.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"};var Xw=jw.assert;function Kw(e,t){if(e instanceof Kw)return e;this._importDER(e,t)||(Xw(e.r&&e.s,"Signature without r or s"),this.r=new mf(e.r,16),this.s=new mf(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var $w=Kw;function eM(){this.place=0}function tM(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function nM(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}Kw.prototype._importDER=function(e,t){e=jw.toArray(e,t);var n=new eM;if(48!==e[n.place++])return!1;var r=tM(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=tM(e,n);if(!1===i)return!1;var o=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var a=tM(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var s=e.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new mf(o),this.s=new mf(s),this.recoveryParam=null,!0},Kw.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=nM(t),n=nM(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];rM(r,t.length),(r=r.concat(t)).push(2),rM(r,n.length);var i=r.concat(n),o=[48];return rM(o,i.length),o=o.concat(i),jw.encode(o,e)};var iM=function(){throw new Error("unsupported")},oM=jw.assert;function aM(e){if(!(this instanceof aM))return new aM(e);"string"==typeof e&&(oM(Object.prototype.hasOwnProperty.call(Vw,e),"Unknown curve "+e),e=Vw[e]),e instanceof Vw.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var sM=aM;aM.prototype.keyPair=function(e){return new Jw(this,e)},aM.prototype.keyFromPrivate=function(e,t){return Jw.fromPrivate(this,e,t)},aM.prototype.keyFromPublic=function(e,t){return Jw.fromPublic(this,e,t)},aM.prototype.genKeyPair=function(e){e||(e={});for(var t=new Gw({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||iM(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new mf(2));;){var i=new mf(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},aM.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},aM.prototype.sign=function(e,t,n,r){"object"==typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new mf(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Gw({hash:this.hash,entropy:o,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new mf(1)),c=0;;c++){var l=r.k?r.k(c):new mf(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(0!==p.cmpn(0)){var f=l.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(f=f.umod(this.n)).cmpn(0)){var y=(d.getY().isOdd()?1:0)|(0!==h.cmp(p)?2:0);return r.canonical&&f.cmp(this.nh)>0&&(f=this.n.sub(f),y^=1),new $w({r:p,s:f,recoveryParam:y})}}}}}},aM.prototype.verify=function(e,t,n,r){e=this._truncateToN(new mf(e,16)),n=this.keyFromPublic(n,r);var i=(t=new $w(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),c)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},aM.prototype.recoverPubKey=function(e,t,n,r){oM((3&n)===n,"The recovery param is more than two bits"),t=new $w(t,r);var i=this.n,o=new mf(e),a=t.r,s=t.s,u=1&n,c=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(i),d=i.sub(o).mul(l).umod(i),h=s.mul(l).umod(i);return this.g.mulAdd(d,a,h)},aM.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new $w(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var uM=kw((function(e,t){var n=t;n.version="6.5.4",n.utils=jw,n.rand=function(){throw new Error("unsupported")},n.curve=Fw,n.curves=Vw,n.ec=sM,n.eddsa=null})).ec;const cM=new If("signing-key/5.7.0");let lM=null;function dM(){return lM||(lM=new uM("secp256k1")),lM}class hM{constructor(e){yy(this,"curve","secp256k1"),yy(this,"privateKey",Rf(e)),32!==Bf(this.privateKey)&&cM.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=dM().keyFromPrivate(Df(this.privateKey));yy(this,"publicKey","0x"+t.getPublic(!1,"hex")),yy(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),yy(this,"_isSigningKey",!0)}_addPoint(e){const t=dM().keyFromPublic(Df(this.publicKey)),n=dM().keyFromPublic(Df(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const t=dM().keyFromPrivate(Df(this.privateKey)),n=Df(e);32!==n.length&&cM.throwArgumentError("bad digest length","digest",e);const r=t.sign(n,{canonical:!0});return Ff({recoveryParam:r.recoveryParam,r:Yf("0x"+r.r.toString(16),32),s:Yf("0x"+r.s.toString(16),32)})}computeSharedSecret(e){const t=dM().keyFromPrivate(Df(this.privateKey)),n=dM().keyFromPublic(Df(pM(e)));return Yf("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function pM(e,t){const n=Df(e);if(32===n.length){const e=new hM(n);return t?"0x"+dM().keyFromPrivate(n).getPublic(!0,"hex"):e.publicKey}return 33===n.length?t?Rf(n):"0x"+dM().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?t?"0x"+dM().keyFromPublic(n).getPublic(!0,"hex"):Rf(n):cM.throwArgumentError("invalid public or private key","key","[REDACTED]")}const fM=new If("transactions/5.7.0");var yM;function mM(e){return"0x"===e?null:dm(e)}function gM(e){return"0x"===e?Nm:Zf.from(e)}function vM(e,t){return function(e){return dm(Uf(Ky(Uf(pM(e),1)),12))}(function(e,t){const n=Ff(t),r={r:Df(n.r),s:Df(n.s)};return"0x"+dM().recoverPubKey(Df(e),r,n.recoveryParam).encode("hex",!1)}(Df(e),t))}function bM(e,t){const n=zf(Zf.from(e).toHexString());return n.length>32&&fM.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function wM(e,t){return{address:dm(e),storageKeys:(t||[]).map(((t,n)=>(32!==Bf(t)&&fM.throwArgumentError("invalid access list storageKey",`accessList[${e}:${n}]`,t),t.toLowerCase())))}}function MM(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&fM.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),wM(e[0],e[1])):wM(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const n=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return wM(t,Object.keys(n).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function AM(e){return MM(e).map((e=>[e.address,e.storageKeys]))}function EM(e,t){if(null!=e.gasPrice){const t=Zf.from(e.gasPrice),n=Zf.from(e.maxFeePerGas||0);t.eq(n)||fM.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:n})}const n=[bM(e.chainId||0,"chainId"),bM(e.nonce||0,"nonce"),bM(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),bM(e.maxFeePerGas||0,"maxFeePerGas"),bM(e.gasLimit||0,"gasLimit"),null!=e.to?dm(e.to):"0x",bM(e.value||0,"value"),e.data||"0x",AM(e.accessList||[])];if(t){const e=Ff(t);n.push(bM(e.recoveryParam,"recoveryParam")),n.push(zf(e.r)),n.push(zf(e.s))}return Wf(["0x02",rm(n)])}function TM(e,t){const n=[bM(e.chainId||0,"chainId"),bM(e.nonce||0,"nonce"),bM(e.gasPrice||0,"gasPrice"),bM(e.gasLimit||0,"gasLimit"),null!=e.to?dm(e.to):"0x",bM(e.value||0,"value"),e.data||"0x",AM(e.accessList||[])];if(t){const e=Ff(t);n.push(bM(e.recoveryParam,"recoveryParam")),n.push(zf(e.r)),n.push(zf(e.s))}return Wf(["0x01",rm(n)])}function NM(e,t,n){try{const n=gM(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(e){fM.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Yf(t[1],32),e.s=Yf(t[2],32);try{const t=Ky(n(e));e.from=vM(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function IM(e){const t=Df(e);if(t[0]>127)return function(e){const t=am(e);9!==t.length&&6!==t.length&&fM.throwArgumentError("invalid raw transaction","rawTransaction",e);const n={nonce:gM(t[0]).toNumber(),gasPrice:gM(t[1]),gasLimit:gM(t[2]),to:mM(t[3]),value:gM(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=Zf.from(t[6]).toNumber()}catch(e){return n}if(n.r=Yf(t[7],32),n.s=Yf(t[8],32),Zf.from(n.r).isZero()&&Zf.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let r=n.v-27;const i=t.slice(0,6);0!==n.chainId&&(i.push(Rf(n.chainId)),i.push("0x"),i.push("0x"),r-=2*n.chainId+8);const o=Ky(rm(i));try{n.from=vM(o,{r:Rf(n.r),s:Rf(n.s),recoveryParam:r})}catch(e){}n.hash=Ky(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){const t=am(e.slice(1));8!==t.length&&11!==t.length&&fM.throwArgumentError("invalid component count for transaction type: 1","payload",Rf(e));const n={type:1,chainId:gM(t[0]).toNumber(),nonce:gM(t[1]).toNumber(),gasPrice:gM(t[2]),gasLimit:gM(t[3]),to:mM(t[4]),value:gM(t[5]),data:t[6],accessList:MM(t[7])};return 8===t.length||(n.hash=Ky(e),NM(n,t.slice(8),TM)),n}(t);case 2:return function(e){const t=am(e.slice(1));9!==t.length&&12!==t.length&&fM.throwArgumentError("invalid component count for transaction type: 2","payload",Rf(e));const n=gM(t[2]),r=gM(t[3]),i={type:2,chainId:gM(t[0]).toNumber(),nonce:gM(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:gM(t[4]),to:mM(t[5]),value:gM(t[6]),data:t[7],accessList:MM(t[8])};return 9===t.length||(i.hash=Ky(e),NM(i,t.slice(9),EM)),i}(t)}return fM.throwError(`unsupported transaction type: ${t[0]}`,If.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(yM||(yM={}));var kM=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const LM=new If("contracts/5.7.0");function xM(e,t){return kM(this,void 0,void 0,(function*(){const n=yield t;"string"!=typeof n&&LM.throwArgumentError("invalid address or ENS name","name",n);try{return dm(n)}catch(e){}e||LM.throwError("a provider or signer is needed to resolve ENS names",If.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield e.resolveName(n);return null==r&&LM.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function SM(e,t,n){return kM(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>SM(e,Array.isArray(t)?t[r]:t[n.name],n)))):"address"===n.type?yield xM(e,t):"tuple"===n.type?yield SM(e,t,n.components):"array"===n.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>SM(e,t,n.arrayChildren)))):Promise.reject(LM.makeError("invalid value for array",If.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function jM(e,t,n){return kM(this,void 0,void 0,(function*(){let r={};n.length===t.inputs.length+1&&"object"==typeof n[n.length-1]&&(r=vy(n.pop())),LM.checkArgumentCount(n.length,t.inputs.length,"passed to contract"),e.signer?r.from?r.from=gy({override:xM(e.signer,r.from),signer:e.signer.getAddress()}).then((e=>kM(this,void 0,void 0,(function*(){return dm(e.signer)!==e.override&&LM.throwError("Contract with a Signer cannot override from",If.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):r.from=e.signer.getAddress():r.from&&(r.from=xM(e.provider,r.from));const i=yield gy({args:SM(e.signer||e.provider,n,t.inputs),address:e.resolvedAddress,overrides:gy(r)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Zf.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Zf.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Zf.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Zf.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Zf.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=MM(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const n=Df(o);for(let t=0;tnull!=r[e]));return u.length&&LM.throwError(`cannot override ${u.map((e=>JSON.stringify(e))).join(",")}`,If.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),a}))}function CM(e,t,n){const r=e.signer||e.provider;return function(...i){return kM(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=vy(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield jM(e,t,i),s=yield r.call(a,o);try{let r=e.interface.decodeFunctionResult(t,s);return n&&1===t.outputs.length&&(r=r[0]),r}catch(t){throw t.code===If.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function DM(e,t){return function(...n){return kM(this,void 0,void 0,(function*(){e.signer||LM.throwError("sending a transaction requires a signer",If.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const r=yield jM(e,t,n),i=yield e.signer.sendTransaction(r);return function(e,t){const n=t.wait.bind(t);t.wait=t=>n(t).then((t=>(t.events=t.logs.map((n=>{let r=Ay(n),i=null;try{i=e.interface.parseLog(n)}catch(e){}return i&&(r.args=i.args,r.decode=(t,n)=>e.interface.decodeEventLog(i.eventFragment,t,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>e.provider,r.getBlock=()=>e.provider.getBlock(t.blockHash),r.getTransaction=()=>e.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(t),r})),t)))}(e,i),i}))}}function OM(e,t,n){return t.constant?CM(e,t,n):DM(e,t)}function zM(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class _M{constructor(e,t){yy(this,"tag",e),yy(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((n=>!(!t&&n.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const n=e.slice();return setTimeout((()=>{t.listener.apply(this,n)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class PM extends _M{constructor(){super("error",null)}}class RM extends _M{constructor(e,t,n,r){const i={address:e};let o=t.getEventTopic(n);r?(o!==r[0]&&LM.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super(zM(i),i),yy(this,"address",e),yy(this,"interface",t),yy(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=function(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let i in r){const o=e.slice();o.push(i);try{n(o,r[i])}catch(e){t.push({path:o,error:e})}}};return n([],e),t}(e.args);if(t.length)throw t[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class BM extends _M{constructor(e,t){super("*",{address:e}),yy(this,"address",e),yy(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,n)=>this.interface.decodeEventLog(t.eventFragment,e,n),e.args=t.args}catch(e){}}}class UM extends class{constructor(e,t,n){yy(this,"interface",my(new.target,"getInterface")(t)),null==n?(yy(this,"provider",null),yy(this,"signer",null)):qg.isSigner(n)?(yy(this,"provider",n.provider||null),yy(this,"signer",n)):Yg.isProvider(n)?(yy(this,"provider",n),yy(this,"signer",null)):LM.throwArgumentError("invalid signer or provider","signerOrProvider",n),yy(this,"callStatic",{}),yy(this,"estimateGas",{}),yy(this,"functions",{}),yy(this,"populateTransaction",{}),yy(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const n=this.interface.events[t];yy(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,e)}))),e[n.name]||(e[n.name]=[]),e[n.name].push(t)})),Object.keys(e).forEach((t=>{const n=e[t];1===n.length?yy(this.filters,t,this.filters[n[0]]):LM.warn(`Duplicate definition of ${t} (${n.join(", ")})`)}))}if(yy(this,"_runningEvents",{}),yy(this,"_wrappedEmits",{}),null==e&&LM.throwArgumentError("invalid contract address or ENS name","addressOrName",e),yy(this,"address",e),this.provider)yy(this,"resolvedAddress",xM(this.provider,e));else try{yy(this,"resolvedAddress",Promise.resolve(dm(e)))}catch(e){LM.throwError("provider is required to use ENS name as contract address",If.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const r={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])LM.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const n=t.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(e)}null==this[e]&&yy(this,e,OM(this,t,!0)),null==this.functions[e]&&yy(this.functions,e,OM(this,t,!1)),null==this.callStatic[e]&&yy(this.callStatic,e,CM(this,t,!0)),null==this.populateTransaction[e]&&yy(this.populateTransaction,e,function(e,t){return function(...n){return jM(e,t,n)}}(this,t)),null==this.estimateGas[e]&&yy(this.estimateGas,e,function(e,t){const n=e.signer||e.provider;return function(...r){return kM(this,void 0,void 0,(function*(){n||LM.throwError("estimate require a provider or signer",If.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield jM(e,t,r);return yield n.estimateGas(i)}))}}(this,t))}})),Object.keys(r).forEach((e=>{const t=r[e];if(t.length>1)return;e=e.substring(1);const n=t[0];try{null==this[e]&&yy(this,e,this[n])}catch(e){}null==this.functions[e]&&yy(this.functions,e,this.functions[n]),null==this.callStatic[e]&&yy(this.callStatic,e,this.callStatic[n]),null==this.populateTransaction[e]&&yy(this.populateTransaction,e,this.populateTransaction[n]),null==this.estimateGas[e]&&yy(this.estimateGas,e,this.estimateGas[n])}))}static getContractAddress(e){return hm(e)}static getInterface(e){return Bg.isInterface(e)?e:new Bg(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&LM.throwError("contract not deployed",If.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||LM.throwError("sending a transactions require a signer",If.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=vy(e||{});return["from","to"].forEach((function(e){null!=t[e]&&LM.throwError("cannot override "+e,If.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new Zg(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&yy(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return _g.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new PM);if("event"===e)return this._normalizeRunningEvent(new _M("event",null));if("*"===e)return this._normalizeRunningEvent(new BM(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new RM(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const n=this.interface.getEvent(t);return this._normalizeRunningEvent(new RM(this.address,this.interface,n,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new _M(zM(t),t))}return this._normalizeRunningEvent(new BM(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,n){const r=Ay(t);return r.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},r.getBlock=()=>this.provider.getBlock(t.blockHash),r.getTransaction=()=>this.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(r),r}_addEventListener(e,t,n){if(this.provider||LM.throwError("events require a provider or a signer with a provider",If.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const n=n=>{let r=this._wrapEvent(e,n,t);if(null==r.decodeError)try{const t=e.getEmit(r);this.emit(e.filter,...t)}catch(e){r.decodeError=e.error}null!=e.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[e.tag]=n,null!=e.filter&&this.provider.on(e.filter,n)}}queryFilter(e,t,n){const r=this._getRunningEvent(e),i=vy(r.filter);return"string"==typeof t&&Pf(t,32)?(null!=n&&LM.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(r,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const n=this._getRunningEvent(e),r=n.run(t)>0;return this._checkRunningEvents(n),r}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(t),this._checkRunningEvents(n),this}removeListener(e,t){return this.off(e,t)}}{}class WM{constructor(e){yy(this,"alphabet",e),yy(this,"base",e.length),yy(this,"_alphabetMap",{}),yy(this,"_leader",e.charAt(0));for(let t=0;t0;)n.push(r%this.base),r=r/this.base|0}let r="";for(let e=0;0===t[e]&&e=0;--e)r+=this.alphabet[n[e]];return r}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let n=0;n>=8;for(;i>0;)t.push(255&i),i>>=8}for(let n=0;e[n]===this._leader&&n{o[t.toLowerCase()]=e})):r.headers.keys().forEach((e=>{o[e.toLowerCase()]=r.headers.get(e)})),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:Df(new Uint8Array(i))}}))}var $M=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const eA=new If("web/5.7.1");function tA(e){return new Promise((t=>{setTimeout(t,e)}))}function nA(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Sf(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return _m(e)}catch(e){}return Rf(e)}return e}function rA(e,t,n){let r=null;if(null!=t){r=zm(t);const n="string"==typeof e?{url:e}:vy(e);if(n.headers){0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length||(n.headers=vy(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return function(e,t,n){const r="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;eA.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;eA.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let u=null;const c={method:"GET"};let l=!1,d=12e4;if("string"==typeof e)u=e;else if("object"==typeof e){if(null!=e&&null!=e.url||eA.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&eA.throwError("basic authentication requires a secure https url",If.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+Vm(zm(t))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(c.fetchOptions=vy(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p=u?u.match(h):null;if(p)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":p[1]||"text/plain"},body:p[2]?Fm(p[3]):(f=p[3],zm(f.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return n&&(t=n(e.body,e)),Promise.resolve(t)}catch(e){eA.throwError("processing response error",If.errors.SERVER_ERROR,{body:nA(p[1],p[2]),error:e,requestBody:null,requestMethod:"GET",url:u})}var f;t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const y={};Object.keys(s).forEach((e=>{const t=s[e];y[t.key]=t.value})),c.headers=y;const m=function(){let e=null;return{promise:new Promise((function(t,n){d&&(e=setTimeout((()=>{null!=e&&(e=null,n(eA.makeError("timeout",If.errors.TIMEOUT,{requestBody:nA(c.body,y["content-type"]),requestMethod:c.method,timeout:d,url:u})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return $M(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(m.cancel(),eA.throwError("bad response",If.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:nA(s,t.headers?t.headers["content-type"]:null),requestBody:nA(c.body,y["content-type"]),requestMethod:c.method,url:u})),n)try{const e=yield n(s,t);return m.cancel(),e}catch(n){if(n.throttleRetry&&e{let r=null;if(null!=e)try{r=JSON.parse(_m(e))}catch(t){eA.throwError("invalid JSON",If.errors.SERVER_ERROR,{body:e,error:t})}return n&&(r=n(r,t)),r}))}function iA(e,t){return t||(t={}),null==(t=vy(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(n,r){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&r(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let u=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(u++,u>s)return void(a()&&r(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&r(e)}))}()}))}for(var oA="qpzry9x8gf2tvdw0s3jn54khce6mua7l",aA={},sA=0;sA>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function lA(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=cA(t)^r>>5}for(t=cA(t),n=0;nt)return"Exceeds length limit";var n=e.toLowerCase(),r=e.toUpperCase();if(e!==n&&e!==r)return"Mixed-case string "+e;var i=(e=n).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=lA(o);if("string"==typeof s)return s;for(var u=[],c=0;c=a.length||u.push(d)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:u}}function hA(e,t,n,r){for(var i=0,o=0,a=(1<=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<=t)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var r=lA(e=e.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");r=cA(r)^a,i+=oA.charAt(a)}for(o=0;o<6;++o)r=cA(r);for(r^=1,o=0;o<6;++o){i+=oA.charAt(r>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=hA(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=hA(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=hA(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=hA(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}};const fA="providers/5.7.2",yA=new If(fA);class mA{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),n=this.bigNumber.bind(this),r=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return e.transaction={hash:o,type:u,accessList:mA.allowNull(this.accessList.bind(this),null),blockHash:mA.allowNull(o,null),blockNumber:mA.allowNull(s,null),transactionIndex:mA.allowNull(s,null),confirmations:mA.allowNull(s,null),from:t,gasPrice:mA.allowNull(n),maxPriorityFeePerGas:mA.allowNull(n),maxFeePerGas:mA.allowNull(n),gasLimit:n,to:mA.allowNull(t,null),value:n,nonce:s,data:i,r:mA.allowNull(this.uint256),s:mA.allowNull(this.uint256),v:mA.allowNull(s),creates:mA.allowNull(t,null),raw:mA.allowNull(i)},e.transactionRequest={from:mA.allowNull(t),nonce:mA.allowNull(s),gasLimit:mA.allowNull(n),gasPrice:mA.allowNull(n),maxPriorityFeePerGas:mA.allowNull(n),maxFeePerGas:mA.allowNull(n),to:mA.allowNull(t),value:mA.allowNull(n),data:mA.allowNull((e=>this.data(e,!0))),type:mA.allowNull(s),accessList:mA.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:mA.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:mA.allowNull(this.address,null),from:mA.allowNull(this.address,null),contractAddress:mA.allowNull(t,null),transactionIndex:s,root:mA.allowNull(a),gasUsed:n,logsBloom:mA.allowNull(i),blockHash:o,transactionHash:o,logs:mA.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:mA.allowNull(s,null),cumulativeGasUsed:n,effectiveGasPrice:mA.allowNull(n),status:mA.allowNull(s),type:u},e.block={hash:mA.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:mA.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:mA.allowNull(t),extraData:i,transactions:mA.allowNull(mA.arrayOf(o)),baseFeePerGas:mA.allowNull(n)},e.blockWithTransactions=vy(e.block),e.blockWithTransactions.transactions=mA.allowNull(mA.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:mA.allowNull(r,void 0),toBlock:mA.allowNull(r,void 0),blockHash:mA.allowNull(o,void 0),address:mA.allowNull(t,void 0),topics:mA.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:mA.allowNull(s),blockHash:mA.allowNull(o),transactionIndex:s,removed:mA.allowNull(this.boolean.bind(this)),address:t,data:mA.allowFalsish(i,"0x"),topics:mA.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return MM(e||[])}number(e){return"0x"===e?0:Zf.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Zf.from(e).toNumber()}bigNumber(e){return Zf.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Pf(e))?e.toLowerCase():yA.throwArgumentError("invalid hash","value",e)}data(e,t){const n=this.hex(e,t);if(n.length%2!=0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return dm(e)}callAddress(e){if(!Pf(e,32))return null;const t=dm(Uf(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return hm(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Pf(e))return Qf(e);throw new Error("invalid blockTag")}hash(e,t){const n=this.hex(e,t);return 32!==Bf(n)?yA.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(null==e)return null;const t=Zf.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Pf(e))throw new Error("invalid uint256");return Yf(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const n=null!=e._difficulty?e._difficulty:e.difficulty,r=mA.check(t,e);return r._difficulty=null==n?null:Zf.from(n),r}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return mA.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Zf.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=mA.check(this.formats.transaction,e);if(null!=e.chainId){let n=e.chainId;Pf(n)&&(n=Zf.from(n).toNumber()),t.chainId=n}else{let n=e.networkId;null==n&&null==t.v&&(n=e.chainId),Pf(n)&&(n=Zf.from(n).toNumber()),"number"!=typeof n&&null!=t.v&&(n=(t.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),t.chainId=n}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return IM(e)}receiptLog(e){return mA.check(this.formats.receiptLog,e)}receipt(e){const t=mA.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Zf.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&yA.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):yA.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&yA.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return mA.check(this.formats.filter,e)}filterLog(e){return mA.check(this.formats.filterLog,e)}static check(e,t){const n={};for(const r in e)try{const i=e[r](t[r]);void 0!==i&&(n[r]=i)}catch(e){throw e.checkKey=r,e.checkValue=t[r],e}return n}static allowNull(e,t){return function(n){return null==n?t:e(n)}}static allowFalsish(e,t){return function(n){return n?e(n):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const n=[];return t.forEach((function(t){n.push(e(t))})),n}}}var gA=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const vA=new If(fA);function bA(e){return null==e?"null":(32!==Bf(e)&&vA.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function wA(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[bA(e)]=!0}));const n=Object.keys(t);return n.sort(),n.join("|")}return bA(e)})).join("&")}function MA(e){if("string"==typeof e){if(32===Bf(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+wA(e);if(Qg.isForkEvent(e))throw vA.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+wA(e.topics||[])}throw new Error("invalid event - "+e)}function AA(){return(new Date).getTime()}function EA(e){return new Promise((t=>{setTimeout(t,e)}))}const TA=["block","network","pending","poll"];class NA{constructor(e,t,n){yy(this,"tag",e),yy(this,"listener",t),yy(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],n=""===(r=e[2])?[]:r.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var r;const i={};return n.length>0&&(i.topics=n),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||TA.indexOf(this.tag)>=0}}const IA={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function kA(e){return Yf(Zf.from(e).toHexString(),32)}function LA(e){return QM.encode(Of([e,Uf(YM(YM(e)),0,4)]))}const xA=new RegExp("^(ipfs)://(.*)$","i"),SA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),xA,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function jA(e,t){try{return _m(CA(e,t))}catch(e){}return null}function CA(e,t){if("0x"===e)return null;const n=Zf.from(Uf(e,t,t+32)).toNumber(),r=Zf.from(Uf(e,n,n+32)).toNumber();return Uf(e,n+32,n+32+r)}function DA(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):vA.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function OA(e){const t=Df(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function zA(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function _A(e){const t=[];let n=0;for(let r=0;rZf.from(e).eq(1))).catch((e=>{if(e.code===If.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return gA(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:Wf([e,yg(this.name),t||"0x"])};let r=!1;var i;(yield this.supportsWildcard())&&(r=!0,n.data=Wf(["0x9061b923",_A([(i=this.name,Rf(Of(fg(i).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),n.data])]));try{let e=yield this.provider.call(n);return Df(e).length%32==4&&vA.throwError("resolver threw error",If.errors.CALL_EXCEPTION,{transaction:n,data:e}),r&&(e=CA(e,0)),e}catch(e){if(e.code===If.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return gA(this,void 0,void 0,(function*(){const n=yield this._fetch(e,t);return null!=n?CA(n,0):null}))}_getAddress(e,t){const n=IA[String(e)];if(null==n&&vA.throwError(`unsupported coin type: ${e}`,If.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===n.ilk)return this.provider.formatter.address(t);const r=Df(t);if(null!=n.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return LA(Of([[n.p2pkh],"0x"+e[2]]))}}if(null!=n.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return LA(Of([[n.p2sh],"0x"+e[2]]))}}if(null!=n.prefix){const e=r[1];let t=r[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&r.length===2+e&&e>=1&&e<=75){const e=pA.toWords(r.slice(2));return e.unshift(t),pA.encode(n.prefix,e)}}return null}getAddress(e){return gA(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===If.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",kA(e));if(null==t||"0x"===t)return null;const n=this._getAddress(e,t);return null==n&&vA.throwError("invalid or unsupported coin data",If.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),n}))}getAvatar(){return gA(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let n=0;ne[t]))}return vA.throwError("invalid or unsupported content hash data",If.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return gA(this,void 0,void 0,(function*(){let t=zm(e);t=Of([kA(64),kA(t.length),t]),t.length%32!=0&&(t=Of([t,Yf("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Rf(t));return null==n||"0x"===n?null:_m(n)}))}}let RA=null,BA=1;class UA extends Yg{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),yy(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=my(new.target,"getNetwork")(e);t?(yy(this,"_network",t),this.emit("network",t,null)):vA.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return gA(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||vA.throwError("no network detected",If.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:yy(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return iA((()=>this._ready().then((e=>e),(e=>{if(e.code!==If.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==RA&&(RA=new mA),RA}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in JM){const n=JM[t];if(n.chainId===e)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=JM[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=JM[e.name];if(!t)return"number"!=typeof e.chainId&&FM.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&FM.throwArgumentError("network chainId mismatch","network",e);let n=e._defaultProvider||null;var r;return null==n&&t._defaultProvider&&(n=(r=t._defaultProvider)&&"function"==typeof r.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:n}}(null==e?"homestead":e)}ccipReadFetch(e,t,n){return gA(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:r}),u=yield rA({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(u.data)return u.data;const c=u.message||"unknown error";if(u.status>=400&&u.status<500)return vA.throwError(`response not found during CCIP fetch: ${c}`,If.errors.SERVER_ERROR,{url:t,errorMessage:c});o.push(c)}return vA.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,If.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(e){return gA(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const n=yield t;if(AA()-n.respTime<=e)return n.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=AA(),n=gy({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=AA();return(e=Zf.from(e).toNumber()){this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return gA(this,void 0,void 0,(function*(){const e=BA++,t=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)vA.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",vA.makeError("network block skew detected",If.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let e=this._emitted.block+1;e<=n;e++)this.emit("block",e);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&n-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((e=>{switch(e.type){case"tx":{const n=e.hash;let r=this.getTransactionReceipt(n).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+n]=e.blockNumber,this.emit(n,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(r);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);const r=e.filter;r.fromBlock=e._lastBlockNumber+1,r.toBlock=n;const i=r.toBlock-this._maxFilterBlockRange;i>r.fromBlock&&(r.fromBlock=i),r.fromBlock<0&&(r.fromBlock=0);const o=this.getLogs(r).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(r,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=n,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return gA(this,void 0,void 0,(function*(){return vA.throwError("provider does not support network detection",If.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return gA(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield EA(0),this._network;const n=vA.makeError("underlying network changed",If.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",n),n}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=AA();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,n){return gA(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,n||0,null)}))}_waitForTransaction(e,t,n,r){return gA(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const u=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},c=e=>{e.confirmations{this.removeListener(e,c)})),r){let n=r.startBlock,i=null;const c=a=>gA(this,void 0,void 0,(function*(){s||(yield EA(1e3),this.getTransactionCount(r.from).then((l=>gA(this,void 0,void 0,(function*(){if(!s){if(l<=r.nonce)n=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=n-3,i{s||this.once("block",c)})))}));if(s)return;this.once("block",c),a.push((()=>{this.removeListener("block",c)}))}if("number"==typeof n&&n>0){const e=setTimeout((()=>{u()||o(vA.makeError("timeout exceeded",If.errors.TIMEOUT,{timeout:n}))}),n);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return gA(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return gA(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Zf.from(e)}catch(t){return vA.throwError("bad result from backend",If.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return gA(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield gy({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getBalance",n);try{return Zf.from(r)}catch(e){return vA.throwError("bad result from backend",If.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:e})}}))}getTransactionCount(e,t){return gA(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield gy({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getTransactionCount",n);try{return Zf.from(r).toNumber()}catch(e){return vA.throwError("bad result from backend",If.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:e})}}))}getCode(e,t){return gA(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield gy({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getCode",n);try{return Rf(r)}catch(e){return vA.throwError("bad result from backend",If.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:e})}}))}getStorageAt(e,t,n){return gA(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield gy({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((e=>Qf(e)))}),i=yield this.perform("getStorageAt",r);try{return Rf(i)}catch(e){return vA.throwError("bad result from backend",If.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:e})}}))}_wrapTransaction(e,t,n){if(null!=t&&32!==Bf(t))throw new Error("invalid response - sendTransaction");const r=e;return null!=t&&e.hash!==t&&vA.throwError("Transaction hash mismatch from Provider.sendTransaction.",If.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),r.wait=(t,r)=>gA(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==r&&(r=0),0!==t&&null!=n&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const o=yield this._waitForTransaction(e.hash,t,r,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&vA.throwError("transaction failed",If.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),r}sendTransaction(e){return gA(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>Rf(e))),n=this.formatter.transaction(e);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(n,e,r)}catch(e){throw e.transaction=n,e.transactionHash=n.hash,e}}))}_getTransactionRequest(e){return gA(this,void 0,void 0,(function*(){const t=yield e,n={};return["from","to"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?Zf.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(n.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?Rf(e):null)))})),this.formatter.transactionRequest(yield gy(n))}))}_getFilter(e){return gA(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((n=>{null!=e[n]&&(t[n]=e[n])})),["fromBlock","toBlock"].forEach((n=>{null!=e[n]&&(t[n]=this._getBlockTag(e[n]))})),this.formatter.filter(yield gy(t))}))}_call(e,t,n){return gA(this,void 0,void 0,(function*(){n>=10&&vA.throwError("CCIP read exceeded maximum redirections",If.errors.SERVER_ERROR,{redirects:n,transaction:e});const r=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(n>=0&&"latest"===t&&null!=r&&"0x556f1830"===i.substring(0,10)&&Bf(i)%32==4)try{const o=Uf(i,4),a=Uf(o,0,32);Zf.from(a).eq(r)||vA.throwError("CCIP Read sender did not match",If.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],u=Zf.from(Uf(o,32,64)).toNumber(),c=Zf.from(Uf(o,u,u+32)).toNumber(),l=Uf(o,u+32);for(let t=0;tgA(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",r);if(null==e)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(t){let t=null;for(let n=0;nthis._wrapTransaction(e))),n}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return gA(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return iA((()=>gA(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(e){return gA(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return iA((()=>gA(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return r}))),{oncePoll:this})}))}getLogs(e){return gA(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield gy({filter:this._getFilter(e)}),n=yield this.perform("getLogs",t);return n.forEach((e=>{null==e.removed&&(e.removed=!1)})),mA.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return gA(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return gA(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&vA.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return gA(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const n=yield this._getResolver(t,"getResolver");if(null!=n){const r=new PA(this,n,e);return t===e||(yield r.supportsWildcard())?r:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return gA(this,void 0,void 0,(function*(){null==t&&(t="ENS");const n=yield this.getNetwork();n.ensAddress||vA.throwError("network does not support ENS",If.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name});try{const t=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+yg(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return gA(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Pf(e))throw t}"string"!=typeof e&&vA.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return gA(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(t,"lookupAddress");if(null==n)return null;const r=jA(yield this.call({to:n,data:"0x691f3431"+yg(t).substring(2)}),0);return(yield this.resolveName(r))!=e?null:r}))}getAvatar(e){return gA(this,void 0,void 0,(function*(){let t=null;if(Pf(e)){const n=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(n,"getAvatar");if(!r)return null;t=new PA(this,r,n);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==If.errors.CALL_EXCEPTION)throw e}try{const e=jA(yield this.call({to:r,data:"0x691f3431"+yg(n).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==If.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const n=yield t.getAvatar();return null==n?null:n.url}))}perform(e,t){return vA.throwError(e+" not implemented",If.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,n){const r=new NA(MA(e),t,n);return this._events.push(r),this._startEvent(r),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let n=!1,r=[],i=MA(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),n=!0,!e.once||(r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),n}listenerCount(e){if(!e)return this._events.length;let t=MA(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=MA(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const n=[];let r=!1,i=MA(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!r||(r=!0,n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const n=MA(e);this._events=this._events.filter((e=>e.tag!==n||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var WA=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const QA=new If(fA),YA=["call","estimateGas"];function FA(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const n=Pf(e.data)?e.data:null;if(!t||n)return{message:e.message,data:n}}if("object"==typeof e){for(const n in e){const r=FA(e[n],t);if(r)return r}return null}if("string"==typeof e)try{return FA(JSON.parse(e),t)}catch(e){}return null}function VA(e,t,n){const r=n.transaction||n.signedTransaction;if("call"===e){const e=FA(t,!0);if(e)return e.data;QA.throwError("missing revert data in call exception; Transaction reverted without a reason string",If.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:t})}if("estimateGas"===e){let n=FA(t.body,!1);null==n&&(n=FA(t,!1)),n&&QA.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",If.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:e,transaction:r,error:t})}let i=t.message;throw t.code===If.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&QA.throwError("insufficient funds for intrinsic transaction cost",If.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),i.match(/nonce (is )?too low/i)&&QA.throwError("nonce has already been used",If.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&QA.throwError("replacement fee too low",If.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),i.match(/only replay-protected/i)&&QA.throwError("legacy pre-eip-155 transactions not supported",If.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:r}),YA.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&QA.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",If.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function HA(e){return new Promise((function(t){setTimeout(t,e)}))}function GA(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function qA(e){return e?e.toLowerCase():e}const ZA={};class JA extends qg{constructor(e,t,n){if(super(),e!==ZA)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");yy(this,"provider",t),null==n&&(n=0),"string"==typeof n?(yy(this,"_address",this.provider.formatter.address(n)),yy(this,"_index",null)):"number"==typeof n?(yy(this,"_index",n),yy(this,"_address",null)):QA.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return QA.throwError("cannot alter JSON-RPC Signer connection",If.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new XA(ZA,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&QA.throwError("unknown account #"+this._index,If.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=vy(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const n=vy(e);n.from=t,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>WA(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&QA.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),gy({tx:gy(e),sender:t}).then((({tx:t,sender:n})=>{null!=t.from?t.from.toLowerCase()!==n&&QA.throwArgumentError("from address mismatch","transaction",e):t.from=n;const r=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&QA.throwError("user rejected transaction",If.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),VA("sendTransaction",e,r))))}))}signTransaction(e){return QA.throwError("signing transactions is unsupported",If.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return WA(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield iA((()=>WA(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(n);if(null!==e)return this.provider._wrapTransaction(e,n,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=n,e}}))}signMessage(e){return WA(this,void 0,void 0,(function*(){const t="string"==typeof e?zm(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Rf(t),n.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&QA.throwError("user rejected signing",If.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),t}}))}_legacySignMessage(e){return WA(this,void 0,void 0,(function*(){const t="string"==typeof e?zm(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Rf(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&QA.throwError("user rejected signing",If.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),t}}))}_signTypedData(e,t,n){return WA(this,void 0,void 0,(function*(){const r=yield jg.resolveNames(e,t,n,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(jg.getPayload(r.domain,t,r.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&QA.throwError("user rejected signing",If.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:r.domain,types:t,value:r.value}}),e}}))}unlock(e){return WA(this,void 0,void 0,(function*(){const t=this.provider,n=yield this.getAddress();return t.send("personal_unlockAccount",[n.toLowerCase(),e,null])}))}}class XA extends JA{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const KA={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class $A extends UA{constructor(e,t){let n=t;null==n&&(n=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(n),e||(e=my(this.constructor,"defaultUrl")()),yy(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(vy(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return WA(this,void 0,void 0,(function*(){yield HA(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=my(this.constructor,"getNetwork");try{return t(Zf.from(e).toNumber())}catch(t){return QA.throwError("could not detect network",If.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return QA.throwError("could not detect network",If.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new JA(ZA,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Ay(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(r&&this._cache[e])return this._cache[e];const i=rA(this.connection,JSON.stringify(n),GA).then((e=>(this.emit("debug",{action:"response",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:n,provider:this}),e}));return r&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[qA(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[qA(t.address),t.blockTag]];case"getCode":return["eth_getCode",[qA(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[qA(t.address),Yf(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[my(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[my(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=qA(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return WA(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Zf.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((t=vy(t)).transaction=vy(e),delete t.transaction.type)}}const n=this.prepareRequest(e,t);null==n&&QA.throwError(e+" not implemented",If.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(n){return VA(e,n,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;let r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return HA(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((e=>{}))}(),n})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const n=vy(KA);if(t)for(const e in t)t[e]&&(n[e]=!0);var r,i;i=n,(r=e)&&"object"==typeof r||fy.throwArgumentError("invalid object","object",r),Object.keys(r).forEach((e=>{i[e]||fy.throwArgumentError("invalid object key - "+e,"transaction:"+e,r)}));const o={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const n=Qf(Zf.from(e[t]));"gasLimit"===t&&(t="gas"),o[t]=n})),["from","to","data"].forEach((function(t){null!=e[t]&&(o[t]=Rf(e[t]))})),e.accessList&&(o.accessList=MM(e.accessList)),o}}const eE=new If(fA);let tE=1;function nE(e,t){const n="Web3LegacyFetcher";return function(e,r){const i={method:e,params:r,id:tE++,jsonrpc:"2.0"};return new Promise(((e,r)=>{this.emit("debug",{action:"request",fetcher:n,request:Ay(i),provider:this}),t(i,((t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:n,error:t,request:i,provider:this}),r(t);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,r(e)}e(o.result)}))}))}}class rE extends $A{constructor(e,t){null==e&&eE.throwArgumentError("missing provider","provider",e);let n=null,r=null,i=null;"function"==typeof e?(n="unknown:",r=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),i=e,e.request?(""===n&&(n="eip-1193:"),r=function(e){return function(t,n){null==n&&(n=[]);const r={method:t,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Ay(r),provider:this}),e.request(r).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:e,provider:this}),e}))}}(e)):e.sendAsync?r=nE(0,e.sendAsync.bind(e)):e.send?r=nE(0,e.send.bind(e)):eE.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,t),yy(this,"jsonRpcFetchFunc",r),yy(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const iE=new RegExp("^bytes([0-9]+)$"),oE=new RegExp("^(u?int)([0-9]*)$"),aE=new RegExp("^(.*)\\[([0-9]*)\\]$"),sE=new If("solidity/5.7.0");function uE(e,t,n){switch(e){case"address":return n?_f(t,32):Df(t);case"string":return zm(t);case"bytes":return Df(t);case"bool":return t=t?"0x01":"0x00",n?_f(t,32):Df(t)}let r=e.match(oE);if(r){let i=parseInt(r[2]||"256");return(r[2]&&String(i)!==r[2]||i%8!=0||0===i||i>256)&&sE.throwArgumentError("invalid number type","type",e),n&&(i=256),_f(t=Zf.from(t).toTwos(i),i/8)}if(r=e.match(iE),r){const i=parseInt(r[1]);return(String(i)!==r[1]||0===i||i>32)&&sE.throwArgumentError("invalid bytes type","type",e),Df(t).byteLength!==i&&sE.throwArgumentError(`invalid value for ${e}`,"value",t),n?Df((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if(r=e.match(aE),r&&Array.isArray(t)){const n=r[1];parseInt(r[2]||String(t.length))!=t.length&&sE.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(uE(n,e,!0))})),Of(i)}return sE.throwArgumentError("invalid type","type",e)}function cE(e,t){e.length!=t.length&&sE.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const n=[];return e.forEach((function(e,r){n.push(uE(e,t[r]))})),Rf(Of(n))}const lE=new If("units/5.7.0"),dE=["wei","kwei","mwei","gwei","szabo","finney","ether"];function hE(e,t){if("string"==typeof t){const e=dE.indexOf(t);-1!==e&&(t=3*e)}return sy(e,null!=t?t:18)}function pE(e,t){if("string"!=typeof e&&lE.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=dE.indexOf(t);-1!==e&&(t=3*e)}return uy(e,null!=t?t:18)}let fE,yE=()=>fE||(fE="object"==typeof r?r:window,fE);const mE=()=>(void 0===yE()._Web3ClientConfiguration&&(yE()._Web3ClientConfiguration={}),yE()._Web3ClientConfiguration);function gE(e){let t,n=e[0],r=1;for(;rn.call(t,...e))),t=void 0)}return n}class vE extends $A{constructor(e,t,n,r){super(e),this._network=t,this._endpoint=e,this._endpoints=n,this._failover=r,this._pendingBatch=[]}detectNetwork(){return Promise.resolve(Jp.findByName(this._network).id)}requestChunk(e,t){try{const n=e.map((e=>e.request));return rA(t,JSON.stringify(n)).then((t=>{e.forEach(((e,n)=>{const r=t[n];if(gE([r,"optionalAccess",e=>e.error])){const t=new Error(r.error.message);t.code=r.error.code,t.data=r.error.data,e.reject(t)}else gE([r,"optionalAccess",e=>e.result])?e.resolve(r.result):e.reject()}))})).catch((t=>{if(t&&"SERVER_ERROR"==t.code){const t=this._endpoints.indexOf(this._endpoint)+1;this._failover(),this._endpoint=t>=this._endpoints.length?this._endpoints[0]:this._endpoints[t],this.requestChunk(e,this._endpoint)}else e.forEach((e=>{e.reject(t)}))}))}catch(t){e.forEach((e=>{e.reject()}))}}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const r={request:n,resolve:null,reject:null},i=new Promise(((e,t)=>{r.resolve=e,r.reject=t}));return this._pendingBatch.push(r),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=[],this._pendingBatchAggregator=null;const t=[];for(let n=0;n(e.map((e=>e.request)),this.requestChunk(e,this._endpoint))))}),mE().batchInterval||10)),i}}const bE=()=>(null==yE()._Web3ClientProviders&&(yE()._Web3ClientProviders={}),yE()._Web3ClientProviders),wE=(e,t)=>{void 0===bE()[e]&&(bE()[e]=[]);const n=bE()[e].indexOf(t);n>-1&&bE()[e].splice(n,1),bE()[e].unshift(t)},ME=async(e,t,n=!0)=>{let r;bE()[e]=t.map(((r,i)=>new vE(r,e,t,(()=>{1===bE()[e].length?ME(e,t,n):bE()[e].splice(i,1)}))));let i=yE();if(null==i.fetch||void 0!==k&&k.env&&"test"==k.env.NODE_ENV||void 0!==i.cy||!1===n)r=bE()[e][0];else{let n=await Promise.all(t.map((e=>new Promise((async t=>{let n=(new Date).getTime();setTimeout((()=>t(900)),900);if(!(await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({method:"net_version",id:1,jsonrpc:"2.0"})})).ok)return t(999);let r=(new Date).getTime();t(r-n)})))));const i=Math.min(...n),o=n.indexOf(i);r=bE()[e][o]}wE(e,r)};var AE={getProvider:async e=>{let t=bE();if(t&&t[e])return t[e][0];let n=yE();return n._Web3ClientGetProviderPromise&&n._Web3ClientGetProviderPromise[e]||(n._Web3ClientGetProviderPromise||(n._Web3ClientGetProviderPromise={}),n._Web3ClientGetProviderPromise[e]=new Promise((async t=>{await ME(e,Jp[e].endpoints),t(yE()._Web3ClientProviders[e][0])}))),await n._Web3ClientGetProviderPromise[e]},getProviders:async e=>{let t=bE();if(t&&t[e])return t[e];let n=yE();return n._Web3ClientGetProvidersPromise&&n._Web3ClientGetProvidersPromise[e]||(n._Web3ClientGetProvidersPromise||(n._Web3ClientGetProvidersPromise={}),n._Web3ClientGetProvidersPromise[e]=new Promise((async t=>{await ME(e,Jp[e].endpoints),t(yE()._Web3ClientProviders[e])}))),await n._Web3ClientGetProvidersPromise[e]},setProviderEndpoints:ME,setProvider:wE};class EE extends $l{constructor(e,t,n,r){super(e),this._provider=new $l(e),this._network=t,this._endpoint=e,this._endpoints=n,this._failover=r,this._pendingBatch=[],this._rpcRequest=this._rpcRequestReplacement.bind(this)}requestChunk(e){const t=e.map((e=>e.request)),n=t=>{if(t&&["Failed to fetch","limit reached","504","503","502","500","429","426","422","413","409","408","406","405","404","403","402","401","400"].some((e=>t.toString().match(e)))){const t=this._endpoints.indexOf(this._endpoint)+1;this._endpoint=t>=this._endpoints.length?this._endpoints[0]:this._endpoints[t],this._provider=new $l(this._endpoint),this.requestChunk(e)}else e.forEach((e=>{e.reject(t)}))};try{return this._provider._rpcBatchRequest(t).then((t=>{e.forEach(((e,n)=>{const r=t[n];if(function(e){let t,n=e[0],r=1;for(;rn.call(t,...e))),t=void 0)}return n}([r,"optionalAccess",e=>e.error])){const t=new Error(r.error.message);t.code=r.error.code,t.data=r.error.data,e.reject(t)}else r?e.resolve(r):e.reject()}))})).catch(n)}catch(e){return n(e)}}_rpcRequestReplacement(e,t){const n={methodName:e,args:t};null==this._pendingBatch&&(this._pendingBatch=[]);const r={request:n,resolve:null,reject:null},i=new Promise(((e,t)=>{r.resolve=e,r.reject=t}));return this._pendingBatch.push(r),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=[],this._pendingBatchAggregator=null;const t=[];for(let n=0;n(e.map((e=>e.request)),this.requestChunk(e))))}),mE().batchInterval||10)),i}}const TE=()=>(null==yE()._Web3ClientProviders&&(yE()._Web3ClientProviders={}),yE()._Web3ClientProviders),NE=(e,t)=>{void 0===TE()[e]&&(TE()[e]=[]);const n=TE()[e].indexOf(t);n>-1&&TE()[e].splice(n,1),TE()[e].unshift(t)},IE=async(e,t,n=!0)=>{let r;TE()[e]=t.map(((r,i)=>new EE(r,e,t,(()=>{1===TE()[e].length?IE(e,t,n):TE()[e].splice(i,1)}))));let i=yE();if(null==i.fetch||void 0!==k&&k.env&&"test"==k.env.NODE_ENV||void 0!==i.cy||!1===n)r=TE()[e][0];else{let n=await Promise.all(t.map((e=>new Promise((async t=>{let n=(new Date).getTime();setTimeout((()=>t(900)),900);if(!(await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({method:"getIdentity",id:1,jsonrpc:"2.0"})})).ok)return t(999);let r=(new Date).getTime();t(r-n)})))));const i=Math.min(...n),o=n.indexOf(i);r=TE()[e][o]}NE(e,r)};var kE={getProvider:async e=>{let t=TE();if(t&&t[e])return t[e][0];let n=yE();return n._Web3ClientGetProviderPromise&&n._Web3ClientGetProviderPromise[e]||(n._Web3ClientGetProviderPromise||(n._Web3ClientGetProviderPromise={}),n._Web3ClientGetProviderPromise[e]=new Promise((async t=>{await IE(e,Jp[e].endpoints),t(yE()._Web3ClientProviders[e][0])}))),await n._Web3ClientGetProviderPromise[e]},getProviders:async e=>{let t=TE();if(t&&t[e])return t[e];let n=yE();return n._Web3ClientGetProvidersPromise&&n._Web3ClientGetProvidersPromise[e]||(n._Web3ClientGetProvidersPromise||(n._Web3ClientGetProvidersPromise={}),n._Web3ClientGetProvidersPromise[e]=new Promise((async t=>{await IE(e,Jp[e].endpoints),t(yE()._Web3ClientProviders[e])}))),await n._Web3ClientGetProvidersPromise[e]},setProviderEndpoints:IE,setProvider:NE};let LE=["ethereum","bsc","polygon","solana","fantom","arbitrum","avalanche","gnosis","optimism","base"];LE.evm=["ethereum","bsc","polygon","fantom","arbitrum","avalanche","gnosis","optimism","base"],LE.solana=["solana"];let xE=()=>(null==yE()._Web3ClientCacheStore&&(yE()._Web3ClientCacheStore={}),yE()._Web3ClientCacheStore),SE=()=>(null==yE()._Web3ClientPromiseStore&&(yE()._Web3ClientPromiseStore={}),yE()._Web3ClientPromiseStore),jE=function({key:e}){SE()[e]=void 0},CE=function({call:e,key:t,expires:n=0}){return new Promise(((r,i)=>{let o,a=function({key:e}){return SE()[e]}({key:t=JSON.stringify(t)});if(a)return a.then(r).catch(i);(function({key:e,promise:t}){return SE()[e]=t,t})({key:t,promise:new Promise(((a,s)=>0===n?e().then((e=>{r(e),a(e)})).catch((e=>{i(e),s(e)})):(o=function({key:e,expires:t}){let n=xE()[e];if(function(e){let t,n=e[0],r=1;for(;rn.call(t,...e))),t=void 0)}return n}([n,"optionalAccess",e=>e.expiresAt])>Date.now())return n.value}({key:t,expires:n}),o?(r(o),a(o),o):void e().then((e=>{e&&function({key:e,value:t,expires:n}){xE()[e]={expiresAt:Date.now()+n,value:t}}({key:t,value:e,expires:n}),r(e),a(e)})).catch((e=>{i(e),s(e)})))))}).then((()=>{jE({key:t})})).catch((()=>{jE({key:t})}))}))};const DE=async e=>{if(LE.evm.includes(e))return await AE.getProvider(e);if(LE.solana.includes(e))return await kE.getProvider(e);throw"Unknown blockchain: "+e},OE=e=>`(${e.map((e=>"tuple"===e.type?OE(e.components):e.type)).join(",")})`;var zE=({provider:e,from:t,to:n,value:r,method:i,api:o,params:a})=>{if(void 0===o)return e.estimateGas({from:t,to:n,value:r});{let s=new UM(n,o,e),u=s.interface.fragments.find((e=>e.name==i)),c=(({contract:e,method:t,params:n})=>{let r=e.interface.fragments.find((e=>e.name==t));return n instanceof Array?n:n instanceof Object?r.inputs.map((e=>n[e.name])):void 0})({contract:s,method:i,params:a});void 0===s[i]&&(i=`${i}(${u.inputs.map((e=>"tuple"===e.type?OE(e.components):e.type)).join(",")})`);let l=s.estimateGas[i];return c?l(...c,{from:t,value:r}):l({from:t,value:r})}};let _E=async function({blockchain:e,from:t,to:n,value:r,method:i,api:o,params:a,cache:s}){if(!LE.includes(e))throw"Unknown blockchain: "+e;void 0===r&&(r="0");const u=await DE(e);return await CE({expires:s||0,key:[e,t,n,r,i,a],call:async()=>zE({provider:u,from:t,to:n,value:r,method:i,api:o,params:a})})};const PE=({address:e,api:t,method:n,params:r,provider:i,block:o})=>{const a=new UM(e,t,i),s=(({contract:e,method:t,params:n})=>e.interface.fragments.find((e=>e.name==t)).inputs.map(((e,t)=>Array.isArray(n)?n[t]:n[e.name])))({contract:a,method:n,params:r}),u=a.interface.fragments.find((e=>e.name===n));return void 0===a[n]&&(n=`${n}(${u.inputs.map((e=>e.type)).join(",")})`),u&&"nonpayable"===u.stateMutability?a.callStatic[n](...s,{blockTag:o}):a[n](...s,{blockTag:o})},RE=({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a})=>n?PE({address:t,api:n,method:r,params:i,provider:a,block:o}):"latestBlockNumber"===r?a.getBlockNumber():"balance"===r?(({address:e,provider:t})=>t.getBalance(e))({address:t,provider:a}):"transactionCount"===r?(({address:e,provider:t})=>t.getTransactionCount(e))({address:t,provider:a}):void 0;const BE=async({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a,providers:s})=>{try{if(null==r||"getAccountInfo"===r)return null==n&&(n=cp),await(async({address:e,api:t,method:n,params:r,provider:i,block:o})=>{const a=await i.getAccountInfo(new iu(e));if(a&&a.data)return t.decode(a.data)})({address:t,api:n,method:r,params:i,provider:a,block:o});if("getProgramAccounts"===r)return await a.getProgramAccounts(new iu(t),i).then((e=>n?e.map((e=>(e.data=n.decode(e.account.data),e))):e));if("getTokenAccountBalance"===r)return await a.getTokenAccountBalance(new iu(t));if("latestBlockNumber"===r)return await a.getSlot(i||void 0);if("balance"===r)return await(({address:e,provider:t})=>t.getBalance(new iu(e)))({address:t,provider:a})}catch(u){if(s&&u&&["Failed to fetch","limit reached","504","503","502","500","429","426","422","413","409","408","406","405","404","403","402","401","400"].some((e=>u.toString().match(e)))){let u=s[s.indexOf(a)+1]||s[0];return BE({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:u,providers:s})}throw u}};const UE=async function(e,t){const{blockchain:n,address:r,method:i}=(e=>{if("object"==typeof e)return e;let t=e.match(/(?\w+):\/\/(?[\w\d]+)(\/(?[\w\d]+)*)?/);return null==t.groups.part2?t.groups.part1.match(/\d/)?{blockchain:t.groups.blockchain,address:t.groups.part1}:{blockchain:t.groups.blockchain,method:t.groups.part1}:{blockchain:t.groups.blockchain,address:t.groups.part1,method:t.groups.part2}})(e),{api:o,params:a,cache:s,block:u,timeout:c,strategy:l,cacheKey:d}=("object"==typeof e?e:t)||{};return await CE({expires:s||0,key:d||[n,r,i,a,u],call:async()=>{if(LE.evm.includes(n))return await(async({blockchain:e,address:t,api:n,method:r,params:i,block:o,timeout:a,strategy:s})=>{if(s=s||mE().strategy||"failover",a=a||mE().timeout||void 0,"fastest"===s){const s=await AE.getProviders(e);let u=[];const c=s.map((a=>new Promise((s=>{u.push(RE({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a}).then(s))})))),l=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a||1e4)));return u=Promise.all(u.map((e=>new Promise((t=>{e.catch(t)}))))).then((()=>{})),Promise.race([...c,l,u])}{const s=await AE.getProvider(e),u=RE({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:s});return a?(a=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a))),Promise.race([u,a])):u}})({blockchain:n,address:r,api:o,method:i,params:a,block:u,strategy:l,timeout:c});if(LE.solana.includes(n))return await(async({blockchain:e,address:t,api:n,method:r,params:i,block:o,timeout:a,strategy:s})=>{s=s||mE().strategy||"failover",a=a||mE().timeout||void 0;const u=await kE.getProviders(e);if("fastest"===s){let s=[];const c=u.map((a=>new Promise((u=>{s.push(BE({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a}).then(u))})))),l=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a||1e4)));return s=Promise.all(s.map((e=>new Promise((t=>{e.catch(t)}))))).then((()=>{})),Promise.race([...c,l,s])}{const s=await kE.getProvider(e),c=BE({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:s,providers:u});return a?(a=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a))),Promise.race([c,a])):c}})({blockchain:n,address:r,api:o,method:i,params:a,block:u,strategy:l,timeout:c});throw"Unknown blockchain: "+n}})};var WE=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=92)}([function(e,t,n){(function(e){n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return u})),n.d(t,"i",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"e",(function(){return p})),n.d(t,"d",(function(){return f})),n.d(t,"o",(function(){return y})),n.d(t,"n",(function(){return m})),n.d(t,"p",(function(){return g})),n.d(t,"A",(function(){return v})),n.d(t,"z",(function(){return b})),n.d(t,"B",(function(){return w})),n.d(t,"v",(function(){return M})),n.d(t,"u",(function(){return A})),n.d(t,"s",(function(){return N})),n.d(t,"r",(function(){return I})),n.d(t,"t",(function(){return k})),n.d(t,"q",(function(){return L})),n.d(t,"m",(function(){return x})),n.d(t,"l",(function(){return S})),n.d(t,"k",(function(){return j})),n.d(t,"j",(function(){return C})),n.d(t,"x",(function(){return O})),n.d(t,"a",(function(){return z})),n.d(t,"y",(function(){return _})),n.d(t,"w",(function(){return P}));var r=n(22),i=n.n(r),o=n(49),a=n.n(o);function s(e){return new Uint8Array(e)}function u(e,t=!1){const n=e.toString("hex");return t?z(n):n}function c(e){return e.toString("utf8")}function l(e){return e.readUIntBE(0,e.length)}function d(e){return a()(e)}function h(e,t=!1){return u(d(e),t)}function p(e){return c(d(e))}function f(e){return l(d(e))}function y(t){return e.from(O(t),"hex")}function m(e){return s(y(e))}function g(e){return c(y(e))}function v(t){return e.from(t,"utf8")}function b(e){return s(v(e))}function w(e,t=!1){return u(v(e),t)}function M(e){return d(T(E(e)))}function A(e){return T(E(e))}function E(e){return D((e>>>0).toString(2))}function T(e){return new Uint8Array(function(e,t=8){const n=D(e).match(new RegExp(`.{${t}}`,"gi"));return Array.from(n||[])}(e).map((e=>parseInt(e,2))))}function N(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function I(t){return e.isBuffer(t)}function k(e){return i.a.strict(e)&&!I(e)}function L(e){return!k(e)&&!I(e)&&void 0!==e.byteLength}function x(e){return I(e)?"buffer":k(e)?"typed-array":L(e)?"array-buffer":Array.isArray(e)?"array":typeof e}function S(e){return function(e){return!("string"!=typeof e||!new RegExp(/^[01]+$/).test(e))&&e.length%8==0}(e)?"binary":N(e)?"hex":"utf8"}function j(...t){return e.concat(t)}function C(...e){let t=[];return e.forEach((e=>t=t.concat(Array.from(e)))),new Uint8Array([...t])}function D(e,t=8,n="0"){return function(e,t,n="0"){return function(e,t,n,r="0"){const i=t-e.length;let o=e;if(i>0){const t=r.repeat(i);o=n?t+e:e+t}return o}(e,t,!0,n)}(e,function(e,t=8){const n=e%t;return n?(e-n)/t*t+t:e}(e.length,t),n)}function O(e){return e.replace(/^0x/,"")}function z(e){return e.startsWith("0x")?e:"0x"+e}function _(e){return(e=D(e=O(e),2))&&(e=z(e)),e}function P(e){const t=e.startsWith("0x");return e=(e=O(e)).startsWith("0")?e.substring(1):e,t?z(e):e}}).call(this,n(18).Buffer)},function(e,t,n){n.d(t,"g",(function(){return r.detectEnv})),n.d(t,"r",(function(){return r.isMobile})),n.d(t,"m",(function(){return r.isBrowser})),n.d(t,"k",(function(){return r.getLocation})),n.d(t,"i",(function(){return r.getClientMeta})),n.d(t,"B",(function(){return r.setLocal})),n.d(t,"j",(function(){return r.getLocal})),n.d(t,"A",(function(){return r.removeLocal})),n.d(t,"v",(function(){return r.mobileLinkChoiceKey})),n.d(t,"C",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return h})),n.d(t,"f",(function(){return p})),n.d(t,"w",(function(){return N})),n.d(t,"x",(function(){return I})),n.d(t,"z",(function(){return m})),n.d(t,"D",(function(){return g})),n.d(t,"h",(function(){return k})),n.d(t,"u",(function(){return C})),n.d(t,"y",(function(){return D})),n.d(t,"l",(function(){return x})),n.d(t,"a",(function(){return S})),n.d(t,"o",(function(){return b})),n.d(t,"q",(function(){return w})),n.d(t,"p",(function(){return M})),n.d(t,"n",(function(){return A})),n.d(t,"s",(function(){return E})),n.d(t,"t",(function(){return T}));var r=n(21);const i=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],o=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];var a=n(16),s=n.n(a),u=n(0);function c(e){return u.b(new Uint8Array(e))}function l(e,t){return u.c(new Uint8Array(e),!t)}function d(e){return u.f(e).buffer}function h(e){return u.n(e).buffer}function p(e,t){const n=u.x(u.y(new s.a(e).toString(16)));return t?n:u.a(n)}var f=n(50);function y(e){return u.y(e)}const m=n(51).payloadId;function g(){return((e,t)=>{for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t})()}function v(e,t){return u.s(e,t)}function b(e){return void 0!==e.method}function w(e){return void 0!==e.result}function M(e){return void 0!==e.error}function A(e){return void 0!==e.event}function E(e){return i.includes(e)||e.startsWith("wc_")}function T(e){return!!e.method.startsWith("wc_")||!o.includes(e.method)}function N(e){var t,n;return(n=e)&&n.length&&!v(e[0])&&(e[0]=(t=e[0],u.B(t,!0))),e}function I(e){if(void 0!==e.type&&"0"!==e.type)return e;if(void 0===e.from||!(t=e.from)||"0x"!==t.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(t)||!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t)&&t!==function(e){e=Object(u.x)(e.toLowerCase());const t=Object(u.x)(Object(f.keccak_256)((n=e,u.A(n))));var n;let r="";for(let n=0;n7?r+=e[n].toUpperCase():r+=e[n];return Object(u.a)(r)}(t))throw new Error("Transaction object must include a valid 'from' value.");var t;function n(e){let t=e;var n;return("number"==typeof e||"string"==typeof e&&!function(e){return""===e||"string"==typeof e&&""===e.trim()}(e))&&(v(e)?"string"==typeof e&&(t=y(e)):t=p(e)),"string"==typeof t&&(n=t,t=u.w(u.a(n))),t}const r={from:y(e.from),to:void 0===e.to?void 0:y(e.to),gasPrice:void 0===e.gasPrice?"":n(e.gasPrice),gas:void 0===e.gas?void 0===e.gasLimit?"":n(e.gasLimit):n(e.gas),value:void 0===e.value?"":n(e.value),nonce:void 0===e.nonce?"":n(e.nonce),data:void 0===e.data?"":y(e.data)||"0x"},i=["gasPrice","gas","value","nonce"];return Object.keys(r).forEach((e=>{(void 0===r[e]||"string"==typeof r[e]&&!r[e].trim().length)&&i.includes(e)&&delete r[e]})),r}function k(e){const t=e.message||"Failed or Rejected Request";let n=-32e3;if(e&&!e.code)switch(t){case"Parse error":n=-32700;break;case"Invalid request":n=-32600;break;case"Method not found":n=-32601;break;case"Invalid params":n=-32602;break;case"Internal error":n=-32603;break;default:n=-32e3}const r={code:n,message:t};return e.data&&(r.data=e.data),r}var L=n(23);function x(e){const t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return void 0!==t?e.substr(t):""}function S(e,t){let n=j(e);return n=Object.assign(Object.assign({},n),t),function(e){return L.stringify(e)}(n)}function j(e){return L.parse(e)}function C(e){return void 0!==e.bridge}function D(e){const t=e.indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),i=function(e){const t=e.split("@");return{handshakeTopic:t[0],version:parseInt(t[1],10)}}(e.substring(t+1,n)),o=function(e){const t=j(e);return{key:t.key||"",bridge:t.bridge||""}}(void 0!==n?e.substr(n):"");return Object.assign(Object.assign({protocol:r},i),o)}},function(e,t,n){n.d(t,"b",(function(){return i})),n.d(t,"g",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"i",(function(){return c})),n.d(t,"j",(function(){return l})),n.d(t,"h",(function(){return r})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return f}));const r=512,i=256,o=256,a="AES-CBC",s="SHA-"+i,u="HMAC",c="SHA-256",l="SHA-512",d="encrypt",h="decrypt",p="sign",f="verify"},function(e,t,n){n.d(t,"b",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"a",(function(){return u}));const r="INTERNAL_ERROR",i="SERVER_ERROR",o=[-32700,-32600,-32601,-32602,-32603],a=[-32e3,-32099],s={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[r]:{code:-32603,message:"Internal error"},[i]:{code:-32e3,message:"Server error"}},u=i},function(e,t,n){function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function i(e){const t=r(e);if(!t)throw new Error(e+" is not defined in Window");return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=i,t.getDocumentOrThrow=function(){return i("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return i("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return i("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return i("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return i("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(67),t),i(n(68),t)},function(e,t,n){n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return d}));var r=n(5),i=n(2);async function o(e,t=i.a){return r.getSubtleCrypto().importKey("raw",e,function(e){return e===i.a?{length:i.b,name:i.a}:{hash:{name:i.f},name:i.e}}(t),!0,function(e){return e===i.a?[i.d,i.c]:[i.k,i.l]}(t))}async function a(e,t,n){const a=r.getSubtleCrypto(),s=await o(t,i.a),u=await a.encrypt({iv:e,name:i.a},s,n);return new Uint8Array(u)}async function s(e,t,n){const a=r.getSubtleCrypto(),s=await o(t,i.a),u=await a.decrypt({iv:e,name:i.a},s,n);return new Uint8Array(u)}async function u(e,t){const n=r.getSubtleCrypto(),a=await o(e,i.e),s=await n.sign({length:i.g,name:i.e},a,t);return new Uint8Array(s)}async function c(e,t){const n=r.getSubtleCrypto(),a=await o(e,i.e),s=await n.sign({length:i.h,name:i.e},a,t);return new Uint8Array(s)}async function l(e){const t=r.getSubtleCrypto(),n=await t.digest({name:i.i},e);return new Uint8Array(n)}async function d(e){const t=r.getSubtleCrypto(),n=await t.digest({name:i.j},e);return new Uint8Array(n)}},function(e,t){var n,r=[0,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];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return r[e]},t.getBCHDigit=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},t.isKanjiModeEnabled=function(){return void 0!==n},t.toSJIS=function(e){return n(e)}},function(e,t,n){var r=n(44),i=n(45);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!r.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}},function(e,t,n){n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(3);function i(e){return r.c.includes(e)}function o(e){return Object.keys(r.f).includes(e)?r.f[e]:r.f[r.a]}function a(e){return Object.values(r.f).find((t=>t.code===e))||r.f[r.a]}},function(e,t,n){var r=n(19);o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}();var i=o.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function o(e,t,n){return o.TYPED_ARRAY_SUPPORT||this instanceof o?"number"==typeof e?u(this,e):function(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(n<0||t.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function s(e,t){var n;return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t)).__proto__=o.prototype:(null===(n=e)&&(n=new o(t)),n.length=t),n}function u(e,t){var n=s(e,t<0?0:0|a(t));if(!o.TYPED_ARRAY_SUPPORT)for(var r=0;r55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function d(e){return o.isBuffer(e)?e.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!=typeof e&&(e=""+e),0===e.length?0:l(e).length)}o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),o.prototype.write=function(e,t,n){void 0===t||void 0===n&&"string"==typeof t?(n=this.length,t=0):isFinite(t)&&(t|=0,isFinite(n)?n|=0:n=void 0);var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,n,r){return function(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}(l(t,e.length-n),e,n,r)}(this,e,t,n)},o.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i1)for(var n=1;n=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function u(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=6)i=s(e,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==t&&(i=s(e,t,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","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"],l=[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],d=[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];function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],p=d[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modn(p).toString(e);n=(f=f.idivn(p)).isZero()?y+n:c[h-y.length]+y+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function f(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):f(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!=(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(n.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(n.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):n.strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,i=o}i>>>=22,e.words[r-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();r(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(54)(e))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(60);r.__exportStar(n(61),t),r.__exportStar(n(62),t)},function(e,t,n){(function(e){ /*! * The buffer module from node.js, for the browser. diff --git a/dist/umd/index.bundle.js b/dist/umd/index.bundle.js index ef2057d1..1d25f5e6 100644 --- a/dist/umd/index.bundle.js +++ b/dist/umd/index.bundle.js @@ -6,7 +6,7 @@ O=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="functio /*! safe-buffer. MIT License. Feross Aboukhadijeh */ !function(e,t){var n=Dn,r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=o),o.prototype=Object.create(r.prototype),i(r,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(Hn,Hn.exports);var Gn=Hn.exports.Buffer;var qn=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var d=0,h=o-1;(0!==l||d>>0,c[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;var f=Gn.allocUnsafe(r+(o-p));f.fill(0,0,r);for(var y=r;p!==o;)f[y++]=c[p++];return f}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=Gn.from(t)),!Gn.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var d=t[i],h=0,p=u-1;(0!==d||h>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=u-r;f!==u&&0===l[f];)f++;for(var y=s.repeat(n);f>6*n)+r];n>0;){var o=t>>6*(n-1);i.push(128|63&o),n-=1}return i}}tr.prototype={decode:function(e,t){var n;n="object"===z(e)&&e instanceof ArrayBuffer?new Uint8Array(e):"object"===z(e)&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=Jn(t),this._streaming||(this._decoder=new rr({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var r,i=new Xn(n),o=[];!i.endOfStream()&&(r=this._decoder.handler(i,i.read()))!==Kn;)null!==r&&(Array.isArray(r)?o.push.apply(o,r):o.push(r));if(!this._streaming){do{if((r=this._decoder.handler(i,i.read()))===Kn)break;null!==r&&(Array.isArray(r)?o.push.apply(o,r):o.push(r))}while(!i.endOfStream());this._decoder=null}return o.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===o[0]?(this._BOMseen=!0,o.shift()):this._BOMseen=!0)),function(e){for(var t="",n=0;n>10),56320+(1023&r)))}return t}(o)}},nr.prototype={encode:function(e,t){e=e?String(e):"",t=Jn(t),this._streaming||(this._encoder=new ir(this._options)),this._streaming=Boolean(t.stream);for(var n,r=[],i=new Xn(function(e){for(var t=String(e),n=t.length,r=0,i=[];r57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(r===n-1)i.push(65533);else{var a=e.charCodeAt(r+1);if(56320<=a&&a<=57343){var s=1023&o,u=1023&a;i.push(65536+(s<<10)+u),r+=1}else i.push(65533)}r+=1}return i}(e));!i.endOfStream()&&(n=this._encoder.handler(i,i.read()))!==Kn;)Array.isArray(n)?r.push.apply(r,n):r.push(n);if(!this._streaming){for(;(n=this._encoder.handler(i,i.read()))!==Kn;)Array.isArray(n)?r.push.apply(r,n):r.push(n);this._encoder=null}return new Uint8Array(r)}};var or=j(Object.freeze({__proto__:null,TextEncoder:nr,TextDecoder:tr})),ar=x&&x.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),sr=x&&x.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ur=x&&x.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":z(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},cr=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&ar(t,e,n);return sr(t,e),t},lr=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vn,"__esModule",{value:!0});var dr=Vn.deserializeUnchecked=kr=Vn.deserialize=Tr=Vn.serialize=Vn.BinaryReader=Vn.BinaryWriter=Vn.BorshError=Vn.baseDecode=Vn.baseEncode=void 0,hr=lr(Cn.exports),pr=lr(qn),fr=cr(or),yr=new("function"!=typeof TextDecoder?fr.TextDecoder:TextDecoder)("utf-8",{fatal:!0});Vn.baseEncode=function(e){return"string"==typeof e&&(e=Te.from(e,"utf8")),pr.default.encode(Te.from(e))},Vn.baseDecode=function(e){return Te.from(pr.default.decode(e))};var mr=1024,gr=function(e){Q(n,e);var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,e)).fieldPath=[],r.originalMessage=e,r}return U(n,[{key:"addToFieldPath",value:function(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}]),n}(G(Error));Vn.BorshError=gr;var vr=function(){function e(){R(this,e),this.buf=Te.alloc(mr),this.length=0}return U(e,[{key:"maybeResize",value:function(){this.buf.length<16+this.length&&(this.buf=Te.concat([this.buf,Te.alloc(mr)]))}},{key:"writeU8",value:function(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}},{key:"writeU16",value:function(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}},{key:"writeU32",value:function(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}},{key:"writeU64",value:function(e){this.maybeResize(),this.writeBuffer(Te.from(new hr.default(e).toArray("le",8)))}},{key:"writeU128",value:function(e){this.maybeResize(),this.writeBuffer(Te.from(new hr.default(e).toArray("le",16)))}},{key:"writeU256",value:function(e){this.maybeResize(),this.writeBuffer(Te.from(new hr.default(e).toArray("le",32)))}},{key:"writeU512",value:function(e){this.maybeResize(),this.writeBuffer(Te.from(new hr.default(e).toArray("le",64)))}},{key:"writeBuffer",value:function(e){this.buf=Te.concat([Te.from(this.buf.subarray(0,this.length)),e,Te.alloc(mr)]),this.length+=e.length}},{key:"writeString",value:function(e){this.maybeResize();var t=Te.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}},{key:"writeFixedArray",value:function(e){this.writeBuffer(Te.from(e))}},{key:"writeArray",value:function(e,t){this.maybeResize(),this.writeU32(e.length);var n,r=se(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.maybeResize(),t(i)}}catch(e){r.e(e)}finally{r.f()}}},{key:"toArray",value:function(){return this.buf.subarray(0,this.length)}}]),e}();function br(e,t,n){var r=n.value;n.value=function(){try{for(var e=arguments.length,t=new Array(e),n=0;n=0)throw new gr("Reached the end of buffer when deserializing")}throw e}}}Vn.BinaryWriter=vr;var wr=function(){function e(t){R(this,e),this.buf=t,this.offset=0}return U(e,[{key:"readU8",value:function(){var e=this.buf.readUInt8(this.offset);return this.offset+=1,e}},{key:"readU16",value:function(){var e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}},{key:"readU32",value:function(){var e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}},{key:"readU64",value:function(){var e=this.readBuffer(8);return new hr.default(e,"le")}},{key:"readU128",value:function(){var e=this.readBuffer(16);return new hr.default(e,"le")}},{key:"readU256",value:function(){var e=this.readBuffer(32);return new hr.default(e,"le")}},{key:"readU512",value:function(){var e=this.readBuffer(64);return new hr.default(e,"le")}},{key:"readBuffer",value:function(e){if(this.offset+e>this.buf.length)throw new gr("Expected buffer length ".concat(e," isn't within bounds"));var t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}},{key:"readString",value:function(){var e=this.readU32(),t=this.readBuffer(e);try{return yr.decode(t)}catch(e){throw new gr("Error decoding UTF-8 string: ".concat(e))}}},{key:"readFixedArray",value:function(e){return new Uint8Array(this.readBuffer(e))}},{key:"readArray",value:function(e){for(var t=this.readU32(),n=Array(),r=0;r2&&void 0!==arguments[2]?arguments[2]:vr,r=new n;return Er(e,t,r),r.toArray()};function Nr(e,t,n,r){try{if("string"==typeof n)return r["read".concat(Mr(n))]();if(n instanceof Array){if("number"==typeof n[0])return r.readFixedArray(n[0]);if("number"==typeof n[1]){for(var i=[],o=0;o=r.values.length)throw new gr("Enum index: ".concat(l," is out of range"));var d=ee(r.values[l],2),h=d[0];return new t(W({},h,Nr(e,h,d[1],n)))}throw new gr("Unexpected schema kind: ".concat(r.kind," for ").concat(t.constructor.name))}var kr=Vn.deserialize=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wr,i=new r(n),o=Ir(e,t,i);if(i.offset3&&void 0!==arguments[3]?arguments[3]:wr,i=new r(n);return Ir(e,t,i)};var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.s16=Lr.s8=Lr.nu64be=Lr.u48be=Lr.u40be=Lr.u32be=Lr.u24be=Lr.u16be=mi=Lr.nu64=Lr.u48=Lr.u40=yi=Lr.u32=Lr.u24=fi=Lr.u16=pi=Lr.u8=hi=Lr.offset=Lr.greedy=Lr.Constant=Lr.UTF8=Lr.CString=Lr.Blob=Lr.Boolean=Lr.BitField=Lr.BitStructure=Lr.VariantLayout=Lr.Union=Lr.UnionLayoutDiscriminator=Lr.UnionDiscriminator=Lr.Structure=Lr.Sequence=Lr.DoubleBE=Lr.Double=Lr.FloatBE=Lr.Float=Lr.NearInt64BE=Lr.NearInt64=Lr.NearUInt64BE=Lr.NearUInt64=Lr.IntBE=Lr.Int=Lr.UIntBE=Lr.UInt=Lr.OffsetLayout=Lr.GreedyCount=Lr.ExternalLayout=Lr.bindConstructorLayout=Lr.nameWithProperty=Lr.Layout=Lr.uint8ArrayToBuffer=Lr.checkUint8Array=void 0,Lr.constant=Lr.utf8=Lr.cstr=wi=Lr.blob=Lr.unionLayoutDiscriminator=Lr.union=bi=Lr.seq=Lr.bits=vi=Lr.struct=Lr.f64be=Lr.f64=Lr.f32be=Lr.f32=Lr.ns64be=Lr.s48be=Lr.s40be=Lr.s32be=Lr.s24be=Lr.s16be=gi=Lr.ns64=Lr.s48=Lr.s40=Lr.s32=Lr.s24=void 0;var xr=Dn;function Sr(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function jr(e){return Sr(e),xr.Buffer.from(e.buffer,e.byteOffset,e.length)}Lr.checkUint8Array=Sr,Lr.uint8ArrayToBuffer=jr;var Cr=function(){function e(t,n){if(R(this,e),!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=n}return U(e,[{key:"makeDestinationObject",value:function(){return{}}},{key:"getSpan",value:function(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function Dr(e,t){return t.property?e+"["+t.property+"]":e}Lr.Layout=Cr,Lr.nameWithProperty=Dr,Lr.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(e,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Cr))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var Or=function(e){Q(n,e);var t=X(n);function n(){return R(this,n),t.apply(this,arguments)}return U(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}(Cr);Lr.ExternalLayout=Or;var zr=function(e){Q(n,e);var t=X(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1?arguments[1]:void 0;if(R(this,n),!Number.isInteger(r)||0>=r)throw new TypeError("elementSpan must be a (positive) integer");return(e=t.call(this,-1,i)).elementSpan=r,e}return U(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Sr(e);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}(Or);Lr.GreedyCount=zr;var _r=function(e){Q(n,e);var t=X(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;if(R(this,n),!(e instanceof Cr))throw new TypeError("layout must be a Layout");if(!Number.isInteger(i))throw new TypeError("offset must be integer or undefined");return(r=t.call(this,e.span,o||e.property)).layout=e,r.offset=i,r}return U(n,[{key:"isCount",value:function(){return this.layout instanceof Pr||this.layout instanceof Rr}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.layout.encode(e,t,n+this.offset)}}]),n}(Or);Lr.OffsetLayout=_r;var Pr=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return jr(e).readUIntLE(t,this.span)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return jr(t).writeUIntLE(e,n,this.span),this.span}}]),n}(Cr);Lr.UInt=Pr;var Rr=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return jr(e).readUIntBE(t,this.span)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return jr(t).writeUIntBE(e,n,this.span),this.span}}]),n}(Cr);Lr.UIntBE=Rr;var Br=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return jr(e).readIntLE(t,this.span)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return jr(t).writeIntLE(e,n,this.span),this.span}}]),n}(Cr);Lr.Int=Br;var Ur=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return jr(e).readIntBE(t,this.span)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return jr(t).writeIntBE(e,n,this.span),this.span}}]),n}(Cr);Lr.IntBE=Ur;var Wr=Math.pow(2,32);function Qr(e){var t=Math.floor(e/Wr);return{hi32:t,lo32:e-t*Wr}}function Yr(e,t){return e*Wr+t}var Fr=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=jr(e),r=n.readUInt32LE(t),i=n.readUInt32LE(t+4);return Yr(i,r)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Qr(e),i=jr(t);return i.writeUInt32LE(r.lo32,n),i.writeUInt32LE(r.hi32,n+4),8}}]),n}(Cr);Lr.NearUInt64=Fr;var Vr=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=jr(e),r=n.readUInt32BE(t),i=n.readUInt32BE(t+4);return Yr(r,i)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Qr(e),i=jr(t);return i.writeUInt32BE(r.hi32,n),i.writeUInt32BE(r.lo32,n+4),8}}]),n}(Cr);Lr.NearUInt64BE=Vr;var Hr=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=jr(e),r=n.readUInt32LE(t),i=n.readInt32LE(t+4);return Yr(i,r)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Qr(e),i=jr(t);return i.writeUInt32LE(r.lo32,n),i.writeInt32LE(r.hi32,n+4),8}}]),n}(Cr);Lr.NearInt64=Hr;var Gr=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=jr(e),r=n.readInt32BE(t),i=n.readUInt32BE(t+4);return Yr(r,i)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Qr(e),i=jr(t);return i.writeInt32BE(r.hi32,n),i.writeUInt32BE(r.lo32,n+4),8}}]),n}(Cr);Lr.NearInt64BE=Gr;var qr=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return jr(e).readFloatLE(t)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return jr(t).writeFloatLE(e,n),4}}]),n}(Cr);Lr.Float=qr;var Zr=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return jr(e).readFloatBE(t)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return jr(t).writeFloatBE(e,n),4}}]),n}(Cr);Lr.FloatBE=Zr;var Jr=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return jr(e).readDoubleLE(t)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return jr(t).writeDoubleLE(e,n),8}}]),n}(Cr);Lr.Double=Jr;var Xr=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return jr(e).readDoubleBE(t)}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return jr(t).writeDoubleBE(e,n),8}}]),n}(Cr);Lr.DoubleBE=Xr;var Kr=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Cr))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Or&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(r instanceof Or)&&01&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var n=0,r=this.count;if(r instanceof Or&&(r=r.decode(e,t)),01&&void 0!==arguments[1]?arguments[1]:0,n=[],r=0,i=this.count;for(i instanceof Or&&(i=i.decode(e,t));r2&&void 0!==arguments[2]?arguments[2]:0,r=this.elementLayout,i=e.reduce((function(e,i){return e+r.encode(i,t,n+e)}),0);return this.count instanceof Or&&this.count.encode(e.length,t,n),i}}]),n}(Cr);Lr.Sequence=Kr;var $r=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;if(R(this,n),!Array.isArray(e)||!e.reduce((function(e,t){return e&&t instanceof Cr}),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof r&&void 0===i&&(i=r,r=void 0);var a,s=se(e);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(0>u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(e){s.e(e)}finally{s.f()}var c=-1;try{c=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(e){}return(o=t.call(this,c,r)).fields=e,o.decodePrefixes=!!i,o}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var n=0;try{n=this.fields.reduce((function(n,r){var i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(e){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Sr(e);var n,r=this.makeDestinationObject(),i=se(this.fields);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(void 0!==o.property&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"encode",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=r,o=0,a=0,s=se(this.fields);try{for(s.s();!(n=s.n()).done;){var u=n.value,c=u.span;if(a=0c&&(c=u.getSpan(t,r)))}o=r,r+=c}}catch(e){s.e(e)}finally{s.f()}return o+a-i}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=se(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;void 0!==i.property&&0i.span?n=-1:0<=n&&(n+=i.span)}}catch(e){r.e(e)}finally{r.f()}}}]),n}(Cr);Lr.Structure=$r;var ei=function(){function e(t){R(this,e),this.property=t}return U(e,[{key:"decode",value:function(e,t){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(e,t,n){throw new Error("UnionDiscriminator is abstract")}}]),e}();Lr.UnionDiscriminator=ei;var ti=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Or&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,r||e.property||"variant")).layout=e,i}return U(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}(ei);Lr.UnionLayoutDiscriminator=ti;var ni=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o,a;if(R(this,n),e instanceof Pr||e instanceof Rr)a=new ti(new _r(e));else if(e instanceof Or&&e.isCount())a=new ti(e);else{if(!(e instanceof ei))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");a=e}if(void 0===r&&(r=null),!(null===r||r instanceof Cr))throw new TypeError("defaultLayout must be null or a Layout");if(null!==r){if(0>r.span)throw new Error("defaultLayout must have constant span");void 0===r.property&&(r=r.replicate("content"))}var s=-1;r&&0<=(s=r.span)&&(e instanceof Pr||e instanceof Rr)&&(s+=a.layout.span),(o=t.call(this,s,i)).discriminator=a,o.usesPrefixDiscriminator=e instanceof Pr||e instanceof Rr,o.defaultLayout=r,o.registry={};var u=o.defaultGetSourceVariant.bind(Z(o));return o.getSourceVariant=function(e){return u(e)},o.configGetSourceVariant=function(e){u=e.bind(this)},o}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.discriminator,i=r.decode(e,n),o=this.registry[i];if(void 0===o){var a=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=r.layout.span),(t=this.makeDestinationObject())[r.property]=i,t[a.property]=a.decode(e,n+s)}else t=o.decode(e,n);return t}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getSourceVariant(e);if(void 0===r){var i=this.discriminator,o=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,n),a+o.encode(e[o.property],t,n+a)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new ri(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t=e instanceof Uint8Array?this.discriminator.decode(e,n):e,this.registry[t]}}]),n}(Cr);Lr.Union=ni;var ri=function(e){Q(n,e);var t=X(n);function n(e,r,i,o){var a;if(R(this,n),!(e instanceof ni))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof i&&void 0===o&&(o=i,i=null),i){if(!(i instanceof Cr))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof o)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=i?i.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(a=t.call(this,s,o)).union=e,a.variant=r,a.layout=i||null,a}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;var n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);var r=0;return this.layout&&(r=this.layout.getSpan(e,t+n)),n+r}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}(Cr);function ii(e){return 0>e&&(e+=4294967296),e}Lr.VariantLayout=ri;var oi=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Pr||e instanceof Rr))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof r&&void 0===i&&(i=r,r=!1),41&&void 0!==arguments[1]?arguments[1]:0,n=this.makeDestinationObject(),r=this.word.decode(e,t);this._packedSetValue(r);var i,o=se(this.fields);try{for(o.s();!(i=o.n()).done;){var a=i.value;void 0!==a.property&&(n[a.property]=a.decode(e))}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.word.decode(t,n);this._packedSetValue(r);var i,o=se(this.fields);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(void 0!==a.property){var s=e[a.property];void 0!==s&&a.encode(s)}}}catch(e){o.e(e)}finally{o.f()}return this.word.encode(this._packedGetValue(),t,n)}},{key:"addField",value:function(e,t){var n=new ai(this,e,t);return this.fields.push(n),n}},{key:"addBoolean",value:function(e){var t=new si(this,e);return this.fields.push(t),t}},{key:"fieldFor",value:function(e){if("string"!=typeof e)throw new TypeError("property must be string");var t,n=se(this.fields);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.property===e)return r}}catch(e){n.e(e)}finally{n.f()}}}]),n}(Cr);Lr.BitStructure=oi;var ai=function(){function e(t,n,r){if(R(this,e),!(t instanceof oi))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");var i=8*t.span,o=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+o>i)throw new Error("bits too long for span remainder ("+(i-o)+" of "+i+" remain)");this.container=t,this.bits=n,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if("number"!=typeof e||!Number.isInteger(e)||e!==ii(e&this.valueMask))throw new TypeError(Dr("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=ii(e<n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.span;return 0>n&&(n=this.length.decode(e,t)),jr(e).slice(t,t+n)}},{key:"encode",value:function(e,t,n){var r=this.length;if(this.length instanceof Or&&(r=e.length),!(e instanceof Uint8Array&&r===e.length))throw new TypeError(Dr("Blob.encode",this)+" requires (length "+r+") Uint8Array as src");if(n+r>t.length)throw new RangeError("encoding overruns Uint8Array");var i=jr(e);return jr(t).write(i.toString("hex"),n,r,"hex"),this.length instanceof Or&&this.length.encode(r,t,n),r}}]),n}(Cr);Lr.Blob=ui;var ci=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,-1,e)}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Sr(e);for(var n=t;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.getSpan(e,t);return jr(e).slice(t,t+n-1).toString("utf-8")}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;"string"!=typeof e&&(e=String(e));var r=xr.Buffer.from(e,"utf8"),i=r.length;if(n+i>t.length)throw new RangeError("encoding overruns Buffer");var o=jr(t);return r.copy(o,n),o[n+i]=0,i+1}}]),n}(Cr);Lr.CString=ci;var li=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),"string"==typeof e&&void 0===r&&(r=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=t.call(this,-1,r)).maxSpan=e,i}return U(n,[{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Sr(e),e.length-t}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan2&&void 0!==arguments[2]?arguments[2]:0;"string"!=typeof e&&(e=String(e));var r=xr.Buffer.from(e,"utf8"),i=r.length;if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return r.copy(jr(t),n),i}}]),n}(Cr);Lr.UTF8=li;var di=function(e){Q(n,e);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,0,r)).value=e,i}return U(n,[{key:"decode",value:function(e,t){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}(Cr);Lr.Constant=di,Lr.greedy=function(e,t){return new zr(e,t)};var hi=Lr.offset=function(e,t,n){return new _r(e,t,n)},pi=Lr.u8=function(e){return new Pr(1,e)},fi=Lr.u16=function(e){return new Pr(2,e)};Lr.u24=function(e){return new Pr(3,e)};var yi=Lr.u32=function(e){return new Pr(4,e)};Lr.u40=function(e){return new Pr(5,e)},Lr.u48=function(e){return new Pr(6,e)};var mi=Lr.nu64=function(e){return new Fr(e)};Lr.u16be=function(e){return new Rr(2,e)},Lr.u24be=function(e){return new Rr(3,e)},Lr.u32be=function(e){return new Rr(4,e)},Lr.u40be=function(e){return new Rr(5,e)},Lr.u48be=function(e){return new Rr(6,e)},Lr.nu64be=function(e){return new Vr(e)},Lr.s8=function(e){return new Br(1,e)},Lr.s16=function(e){return new Br(2,e)},Lr.s24=function(e){return new Br(3,e)},Lr.s32=function(e){return new Br(4,e)},Lr.s40=function(e){return new Br(5,e)},Lr.s48=function(e){return new Br(6,e)};var gi=Lr.ns64=function(e){return new Hr(e)};Lr.s16be=function(e){return new Ur(2,e)},Lr.s24be=function(e){return new Ur(3,e)},Lr.s32be=function(e){return new Ur(4,e)},Lr.s40be=function(e){return new Ur(5,e)},Lr.s48be=function(e){return new Ur(6,e)},Lr.ns64be=function(e){return new Gr(e)},Lr.f32=function(e){return new qr(e)},Lr.f32be=function(e){return new Zr(e)},Lr.f64=function(e){return new Jr(e)},Lr.f64be=function(e){return new Xr(e)};var vi=Lr.struct=function(e,t,n){return new $r(e,t,n)};Lr.bits=function(e,t,n){return new oi(e,t,n)};var bi=Lr.seq=function(e,t,n){return new Kr(e,t,n)};Lr.union=function(e,t,n){return new ni(e,t,n)},Lr.unionLayoutDiscriminator=function(e,t){return new ti(e,t)};var wi=Lr.blob=function(e,t){return new ui(e,t)};Lr.cstr=function(e){return new ci(e)},Lr.utf8=function(e,t){return new li(e,t)},Lr.constant=function(e,t){return new di(e,t)};var Mi={};Object.defineProperty(Mi,"__esModule",{value:!0});var Ai=Mi.toBigIntLE=function(e){var t=Te.from(e);t.reverse();var n=t.toString("hex");return 0===n.length?BigInt(0):BigInt("0x".concat(n))};Mi.toBigIntBE=function(e){var t=e.toString("hex");return 0===t.length?BigInt(0):BigInt("0x".concat(t))};var Ei=Mi.toBufferLE=function(e,t){var n=e.toString(16),r=Te.from(n.padStart(2*t,"0").slice(0,2*t),"hex");return r.reverse(),r};Mi.toBufferBE=function(e,t){var n=e.toString(16);return Te.from(n.padStart(2*t,"0").slice(0,2*t),"hex")};var Ti=["message"],Ni=O().mark(Ci),Ii=function(e){Q(n,e);var t=X(n);function n(e,r){var i,o;R(this,n);var a=e.message,s=q(e,Ti),u=e.path,c=0===u.length?a:"At path: "+u.join(".")+" -- "+a;return i=t.call(this,c),Object.assign(Z(i),s),i.name=i.constructor.name,i.failures=function(){var t;return null!=(t=o)?t:o=[e].concat(te(r()))},i}return U(n)}(G(TypeError));function ki(e){return Li(e)&&"function"==typeof e[Symbol.iterator]}function Li(e){return"object"===z(e)&&null!=e}function xi(e){return"string"==typeof e?JSON.stringify(e):""+e}function Si(e){var t=e.next(),n=t.done,r=t.value;return n?void 0:r}function ji(e,t,n,r){if(!0!==e){!1===e?e={}:"string"==typeof e&&(e={message:e});var i=t.path,o=t.branch,a=n.type,s=e,u=s.refinement,c=s.message,l=void 0===c?"Expected a value of type `"+a+"`"+(u?" with refinement `"+u+"`":"")+", but received: `"+xi(r)+"`":c;return D(D({value:r,type:a,refinement:u,key:i[i.length-1],path:i,branch:o},e),{},{message:l})}}function Ci(e,t,n,r){var i,o,a,s;return O().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:ki(e)||(e=[e]),i=se(e),u.prev=2,i.s();case 4:if((o=i.n()).done){u.next=12;break}if(a=o.value,!(s=ji(a,t,n,r))){u.next=10;break}return u.next=10,s;case 10:u.next=4;break;case 12:u.next=17;break;case 14:u.prev=14,u.t0=u.catch(2),i.e(u.t0);case 17:return u.prev=17,i.f(),u.finish(17);case 20:case"end":return u.stop()}}),Ni,null,[[2,14,17,20]])}function Di(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return O().mark((function r(){var i,o,a,s,u,c,l,d,h,p,f,y,m,g,v,b,w,M,A,E,T,N,I,k,L,x,S;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=n.path,o=void 0===i?[]:i,a=n.branch,s=void 0===a?[e]:a,u=n.coerce,c=void 0!==u&&u,l=n.mask,d=void 0!==l&&l,h={path:o,branch:s},c&&(e=t.coercer(e,h),d&&"type"!==t.type&&Li(t.schema)&&Li(e)&&!Array.isArray(e)))for(p in e)void 0===t.schema[p]&&delete e[p];f=!0,y=se(t.validator(e,h)),r.prev=5,y.s();case 7:if((m=y.n()).done){r.next=14;break}return g=m.value,f=!1,r.next=12,[g,void 0];case 12:r.next=7;break;case 14:r.next=19;break;case 16:r.prev=16,r.t0=r.catch(5),y.e(r.t0);case 19:return r.prev=19,y.f(),r.finish(19);case 22:v=se(t.entries(e,h)),r.prev=23,v.s();case 25:if((b=v.n()).done){r.next=52;break}w=ee(b.value,3),M=w[0],A=w[1],E=w[2],T=Di(A,E,{path:void 0===M?o:[].concat(te(o),[M]),branch:void 0===M?s:[].concat(te(s),[A]),coerce:c,mask:d}),N=se(T),r.prev=29,N.s();case 31:if((I=N.n()).done){r.next=42;break}if(!(k=I.value)[0]){r.next=39;break}return f=!1,r.next=37,[k[0],void 0];case 37:r.next=40;break;case 39:c&&(A=k[1],void 0===M?e=A:e instanceof Map?e.set(M,A):e instanceof Set?e.add(A):Li(e)&&(e[M]=A));case 40:r.next=31;break;case 42:r.next=47;break;case 44:r.prev=44,r.t1=r.catch(29),N.e(r.t1);case 47:return r.prev=47,N.f(),r.finish(47);case 50:r.next=25;break;case 52:r.next=57;break;case 54:r.prev=54,r.t2=r.catch(23),v.e(r.t2);case 57:return r.prev=57,v.f(),r.finish(57);case 60:if(!f){r.next=79;break}L=se(t.refiner(e,h)),r.prev=62,L.s();case 64:if((x=L.n()).done){r.next=71;break}return S=x.value,f=!1,r.next=69,[S,void 0];case 69:r.next=64;break;case 71:r.next=76;break;case 73:r.prev=73,r.t3=r.catch(62),L.e(r.t3);case 76:return r.prev=76,L.f(),r.finish(76);case 79:if(!f){r.next=82;break}return r.next=82,[void 0,e];case 82:case"end":return r.stop()}}),r,null,[[5,16,19,22],[23,54,57,60],[29,44,47,50],[62,73,76,79]])}))()}var Oi,zi=function(){function e(t){var n=this;R(this,e);var r=t.type,i=t.schema,o=t.validator,a=t.refiner,s=t.coercer,u=void 0===s?function(e){return e}:s,c=t.entries,l=void 0===c?O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})):c;this.type=r,this.schema=i,this.entries=l,this.coercer=u,this.validator=o?function(e,t){return Ci(o(e,t),t,n,e)}:function(){return[]},this.refiner=a?function(e,t){return Ci(a(e,t),t,n,e)}:function(){return[]}}return U(e,[{key:"assert",value:function(e){return _i(e,this)}},{key:"create",value:function(e){return Pi(e,this)}},{key:"is",value:function(e){return Ri(e,this)}},{key:"mask",value:function(e){return function(e,t){var n=Bi(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}(e,this)}},{key:"validate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Bi(e,this,t)}}]),e}();function _i(e,t){var n=Bi(e,t);if(n[0])throw n[0]}function Pi(e,t){var n=Bi(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}function Ri(e,t){return!Bi(e,t)[0]}function Bi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Di(e,t,n),i=Si(r);if(i[0]){var o=new Ii(i[0],O().mark((function e(){var t,n,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=se(r),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if(!(i=n.value)[0]){e.next=8;break}return e.next=8,i[0];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])})));return[o,void 0]}var a=i[1];return[void 0,a]}function Ui(e,t){return new zi({type:e,schema:null,validator:t})}function Wi(e){return new zi({type:"array",schema:e,entries:O().mark((function t(n){var r,i,o,a,s;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e||!Array.isArray(n)){t.next=18;break}r=se(n.entries()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=ee(i.value,2),a=o[0],s=o[1],t.next=8,[a,s,e];case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[2,12,15,18]])})),coercer:function(e){return Array.isArray(e)?e.slice():e},validator:function(e){return Array.isArray(e)||"Expected an array value, but received: "+xi(e)}})}function Qi(){return Ui("boolean",(function(e){return"boolean"==typeof e}))}function Yi(e){return Ui("instance",(function(t){return t instanceof e||"Expected a `"+e.name+"` instance, but received: "+xi(t)}))}function Fi(e){var t=xi(e),n=z(e);return new zi({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:function(n){return n===e||"Expected the literal `"+t+"`, but received: "+xi(n)}})}function Vi(e){return new zi(D(D({},e),{},{validator:function(t,n){return null===t||e.validator(t,n)},refiner:function(t,n){return null===t||e.refiner(t,n)}}))}function Hi(){return Ui("number",(function(e){return"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+xi(e)}))}function Gi(e){return new zi(D(D({},e),{},{validator:function(t,n){return void 0===t||e.validator(t,n)},refiner:function(t,n){return void 0===t||e.refiner(t,n)}}))}function qi(e,t){return new zi({type:"record",schema:null,entries:O().mark((function n(r){var i,o;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Li(r)){n.next=11;break}n.t0=O().keys(r);case 2:if((n.t1=n.t0()).done){n.next=11;break}return i=n.t1.value,o=r[i],n.next=7,[i,i,e];case 7:return n.next=9,[i,o,t];case 9:n.next=2;break;case 11:case"end":return n.stop()}}),n)})),validator:function(e){return Li(e)||"Expected an object, but received: "+xi(e)}})}function Zi(){return Ui("string",(function(e){return"string"==typeof e||"Expected a string, but received: "+xi(e)}))}function Ji(e){var t=Ui("never",(function(){return!1}));return new zi({type:"tuple",schema:null,entries:O().mark((function n(r){var i,o;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=9;break}i=Math.max(e.length,r.length),o=0;case 3:if(!(o1&&void 0!==arguments[1]?arguments[1]:0,n=(so[e[t+0]]+so[e[t+1]]+so[e[t+2]]+so[e[t+3]]+"-"+so[e[t+4]]+so[e[t+5]]+"-"+so[e[t+6]]+so[e[t+7]]+"-"+so[e[t+8]]+so[e[t+9]]+"-"+so[e[t+10]]+so[e[t+11]]+so[e[t+12]]+so[e[t+13]]+so[e[t+14]]+so[e[t+15]]).toLowerCase();if(!io(n))throw TypeError("Stringified UUID is invalid");return n}var lo=0,ho=0;function po(e){if(!io(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function fo(e,t,n){function r(e,r,i,o){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n>>9<<4)+1}function mo(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function go(e,t,n,r,i,o){return mo((a=mo(mo(t,e),mo(r,o)))<<(s=i)|a>>>32-s,n);var a,s}function vo(e,t,n,r,i,o,a){return go(t&n|~t&r,e,t,i,o,a)}function bo(e,t,n,r,i,o,a){return go(t&r|n&~r,e,t,i,o,a)}function wo(e,t,n,r,i,o,a){return go(t^n^r,e,t,i,o,a)}function Mo(e,t,n,r,i,o,a){return go(n^(t|~r),e,t,i,o,a)}var Ao=fo("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n>5]>>>i%32&255,a=parseInt(r.charAt(o>>>4&15)+r.charAt(15&o),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[r/8])<>>32-t}var No=fo("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i>>0;b=v,v=g,g=To(m,30)>>>0,m=y,y=A}n[0]=n[0]+y>>>0,n[1]=n[1]+m>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var Io=j(Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,i=t||new Array(16),o=(e=e||{}).node||oo,a=void 0!==e.clockseq?e.clockseq:ao;if(null==o||null==a){var s=e.random||(e.rng||no)();null==o&&(o=oo=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=ao=16383&(s[6]<<8|s[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:ho+1,l=u-lo+(c-ho)/1e4;if(l<0&&void 0===e.clockseq&&(a=a+1&16383),(l<0||u>lo)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");lo=u,ho=c,ao=a;var d=(1e4*(268435455&(u+=122192928e5))+c)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=255&d;var h=u/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var p=0;p<6;++p)i[r+p]=o[p];return t||co(i)},v3:Ao,v4:function(e,t,n){var r=(e=e||{}).random||(e.rng||no)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return co(r)},v5:No,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!io(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:io,stringify:co,parse:po})),ko=Io.v4,Lo=function(e,t,n,r){if("string"!=typeof e)throw new TypeError(e+" must be a string");var i="number"==typeof(r=r||{}).version?r.version:2;if(1!==i&&2!==i)throw new TypeError(i+" must be 1 or 2");var o={method:e};if(2===i&&(o.jsonrpc="2.0"),t){if("object"!==z(t)&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");o.params=t}if(void 0===n){var a="function"==typeof r.generator?r.generator:function(){return ko()};o.id=a(o,r)}else 2===i&&null===n?r.notificationIdNull&&(o.id=null):o.id=n;return o},xo=Io.v4,So=Lo,jo=function e(t,n){if(!(this instanceof e))return new e(t,n);n||(n={}),this.options={reviver:void 0!==n.reviver?n.reviver:null,replacer:void 0!==n.replacer?n.replacer:null,generator:void 0!==n.generator?n.generator:function(){return xo()},version:void 0!==n.version?n.version:2,notificationIdNull:"boolean"==typeof n.notificationIdNull&&n.notificationIdNull},this.callServer=t},Co=jo;jo.prototype.request=function(e,t,n,r){var i=this,o=null,a=Array.isArray(e)&&"function"==typeof t;if(1===this.options.version&&a)throw new TypeError("JSON-RPC 1.0 does not support batching");var s,u=!a&&e&&"object"===z(e)&&"function"==typeof t;if(a||u)r=t,o=e;else{"function"==typeof n&&(r=n,n=void 0);var c="function"==typeof r;try{o=So(e,t,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(e){if(c)return r(e);throw e}if(!c)return o}try{s=JSON.stringify(o,this.options.replacer)}catch(e){return r(e)}return this.callServer(s,(function(e,t){i._parseResponse(e,t,r)})),o},jo.prototype._parseResponse=function(e,t,n){if(e)n(e);else{if(!t)return n();var r;try{r=JSON.parse(t,this.options.reviver)}catch(e){return n(e)}if(3===n.length){if(Array.isArray(r)){var i=function(e){return void 0!==e.error};return n(null,r.filter(i),r.filter((function(e){return!i(e)})))}return n(null,r.error,r.result)}n(null,r)}};var Do=Co,Oo={},zo={exports:{}};!function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}(zo);var _o,Po,Ro,Bo,Uo={exports:{}},Wo={exports:{}};function Qo(){return _o||(_o=1,function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Wo)),Wo.exports}function Yo(){return Po||(Po=1,function(e){var t=Qo().default;function n(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ -e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new I(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return L()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=h(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=d;var p={};function f(){}function y(){}function m(){}var g={};l(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(k([])));b&&b!==i&&o.call(b,s)&&(g=b);var w=m.prototype=f.prototype=Object.create(g);function M(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,n){function r(i,a,s,u){var c=h(e[i],e,a);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==t(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var i;this._invoke=function(e,t){function o(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(o,o):o()}}function E(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function k(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Uo)),Uo.exports}var Fo,Vo={exports:{}};var Ho,Go={exports:{}};function qo(){return Ho||(Ho=1,function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(Go)),Go.exports}var Zo,Jo={exports:{}};function Xo(){return Zo||(Zo=1,function(e){function t(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(0,o.default)(this,f);var a=r.autoconnect,s=void 0===a||a,u=r.reconnect,c=void 0===u||u,l=r.reconnect_interval,d=void 0===l?1e3:l,y=r.max_reconnects,m=void 0===y?5:y,g=h(r,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(t=p.call(this)).webSocketFactory=e,t.queue={},t.rpc_id=0,t.address=n,t.autoconnect=s,t.ready=!1,t.reconnect=c,t.reconnect_timer_id=void 0,t.reconnect_interval=d,t.max_reconnects=m,t.rest_options=g,t.current_reconnects=0,t.generate_request_id=i||function(){return++t.rpc_id},t.autoconnect&&t._connect(t.address,Object.assign({autoconnect:t.autoconnect,reconnect:t.reconnect,reconnect_interval:t.reconnect_interval,max_reconnects:t.max_reconnects},t.rest_options)),t}return(0,a.default)(f,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(e,t,n,r){var o=this;return r||"object"!==(0,i.default)(n)||(r=n,n=null),new Promise((function(i,a){if(!o.ready)return a(new Error("socket not ready"));var s=o.generate_request_id(e,t),u={jsonrpc:"2.0",method:e,params:t||null,id:s};o.socket.send(JSON.stringify(u),r,(function(e){if(e)return a(e);o.queue[s]={promise:[i,a]},n&&(o.queue[s].timeout=setTimeout((function(){delete o.queue[s],a(new Error("reply timeout"))}),n))}))}))}},{key:"login",value:(l=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("rpc.login",t);case 2:if(r=e.sent){e.next=5;break}throw new Error("authentication failed");case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"listMethods",value:(c=(0,r.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("__listMethods");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"notify",value:function(e,t){var n=this;return new Promise((function(r,i){if(!n.ready)return i(new Error("socket not ready"));var o={jsonrpc:"2.0",method:e,params:t||null};n.socket.send(JSON.stringify(o),(function(e){if(e)return i(e);r()}))}))}},{key:"subscribe",value:(u=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.on",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed subscribing to an event '"+t+"' with: "+r[t]);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"unsubscribe",value:(t=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.off",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed unsubscribing from an event with: "+r);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"close",value:function(e,t){this.socket.close(e||1e3,t)}},{key:"_connect",value:function(e,t){var n=this;clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",(function(){n.ready=!0,n.emit("open"),n.current_reconnects=0})),this.socket.addEventListener("message",(function(e){var t=e.data;t instanceof ArrayBuffer&&(t=Te.from(t).toString());try{t=JSON.parse(t)}catch(e){return}if(t.notification&&n.listeners(t.notification).length){if(!Object.keys(t.params).length)return n.emit(t.notification);var r=[t.notification];if(t.params.constructor===Object)r.push(t.params);else for(var i=0;in.current_reconnects||0===n.max_reconnects)&&(n.reconnect_timer_id=setTimeout((function(){return n._connect(e,t)}),n.reconnect_interval)))}))}}]),f}(l.EventEmitter);e.default=p}(Oo);var ma=S(Oo),ga={};!function(e){var t=zo.exports;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){return new u(e,t)};var n=t(qo()),r=t(Xo()),i=t(ra()),o=t(ca()),a=t(ha());function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,a.default)(e);if(t){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}var u=function(e){(0,i.default)(o,e);var t=s(o);function o(e,r,i){var a;return(0,n.default)(this,o),(a=t.call(this)).socket=new window.WebSocket(e,i),a.socket.onopen=function(){return a.emit("open")},a.socket.onmessage=function(e){return a.emit("message",e.data)},a.socket.onerror=function(e){return a.emit("error",e)},a.socket.onclose=function(e){a.emit("close",e.code,e.reason)},a}return(0,r.default)(o,[{key:"send",value:function(e,t,n){var r=n||t;try{this.socket.send(e),r()}catch(e){r(e)}}},{key:"close",value:function(e,t){this.socket.close(e,t)}},{key:"addEventListener",value:function(e,t,n){this.socket.addEventListener(e,t,n)}}]),o}(ya().EventEmitter)}(ga);for(var va=S(ga),ba=[],wa=[],Ma=[],Aa=BigInt(0),Ea=BigInt(1),Ta=BigInt(2),Na=BigInt(7),Ia=BigInt(256),ka=BigInt(113),La=0,xa=Ea,Sa=1,ja=0;La<24;La++){var Ca=[ja,(2*Sa+3*ja)%5];Sa=Ca[0],ja=Ca[1],ba.push(2*(5*ja+Sa)),wa.push((La+1)*(La+2)/2%64);for(var Da=Aa,Oa=0;Oa<7;Oa++)(xa=(xa<>Na)*ka)%Ia)&Ta&&(Da^=Ea<<(Ea<32?Et.rotlBH(e,t,n):Et.rotlSH(e,t,n)},Ba=function(e,t,n){return n>32?Et.rotlBL(e,t,n):Et.rotlSL(e,t,n)};var Ua=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(R(this,n),(o=t.call(this)).blockLen=e,o.suffix=r,o.outputLen=i,o.enableXOF=a,o.rounds=s,o.pos=0,o.posOut=0,o.finished=!1,o.destroyed=!1,ht.number(i),0>=o.blockLen||o.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");return o.state=new Uint8Array(200),o.state32=pt(o.state),o}return U(n,[{key:"keccak",value:function(){!function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24,n=new Uint32Array(10),r=24-t;r<24;r++){for(var i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(var o=0;o<10;o+=2)for(var a=(o+8)%10,s=(o+2)%10,u=n[s],c=n[s+1],l=Ra(u,c,1)^n[a],d=Ba(u,c,1)^n[a+1],h=0;h<50;h+=10)e[o+h]^=l,e[o+h+1]^=d;for(var p=e[2],f=e[3],y=0;y<24;y++){var m=wa[y],g=Ra(p,f,m),v=Ba(p,f,m),b=ba[y];p=e[b],f=e[b+1],e[b]=g,e[b+1]=v}for(var w=0;w<50;w+=10){for(var M=0;M<10;M++)n[M]=e[w+M];for(var A=0;A<10;A++)e[w+A]^=~n[(A+2)%10]&n[(A+4)%10]}e[0]^=_a[r],e[1]^=Pa[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}},{key:"update",value:function(e){ht.exists(this);for(var t=this.blockLen,n=this.state,r=(e=mt(e)).length,i=0;i=n&&this.keccak();var o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}},{key:"xofInto",value:function(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}},{key:"xof",value:function(e){return ht.number(e),this.xofInto(new Uint8Array(e))}},{key:"digestInto",value:function(e){if(ht.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}},{key:"digest",value:function(){return this.digestInto(new Uint8Array(this.outputLen))}},{key:"destroy",value:function(){this.destroyed=!0,this.state.fill(0)}},{key:"_cloneInto",value:function(e){var t=this.blockLen,r=this.suffix,i=this.outputLen,o=this.rounds,a=this.enableXOF;return e||(e=new n(t,r,i,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}}]),n}(gt),Wa=function(e,t,n){return vt((function(){return new Ua(t,e,n)}))};Wa(6,144,28),Wa(6,136,32),Wa(6,104,48),Wa(6,72,64),Wa(1,144,28);var Qa=Wa(1,136,32);Wa(1,104,48),Wa(1,72,64);var Ya=function(e,t,n){return i=function(e,t){return r(t).update(mt(e)).digest()},o=(r=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Ua(t,e,void 0===r.dkLen?n:r.dkLen,!0)})({}),i.outputLen=o.outputLen,i.blockLen=o.blockLen,i.create=function(e){return r(e)},i;var r,i,o};Ya(31,168,16),Ya(31,136,32);var Fa=function(e){Q(n,e);var t=X(n);function n(e,r){var i;R(this,n),(i=t.call(this)).finished=!1,i.destroyed=!1,ht.hash(e);var o=mt(r);if(i.iHash=e.create(),"function"!=typeof i.iHash.update)throw new TypeError("Expected instance of class which extends utils.Hash");i.blockLen=i.iHash.blockLen,i.outputLen=i.iHash.outputLen;var a=i.blockLen,s=new Uint8Array(a);s.set(o.length>a?e.create().update(o).digest():o);for(var u=0;ua,h=l>a;if(d&&(c=t-c),h&&(l=t-l),c>a||l>a)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:h,k2:l}},ts=32,ns=32;function rs(e){var t=Xa.a,n=Xa.b,r=Ls(e*e),i=Ls(r*e);return Ls(i+t*e+n)}var is=Xa.a===Ha,os=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,e)}return U(n)}(G(Error));function as(e){if(!(e instanceof ss))throw new TypeError("JacobianPoint expected")}var ss=function(){function e(t,n,r){R(this,e),this.x=t,this.y=n,this.z=r}return U(e,[{key:"equals",value:function(e){as(e);var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=Ls(r*r),u=Ls(a*a),c=Ls(t*u),l=Ls(i*s),d=Ls(Ls(n*a)*u),h=Ls(Ls(o*r)*s);return c===l&&d===h}},{key:"negate",value:function(){return new e(this.x,Ls(-this.y),this.z)}},{key:"double",value:function(){var t=this.x,n=this.y,r=this.z,i=Ls(t*t),o=Ls(n*n),a=Ls(o*o),s=t+o,u=Ls(qa*(Ls(s*s)-i-a)),c=Ls(Za*i),l=Ls(c*c),d=Ls(l-qa*u);return new e(d,Ls(c*(u-d)-Ja*a),Ls(qa*n*r))}},{key:"add",value:function(t){as(t);var n=this.x,r=this.y,i=this.z,o=t.x,a=t.y,s=t.z;if(o===Ha||a===Ha)return this;if(n===Ha||r===Ha)return t;var u=Ls(i*i),c=Ls(s*s),l=Ls(n*c),d=Ls(o*u),h=Ls(Ls(r*s)*c),p=Ls(Ls(a*i)*u),f=Ls(d-l),y=Ls(p-h);if(f===Ha)return y===Ha?this.double():e.ZERO;var m=Ls(f*f),g=Ls(f*m),v=Ls(l*m),b=Ls(y*y-g-qa*v);return new e(b,Ls(y*(v-b)-h*g),Ls(i*s*f))}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiplyUnsafe",value:function(t){var n=e.ZERO;if("bigint"==typeof t&&t===Ha)return n;var r=ks(t);if(r===Ga)return this;if(!is){for(var i=n,o=this;r>Ha;)r&Ga&&(i=i.add(o)),o=o.double(),r>>=Ga;return i}for(var a=es(r),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,d=n,h=n,p=this;u>Ha||l>Ha;)u&Ga&&(d=d.add(p)),l&Ga&&(h=h.add(p)),p=p.double(),u>>=Ga,l>>=Ga;return s&&(d=d.negate()),c&&(h=h.negate()),h=new e(Ls(h.x*$a),h.y,h.z),d.add(h)}},{key:"precomputeWindow",value:function(e){for(var t=is?128/e+1:256/e+1,n=[],r=this,i=r,o=0;o>=d,f>u&&(f-=l,t+=Ga);var y=p,m=p+Math.abs(f)-1,g=h%2!=0,v=f<0;0===f?a=a.add(us(g,i[y])):o=o.add(us(v,i[m]))}return{p:o,f:a}}},{key:"multiply",value:function(t,n){var r,i,o=ks(t);if(is){var a=es(o),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,d=this.wNAF(u,n),h=d.p,p=d.f,f=this.wNAF(l,n),y=f.p,m=f.f;h=us(s,h),y=new e(Ls((y=us(c,y)).x*$a),y.y,y.z),r=h.add(y),i=p.add(m)}else{var g=this.wNAF(o,n);r=g.p,i=g.f}return e.normalizeZ([r,i])[0]}},{key:"toAffine",value:function(t){var n=this.x,r=this.y,i=this.z,o=this.equals(e.ZERO);null==t&&(t=o?Ja:Ss(i));var a=t,s=Ls(a*a),u=Ls(s*a),c=Ls(n*s),l=Ls(r*u),d=Ls(i*a);if(o)return ls.ZERO;if(d!==Ga)throw new Error("invZ was invalid");return new ls(c,l)}}],[{key:"fromAffine",value:function(t){if(!(t instanceof ls))throw new TypeError("JacobianPoint#fromAffine: expected Point");return t.equals(ls.ZERO)?e.ZERO:new e(t.x,t.y,Ga)}},{key:"toAffineBatch",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xa.P,n=new Array(e.length),r=Ss(e.reduce((function(e,r,i){return r===Ha?e:(n[i]=e,Ls(e*r,t))}),Ga),t);return e.reduceRight((function(e,r,i){return r===Ha?e:(n[i]=Ls(e*n[i],t),Ls(e*r,t))}),r),n}(e.map((function(e){return e.z})));return e.map((function(e,n){return e.toAffine(t[n])}))}},{key:"normalizeZ",value:function(t){return e.toAffineBatch(t).map(e.fromAffine)}}]),e}();function us(e,t){var n=t.negate();return e?n:t}ss.BASE=new ss(Xa.Gx,Xa.Gy,Ga),ss.ZERO=new ss(Ha,Ga,Ha);var cs=new WeakMap,ls=function(){function e(t,n){R(this,e),this.x=t,this.y=n}return U(e,[{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,cs.delete(this)}},{key:"hasEvenY",value:function(){return this.y%qa===Ha}},{key:"toRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ts(this.toHex(e))}},{key:"toHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=ws(this.x);if(e){var n=this.hasEvenY()?"02":"03";return"".concat(n).concat(t)}return"04".concat(t).concat(ws(this.y))}},{key:"toHexX",value:function(){return this.toHex(!0).slice(2)}},{key:"toRawX",value:function(){return this.toRawBytes(!0).slice(1)}},{key:"assertValidity",value:function(){var e="Point is not on elliptic curve",t=this.x,n=this.y;if(!zs(t)||!zs(n))throw new Error(e);var r=Ls(n*n);if(Ls(r-rs(t))!==Ha)throw new Error(e)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(this.x,Ls(-this.y))}},{key:"double",value:function(){return ss.fromAffine(this).double().toAffine()}},{key:"add",value:function(e){return ss.fromAffine(this).add(ss.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return ss.fromAffine(this).multiply(e,this).toAffine()}},{key:"multiplyAndAddUnsafe",value:function(t,n,r){var i=ss.fromAffine(this),o=n===Ha||n===Ga||this!==e.BASE?i.multiplyUnsafe(n):i.multiply(n),a=ss.fromAffine(t).multiplyUnsafe(r),s=o.add(a);return s.equals(ss.ZERO)?void 0:s.toAffine()}}],[{key:"fromCompressedHex",value:function(t){var n=32===t.length,r=Ns(n?t:t.subarray(1));if(!zs(r))throw new Error("Point is not on curve");var i=function(e){var t=Xa.P,n=BigInt(6),r=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),s=BigInt(88),u=e*e*e%t,c=u*u*e%t,l=xs(c,Za)*c%t,d=xs(l,Za)*c%t,h=xs(d,qa)*u%t,p=xs(h,r)*h%t,f=xs(p,i)*p%t,y=xs(f,a)*f%t,m=xs(y,s)*y%t,g=xs(m,a)*f%t,v=xs(g,Za)*c%t,b=xs(v,o)*p%t,w=xs(b,n)*u%t,M=xs(w,qa);if(M*M%t!==e)throw new Error("Cannot find square root");return M}(rs(r)),o=(i&Ga)===Ga;n?o&&(i=Ls(-i)):1==(1&t[0])!==o&&(i=Ls(-i));var a=new e(r,i);return a.assertValidity(),a}},{key:"fromUncompressedHex",value:function(t){var n=new e(Ns(t.subarray(1,33)),Ns(t.subarray(33,65)));return n.assertValidity(),n}},{key:"fromHex",value:function(e){var t=Is(e),n=t.length,r=t[0];if(n===ts)return this.fromCompressedHex(t);if(33===n&&(2===r||3===r))return this.fromCompressedHex(t);if(65===n&&4===r)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-".concat(33," compressed bytes or ").concat(65," uncompressed bytes, not ").concat(n))}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(Ps(t))}},{key:"fromSignature",value:function(t,n,r){var i=function(e){if(e instanceof ps)return e.assertValidity(),e;try{return ps.fromDER(e)}catch(t){return ps.fromCompact(e)}}(n),o=i.r,a=i.s;if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");var s=Cs(Is(t)),u=Xa.n,c=2===r||3===r?o+u:o,l=Ss(c,u),d=Ls(-s*l,u),h=Ls(a*l,u),p=1&r?"03":"02",f=e.fromHex(p+ws(c)),y=e.BASE.multiplyAndAddUnsafe(f,d,h);if(!y)throw new Error("Cannot recover signature: point at infinify");return y.assertValidity(),y}}]),e}();function ds(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function hs(e){if(e.length<2||2!==e[0])throw new Error("Invalid signature integer tag: ".concat(ms(e)));var t=e[1],n=e.subarray(2,t+2);if(!t||n.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===n[0]&&n[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:Ns(n),left:e.subarray(t+2)}}ls.BASE=new ls(Xa.Gx,Xa.Gy),ls.ZERO=new ls(Ha,Ha);var ps=function(){function e(t,n){R(this,e),this.r=t,this.s=n,this.assertValidity()}return U(e,[{key:"assertValidity",value:function(){var e=this.r,t=this.s;if(!Os(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!Os(t))throw new Error("Invalid Signature: s must be 0 < s < n")}},{key:"hasHighS",value:function(){var e=Xa.n>>Ga;return this.s>e}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,Ls(-this.s,Xa.n)):this}},{key:"toDERRawBytes",value:function(){return Ts(this.toDERHex())}},{key:"toDERHex",value:function(){var e=ds(As(this.s)),t=ds(As(this.r)),n=e.length/2,r=t.length/2,i=As(n),o=As(r),a=As(r+n+4);return"30".concat(a,"02").concat(o).concat(t,"02").concat(i).concat(e)}},{key:"toRawBytes",value:function(){return this.toDERRawBytes()}},{key:"toHex",value:function(){return this.toDERHex()}},{key:"toCompactRawBytes",value:function(){return Ts(this.toCompactHex())}},{key:"toCompactHex",value:function(){return ws(this.r)+ws(this.s)}}],[{key:"fromCompact",value:function(t){var n=t instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof t&&!n)throw new TypeError("".concat(r,": Expected string or Uint8Array"));var i=n?ms(t):t;if(128!==i.length)throw new Error("".concat(r,": Expected 64-byte hex"));return new e(Es(i.slice(0,64)),Es(i.slice(64,128)))}},{key:"fromDER",value:function(t){var n=t instanceof Uint8Array;if("string"!=typeof t&&!n)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");var r=function(e){if(e.length<2||48!=e[0])throw new Error("Invalid signature tag: ".concat(ms(e)));if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");var t=hs(e.subarray(2)),n=t.data,r=hs(t.left),i=r.data,o=r.left;if(o.length)throw new Error("Invalid signature: left bytes after parsing: ".concat(ms(o)));return{r:n,s:i}}(n?t:Ts(t));return new e(r.r,r.s)}},{key:"fromHex",value:function(e){return this.fromDER(e)}}]),e}();function fs(){for(var e=arguments.length,t=new Array(e),n=0;n0)return BigInt(e);if("bigint"==typeof e&&Os(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Ls(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xa.P,n=e%t;return n>=Ha?n:t+n}function xs(e,t){for(var n=Xa.P,r=e;t-- >Ha;)r*=r,r%=n;return r}function Ss(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xa.P;if(e===Ha||t<=Ha)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var n=Ls(e,t),r=t,i=Ha,o=Ga;n!==Ha;){var a=r/n,s=r%n,u=i-o*a;r=n,n=s,i=o,o=u}var c=r;if(c!==Ga)throw new Error("invert: does not exist");return Ls(i,t)}function js(e){var t=8*e.length-256,n=Ns(e);return t>0?n>>BigInt(t):n}function Cs(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=js(e);if(t)return n;var r=Xa.n;return n>=r?n-r:n}var Ds=function(){function e(t,n){if(R(this,e),this.hashLen=t,this.qByteLen=n,"number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof n||n<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(t).fill(1),this.k=new Uint8Array(t).fill(0),this.counter=0}var t,n;return U(e,[{key:"hmac",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}},{key:"reseed",value:(n=P(O().mark((function e(){var t,n=arguments;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:new Uint8Array,e.next=3,this.hmac(this.v,Uint8Array.from([0]),t);case 3:return this.k=e.sent,e.next=6,this.hmac(this.v);case 6:if(this.v=e.sent,0!==t.length){e.next=9;break}return e.abrupt("return");case 9:return e.next=11,this.hmac(this.v,Uint8Array.from([1]),t);case 11:return this.k=e.sent,e.next=14,this.hmac(this.v);case 14:this.v=e.sent;case 15:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reseedSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}},{key:"generate",value:(t=P(O().mark((function e(){var t,n,r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.incr(),t=0,n=[];case 3:if(!(t3&&void 0!==arguments[3])||arguments[3],i=Xa.n,o=Cs(e,!0);if(Os(o)){var a=Ss(o,i),s=ls.BASE.multiply(o),u=Ls(s.x,i);if(u!==Ha){var c=Ls(a*Ls(t+n*u,i),i);if(c!==Ha){var l=new ps(u,c),d=(s.x===l.r?0:2)|Number(s.y&Ga);return r&&l.hasHighS()&&(l=l.normalizeS(),d^=1),{sig:l,recovery:d}}}}}function Ps(e){var t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=Es(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(e.length!==ns)throw new Error("Expected 32 bytes of private key");t=Ns(e)}if(!Os(t))throw new Error("Expected private key: 0 < key < n");return t}function Rs(e){return Ns(e.length>ts?e.slice(0,ts):e)}function Bs(e){var t=Rs(e),n=Ls(t,Xa.n);return Us(n1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return Ms(Ls(Ns(e),Xa.n-Ga)+Ga)},randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(Vs.web)return Vs.web.getRandomValues(new Uint8Array(e));if(Vs.node){var t=Vs.node.randomBytes;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return Gs.hashToPrivateKey(Gs.randomBytes(40))},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ls.BASE,n=t===ls.BASE?t:new ls(t.x,t.y);return n._setWindowSize(e),n.multiply(Za),n},sha256:function(){var e=P(O().mark((function e(){var t,n,r,i,o,a,s=arguments;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=s.length,n=new Array(t),r=0;r1?n-1:0),i=1;i1?i-1:0),a=1;a1?r-1:0),o=1;ouu)throw new Error("Invalid public key input")}return t}return U(a,[{key:"equals",value:function(e){return this._bn.eq(e._bn)}},{key:"toBase58",value:function(){return Pn.encode(this.toBytes())}},{key:"toJSON",value:function(){return this.toBase58()}},{key:"toBytes",value:function(){var e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}},{key:"toBuffer",value:function(){var e=this._bn.toArrayLike(Te);if(e.length===uu)return e;var t=Te.alloc(32);return e.copy(t,32-e.length),t}},{key:t,get:function(){return"PublicKey(".concat(this.toString(),")")}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"unique",value:function(){var e=new a(cu);return cu+=1,new a(e.toBuffer())}},{key:"createWithSeed",value:(i=P(O().mark((function e(t,n,r){var i,o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Te.concat([t.toBuffer(),Te.from(n),r.toBuffer()]),o=Fn(i),e.abrupt("return",new a(o));case 3:case"end":return e.stop()}}),e)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"createProgramAddressSync",value:function(e,t){var n=Te.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");n=Te.concat([n,iu(e)])})),n=Te.concat([n,t.toBuffer(),Te.from("ProgramDerivedAddress")]);var r=Fn(n);if(tu(r))throw new Error("Invalid seeds, address must fall off the curve");return new a(r)}},{key:"createProgramAddress",value:(r=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.createProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"findProgramAddressSync",value:function(e,t){for(var n,r=255;0!=r;){try{var i=e.concat(Te.from([r]));n=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;r--;continue}return[n,r]}throw new Error("Unable to find a viable program address nonce")}},{key:"findProgramAddress",value:(n=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.findProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"isOnCurve",value:function(e){return tu(new a(e).toBytes())}}]),a}(ou,Symbol.toStringTag);lu.default=new lu("11111111111111111111111111111111"),su.set(lu,{kind:"struct",fields:[["_bn","u256"]]});var du=function(){function e(t){if(R(this,e),this._publicKey=void 0,this._secretKey=void 0,t){var n=iu(t);if(64!==t.length)throw new Error("bad secret key size");this._publicKey=n.slice(32,64),this._secretKey=n.slice(0,32)}else this._secretKey=iu(Ks()),this._publicKey=iu(eu(this._secretKey))}return U(e,[{key:"publicKey",get:function(){return new lu(this._publicKey)}},{key:"secretKey",get:function(){return Te.concat([this._secretKey,this._publicKey],64)}}]),e}(),hu=new lu("BPFLoader1111111111111111111111111111111111"),pu=1232,fu=127,yu=64,mu=function(e){Q(n,e);var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: block height exceeded."))).signature=void 0,r.signature=e,r}return U(n)}(G(Error));Object.defineProperty(mu.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var gu=function(e){Q(n,e);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,"Transaction was not confirmed in ".concat(r.toFixed(2)," seconds. It is ")+"unknown if it succeeded or failed. Check signature "+"".concat(e," using the Solana Explorer or CLI tools."))).signature=void 0,i.signature=e,i}return U(n)}(G(Error));Object.defineProperty(gu.prototype,"name",{value:"TransactionExpiredTimeoutError"});var vu=function(e){Q(n,e);var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: the nonce is no longer valid."))).signature=void 0,r.signature=e,r}return U(n)}(G(Error));Object.defineProperty(vu.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});var bu=function(){function e(t,n){R(this,e),this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=n}return U(e,[{key:"keySegments",value:function(){var e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}},{key:"get",value:function(e){var t,n=se(this.keySegments());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e256)throw new Error("Account index overflow encountered during compilation");var t=new Map;this.keySegments().flat().forEach((function(e,n){t.set(e.toBase58(),n)}));var n=function(e){var n=t.get(e.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return e.map((function(e){return{programIdIndex:n(e.programId),accountKeyIndexes:e.keys.map((function(e){return n(e.pubkey)})),data:e.data}}))}}]),e}(),wu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return wi(32,e)},Mu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature";return wi(64,e)},Au=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",t=vi([yi("length"),yi("lengthPadding"),wi(hi(yi(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=function(e,t){return n(e,t).chars.toString()},i.encode=function(e,t,n){var i={chars:Te.from(e,"utf8")};return r(i,t,n)},i.alloc=function(e){return yi().span+yi().span+Te.from(e,"utf8").length},i};function Eu(e,t){var n=function e(n){if(n.span>=0)return n.span;if("function"==typeof n.alloc)return n.alloc(t[n.property]);if("count"in n&&"elementLayout"in n){var r=t[n.property];if(Array.isArray(r))return r.length*e(n.elementLayout)}else if("fields"in n)return Eu({layout:n},t[n.property]);return 0},r=0;return e.layout.fields.forEach((function(e){r+=n(e)})),r}function Tu(e){for(var t=0,n=0;;){var r=e.shift();if(t|=(127&r)<<7*n,n+=1,0==(128&r))break}return t}function Nu(e,t){for(var n=t;;){var r=127&n;if(0==(n>>=7)){e.push(r);break}r|=128,e.push(r)}}function Iu(e,t){if(!e)throw new Error(t||"Assertion failed")}var ku,Lu=function(){function e(t,n){R(this,e),this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=n}return U(e,[{key:"getMessageComponents",value:function(){var e=te(this.keyMetaMap.entries());Iu(e.length<=256,"Max static account keys length exceeded");var t=e.filter((function(e){var t=ee(e,2)[1];return t.isSigner&&t.isWritable})),n=e.filter((function(e){var t=ee(e,2)[1];return t.isSigner&&!t.isWritable})),r=e.filter((function(e){var t=ee(e,2)[1];return!t.isSigner&&t.isWritable})),i=e.filter((function(e){var t=ee(e,2)[1];return!t.isSigner&&!t.isWritable})),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};return Iu(t.length>0,"Expected at least one writable signer key"),Iu(ee(t[0],1)[0]===this.payer.toBase58(),"Expected first writable signer key to be the fee payer"),[o,[].concat(te(t.map((function(e){var t=ee(e,1)[0];return new lu(t)}))),te(n.map((function(e){var t=ee(e,1)[0];return new lu(t)}))),te(r.map((function(e){var t=ee(e,1)[0];return new lu(t)}))),te(i.map((function(e){var t=ee(e,1)[0];return new lu(t)}))))]}},{key:"extractTableLookup",value:function(e){var t=ee(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&e.isWritable})),2),n=t[0],r=t[1],i=ee(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&!e.isWritable})),2),o=i[0],a=i[1];if(0!==n.length||0!==o.length)return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:o},{writable:r,readonly:a}]}},{key:"drainKeysFoundInLookupTable",value:function(e,t){var n,r=this,i=new Array,o=new Array,a=se(this.keyMetaMap.entries());try{var s=function(){var a=ee(n.value,2),s=a[0],u=a[1];if(t(u)){var c=new lu(s),l=e.findIndex((function(e){return e.equals(c)}));l>=0&&(Iu(l<256,"Max lookup table index exceeded"),i.push(l),o.push(c),r.keyMetaMap.delete(s))}};for(a.s();!(n=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return[i,o]}}],[{key:"compile",value:function(t,n){var r=new Map,i=function(e){var t=e.toBase58(),n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},o=i(n);o.isSigner=!0,o.isWritable=!0;var a,s=se(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;i(u.programId).isInvoked=!0;var c,l=se(u.keys);try{for(l.s();!(c=l.n()).done;){var d=c.value,h=i(d.pubkey);h.isSigner||(h.isSigner=d.isSigner),h.isWritable||(h.isWritable=d.isWritable)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){s.e(e)}finally{s.f()}return new e(n,r)}}]),e}(),xu=function(){function e(t){var n=this;R(this,e),this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((function(e){return new lu(e)})),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((function(e){return n.indexToProgramIds.set(e.programIdIndex,n.accountKeys[e.programIdIndex])}))}return U(e,[{key:"version",get:function(){return"legacy"}},{key:"staticAccountKeys",get:function(){return this.accountKeys}},{key:"compiledInstructions",get:function(){return this.instructions.map((function(e){return{programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:Pn.decode(e.data)}}))}},{key:"addressTableLookups",get:function(){return[]}},{key:"getAccountKeys",value:function(){return new bu(this.staticAccountKeys)}},{key:"isAccountSigner",value:function(e){return e=this.header.numRequiredSignatures?e-t0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new bu(this.staticAccountKeys,t)}},{key:"isAccountSigner",value:function(e){return e=n?e-n=this.header.numRequiredSignatures?e-t0?this.signatures[0].signature:null}},{key:"toJSON",value:function(){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((function(e){return e.toJSON()})),signers:this.signatures.map((function(e){return e.publicKey.toJSON()}))}}},{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(var r=0;r-1?(a[n].isWritable=a[n].isWritable||e.isWritable,a[n].isSigner=a[n].isSigner||e.isSigner):a.push(e)})),a.sort((function(e,t){return e.isSigner!==t.isSigner?e.isSigner?-1:1:e.isWritable!==t.isWritable?e.isWritable?-1:1:e.pubkey.toBase58().localeCompare(t.pubkey.toBase58())}));var s=a.findIndex((function(e){return e.pubkey.equals(n)}));if(s>-1){var u=ee(a.splice(s,1),1)[0];u.isSigner=!0,u.isWritable=!0,a.unshift(u)}else a.unshift({pubkey:n,isSigner:!0,isWritable:!0});var c,l=se(this.signatures);try{var d=function(){var e=c.value,t=a.findIndex((function(t){return t.pubkey.equals(e.publicKey)}));if(!(t>-1))throw new Error("unknown signer: ".concat(e.publicKey.toString()));a[t].isSigner||(a[t].isSigner=!0,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."))};for(l.s();!(c=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}var h=0,p=0,f=0,y=[],m=[];a.forEach((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;n?(y.push(t.toString()),h+=1,r||(p+=1)):(m.push(t.toString()),r||(f+=1))}));var g=y.concat(m),v=t.map((function(e){var t=e.data,n=e.programId;return{programIdIndex:g.indexOf(n.toString()),accounts:e.keys.map((function(e){return g.indexOf(e.pubkey.toString())})),data:Pn.encode(t)}}));return v.forEach((function(e){Iu(e.programIdIndex>=0),e.accounts.forEach((function(e){return Iu(e>=0)}))})),new xu({header:{numRequiredSignatures:h,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:f},accountKeys:g,recentBlockhash:e,instructions:v})}},{key:"_compile",value:function(){var e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length&&this.signatures.every((function(e,n){return t[n].equals(e.publicKey)})))return e;return this.signatures=t.map((function(e){return{signature:null,publicKey:e}})),e}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"getEstimatedFee",value:(t=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getFeeForMessage(this.compileMessage());case 2:return e.abrupt("return",e.sent.value);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setSigners",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),o=1;o ").concat(pu)),i}},{key:"keys",get:function(){return Iu(1===this.instructions.length),this.instructions[0].keys.map((function(e){return e.pubkey}))}},{key:"programId",get:function(){return Iu(1===this.instructions.length),this.instructions[0].programId}},{key:"data",get:function(){return Iu(1===this.instructions.length),this.instructions[0].data}}],[{key:"from",value:function(t){for(var n=te(t),r=Tu(n),i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:[],r=new e;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),n.forEach((function(e,n){var i={signature:e==Pn.encode(Cu)?null:Pn.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)})),t.instructions.forEach((function(e){var n=e.accounts.map((function(e){var n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some((function(e){return e.publicKey.toString()===n.toString()}))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));r.instructions.push(new Du({keys:n,programId:t.accountKeys[e.programIdIndex],data:Pn.decode(e.data)}))})),r._message=t,r._json=r.toJSON(),r}}]),e}(),zu=function(){function e(t){R(this,e),this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}return U(e,[{key:"compileToLegacyMessage",value:function(){return xu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}},{key:"compileToV0Message",value:function(e){return Su.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}],[{key:"decompile",value:function(t,n){var r=t.header,i=t.compiledInstructions,o=t.recentBlockhash,a=r.numRequiredSignatures,s=r.numReadonlySignedAccounts,u=r.numReadonlyUnsignedAccounts,c=a-s;Iu(c>0,"Message header is invalid");var l=t.staticAccountKeys.length-a-u;Iu(l>=0,"Message header is invalid");var d=t.getAccountKeys(n),h=d.get(0);if(void 0===h)throw new Error("Failed to decompile message because no account keys were found");var p,f=[],y=se(i);try{for(y.s();!(p=y.n()).done;){var m,g=p.value,v=[],b=se(g.accountKeyIndexes);try{for(b.s();!(m=b.n()).done;){var w=m.value,M=d.get(w);if(void 0===M)throw new Error("Failed to find key for account key index ".concat(w));var A=void 0;A=w=0,"Cannot sign with non signer key ".concat(e.publicKey.toBase58())),n.signatures[o]=nu(r,e.secretKey)};for(o.s();!(t=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}}},{key:"addSignature",value:function(e,t){Iu(64===t.byteLength,"Signature must be 64 bytes long");var n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((function(t){return t.equals(e)}));Iu(n>=0,"Can not add signature; `".concat(e.toBase58(),"` is not required to sign this transaction")),this.signatures[n]=t}}],[{key:"deserialize",value:function(t){for(var n=te(t),r=[],i=Tu(n),o=0;o=0?e.layout.span:Eu(e,t),r=Te.alloc(n),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,r),r}function Ju(e,t){var n;try{n=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(n.instruction!==e.index)throw new Error("invalid instruction; instruction index mismatch ".concat(n.instruction," != ").concat(e.index));return n}var Xu,Ku=mi("lamportsPerSignature"),$u=vi([yi("version"),yi("state"),wu("authorizedPubkey"),wu("nonce"),vi([Ku],"feeCalculator")]),ec=$u.span,tc=function(){function e(t){R(this,e),this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}return U(e,null,[{key:"fromAccountData",value:function(t){var n=$u.decode(iu(t),0);return new e({authorizedPubkey:new lu(n.authorizedPubkey),nonce:new lu(n.nonce).toString(),feeCalculator:n.feeCalculator})}}]),e}(),nc=(Xu=8,function(e){var t=wi(Xu,e),n=function(e){return{decode:e.decode.bind(e),encode:e.encode.bind(e)}}(t),r=n.encode,i=n.decode,o=t;return o.decode=function(e,t){var n=i(e,t);return Ai(Te.from(n))},o.encode=function(e,t,n){var i=Ei(e,Xu);return r(i,t,n)},o}),rc=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=yi("instruction").decode(e.data),r=0,i=Object.entries(ic);r0?s:1,space:a.length,programId:o}));case 17:if(null===c){t.next=20;break}return t.next=20,Hu(n,c,[r,i],{commitment:"confirmed"});case 20:l=vi([yi("instruction"),yi("offset"),yi("bytesLength"),yi("bytesLengthPadding"),bi(pi("byte"),hi(yi(),-8),"bytes")]),d=e.chunkSize,h=0,p=a,f=[];case 25:if(!(p.length>0)){t.next=39;break}if(y=p.slice(0,d),m=Te.alloc(d+16),l.encode({instruction:0,offset:h,bytes:y,bytesLength:0,bytesLengthPadding:0},m),g=(new Ou).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:m}),f.push(Hu(n,g,[r,i],{commitment:"confirmed"})),!n._rpcEndpoint.includes("solana.com")){t.next=35;break}return t.next=35,qu(250);case 35:h+=d,p=p.slice(d),t.next=25;break;case 39:return t.next=41,Promise.all(f);case 41:return v=vi([yi("instruction")]),b=Te.alloc(v.span),v.encode({instruction:1},b),w=(new Ou).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1}],programId:o,data:b}),t.next=47,Hu(n,w,[r,i],{commitment:"confirmed"});case 47:return t.abrupt("return",!0);case 48:case"end":return t.stop()}}),t)}))),function(e,n,r,i,o){return t.apply(this,arguments)})}]),e}();ac.chunkSize=932;var sc=new lu("BPFLoader2111111111111111111111111111111111"),uc=function(){function e(){R(this,e)}return U(e,null,[{key:"getMinNumSignatures",value:function(e){return ac.getMinNumSignatures(e)}},{key:"load",value:function(e,t,n,r,i){return ac.load(e,t,n,i,r)}}]),e}(),cc=Object.prototype.toString,lc=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function dc(e,t){var n,r,i,o,a,s,u;if(!0===e)return"true";if(!1===e)return"false";switch(z(e)){case"object":if(null===e)return null;if(e.toJSON&&"function"==typeof e.toJSON)return dc(e.toJSON(),t);if("[object Array]"===(u=cc.call(e))){for(i="[",r=e.length-1,n=0;n-1&&(i+=dc(e[n],!0)),i+"]"}if("[object Object]"===u){for(r=(o=lc(e).sort()).length,i="",n=0;n1;)e/=2,t++;return t}var fc=function(){function e(t,n,r,i,o){R(this,e),this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=n,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=o}return U(e,[{key:"getEpoch",value:function(e){return this.getEpochAndSlotIndex(e)[0]}},{key:"getEpochAndSlotIndex",value:function(e){if(e>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,1+(e|=e>>32))}(e+32+1))-pc(32)-1;return[t,e-(this.getSlotsInEpoch(t)-32)]}var n=e-this.firstNormalSlot,r=Math.floor(n/this.slotsPerEpoch);return[this.firstNormalEpoch+r,n%this.slotsPerEpoch]}},{key:"getFirstSlotInEpoch",value:function(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}},{key:"getLastSlotInEpoch",value:function(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}},{key:"getSlotsInEpoch",value:function(e){return e0&&(i.until=a.signatures[a.signatures.length-1].toString()),e.next=22;break;case 15:if(e.prev=15,e.t0=e.catch(8),!(e.t0 instanceof Error&&e.t0.message.includes("skipped"))){e.next=21;break}return e.abrupt("continue",4);case 21:throw e.t0;case 22:e.next=4;break;case 24:return e.next=26,this.getSlot("finalized");case 26:s=e.sent;case 27:if("before"in i){e.next=47;break}if(!(++r>s)){e.next=31;break}return e.abrupt("break",47);case 31:return e.prev=31,e.next=34,this.getConfirmedBlockSignatures(r);case 34:(u=e.sent).signatures.length>0&&(i.before=u.signatures[u.signatures.length-1].toString()),e.next=45;break;case 38:if(e.prev=38,e.t1=e.catch(31),!(e.t1 instanceof Error&&e.t1.message.includes("skipped"))){e.next=44;break}return e.abrupt("continue",27);case 44:throw e.t1;case 45:e.next=27;break;case 47:return e.next=49,this.getConfirmedSignaturesForAddress2(t,i);case 49:return c=e.sent,e.abrupt("return",c.map((function(e){return e.signature})));case 51:case"end":return e.stop()}}),e,this,[[8,15],[31,38]])}))),function(e,t,n){return E.apply(this,arguments)})},{key:"getConfirmedSignaturesForAddress2",value:(A=P(O().mark((function e(t,n,r){var i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getConfirmedSignaturesForAddress2",i);case 3:if(o=e.sent,!("error"in(a=Pi(o,dl)))){e.next=7;break}throw new mc(a.error,"failed to get confirmed signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return A.apply(this,arguments)})},{key:"getSignaturesForAddress",value:(M=P(O().mark((function e(t,n,r){var i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getSignaturesForAddress",i);case 3:if(o=e.sent,!("error"in(a=Pi(o,hl)))){e.next=7;break}throw new mc(a.error,"failed to get signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return M.apply(this,arguments)})},{key:"getAddressLookupTable",value:(w=P(O().mark((function e(t,n){var r,i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=new bc({key:t,state:bc.deserialize(o.data)})),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getNonceAndContext",value:(b=P(O().mark((function e(t,n){var r,i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=tc.fromAccountData(o.data)),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getNonce",value:(v=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNonceAndContext(t,n).then((function(e){return e.value})).catch((function(e){throw new Error("failed to get nonce for account "+t.toBase58()+": "+e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"requestAirdrop",value:(g=P(O().mark((function e(t,n){var r,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("requestAirdrop",[t.toBase58(),n]);case 2:if(r=e.sent,!("error"in(i=Pi(r,rd)))){e.next=6;break}throw new mc(i.error,"airdrop to ".concat(t.toBase58()," failed"));case 6:return e.abrupt("return",i.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"_blockhashWithExpiryBlockHeight",value:(m=P(O().mark((function e(t){var n,r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=10;break}case 1:if(!this._pollingBlockhash){e.next=6;break}return e.next=4,qu(100);case 4:e.next=1;break;case 6:if(n=Date.now()-this._blockhashInfo.lastFetch,r=n>=3e4,null===this._blockhashInfo.latestBlockhash||r){e.next=10;break}return e.abrupt("return",this._blockhashInfo.latestBlockhash);case 10:return e.next=12,this._pollNewBlockhash();case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"_pollNewBlockhash",value:(y=P(O().mark((function e(){var t,n,r,i,o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._pollingBlockhash=!0,e.prev=1,t=Date.now(),n=this._blockhashInfo.latestBlockhash,r=n?n.blockhash:null,i=0;case 6:if(!(i<50)){e.next=18;break}return e.next=9,this.getLatestBlockhash("finalized");case 9:if(o=e.sent,r===o.blockhash){e.next=13;break}return this._blockhashInfo={latestBlockhash:o,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e.abrupt("return",o);case 13:return e.next=15,qu(200);case 15:i++,e.next=6;break;case 18:throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-t,"ms"));case 19:return e.prev=19,this._pollingBlockhash=!1,e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[1,,19,22]])}))),function(){return y.apply(this,arguments)})},{key:"getStakeMinimumDelegation",value:(f=P(O().mark((function e(t){var n,r,i,o,a,s;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Nc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,"base64",i),e.next=4,this._rpcRequest("getStakeMinimumDelegation",o);case 4:if(a=e.sent,!("error"in(s=Pi(a,xc(Hi()))))){e.next=8;break}throw new mc(s.error,"failed to get stake minimum delegation");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"simulateTransaction",value:(p=P(O().mark((function e(t,n,r){var i,o,a,s,u,c,l,d,h,p,f,y,m,g,v,b,w,M,A,E,T,N,I,k,L,x;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("message"in t)){e.next=17;break}if(i=t.serialize(),o=Te.from(i).toString("base64"),!Array.isArray(n)&&void 0===r){e.next=6;break}throw new Error("Invalid arguments");case 6:return(a=n||{}).encoding="base64","commitment"in a||(a.commitment=this.commitment),s=[o,a],e.next=12,this._rpcRequest("simulateTransaction",s);case 12:if(u=e.sent,!("error"in(c=Pi(u,Yc)))){e.next=16;break}throw new Error("failed to simulate transaction: "+c.error.message);case 16:return e.abrupt("return",c.result);case 17:if(t instanceof Ou?(d=t,(l=new Ou).feePayer=d.feePayer,l.instructions=t.instructions,l.nonceInfo=d.nonceInfo,l.signatures=d.signatures):(l=Ou.populate(t))._message=l._json=void 0,void 0===n||Array.isArray(n)){e.next=20;break}throw new Error("Invalid arguments");case 20:if(h=n,!l.nonceInfo||!h){e.next=25;break}(p=l).sign.apply(p,te(h)),e.next=45;break;case 25:f=this._disableBlockhashCaching;case 26:return e.next=28,this._blockhashWithExpiryBlockHeight(f);case 28:if(m=e.sent,l.lastValidBlockHeight=m.lastValidBlockHeight,l.recentBlockhash=m.blockhash,h){e.next=33;break}return e.abrupt("break",45);case 33:if((y=l).sign.apply(y,te(h)),l.signature){e.next=36;break}throw new Error("!signature");case 36:if(g=l.signature.toString("base64"),this._blockhashInfo.simulatedSignatures.includes(g)||this._blockhashInfo.transactionSignatures.includes(g)){e.next=42;break}return this._blockhashInfo.simulatedSignatures.push(g),e.abrupt("break",45);case 42:f=!0;case 43:e.next=26;break;case 45:return v=l._compile(),b=v.serialize(),w=l._serialize(b),M=w.toString("base64"),A={encoding:"base64",commitment:this.commitment},r&&(E=(Array.isArray(r)?r:v.nonProgramIds()).map((function(e){return e.toBase58()})),A.accounts={encoding:"base64",addresses:E}),h&&(A.sigVerify=!0),T=[M,A],e.next=55,this._rpcRequest("simulateTransaction",T);case 55:if(N=e.sent,!("error"in(I=Pi(N,Yc)))){e.next=60;break}throw"data"in I.error&&(k=I.error.data.logs)&&Array.isArray(k)&&(x=(L="\n ")+k.join(L),console.error(I.error.message,x)),new yc("failed to simulate transaction: "+I.error.message,k);case 60:return e.abrupt("return",I.result);case 61:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"sendTransaction",value:(h=P(O().mark((function e(t,n,r){var i,o,a,s,u,c;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("version"in t)){e.next=7;break}if(!n||!Array.isArray(n)){e.next=3;break}throw new Error("Invalid arguments");case 3:return i=t.serialize(),e.next=6,this.sendRawTransaction(i,n);case 6:return e.abrupt("return",e.sent);case 7:if(void 0!==n&&Array.isArray(n)){e.next=9;break}throw new Error("Invalid arguments");case 9:if(o=n,!t.nonceInfo){e.next=14;break}t.sign.apply(t,te(o)),e.next=32;break;case 14:a=this._disableBlockhashCaching;case 15:return e.next=17,this._blockhashWithExpiryBlockHeight(a);case 17:if(s=e.sent,t.lastValidBlockHeight=s.lastValidBlockHeight,t.recentBlockhash=s.blockhash,t.sign.apply(t,te(o)),t.signature){e.next=23;break}throw new Error("!signature");case 23:if(u=t.signature.toString("base64"),this._blockhashInfo.transactionSignatures.includes(u)){e.next=29;break}return this._blockhashInfo.transactionSignatures.push(u),e.abrupt("break",32);case 29:a=!0;case 30:e.next=15;break;case 32:return c=t.serialize(),e.next=35,this.sendRawTransaction(c,r);case 35:return e.abrupt("return",e.sent);case 36:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"sendRawTransaction",value:(d=P(O().mark((function e(t,n){var r,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=iu(t).toString("base64"),e.next=3,this.sendEncodedTransaction(r,n);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"sendEncodedTransaction",value:(l=P(O().mark((function e(t,n){var r,i,o,a,s,u,c;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={encoding:"base64"},i=n&&n.skipPreflight,o=n&&n.preflightCommitment||this.commitment,n&&null!=n.maxRetries&&(r.maxRetries=n.maxRetries),n&&null!=n.minContextSlot&&(r.minContextSlot=n.minContextSlot),i&&(r.skipPreflight=i),o&&(r.preflightCommitment=o),a=[t,r],e.next=10,this._rpcRequest("sendTransaction",a);case 10:if(s=e.sent,!("error"in(u=Pi(s,id)))){e.next=15;break}throw"data"in u.error&&(c=u.error.data.logs),new yc("failed to send transaction: "+u.error.message,c);case 15:return e.abrupt("return",u.result);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"_wsOnOpen",value:function(){var e=this;this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((function(){P(O().mark((function t(){return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._rpcWebSocket.notify("ping");case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})))()}),5e3),this._updateSubscriptions()}},{key:"_wsOnError",value:function(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}},{key:"_wsOnClose",value:function(e){var t=this;this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((function(e){var n=ee(e,2),r=n[0],i=n[1];t._setSubscription(r,D(D({},i),{},{state:"pending"}))}))):this._updateSubscriptions()}},{key:"_setSubscription",value:function(e,t){var n,r=null===(n=this._subscriptionsByHash[e])||void 0===n?void 0:n.state;if(this._subscriptionsByHash[e]=t,r!==t.state){var i=this._subscriptionStateChangeCallbacksByHash[e];i&&i.forEach((function(e){try{e(t.state)}catch(e){}}))}}},{key:"_onSubscriptionStateChange",value:function(e,t){var n,r=this,i=this._subscriptionHashByClientSubscriptionId[e];if(null==i)return function(){};var o=(n=this._subscriptionStateChangeCallbacksByHash)[i]||(n[i]=new Set);return o.add(t),function(){o.delete(t),0===o.size&&delete r._subscriptionStateChangeCallbacksByHash[i]}}},{key:"_updateSubscriptions",value:(c=P(O().mark((function e(){var t,n,r=this;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==Object.keys(this._subscriptionsByHash).length){e.next=3;break}return this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((function(){r._rpcWebSocketIdleTimeout=null;try{r._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log("Error when closing socket connection: ".concat(e.message))}}),500)),e.abrupt("return");case 3:if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),this._rpcWebSocketConnected){e.next=7;break}return this._rpcWebSocket.connect(),e.abrupt("return");case 7:return t=this._rpcWebSocketGeneration,n=function(){return t===r._rpcWebSocketGeneration},e.next=11,Promise.all(Object.keys(this._subscriptionsByHash).map(function(){var e=P(O().mark((function e(t){var i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(i=r._subscriptionsByHash[t])){e.next=3;break}return e.abrupt("return");case 3:e.t0=i.state,e.next="pending"===e.t0||"unsubscribed"===e.t0?6:"subscribed"===e.t0?15:19;break;case 6:if(0!==i.callbacks.size){e.next=12;break}return delete r._subscriptionsByHash[t],"unsubscribed"===i.state&&delete r._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],e.next=11,r._updateSubscriptions();case 11:return e.abrupt("return");case 12:return e.next=14,P(O().mark((function e(){var o,a,s;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.args,a=i.method,e.prev=1,r._setSubscription(t,D(D({},i),{},{state:"subscribing"})),e.next=5,r._rpcWebSocket.call(a,o);case 5:return s=e.sent,r._setSubscription(t,D(D({},i),{},{serverSubscriptionId:s,state:"subscribed"})),r._subscriptionCallbacksByServerSubscriptionId[s]=i.callbacks,e.next=10,r._updateSubscriptions();case 10:e.next=20;break;case 12:if(e.prev=12,e.t0=e.catch(1),e.t0 instanceof Error&&console.error("".concat(a," error for argument"),o,e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,D(D({},i),{},{state:"pending"})),e.next=20,r._updateSubscriptions();case 20:case"end":return e.stop()}}),e,null,[[1,12]])})))();case 14:return e.abrupt("break",19);case 15:if(0!==i.callbacks.size){e.next=18;break}return e.next=18,P(O().mark((function e(){var o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=i.serverSubscriptionId,a=i.unsubscribeMethod,!r._subscriptionsAutoDisposedByRpc.has(o)){e.next=5;break}r._subscriptionsAutoDisposedByRpc.delete(o),e.next=21;break;case 5:return r._setSubscription(t,D(D({},i),{},{state:"unsubscribing"})),r._setSubscription(t,D(D({},i),{},{state:"unsubscribing"})),e.prev=7,e.next=10,r._rpcWebSocket.call(a,[o]);case 10:e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(7),e.t0 instanceof Error&&console.error("".concat(a," error:"),e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,D(D({},i),{},{state:"subscribed"})),e.next=20,r._updateSubscriptions();case 20:return e.abrupt("return");case 21:return r._setSubscription(t,D(D({},i),{},{state:"unsubscribed"})),e.next=24,r._updateSubscriptions();case 24:case"end":return e.stop()}}),e,null,[[7,12]])})))();case 18:return e.abrupt("break",19);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 11:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_handleServerNotification",value:function(e,t){var n=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==n&&n.forEach((function(e){try{e.apply(void 0,te(t))}catch(e){console.error(e)}}))}},{key:"_wsOnAccountNotification",value:function(e){var t=Pi(e,pl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_makeSubscription",value:function(e,t){var n=this,r=this._nextClientSubscriptionId++,i=hc([e.method,t]),o=this._subscriptionsByHash[i];return void 0===o?this._subscriptionsByHash[i]=D(D({},e),{},{args:t,callbacks:new Set([e.callback]),state:"pending"}):o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=P(O().mark((function t(){var o;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return delete n._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete n._subscriptionHashByClientSubscriptionId[r],Iu(void 0!==(o=n._subscriptionsByHash[i]),"Could not find a `Subscription` when tearing down client subscription #".concat(r)),o.callbacks.delete(e.callback),t.next=7,n._updateSubscriptions();case 7:case"end":return t.stop()}}),t)}))),this._updateSubscriptions(),r}},{key:"onAccountChange",value:function(e,t,n){var r=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},r)}},{key:"removeAccountChangeListener",value:(u=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_wsOnProgramAccountNotification",value:function(e){var t=Pi(e,yl),n=t.result,r=t.subscription;this._handleServerNotification(r,[{accountId:n.value.pubkey,accountInfo:n.value.account},n.context])}},{key:"onProgramAccountChange",value:function(e,t,n,r){var i=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",r?{filters:r}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}},{key:"removeProgramAccountChangeListener",value:(s=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"program account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"onLogs",value:function(e,t,n){var r=this._buildArgs(["object"===z(e)?{mentions:[e.toString()]}:e],n||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},r)}},{key:"removeOnLogsListener",value:(a=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"logs");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_wsOnLogsNotification",value:function(e){var t=Pi(e,ad),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_wsOnSlotNotification",value:function(e){var t=Pi(e,gl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotChange",value:function(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}},{key:"removeSlotChangeListener",value:(o=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_wsOnSlotUpdatesNotification",value:function(e){var t=Pi(e,bl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotUpdate",value:function(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}},{key:"removeSlotUpdateListener",value:(i=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot update");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_unsubscribeClientSubscription",value:(r=P(O().mark((function e(t,n){var r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t])){e.next=6;break}return e.next=4,r();case 4:e.next=7;break;case 6:console.warn("Ignored unsubscribe request because an active subscription with id "+"`".concat(t,"` for '").concat(n,"' events ")+"could not be found.");case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"_buildArgs",value:function(e,t,n,r){var i=t||this._commitment;if(i||n||r){var o={};n&&(o.encoding=n),i&&(o.commitment=i),r&&(o=Object.assign(o,r)),e.push(o)}return e}},{key:"_buildArgsAtLeastConfirmed",value:function(e,t,n,r){var i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,n,r)}},{key:"_wsOnSignatureNotification",value:function(e){var t=Pi(e,wl),n=t.result,r=t.subscription;"receivedSignature"!==n.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===n.value?[{type:"received"},n.context]:[{type:"status",result:n.value},n.context])}},{key:"onSignature",value:function(e,t,n){var r=this,i=this._buildArgs([e],n||this._commitment||"finalized"),o=this._makeSubscription({callback:function(e,n){if("status"===e.type){t(e.result,n);try{r.removeSignatureListener(o)}catch(e){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return o}},{key:"onSignatureWithOptions",value:function(e,t,n){var r=this,i=D(D({},n),{},{commitment:n&&n.commitment||this._commitment||"finalized"}),o=i.commitment,a=q(i,Xs),s=this._buildArgs([e],o,void 0,a),u=this._makeSubscription({callback:function(e,n){t(e,n);try{r.removeSignatureListener(u)}catch(e){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return u}},{key:"removeSignatureListener",value:(n=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"signature result");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_wsOnRootNotification",value:function(e){var t=Pi(e,Ml),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onRootChange",value:function(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}},{key:"removeRootChangeListener",value:(t=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"root change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),cd=function(){function e(t){R(this,e),this._keypair=void 0,this._keypair=null!=t?t:$s()}return U(e,[{key:"publicKey",get:function(){return new lu(this._keypair.publicKey)}},{key:"secretKey",get:function(){return new Uint8Array(this._keypair.secretKey)}}],[{key:"generate",value:function(){return new e($s())}},{key:"fromSecretKey",value:function(t,n){if(64!==t.byteLength)throw new Error("bad secret key size");var r=t.slice(32,64);if(!n||!n.skipValidation)for(var i=t.slice(0,32),o=eu(i),a=0;a<32;a++)if(r[a]!==o[a])throw new Error("provided secretKey is invalid");return new e({publicKey:r,secretKey:t})}},{key:"fromSeed",value:function(t){var n=eu(t),r=new Uint8Array(64);return r.set(t),r.set(n,32),new e({publicKey:n,secretKey:r})}}]),e}(),ld=Object.freeze({CreateLookupTable:{index:0,layout:vi([yi("instruction"),nc("recentSlot"),pi("bumpSeed")])},FreezeLookupTable:{index:1,layout:vi([yi("instruction")])},ExtendLookupTable:{index:2,layout:vi([yi("instruction"),nc(),bi(wu(),hi(yi(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:vi([yi("instruction")])},CloseLookupTable:{index:4,layout:vi([yi("instruction")])}}),dd=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=yi("instruction").decode(e.data),r=0,i=Object.entries(ld);r2?e.keys[2].pubkey:void 0,addresses:t.map((function(e){return new lu(e)}))}}},{key:"decodeCloseLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}},{key:"decodeFreezeLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"decodeDeactivateLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(hd.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}},{key:"checkKeysLength",value:function(e,t){if(e.length1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{},i=Ws(e,t,r.extraEntropy),o=i.seed,a=i.m,s=i.d,u=new Ds(32,ns);for(u.reseedSync(o);!(n=_s(u.generateSync(),a,s,r.canonical));)u.reseedSync();return Qs(n,r)}(e,t,{der:!1,recovered:!0})};Gs.isValidPrivateKey;var bd=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ls.fromPrivateKey(e).toRawBytes(t)},wd=vi([pi("numSignatures"),fi("signatureOffset"),pi("signatureInstructionIndex"),fi("ethAddressOffset"),pi("ethAddressInstructionIndex"),fi("messageDataOffset"),fi("messageDataSize"),pi("messageInstructionIndex"),wi(20,"ethAddress"),wi(64,"signature"),pi("recoveryId")]),Md=function(){function e(){R(this,e)}return U(e,null,[{key:"publicKeyToEthAddress",value:function(e){Iu(64===e.length,"Public key must be ".concat(64," bytes but received ").concat(e.length," bytes"));try{return Te.from(Qa(iu(e))).slice(-20)}catch(e){throw new Error("Error constructing Ethereum address: ".concat(e))}}},{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,i=t.signature,o=t.recoveryId,a=t.instructionIndex;return e.createInstructionWithEthAddress({ethAddress:e.publicKeyToEthAddress(n),message:r,signature:i,recoveryId:o,instructionIndex:a})}},{key:"createInstructionWithEthAddress",value:function(t){var n,r=t.ethAddress,i=t.message,o=t.signature,a=t.recoveryId,s=t.instructionIndex,u=void 0===s?0:s;Iu(20===(n="string"==typeof r?r.startsWith("0x")?Te.from(r.substr(2),"hex"):Te.from(r,"hex"):r).length,"Address must be ".concat(20," bytes but received ").concat(n.length," bytes"));var c=12+n.length,l=c+o.length+1,d=Te.alloc(wd.span+i.length);return wd.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:u,ethAddressOffset:12,ethAddressInstructionIndex:u,messageDataOffset:l,messageDataSize:i.length,messageInstructionIndex:u,signature:iu(o),ethAddress:iu(n),recoveryId:a},d),d.fill(iu(i),wd.span),new Du({keys:[],programId:e.programId,data:d})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;Iu(32===t.length,"Private key must be ".concat(32," bytes but received ").concat(t.length," bytes"));try{var i=iu(t),o=bd(i,!1).slice(1),a=Te.from(Qa(iu(n))),s=ee(vd(a,i),2),u=s[0],c=s[1];return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:u,recoveryId:c,instructionIndex:r})}catch(e){throw new Error("Error creating instruction; ".concat(e))}}}]),e}();Md.programId=new lu("KeccakSecp256k11111111111111111111111111111");var Ad=new lu("StakeConfig11111111111111111111111111111111"),Ed=U((function e(t,n){R(this,e),this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=n})),Td=U((function e(t,n,r){R(this,e),this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=n,this.custodian=r}));Td.default=new Td(0,0,lu.default);var Nd=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=yi("instruction").decode(e.data),r=0,i=Object.entries(Id);r3&&(i.custodianPubkey=e.keys[3].pubkey),i}},{key:"decodeAuthorizeWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Ju(Id.AuthorizeWithSeed,e.data),n=t.newAuthorized,r=t.stakeAuthorizationType,i=t.authoritySeed,o=t.authorityOwner,a={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:i,authorityOwner:new lu(o),newAuthorizedPubkey:new lu(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(a.custodianPubkey=e.keys[3].pubkey),a}},{key:"decodeSplit",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Ju(Id.Split,e.data).lamports;return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}},{key:"decodeMerge",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ju(Id.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}},{key:"decodeWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);var t=Ju(Id.Withdraw,e.data).lamports,n={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(n.custodianPubkey=e.keys[5].pubkey),n}},{key:"decodeDeactivate",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ju(Id.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(Ld.programId))throw new Error("invalid instruction; programId is not StakeProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length0&&void 0!==arguments[0]?arguments[0]:"authorized";return vi([wu("staker"),wu("withdrawer")],e)}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return vi([gi("unixTimestamp"),gi("epoch"),wu("custodian")],e)}()])},Authorize:{index:1,layout:vi([yi("instruction"),wu("newAuthorized"),yi("stakeAuthorizationType")])},Delegate:{index:2,layout:vi([yi("instruction")])},Split:{index:3,layout:vi([yi("instruction"),gi("lamports")])},Withdraw:{index:4,layout:vi([yi("instruction"),gi("lamports")])},Deactivate:{index:5,layout:vi([yi("instruction")])},Merge:{index:7,layout:vi([yi("instruction")])},AuthorizeWithSeed:{index:8,layout:vi([yi("instruction"),wu("newAuthorized"),yi("stakeAuthorizationType"),Au("authoritySeed"),wu("authorityOwner")])}}),kd=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),Ld=function(){function e(){R(this,e)}return U(e,null,[{key:"initialize",value:function(e){var t=e.stakePubkey,n=e.authorized,r=e.lockup||Td.default,i=Zu(Id.Initialize,{authorized:{staker:iu(n.staker.toBuffer()),withdrawer:iu(n.withdrawer.toBuffer())},lockup:{unixTimestamp:r.unixTimestamp,epoch:r.epoch,custodian:iu(r.custodian.toBuffer())}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new Du(o)}},{key:"createAccountWithSeed",value:function(e){var t=new Ou;t.add(oc.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"createAccount",value:function(e){var t=new Ou;t.add(oc.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"delegate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.votePubkey,i=Zu(Id.Delegate);return(new Ou).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:Vu,isSigner:!1,isWritable:!1},{pubkey:Ad,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"authorize",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.stakeAuthorizationType,o=e.custodianPubkey,a=Zu(Id.Authorize,{newAuthorized:iu(r.toBuffer()),stakeAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Ou).add({keys:s,programId:this.programId,data:a})}},{key:"authorizeWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorityBase,r=e.authoritySeed,i=e.authorityOwner,o=e.newAuthorizedPubkey,a=e.stakeAuthorizationType,s=e.custodianPubkey,u=Zu(Id.AuthorizeWithSeed,{newAuthorized:iu(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:r,authorityOwner:iu(i.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:Pu,isSigner:!1,isWritable:!1}];return s&&c.push({pubkey:s,isSigner:!1,isWritable:!1}),(new Ou).add({keys:c,programId:this.programId,data:u})}},{key:"splitInstruction",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.lamports,o=Zu(Id.Split,{lamports:i});return new Du({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}},{key:"split",value:function(e){var t=new Ou;return t.add(oc.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}},{key:"splitWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.basePubkey,o=e.seed,a=e.lamports,s=new Ou;return s.add(oc.allocate({accountPubkey:r,basePubkey:i,seed:o,space:this.space,programId:this.programId})),s.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:a}))}},{key:"merge",value:function(e){var t=e.stakePubkey,n=e.sourceStakePubKey,r=e.authorizedPubkey,i=Zu(Id.Merge);return(new Ou).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:Vu,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"withdraw",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.toPubkey,i=e.lamports,o=e.custodianPubkey,a=Zu(Id.Withdraw,{lamports:i}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:Vu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Ou).add({keys:s,programId:this.programId,data:a})}},{key:"deactivate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=Zu(Id.Deactivate);return(new Ou).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}]),e}();Ld.programId=new lu("Stake11111111111111111111111111111111111111"),Ld.space=200;var xd=U((function e(t,n,r,i){R(this,e),this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=n,this.authorizedWithdrawer=r,this.commission=i})),Sd=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=yi("instruction").decode(e.data),r=0,i=Object.entries(jd);r0&&void 0!==arguments[0]?arguments[0]:"voteInit";return vi([wu("nodePubkey"),wu("authorizedVoter"),wu("authorizedWithdrawer"),pi("commission")],e)}()])},Authorize:{index:1,layout:vi([yi("instruction"),wu("newAuthorized"),yi("voteAuthorizationType")])},Withdraw:{index:3,layout:vi([yi("instruction"),gi("lamports")])},AuthorizeWithSeed:{index:10,layout:vi([yi("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteAuthorizeWithSeedArgs";return vi([yi("voteAuthorizationType"),wu("currentAuthorityDerivedKeyOwnerPubkey"),Au("currentAuthorityDerivedKeySeed"),wu("newAuthorized")],e)}()])}}),Cd=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Dd=function(){function e(){R(this,e)}return U(e,null,[{key:"initializeAccount",value:function(e){var t=e.votePubkey,n=e.nodePubkey,r=e.voteInit,i=Zu(jd.InitializeAccount,{voteInit:{nodePubkey:iu(r.nodePubkey.toBuffer()),authorizedVoter:iu(r.authorizedVoter.toBuffer()),authorizedWithdrawer:iu(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Du(o)}},{key:"createAccount",value:function(e){var t=new Ou;return t.add(oc.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}},{key:"authorize",value:function(e){var t=e.votePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.voteAuthorizationType,o=Zu(jd.Authorize,{newAuthorized:iu(r.toBuffer()),voteAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Ou).add({keys:a,programId:this.programId,data:o})}},{key:"authorizeWithSeed",value:function(e){var t=e.currentAuthorityDerivedKeyBasePubkey,n=e.currentAuthorityDerivedKeyOwnerPubkey,r=e.currentAuthorityDerivedKeySeed,i=e.newAuthorizedPubkey,o=e.voteAuthorizationType,a=e.votePubkey,s=Zu(jd.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:iu(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:iu(i.toBuffer()),voteAuthorizationType:o.index}}),u=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new Ou).add({keys:u,programId:this.programId,data:s})}},{key:"withdraw",value:function(e){var t=e.votePubkey,n=e.authorizedWithdrawerPubkey,r=e.lamports,i=e.toPubkey,o=Zu(jd.Withdraw,{lamports:r}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Ou).add({keys:a,programId:this.programId,data:o})}},{key:"safeWithdraw",value:function(t,n,r){if(t.lamports>n-r)throw new Error("Withdraw will leave vote account with insuffcient funds.");return e.withdraw(t)}}]),e}();Dd.programId=new lu("Vote111111111111111111111111111111111111111"),Dd.space=3731;var Od=new lu("Va1idator1nfo111111111111111111111111111111"),zd=Xi({name:Zi(),website:Gi(Zi()),details:Gi(Zi()),keybaseUsername:Gi(Zi())}),_d=function(){function e(t,n){R(this,e),this.key=void 0,this.info=void 0,this.key=t,this.info=n}return U(e,null,[{key:"fromConfigData",value:function(t){var n=te(t);if(2!==Tu(n))return null;for(var r=[],i=0;i<2;i++){var o=new lu(n.slice(0,uu)),a=1===(n=n.slice(uu)).slice(0,1)[0];n=n.slice(1),r.push({publicKey:o,isSigner:a})}if(r[0].publicKey.equals(Od)&&r[1].isSigner){var s=Au().decode(Te.from(n)),u=JSON.parse(s);return _i(u,zd),new e(r[1].publicKey,u)}return null}}]),e}(),Pd=new lu("Vote111111111111111111111111111111111111111"),Rd=vi([wu("nodePubkey"),wu("authorizedWithdrawer"),pi("commission"),mi(),bi(vi([mi("slot"),yi("confirmationCount")]),hi(yi(),-8),"votes"),pi("rootSlotValid"),mi("rootSlot"),mi(),bi(vi([mi("epoch"),wu("authorizedVoter")]),hi(yi(),-8),"authorizedVoters"),vi([bi(vi([wu("authorizedPubkey"),mi("epochOfLastAuthorizedSwitch"),mi("targetEpoch")]),32,"buf"),mi("idx"),pi("isEmpty")],"priorVoters"),mi(),bi(vi([mi("epoch"),mi("credits"),mi("prevCredits")]),hi(yi(),-8),"epochCredits"),vi([mi("slot"),mi("timestamp")],"lastTimestamp")]),Bd=function(){function e(t){R(this,e),this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}return U(e,null,[{key:"fromAccountData",value:function(t){var n=Rd.decode(iu(t),4),r=n.rootSlot;return n.rootSlotValid||(r=null),new e({nodePubkey:new lu(n.nodePubkey),authorizedWithdrawer:new lu(n.authorizedWithdrawer),commission:n.commission,votes:n.votes,rootSlot:r,authorizedVoters:n.authorizedVoters.map(Ud),priorVoters:Qd(n.priorVoters),epochCredits:n.epochCredits,lastTimestamp:n.lastTimestamp})}}]),e}();function Ud(e){var t=e.authorizedVoter;return{epoch:e.epoch,authorizedVoter:new lu(t)}}function Wd(e){var t=e.authorizedPubkey,n=e.epochOfLastAuthorizedSwitch,r=e.targetEpoch;return{authorizedPubkey:new lu(t),epochOfLastAuthorizedSwitch:n,targetEpoch:r}}function Qd(e){var t=e.buf,n=e.idx;return e.isEmpty?[]:[].concat(te(t.slice(n+1).map(Wd)),te(t.slice(0,n).map(Wd)))}var Yd={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function Fd(){return(Fd=P(O().mark((function e(t,n,r,i){var o,a,s,u,c,l,d;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(o=r,a=i):a=r,s=a&&{skipPreflight:a.skipPreflight,preflightCommitment:a.preflightCommitment||a.commitment,minContextSlot:a.minContextSlot},e.next=4,t.sendRawTransaction(n,s);case 4:return u=e.sent,c=a&&a.commitment,l=o?t.confirmTransaction(o,c):t.confirmTransaction(u,c),e.next=9,l;case 9:if(!(d=e.sent.value).err){e.next=12;break}throw new Error("Raw transaction ".concat(u," failed (").concat(JSON.stringify(d),")"));case 12:return e.abrupt("return",u);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Vd=j(Object.freeze({__proto__:null,Account:du,AddressLookupTableAccount:bc,AddressLookupTableInstruction:dd,AddressLookupTableProgram:hd,Authorized:Ed,BLOCKHASH_CACHE_TIMEOUT_MS:3e4,BPF_LOADER_DEPRECATED_PROGRAM_ID:hu,BPF_LOADER_PROGRAM_ID:sc,BpfLoader:uc,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:fd,ComputeBudgetInstruction:pd,ComputeBudgetProgram:yd,Connection:ud,Ed25519Program:gd,Enum:au,EpochSchedule:fc,FeeCalculatorLayout:Ku,Keypair:cd,LAMPORTS_PER_SOL:1e9,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:ld,Loader:ac,Lockup:Td,MAX_SEED_LENGTH:32,Message:xu,MessageAccountKeys:bu,MessageV0:Su,NONCE_ACCOUNT_LENGTH:ec,NonceAccount:tc,PACKET_DATA_SIZE:pu,PUBLIC_KEY_LENGTH:uu,PublicKey:lu,SIGNATURE_LENGTH_IN_BYTES:yu,SOLANA_SCHEMA:su,STAKE_CONFIG_ID:Ad,STAKE_INSTRUCTION_LAYOUTS:Id,SYSTEM_INSTRUCTION_LAYOUTS:ic,SYSVAR_CLOCK_PUBKEY:Pu,SYSVAR_EPOCH_SCHEDULE_PUBKEY:Ru,SYSVAR_INSTRUCTIONS_PUBKEY:Bu,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:Uu,SYSVAR_RENT_PUBKEY:Wu,SYSVAR_REWARDS_PUBKEY:Qu,SYSVAR_SLOT_HASHES_PUBKEY:Yu,SYSVAR_SLOT_HISTORY_PUBKEY:Fu,SYSVAR_STAKE_HISTORY_PUBKEY:Vu,Secp256k1Program:Md,SendTransactionError:yc,SolanaJSONRPCError:mc,SolanaJSONRPCErrorCode:{JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016},StakeAuthorizationLayout:kd,StakeInstruction:Nd,StakeProgram:Ld,Struct:ou,SystemInstruction:rc,SystemProgram:oc,Transaction:Ou,TransactionExpiredBlockheightExceededError:mu,TransactionExpiredNonceInvalidError:vu,TransactionExpiredTimeoutError:gu,TransactionInstruction:Du,TransactionMessage:zu,get TransactionStatus(){return ku},VALIDATOR_INFO_KEY:Od,VERSION_PREFIX_MASK:fu,VOTE_PROGRAM_ID:Pd,ValidatorInfo:_d,VersionedMessage:ju,VersionedTransaction:_u,VoteAccount:Bd,VoteAuthorizationLayout:Cd,VoteInit:xd,VoteInstruction:Sd,VoteProgram:Dd,clusterApiUrl:function(e,t){var n=!1===t?"http":"https";if(!e)return Yd[n].devnet;var r=Yd[n][e];if(!r)throw new Error("Unknown ".concat(n," cluster: ").concat(e));return r},sendAndConfirmRawTransaction:function(e,t,n,r){return Fd.apply(this,arguments)},sendAndConfirmTransaction:Hu})),Hd={};Object.defineProperty(Hd,"__esModule",{value:!0});var Gd={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"},qd=function(e){Q(n,e);var t=X(n);function n(){var e;R(this,n);for(var r=arguments.length,i=new Array(r),o=0;o=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");var t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}function $d(){return Jd(this,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}function eh(){return Jd(this,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}var th;function nh(e,t){return Jd(this,void 0,void 0,O().mark((function n(){var r,i,o,a,s;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=JSON.stringify(e),i=Kd(e.id),o=new Uint8Array(12),crypto.getRandomValues(o),n.next=6,crypto.subtle.encrypt(ih(i,o),t,(new TextEncoder).encode(r));case 6:return a=n.sent,(s=new Uint8Array(i.byteLength+o.byteLength+a.byteLength)).set(new Uint8Array(i),0),s.set(new Uint8Array(o),i.byteLength),s.set(new Uint8Array(a),i.byteLength+o.byteLength),n.abrupt("return",s);case 12:case"end":return n.stop()}}),n)})))}function rh(e,t){return Jd(this,void 0,void 0,O().mark((function n(){var r,i,o,a,s,u;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.slice(0,4),i=e.slice(4,16),o=e.slice(16),n.next=5,crypto.subtle.decrypt(ih(r,i),t,o);case 5:if(a=n.sent,s=oh().decode(a),u=JSON.parse(s),!Object.hasOwnProperty.call(u,"error")){n.next=10;break}throw new Zd(u.id,u.error.code,u.error.message);case 10:return n.abrupt("return",u);case 11:case"end":return n.stop()}}),n)})))}function ih(e,t){return{additionalData:e,iv:t,name:"AES-GCM",tagLength:128}}function oh(){return void 0===th&&(th=new TextDecoder("utf-8")),th}function ah(e,t,n){return Jd(this,void 0,void 0,O().mark((function r(){var i,o,a,s,u,c,l;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Promise.all([crypto.subtle.exportKey("raw",t),crypto.subtle.importKey("raw",e,{name:"ECDH",namedCurve:"P-256"},!1,[])]);case 2:return i=r.sent,o=ee(i,2),a=o[0],s=o[1],r.next=8,crypto.subtle.deriveBits({name:"ECDH",public:s},n,256);case 8:return u=r.sent,r.next=11,crypto.subtle.importKey("raw",u,"HKDF",!1,["deriveKey"]);case 11:return c=r.sent,r.next=14,crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(a),info:new Uint8Array},c,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"]);case 14:return l=r.sent,r.abrupt("return",l);case 16:case"end":return r.stop()}}),r)})))}function sh(e){if(e<49152||e>65535)throw new qd(Gd.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,"Association port number must be between 49152 and 65535. ".concat(e," given."),{port:e});return e}function uh(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i1?e.shift():e[0]}}(),u=1,c=0,l={__type:"disconnected"},n.abrupt("return",new Promise((function(t,n){var h,p,f,y={},m=function e(){return Jd(d,void 0,void 0,O().mark((function t(){var n,r;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("connecting"===l.__type){t.next=3;break}return console.warn("Expected adapter state to be `connecting` at the moment the websocket opens. "+"Got `".concat(l.__type,"`.")),t.abrupt("return");case 3:return n=l.associationKeypair,h.removeEventListener("open",e),t.next=7,eh();case 7:return r=t.sent,t.t0=h,t.next=11,Xd(r.publicKey,n.privateKey);case 11:t.t1=t.sent,t.t0.send.call(t.t0,t.t1),l={__type:"hello_req_sent",associationPublicKey:n.publicKey,ecdhPrivateKey:r.privateKey};case 14:case"end":return t.stop()}}),t)})))},g=function(e){e.wasClean?l={__type:"disconnected"}:n(new qd(Gd.ERROR_SESSION_CLOSED,"The wallet session dropped unexpectedly (".concat(e.code,": ").concat(e.reason,")."),{closeEvent:e})),p()},v=function(e){return Jd(d,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p(),!(Date.now()-a>=gh)){e.next=5;break}n(new qd(Gd.ERROR_SESSION_TIMEOUT,"Failed to connect to the wallet websocket on port ".concat(i,"."))),e.next=8;break;case 5:return e.next=7,new Promise((function(e){var t=s();f=window.setTimeout(e,t)}));case 7:w();case 8:case"end":return e.stop()}}),e)})))},b=function(r){return Jd(d,void 0,void 0,O().mark((function i(){var o,a,s,d,f,m,g,v;return O().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.data.arrayBuffer();case 2:o=i.sent,i.t0=l.__type,i.next="connected"===i.t0?6:"hello_req_sent"===i.t0?30:51;break;case 6:if(i.prev=6,a=o.slice(0,4),(s=new DataView(a).getUint32(0,!1))===c+1){i.next=11;break}throw new Error("Encrypted message has invalid sequence number");case 11:return c=s,i.next=14,rh(o,l.sharedSecret);case 14:d=i.sent,f=y[d.id],delete y[d.id],f.resolve(d.result),i.next=29;break;case 20:if(i.prev=20,i.t1=i.catch(6),!(i.t1 instanceof Zd)){i.next=28;break}m=y[i.t1.jsonRpcMessageId],delete y[i.t1.jsonRpcMessageId],m.reject(i.t1),i.next=29;break;case 28:throw i.t1;case 29:return i.abrupt("break",51);case 30:return i.next=32,ah(o,l.associationPublicKey,l.ecdhPrivateKey);case 32:return g=i.sent,l={__type:"connected",sharedSecret:g},v=new Proxy({},{get:function(e,t){if(null==e[t]){var n=t.toString().replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())})).toLowerCase();e[t]=function(e){return Jd(this,void 0,void 0,O().mark((function r(){var i;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=u++,r.t0=h,r.next=4,nh({id:i,jsonrpc:"2.0",method:n,params:null!=e?e:{}},g);case 4:return r.t1=r.sent,r.t0.send.call(r.t0,r.t1),r.abrupt("return",new Promise((function(e,n){y[i]={resolve:function(r){switch(t){case"authorize":case"reauthorize":var i=r.wallet_uri_base;if(null!=i)try{bh(i)}catch(e){return void n(e)}}e(r)},reject:n}})));case 7:case"end":return r.stop()}}),r)})))}}return e[t]},defineProperty:function(){return!1},deleteProperty:function(){return!1}}),i.prev=35,i.t2=t,i.next=39,e(v);case 39:i.t3=i.sent,(0,i.t2)(i.t3),i.next=46;break;case 43:i.prev=43,i.t4=i.catch(35),n(i.t4);case 46:return i.prev=46,p(),h.close(),i.finish(46);case 50:return i.abrupt("break",51);case 51:case"end":return i.stop()}}),i,null,[[6,20],[35,43,46,50]])})))},w=function(){p&&p(),l={__type:"connecting",associationKeypair:r},void 0===a&&(a=Date.now()),(h=new WebSocket(o,["com.solana.mobilewalletadapter.v1"])).addEventListener("open",m),h.addEventListener("close",g),h.addEventListener("error",v),h.addEventListener("message",b),p=function(){window.clearTimeout(f),h.removeEventListener("open",m),h.removeEventListener("close",g),h.removeEventListener("error",v),h.removeEventListener("message",b)}};w()})));case 13:case"end":return n.stop()}}),n)})))};var wh=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var d=0,h=o-1;(0!==l||d>>0,c[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var f=new Uint8Array(r+(o-p)),y=r;p!==o;)f[y++]=c[p++];return f}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var d=t[i],h=0,p=u-1;(0!==d||h>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=u-r;f!==u&&0===l[f];)f++;for(var y=s.repeat(n);fthis.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function Dh(e,t){return t.property?e+"["+t.property+"]":e}jh.Layout=Ch,jh.nameWithProperty=Dh,jh.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Ch))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var Oh=function(e){Q(n,e);var t=X(n);function n(){return R(this,n),t.apply(this,arguments)}return U(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}(Ch),zh=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");return(i=t.call(this,-1,r)).elementSpan=e,i}return U(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}(Oh),_h=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ch))throw new TypeError("layout must be a Layout");if(void 0===r)r=0;else if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");return(o=t.call(this,e.span,i||e.property)).layout=e,o.offset=r,o}return U(n,[{key:"isCount",value:function(){return this.layout instanceof Ph||this.layout instanceof Rh}},{key:"decode",value:function(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)}}]),n}(Oh),Ph=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntLE(e,n,this.span),this.span}}]),n}(Ch),Rh=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntBE(e,n,this.span),this.span}}]),n}(Ch),Bh=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntLE(e,n,this.span),this.span}}]),n}(Ch),Uh=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntBE(e,n,this.span),this.span}}]),n}(Ch),Wh=Math.pow(2,32);function Qh(e){var t=Math.floor(e/Wh);return{hi32:t,lo32:e-t*Wh}}function Yh(e,t){return e*Wh+t}var Fh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Yh(e.readUInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Qh(e);return t.writeUInt32LE(r.lo32,n),t.writeUInt32LE(r.hi32,n+4),8}}]),n}(Ch),Vh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Yh(e.readUInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Qh(e);return t.writeUInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(Ch),Hh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Yh(e.readInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Qh(e);return t.writeUInt32LE(r.lo32,n),t.writeInt32LE(r.hi32,n+4),8}}]),n}(Ch),Gh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Yh(e.readInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Qh(e);return t.writeInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(Ch),qh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatLE(e,n),4}}]),n}(Ch),Zh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatBE(e,n),4}}]),n}(Ch),Jh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleLE(e,n),8}}]),n}(Ch),Xh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleBE(e,n),8}}]),n}(Ch),Kh=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ch))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Oh&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(r instanceof Oh)&&0u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(e){s.e(e)}finally{s.f()}var c=-1;try{c=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(e){}return(o=t.call(this,c,r)).fields=e,o.decodePrefixes=!!i,o}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;try{n=this.fields.reduce((function(n,r){var i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(e){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n,r=this.makeDestinationObject(),i=se(this.fields);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(void 0!==o.property&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r,i=n,o=0,a=0,s=se(this.fields);try{for(s.s();!(r=s.n()).done;){var u=r.value,c=u.span;if(a=0c&&(c=u.getSpan(t,n)))}o=n,n+=c}}catch(e){s.e(e)}finally{s.f()}return o+a-i}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=se(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;void 0!==i.property&&0i.span?n=-1:0<=n&&(n+=i.span)}}catch(e){r.e(e)}finally{r.f()}}}]),n}(Ch),ep=function(){function e(t){R(this,e),this.property=t}return U(e,[{key:"decode",value:function(){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(){throw new Error("UnionDiscriminator is abstract")}}]),e}(),tp=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Oh&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,r||e.property||"variant")).layout=e,i}return U(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}(ep),np=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;R(this,n);var a=e instanceof Ph||e instanceof Rh;if(a)e=new tp(new _h(e));else if(e instanceof Oh&&e.isCount())e=new tp(e);else if(!(e instanceof ep))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===r&&(r=null),!(null===r||r instanceof Ch))throw new TypeError("defaultLayout must be null or a Layout");if(null!==r){if(0>r.span)throw new Error("defaultLayout must have constant span");void 0===r.property&&(r=r.replicate("content"))}var s=-1;r&&0<=(s=r.span)&&a&&(s+=e.layout.span),(o=t.call(this,s,i)).discriminator=e,o.usesPrefixDiscriminator=a,o.defaultLayout=r,o.registry={};var u=o.defaultGetSourceVariant.bind(Z(o));return o.getSourceVariant=function(e){return u(e)},o.configGetSourceVariant=function(e){u=e.bind(this)},o}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e,t){var n;void 0===t&&(t=0);var r=this.discriminator,i=r.decode(e,t),o=this.registry[i];if(void 0===o){var a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=r.layout.span),(n=this.makeDestinationObject())[r.property]=i,n[o.property]=this.defaultLayout.decode(e,t+a)}else n=o.decode(e,t);return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.getSourceVariant(e);if(void 0===r){var i=this.discriminator,o=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,n),a+o.encode(e[o.property],t,n+a)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new rp(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(e,t){var n=e;return Te.isBuffer(e)&&(void 0===t&&(t=0),n=this.discriminator.decode(e,t)),this.registry[n]}}]),n}(Ch),rp=function(e){Q(n,e);var t=X(n);function n(e,r,i,o){var a;if(R(this,n),!(e instanceof np))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof i&&void 0===o&&(o=i,i=null),i){if(!(i instanceof Ch))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof o)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=i?i.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(a=t.call(this,s,o)).union=e,a.variant=r,a.layout=i||null,a}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(e,t+n)}},{key:"decode",value:function(e,t){var n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}(Ch);function ip(e){return 0>e&&(e+=4294967296),e}var op=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ph||e instanceof Rh))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof r&&void 0===i&&(i=r,r=void 0),4=n)throw new TypeError("bits must be positive integer");var i=8*t.span,o=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+o>i)throw new Error("bits too long for span remainder ("+(i-o)+" of "+i+" remain)");this.container=t,this.bits=n,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if(!Number.isInteger(e)||e!==ip(e&this.valueMask))throw new TypeError(Dh("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=ip(e<n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=this.span;return 0>n&&(n=this.length.decode(e,t)),e.slice(t,t+n)}},{key:"encode",value:function(e,t,n){var r=this.length;if(this.length instanceof Oh&&(r=e.length),!Te.isBuffer(e)||r!==e.length)throw new TypeError(Dh("Blob.encode",this)+" requires (length "+r+") Buffer as src");if(n+r>t.length)throw new RangeError("encoding overruns Buffer");return t.write(e.toString("hex"),n,r,"hex"),this.length instanceof Oh&&this.length.encode(r,t,n),r}}]),n}(Ch),cp=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,-1,e)}return U(n,[{key:"getSpan",value:function(e,t){if(!Te.isBuffer(e))throw new TypeError("b must be a Buffer");void 0===t&&(t=0);for(var n=t;nt.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),t[n+i]=0,i+1}}]),n}(Ch),lp=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),"string"==typeof e&&void 0===r&&(r=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=t.call(this,-1,r)).maxSpan=e,i}return U(n,[{key:"getSpan",value:function(e,t){if(!Te.isBuffer(e))throw new TypeError("b must be a Buffer");return void 0===t&&(t=0),e.length-t}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),i}}]),n}(Ch),dp=function(e){Q(n,e);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,0,r)).value=e,i}return U(n,[{key:"decode",value:function(e,t,n){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}(Ch);jh.ExternalLayout=Oh,jh.GreedyCount=zh,jh.OffsetLayout=_h,jh.UInt=Ph,jh.UIntBE=Rh,jh.Int=Bh,jh.IntBE=Uh,jh.Float=qh,jh.FloatBE=Zh,jh.Double=Jh,jh.DoubleBE=Xh,jh.Sequence=Kh,jh.Structure=$h,jh.UnionDiscriminator=ep,jh.UnionLayoutDiscriminator=tp,jh.Union=np,jh.VariantLayout=rp,jh.BitStructure=op,jh.BitField=ap,jh.Boolean=sp,jh.Blob=up,jh.CString=cp,jh.UTF8=lp,jh.Constant=dp,jh.greedy=function(e,t){return new zh(e,t)},jh.offset=function(e,t,n){return new _h(e,t,n)},jh.u8=function(e){return new Ph(1,e)},jh.u16=function(e){return new Ph(2,e)},jh.u24=function(e){return new Ph(3,e)},jh.u32=function(e){return new Ph(4,e)},jh.u40=function(e){return new Ph(5,e)},jh.u48=function(e){return new Ph(6,e)},jh.nu64=function(e){return new Fh(e)},jh.u16be=function(e){return new Rh(2,e)},jh.u24be=function(e){return new Rh(3,e)},jh.u32be=function(e){return new Rh(4,e)},jh.u40be=function(e){return new Rh(5,e)},jh.u48be=function(e){return new Rh(6,e)},jh.nu64be=function(e){return new Vh(e)},jh.s8=function(e){return new Bh(1,e)},jh.s16=function(e){return new Bh(2,e)},jh.s24=function(e){return new Bh(3,e)},jh.s32=function(e){return new Bh(4,e)},jh.s40=function(e){return new Bh(5,e)},jh.s48=function(e){return new Bh(6,e)},jh.ns64=function(e){return new Hh(e)},jh.s16be=function(e){return new Uh(2,e)},jh.s24be=function(e){return new Uh(3,e)},jh.s32be=function(e){return new Uh(4,e)},jh.s40be=function(e){return new Uh(5,e)},jh.s48be=function(e){return new Uh(6,e)},jh.ns64be=function(e){return new Gh(e)},jh.f32=function(e){return new qh(e)},jh.f32be=function(e){return new Zh(e)},jh.f64=function(e){return new Jh(e)},jh.f64be=function(e){return new Xh(e)},jh.struct=function(e,t,n){return new $h(e,t,n)},jh.bits=function(e,t,n){return new op(e,t,n)};var hp=jh.seq=function(e,t,n){return new Kh(e,t,n)};jh.union=function(e,t,n){return new np(e,t,n)},jh.unionLayoutDiscriminator=function(e,t){return new tp(e,t)},jh.blob=function(e,t){return new up(e,t)},jh.cstr=function(e){return new cp(e)},jh.utf8=function(e,t){return new lp(e,t)},jh.const=function(e,t){return new dp(e,t)};var pp={},fp={exports:{}};!function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===z(e)?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Dn.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===z(e))return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=s(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var d=["","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"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return m(e,t,n)}Math.imul||(y=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?f(this,e,t):n<1024?m(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new T(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function N(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(w,b),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new N(e)},r(N,T),N.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},N.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},N.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},N.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,x)}(fp),function(e){var t=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.map=e.array=e.rustEnum=e.str=e.vecU8=e.tagged=e.vec=e.bool=e.option=e.publicKey=e.i128=e.u128=e.i64=e.u64=e.struct=e.f64=e.f32=e.i32=e.u32=e.i16=e.u16=e.i8=e.u8=void 0;var n=jh,r=Vd,i=t(fp.exports),o=jh;Object.defineProperty(e,"u8",{enumerable:!0,get:function(){return o.u8}}),Object.defineProperty(e,"i8",{enumerable:!0,get:function(){return o.s8}}),Object.defineProperty(e,"u16",{enumerable:!0,get:function(){return o.u16}}),Object.defineProperty(e,"i16",{enumerable:!0,get:function(){return o.s16}}),Object.defineProperty(e,"u32",{enumerable:!0,get:function(){return o.u32}}),Object.defineProperty(e,"i32",{enumerable:!0,get:function(){return o.s32}}),Object.defineProperty(e,"f32",{enumerable:!0,get:function(){return o.f32}}),Object.defineProperty(e,"f64",{enumerable:!0,get:function(){return o.f64}}),Object.defineProperty(e,"struct",{enumerable:!0,get:function(){return o.struct}});var a=function(e){Q(r,e);var t=X(r);function r(e,i,o){var a;return R(this,r),(a=t.call(this,e,o)).blob=n.blob(e),a.signed=i,a}return U(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new i.default(this.blob.decode(e,t),10,"le");return this.signed?n.fromTwos(8*this.span).clone():n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.signed&&(e=e.toTwos(8*this.span)),this.blob.encode(e.toArrayLike(Te,"le",this.span),t,n)}}]),r}(n.Layout);function s(e){return new a(8,!1,e)}e.u64=s,e.i64=function(e){return new a(8,!0,e)},e.u128=function(e){return new a(16,!1,e)},e.i128=function(e){return new a(16,!0,e)};var u=function(e){Q(n,e);var t=X(n);function n(e,r,i,o){var a;return R(this,n),(a=t.call(this,e.span,o)).layout=e,a.decoder=r,a.encoder=i,a}return U(n,[{key:"decode",value:function(e,t){return this.decoder(this.layout.decode(e,t))}},{key:"encode",value:function(e,t,n){return this.layout.encode(this.encoder(e),t,n)}},{key:"getSpan",value:function(e,t){return this.layout.getSpan(e,t)}}]),n}(n.Layout);e.publicKey=function(e){return new u(n.blob(32),(function(e){return new r.PublicKey(e)}),(function(e){return e.toBuffer()}),e)};var c=function(e){Q(r,e);var t=X(r);function r(e,i){var o;return R(this,r),(o=t.call(this,-1,i)).layout=e,o.discriminator=n.u8(),o}return U(r,[{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null==e?this.discriminator.encode(0,t,n):(this.discriminator.encode(1,t,n),this.layout.encode(e,t,n+1)+1)}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return null;if(1===n)return this.layout.decode(e,t+1);throw new Error("Invalid option "+this.property)}},{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return 1;if(1===n)return this.layout.getSpan(e,t+1)+1;throw new Error("Invalid option "+this.property)}}]),r}(n.Layout);function l(e){if(0===e)return!1;if(1===e)return!0;throw new Error("Invalid bool: "+e)}function d(e){return e?1:0}function h(e){var t=n.u32("length"),r=n.struct([t,n.blob(n.offset(t,-t.span),"data")]);return new u(r,(function(e){return e.data}),(function(e){return{data:e}}),e)}e.option=function(e,t){return new c(e,t)},e.bool=function(e){return new u(n.u8(),l,d,e)},e.vec=function(e,t){var r=n.u32("length"),i=n.struct([r,n.seq(e,n.offset(r,-r.span),"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),t)},e.tagged=function(e,t,r){var i=n.struct([s("tag"),t.replicate("data")]);return new u(i,(function(t){var n=t.tag,r=t.data;if(!n.eq(e))throw new Error("Invalid tag, expected: "+e.toString("hex")+", got: "+n.toString("hex"));return r}),(function(t){return{tag:e,data:t}}),r)},e.vecU8=h,e.str=function(e){return new u(h(),(function(e){return e.toString("utf-8")}),(function(e){return Te.from(e,"utf-8")}),e)},e.rustEnum=function(e,t,r){var i=n.union(null!=r?r:n.u8(),t);return e.forEach((function(e,t){return i.addVariant(t,e,e.property)})),i},e.array=function(e,t,r){var i=n.struct([n.seq(e,t,"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),r)};var p=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;return R(this,n),(o=t.call(this,e.span+r.span,i)).keyLayout=e,o.valueLayout=r,o}return U(n,[{key:"decode",value:function(e,t){return t=t||0,[this.keyLayout.decode(e,t),this.valueLayout.decode(e,t+this.keyLayout.getSpan(e,t))]}},{key:"encode",value:function(e,t,n){n=n||0;var r=this.keyLayout.encode(e[0],t,n);return r+this.valueLayout.encode(e[1],t,n+r)}},{key:"getSpan",value:function(e,t){return this.keyLayout.getSpan(e,t)+this.valueLayout.getSpan(e,t)}}]),n}(n.Layout);e.map=function(e,t,r){var i=n.u32("length"),o=n.struct([i,n.seq(new p(e,t),n.offset(i,-i.span),"values")]);return new u(o,(function(e){var t=e.values;return new Map(t)}),(function(e){return{values:Array.from(e.entries())}}),r)}}(pp),ue.Web3MobileWallet;var yp=ue.transact,mp=Dn.Buffer,gp=Cn.exports,vp=pp.struct([pp.publicKey("mint"),pp.publicKey("owner"),pp.u64("amount"),pp.u32("delegateOption"),pp.publicKey("delegate"),pp.u8("state"),pp.u32("isNativeOption"),pp.u64("isNative"),pp.u64("delegatedAmount"),pp.u32("closeAuthorityOption"),pp.publicKey("closeAuthority")]);pp.array;var bp=pp.bool,wp=pp.i128;pp.i16;var Mp=pp.i32,Ap=pp.i64;pp.i8,pp.map;var Ep=pp.option,Tp=pp.publicKey,Np=pp.rustEnum,Ip=pp.str,kp=pp.struct;pp.tagged;var Lp=pp.u128,xp=pp.u16,Sp=pp.u32,jp=pp.u64,Cp=pp.u8,Dp=pp.vec;pp.vecU8;const Op="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0yOTkuMyAyMzcuNSA1MDAgMTIybDIwMC43IDExNS41LTczLjUgNDIuNkw1MDAgMjA4LjJsLTEyNy4xIDcxLjktNzMuNi00Mi42em00MDEuNCAxNDYtNzMuNS00Mi42LTEyNy4xIDczTDM3MyAzNDAuNGwtNzMuNSA0My4xdjg1LjdsMTI3LjEgNzN2MTQ1LjRsNzMuNSA0My4xIDczLjUtNDMuMVY1NDIuMWwxMjcuMS03M3YtODUuNnptMCAyMzIuMXYtODUuN2wtNzMuNSA0Mi42djg1LjdjLS4xLS42IDczLjUtNDIuNiA3My41LTQyLjZ6bTUxLjkgMjkuMy0xMjcuMSA3M3Y4NS43TDgyNi4xIDY4OFY0NTYuNGwtNzMuNSA0My4xdjE0NS40em0tNzMuNS0zMzQuNCA3My41IDQzLjF2ODUuN2w3My41LTQzLjF2LTg1LjdsLTczLjUtNDMuMS03My41IDQzLjF6TTQyNi41IDc0OS40djg1LjdsNzMuNSA0My4xIDczLjUtNDMuMXYtODUuN2wtNzMuNSA0Mi03My41LTQyek0yOTkuMyA2MTUuNmw3My41IDQzLjF2LTg2LjJMMjk5LjMgNTMwdjg1LjZ6bTEyNy4yLTMwNS4xIDczLjUgNDMuMSA3My41LTQzLjEtNzMuNS00Mi42YzAtLjUtNzMuNSA0Mi42LTczLjUgNDIuNnptLTE3OS4xIDQzLjEgNzMuNS00My4xLTczLjUtNDMuMS03My41IDQzLjF2ODUuN2w3My41IDQzLjF2LTg1Ljd6bTAgMTQ1LjQtNzMuNS00Mi42VjY4OGwyMDAuNyAxMTUuNXYtODUuN2wtMTI3LjEtNzNjLS4xLjEtLjEtMTQ1LjgtLjEtMTQ1Ljh6IiBmaWxsPSIjZjBiOTBiIi8+PC9zdmc+",zp="https://app.uniswap.org/static/media/bnb-logo.797868eb94521320b78e3967134febbe.svg";var _p={name:"bsc",id:"0x38",networkId:"56",namespace:"eip155",platform:"evm",label:"BNB Smart Chain",fullName:"BNB Smart Chain Mainnet",logo:Op,logoBackgroundColor:"#000000",logoWhiteBackground:Op,currency:{name:"BNB",symbol:"BNB",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:zp},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png"},stables:{usd:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955"]},explorer:"https://bscscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://bscscan.com/tx/${e.id||e}`:t?`https://bscscan.com/token/${t}`:n?`https://bscscan.com/address/${n}`:void 0,endpoints:["https://bsc-dataseed.binance.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed3.defibit.io"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"BNB",name:"Binance Coin",decimals:18,logo:zp,type:"NATIVE"},{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",name:"Wrapped BNB",decimals:18,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png",type:"20"},{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",name:"Tether USD",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png",type:"20"},{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",name:"USD Coin",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d/logo.png",type:"20"},{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:"ETH",name:"Ethereum Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x2170Ed0880ac9A755fd29B2688956BD959F933F8/logo.png",type:"20"},{address:"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",symbol:"Cake",name:"PancakeSwap Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",type:"20"},{address:"0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",symbol:"BTCB",name:"BTCB Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Pp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAADxdJREFUeJztXVtzFMcVplwuP8VVeYmf7HJ+RKqSl/AQP6X8H+yqXUEIjhMnQY5jO9oVCIzA5mowdzAYG4xAGAyWLC5G3IyDL8gOASUYKrarYGZWC7qi23b6692VV6uZ7e6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TxVREAEwaxjTy08JfN3nNqmJ8adIkHJb6R9cHbt9qoiCCIBOJNTj1QFsUVPjQ/ha8xCPNfdRP7wOcFmUjAC7j9hR3TNlfG4D2KLmBCiQ4JFEyu2iVoIqyquIyglgT3VPAVz3gSXetZJEq/tossm9TK4MRbSWVBGVEwDtXqjHpwqhc657UuMXZUF64DHuiPRSK0UVOLJdTgCcPKIelzrcXuic2u7TJNmSfdIWEhSriIoEsKm6BzqGrqnt7StgpS3LAc7to+MIqntMvM/HD9CtcW9+uWBdssUxxDk+dPGiHocSoFNT1nyZiIOmloWIJqMQ6tF6+7oi9gnEZpE9O4bmwc1Bh2RxfjUkv21sT+7AIHg1396NS5CksC2LSAnoqmaJnVqJSCWLeoLZJSEYophjeewpXUpBtYpN5WW1AnQSWyWPaQKGc7Y32lRtHJvhhQ7cxrp+64NElJw3OW3URqB76522qpVu2yw4vWLTMbTohne7I5/YqUfBIUZbTiWHMjx/ttAHNR8kwVn2fJOKeogYxGZOu/b5/FnJt6vJ9yyyI8tYZvhejF25LcusVBa0N0OPO5ObWWJsGKO0FdushBckRdDqFP1u0fSYsss5vluMgY8FY7IuYVMPgrbn6H2PCxBEJBHn9Tf8s4UHz78L3zmj5fqsmCG4DAk3YiWbvGfFvYgpdz888EJL/J7Chdkerk8XEP8Wv+vJzyo8EsHf8L/FZ+Czpi5YqjP5P2ey0rAsl+yGAAAAAElFTkSuQmCC",Rp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png";var Bp={name:"ethereum",id:"0x1",networkId:"1",namespace:"eip155",platform:"evm",label:"Ethereum",fullName:"Ethereum Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNl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cuNS01LjUgMTl2NTU5LjFsNS41IDUuNSAyNTkuNy0xNTMuNUw0OTkuOCA3Ny41eiIgZmlsbD0iIzM0MzQzNCIvPjxwYXRoIGNsYXNzPSJzdDEiIGQ9Im00OTkuOCA3Ny41LTI1OS4zIDQzMEw0OTkuOCA2NjFWNzcuNXoiLz48cGF0aCBkPSJtNDk5LjggNzEwLjMtMi45IDR2MTk5LjFsMi45IDkuMSAyNTkuNy0zNjUuOC0yNTkuNyAxNTMuNnoiIGZpbGw9IiMzYzNjM2IiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNDk5LjggOTIyLjVWNzEwLjNMMjQwLjUgNTU2LjdsMjU5LjMgMzY1Ljh6Ii8+PHBhdGggZD0ibTQ5OS44IDY2MSAyNTkuNy0xNTMuNS0yNTkuNy0xMTcuOFY2NjF6IiBmaWxsPSIjMTQxNDE0Ii8+PHBhdGggZD0iTTI0MC41IDUwNy41IDQ5OS44IDY2MVYzODkuN0wyNDAuNSA1MDcuNXoiIGZpbGw9IiMzOTM5MzkiLz48L3N2Zz4K",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Pp},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",logo:Rp,logoBackgroundColor:"#FFFFFF"},stables:{usd:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"]},explorer:"https://etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://etherscan.io/tx/${e.id||e}`:t?`https://etherscan.io/token/${t}`:n?`https://etherscan.io/address/${n}`:void 0,endpoints:["https://rpc.ankr.com/eth","https://eth.llamarpc.com","https://ethereum.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Pp,type:"NATIVE"},{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Rp,type:"20"},{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c/logo.png",type:"20"},{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x853d955aCEf822Db058eb8505911ED77F175b99e",symbol:"FRAX",name:"Frax",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x853d955aCEf822Db058eb8505911ED77F175b99e/logo.png",type:"20"},{address:"0x956F47F50A910163D8BF957Cf5846D573E7f87CA",symbol:"FEI",name:"Fei USD",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x956F47F50A910163D8BF957Cf5846D573E7f87CA/logo.png",type:"20"},{address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Up="https://assets.spooky.fi/tokens/FTM.png",Wp="https://assets.spooky.fi/tokens/wFTM.png";var Qp={name:"fantom",id:"0xfa",networkId:"250",namespace:"eip155",label:"Fantom",fullName:"Fantom Opera",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00NjcgMTM1LjVjMTgtOS4zIDQ1LjEtOS4zIDYzIDBsMTgzLjQgOTdjMTAuNyA2LjEgMTYuNiAxNCAxOCAyMy4zdjQ4Ni42YzAgOS4zLTYuMSAxOS4yLTE4IDI1LjJsLTE4My4yIDk3Yy0xOCA5LjMtNDUuMSA5LjMtNjMgMGwtMTgzLjMtOTdjLTExLjktNi4xLTE3LjItMTUuOS0xOC0yNS4yVjI1NS43Yy43LTguNyA2LjctMTcuMiAxNy4yLTIzLjNMNDY3IDEzNS41em0yMzUuOCAzODkuNy0xNzIuNiA5MC45Yy0xOCA5LjMtNDUuMSA5LjMtNjMgMGwtMTcxLjktOTAuM3YyMTQuNGwxNzEuOSA5MC4zYzEwIDUuMyAyMC42IDEwLjcgMzEuMiAxMS4zaC43YzEwIDAgMjAtNS4zIDMwLjUtMTBsMTc0LTkyLjMtLjgtMjE0LjN6TTIzNy4zIDczMS4xYzAgMTguNiAyIDMxLjIgNi43IDM5LjggMy4zIDcuMyA4LjcgMTIuNiAxOC42IDE5LjJsLjcuN2MyIDEuNCA0LjcgMi42IDcuMyA0LjdsMy4zIDIgMTAuNyA2LjEtMTQu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OS03OC4yYy0xLjEtLjUtMi4xLTEtMy4yLTF6TTY2MS44IDMzM2wtMTMxLjEgNjguNyAxMzEuMSA2OC43VjMzM3ptLTMyNC42IDB2MTM4bDEzMS4xLTY4LjdjMC0uMS0xMzEuMS02OS4zLTEzMS4xLTY5LjN6bTE3Ny4xLTEwMi4xYy03LjQtNC4yLTIxLjEtNC4yLTI5LjEgMGwtMTQ1LjkgNzcuMmgtLjUuNWwxNDUuOSA3Ny4yYzcuNCA0LjIgMjEuMSA0LjIgMjkuMSAwbDE0NS45LTc3LjJoLjUtLjVsLTE0NS45LTc3LjJ6bTE2OS4xIDcuNCA5IDUuOCAxLjYgMS4xYzIuNiAxLjYgNC44IDMuMiA2LjkgNC4yIDIyLjIgMTQuOCAzMC4xIDMxLjIgMzAuMSA2NXYxLjFoLTIyLjdjMC0xNC44LTEuNi0yNC44LTUuMy0zMS43LTIuNi01LjgtNi45LTEwLTE0LjgtMTUuM2wtLjUtLjVjLTEuNi0xLjEtMy43LTIuMS01LjgtMy43bC0yLjYtMS42LTguNS00LjggMTIuNi0xOS42eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==",currency:{name:"Fantom",symbol:"FTM",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Up},wrapped:{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",logo:Wp},stables:{usd:["0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf","0x1B6382DBDEa11d97f24495C9A90b7c88469134a4"]},explorer:"https://ftmscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://ftmscan.com/tx/${e.id||e}`:t?`https://ftmscan.com/token/${t}`:n?`https://ftmscan.com/address/${n}`:void 0,endpoints:["https://rpc.ftm.tools","https://fantom.publicnode.com","https://rpc2.fantom.network"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"FTM",name:"Fantom",decimals:18,logo:Up,type:"NATIVE"},{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",symbol:"WFTM",name:"Wrapped Fantom",decimals:18,logo:Wp,type:"20"},{address:"0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf",symbol:"lzUSDC",name:"LayerZero USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"},{address:"0x1B6382DBDEa11d97f24495C9A90b7c88469134a4",symbol:"axlUSDC",name:"Axelar Wrapped USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Yp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/info/logo.png",Fp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/assets/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270/logo.png";var Vp={name:"polygon",id:"0x89",networkId:"137",namespace:"eip155",label:"Polygon (POS)",fullName:"Polygon (POS) Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0xMzEuNSA0NTkuM2MtMTQuNCA5LjYtMjQgMjQtMjQgNDMuMnYxOTQuNGMwIDE5LjIgOS42IDM2IDI0IDQzLjJsMTY1LjYgOTZjMTQuNCA5LjYgMzMuNiA5LjYgNDggMGwxNjUuNi05NmMxNC40LTkuNiAyNC0yNCAyNC00My4ydi02OS42bC03Ni44LTQzLjJ2NjQuOGMwIDE5LjItOS42IDM2LTI0IDQzLjJsLTg2LjQgNTIuOGMtMTQuNCA5LjYtMzMuNiA5LjYtNDggMGwtODYuNC01MC40Yy0xNC40LTkuNi0yNC0yNC0yNC00My4yVjU1MC41YzAtMTkuMiA5LjYtMzYgMjQtNDMuMmw4OC44LT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ni45TDMzNyA3NjEuNGMtMTYuNCA5LjQtMzUuMiA5LjQtNTEuNiAwTDE5NCA3MDcuNWMtMTYuNC05LjQtMjUuOC0yNS44LTI1LjgtNDYuOVY1NTIuOGMwLTIxLjEgOS40LTM3LjUgMjUuOC00Ni45bDkzLjgtNTMuOWMxNC4xLTkuNCAzNS4yLTkuNCA1MS42IDBsMTE5LjUgNjggODIgNDkuMiAxMTkuNSA2OGMxNi40IDkuNCAzNS4yIDkuNCA1MS42IDBMODkwLjIgNTM0YzE2LjQtOS40IDI1LjgtMjUuOCAyNS44LTQ2LjlWMjgzLjJjMC0xNi40LTkuNC0zMi44LTI1LjgtNDIuMkw3MTIuMSAxMzcuOWMtMTYuNC05LjQtMzUuMi05LjQtNTEuNiAwTDQ4NC43IDI0MWMtMTYuNCA5LjQtMjUuOCAyNS44LTI1LjggNDYuOXY3NWw4MiA0OS4ydi03Mi43YzAtMjEuMSA5LjQtMzcuNSAyNS44LTQ2LjlsOTMuOC01Ni4zYzE2LjQtOS40IDM1LjItOS40IDUxLjYgMGw5My44IDUzLjljMTQuMSA5LjQgMjUuOCAyNS44IDI1LjggNDYuOXYxMDhjMCAyMS4xLTExLjcgMzcuNS0yNS44IDQ2LjlsLTkzLjggNTYuM2MtMTQuMSA5LjQtMzUuMiA5LjQtNTEuNiAwTDU0MSA0NzUuNGwtODItNDYuOS0xMjQuMi03Mi43Yy0xNC4xLTkuNC0zNS4yLTkuNC01MS42IDAtLjEuMS0xNzEuMiAxMDMuMi0xNzMuNSAxMDMuMnoiIGZpbGw9IiM4MjQ3ZTUiLz48L3N2Zz4=",currency:{name:"Polygon",symbol:"MATIC",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Yp},wrapped:{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",logo:Fp},stables:{usd:["0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"]},explorer:"https://polygonscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://polygonscan.com/tx/${e.id||e}`:t?`https://polygonscan.com/token/${t}`:n?`https://polygonscan.com/address/${n}`:void 0,endpoints:["https://polygon-rpc.com","https://poly-rpc.gateway.pokt.network","https://polygon.llamarpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"MATIC",name:"Polygon",decimals:18,logo:Yp,type:"NATIVE"},{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",symbol:"WMATIC",name:"Wrapped Matic",decimals:18,logo:Fp,type:"20"},{address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xf6261529C6C2fBEB313aB25cDEcD243613b40EB5",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Hp="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDF7ZmlsbDp1cmwoI1NWR0lEXzAwMDAwMDE5Njc2ODQzODE5NzI3MzAwODIwMDAwMDA1OTQ3NjMyODMzODYxMjM4OTE3Xyl9LnN0MntmaWxsOnVybCgjU1ZHSURfMDAwMDAwNjQzMjA1MjE4MTcxODM4NzM1NjAwMDAwMDMxNzkyNDIxNTkzMzkwODM5NjdfKX08L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMV8iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iODE1Ljg1NiIgeTE9IjcwLjgyNCIgeDI9IjM4OC4zMzYiIHkyPSItNzQ4LjA1MiIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDE5MS40MzUpIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiMwMGZmYTMiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNkYzFmZmYiLz48L2xpbmVhckdyYWRpZW50PjxwYXRoIGQ9Ik0yMzcuOSA2NTcuOWM0LjktNC45IDEyLjItNy4zIDE3LjEtNy4zaDYxOS43YzEyLjIgMCAxNy4xIDE0LjcgOS44IDIyTDc2Mi4xIDc5NS4xYy00LjkgNC45LTEyL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kaWVudFRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIC0xIDAgMTkxLjQzNSkiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzAwZmZhMyIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2RjMWZmZiIvPjwvbGluZWFyR3JhZGllbnQ+PHBhdGggZD0iTTc2Mi4xIDQzMC4xYy00LjktNC45LTEyLjItNy4zLTE3LjEtNy4zSDEyNS4zYy0xMi4yIDAtMTcuMSAxNC43LTkuOCAyMkwyMzggNTY3LjNjNC45IDQuOSAxMi4yIDcuMyAxNy4xIDcuM2g2MTkuN2MxMi4yIDAgMTcuMS0xNC43IDkuOC0yMkw3NjIuMSA0MzAuMXoiIGZpbGw9InVybCgjU1ZHSURfMDAwMDAwMDc0MDk4NzczNjMxMDQ5ODE2MzAwMDAwMTUxMzM3MDU1NzA2ODAwOTc3MDlfKSIvPjwvc3ZnPgo=",Gp="https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png";var qp={name:"solana",networkId:"solana",namespace:"solana",label:"Solana",fullName:"Solana Mainnet Beta",logo:Hp,logoBackgroundColor:"#000000",logoWhiteBackground:Hp,currency:{name:"Solana",symbol:"SOL",decimals:9,address:"11111111111111111111111111111111",logo:Gp},wrapped:{address:"So11111111111111111111111111111111111111112",logo:Gp},stables:{usd:["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"]},explorer:"https://solscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://solscan.io/tx/${e.id||e}`:t?`https://solscan.io/token/${t}`:n?`https://solscan.io/address/${n}`:void 0,endpoints:["https://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","https://mainnet-beta.solflare.network","https://solana-mainnet.rpc.extrnode.com"],sockets:["wss://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","wss://mainnet-beta.solflare.network"],tokens:[{address:"11111111111111111111111111111111",symbol:"SOL",name:"Solana",decimals:9,logo:Gp,type:"NATIVE"},{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://img.raydium.io/icon/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.png",type:"SPL"},{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",name:"USDT",decimals:6,logo:"https://img.raydium.io/icon/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB.png",type:"SPL"},{address:"7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",symbol:"stSOL",name:"Lido Staked SOL",decimals:9,logo:"https://img.raydium.io/icon/7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj.png",type:"SPL"},{address:"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",symbol:"BONK",name:"BONK",decimals:5,logo:"https://img.raydium.io/icon/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263.png",type:"SPL"},{address:"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",symbol:"SAMO",name:"Samoyed Coin",decimals:9,logo:"https://img.raydium.io/icon/7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU.png",type:"SPL"},{address:"DePay1miDBPWXs6PVQrdC5Vch2jemgEPaiyXLNLLa2NF",symbol:"DEPAY",name:"DePay",decimals:9,logo:"https://depay.com/favicon.png",type:"SPL"}],zero:"0",maxInt:"340282366920938463463374607431768211455"};const Zp="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIge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LjdjMC0zLjkgMi4zLTcuOCA1LjUtOS44bDI5OS42LTE3M2MxLjYtMSAzLjYtMS42IDUuNS0xLjZ2LjN6bTAtNTAuNmMtMTAuOCAwLTIxLjIgMi42LTMxIDguMmwtMjk5LjYgMTczYy0xOS4yIDExLjEtMzEgMzEuMy0zMSA1My41djM0NmMwIDIyLjIgMTEuOCA0Mi40IDMxIDUzLjVsMjk5LjYgMTczYzkuNSA1LjUgMjAuMiA4LjIgMzEgOC4yczIxLjItMi42IDMxLTguMmwyOTkuNi0xNzNjMTkuMi0xMS4xIDMxLTMxLjMgMzEtNTMuNXYtMzQ2YzAtMjIuMi0xMS44LTQyLjQtMzEtNTMuNWwtMjk5LjktMTczYy05LjUtNS41LTIwLjItOC4yLTMxLTguMmguM3oiIGZpbGw9IiM5ZGNjZWQiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJtMzAxLjUgODAzLjIgMjcuOC03NS43IDU1LjUgNDYtNTEuOSA0Ny43LTMxLjQtMTh6Ii8+PHBhdGggZD0iTTQ3NC41IDMwMi4yaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOEwyMjIuOSA3NTcuNWw3OC42IDQ1LjRMNDgxLjEgMzExYzEuNi00LjYtMS42LTkuMS02LjItOS4xbC0uNC4zem0xMzMuMiAwaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOGwtMTg2IDUwOS44IDc4LjYgNDUuNEw2MTMuOSAzMTFjMS42LTQuNi0xLjYtOS4xLTYuMi05LjF2LjN6IiBmaWxsPSIjZmZmIi8+PC9zdmc+Cg==";var Jp={name:"arbitrum",id:"0xa4b1",networkId:"42161",namespace:"eip155",platform:"evm",label:"Arbitrum",fullName:"Arbitrum One",logo:Zp,logoBackgroundColor:"#2b354d",logoWhiteBackground:Zp,currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Bp.currency.logo},wrapped:{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",logo:Bp.wrapped.logo},stables:{usd:["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"]},explorer:"https://arbiscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://arbiscan.io/tx/${e.id||e}`:t?`https://arbiscan.io/token/${t}`:n?`https://arbiscan.io/address/${n}`:void 0,endpoints:["https://arbitrum.blockpi.network/v1/rpc/public","https://arbitrum-one.publicnode.com","https://endpoints.omniatech.io/v1/arbitrum/one/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Bp.currency.logo,type:"NATIVE"},{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Bp.wrapped.logo,type:"20"},{address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8/logo.png",type:"20"},{address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1/logo.png",type:"20"},{address:"0x912CE59144191C1204E64559FE8253a0e49E6548",symbol:"ARB",name:"Arbitrum",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x912CE59144191C1204E64559FE8253a0e49E6548/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Xp="https://traderjoexyz.com/static/media/avalanche.7c81486190237e87e238c029fd746008.svg",Kp="https://raw.githubusercontent.com/traderjoe-xyz/joe-tokenlists/main/logos/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7/logo.png";var $p={name:"avalanche",id:"0xa86a",networkId:"43114",namespace:"eip155",platform:"evm",label:"Avalanche",fullName:"Avalanche C-Chain",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0zNTkuMSA3NTEuMWgtOTUuM2MtMjAgMC0yOS45IDAtMzYtMy44LTYuNi00LjMtMTAuNC0xMS4zLTEwLjktMTguOS0uMy03LjEgNC42LTE1LjggMTQuNC0zM2wyMzUtNDE0LjNjMTAuMS0xNy42IDE1LjEtMjYuNCAyMS40LTI5LjYgNi45LTMuNSAxNS4xLTMuNSAyMS45IDAgNi40IDMuMyAxMS40IDEyIDIxLjQgMjkuNmw0OC40IDg0LjMuMi41YzEwLjggMTguOSAxNi4zIDI4LjUgMTguNiAzOC41IDIuNiAxMC45IDIuNiAyMi42IDAgMzMuNS0yLjQgMTAuMS03LjggMTkuOC0xOC44IDM4LjlMNDU2LjIgNjk0LjlsLS4zLjVjLTEwLjggMTktMTYuMyAyOC43LTI0LjEgMzYtOC4zIDgtMTguMyAxMy43LTI5LjMgMTYuOS05LjkgMi44LTIxLjEgMi44LTQzLjQgMi44em0yNDAuMyAwaDEzNi40YzIwLjIgMCAzMC4yIDAgMzYuMy00IDYuNi00LjMgMTAuNi0xMS4zIDEwLjktMTkuMS4zLTYuOS00LjUtMTUuMi0xMy45LTMxLjZsLTEtMS43TDY5OS44IDU3OGwtLjg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IDI1LTIxIDMxLjQtNy4zIDYuOS0xNiAxMi0yNS41IDE0LjgtOC43IDIuNC0xOC41IDIuNC0zOC4xIDIuNHptMjA5LjggMGgxMTljMTcuNiAwIDI2LjQgMCAzMS43LTMuNSA1LjctMy43IDkuMi05LjkgOS42LTE2LjYuMy02LTMuOS0xMy4zLTEyLjItMjcuNWwtLjktMS41LTU5LjYtMTAyLS43LTEuMWMtOC40LTE0LjItMTIuNi0yMS4zLTE4LTI0LjEtNi0zLTEzLjEtMy0xOSAwLTUuNSAyLjgtOS45IDEwLjMtMTguNiAyNS4zbC01OS40IDEwMi0uMi40Yy04LjcgMTUtMTMgMjIuNS0xMi43IDI4LjcuNCA2LjcgMy45IDEyLjkgOS42IDE2LjYgNSAzLjMgMTMuOCAzLjMgMzEuNCAzLjN6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2U4NDE0MiIvPjwvc3ZnPg==",currency:{name:"Avalanche",symbol:"AVAX",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Xp},wrapped:{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",logo:Kp},stables:{usd:["0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7","0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"]},explorer:"https://snowtrace.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://snowtrace.io/tx/${e.id||e}`:t?`https://snowtrace.io/token/${t}`:n?`https://snowtrace.io/address/${n}`:void 0,endpoints:["https://avalanche.public-rpc.com","https://avalanche.blockpi.network/v1/rpc/public","https://avax.meowrpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"AVAX",name:"Avalanche",decimals:18,logo:Xp,type:"NATIVE"},{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",symbol:"WAVAX",name:"Wrapped AVAX",decimals:18,logo:Kp,type:"20"},{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7/logo.png",type:"20"},{address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E/logo.png",type:"20"},{address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70/logo.png",type:"20"},{address:"0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const ef="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAC7CAMAAAAKTh9YAAAAYFBMVEVHcEz////////////////////////////////////j++ma6qVj5nsl5lAK4zpA6mXO79aD8Zyr87uCvq0J2TkItEkOhl4EeVsKzSwLrxMNtQpjsZG42dEeuxyF2oU6wzjPwJjeAAAACnRSTlMAEUB9r9j/YO+Kf6/iMwAABD1JREFUeAHU1EESQjEMAlBIAq33v7ArV7+OLss7AZOB4IDVI/kW0nQRf+Ca7QvNwg/s7VtpGJP8oPFNybdT4aidoPHEcYZn6ymnEEOjH8KPk0zeTI+DLacpfMhpxKTGnFtDB9o8/Jisw8uxh1/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h+AqEsNdx+k8l9gAnIFMZYaNQH0c682I0mFdip6lMGP4KQthGhdPxmyunCwSYhIzuwjZlvBC/uRK7jO7CNkqHPjM5F/9x9YlgNLqHcq6MsAB1fPrFiep3rY6dRncvPAYhuKvTsV/zQef+MYedDyr9GDAGITii6cvpyeO1727kwI9f048FRyEEK+EJnJl8rN7fNL54oxwco5NnIAQX1GsZDafhat0bj44PwlMn9UeNQgiTUehB+Mit01/qWv+yPLohfQKoExDCWHrq0iR0sv7IXu3g+ARC9TyEMEn0ZHT1EmPjD23FwfExBOplfathCJEnWken5cXTk9MbvUlrscdklBd5oWumPX2kv6QPgDaZtqzVXuxkdHwYvtLR42EZ6UXqOog81n7s1faPP6k/0xNyIEokigJX4Yx+/Up0GnqbkceSiT1GS5UFvUwZYEx/5n36ixzW/8SgjPyiqeicrHC+sgGAmtGRvx1dMtph4NW+AiZycfiu2QTRAAAAAElFTkSuQmCC";var nf={name:"gnosis",id:"0x64",networkId:"100",namespace:"eip155",label:"Gnosis",fullName:"Gnosis Chain",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbDojZmZmfTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MCIgZD0iTTMzMS45IDU1Ni41YzIzLjUgMCA0Ni40LTcuOCA2NS0yMi4yTDI0OCAzODUuNGMtMzUuOSA0Ni40LTI3LjQgMTEyLjkgMTguOSAxNDguOCAxOC42IDE0IDQxLjUgMjEuOSA2NSAyMS45di40em00NDIuMy0xMDYuMWMwLTIzLjUtNy44LTQ2LjQtMjIuMi02NUw2MDMuMiA1MzQuMmM0Ni40IDM1LjkgMTEyLjkgMjcuNCAxNDguOC0xOC45IDE0LjMtMTguNiAyMi4yL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OSA1MDAgMTI5eiIvPjwvc3ZnPgo=",currency:{name:"xDAI",symbol:"xDAI",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:ef},wrapped:{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",logo:tf},stables:{usd:["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83"]},explorer:"https://gnosisscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://gnosisscan.io/tx/${e.id||e}`:t?`https://gnosisscan.io/token/${t}`:n?`https://gnosisscan.io/address/${n}`:void 0,endpoints:["https://rpc.gnosis.gateway.fm","https://rpc.gnosischain.com","https://gnosis.blockpi.network/v1/rpc/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"xDAI",name:"xDAI",decimals:18,logo:ef,type:"NATIVE"},{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",symbol:"WXDAI",name:"Wrapped XDAI",decimals:18,logo:tf,type:"20"},{address:"0x4ECaBa5870353805a9F068101A40E0f32ed605C6",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",symbol:"GNO",name:"Gnosis",decimals:18,logo:"https://cdn.sushi.com/image/upload/f_auto,c_limit,w_16,q_auto/tokens/100/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb.jpg",type:"20"},{address:"0xD057604A14982FE8D88c5fC25Aac3267eA142a08",symbol:"HOPR",name:"HOPR",decimals:18,logo:"https://hoprnet.org/assets/icons/hopr_icon.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var rf={name:"optimism",id:"0xa",networkId:"10",namespace:"eip155",label:"Optimism",fullName:"Optimism",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00ODcuMSAzOTUuN2MtNS4yLTE1LjgtMTMuMi0zMS43LTI2LjQtNDIuMi0xMy4yLTEwLjUtMjYuNC0yMS4yLTQ0LjktMjYuNC0xOC41LTUuMi0zNy04LTU4LjEtOC00Ny41IDAtODcuMSAxMC41LTExNi4xIDM0LjQtMjkgMjMuOC00Ny41IDU4LjEtNjAuNyAxMDIuOS0yLjYgMTUuOC04IDI5LTEwLjUgNDQuOS0yLjYgMTMuMi01LjIgMjktOCA0Mi4yLTIuNiAyMy44LTIuNiA0Mi4yIDIuNiA2MC43IDUuMiAxNS44IDEzLjIgMzEuNyAyNi40IDQyLjIgMTMuMiAxMC41IDI2LjQgMjEuMiA0NC45IDI2LjQgMTguNCA1LjIgMzcgOCA1OC4xIDggNDcuNSAwIDg3LjEtMTAuNSAxMTYuMS0zNC40czQ3LjUtNTguMSA2MC43LTEwMi45YzIuNi0xMy4yIDUuMi0yOSAxMC41LTQyLjIgMi42LTEzLjIgNS4yLTI5IDgtNDQuOSAyLjgtMjMuOCAyLjgtNDQuOC0yLjYtNjAuN3ptLTkyLjQgNjAuOGMtMi42IDEzLjItNS4yIDI2LjQtOCAzOS41LTIuNiAxMy4yLTUuMiAyNi40LTEwLjUgNDIuMi01LjIgMjMuOC0xNS44IDM5LjUtMjkgNTAuMi0xMy4yIDEwLjUtMjkgMT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4LjItNi40IDE3LjgtOS42IDI4LjYtOS42czE4LjggMy4yIDIzLjggOS42IDYuMiAxNi43IDMuNiAzMC43Yy0xLjQgOC40LTMgMTYuNi00LjggMjQuNC0xLjYgNy44LTMuNSAxNi4yLTUuNyAyNS0zLjQgMTQtOS4yIDI0LjMtMTcuNSAzMC43em05MS43IDQ4YzEuMiAxLjQgMi44IDIuMSA0LjggMi4xaDQxYzIuMiAwIDQuMS0uNyA1LjctMi4xIDEuOC0xLjQgMi45LTMuMiAzLjMtNS40bDEzLjktNjZoNDAuN2MyNS45IDAgNDYuNS01LjUgNjEuOC0xNi42IDE1LjUtMTEuMSAyNS43LTI4LjEgMzAuNy01MS4yIDIuNC0xMS43IDIuMy0yMS44LS4zLTMwLjQtMi42LTguOC03LjItMTYuMi0xMy45LTIyLTYuNi01LjgtMTUtMTAuMS0yNS0xMy05LjgtMi44LTIwLjktNC4yLTMzLjItNC4yaC04MC4yYy0yIDAtMy45LjctNS43IDIuMS0xLjggMS40LTIuOSAzLjItMy4zIDUuNEw1MDkgNjAzLjVjLS40IDIuMiAwIDQgMS4yIDUuNXptMTExLjItMTEzLjFoLTM0LjdsMTEuOC01NGgzNi4yYzcuMiAwIDEyLjYgMS4yIDE2IDMuNiAzLjYgMi40IDUuNyA1LjYgNi4zIDkuNi42IDQgLjQgOC42LS42IDEzLjktMiA5LTYuMyAxNS44LTEzIDIwLjItNi40IDQuNS0xMy44IDYuNy0yMiA2Ljd6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2ZmMDQyMCIvPjwvc3ZnPg==",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Bp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Bp.wrapped.logo},stables:{usd:["0x94b008aA00579c1307B0EF2c499aD98a8ce58e58","0x7F5c764cBc14f9669B88837ca1490cCa17c31607"]},explorer:"https://optimistic.etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://optimistic.etherscan.io/tx/${e.id||e}`:t?`https://optimistic.etherscan.io/token/${t}`:n?`https://optimistic.etherscan.io/address/${n}`:void 0,endpoints:["https://optimism.blockpi.network/v1/rpc/public","https://optimism.meowrpc.com","https://optimism.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Bp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Bp.wrapped.logo,type:"20"},{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58/logo.png",type:"20"},{address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x7F5c764cBc14f9669B88837ca1490cCa17c31607/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x4200000000000000000000000000000000000042",symbol:"OP",name:"Optimism",decimals:18,logo:"https://user-images.githubusercontent.com/1300064/219575413-d7990d69-1d21-44ef-a2b1-e9c682c79802.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var of={name:"base",id:"0x2105",networkId:"8453",namespace:"eip155",label:"Base",fullName:"Base",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguNiA4NDJDNjg4IDg0MiA4NDIgNjg4LjkgODQyIDQ5OS41UzY4OCAxNTcgNDk4LjYgMTU3QzMxOSAxNTcgMTcxLjIgMjk1LjEgMTU3IDQ3MC4zaDQ1My4xdjU3LjVIMTU3QzE3MiA3MDMuOSAzMTkgODQyIDQ5OC42IDg0MnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",logoBackgroundColor:"#0052FF",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguOSA4NDVDNjkwLjEgODQ1IDg0NSA2OTAuMyA4NDUgNDk5LjVTNjkwLjEgMTU0IDQ5OC45IDE1NEMzMTcuNiAxNTQgMTY4LjggMjkzLjMgMTU0IDQ3MC41aDQ1Ny40djU4LjFIMTU0QzE2OC44IDcwNS44IDMxNy42IDg0NSA0OTguOSA4NDV6IiBmaWxsPSIjMDA1MmZmIi8+PC9zdmc+",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Bp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Bp.wrapped.logo},stables:{usd:["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"]},explorer:"https://basescan.org",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://basescan.org/tx/${e.id||e}`:t?`https://basescan.org/token/${t}`:n?`https://basescan.org/address/${n}`:void 0,endpoints:["https://base.blockpi.network/v1/rpc/public","https://base.meowrpc.com","https://mainnet.base.org"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Bp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Bp.wrapped.logo,type:"20"},{address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",symbol:"USDbC",name:"USD Base Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const af=[Bp,_p,Vp,qp,Qp,Jp,$p,nf,rf,of];var sf={ethereum:Bp,bsc:_p,polygon:Vp,solana:qp,fantom:Qp,arbitrum:Jp,avalanche:$p,gnosis:nf,optimism:rf,base:of,all:af,findById:function(e){let t=e;return t.match("0x0")&&(t=t.replace(/0x0+/,"0x")),af.find((e=>e.id&&e.id.toLowerCase()==t.toLowerCase()))},findByNetworkId:function(e){return e=e.toString(),af.find((t=>t.networkId==e))},findByName:function(e){return af.find((t=>t.name==e))}},uf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lf(e){var t={exports:{}};return e(t,t.exports),t.exports}for(var df=function(e){var t=wf(e),n=t[0],r=t[1];return 3*(n+r)/4-r},hf=function(e){var t,n,r=wf(e),i=r[0],o=r[1],a=new mf(function(e,t,n){return 3*(t+n)/4-n}(0,i,o)),s=0,u=o>0?i-4:i;for(n=0;n>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=yf[e.charCodeAt(n)]<<2|yf[e.charCodeAt(n+1)]>>4,a[s++]=255&t);1===o&&(t=yf[e.charCodeAt(n)]<<10|yf[e.charCodeAt(n+1)]<<4|yf[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},pf=function(e){for(var t,n=e.length,r=n%3,i=[],o=16383,a=0,s=n-r;as?s:a+o));1===r?(t=e[n-1],i.push(ff[t>>2]+ff[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(ff[t>>10]+ff[t>>4&63]+ff[t<<2&63]+"="));return i.join("")},ff=[],yf=[],mf="undefined"!=typeof Uint8Array?Uint8Array:Array,gf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vf=0,bf=gf.length;vf0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function Mf(e,t,n){for(var r,i,o=[],a=t;a>18&63]+ff[i>>12&63]+ff[i>>6&63]+ff[63&i]);return o.join("")}yf["-".charCodeAt(0)]=62,yf["_".charCodeAt(0)]=63;var Af={byteLength:df,toByteArray:hf,fromByteArray:pf},Ef=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},Tf=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=f,a/=256,c-=8);e[n+p-f]|=128*y},Nf=lf((function(e,t){var n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},t.INSPECT_MAX_BYTES=50;var r=2147483647;function i(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|h(e,t),r=i(n),a=r.write(e,t);a!==n&&(r=r.slice(0,a));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(R(e,Uint8Array)){var t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(R(e,ArrayBuffer)||e&&R(e.buffer,ArrayBuffer))return l(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(R(e,SharedArrayBuffer)||e&&R(e.buffer,SharedArrayBuffer)))return l(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,n);var a=function(e){if(o.isBuffer(e)){var t=0|d(e.length),n=i(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||B(e.length)?i(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return s(e),i(e<0?0:0|d(e))}function c(e){for(var t=e.length<0?0:0|d(e.length),n=i(t),r=0;r=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||R(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return _(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var d=!0,h=0;hi&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?Af.fromByteArray(e):Af.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?o.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else{if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,n,r,i){if(R(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(a,s),c=this.slice(r,i),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":case"latin1":case"binary":return b(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function S(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function C(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,4),Tf(e,t,n,r,23,4),n+4}function D(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,8),Tf(e,t,n,r,52,8),n+8}o.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),Ef(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),Ef(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),Ef(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),Ef(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||S(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r)||S(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,n){return C(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return C(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function _(e){return Af.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function P(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function R(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function B(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()})),If=lf((function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Nf.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=s(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var d=["","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"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return m(e,t,n)}Math.imul||(y=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?f(this,e,t):n<1024?m(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new T(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function N(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(w,b),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new N(e)},r(N,T),N.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},N.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},N.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},N.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,uf)})); +e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new I(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return L()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=h(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=d;var p={};function f(){}function y(){}function m(){}var g={};l(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(k([])));b&&b!==i&&o.call(b,s)&&(g=b);var w=m.prototype=f.prototype=Object.create(g);function M(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,n){function r(i,a,s,u){var c=h(e[i],e,a);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==t(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var i;this._invoke=function(e,t){function o(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(o,o):o()}}function E(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function k(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Uo)),Uo.exports}var Fo,Vo={exports:{}};var Ho,Go={exports:{}};function qo(){return Ho||(Ho=1,function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(Go)),Go.exports}var Zo,Jo={exports:{}};function Xo(){return Zo||(Zo=1,function(e){function t(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(0,o.default)(this,f);var a=r.autoconnect,s=void 0===a||a,u=r.reconnect,c=void 0===u||u,l=r.reconnect_interval,d=void 0===l?1e3:l,y=r.max_reconnects,m=void 0===y?5:y,g=h(r,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(t=p.call(this)).webSocketFactory=e,t.queue={},t.rpc_id=0,t.address=n,t.autoconnect=s,t.ready=!1,t.reconnect=c,t.reconnect_timer_id=void 0,t.reconnect_interval=d,t.max_reconnects=m,t.rest_options=g,t.current_reconnects=0,t.generate_request_id=i||function(){return++t.rpc_id},t.autoconnect&&t._connect(t.address,Object.assign({autoconnect:t.autoconnect,reconnect:t.reconnect,reconnect_interval:t.reconnect_interval,max_reconnects:t.max_reconnects},t.rest_options)),t}return(0,a.default)(f,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(e,t,n,r){var o=this;return r||"object"!==(0,i.default)(n)||(r=n,n=null),new Promise((function(i,a){if(!o.ready)return a(new Error("socket not ready"));var s=o.generate_request_id(e,t),u={jsonrpc:"2.0",method:e,params:t||null,id:s};o.socket.send(JSON.stringify(u),r,(function(e){if(e)return a(e);o.queue[s]={promise:[i,a]},n&&(o.queue[s].timeout=setTimeout((function(){delete o.queue[s],a(new Error("reply timeout"))}),n))}))}))}},{key:"login",value:(l=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("rpc.login",t);case 2:if(r=e.sent){e.next=5;break}throw new Error("authentication failed");case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"listMethods",value:(c=(0,r.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.call("__listMethods");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"notify",value:function(e,t){var n=this;return new Promise((function(r,i){if(!n.ready)return i(new Error("socket not ready"));var o={jsonrpc:"2.0",method:e,params:t||null};n.socket.send(JSON.stringify(o),(function(e){if(e)return i(e);r()}))}))}},{key:"subscribe",value:(u=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.on",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed subscribing to an event '"+t+"' with: "+r[t]);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"unsubscribe",value:(t=(0,r.default)(n.default.mark((function e(t){var r;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"string"==typeof t&&(t=[t]),e.next=3,this.call("rpc.off",t);case 3:if(r=e.sent,"string"!=typeof t||"ok"===r[t]){e.next=6;break}throw new Error("Failed unsubscribing from an event with: "+r);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"close",value:function(e,t){this.socket.close(e||1e3,t)}},{key:"_connect",value:function(e,t){var n=this;clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",(function(){n.ready=!0,n.emit("open"),n.current_reconnects=0})),this.socket.addEventListener("message",(function(e){var t=e.data;t instanceof ArrayBuffer&&(t=Te.from(t).toString());try{t=JSON.parse(t)}catch(e){return}if(t.notification&&n.listeners(t.notification).length){if(!Object.keys(t.params).length)return n.emit(t.notification);var r=[t.notification];if(t.params.constructor===Object)r.push(t.params);else for(var i=0;in.current_reconnects||0===n.max_reconnects)&&(n.reconnect_timer_id=setTimeout((function(){return n._connect(e,t)}),n.reconnect_interval)))}))}}]),f}(l.EventEmitter);e.default=p}(Oo);var ma=S(Oo),ga={};!function(e){var t=zo.exports;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){return new u(e,t)};var n=t(qo()),r=t(Xo()),i=t(ra()),o=t(ca()),a=t(ha());function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,a.default)(e);if(t){var i=(0,a.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}var u=function(e){(0,i.default)(o,e);var t=s(o);function o(e,r,i){var a;return(0,n.default)(this,o),(a=t.call(this)).socket=new window.WebSocket(e,i),a.socket.onopen=function(){return a.emit("open")},a.socket.onmessage=function(e){return a.emit("message",e.data)},a.socket.onerror=function(e){return a.emit("error",e)},a.socket.onclose=function(e){a.emit("close",e.code,e.reason)},a}return(0,r.default)(o,[{key:"send",value:function(e,t,n){var r=n||t;try{this.socket.send(e),r()}catch(e){r(e)}}},{key:"close",value:function(e,t){this.socket.close(e,t)}},{key:"addEventListener",value:function(e,t,n){this.socket.addEventListener(e,t,n)}}]),o}(ya().EventEmitter)}(ga);for(var va=S(ga),ba=[],wa=[],Ma=[],Aa=BigInt(0),Ea=BigInt(1),Ta=BigInt(2),Na=BigInt(7),Ia=BigInt(256),ka=BigInt(113),La=0,xa=Ea,Sa=1,ja=0;La<24;La++){var Ca=[ja,(2*Sa+3*ja)%5];Sa=Ca[0],ja=Ca[1],ba.push(2*(5*ja+Sa)),wa.push((La+1)*(La+2)/2%64);for(var Da=Aa,Oa=0;Oa<7;Oa++)(xa=(xa<>Na)*ka)%Ia)&Ta&&(Da^=Ea<<(Ea<32?Et.rotlBH(e,t,n):Et.rotlSH(e,t,n)},Ba=function(e,t,n){return n>32?Et.rotlBL(e,t,n):Et.rotlSL(e,t,n)};var Ua=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(R(this,n),(o=t.call(this)).blockLen=e,o.suffix=r,o.outputLen=i,o.enableXOF=a,o.rounds=s,o.pos=0,o.posOut=0,o.finished=!1,o.destroyed=!1,ht.number(i),0>=o.blockLen||o.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");return o.state=new Uint8Array(200),o.state32=pt(o.state),o}return U(n,[{key:"keccak",value:function(){!function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24,n=new Uint32Array(10),r=24-t;r<24;r++){for(var i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(var o=0;o<10;o+=2)for(var a=(o+8)%10,s=(o+2)%10,u=n[s],c=n[s+1],l=Ra(u,c,1)^n[a],d=Ba(u,c,1)^n[a+1],h=0;h<50;h+=10)e[o+h]^=l,e[o+h+1]^=d;for(var p=e[2],f=e[3],y=0;y<24;y++){var m=wa[y],g=Ra(p,f,m),v=Ba(p,f,m),b=ba[y];p=e[b],f=e[b+1],e[b]=g,e[b+1]=v}for(var w=0;w<50;w+=10){for(var M=0;M<10;M++)n[M]=e[w+M];for(var A=0;A<10;A++)e[w+A]^=~n[(A+2)%10]&n[(A+4)%10]}e[0]^=_a[r],e[1]^=Pa[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}},{key:"update",value:function(e){ht.exists(this);for(var t=this.blockLen,n=this.state,r=(e=mt(e)).length,i=0;i=n&&this.keccak();var o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}},{key:"xofInto",value:function(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}},{key:"xof",value:function(e){return ht.number(e),this.xofInto(new Uint8Array(e))}},{key:"digestInto",value:function(e){if(ht.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}},{key:"digest",value:function(){return this.digestInto(new Uint8Array(this.outputLen))}},{key:"destroy",value:function(){this.destroyed=!0,this.state.fill(0)}},{key:"_cloneInto",value:function(e){var t=this.blockLen,r=this.suffix,i=this.outputLen,o=this.rounds,a=this.enableXOF;return e||(e=new n(t,r,i,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}}]),n}(gt),Wa=function(e,t,n){return vt((function(){return new Ua(t,e,n)}))};Wa(6,144,28),Wa(6,136,32),Wa(6,104,48),Wa(6,72,64),Wa(1,144,28);var Qa=Wa(1,136,32);Wa(1,104,48),Wa(1,72,64);var Ya=function(e,t,n){return i=function(e,t){return r(t).update(mt(e)).digest()},o=(r=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Ua(t,e,void 0===r.dkLen?n:r.dkLen,!0)})({}),i.outputLen=o.outputLen,i.blockLen=o.blockLen,i.create=function(e){return r(e)},i;var r,i,o};Ya(31,168,16),Ya(31,136,32);var Fa=function(e){Q(n,e);var t=X(n);function n(e,r){var i;R(this,n),(i=t.call(this)).finished=!1,i.destroyed=!1,ht.hash(e);var o=mt(r);if(i.iHash=e.create(),"function"!=typeof i.iHash.update)throw new TypeError("Expected instance of class which extends utils.Hash");i.blockLen=i.iHash.blockLen,i.outputLen=i.iHash.outputLen;var a=i.blockLen,s=new Uint8Array(a);s.set(o.length>a?e.create().update(o).digest():o);for(var u=0;ua,h=l>a;if(d&&(c=t-c),h&&(l=t-l),c>a||l>a)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:h,k2:l}},ts=32,ns=32;function rs(e){var t=Xa.a,n=Xa.b,r=Ls(e*e),i=Ls(r*e);return Ls(i+t*e+n)}var is=Xa.a===Ha,os=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,e)}return U(n)}(G(Error));function as(e){if(!(e instanceof ss))throw new TypeError("JacobianPoint expected")}var ss=function(){function e(t,n,r){R(this,e),this.x=t,this.y=n,this.z=r}return U(e,[{key:"equals",value:function(e){as(e);var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=Ls(r*r),u=Ls(a*a),c=Ls(t*u),l=Ls(i*s),d=Ls(Ls(n*a)*u),h=Ls(Ls(o*r)*s);return c===l&&d===h}},{key:"negate",value:function(){return new e(this.x,Ls(-this.y),this.z)}},{key:"double",value:function(){var t=this.x,n=this.y,r=this.z,i=Ls(t*t),o=Ls(n*n),a=Ls(o*o),s=t+o,u=Ls(qa*(Ls(s*s)-i-a)),c=Ls(Za*i),l=Ls(c*c),d=Ls(l-qa*u);return new e(d,Ls(c*(u-d)-Ja*a),Ls(qa*n*r))}},{key:"add",value:function(t){as(t);var n=this.x,r=this.y,i=this.z,o=t.x,a=t.y,s=t.z;if(o===Ha||a===Ha)return this;if(n===Ha||r===Ha)return t;var u=Ls(i*i),c=Ls(s*s),l=Ls(n*c),d=Ls(o*u),h=Ls(Ls(r*s)*c),p=Ls(Ls(a*i)*u),f=Ls(d-l),y=Ls(p-h);if(f===Ha)return y===Ha?this.double():e.ZERO;var m=Ls(f*f),g=Ls(f*m),v=Ls(l*m),b=Ls(y*y-g-qa*v);return new e(b,Ls(y*(v-b)-h*g),Ls(i*s*f))}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiplyUnsafe",value:function(t){var n=e.ZERO;if("bigint"==typeof t&&t===Ha)return n;var r=ks(t);if(r===Ga)return this;if(!is){for(var i=n,o=this;r>Ha;)r&Ga&&(i=i.add(o)),o=o.double(),r>>=Ga;return i}for(var a=es(r),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,d=n,h=n,p=this;u>Ha||l>Ha;)u&Ga&&(d=d.add(p)),l&Ga&&(h=h.add(p)),p=p.double(),u>>=Ga,l>>=Ga;return s&&(d=d.negate()),c&&(h=h.negate()),h=new e(Ls(h.x*$a),h.y,h.z),d.add(h)}},{key:"precomputeWindow",value:function(e){for(var t=is?128/e+1:256/e+1,n=[],r=this,i=r,o=0;o>=d,f>u&&(f-=l,t+=Ga);var y=p,m=p+Math.abs(f)-1,g=h%2!=0,v=f<0;0===f?a=a.add(us(g,i[y])):o=o.add(us(v,i[m]))}return{p:o,f:a}}},{key:"multiply",value:function(t,n){var r,i,o=ks(t);if(is){var a=es(o),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,d=this.wNAF(u,n),h=d.p,p=d.f,f=this.wNAF(l,n),y=f.p,m=f.f;h=us(s,h),y=new e(Ls((y=us(c,y)).x*$a),y.y,y.z),r=h.add(y),i=p.add(m)}else{var g=this.wNAF(o,n);r=g.p,i=g.f}return e.normalizeZ([r,i])[0]}},{key:"toAffine",value:function(t){var n=this.x,r=this.y,i=this.z,o=this.equals(e.ZERO);null==t&&(t=o?Ja:Ss(i));var a=t,s=Ls(a*a),u=Ls(s*a),c=Ls(n*s),l=Ls(r*u),d=Ls(i*a);if(o)return ls.ZERO;if(d!==Ga)throw new Error("invZ was invalid");return new ls(c,l)}}],[{key:"fromAffine",value:function(t){if(!(t instanceof ls))throw new TypeError("JacobianPoint#fromAffine: expected Point");return t.equals(ls.ZERO)?e.ZERO:new e(t.x,t.y,Ga)}},{key:"toAffineBatch",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xa.P,n=new Array(e.length),r=Ss(e.reduce((function(e,r,i){return r===Ha?e:(n[i]=e,Ls(e*r,t))}),Ga),t);return e.reduceRight((function(e,r,i){return r===Ha?e:(n[i]=Ls(e*n[i],t),Ls(e*r,t))}),r),n}(e.map((function(e){return e.z})));return e.map((function(e,n){return e.toAffine(t[n])}))}},{key:"normalizeZ",value:function(t){return e.toAffineBatch(t).map(e.fromAffine)}}]),e}();function us(e,t){var n=t.negate();return e?n:t}ss.BASE=new ss(Xa.Gx,Xa.Gy,Ga),ss.ZERO=new ss(Ha,Ga,Ha);var cs=new WeakMap,ls=function(){function e(t,n){R(this,e),this.x=t,this.y=n}return U(e,[{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,cs.delete(this)}},{key:"hasEvenY",value:function(){return this.y%qa===Ha}},{key:"toRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ts(this.toHex(e))}},{key:"toHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=ws(this.x);if(e){var n=this.hasEvenY()?"02":"03";return"".concat(n).concat(t)}return"04".concat(t).concat(ws(this.y))}},{key:"toHexX",value:function(){return this.toHex(!0).slice(2)}},{key:"toRawX",value:function(){return this.toRawBytes(!0).slice(1)}},{key:"assertValidity",value:function(){var e="Point is not on elliptic curve",t=this.x,n=this.y;if(!zs(t)||!zs(n))throw new Error(e);var r=Ls(n*n);if(Ls(r-rs(t))!==Ha)throw new Error(e)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(this.x,Ls(-this.y))}},{key:"double",value:function(){return ss.fromAffine(this).double().toAffine()}},{key:"add",value:function(e){return ss.fromAffine(this).add(ss.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return ss.fromAffine(this).multiply(e,this).toAffine()}},{key:"multiplyAndAddUnsafe",value:function(t,n,r){var i=ss.fromAffine(this),o=n===Ha||n===Ga||this!==e.BASE?i.multiplyUnsafe(n):i.multiply(n),a=ss.fromAffine(t).multiplyUnsafe(r),s=o.add(a);return s.equals(ss.ZERO)?void 0:s.toAffine()}}],[{key:"fromCompressedHex",value:function(t){var n=32===t.length,r=Ns(n?t:t.subarray(1));if(!zs(r))throw new Error("Point is not on curve");var i=function(e){var t=Xa.P,n=BigInt(6),r=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),s=BigInt(88),u=e*e*e%t,c=u*u*e%t,l=xs(c,Za)*c%t,d=xs(l,Za)*c%t,h=xs(d,qa)*u%t,p=xs(h,r)*h%t,f=xs(p,i)*p%t,y=xs(f,a)*f%t,m=xs(y,s)*y%t,g=xs(m,a)*f%t,v=xs(g,Za)*c%t,b=xs(v,o)*p%t,w=xs(b,n)*u%t,M=xs(w,qa);if(M*M%t!==e)throw new Error("Cannot find square root");return M}(rs(r)),o=(i&Ga)===Ga;n?o&&(i=Ls(-i)):1==(1&t[0])!==o&&(i=Ls(-i));var a=new e(r,i);return a.assertValidity(),a}},{key:"fromUncompressedHex",value:function(t){var n=new e(Ns(t.subarray(1,33)),Ns(t.subarray(33,65)));return n.assertValidity(),n}},{key:"fromHex",value:function(e){var t=Is(e),n=t.length,r=t[0];if(n===ts)return this.fromCompressedHex(t);if(33===n&&(2===r||3===r))return this.fromCompressedHex(t);if(65===n&&4===r)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-".concat(33," compressed bytes or ").concat(65," uncompressed bytes, not ").concat(n))}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(Ps(t))}},{key:"fromSignature",value:function(t,n,r){var i=function(e){if(e instanceof ps)return e.assertValidity(),e;try{return ps.fromDER(e)}catch(t){return ps.fromCompact(e)}}(n),o=i.r,a=i.s;if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");var s=Cs(Is(t)),u=Xa.n,c=2===r||3===r?o+u:o,l=Ss(c,u),d=Ls(-s*l,u),h=Ls(a*l,u),p=1&r?"03":"02",f=e.fromHex(p+ws(c)),y=e.BASE.multiplyAndAddUnsafe(f,d,h);if(!y)throw new Error("Cannot recover signature: point at infinify");return y.assertValidity(),y}}]),e}();function ds(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function hs(e){if(e.length<2||2!==e[0])throw new Error("Invalid signature integer tag: ".concat(ms(e)));var t=e[1],n=e.subarray(2,t+2);if(!t||n.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===n[0]&&n[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:Ns(n),left:e.subarray(t+2)}}ls.BASE=new ls(Xa.Gx,Xa.Gy),ls.ZERO=new ls(Ha,Ha);var ps=function(){function e(t,n){R(this,e),this.r=t,this.s=n,this.assertValidity()}return U(e,[{key:"assertValidity",value:function(){var e=this.r,t=this.s;if(!Os(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!Os(t))throw new Error("Invalid Signature: s must be 0 < s < n")}},{key:"hasHighS",value:function(){var e=Xa.n>>Ga;return this.s>e}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,Ls(-this.s,Xa.n)):this}},{key:"toDERRawBytes",value:function(){return Ts(this.toDERHex())}},{key:"toDERHex",value:function(){var e=ds(As(this.s)),t=ds(As(this.r)),n=e.length/2,r=t.length/2,i=As(n),o=As(r),a=As(r+n+4);return"30".concat(a,"02").concat(o).concat(t,"02").concat(i).concat(e)}},{key:"toRawBytes",value:function(){return this.toDERRawBytes()}},{key:"toHex",value:function(){return this.toDERHex()}},{key:"toCompactRawBytes",value:function(){return Ts(this.toCompactHex())}},{key:"toCompactHex",value:function(){return ws(this.r)+ws(this.s)}}],[{key:"fromCompact",value:function(t){var n=t instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof t&&!n)throw new TypeError("".concat(r,": Expected string or Uint8Array"));var i=n?ms(t):t;if(128!==i.length)throw new Error("".concat(r,": Expected 64-byte hex"));return new e(Es(i.slice(0,64)),Es(i.slice(64,128)))}},{key:"fromDER",value:function(t){var n=t instanceof Uint8Array;if("string"!=typeof t&&!n)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");var r=function(e){if(e.length<2||48!=e[0])throw new Error("Invalid signature tag: ".concat(ms(e)));if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");var t=hs(e.subarray(2)),n=t.data,r=hs(t.left),i=r.data,o=r.left;if(o.length)throw new Error("Invalid signature: left bytes after parsing: ".concat(ms(o)));return{r:n,s:i}}(n?t:Ts(t));return new e(r.r,r.s)}},{key:"fromHex",value:function(e){return this.fromDER(e)}}]),e}();function fs(){for(var e=arguments.length,t=new Array(e),n=0;n0)return BigInt(e);if("bigint"==typeof e&&Os(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Ls(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xa.P,n=e%t;return n>=Ha?n:t+n}function xs(e,t){for(var n=Xa.P,r=e;t-- >Ha;)r*=r,r%=n;return r}function Ss(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xa.P;if(e===Ha||t<=Ha)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var n=Ls(e,t),r=t,i=Ha,o=Ga;n!==Ha;){var a=r/n,s=r%n,u=i-o*a;r=n,n=s,i=o,o=u}var c=r;if(c!==Ga)throw new Error("invert: does not exist");return Ls(i,t)}function js(e){var t=8*e.length-256,n=Ns(e);return t>0?n>>BigInt(t):n}function Cs(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=js(e);if(t)return n;var r=Xa.n;return n>=r?n-r:n}var Ds=function(){function e(t,n){if(R(this,e),this.hashLen=t,this.qByteLen=n,"number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof n||n<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(t).fill(1),this.k=new Uint8Array(t).fill(0),this.counter=0}var t,n;return U(e,[{key:"hmac",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}},{key:"reseed",value:(n=P(O().mark((function e(){var t,n=arguments;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:new Uint8Array,e.next=3,this.hmac(this.v,Uint8Array.from([0]),t);case 3:return this.k=e.sent,e.next=6,this.hmac(this.v);case 6:if(this.v=e.sent,0!==t.length){e.next=9;break}return e.abrupt("return");case 9:return e.next=11,this.hmac(this.v,Uint8Array.from([1]),t);case 11:return this.k=e.sent,e.next=14,this.hmac(this.v);case 14:this.v=e.sent;case 15:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"reseedSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}},{key:"generate",value:(t=P(O().mark((function e(){var t,n,r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.incr(),t=0,n=[];case 3:if(!(t3&&void 0!==arguments[3])||arguments[3],i=Xa.n,o=Cs(e,!0);if(Os(o)){var a=Ss(o,i),s=ls.BASE.multiply(o),u=Ls(s.x,i);if(u!==Ha){var c=Ls(a*Ls(t+n*u,i),i);if(c!==Ha){var l=new ps(u,c),d=(s.x===l.r?0:2)|Number(s.y&Ga);return r&&l.hasHighS()&&(l=l.normalizeS(),d^=1),{sig:l,recovery:d}}}}}function Ps(e){var t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=Es(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(e.length!==ns)throw new Error("Expected 32 bytes of private key");t=Ns(e)}if(!Os(t))throw new Error("Expected private key: 0 < key < n");return t}function Rs(e){return Ns(e.length>ts?e.slice(0,ts):e)}function Bs(e){var t=Rs(e),n=Ls(t,Xa.n);return Us(n1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return Ms(Ls(Ns(e),Xa.n-Ga)+Ga)},randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(Vs.web)return Vs.web.getRandomValues(new Uint8Array(e));if(Vs.node){var t=Vs.node.randomBytes;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return Gs.hashToPrivateKey(Gs.randomBytes(40))},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ls.BASE,n=t===ls.BASE?t:new ls(t.x,t.y);return n._setWindowSize(e),n.multiply(Za),n},sha256:function(){var e=P(O().mark((function e(){var t,n,r,i,o,a,s=arguments;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=s.length,n=new Array(t),r=0;r1?n-1:0),i=1;i1?i-1:0),a=1;a1?r-1:0),o=1;ouu)throw new Error("Invalid public key input")}return t}return U(a,[{key:"equals",value:function(e){return this._bn.eq(e._bn)}},{key:"toBase58",value:function(){return Pn.encode(this.toBytes())}},{key:"toJSON",value:function(){return this.toBase58()}},{key:"toBytes",value:function(){var e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}},{key:"toBuffer",value:function(){var e=this._bn.toArrayLike(Te);if(e.length===uu)return e;var t=Te.alloc(32);return e.copy(t,32-e.length),t}},{key:t,get:function(){return"PublicKey(".concat(this.toString(),")")}},{key:"toString",value:function(){return this.toBase58()}}],[{key:"unique",value:function(){var e=new a(cu);return cu+=1,new a(e.toBuffer())}},{key:"createWithSeed",value:(i=P(O().mark((function e(t,n,r){var i,o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Te.concat([t.toBuffer(),Te.from(n),r.toBuffer()]),o=Fn(i),e.abrupt("return",new a(o));case 3:case"end":return e.stop()}}),e)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"createProgramAddressSync",value:function(e,t){var n=Te.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");n=Te.concat([n,iu(e)])})),n=Te.concat([n,t.toBuffer(),Te.from("ProgramDerivedAddress")]);var r=Fn(n);if(tu(r))throw new Error("Invalid seeds, address must fall off the curve");return new a(r)}},{key:"createProgramAddress",value:(r=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.createProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"findProgramAddressSync",value:function(e,t){for(var n,r=255;0!=r;){try{var i=e.concat(Te.from([r]));n=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;r--;continue}return[n,r]}throw new Error("Unable to find a viable program address nonce")}},{key:"findProgramAddress",value:(n=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.findProgramAddressSync(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"isOnCurve",value:function(e){return tu(new a(e).toBytes())}}]),a}(ou,Symbol.toStringTag);lu.default=new lu("11111111111111111111111111111111"),su.set(lu,{kind:"struct",fields:[["_bn","u256"]]});var du=function(){function e(t){if(R(this,e),this._publicKey=void 0,this._secretKey=void 0,t){var n=iu(t);if(64!==t.length)throw new Error("bad secret key size");this._publicKey=n.slice(32,64),this._secretKey=n.slice(0,32)}else this._secretKey=iu(Ks()),this._publicKey=iu(eu(this._secretKey))}return U(e,[{key:"publicKey",get:function(){return new lu(this._publicKey)}},{key:"secretKey",get:function(){return Te.concat([this._secretKey,this._publicKey],64)}}]),e}(),hu=new lu("BPFLoader1111111111111111111111111111111111"),pu=1232,fu=127,yu=64,mu=function(e){Q(n,e);var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: block height exceeded."))).signature=void 0,r.signature=e,r}return U(n)}(G(Error));Object.defineProperty(mu.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});var gu=function(e){Q(n,e);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,"Transaction was not confirmed in ".concat(r.toFixed(2)," seconds. It is ")+"unknown if it succeeded or failed. Check signature "+"".concat(e," using the Solana Explorer or CLI tools."))).signature=void 0,i.signature=e,i}return U(n)}(G(Error));Object.defineProperty(gu.prototype,"name",{value:"TransactionExpiredTimeoutError"});var vu=function(e){Q(n,e);var t=X(n);function n(e){var r;return R(this,n),(r=t.call(this,"Signature ".concat(e," has expired: the nonce is no longer valid."))).signature=void 0,r.signature=e,r}return U(n)}(G(Error));Object.defineProperty(vu.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});var bu=function(){function e(t,n){R(this,e),this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=n}return U(e,[{key:"keySegments",value:function(){var e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}},{key:"get",value:function(e){var t,n=se(this.keySegments());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e256)throw new Error("Account index overflow encountered during compilation");var t=new Map;this.keySegments().flat().forEach((function(e,n){t.set(e.toBase58(),n)}));var n=function(e){var n=t.get(e.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return e.map((function(e){return{programIdIndex:n(e.programId),accountKeyIndexes:e.keys.map((function(e){return n(e.pubkey)})),data:e.data}}))}}]),e}(),wu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return wi(32,e)},Mu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature";return wi(64,e)},Au=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",t=vi([yi("length"),yi("lengthPadding"),wi(hi(yi(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=function(e,t){return n(e,t).chars.toString()},i.encode=function(e,t,n){var i={chars:Te.from(e,"utf8")};return r(i,t,n)},i.alloc=function(e){return yi().span+yi().span+Te.from(e,"utf8").length},i};function Eu(e,t){var n=function e(n){if(n.span>=0)return n.span;if("function"==typeof n.alloc)return n.alloc(t[n.property]);if("count"in n&&"elementLayout"in n){var r=t[n.property];if(Array.isArray(r))return r.length*e(n.elementLayout)}else if("fields"in n)return Eu({layout:n},t[n.property]);return 0},r=0;return e.layout.fields.forEach((function(e){r+=n(e)})),r}function Tu(e){for(var t=0,n=0;;){var r=e.shift();if(t|=(127&r)<<7*n,n+=1,0==(128&r))break}return t}function Nu(e,t){for(var n=t;;){var r=127&n;if(0==(n>>=7)){e.push(r);break}r|=128,e.push(r)}}function Iu(e,t){if(!e)throw new Error(t||"Assertion failed")}var ku,Lu=function(){function e(t,n){R(this,e),this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=n}return U(e,[{key:"getMessageComponents",value:function(){var e=te(this.keyMetaMap.entries());Iu(e.length<=256,"Max static account keys length exceeded");var t=e.filter((function(e){var t=ee(e,2)[1];return t.isSigner&&t.isWritable})),n=e.filter((function(e){var t=ee(e,2)[1];return t.isSigner&&!t.isWritable})),r=e.filter((function(e){var t=ee(e,2)[1];return!t.isSigner&&t.isWritable})),i=e.filter((function(e){var t=ee(e,2)[1];return!t.isSigner&&!t.isWritable})),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};return Iu(t.length>0,"Expected at least one writable signer key"),Iu(ee(t[0],1)[0]===this.payer.toBase58(),"Expected first writable signer key to be the fee payer"),[o,[].concat(te(t.map((function(e){var t=ee(e,1)[0];return new lu(t)}))),te(n.map((function(e){var t=ee(e,1)[0];return new lu(t)}))),te(r.map((function(e){var t=ee(e,1)[0];return new lu(t)}))),te(i.map((function(e){var t=ee(e,1)[0];return new lu(t)}))))]}},{key:"extractTableLookup",value:function(e){var t=ee(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&e.isWritable})),2),n=t[0],r=t[1],i=ee(this.drainKeysFoundInLookupTable(e.state.addresses,(function(e){return!e.isSigner&&!e.isInvoked&&!e.isWritable})),2),o=i[0],a=i[1];if(0!==n.length||0!==o.length)return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:o},{writable:r,readonly:a}]}},{key:"drainKeysFoundInLookupTable",value:function(e,t){var n,r=this,i=new Array,o=new Array,a=se(this.keyMetaMap.entries());try{var s=function(){var a=ee(n.value,2),s=a[0],u=a[1];if(t(u)){var c=new lu(s),l=e.findIndex((function(e){return e.equals(c)}));l>=0&&(Iu(l<256,"Max lookup table index exceeded"),i.push(l),o.push(c),r.keyMetaMap.delete(s))}};for(a.s();!(n=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return[i,o]}}],[{key:"compile",value:function(t,n){var r=new Map,i=function(e){var t=e.toBase58(),n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},o=i(n);o.isSigner=!0,o.isWritable=!0;var a,s=se(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;i(u.programId).isInvoked=!0;var c,l=se(u.keys);try{for(l.s();!(c=l.n()).done;){var d=c.value,h=i(d.pubkey);h.isSigner||(h.isSigner=d.isSigner),h.isWritable||(h.isWritable=d.isWritable)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){s.e(e)}finally{s.f()}return new e(n,r)}}]),e}(),xu=function(){function e(t){var n=this;R(this,e),this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((function(e){return new lu(e)})),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((function(e){return n.indexToProgramIds.set(e.programIdIndex,n.accountKeys[e.programIdIndex])}))}return U(e,[{key:"version",get:function(){return"legacy"}},{key:"staticAccountKeys",get:function(){return this.accountKeys}},{key:"compiledInstructions",get:function(){return this.instructions.map((function(e){return{programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:Pn.decode(e.data)}}))}},{key:"addressTableLookups",get:function(){return[]}},{key:"getAccountKeys",value:function(){return new bu(this.staticAccountKeys)}},{key:"isAccountSigner",value:function(e){return e=this.header.numRequiredSignatures?e-t0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new bu(this.staticAccountKeys,t)}},{key:"isAccountSigner",value:function(e){return e=n?e-n=this.header.numRequiredSignatures?e-t0?this.signatures[0].signature:null}},{key:"toJSON",value:function(){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((function(e){return e.toJSON()})),signers:this.signatures.map((function(e){return e.publicKey.toJSON()}))}}},{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(var r=0;r-1?(a[n].isWritable=a[n].isWritable||e.isWritable,a[n].isSigner=a[n].isSigner||e.isSigner):a.push(e)})),a.sort((function(e,t){return e.isSigner!==t.isSigner?e.isSigner?-1:1:e.isWritable!==t.isWritable?e.isWritable?-1:1:e.pubkey.toBase58().localeCompare(t.pubkey.toBase58())}));var s=a.findIndex((function(e){return e.pubkey.equals(n)}));if(s>-1){var u=ee(a.splice(s,1),1)[0];u.isSigner=!0,u.isWritable=!0,a.unshift(u)}else a.unshift({pubkey:n,isSigner:!0,isWritable:!0});var c,l=se(this.signatures);try{var d=function(){var e=c.value,t=a.findIndex((function(t){return t.pubkey.equals(e.publicKey)}));if(!(t>-1))throw new Error("unknown signer: ".concat(e.publicKey.toString()));a[t].isSigner||(a[t].isSigner=!0,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."))};for(l.s();!(c=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}var h=0,p=0,f=0,y=[],m=[];a.forEach((function(e){var t=e.pubkey,n=e.isSigner,r=e.isWritable;n?(y.push(t.toString()),h+=1,r||(p+=1)):(m.push(t.toString()),r||(f+=1))}));var g=y.concat(m),v=t.map((function(e){var t=e.data,n=e.programId;return{programIdIndex:g.indexOf(n.toString()),accounts:e.keys.map((function(e){return g.indexOf(e.pubkey.toString())})),data:Pn.encode(t)}}));return v.forEach((function(e){Iu(e.programIdIndex>=0),e.accounts.forEach((function(e){return Iu(e>=0)}))})),new xu({header:{numRequiredSignatures:h,numReadonlySignedAccounts:p,numReadonlyUnsignedAccounts:f},accountKeys:g,recentBlockhash:e,instructions:v})}},{key:"_compile",value:function(){var e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length&&this.signatures.every((function(e,n){return t[n].equals(e.publicKey)})))return e;return this.signatures=t.map((function(e){return{signature:null,publicKey:e}})),e}},{key:"serializeMessage",value:function(){return this._compile().serialize()}},{key:"getEstimatedFee",value:(t=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getFeeForMessage(this.compileMessage());case 2:return e.abrupt("return",e.sent.value);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setSigners",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),o=1;o ").concat(pu)),i}},{key:"keys",get:function(){return Iu(1===this.instructions.length),this.instructions[0].keys.map((function(e){return e.pubkey}))}},{key:"programId",get:function(){return Iu(1===this.instructions.length),this.instructions[0].programId}},{key:"data",get:function(){return Iu(1===this.instructions.length),this.instructions[0].data}}],[{key:"from",value:function(t){for(var n=te(t),r=Tu(n),i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:[],r=new e;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),n.forEach((function(e,n){var i={signature:e==Pn.encode(Cu)?null:Pn.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)})),t.instructions.forEach((function(e){var n=e.accounts.map((function(e){var n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some((function(e){return e.publicKey.toString()===n.toString()}))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));r.instructions.push(new Du({keys:n,programId:t.accountKeys[e.programIdIndex],data:Pn.decode(e.data)}))})),r._message=t,r._json=r.toJSON(),r}}]),e}(),zu=function(){function e(t){R(this,e),this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}return U(e,[{key:"compileToLegacyMessage",value:function(){return xu.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}},{key:"compileToV0Message",value:function(e){return Su.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}],[{key:"decompile",value:function(t,n){var r=t.header,i=t.compiledInstructions,o=t.recentBlockhash,a=r.numRequiredSignatures,s=r.numReadonlySignedAccounts,u=r.numReadonlyUnsignedAccounts,c=a-s;Iu(c>0,"Message header is invalid");var l=t.staticAccountKeys.length-a-u;Iu(l>=0,"Message header is invalid");var d=t.getAccountKeys(n),h=d.get(0);if(void 0===h)throw new Error("Failed to decompile message because no account keys were found");var p,f=[],y=se(i);try{for(y.s();!(p=y.n()).done;){var m,g=p.value,v=[],b=se(g.accountKeyIndexes);try{for(b.s();!(m=b.n()).done;){var w=m.value,M=d.get(w);if(void 0===M)throw new Error("Failed to find key for account key index ".concat(w));var A=void 0;A=w=0,"Cannot sign with non signer key ".concat(e.publicKey.toBase58())),n.signatures[o]=nu(r,e.secretKey)};for(o.s();!(t=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}}},{key:"addSignature",value:function(e,t){Iu(64===t.byteLength,"Signature must be 64 bytes long");var n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((function(t){return t.equals(e)}));Iu(n>=0,"Can not add signature; `".concat(e.toBase58(),"` is not required to sign this transaction")),this.signatures[n]=t}}],[{key:"deserialize",value:function(t){for(var n=te(t),r=[],i=Tu(n),o=0;o=0?e.layout.span:Eu(e,t),r=Te.alloc(n),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,r),r}function Ju(e,t){var n;try{n=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(n.instruction!==e.index)throw new Error("invalid instruction; instruction index mismatch ".concat(n.instruction," != ").concat(e.index));return n}var Xu,Ku=mi("lamportsPerSignature"),$u=vi([yi("version"),yi("state"),wu("authorizedPubkey"),wu("nonce"),vi([Ku],"feeCalculator")]),ec=$u.span,tc=function(){function e(t){R(this,e),this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}return U(e,null,[{key:"fromAccountData",value:function(t){var n=$u.decode(iu(t),0);return new e({authorizedPubkey:new lu(n.authorizedPubkey),nonce:new lu(n.nonce).toString(),feeCalculator:n.feeCalculator})}}]),e}(),nc=(Xu=8,function(e){var t=wi(Xu,e),n=function(e){return{decode:e.decode.bind(e),encode:e.encode.bind(e)}}(t),r=n.encode,i=n.decode,o=t;return o.decode=function(e,t){var n=i(e,t);return Ai(Te.from(n))},o.encode=function(e,t,n){var i=Ei(e,Xu);return r(i,t,n)},o}),rc=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=yi("instruction").decode(e.data),r=0,i=Object.entries(ic);r0?s:1,space:a.length,programId:o}));case 17:if(null===c){t.next=20;break}return t.next=20,Hu(n,c,[r,i],{commitment:"confirmed"});case 20:l=vi([yi("instruction"),yi("offset"),yi("bytesLength"),yi("bytesLengthPadding"),bi(pi("byte"),hi(yi(),-8),"bytes")]),d=e.chunkSize,h=0,p=a,f=[];case 25:if(!(p.length>0)){t.next=39;break}if(y=p.slice(0,d),m=Te.alloc(d+16),l.encode({instruction:0,offset:h,bytes:y,bytesLength:0,bytesLengthPadding:0},m),g=(new Ou).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:m}),f.push(Hu(n,g,[r,i],{commitment:"confirmed"})),!n._rpcEndpoint.includes("solana.com")){t.next=35;break}return t.next=35,qu(250);case 35:h+=d,p=p.slice(d),t.next=25;break;case 39:return t.next=41,Promise.all(f);case 41:return v=vi([yi("instruction")]),b=Te.alloc(v.span),v.encode({instruction:1},b),w=(new Ou).add({keys:[{pubkey:i.publicKey,isSigner:!0,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1}],programId:o,data:b}),t.next=47,Hu(n,w,[r,i],{commitment:"confirmed"});case 47:return t.abrupt("return",!0);case 48:case"end":return t.stop()}}),t)}))),function(e,n,r,i,o){return t.apply(this,arguments)})}]),e}();ac.chunkSize=932;var sc=new lu("BPFLoader2111111111111111111111111111111111"),uc=function(){function e(){R(this,e)}return U(e,null,[{key:"getMinNumSignatures",value:function(e){return ac.getMinNumSignatures(e)}},{key:"load",value:function(e,t,n,r,i){return ac.load(e,t,n,i,r)}}]),e}(),cc=Object.prototype.toString,lc=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function dc(e,t){var n,r,i,o,a,s,u;if(!0===e)return"true";if(!1===e)return"false";switch(z(e)){case"object":if(null===e)return null;if(e.toJSON&&"function"==typeof e.toJSON)return dc(e.toJSON(),t);if("[object Array]"===(u=cc.call(e))){for(i="[",r=e.length-1,n=0;n-1&&(i+=dc(e[n],!0)),i+"]"}if("[object Object]"===u){for(r=(o=lc(e).sort()).length,i="",n=0;n1;)e/=2,t++;return t}var fc=function(){function e(t,n,r,i,o){R(this,e),this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=n,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=o}return U(e,[{key:"getEpoch",value:function(e){return this.getEpochAndSlotIndex(e)[0]}},{key:"getEpochAndSlotIndex",value:function(e){if(e>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,1+(e|=e>>32))}(e+32+1))-pc(32)-1;return[t,e-(this.getSlotsInEpoch(t)-32)]}var n=e-this.firstNormalSlot,r=Math.floor(n/this.slotsPerEpoch);return[this.firstNormalEpoch+r,n%this.slotsPerEpoch]}},{key:"getFirstSlotInEpoch",value:function(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}},{key:"getLastSlotInEpoch",value:function(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}},{key:"getSlotsInEpoch",value:function(e){return e0&&(i.until=a.signatures[a.signatures.length-1].toString()),e.next=22;break;case 15:if(e.prev=15,e.t0=e.catch(8),!(e.t0 instanceof Error&&e.t0.message.includes("skipped"))){e.next=21;break}return e.abrupt("continue",4);case 21:throw e.t0;case 22:e.next=4;break;case 24:return e.next=26,this.getSlot("finalized");case 26:s=e.sent;case 27:if("before"in i){e.next=47;break}if(!(++r>s)){e.next=31;break}return e.abrupt("break",47);case 31:return e.prev=31,e.next=34,this.getConfirmedBlockSignatures(r);case 34:(u=e.sent).signatures.length>0&&(i.before=u.signatures[u.signatures.length-1].toString()),e.next=45;break;case 38:if(e.prev=38,e.t1=e.catch(31),!(e.t1 instanceof Error&&e.t1.message.includes("skipped"))){e.next=44;break}return e.abrupt("continue",27);case 44:throw e.t1;case 45:e.next=27;break;case 47:return e.next=49,this.getConfirmedSignaturesForAddress2(t,i);case 49:return c=e.sent,e.abrupt("return",c.map((function(e){return e.signature})));case 51:case"end":return e.stop()}}),e,this,[[8,15],[31,38]])}))),function(e,t,n){return E.apply(this,arguments)})},{key:"getConfirmedSignaturesForAddress2",value:(A=P(O().mark((function e(t,n,r){var i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getConfirmedSignaturesForAddress2",i);case 3:if(o=e.sent,!("error"in(a=Pi(o,dl)))){e.next=7;break}throw new mc(a.error,"failed to get confirmed signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return A.apply(this,arguments)})},{key:"getSignaturesForAddress",value:(M=P(O().mark((function e(t,n,r){var i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,n),e.next=3,this._rpcRequest("getSignaturesForAddress",i);case 3:if(o=e.sent,!("error"in(a=Pi(o,hl)))){e.next=7;break}throw new mc(a.error,"failed to get signatures for address");case 7:return e.abrupt("return",a.result);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return M.apply(this,arguments)})},{key:"getAddressLookupTable",value:(w=P(O().mark((function e(t,n){var r,i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=new bc({key:t,state:bc.deserialize(o.data)})),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getNonceAndContext",value:(b=P(O().mark((function e(t,n){var r,i,o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccountInfoAndContext(t,n);case 2:return r=e.sent,i=r.context,o=r.value,a=null,null!==o&&(a=tc.fromAccountData(o.data)),e.abrupt("return",{context:i,value:a});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getNonce",value:(v=P(O().mark((function e(t,n){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNonceAndContext(t,n).then((function(e){return e.value})).catch((function(e){throw new Error("failed to get nonce for account "+t.toBase58()+": "+e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"requestAirdrop",value:(g=P(O().mark((function e(t,n){var r,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._rpcRequest("requestAirdrop",[t.toBase58(),n]);case 2:if(r=e.sent,!("error"in(i=Pi(r,rd)))){e.next=6;break}throw new mc(i.error,"airdrop to ".concat(t.toBase58()," failed"));case 6:return e.abrupt("return",i.result);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"_blockhashWithExpiryBlockHeight",value:(m=P(O().mark((function e(t){var n,r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=10;break}case 1:if(!this._pollingBlockhash){e.next=6;break}return e.next=4,qu(100);case 4:e.next=1;break;case 6:if(n=Date.now()-this._blockhashInfo.lastFetch,r=n>=3e4,null===this._blockhashInfo.latestBlockhash||r){e.next=10;break}return e.abrupt("return",this._blockhashInfo.latestBlockhash);case 10:return e.next=12,this._pollNewBlockhash();case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"_pollNewBlockhash",value:(y=P(O().mark((function e(){var t,n,r,i,o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._pollingBlockhash=!0,e.prev=1,t=Date.now(),n=this._blockhashInfo.latestBlockhash,r=n?n.blockhash:null,i=0;case 6:if(!(i<50)){e.next=18;break}return e.next=9,this.getLatestBlockhash("finalized");case 9:if(o=e.sent,r===o.blockhash){e.next=13;break}return this._blockhashInfo={latestBlockhash:o,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e.abrupt("return",o);case 13:return e.next=15,qu(200);case 15:i++,e.next=6;break;case 18:throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-t,"ms"));case 19:return e.prev=19,this._pollingBlockhash=!1,e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[1,,19,22]])}))),function(){return y.apply(this,arguments)})},{key:"getStakeMinimumDelegation",value:(f=P(O().mark((function e(t){var n,r,i,o,a,s;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Nc(t),r=n.commitment,i=n.config,o=this._buildArgs([],r,"base64",i),e.next=4,this._rpcRequest("getStakeMinimumDelegation",o);case 4:if(a=e.sent,!("error"in(s=Pi(a,xc(Hi()))))){e.next=8;break}throw new mc(s.error,"failed to get stake minimum delegation");case 8:return e.abrupt("return",s.result);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"simulateTransaction",value:(p=P(O().mark((function e(t,n,r){var i,o,a,s,u,c,l,d,h,p,f,y,m,g,v,b,w,M,A,E,T,N,I,k,L,x;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("message"in t)){e.next=17;break}if(i=t.serialize(),o=Te.from(i).toString("base64"),!Array.isArray(n)&&void 0===r){e.next=6;break}throw new Error("Invalid arguments");case 6:return(a=n||{}).encoding="base64","commitment"in a||(a.commitment=this.commitment),s=[o,a],e.next=12,this._rpcRequest("simulateTransaction",s);case 12:if(u=e.sent,!("error"in(c=Pi(u,Yc)))){e.next=16;break}throw new Error("failed to simulate transaction: "+c.error.message);case 16:return e.abrupt("return",c.result);case 17:if(t instanceof Ou?(d=t,(l=new Ou).feePayer=d.feePayer,l.instructions=t.instructions,l.nonceInfo=d.nonceInfo,l.signatures=d.signatures):(l=Ou.populate(t))._message=l._json=void 0,void 0===n||Array.isArray(n)){e.next=20;break}throw new Error("Invalid arguments");case 20:if(h=n,!l.nonceInfo||!h){e.next=25;break}(p=l).sign.apply(p,te(h)),e.next=45;break;case 25:f=this._disableBlockhashCaching;case 26:return e.next=28,this._blockhashWithExpiryBlockHeight(f);case 28:if(m=e.sent,l.lastValidBlockHeight=m.lastValidBlockHeight,l.recentBlockhash=m.blockhash,h){e.next=33;break}return e.abrupt("break",45);case 33:if((y=l).sign.apply(y,te(h)),l.signature){e.next=36;break}throw new Error("!signature");case 36:if(g=l.signature.toString("base64"),this._blockhashInfo.simulatedSignatures.includes(g)||this._blockhashInfo.transactionSignatures.includes(g)){e.next=42;break}return this._blockhashInfo.simulatedSignatures.push(g),e.abrupt("break",45);case 42:f=!0;case 43:e.next=26;break;case 45:return v=l._compile(),b=v.serialize(),w=l._serialize(b),M=w.toString("base64"),A={encoding:"base64",commitment:this.commitment},r&&(E=(Array.isArray(r)?r:v.nonProgramIds()).map((function(e){return e.toBase58()})),A.accounts={encoding:"base64",addresses:E}),h&&(A.sigVerify=!0),T=[M,A],e.next=55,this._rpcRequest("simulateTransaction",T);case 55:if(N=e.sent,!("error"in(I=Pi(N,Yc)))){e.next=60;break}throw"data"in I.error&&(k=I.error.data.logs)&&Array.isArray(k)&&(x=(L="\n ")+k.join(L),console.error(I.error.message,x)),new yc("failed to simulate transaction: "+I.error.message,k);case 60:return e.abrupt("return",I.result);case 61:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"sendTransaction",value:(h=P(O().mark((function e(t,n,r){var i,o,a,s,u,c;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!("version"in t)){e.next=7;break}if(!n||!Array.isArray(n)){e.next=3;break}throw new Error("Invalid arguments");case 3:return i=t.serialize(),e.next=6,this.sendRawTransaction(i,n);case 6:return e.abrupt("return",e.sent);case 7:if(void 0!==n&&Array.isArray(n)){e.next=9;break}throw new Error("Invalid arguments");case 9:if(o=n,!t.nonceInfo){e.next=14;break}t.sign.apply(t,te(o)),e.next=32;break;case 14:a=this._disableBlockhashCaching;case 15:return e.next=17,this._blockhashWithExpiryBlockHeight(a);case 17:if(s=e.sent,t.lastValidBlockHeight=s.lastValidBlockHeight,t.recentBlockhash=s.blockhash,t.sign.apply(t,te(o)),t.signature){e.next=23;break}throw new Error("!signature");case 23:if(u=t.signature.toString("base64"),this._blockhashInfo.transactionSignatures.includes(u)){e.next=29;break}return this._blockhashInfo.transactionSignatures.push(u),e.abrupt("break",32);case 29:a=!0;case 30:e.next=15;break;case 32:return c=t.serialize(),e.next=35,this.sendRawTransaction(c,r);case 35:return e.abrupt("return",e.sent);case 36:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"sendRawTransaction",value:(d=P(O().mark((function e(t,n){var r,i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=iu(t).toString("base64"),e.next=3,this.sendEncodedTransaction(r,n);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"sendEncodedTransaction",value:(l=P(O().mark((function e(t,n){var r,i,o,a,s,u,c;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={encoding:"base64"},i=n&&n.skipPreflight,o=n&&n.preflightCommitment||this.commitment,n&&null!=n.maxRetries&&(r.maxRetries=n.maxRetries),n&&null!=n.minContextSlot&&(r.minContextSlot=n.minContextSlot),i&&(r.skipPreflight=i),o&&(r.preflightCommitment=o),a=[t,r],e.next=10,this._rpcRequest("sendTransaction",a);case 10:if(s=e.sent,!("error"in(u=Pi(s,id)))){e.next=15;break}throw"data"in u.error&&(c=u.error.data.logs),new yc("failed to send transaction: "+u.error.message,c);case 15:return e.abrupt("return",u.result);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"_wsOnOpen",value:function(){var e=this;this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((function(){P(O().mark((function t(){return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._rpcWebSocket.notify("ping");case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})))()}),5e3),this._updateSubscriptions()}},{key:"_wsOnError",value:function(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}},{key:"_wsOnClose",value:function(e){var t=this;this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((function(e){var n=ee(e,2),r=n[0],i=n[1];t._setSubscription(r,D(D({},i),{},{state:"pending"}))}))):this._updateSubscriptions()}},{key:"_setSubscription",value:function(e,t){var n,r=null===(n=this._subscriptionsByHash[e])||void 0===n?void 0:n.state;if(this._subscriptionsByHash[e]=t,r!==t.state){var i=this._subscriptionStateChangeCallbacksByHash[e];i&&i.forEach((function(e){try{e(t.state)}catch(e){}}))}}},{key:"_onSubscriptionStateChange",value:function(e,t){var n,r=this,i=this._subscriptionHashByClientSubscriptionId[e];if(null==i)return function(){};var o=(n=this._subscriptionStateChangeCallbacksByHash)[i]||(n[i]=new Set);return o.add(t),function(){o.delete(t),0===o.size&&delete r._subscriptionStateChangeCallbacksByHash[i]}}},{key:"_updateSubscriptions",value:(c=P(O().mark((function e(){var t,n,r=this;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==Object.keys(this._subscriptionsByHash).length){e.next=3;break}return this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((function(){r._rpcWebSocketIdleTimeout=null;try{r._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log("Error when closing socket connection: ".concat(e.message))}}),500)),e.abrupt("return");case 3:if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),this._rpcWebSocketConnected){e.next=7;break}return this._rpcWebSocket.connect(),e.abrupt("return");case 7:return t=this._rpcWebSocketGeneration,n=function(){return t===r._rpcWebSocketGeneration},e.next=11,Promise.all(Object.keys(this._subscriptionsByHash).map(function(){var e=P(O().mark((function e(t){var i;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(i=r._subscriptionsByHash[t])){e.next=3;break}return e.abrupt("return");case 3:e.t0=i.state,e.next="pending"===e.t0||"unsubscribed"===e.t0?6:"subscribed"===e.t0?15:19;break;case 6:if(0!==i.callbacks.size){e.next=12;break}return delete r._subscriptionsByHash[t],"unsubscribed"===i.state&&delete r._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],e.next=11,r._updateSubscriptions();case 11:return e.abrupt("return");case 12:return e.next=14,P(O().mark((function e(){var o,a,s;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.args,a=i.method,e.prev=1,r._setSubscription(t,D(D({},i),{},{state:"subscribing"})),e.next=5,r._rpcWebSocket.call(a,o);case 5:return s=e.sent,r._setSubscription(t,D(D({},i),{},{serverSubscriptionId:s,state:"subscribed"})),r._subscriptionCallbacksByServerSubscriptionId[s]=i.callbacks,e.next=10,r._updateSubscriptions();case 10:e.next=20;break;case 12:if(e.prev=12,e.t0=e.catch(1),e.t0 instanceof Error&&console.error("".concat(a," error for argument"),o,e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,D(D({},i),{},{state:"pending"})),e.next=20,r._updateSubscriptions();case 20:case"end":return e.stop()}}),e,null,[[1,12]])})))();case 14:return e.abrupt("break",19);case 15:if(0!==i.callbacks.size){e.next=18;break}return e.next=18,P(O().mark((function e(){var o,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=i.serverSubscriptionId,a=i.unsubscribeMethod,!r._subscriptionsAutoDisposedByRpc.has(o)){e.next=5;break}r._subscriptionsAutoDisposedByRpc.delete(o),e.next=21;break;case 5:return r._setSubscription(t,D(D({},i),{},{state:"unsubscribing"})),r._setSubscription(t,D(D({},i),{},{state:"unsubscribing"})),e.prev=7,e.next=10,r._rpcWebSocket.call(a,[o]);case 10:e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(7),e.t0 instanceof Error&&console.error("".concat(a," error:"),e.t0.message),n()){e.next=17;break}return e.abrupt("return");case 17:return r._setSubscription(t,D(D({},i),{},{state:"subscribed"})),e.next=20,r._updateSubscriptions();case 20:return e.abrupt("return");case 21:return r._setSubscription(t,D(D({},i),{},{state:"unsubscribed"})),e.next=24,r._updateSubscriptions();case 24:case"end":return e.stop()}}),e,null,[[7,12]])})))();case 18:return e.abrupt("break",19);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 11:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_handleServerNotification",value:function(e,t){var n=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==n&&n.forEach((function(e){try{e.apply(void 0,te(t))}catch(e){console.error(e)}}))}},{key:"_wsOnAccountNotification",value:function(e){var t=Pi(e,pl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_makeSubscription",value:function(e,t){var n=this,r=this._nextClientSubscriptionId++,i=hc([e.method,t]),o=this._subscriptionsByHash[i];return void 0===o?this._subscriptionsByHash[i]=D(D({},e),{},{args:t,callbacks:new Set([e.callback]),state:"pending"}):o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=P(O().mark((function t(){var o;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return delete n._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete n._subscriptionHashByClientSubscriptionId[r],Iu(void 0!==(o=n._subscriptionsByHash[i]),"Could not find a `Subscription` when tearing down client subscription #".concat(r)),o.callbacks.delete(e.callback),t.next=7,n._updateSubscriptions();case 7:case"end":return t.stop()}}),t)}))),this._updateSubscriptions(),r}},{key:"onAccountChange",value:function(e,t,n){var r=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},r)}},{key:"removeAccountChangeListener",value:(u=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_wsOnProgramAccountNotification",value:function(e){var t=Pi(e,yl),n=t.result,r=t.subscription;this._handleServerNotification(r,[{accountId:n.value.pubkey,accountInfo:n.value.account},n.context])}},{key:"onProgramAccountChange",value:function(e,t,n,r){var i=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",r?{filters:r}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}},{key:"removeProgramAccountChangeListener",value:(s=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"program account change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"onLogs",value:function(e,t,n){var r=this._buildArgs(["object"===z(e)?{mentions:[e.toString()]}:e],n||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},r)}},{key:"removeOnLogsListener",value:(a=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"logs");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_wsOnLogsNotification",value:function(e){var t=Pi(e,ad),n=t.result,r=t.subscription;this._handleServerNotification(r,[n.value,n.context])}},{key:"_wsOnSlotNotification",value:function(e){var t=Pi(e,gl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotChange",value:function(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}},{key:"removeSlotChangeListener",value:(o=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_wsOnSlotUpdatesNotification",value:function(e){var t=Pi(e,bl),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onSlotUpdate",value:function(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}},{key:"removeSlotUpdateListener",value:(i=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"slot update");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_unsubscribeClientSubscription",value:(r=P(O().mark((function e(t,n){var r;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t])){e.next=6;break}return e.next=4,r();case 4:e.next=7;break;case 6:console.warn("Ignored unsubscribe request because an active subscription with id "+"`".concat(t,"` for '").concat(n,"' events ")+"could not be found.");case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"_buildArgs",value:function(e,t,n,r){var i=t||this._commitment;if(i||n||r){var o={};n&&(o.encoding=n),i&&(o.commitment=i),r&&(o=Object.assign(o,r)),e.push(o)}return e}},{key:"_buildArgsAtLeastConfirmed",value:function(e,t,n,r){var i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,n,r)}},{key:"_wsOnSignatureNotification",value:function(e){var t=Pi(e,wl),n=t.result,r=t.subscription;"receivedSignature"!==n.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===n.value?[{type:"received"},n.context]:[{type:"status",result:n.value},n.context])}},{key:"onSignature",value:function(e,t,n){var r=this,i=this._buildArgs([e],n||this._commitment||"finalized"),o=this._makeSubscription({callback:function(e,n){if("status"===e.type){t(e.result,n);try{r.removeSignatureListener(o)}catch(e){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return o}},{key:"onSignatureWithOptions",value:function(e,t,n){var r=this,i=D(D({},n),{},{commitment:n&&n.commitment||this._commitment||"finalized"}),o=i.commitment,a=q(i,Xs),s=this._buildArgs([e],o,void 0,a),u=this._makeSubscription({callback:function(e,n){t(e,n);try{r.removeSignatureListener(u)}catch(e){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return u}},{key:"removeSignatureListener",value:(n=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"signature result");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_wsOnRootNotification",value:function(e){var t=Pi(e,Ml),n=t.result,r=t.subscription;this._handleServerNotification(r,[n])}},{key:"onRootChange",value:function(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}},{key:"removeRootChangeListener",value:(t=P(O().mark((function e(t){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._unsubscribeClientSubscription(t,"root change");case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),cd=function(){function e(t){R(this,e),this._keypair=void 0,this._keypair=null!=t?t:$s()}return U(e,[{key:"publicKey",get:function(){return new lu(this._keypair.publicKey)}},{key:"secretKey",get:function(){return new Uint8Array(this._keypair.secretKey)}}],[{key:"generate",value:function(){return new e($s())}},{key:"fromSecretKey",value:function(t,n){if(64!==t.byteLength)throw new Error("bad secret key size");var r=t.slice(32,64);if(!n||!n.skipValidation)for(var i=t.slice(0,32),o=eu(i),a=0;a<32;a++)if(r[a]!==o[a])throw new Error("provided secretKey is invalid");return new e({publicKey:r,secretKey:t})}},{key:"fromSeed",value:function(t){var n=eu(t),r=new Uint8Array(64);return r.set(t),r.set(n,32),new e({publicKey:n,secretKey:r})}}]),e}(),ld=Object.freeze({CreateLookupTable:{index:0,layout:vi([yi("instruction"),nc("recentSlot"),pi("bumpSeed")])},FreezeLookupTable:{index:1,layout:vi([yi("instruction")])},ExtendLookupTable:{index:2,layout:vi([yi("instruction"),nc(),bi(wu(),hi(yi(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:vi([yi("instruction")])},CloseLookupTable:{index:4,layout:vi([yi("instruction")])}}),dd=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=yi("instruction").decode(e.data),r=0,i=Object.entries(ld);r2?e.keys[2].pubkey:void 0,addresses:t.map((function(e){return new lu(e)}))}}},{key:"decodeCloseLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}},{key:"decodeFreezeLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"decodeDeactivateLookupTable",value:function(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(hd.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}},{key:"checkKeysLength",value:function(e,t){if(e.length1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{},i=Ws(e,t,r.extraEntropy),o=i.seed,a=i.m,s=i.d,u=new Ds(32,ns);for(u.reseedSync(o);!(n=_s(u.generateSync(),a,s,r.canonical));)u.reseedSync();return Qs(n,r)}(e,t,{der:!1,recovered:!0})};Gs.isValidPrivateKey;var bd=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ls.fromPrivateKey(e).toRawBytes(t)},wd=vi([pi("numSignatures"),fi("signatureOffset"),pi("signatureInstructionIndex"),fi("ethAddressOffset"),pi("ethAddressInstructionIndex"),fi("messageDataOffset"),fi("messageDataSize"),pi("messageInstructionIndex"),wi(20,"ethAddress"),wi(64,"signature"),pi("recoveryId")]),Md=function(){function e(){R(this,e)}return U(e,null,[{key:"publicKeyToEthAddress",value:function(e){Iu(64===e.length,"Public key must be ".concat(64," bytes but received ").concat(e.length," bytes"));try{return Te.from(Qa(iu(e))).slice(-20)}catch(e){throw new Error("Error constructing Ethereum address: ".concat(e))}}},{key:"createInstructionWithPublicKey",value:function(t){var n=t.publicKey,r=t.message,i=t.signature,o=t.recoveryId,a=t.instructionIndex;return e.createInstructionWithEthAddress({ethAddress:e.publicKeyToEthAddress(n),message:r,signature:i,recoveryId:o,instructionIndex:a})}},{key:"createInstructionWithEthAddress",value:function(t){var n,r=t.ethAddress,i=t.message,o=t.signature,a=t.recoveryId,s=t.instructionIndex,u=void 0===s?0:s;Iu(20===(n="string"==typeof r?r.startsWith("0x")?Te.from(r.substr(2),"hex"):Te.from(r,"hex"):r).length,"Address must be ".concat(20," bytes but received ").concat(n.length," bytes"));var c=12+n.length,l=c+o.length+1,d=Te.alloc(wd.span+i.length);return wd.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:u,ethAddressOffset:12,ethAddressInstructionIndex:u,messageDataOffset:l,messageDataSize:i.length,messageInstructionIndex:u,signature:iu(o),ethAddress:iu(n),recoveryId:a},d),d.fill(iu(i),wd.span),new Du({keys:[],programId:e.programId,data:d})}},{key:"createInstructionWithPrivateKey",value:function(e){var t=e.privateKey,n=e.message,r=e.instructionIndex;Iu(32===t.length,"Private key must be ".concat(32," bytes but received ").concat(t.length," bytes"));try{var i=iu(t),o=bd(i,!1).slice(1),a=Te.from(Qa(iu(n))),s=ee(vd(a,i),2),u=s[0],c=s[1];return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:u,recoveryId:c,instructionIndex:r})}catch(e){throw new Error("Error creating instruction; ".concat(e))}}}]),e}();Md.programId=new lu("KeccakSecp256k11111111111111111111111111111");var Ad=new lu("StakeConfig11111111111111111111111111111111"),Ed=U((function e(t,n){R(this,e),this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=n})),Td=U((function e(t,n,r){R(this,e),this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=n,this.custodian=r}));Td.default=new Td(0,0,lu.default);var Nd=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=yi("instruction").decode(e.data),r=0,i=Object.entries(Id);r3&&(i.custodianPubkey=e.keys[3].pubkey),i}},{key:"decodeAuthorizeWithSeed",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);var t=Ju(Id.AuthorizeWithSeed,e.data),n=t.newAuthorized,r=t.stakeAuthorizationType,i=t.authoritySeed,o=t.authorityOwner,a={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:i,authorityOwner:new lu(o),newAuthorizedPubkey:new lu(n),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(a.custodianPubkey=e.keys[3].pubkey),a}},{key:"decodeSplit",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);var t=Ju(Id.Split,e.data).lamports;return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}},{key:"decodeMerge",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ju(Id.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}},{key:"decodeWithdraw",value:function(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);var t=Ju(Id.Withdraw,e.data).lamports,n={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(n.custodianPubkey=e.keys[5].pubkey),n}},{key:"decodeDeactivate",value:function(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),Ju(Id.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}},{key:"checkProgramId",value:function(e){if(!e.equals(Ld.programId))throw new Error("invalid instruction; programId is not StakeProgram")}},{key:"checkKeyLength",value:function(e,t){if(e.length0&&void 0!==arguments[0]?arguments[0]:"authorized";return vi([wu("staker"),wu("withdrawer")],e)}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return vi([gi("unixTimestamp"),gi("epoch"),wu("custodian")],e)}()])},Authorize:{index:1,layout:vi([yi("instruction"),wu("newAuthorized"),yi("stakeAuthorizationType")])},Delegate:{index:2,layout:vi([yi("instruction")])},Split:{index:3,layout:vi([yi("instruction"),gi("lamports")])},Withdraw:{index:4,layout:vi([yi("instruction"),gi("lamports")])},Deactivate:{index:5,layout:vi([yi("instruction")])},Merge:{index:7,layout:vi([yi("instruction")])},AuthorizeWithSeed:{index:8,layout:vi([yi("instruction"),wu("newAuthorized"),yi("stakeAuthorizationType"),Au("authoritySeed"),wu("authorityOwner")])}}),kd=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),Ld=function(){function e(){R(this,e)}return U(e,null,[{key:"initialize",value:function(e){var t=e.stakePubkey,n=e.authorized,r=e.lockup||Td.default,i=Zu(Id.Initialize,{authorized:{staker:iu(n.staker.toBuffer()),withdrawer:iu(n.withdrawer.toBuffer())},lockup:{unixTimestamp:r.unixTimestamp,epoch:r.epoch,custodian:iu(r.custodian.toBuffer())}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new Du(o)}},{key:"createAccountWithSeed",value:function(e){var t=new Ou;t.add(oc.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"createAccount",value:function(e){var t=new Ou;t.add(oc.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));var n=e.stakePubkey,r=e.authorized,i=e.lockup;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}},{key:"delegate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.votePubkey,i=Zu(Id.Delegate);return(new Ou).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:Vu,isSigner:!1,isWritable:!1},{pubkey:Ad,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"authorize",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.stakeAuthorizationType,o=e.custodianPubkey,a=Zu(Id.Authorize,{newAuthorized:iu(r.toBuffer()),stakeAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Ou).add({keys:s,programId:this.programId,data:a})}},{key:"authorizeWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorityBase,r=e.authoritySeed,i=e.authorityOwner,o=e.newAuthorizedPubkey,a=e.stakeAuthorizationType,s=e.custodianPubkey,u=Zu(Id.AuthorizeWithSeed,{newAuthorized:iu(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:r,authorityOwner:iu(i.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:Pu,isSigner:!1,isWritable:!1}];return s&&c.push({pubkey:s,isSigner:!1,isWritable:!1}),(new Ou).add({keys:c,programId:this.programId,data:u})}},{key:"splitInstruction",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.lamports,o=Zu(Id.Split,{lamports:i});return new Du({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}},{key:"split",value:function(e){var t=new Ou;return t.add(oc.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}},{key:"splitWithSeed",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.splitStakePubkey,i=e.basePubkey,o=e.seed,a=e.lamports,s=new Ou;return s.add(oc.allocate({accountPubkey:r,basePubkey:i,seed:o,space:this.space,programId:this.programId})),s.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:a}))}},{key:"merge",value:function(e){var t=e.stakePubkey,n=e.sourceStakePubKey,r=e.authorizedPubkey,i=Zu(Id.Merge);return(new Ou).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:Vu,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},{key:"withdraw",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=e.toPubkey,i=e.lamports,o=e.custodianPubkey,a=Zu(Id.Withdraw,{lamports:i}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:Vu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!1,isWritable:!1}),(new Ou).add({keys:s,programId:this.programId,data:a})}},{key:"deactivate",value:function(e){var t=e.stakePubkey,n=e.authorizedPubkey,r=Zu(Id.Deactivate);return(new Ou).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}]),e}();Ld.programId=new lu("Stake11111111111111111111111111111111111111"),Ld.space=200;var xd=U((function e(t,n,r,i){R(this,e),this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=n,this.authorizedWithdrawer=r,this.commission=i})),Sd=function(){function e(){R(this,e)}return U(e,null,[{key:"decodeInstructionType",value:function(e){this.checkProgramId(e.programId);for(var t,n=yi("instruction").decode(e.data),r=0,i=Object.entries(jd);r0&&void 0!==arguments[0]?arguments[0]:"voteInit";return vi([wu("nodePubkey"),wu("authorizedVoter"),wu("authorizedWithdrawer"),pi("commission")],e)}()])},Authorize:{index:1,layout:vi([yi("instruction"),wu("newAuthorized"),yi("voteAuthorizationType")])},Withdraw:{index:3,layout:vi([yi("instruction"),gi("lamports")])},AuthorizeWithSeed:{index:10,layout:vi([yi("instruction"),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteAuthorizeWithSeedArgs";return vi([yi("voteAuthorizationType"),wu("currentAuthorityDerivedKeyOwnerPubkey"),Au("currentAuthorityDerivedKeySeed"),wu("newAuthorized")],e)}()])}}),Cd=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Dd=function(){function e(){R(this,e)}return U(e,null,[{key:"initializeAccount",value:function(e){var t=e.votePubkey,n=e.nodePubkey,r=e.voteInit,i=Zu(jd.InitializeAccount,{voteInit:{nodePubkey:iu(r.nodePubkey.toBuffer()),authorizedVoter:iu(r.authorizedVoter.toBuffer()),authorizedWithdrawer:iu(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Wu,isSigner:!1,isWritable:!1},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Du(o)}},{key:"createAccount",value:function(e){var t=new Ou;return t.add(oc.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}},{key:"authorize",value:function(e){var t=e.votePubkey,n=e.authorizedPubkey,r=e.newAuthorizedPubkey,i=e.voteAuthorizationType,o=Zu(jd.Authorize,{newAuthorized:iu(r.toBuffer()),voteAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Ou).add({keys:a,programId:this.programId,data:o})}},{key:"authorizeWithSeed",value:function(e){var t=e.currentAuthorityDerivedKeyBasePubkey,n=e.currentAuthorityDerivedKeyOwnerPubkey,r=e.currentAuthorityDerivedKeySeed,i=e.newAuthorizedPubkey,o=e.voteAuthorizationType,a=e.votePubkey,s=Zu(jd.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:iu(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:iu(i.toBuffer()),voteAuthorizationType:o.index}}),u=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:Pu,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new Ou).add({keys:u,programId:this.programId,data:s})}},{key:"withdraw",value:function(e){var t=e.votePubkey,n=e.authorizedWithdrawerPubkey,r=e.lamports,i=e.toPubkey,o=Zu(jd.Withdraw,{lamports:r}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new Ou).add({keys:a,programId:this.programId,data:o})}},{key:"safeWithdraw",value:function(t,n,r){if(t.lamports>n-r)throw new Error("Withdraw will leave vote account with insuffcient funds.");return e.withdraw(t)}}]),e}();Dd.programId=new lu("Vote111111111111111111111111111111111111111"),Dd.space=3731;var Od=new lu("Va1idator1nfo111111111111111111111111111111"),zd=Xi({name:Zi(),website:Gi(Zi()),details:Gi(Zi()),keybaseUsername:Gi(Zi())}),_d=function(){function e(t,n){R(this,e),this.key=void 0,this.info=void 0,this.key=t,this.info=n}return U(e,null,[{key:"fromConfigData",value:function(t){var n=te(t);if(2!==Tu(n))return null;for(var r=[],i=0;i<2;i++){var o=new lu(n.slice(0,uu)),a=1===(n=n.slice(uu)).slice(0,1)[0];n=n.slice(1),r.push({publicKey:o,isSigner:a})}if(r[0].publicKey.equals(Od)&&r[1].isSigner){var s=Au().decode(Te.from(n)),u=JSON.parse(s);return _i(u,zd),new e(r[1].publicKey,u)}return null}}]),e}(),Pd=new lu("Vote111111111111111111111111111111111111111"),Rd=vi([wu("nodePubkey"),wu("authorizedWithdrawer"),pi("commission"),mi(),bi(vi([mi("slot"),yi("confirmationCount")]),hi(yi(),-8),"votes"),pi("rootSlotValid"),mi("rootSlot"),mi(),bi(vi([mi("epoch"),wu("authorizedVoter")]),hi(yi(),-8),"authorizedVoters"),vi([bi(vi([wu("authorizedPubkey"),mi("epochOfLastAuthorizedSwitch"),mi("targetEpoch")]),32,"buf"),mi("idx"),pi("isEmpty")],"priorVoters"),mi(),bi(vi([mi("epoch"),mi("credits"),mi("prevCredits")]),hi(yi(),-8),"epochCredits"),vi([mi("slot"),mi("timestamp")],"lastTimestamp")]),Bd=function(){function e(t){R(this,e),this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}return U(e,null,[{key:"fromAccountData",value:function(t){var n=Rd.decode(iu(t),4),r=n.rootSlot;return n.rootSlotValid||(r=null),new e({nodePubkey:new lu(n.nodePubkey),authorizedWithdrawer:new lu(n.authorizedWithdrawer),commission:n.commission,votes:n.votes,rootSlot:r,authorizedVoters:n.authorizedVoters.map(Ud),priorVoters:Qd(n.priorVoters),epochCredits:n.epochCredits,lastTimestamp:n.lastTimestamp})}}]),e}();function Ud(e){var t=e.authorizedVoter;return{epoch:e.epoch,authorizedVoter:new lu(t)}}function Wd(e){var t=e.authorizedPubkey,n=e.epochOfLastAuthorizedSwitch,r=e.targetEpoch;return{authorizedPubkey:new lu(t),epochOfLastAuthorizedSwitch:n,targetEpoch:r}}function Qd(e){var t=e.buf,n=e.idx;return e.isEmpty?[]:[].concat(te(t.slice(n+1).map(Wd)),te(t.slice(0,n).map(Wd)))}var Yd={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function Fd(){return(Fd=P(O().mark((function e(t,n,r,i){var o,a,s,u,c,l,d;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(o=r,a=i):a=r,s=a&&{skipPreflight:a.skipPreflight,preflightCommitment:a.preflightCommitment||a.commitment,minContextSlot:a.minContextSlot},e.next=4,t.sendRawTransaction(n,s);case 4:return u=e.sent,c=a&&a.commitment,l=o?t.confirmTransaction(o,c):t.confirmTransaction(u,c),e.next=9,l;case 9:if(!(d=e.sent.value).err){e.next=12;break}throw new Error("Raw transaction ".concat(u," failed (").concat(JSON.stringify(d),")"));case 12:return e.abrupt("return",u);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Vd=j(Object.freeze({__proto__:null,Account:du,AddressLookupTableAccount:bc,AddressLookupTableInstruction:dd,AddressLookupTableProgram:hd,Authorized:Ed,BLOCKHASH_CACHE_TIMEOUT_MS:3e4,BPF_LOADER_DEPRECATED_PROGRAM_ID:hu,BPF_LOADER_PROGRAM_ID:sc,BpfLoader:uc,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:fd,ComputeBudgetInstruction:pd,ComputeBudgetProgram:yd,Connection:ud,Ed25519Program:gd,Enum:au,EpochSchedule:fc,FeeCalculatorLayout:Ku,Keypair:cd,LAMPORTS_PER_SOL:1e9,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:ld,Loader:ac,Lockup:Td,MAX_SEED_LENGTH:32,Message:xu,MessageAccountKeys:bu,MessageV0:Su,NONCE_ACCOUNT_LENGTH:ec,NonceAccount:tc,PACKET_DATA_SIZE:pu,PUBLIC_KEY_LENGTH:uu,PublicKey:lu,SIGNATURE_LENGTH_IN_BYTES:yu,SOLANA_SCHEMA:su,STAKE_CONFIG_ID:Ad,STAKE_INSTRUCTION_LAYOUTS:Id,SYSTEM_INSTRUCTION_LAYOUTS:ic,SYSVAR_CLOCK_PUBKEY:Pu,SYSVAR_EPOCH_SCHEDULE_PUBKEY:Ru,SYSVAR_INSTRUCTIONS_PUBKEY:Bu,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:Uu,SYSVAR_RENT_PUBKEY:Wu,SYSVAR_REWARDS_PUBKEY:Qu,SYSVAR_SLOT_HASHES_PUBKEY:Yu,SYSVAR_SLOT_HISTORY_PUBKEY:Fu,SYSVAR_STAKE_HISTORY_PUBKEY:Vu,Secp256k1Program:Md,SendTransactionError:yc,SolanaJSONRPCError:mc,SolanaJSONRPCErrorCode:{JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016},StakeAuthorizationLayout:kd,StakeInstruction:Nd,StakeProgram:Ld,Struct:ou,SystemInstruction:rc,SystemProgram:oc,Transaction:Ou,TransactionExpiredBlockheightExceededError:mu,TransactionExpiredNonceInvalidError:vu,TransactionExpiredTimeoutError:gu,TransactionInstruction:Du,TransactionMessage:zu,get TransactionStatus(){return ku},VALIDATOR_INFO_KEY:Od,VERSION_PREFIX_MASK:fu,VOTE_PROGRAM_ID:Pd,ValidatorInfo:_d,VersionedMessage:ju,VersionedTransaction:_u,VoteAccount:Bd,VoteAuthorizationLayout:Cd,VoteInit:xd,VoteInstruction:Sd,VoteProgram:Dd,clusterApiUrl:function(e,t){var n=!1===t?"http":"https";if(!e)return Yd[n].devnet;var r=Yd[n][e];if(!r)throw new Error("Unknown ".concat(n," cluster: ").concat(e));return r},sendAndConfirmRawTransaction:function(e,t,n,r){return Fd.apply(this,arguments)},sendAndConfirmTransaction:Hu})),Hd={};Object.defineProperty(Hd,"__esModule",{value:!0});var Gd={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"},qd=function(e){Q(n,e);var t=X(n);function n(){var e;R(this,n);for(var r=arguments.length,i=new Array(r),o=0;o=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");var t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}function $d(){return Jd(this,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}function eh(){return Jd(this,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}var th;function nh(e,t){return Jd(this,void 0,void 0,O().mark((function n(){var r,i,o,a,s;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=JSON.stringify(e),i=Kd(e.id),o=new Uint8Array(12),crypto.getRandomValues(o),n.next=6,crypto.subtle.encrypt(ih(i,o),t,(new TextEncoder).encode(r));case 6:return a=n.sent,(s=new Uint8Array(i.byteLength+o.byteLength+a.byteLength)).set(new Uint8Array(i),0),s.set(new Uint8Array(o),i.byteLength),s.set(new Uint8Array(a),i.byteLength+o.byteLength),n.abrupt("return",s);case 12:case"end":return n.stop()}}),n)})))}function rh(e,t){return Jd(this,void 0,void 0,O().mark((function n(){var r,i,o,a,s,u;return O().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.slice(0,4),i=e.slice(4,16),o=e.slice(16),n.next=5,crypto.subtle.decrypt(ih(r,i),t,o);case 5:if(a=n.sent,s=oh().decode(a),u=JSON.parse(s),!Object.hasOwnProperty.call(u,"error")){n.next=10;break}throw new Zd(u.id,u.error.code,u.error.message);case 10:return n.abrupt("return",u);case 11:case"end":return n.stop()}}),n)})))}function ih(e,t){return{additionalData:e,iv:t,name:"AES-GCM",tagLength:128}}function oh(){return void 0===th&&(th=new TextDecoder("utf-8")),th}function ah(e,t,n){return Jd(this,void 0,void 0,O().mark((function r(){var i,o,a,s,u,c,l;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Promise.all([crypto.subtle.exportKey("raw",t),crypto.subtle.importKey("raw",e,{name:"ECDH",namedCurve:"P-256"},!1,[])]);case 2:return i=r.sent,o=ee(i,2),a=o[0],s=o[1],r.next=8,crypto.subtle.deriveBits({name:"ECDH",public:s},n,256);case 8:return u=r.sent,r.next=11,crypto.subtle.importKey("raw",u,"HKDF",!1,["deriveKey"]);case 11:return c=r.sent,r.next=14,crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(a),info:new Uint8Array},c,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"]);case 14:return l=r.sent,r.abrupt("return",l);case 16:case"end":return r.stop()}}),r)})))}function sh(e){if(e<49152||e>65535)throw new qd(Gd.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,"Association port number must be between 49152 and 65535. ".concat(e," given."),{port:e});return e}function uh(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i1?e.shift():e[0]}}(),u=1,c=0,l={__type:"disconnected"},n.abrupt("return",new Promise((function(t,n){var h,p,f,y={},m=function e(){return Jd(d,void 0,void 0,O().mark((function t(){var n,r;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("connecting"===l.__type){t.next=3;break}return console.warn("Expected adapter state to be `connecting` at the moment the websocket opens. "+"Got `".concat(l.__type,"`.")),t.abrupt("return");case 3:return n=l.associationKeypair,h.removeEventListener("open",e),t.next=7,eh();case 7:return r=t.sent,t.t0=h,t.next=11,Xd(r.publicKey,n.privateKey);case 11:t.t1=t.sent,t.t0.send.call(t.t0,t.t1),l={__type:"hello_req_sent",associationPublicKey:n.publicKey,ecdhPrivateKey:r.privateKey};case 14:case"end":return t.stop()}}),t)})))},g=function(e){e.wasClean?l={__type:"disconnected"}:n(new qd(Gd.ERROR_SESSION_CLOSED,"The wallet session dropped unexpectedly (".concat(e.code,": ").concat(e.reason,")."),{closeEvent:e})),p()},v=function(e){return Jd(d,void 0,void 0,O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p(),!(Date.now()-a>=gh)){e.next=5;break}n(new qd(Gd.ERROR_SESSION_TIMEOUT,"Failed to connect to the wallet websocket on port ".concat(i,"."))),e.next=8;break;case 5:return e.next=7,new Promise((function(e){var t=s();f=window.setTimeout(e,t)}));case 7:w();case 8:case"end":return e.stop()}}),e)})))},b=function(r){return Jd(d,void 0,void 0,O().mark((function i(){var o,a,s,d,f,m,g,v;return O().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.data.arrayBuffer();case 2:o=i.sent,i.t0=l.__type,i.next="connected"===i.t0?6:"hello_req_sent"===i.t0?30:51;break;case 6:if(i.prev=6,a=o.slice(0,4),(s=new DataView(a).getUint32(0,!1))===c+1){i.next=11;break}throw new Error("Encrypted message has invalid sequence number");case 11:return c=s,i.next=14,rh(o,l.sharedSecret);case 14:d=i.sent,f=y[d.id],delete y[d.id],f.resolve(d.result),i.next=29;break;case 20:if(i.prev=20,i.t1=i.catch(6),!(i.t1 instanceof Zd)){i.next=28;break}m=y[i.t1.jsonRpcMessageId],delete y[i.t1.jsonRpcMessageId],m.reject(i.t1),i.next=29;break;case 28:throw i.t1;case 29:return i.abrupt("break",51);case 30:return i.next=32,ah(o,l.associationPublicKey,l.ecdhPrivateKey);case 32:return g=i.sent,l={__type:"connected",sharedSecret:g},v=new Proxy({},{get:function(e,t){if(null==e[t]){var n=t.toString().replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())})).toLowerCase();e[t]=function(e){return Jd(this,void 0,void 0,O().mark((function r(){var i;return O().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=u++,r.t0=h,r.next=4,nh({id:i,jsonrpc:"2.0",method:n,params:null!=e?e:{}},g);case 4:return r.t1=r.sent,r.t0.send.call(r.t0,r.t1),r.abrupt("return",new Promise((function(e,n){y[i]={resolve:function(r){switch(t){case"authorize":case"reauthorize":var i=r.wallet_uri_base;if(null!=i)try{bh(i)}catch(e){return void n(e)}}e(r)},reject:n}})));case 7:case"end":return r.stop()}}),r)})))}}return e[t]},defineProperty:function(){return!1},deleteProperty:function(){return!1}}),i.prev=35,i.t2=t,i.next=39,e(v);case 39:i.t3=i.sent,(0,i.t2)(i.t3),i.next=46;break;case 43:i.prev=43,i.t4=i.catch(35),n(i.t4);case 46:return i.prev=46,p(),h.close(),i.finish(46);case 50:return i.abrupt("break",51);case 51:case"end":return i.stop()}}),i,null,[[6,20],[35,43,46,50]])})))},w=function(){p&&p(),l={__type:"connecting",associationKeypair:r},void 0===a&&(a=Date.now()),(h=new WebSocket(o,["com.solana.mobilewalletadapter.v1"])).addEventListener("open",m),h.addEventListener("close",g),h.addEventListener("error",v),h.addEventListener("message",b),p=function(){window.clearTimeout(f),h.removeEventListener("open",m),h.removeEventListener("close",g),h.removeEventListener("error",v),h.removeEventListener("message",b)}};w()})));case 13:case"end":return n.stop()}}),n)})))};var wh=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var d=0,h=o-1;(0!==l||d>>0,c[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var f=new Uint8Array(r+(o-p)),y=r;p!==o;)f[y++]=c[p++];return f}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var d=t[i],h=0,p=u-1;(0!==d||h>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=u-r;f!==u&&0===l[f];)f++;for(var y=s.repeat(n);fthis.span)throw new RangeError("indeterminate span");return this.span}},{key:"replicate",value:function(e){var t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}},{key:"fromArray",value:function(e){}}]),e}();function Dh(e,t){return t.property?e+"["+t.property+"]":e}jh.Layout=Ch,jh.nameWithProperty=Dh,jh.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Ch))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=function(){return new e},Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};var Oh=function(e){Q(n,e);var t=X(n);function n(){return R(this,n),t.apply(this,arguments)}return U(n,[{key:"isCount",value:function(){throw new Error("ExternalLayout is abstract")}}]),n}(Ch),zh=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");return(i=t.call(this,-1,r)).elementSpan=e,i}return U(n,[{key:"isCount",value:function(){return!0}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.length-t;return Math.floor(n/this.elementSpan)}},{key:"encode",value:function(e,t,n){return 0}}]),n}(Oh),_h=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ch))throw new TypeError("layout must be a Layout");if(void 0===r)r=0;else if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");return(o=t.call(this,e.span,i||e.property)).layout=e,o.offset=r,o}return U(n,[{key:"isCount",value:function(){return this.layout instanceof Ph||this.layout instanceof Rh}},{key:"decode",value:function(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)}}]),n}(Oh),Ph=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntLE(e,n,this.span),this.span}}]),n}(Ch),Rh=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readUIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeUIntBE(e,n,this.span),this.span}}]),n}(Ch),Bh=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntLE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntLE(e,n,this.span),this.span}}]),n}(Ch),Uh=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),6<(i=t.call(this,e,r)).span)throw new RangeError("span must not exceed 6 bytes");return i}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readIntBE(t,this.span)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeIntBE(e,n,this.span),this.span}}]),n}(Ch),Wh=Math.pow(2,32);function Qh(e){var t=Math.floor(e/Wh);return{hi32:t,lo32:e-t*Wh}}function Yh(e,t){return e*Wh+t}var Fh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Yh(e.readUInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Qh(e);return t.writeUInt32LE(r.lo32,n),t.writeUInt32LE(r.hi32,n+4),8}}]),n}(Ch),Vh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Yh(e.readUInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Qh(e);return t.writeUInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(Ch),Hh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=e.readUInt32LE(t);return Yh(e.readInt32LE(t+4),n)}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Qh(e);return t.writeUInt32LE(r.lo32,n),t.writeInt32LE(r.hi32,n+4),8}}]),n}(Ch),Gh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),Yh(e.readInt32BE(t),e.readUInt32BE(t+4))}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=Qh(e);return t.writeInt32BE(r.hi32,n),t.writeUInt32BE(r.lo32,n+4),8}}]),n}(Ch),qh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatLE(e,n),4}}]),n}(Ch),Zh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,4,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readFloatBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeFloatBE(e,n),4}}]),n}(Ch),Jh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleLE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleLE(e,n),8}}]),n}(Ch),Xh=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,8,e)}return U(n,[{key:"decode",value:function(e,t){return void 0===t&&(t=0),e.readDoubleBE(t)}},{key:"encode",value:function(e,t,n){return void 0===n&&(n=0),t.writeDoubleBE(e,n),8}}]),n}(Ch),Kh=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ch))throw new TypeError("elementLayout must be a Layout");if(!(r instanceof Oh&&r.isCount()||Number.isInteger(r)&&0<=r))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");var a=-1;return!(r instanceof Oh)&&0u.span&&void 0===u.property)throw new Error("fields cannot contain unnamed variable-length layout")}}catch(e){s.e(e)}finally{s.f()}var c=-1;try{c=e.reduce((function(e,t){return e+t.getSpan()}),0)}catch(e){}return(o=t.call(this,c,r)).fields=e,o.decodePrefixes=!!i,o}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;try{n=this.fields.reduce((function(n,r){var i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(e){throw new RangeError("indeterminate span")}return n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n,r=this.makeDestinationObject(),i=se(this.fields);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(void 0!==o.property&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r,i=n,o=0,a=0,s=se(this.fields);try{for(s.s();!(r=s.n()).done;){var u=r.value,c=u.span;if(a=0c&&(c=u.getSpan(t,n)))}o=n,n+=c}}catch(e){s.e(e)}finally{s.f()}return o+a-i}},{key:"fromArray",value:function(e){var t,n=this.makeDestinationObject(),r=se(this.fields);try{for(r.s();!(t=r.n()).done;){var i=t.value;void 0!==i.property&&0i.span?n=-1:0<=n&&(n+=i.span)}}catch(e){r.e(e)}finally{r.f()}}}]),n}(Ch),ep=function(){function e(t){R(this,e),this.property=t}return U(e,[{key:"decode",value:function(){throw new Error("UnionDiscriminator is abstract")}},{key:"encode",value:function(){throw new Error("UnionDiscriminator is abstract")}}]),e}(),tp=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),!(e instanceof Oh&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");return(i=t.call(this,r||e.property||"variant")).layout=e,i}return U(n,[{key:"decode",value:function(e,t){return this.layout.decode(e,t)}},{key:"encode",value:function(e,t,n){return this.layout.encode(e,t,n)}}]),n}(ep),np=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;R(this,n);var a=e instanceof Ph||e instanceof Rh;if(a)e=new tp(new _h(e));else if(e instanceof Oh&&e.isCount())e=new tp(e);else if(!(e instanceof ep))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===r&&(r=null),!(null===r||r instanceof Ch))throw new TypeError("defaultLayout must be null or a Layout");if(null!==r){if(0>r.span)throw new Error("defaultLayout must have constant span");void 0===r.property&&(r=r.replicate("content"))}var s=-1;r&&0<=(s=r.span)&&a&&(s+=e.layout.span),(o=t.call(this,s,i)).discriminator=e,o.usesPrefixDiscriminator=a,o.defaultLayout=r,o.registry={};var u=o.defaultGetSourceVariant.bind(Z(o));return o.getSourceVariant=function(e){return u(e)},o.configGetSourceVariant=function(e){u=e.bind(this)},o}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}},{key:"defaultGetSourceVariant",value:function(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;var t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(var n in this.registry){var r=this.registry[n];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}},{key:"decode",value:function(e,t){var n;void 0===t&&(t=0);var r=this.discriminator,i=r.decode(e,t),o=this.registry[i];if(void 0===o){var a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=r.layout.span),(n=this.makeDestinationObject())[r.property]=i,n[o.property]=this.defaultLayout.decode(e,t+a)}else n=o.decode(e,t);return n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=this.getSourceVariant(e);if(void 0===r){var i=this.discriminator,o=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],t,n),a+o.encode(e[o.property],t,n+a)}return r.encode(e,t,n)}},{key:"addVariant",value:function(e,t,n){var r=new rp(this,e,t,n);return this.registry[e]=r,r}},{key:"getVariant",value:function(e,t){var n=e;return Te.isBuffer(e)&&(void 0===t&&(t=0),n=this.discriminator.decode(e,t)),this.registry[n]}}]),n}(Ch),rp=function(e){Q(n,e);var t=X(n);function n(e,r,i,o){var a;if(R(this,n),!(e instanceof np))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof i&&void 0===o&&(o=i,i=null),i){if(!(i instanceof Ch))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=i.span&&i.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof o)throw new TypeError("variant must have a String property")}var s=e.span;return 0>e.span&&0<=(s=i?i.span:0)&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span),(a=t.call(this,s,o)).union=e,a.variant=r,a.layout=i||null,a}return U(n,[{key:"getSpan",value:function(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);var n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(e,t+n)}},{key:"decode",value:function(e,t){var n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");var r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}},{key:"encode",value:function(e,t,n){void 0===n&&(n=0);var r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);var i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}},{key:"fromArray",value:function(e){if(this.layout)return this.layout.fromArray(e)}}]),n}(Ch);function ip(e){return 0>e&&(e+=4294967296),e}var op=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;if(R(this,n),!(e instanceof Ph||e instanceof Rh))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof r&&void 0===i&&(i=r,r=void 0),4=n)throw new TypeError("bits must be positive integer");var i=8*t.span,o=t.fields.reduce((function(e,t){return e+t.bits}),0);if(n+o>i)throw new Error("bits too long for span remainder ("+(i-o)+" of "+i+" remain)");this.container=t,this.bits=n,this.valueMask=(1<>>this.start}},{key:"encode",value:function(e){if(!Number.isInteger(e)||e!==ip(e&this.valueMask))throw new TypeError(Dh("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);var t=this.container._packedGetValue(),n=ip(e<n&&(n=this.length.decode(e,t)),n}},{key:"decode",value:function(e,t){void 0===t&&(t=0);var n=this.span;return 0>n&&(n=this.length.decode(e,t)),e.slice(t,t+n)}},{key:"encode",value:function(e,t,n){var r=this.length;if(this.length instanceof Oh&&(r=e.length),!Te.isBuffer(e)||r!==e.length)throw new TypeError(Dh("Blob.encode",this)+" requires (length "+r+") Buffer as src");if(n+r>t.length)throw new RangeError("encoding overruns Buffer");return t.write(e.toString("hex"),n,r,"hex"),this.length instanceof Oh&&this.length.encode(r,t,n),r}}]),n}(Ch),cp=function(e){Q(n,e);var t=X(n);function n(e){return R(this,n),t.call(this,-1,e)}return U(n,[{key:"getSpan",value:function(e,t){if(!Te.isBuffer(e))throw new TypeError("b must be a Buffer");void 0===t&&(t=0);for(var n=t;nt.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),t[n+i]=0,i+1}}]),n}(Ch),lp=function(e){Q(n,e);var t=X(n);function n(e,r){var i;if(R(this,n),"string"==typeof e&&void 0===r&&(r=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");return(i=t.call(this,-1,r)).maxSpan=e,i}return U(n,[{key:"getSpan",value:function(e,t){if(!Te.isBuffer(e))throw new TypeError("b must be a Buffer");return void 0===t&&(t=0),e.length-t}},{key:"decode",value:function(e,t,n){void 0===t&&(t=0);var r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return r.copy(t,n),i}}]),n}(Ch),dp=function(e){Q(n,e);var t=X(n);function n(e,r){var i;return R(this,n),(i=t.call(this,0,r)).value=e,i}return U(n,[{key:"decode",value:function(e,t,n){return this.value}},{key:"encode",value:function(e,t,n){return 0}}]),n}(Ch);jh.ExternalLayout=Oh,jh.GreedyCount=zh,jh.OffsetLayout=_h,jh.UInt=Ph,jh.UIntBE=Rh,jh.Int=Bh,jh.IntBE=Uh,jh.Float=qh,jh.FloatBE=Zh,jh.Double=Jh,jh.DoubleBE=Xh,jh.Sequence=Kh,jh.Structure=$h,jh.UnionDiscriminator=ep,jh.UnionLayoutDiscriminator=tp,jh.Union=np,jh.VariantLayout=rp,jh.BitStructure=op,jh.BitField=ap,jh.Boolean=sp,jh.Blob=up,jh.CString=cp,jh.UTF8=lp,jh.Constant=dp,jh.greedy=function(e,t){return new zh(e,t)},jh.offset=function(e,t,n){return new _h(e,t,n)},jh.u8=function(e){return new Ph(1,e)},jh.u16=function(e){return new Ph(2,e)},jh.u24=function(e){return new Ph(3,e)},jh.u32=function(e){return new Ph(4,e)},jh.u40=function(e){return new Ph(5,e)},jh.u48=function(e){return new Ph(6,e)},jh.nu64=function(e){return new Fh(e)},jh.u16be=function(e){return new Rh(2,e)},jh.u24be=function(e){return new Rh(3,e)},jh.u32be=function(e){return new Rh(4,e)},jh.u40be=function(e){return new Rh(5,e)},jh.u48be=function(e){return new Rh(6,e)},jh.nu64be=function(e){return new Vh(e)},jh.s8=function(e){return new Bh(1,e)},jh.s16=function(e){return new Bh(2,e)},jh.s24=function(e){return new Bh(3,e)},jh.s32=function(e){return new Bh(4,e)},jh.s40=function(e){return new Bh(5,e)},jh.s48=function(e){return new Bh(6,e)},jh.ns64=function(e){return new Hh(e)},jh.s16be=function(e){return new Uh(2,e)},jh.s24be=function(e){return new Uh(3,e)},jh.s32be=function(e){return new Uh(4,e)},jh.s40be=function(e){return new Uh(5,e)},jh.s48be=function(e){return new Uh(6,e)},jh.ns64be=function(e){return new Gh(e)},jh.f32=function(e){return new qh(e)},jh.f32be=function(e){return new Zh(e)},jh.f64=function(e){return new Jh(e)},jh.f64be=function(e){return new Xh(e)},jh.struct=function(e,t,n){return new $h(e,t,n)},jh.bits=function(e,t,n){return new op(e,t,n)};var hp=jh.seq=function(e,t,n){return new Kh(e,t,n)};jh.union=function(e,t,n){return new np(e,t,n)},jh.unionLayoutDiscriminator=function(e,t){return new tp(e,t)},jh.blob=function(e,t){return new up(e,t)},jh.cstr=function(e){return new cp(e)},jh.utf8=function(e,t){return new lp(e,t)},jh.const=function(e,t){return new dp(e,t)};var pp={},fp={exports:{}};!function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"===z(e)?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Dn.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===z(e))return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=s(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var d=["","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"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return m(e,t,n)}Math.imul||(y=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?f(this,e,t):n<1024?m(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new T(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function N(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(w,b),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new N(e)},r(N,T),N.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},N.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},N.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},N.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,x)}(fp),function(e){var t=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.map=e.array=e.rustEnum=e.str=e.vecU8=e.tagged=e.vec=e.bool=e.option=e.publicKey=e.i128=e.u128=e.i64=e.u64=e.struct=e.f64=e.f32=e.i32=e.u32=e.i16=e.u16=e.i8=e.u8=void 0;var n=jh,r=Vd,i=t(fp.exports),o=jh;Object.defineProperty(e,"u8",{enumerable:!0,get:function(){return o.u8}}),Object.defineProperty(e,"i8",{enumerable:!0,get:function(){return o.s8}}),Object.defineProperty(e,"u16",{enumerable:!0,get:function(){return o.u16}}),Object.defineProperty(e,"i16",{enumerable:!0,get:function(){return o.s16}}),Object.defineProperty(e,"u32",{enumerable:!0,get:function(){return o.u32}}),Object.defineProperty(e,"i32",{enumerable:!0,get:function(){return o.s32}}),Object.defineProperty(e,"f32",{enumerable:!0,get:function(){return o.f32}}),Object.defineProperty(e,"f64",{enumerable:!0,get:function(){return o.f64}}),Object.defineProperty(e,"struct",{enumerable:!0,get:function(){return o.struct}});var a=function(e){Q(r,e);var t=X(r);function r(e,i,o){var a;return R(this,r),(a=t.call(this,e,o)).blob=n.blob(e),a.signed=i,a}return U(r,[{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new i.default(this.blob.decode(e,t),10,"le");return this.signed?n.fromTwos(8*this.span).clone():n}},{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.signed&&(e=e.toTwos(8*this.span)),this.blob.encode(e.toArrayLike(Te,"le",this.span),t,n)}}]),r}(n.Layout);function s(e){return new a(8,!1,e)}e.u64=s,e.i64=function(e){return new a(8,!0,e)},e.u128=function(e){return new a(16,!1,e)},e.i128=function(e){return new a(16,!0,e)};var u=function(e){Q(n,e);var t=X(n);function n(e,r,i,o){var a;return R(this,n),(a=t.call(this,e.span,o)).layout=e,a.decoder=r,a.encoder=i,a}return U(n,[{key:"decode",value:function(e,t){return this.decoder(this.layout.decode(e,t))}},{key:"encode",value:function(e,t,n){return this.layout.encode(this.encoder(e),t,n)}},{key:"getSpan",value:function(e,t){return this.layout.getSpan(e,t)}}]),n}(n.Layout);e.publicKey=function(e){return new u(n.blob(32),(function(e){return new r.PublicKey(e)}),(function(e){return e.toBuffer()}),e)};var c=function(e){Q(r,e);var t=X(r);function r(e,i){var o;return R(this,r),(o=t.call(this,-1,i)).layout=e,o.discriminator=n.u8(),o}return U(r,[{key:"encode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null==e?this.discriminator.encode(0,t,n):(this.discriminator.encode(1,t,n),this.layout.encode(e,t,n+1)+1)}},{key:"decode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return null;if(1===n)return this.layout.decode(e,t+1);throw new Error("Invalid option "+this.property)}},{key:"getSpan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.discriminator.decode(e,t);if(0===n)return 1;if(1===n)return this.layout.getSpan(e,t+1)+1;throw new Error("Invalid option "+this.property)}}]),r}(n.Layout);function l(e){if(0===e)return!1;if(1===e)return!0;throw new Error("Invalid bool: "+e)}function d(e){return e?1:0}function h(e){var t=n.u32("length"),r=n.struct([t,n.blob(n.offset(t,-t.span),"data")]);return new u(r,(function(e){return e.data}),(function(e){return{data:e}}),e)}e.option=function(e,t){return new c(e,t)},e.bool=function(e){return new u(n.u8(),l,d,e)},e.vec=function(e,t){var r=n.u32("length"),i=n.struct([r,n.seq(e,n.offset(r,-r.span),"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),t)},e.tagged=function(e,t,r){var i=n.struct([s("tag"),t.replicate("data")]);return new u(i,(function(t){var n=t.tag,r=t.data;if(!n.eq(e))throw new Error("Invalid tag, expected: "+e.toString("hex")+", got: "+n.toString("hex"));return r}),(function(t){return{tag:e,data:t}}),r)},e.vecU8=h,e.str=function(e){return new u(h(),(function(e){return e.toString("utf-8")}),(function(e){return Te.from(e,"utf-8")}),e)},e.rustEnum=function(e,t,r){var i=n.union(null!=r?r:n.u8(),t);return e.forEach((function(e,t){return i.addVariant(t,e,e.property)})),i},e.array=function(e,t,r){var i=n.struct([n.seq(e,t,"values")]);return new u(i,(function(e){return e.values}),(function(e){return{values:e}}),r)};var p=function(e){Q(n,e);var t=X(n);function n(e,r,i){var o;return R(this,n),(o=t.call(this,e.span+r.span,i)).keyLayout=e,o.valueLayout=r,o}return U(n,[{key:"decode",value:function(e,t){return t=t||0,[this.keyLayout.decode(e,t),this.valueLayout.decode(e,t+this.keyLayout.getSpan(e,t))]}},{key:"encode",value:function(e,t,n){n=n||0;var r=this.keyLayout.encode(e[0],t,n);return r+this.valueLayout.encode(e[1],t,n+r)}},{key:"getSpan",value:function(e,t){return this.keyLayout.getSpan(e,t)+this.valueLayout.getSpan(e,t)}}]),n}(n.Layout);e.map=function(e,t,r){var i=n.u32("length"),o=n.struct([i,n.seq(new p(e,t),n.offset(i,-i.span),"values")]);return new u(o,(function(e){var t=e.values;return new Map(t)}),(function(e){return{values:Array.from(e.entries())}}),r)}}(pp),ue.Web3MobileWallet;var yp=ue.transact,mp=Dn.Buffer,gp=Cn.exports,vp=pp.struct([pp.publicKey("mint"),pp.publicKey("owner"),pp.u64("amount"),pp.u32("delegateOption"),pp.publicKey("delegate"),pp.u8("state"),pp.u32("isNativeOption"),pp.u64("isNative"),pp.u64("delegatedAmount"),pp.u32("closeAuthorityOption"),pp.publicKey("closeAuthority")]);pp.array;var bp=pp.bool,wp=pp.i128;pp.i16;var Mp=pp.i32,Ap=pp.i64;pp.i8,pp.map;var Ep=pp.option,Tp=pp.publicKey,Np=pp.rustEnum,Ip=pp.str,kp=pp.struct;pp.tagged;var Lp=pp.u128,xp=pp.u16,Sp=pp.u32,jp=pp.u64,Cp=pp.u8,Dp=pp.vec;pp.vecU8;const Op="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0yOTkuMyAyMzcuNSA1MDAgMTIybDIwMC43IDExNS41LTczLjUgNDIuNkw1MDAgMjA4LjJsLTEyNy4xIDcxLjktNzMuNi00Mi42em00MDEuNCAxNDYtNzMuNS00Mi42LTEyNy4xIDczTDM3MyAzNDAuNGwtNzMuNSA0My4xdjg1LjdsMTI3LjEgNzN2MTQ1LjRsNzMuNSA0My4xIDczLjUtNDMuMVY1NDIuMWwxMjcuMS03M3YtODUuNnptMCAyMzIuMXYtODUuN2wtNzMuNSA0Mi42djg1LjdjLS4xLS42IDczLjUtNDIuNiA3My41LTQyLjZ6bTUxLjkgMjkuMy0xMjcuMSA3M3Y4NS43TDgyNi4xIDY4OFY0NTYuNGwtNzMuNSA0My4xdjE0NS40em0tNzMuNS0zMzQuNCA3My41IDQzLjF2ODUuN2w3My41LTQzLjF2LTg1LjdsLTczLjUtNDMuMS03My41IDQzLjF6TTQyNi41IDc0OS40djg1LjdsNzMuNSA0My4xIDczLjUtNDMuMXYtODUuN2wtNzMuNSA0Mi03My41LTQyek0yOTkuMyA2MTUuNmw3My41IDQzLjF2LTg2LjJMMjk5LjMgNTMwdjg1LjZ6bTEyNy4yLTMwNS4xIDczLjUgNDMuMSA3My41LTQzLjEtNzMuNS00Mi42YzAtLjUtNzMuNSA0Mi42LTczLjUgNDIuNnptLTE3OS4xIDQzLjEgNzMuNS00My4xLTczLjUtNDMuMS03My41IDQzLjF2ODUuN2w3My41IDQzLjF2LTg1Ljd6bTAgMTQ1LjQtNzMuNS00Mi42VjY4OGwyMDAuNyAxMTUuNXYtODUuN2wtMTI3LjEtNzNjLS4xLjEtLjEtMTQ1LjgtLjEtMTQ1Ljh6IiBmaWxsPSIjZjBiOTBiIi8+PC9zdmc+",zp="https://app.uniswap.org/static/media/bnb-logo.797868eb94521320b78e3967134febbe.svg";var _p={name:"bsc",id:"0x38",networkId:"56",namespace:"eip155",platform:"evm",label:"BNB Smart Chain",fullName:"BNB Smart Chain Mainnet",logo:Op,logoBackgroundColor:"#000000",logoWhiteBackground:Op,currency:{name:"BNB",symbol:"BNB",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:zp},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png"},stables:{usd:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955"]},explorer:"https://bscscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://bscscan.com/tx/${e.id||e}`:t?`https://bscscan.com/token/${t}`:n?`https://bscscan.com/address/${n}`:void 0,endpoints:["https://bsc-dataseed.binance.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed3.defibit.io"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"BNB",name:"Binance Coin",decimals:18,logo:zp,type:"NATIVE"},{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",name:"Wrapped BNB",decimals:18,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png",type:"20"},{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",name:"Tether USD",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png",type:"20"},{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",name:"USD Coin",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d/logo.png",type:"20"},{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:"ETH",name:"Ethereum Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x2170Ed0880ac9A755fd29B2688956BD959F933F8/logo.png",type:"20"},{address:"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",symbol:"Cake",name:"PancakeSwap Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",type:"20"},{address:"0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",symbol:"BTCB",name:"BTCB Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Pp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAADxdJREFUeJztXVtzFMcVplwuP8VVeYmf7HJ+RKqSl/AQP6X8H+yqXUEIjhMnQY5jO9oVCIzA5mowdzAYG4xAGAyWLC5G3IyDL8gOASUYKrarYGZWC7qi23b6692VV6uZ7e6ZnT3di07VV6JUaLfnnG+6z+lz+vScOXUoL6SzP52/2PtlQ9p7piHlLU2k3P2JJqcjkXLO8589/OdN/tPjvx8VEP8Wv+sp/J8O/A3+Fp+Bz8JnUj/XrPjIwjT7ybxm57fJlLsy2eR2cwPe4QZksYB/Nr4D34XvxHdTP/8DJ+k0e4S/lb9Jpr2WZJNzgRtjPDaDS4DvFmPgY8GYMDZq/dStNKQzv0qmnA1c6RkqgysQIoMxYqzU+qoLWZDO/jyZdl7lir1ObdwQZLiOseMZqPVonSTS7i+4AtsTTW6O2pDR4ebEs/Bnotar8dKw2Pk1n0I76Y0W16zgdOIZqfVsnCSbvaeEB2+AkWpCBEQS/Jmp9U4u3Fl6nIdWB6gNQgb+7NABtR1qLjxcejiZdhfxKXGA3AjUswHXAXQBnVDbpSbCPeO5fAr8hlrxpgE6gW6o7ROb5N96Z3l9ePZxgUcMXEd1NxssbMk8kWxyztEr2A5AV3XjGySb3acTSLYYoFjL4EF31PYLLXwaeyiZcltnp/woEJtIrdAltT21BEkR7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F25LcusVBa0N0OPO5ObWWJsGKO0FdushBckRdDqFP1u0fSYsss5vluMgY8FY7IuYVMPgrbn6H2PCxBEJBHn9Tf8s4UHz78L3zmj5fqsmCG4DAk3YiWbvGfFvYgpdz888EJL/J7Chdkerk8XEP8Wv+vJzyo8EsHf8L/FZ+Czpi5YqjP5P2ey0rAsl+yGAAAAAElFTkSuQmCC",Rp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png";var Bp={name:"ethereum",id:"0x1",networkId:"1",namespace:"eip155",platform:"evm",label:"Ethereum",fullName:"Ethereum Mainnet",logo:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbC1vcGFjaXR5Oi42MDJ9LnN0MCwuc3Qxe2ZpbGw6I2ZmZn08L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik01MTEuNCA3My4zdjMxNS41TDc3OCA1MDggNTExLjQgNzMuM3oiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNTExLjQgNzMuMyAyNDQuNyA1MDhsMjY2LjYtMTE5LjJWNzMuM3oiLz48cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTExLjQgNzEyLjN2MjE0LjVsMjY2LjgtMzY5LjEtMjY2LjggMTU0LjZ6Ii8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTUxMS40IDkyNi43VjcxMi4zTDI0NC43IDU1Ny42bDI2Ni43IDM2OS4xeiIvPjxwYXRoIGQ9Ik01MTEuNCA2NjIuNyA3NzggNTA4IDUxMS40IDM4OC44djI3My45eiIgZmlsbD0iI2ZmZiIgZmlsbC1vcGFjaXR5PSIu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5MzkiLz48L3N2Zz4K",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Pp},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",logo:Rp,logoBackgroundColor:"#FFFFFF"},stables:{usd:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"]},explorer:"https://etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://etherscan.io/tx/${e.id||e}`:t?`https://etherscan.io/token/${t}`:n?`https://etherscan.io/address/${n}`:void 0,endpoints:["https://rpc.ankr.com/eth","https://eth.llamarpc.com","https://ethereum.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Pp,type:"NATIVE"},{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Rp,type:"20"},{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c/logo.png",type:"20"},{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x853d955aCEf822Db058eb8505911ED77F175b99e",symbol:"FRAX",name:"Frax",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x853d955aCEf822Db058eb8505911ED77F175b99e/logo.png",type:"20"},{address:"0x956F47F50A910163D8BF957Cf5846D573E7f87CA",symbol:"FEI",name:"Fei USD",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x956F47F50A910163D8BF957Cf5846D573E7f87CA/logo.png",type:"20"},{address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Up="https://assets.spooky.fi/tokens/FTM.png",Wp="https://assets.spooky.fi/tokens/wFTM.png";var Qp={name:"fantom",id:"0xfa",networkId:"250",namespace:"eip155",label:"Fantom",fullName:"Fantom Opera",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00NjcgMTM1LjVjMTgtOS4zIDQ1LjEtOS4zIDYzIDBsMTgzLjQgOTdjMTAuNyA2LjEgMTYuNiAxNCAxOCAyMy4zdjQ4Ni42YzAgO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jYtMS42LTguNS00LjggMTIuNi0xOS42eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==",currency:{name:"Fantom",symbol:"FTM",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Up},wrapped:{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",logo:Wp},stables:{usd:["0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf","0x1B6382DBDEa11d97f24495C9A90b7c88469134a4"]},explorer:"https://ftmscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://ftmscan.com/tx/${e.id||e}`:t?`https://ftmscan.com/token/${t}`:n?`https://ftmscan.com/address/${n}`:void 0,endpoints:["https://rpc.ftm.tools","https://fantom.publicnode.com","https://rpc2.fantom.network"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"FTM",name:"Fantom",decimals:18,logo:Up,type:"NATIVE"},{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",symbol:"WFTM",name:"Wrapped Fantom",decimals:18,logo:Wp,type:"20"},{address:"0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf",symbol:"lzUSDC",name:"LayerZero USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"},{address:"0x1B6382DBDEa11d97f24495C9A90b7c88469134a4",symbol:"axlUSDC",name:"Axelar Wrapped USDC",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Yp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/info/logo.png",Fp="https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/polygon/assets/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270/logo.png";var Vp={name:"polygon",id:"0x89",networkId:"137",namespace:"eip155",label:"Polygon (POS)",fullName:"Polygon (POS) M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OS40IDUxLjYgMGw5My44IDUzLjljMTQuMSA5LjQgMjUuOCAyNS44IDI1LjggNDYuOXYxMDhjMCAyMS4xLTExLjcgMzcuNS0yNS44IDQ2LjlsLTkzLjggNTYuM2MtMTQuMSA5LjQtMzUuMiA5LjQtNTEuNiAwTDU0MSA0NzUuNGwtODItNDYuOS0xMjQuMi03Mi43Yy0xNC4xLTkuNC0zNS4yLTkuNC01MS42IDAtLjEuMS0xNzEuMiAxMDMuMi0xNzMuNSAxMDMuMnoiIGZpbGw9IiM4MjQ3ZTUiLz48L3N2Zz4=",currency:{name:"Polygon",symbol:"MATIC",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Yp},wrapped:{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",logo:Fp},stables:{usd:["0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"]},explorer:"https://polygonscan.com",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://polygonscan.com/tx/${e.id||e}`:t?`https://polygonscan.com/token/${t}`:n?`https://polygonscan.com/address/${n}`:void 0,endpoints:["https://polygon-rpc.com","https://polygon-pokt.nodies.app","https://polygon.llamarpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"MATIC",name:"Polygon",decimals:18,logo:Yp,type:"NATIVE"},{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",symbol:"WMATIC",name:"Wrapped Matic",decimals:18,logo:Fp,type:"20"},{address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xf6261529C6C2fBEB313aB25cDEcD243613b40EB5",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://depay.com/favicon.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Hp="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDF7ZmlsbDp1cmwoI1NWR0lEXzAwMDAwMDE5Njc2ODQzODE5NzI3MzAwODIwMDAwMDA1OTQ3NjMyODMzODYxMjM4OTE3Xyl9LnN0MntmaWxsOnVybCgjU1ZHSURfMDAwMDAwNjQzMjA1MjE4MTcxODM4NzM1NjAwMDAwMDMxNzkyNDIx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solana",networkId:"solana",namespace:"solana",label:"Solana",fullName:"Solana Mainnet Beta",logo:Hp,logoBackgroundColor:"#000000",logoWhiteBackground:Hp,currency:{name:"Solana",symbol:"SOL",decimals:9,address:"11111111111111111111111111111111",logo:Gp},wrapped:{address:"So11111111111111111111111111111111111111112",logo:Gp},stables:{usd:["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"]},explorer:"https://solscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://solscan.io/tx/${e.id||e}`:t?`https://solscan.io/token/${t}`:n?`https://solscan.io/address/${n}`:void 0,endpoints:["https://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","https://mainnet-beta.solflare.network","https://solana-mainnet.rpc.extrnode.com"],sockets:["wss://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","wss://mainnet-beta.solflare.network"],tokens:[{address:"11111111111111111111111111111111",symbol:"SOL",name:"Solana",decimals:9,logo:Gp,type:"NATIVE"},{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://img.raydium.io/icon/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.png",type:"SPL"},{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",name:"USDT",decimals:6,logo:"https://img.raydium.io/icon/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB.png",type:"SPL"},{address:"7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",symbol:"stSOL",name:"Lido Staked SOL",decimals:9,logo:"https://img.raydium.io/icon/7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj.png",type:"SPL"},{address:"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",symbol:"BONK",name:"BONK",decimals:5,logo:"https://img.raydium.io/icon/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263.png",type:"SPL"},{address:"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",symbol:"SAMO",name:"Samoyed Coin",decimals:9,logo:"https://img.raydium.io/icon/7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU.png",type:"SPL"},{address:"DePay1miDBPWXs6PVQrdC5Vch2jemgEPaiyXLNLLa2NF",symbol:"DEPAY",name:"DePay",decimals:9,logo:"https://depay.com/favicon.png",type:"SPL"}],zero:"0",maxInt:"340282366920938463463374607431768211455"};const Zp="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDF7ZmlsbDojMjEzMTQ3fTwvc3R5bGU+PHBhdGggZD0iTTkyIDkyaDgxNnY4MTZIOTJWOTJ6IiBmaWxsPSJub25lIi8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTE2NS44IDM0MC4xVjY2MGMwIDIwLjYgMTAuOCAzOS4yIDI4LjcgNDkuNmwyNzcuMSAxNTkuOWMxNy42IDEwLjEgMzkuNSAxMC4xIDU3LjEgMGwyNzcuMS0xNTkuOWMxNy42LTEwLjEgMjguNy0yOSAyOC43LTQ5LjZWMzQwLjFjMC0yMC42LTEwLjgtMzkuMi0yOC43LTQ5LjZsLTI3Ny4xLTE2MGMtMTcuNi0xMC4xLTM5LjUtMTAuMS01Ny4xIDBsLTI3Ny4xIDE2MGMtMTcuNiAxMC4xLTI4LjQgMjktMjguNCA0OS42aC0uM3oiLz48cGF0aCBkPSJtNTYwLjQgN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C41IDMwMi4yaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOEwyMjIuOSA3NTcuNWw3OC42IDQ1LjRMNDgxLjEgMzExYzEuNi00LjYtMS42LTkuMS02LjItOS4xbC0uNC4zem0xMzMuMiAwaC03Ni4xYy01LjUgMC0xMC44IDMuNi0xMi43IDguOGwtMTg2IDUwOS44IDc4LjYgNDUuNEw2MTMuOSAzMTFjMS42LTQuNi0xLjYtOS4xLTYuMi05LjF2LjN6IiBmaWxsPSIjZmZmIi8+PC9zdmc+Cg==";var Jp={name:"arbitrum",id:"0xa4b1",networkId:"42161",namespace:"eip155",platform:"evm",label:"Arbitrum",fullName:"Arbitrum One",logo:Zp,logoBackgroundColor:"#2b354d",logoWhiteBackground:Zp,currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Bp.currency.logo},wrapped:{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",logo:Bp.wrapped.logo},stables:{usd:["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"]},explorer:"https://arbiscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://arbiscan.io/tx/${e.id||e}`:t?`https://arbiscan.io/token/${t}`:n?`https://arbiscan.io/address/${n}`:void 0,endpoints:["https://arbitrum.blockpi.network/v1/rpc/public","https://arbitrum-one.publicnode.com","https://endpoints.omniatech.io/v1/arbitrum/one/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Bp.currency.logo,type:"NATIVE"},{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Bp.wrapped.logo,type:"20"},{address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8/logo.png",type:"20"},{address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1/logo.png",type:"20"},{address:"0x912CE59144191C1204E64559FE8253a0e49E6548",symbol:"ARB",name:"Arbitrum",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x912CE59144191C1204E64559FE8253a0e49E6548/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const Xp="https://traderjoexyz.com/static/media/avalanche.7c81486190237e87e238c029fd746008.svg",Kp="https://raw.githubusercontent.com/traderjoe-xyz/joe-tokenlists/main/logos/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7/logo.png";var $p={name:"avalanche",id:"0xa86a",networkId:"43114",namespace:"eip155",platform:"evm",label:"Avalanche",fullName:"Avalanche C-Chain",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik0zNTkuMSA3NTEuMWgtOTUuM2MtMjAgMC0yOS45IDAtMzYtMy44LTYuNi00LjMtMTAuNC0xMS4zLTEwLjktMTguOS0uMy03LjEgNC42LTE1LjggMTQuNC0zM2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address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Xp},wrapped:{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",logo:Kp},stables:{usd:["0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7","0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"]},explorer:"https://snowtrace.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://snowtrace.io/tx/${e.id||e}`:t?`https://snowtrace.io/token/${t}`:n?`https://snowtrace.io/address/${n}`:void 0,endpoints:["https://avalanche.public-rpc.com","https://avalanche.blockpi.network/v1/rpc/public","https://avax.meowrpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"AVAX",name:"Avalanche",decimals:18,logo:Xp,type:"NATIVE"},{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",symbol:"WAVAX",name:"Wrapped AVAX",decimals:18,logo:Kp,type:"20"},{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7/logo.png",type:"20"},{address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E/logo.png",type:"20"},{address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70/logo.png",type:"20"},{address:"0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",symbol:"EUROC",name:"EURO Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/assets/0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const ef="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAC7CAMAAAAKTh9YAAAAYFBMVEVHcEz////////////////////////////////////j++ma6qVj5nsl5lAK4zpA6mXO79aD8Zyr87uCvq0J2TkItEkOhl4EeVsKzSwLrxMNtQpjsZG42dEeuxyF2oU6wzjPwJjeAAAACnRSTlMAEUB9r9j/YO+Kf6/iMwAABD1JREFUeAHU1EESQjEMAlBIAq33v7ArV7+OLss7AZOB4IDVI/kW0nQRf+Ca7QvNwg/s7VtpGJP8oPFNybdT4aidoPHEcYZn6ymnEEOjH8KPk0zeTI+DLacpfMhpxKTGnFtDB9o8/Jisw8uxh1/OtGIrYw9Ah9pEOVWhnaoxTvWCnErR2Z3rzX59JMYOAkEYXr1gRJfIzP1PalbOpZm2aEf+tcKnCCz7bS37si/7si/7si/7si/7srvRHAE5kJHdbV4wkn076Q9RMMLu04fYnceT/An9JnhMkr19Ezwvvvee73ieOL1dfdN15yQlwas2S7vbgTn4iLfaDO0emIPPeLtgZt+AOfhcQHJGdieYg88VLG9k98AUfG7gBRu7YAo+9wpeNLEnYAY+915wkIndQ4Xn9IajgoV9hwbP6b3iqGRhF5zH537VHi3swGl87tft3tB+Ap/7Z9lFhef0z3hndmjwnP4Z32qEAs/po4//Rwao8JzeC3hiMyeACs/ppnMCUlThOf3wxjurObAKz+kHNz5arT0CNHhO5zde7NZ8UYXn9N4K2Utnt8NzOsFL+Kuz2+EJneA5nduN8bmTWsXzKqNzuyX+FZ3rL43Sud0Un/txtV7KqNY+6Hq7Kb71Gxt0W7seX5od/Z6a+8BuGASCMMwraRK4103A9z9leq+Q3zCYC+h7oy7tbr6d4zGd2zme04Ed4AEd2AEe0Km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6gyi9vxPc+NhxeALcFD2U/7oVatdNeLsWkQT64Vn62R4rQo8FF7YivNIPf+Q8VGHjvxm7kXCxR4/oD6F46lvgSOHAsyEYS2KngdLUdv1cYKcxpyQkjc5KvOPYFLzN7Z+dGJy/Gzdfe4TNmno97GMndPovRV84cqml25X1UVmKPO+js1mhq4q6x860FD09EV1+cz+K/9wD7qyIPUbR0+V7/qEr8Pdeh+orrfp7GrlpulLWR2PLb2y1diRvxh8+F4VPmx35Q6s3PApLXQg+H0B5Ti8EvDuiX6e/+pUVq2Kv5/ZFH3rZ0tW4m4l2COitbJ/NbYWlFdZ/9216wpkWeuKJRfvvJ7l4QzhDYhfOkNiFMyR24QyJXThDYhfOkNiFMyR24QyJXThDYhfOkNiFMyR24QyJXThDYhfOkNiFMyj2OQhhvzkPIeYhhO105zr28G0IYTsVfuRBYQZC2C7EjKdn7RK7sJ+HaQ+lKHaZtwu7lWhkn5mk0GV0Fzabps4r6+xh+AqEsNdx+k8l9gAnIFMZYaNQH0c682I0mFdip6lMGP4KQthGhdPxmyunCwSYhIzuwjZlvBC/uRK7jO7CNkqHPjM5F/9x9YlgNLqHcq6MsAB1fPrFiep3rY6dRncvPAYhuKvTsV/zQef+MYedDyr9GDAGITii6cvpyeO1727kwI9f048FRyEEK+EJnJl8rN7fNL54oxwco5NnIAQX1GsZDafhat0bj44PwlMn9UeNQgiTUehB+Mit01/qWv+yPLohfQKoExDCWHrq0iR0sv7IXu3g+ARC9TyEMEn0ZHT1EmPjD23FwfExBOplfathCJEnWken5cXTk9MbvUlrscdklBd5oWumPX2kv6QPgDaZtqzVXuxkdHwYvtLR42EZ6UXqOog81n7s1faPP6k/0xNyIEokigJX4Yx+/Up0GnqbkceSiT1GS5UFvUwZYEx/5n36ixzW/8SgjPyiqeicrHC+sgGAmtGRvx1dMtph4NW+AiZycfiu2QTRAAAAAElFTkSuQmCC";var nf={name:"gnosis",id:"0x64",networkId:"100",namespace:"eip155",label:"Gnosis",fullName:"Gnosis Chain",log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4yLTMzLjQtMzMuOGMtNDAuNiA2Ni42LTYxLjggMTQzLTYxLjggMjIxLjIgMCAyMzUuNSAxOTEuMSA0MjYuNiA0MjYuNiA0MjYuNlM5MjYuNiA3MzUuNSA5MjYuNiA1MDBjLjQtNzcuOC0yMS41LTE1NC42LTYxLjQtMjIxLjJ6Ii8+PHBhdGggY2xhc3M9InN0MCIgZD0iTTgwOC42IDIwNS41QzY0Ni4xIDM1LjEgMzc2LjEgMjguNyAyMDUuOCAxOTEuMWMtNS4xIDQuOC05LjkgOS42LTE0LjMgMTQuMy0xMC42IDExLjMtMjAuNSAyMi45LTMwIDM0LjhMNTAwIDU3OC44bDMzOC42LTMzOC42Yy05LjItMTIuMi0xOS41LTIzLjgtMzAtMzQuN3pNNTAwIDEyOWM5OS43IDAgMTkyLjUgMzguNiAyNjIuNSAxMDguNUw1MDAgNTAwIDIzNy41IDIzNy41QzMwNy4yIDE2Ny4yIDQwMC4zIDEyOSA1MDAgMTI5eiIvPjwvc3ZnPgo=",currency:{name:"xDAI",symbol:"xDAI",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:ef},wrapped:{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",logo:tf},stables:{usd:["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83"]},explorer:"https://gnosisscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://gnosisscan.io/tx/${e.id||e}`:t?`https://gnosisscan.io/token/${t}`:n?`https://gnosisscan.io/address/${n}`:void 0,endpoints:["https://rpc.gnosis.gateway.fm","https://rpc.gnosischain.com","https://gnosis.blockpi.network/v1/rpc/public"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"xDAI",name:"xDAI",decimals:18,logo:ef,type:"NATIVE"},{address:"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",symbol:"WXDAI",name:"Wrapped XDAI",decimals:18,logo:tf,type:"20"},{address:"0x4ECaBa5870353805a9F068101A40E0f32ed605C6",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",symbol:"GNO",name:"Gnosis",decimals:18,logo:"https://cdn.sushi.com/image/upload/f_auto,c_limit,w_16,q_auto/tokens/100/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb.jpg",type:"20"},{address:"0xD057604A14982FE8D88c5fC25Aac3267eA142a08",symbol:"HOPR",name:"HOPR",decimals:18,logo:"https://hoprnet.org/assets/icons/hopr_icon.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var rf={name:"optimism",id:"0xa",networkId:"10",namespace:"eip155",label:"Optimism",fullName:"Optimism",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00ODcuMSAzOTUuN2MtNS4yLTE1LjgtMTMuMi0zMS43LTI2LjQtNDIuMi0xMy4yLTEwLjUtMjYuNC0yMS4yLTQ0LjktMjYuNC0xOC41LTUuMi0zNy04LTU4LjEtOC00Ny41IDAtODcuMSAxMC41LTExNi4xIDM0LjQtMjkgMjMuOC00Ny41IDU4LjEtNjAuNyAxMDIuOS0yLjY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1MDkgNjAzLjVjLS40IDIuMiAwIDQgMS4yIDUuNXptMTExLjItMTEzLjFoLTM0LjdsMTEuOC01NGgzNi4yYzcuMiAwIDEyLjYgMS4yIDE2IDMuNiAzLjYgMi40IDUuNyA1LjYgNi4zIDkuNi42IDQgLjQgOC42LS42IDEzLjktMiA5LTYuMyAxNS44LTEzIDIwLjItNi40IDQuNS0xMy44IDYuNy0yMiA2Ljd6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2ZmMDQyMCIvPjwvc3ZnPg==",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Bp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Bp.wrapped.logo},stables:{usd:["0x94b008aA00579c1307B0EF2c499aD98a8ce58e58","0x7F5c764cBc14f9669B88837ca1490cCa17c31607"]},explorer:"https://optimistic.etherscan.io",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://optimistic.etherscan.io/tx/${e.id||e}`:t?`https://optimistic.etherscan.io/token/${t}`:n?`https://optimistic.etherscan.io/address/${n}`:void 0,endpoints:["https://optimism.blockpi.network/v1/rpc/public","https://optimism.meowrpc.com","https://optimism.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Bp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Bp.wrapped.logo,type:"20"},{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:"USDT",name:"Tether",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58/logo.png",type:"20"},{address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/assets/0x7F5c764cBc14f9669B88837ca1490cCa17c31607/logo.png",type:"20"},{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x4200000000000000000000000000000000000042",symbol:"OP",name:"Optimism",decimals:18,logo:"https://user-images.githubusercontent.com/1300064/219575413-d7990d69-1d21-44ef-a2b1-e9c682c79802.svg",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};var of={name:"base",id:"0x2105",networkId:"8453",namespace:"eip155",label:"Base",fullName:"Base",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguNiA4NDJDNjg4IDg0MiA4NDIgNjg4LjkgODQyIDQ5OS41UzY4OCAxNTcgNDk4LjYgMTU3QzMxOSAxNTcgMTcxLjIgMjk1LjEgMTU3IDQ3MC4zaDQ1My4xdjU3LjVIMTU3QzE3MiA3MDMuOSAzMTkgODQyIDQ5OC42IDg0MnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",logoBackgroundColor:"#0052FF",logoWhiteBackground:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGQ9Ik00OTguOSA4NDVDNjkwLjEgODQ1IDg0NSA2OTAuMyA4NDUgNDk5LjVTNjkwLjEgMTU0IDQ5OC45IDE1NEMzMTcuNiAxNTQgMTY4LjggMjkzLjMgMTU0IDQ3MC41aDQ1Ny40djU4LjFIMTU0QzE2OC44IDcwNS44IDMxNy42IDg0NSA0OTguOSA4NDV6IiBmaWxsPSIjMDA1MmZmIi8+PC9zdmc+",currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",logo:Bp.currency.logo},wrapped:{address:"0x4200000000000000000000000000000000000006",logo:Bp.wrapped.logo},stables:{usd:["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"]},explorer:"https://basescan.org",explorerUrlFor:({transaction:e,token:t,address:n})=>e?`https://basescan.org/tx/${e.id||e}`:t?`https://basescan.org/token/${t}`:n?`https://basescan.org/address/${n}`:void 0,endpoints:["https://base.blockpi.network/v1/rpc/public","https://base.meowrpc.com","https://mainnet.base.org"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:Bp.currency.logo,type:"NATIVE"},{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:Bp.wrapped.logo,type:"20"},{address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",symbol:"USDbC",name:"USD Base Coin",decimals:6,logo:"https://ethereum-optimism.github.io/data/USDC/logo.png",type:"20"},{address:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const af=[Bp,_p,Vp,qp,Qp,Jp,$p,nf,rf,of];var sf={ethereum:Bp,bsc:_p,polygon:Vp,solana:qp,fantom:Qp,arbitrum:Jp,avalanche:$p,gnosis:nf,optimism:rf,base:of,all:af,findById:function(e){let t=e;return t.match("0x0")&&(t=t.replace(/0x0+/,"0x")),af.find((e=>e.id&&e.id.toLowerCase()==t.toLowerCase()))},findByNetworkId:function(e){return e=e.toString(),af.find((t=>t.networkId==e))},findByName:function(e){return af.find((t=>t.name==e))}},uf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lf(e){var t={exports:{}};return e(t,t.exports),t.exports}for(var df=function(e){var t=wf(e),n=t[0],r=t[1];return 3*(n+r)/4-r},hf=function(e){var t,n,r=wf(e),i=r[0],o=r[1],a=new mf(function(e,t,n){return 3*(t+n)/4-n}(0,i,o)),s=0,u=o>0?i-4:i;for(n=0;n>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=yf[e.charCodeAt(n)]<<2|yf[e.charCodeAt(n+1)]>>4,a[s++]=255&t);1===o&&(t=yf[e.charCodeAt(n)]<<10|yf[e.charCodeAt(n+1)]<<4|yf[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},pf=function(e){for(var t,n=e.length,r=n%3,i=[],o=16383,a=0,s=n-r;as?s:a+o));1===r?(t=e[n-1],i.push(ff[t>>2]+ff[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(ff[t>>10]+ff[t>>4&63]+ff[t<<2&63]+"="));return i.join("")},ff=[],yf=[],mf="undefined"!=typeof Uint8Array?Uint8Array:Array,gf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vf=0,bf=gf.length;vf0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function Mf(e,t,n){for(var r,i,o=[],a=t;a>18&63]+ff[i>>12&63]+ff[i>>6&63]+ff[63&i]);return o.join("")}yf["-".charCodeAt(0)]=62,yf["_".charCodeAt(0)]=63;var Af={byteLength:df,toByteArray:hf,fromByteArray:pf},Ef=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},Tf=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=f,a/=256,c-=8);e[n+p-f]|=128*y},Nf=lf((function(e,t){var n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},t.INSPECT_MAX_BYTES=50;var r=2147483647;function i(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|h(e,t),r=i(n),a=r.write(e,t);a!==n&&(r=r.slice(0,a));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(R(e,Uint8Array)){var t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(R(e,ArrayBuffer)||e&&R(e.buffer,ArrayBuffer))return l(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(R(e,SharedArrayBuffer)||e&&R(e.buffer,SharedArrayBuffer)))return l(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,n);var a=function(e){if(o.isBuffer(e)){var t=0|d(e.length),n=i(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||B(e.length)?i(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return s(e),i(e<0?0:0|d(e))}function c(e){for(var t=e.length<0?0:0|d(e.length),n=i(t),r=0;r=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||R(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return _(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var d=!0,h=0;hi&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?Af.fromByteArray(e):Af.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?o.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else{if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,n,r,i){if(R(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(a,s),c=this.slice(r,i),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":case"latin1":case"binary":return b(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function S(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function C(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,4),Tf(e,t,n,r,23,4),n+4}function D(e,t,n,r,i){return t=+t,n>>>=0,i||j(e,0,n,8),Tf(e,t,n,r,52,8),n+8}o.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),Ef(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),Ef(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),Ef(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),Ef(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||S(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r)||S(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,n){return C(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return C(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function _(e){return Af.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function P(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function R(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function B(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()})),If=lf((function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Nf.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function u(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=s(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var d=["","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"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function g(e,t,n){return m(e,t,n)}Math.imul||(y=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?f(this,e,t):n<1024?m(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new T(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function N(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(w,b),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return v[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},T.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),p=this.pow(e,o),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new N(e)},r(N,T),N.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},N.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},N.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},N.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,uf)})); /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */let kf=!1,Lf=!1;const xf={debug:1,default:2,info:2,warning:3,error:4,off:5};let Sf=xf.default,jf=null;const Cf=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Df,Of;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Df||(Df={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Of||(Of={}));const zf="0123456789abcdef";class _f{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==xf[n]&&this.throwArgumentError("invalid log level name","logLevel",e),Sf>xf[n]||console.log.apply(console,t)}debug(...e){this._log(_f.levels.DEBUG,e)}info(...e){this._log(_f.levels.INFO,e)}warn(...e){this._log(_f.levels.WARNING,e)}makeError(e,t,n){if(Lf)return this.makeError("censored error",t,{});t||(t=_f.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e>4],n+=zf[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(t){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const i=e;let o="";switch(t){case Of.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case Of.CALL_EXCEPTION:case Of.INSUFFICIENT_FUNDS:case Of.MISSING_NEW:case Of.NONCE_EXPIRED:case Of.REPLACEMENT_UNDERPRICED:case Of.TRANSACTION_REPLACED:case Of.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(n).forEach((function(e){a[e]=n[e]})),a}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,_f.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){Cf&&this.throwError("platform missing String.prototype.normalize",_f.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Cf})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,_f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,_f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",et&&this.throwError("too many arguments"+n,_f.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",_f.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",_f.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",_f.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return jf||(jf=new _f("logger/5.7.0")),jf}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",_f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),kf){if(!e)return;this.globalLogger().throwError("error censorship permanent",_f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Lf=!!e,kf=!!t}static setLogLevel(e){const t=xf[e.toLowerCase()];null!=t?Sf=t:_f.globalLogger().warn("invalid log level - "+e)}static from(e){return new _f(e)}}_f.errors=Of,_f.levels=Df;const Pf=new _f("bytes/5.7.0");function Rf(e){return!!e.toHexString}function Bf(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Bf(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Uf(e){return Gf(e)&&!(e.length%2)||Qf(e)}function Wf(e){return"number"==typeof e&&e==e&&e%1==0}function Qf(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Wf(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Yf(e,t){if(t||(t={}),"number"==typeof e){Pf.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),Bf(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Rf(e)&&(e=e.toHexString()),Gf(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":Pf.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;eYf(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),Bf(r)}function Vf(e){let t=Yf(e);if(0===t.length)return t;let n=0;for(;nt&&Pf.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),Bf(n)}function Gf(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const qf="0123456789abcdef";function Zf(e,t){if(t||(t={}),"number"==typeof e){Pf.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=qf[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Rf(e))return e.toHexString();if(Gf(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":Pf.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(Qf(e)){let t="0x";for(let n=0;n>4]+qf[15&r]}return t}return Pf.throwArgumentError("invalid hexlify value","value",e)}function Jf(e){if("string"!=typeof e)e=Zf(e);else if(!Gf(e)||e.length%2)return null;return(e.length-2)/2}function Xf(e,t,n){return"string"!=typeof e?e=Zf(e):(!Gf(e)||e.length%2)&&Pf.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function Kf(e){let t="0x";return e.forEach((e=>{t+=Zf(e).substring(2)})),t}function $f(e){const t=function(e){"string"!=typeof e&&(e=Zf(e));Gf(e)||Pf.throwArgumentError("invalid hex string","value",e);e=e.substring(2);let t=0;for(;t2*t+2&&Pf.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function ty(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Uf(e)){let n=Yf(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=Zf(n.slice(0,32)),t.s=Zf(n.slice(32,64))):65===n.length?(t.r=Zf(n.slice(0,32)),t.s=Zf(n.slice(32,64)),t.v=n[64]):Pf.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:Pf.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=Zf(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=Hf(Yf(t._vs),32);t._vs=Zf(n);const r=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&Pf.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const i=Zf(n);null==t.s?t.s=i:t.s!==i&&Pf.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?Pf.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&Pf.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Gf(t.r)?t.r=ey(t.r,32):Pf.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Gf(t.s)?t.s=ey(t.s,32):Pf.throwArgumentError("signature missing or invalid s","signature",e);const n=Yf(t.s);n[0]>=128&&Pf.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const r=Zf(n);t._vs&&(Gf(t._vs)||Pf.throwArgumentError("signature invalid _vs","signature",e),t._vs=ey(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&Pf.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}const ny="bignumber/5.7.0";var ry=If.BN;const iy=new _f(ny),oy={},ay=9007199254740991;let sy=!1;class uy{constructor(e,t){e!==oy&&iy.throwError("cannot call constructor directly; use BigNumber.from",_f.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ly(dy(this).fromTwos(e))}toTwos(e){return ly(dy(this).toTwos(e))}abs(){return"-"===this._hex[0]?uy.from(this._hex.substring(1)):this}add(e){return ly(dy(this).add(dy(e)))}sub(e){return ly(dy(this).sub(dy(e)))}div(e){return uy.from(e).isZero()&&hy("division-by-zero","div"),ly(dy(this).div(dy(e)))}mul(e){return ly(dy(this).mul(dy(e)))}mod(e){const t=dy(e);return t.isNeg()&&hy("division-by-zero","mod"),ly(dy(this).umod(t))}pow(e){const t=dy(e);return t.isNeg()&&hy("negative-power","pow"),ly(dy(this).pow(t))}and(e){const t=dy(e);return(this.isNegative()||t.isNeg())&&hy("unbound-bitwise-result","and"),ly(dy(this).and(t))}or(e){const t=dy(e);return(this.isNegative()||t.isNeg())&&hy("unbound-bitwise-result","or"),ly(dy(this).or(t))}xor(e){const t=dy(e);return(this.isNegative()||t.isNeg())&&hy("unbound-bitwise-result","xor"),ly(dy(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&hy("negative-width","mask"),ly(dy(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&hy("negative-width","shl"),ly(dy(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&hy("negative-width","shr"),ly(dy(this).shrn(e))}eq(e){return dy(this).eq(dy(e))}lt(e){return dy(this).lt(dy(e))}lte(e){return dy(this).lte(dy(e))}gt(e){return dy(this).gt(dy(e))}gte(e){return dy(this).gte(dy(e))}isNegative(){return"-"===this._hex[0]}isZero(){return dy(this).isZero()}toNumber(){try{return dy(this).toNumber()}catch(e){hy("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return iy.throwError("this platform does not support BigInt",_f.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?sy||(sy=!0,iy.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?iy.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",_f.errors.UNEXPECTED_ARGUMENT,{}):iy.throwError("BigNumber.toString does not accept parameters",_f.errors.UNEXPECTED_ARGUMENT,{})),dy(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof uy)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new uy(oy,cy(e)):e.match(/^-?[0-9]+$/)?new uy(oy,cy(new ry(e))):iy.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&hy("underflow","BigNumber.from",e),(e>=ay||e<=-ay)&&hy("overflow","BigNumber.from",e),uy.from(String(e));const t=e;if("bigint"==typeof t)return uy.from(t.toString());if(Qf(t))return uy.from(Zf(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return uy.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Gf(e)||"-"===e[0]&&Gf(e.substring(1))))return uy.from(e)}return iy.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function cy(e){if("string"!=typeof e)return cy(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&iy.throwArgumentError("invalid hex","value",e),"0x00"===(e=cy(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function ly(e){return uy.from(cy(e))}function dy(e){const t=uy.from(e).toHexString();return"-"===t[0]?new ry("-"+t.substring(3),16):new ry(t.substring(2),16)}function hy(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),iy.throwError(e,_f.errors.NUMERIC_FAULT,r)}const py=new _f(ny),fy={},yy=uy.from(0),my=uy.from(-1);function gy(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),py.throwError(e,_f.errors.NUMERIC_FAULT,i)}let vy="0";for(;vy.length<256;)vy+=vy;function by(e){if("number"!=typeof e)try{e=uy.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+vy.substring(0,e):py.throwArgumentError("invalid decimal size","decimals",e)}function wy(e,t){null==t&&(t=0);const n=by(t),r=(e=uy.from(e)).lt(yy);r&&(e=e.mul(my));let i=e.mod(n).toString();for(;i.length2&&py.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>n.length-1&&gy("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?r:(typeof e[t]!==n&&py.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&py.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&py.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new Ay(fy,t,n,r)}}class Ey{constructor(e,t,n,r){e!==fy&&py.throwError("cannot use FixedNumber constructor; use FixedNumber.from",_f.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&py.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=My(this._value,this.format.decimals),n=My(e._value,e.format.decimals);return Ey.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=My(this._value,this.format.decimals),n=My(e._value,e.format.decimals);return Ey.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=My(this._value,this.format.decimals),n=My(e._value,e.format.decimals);return Ey.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=My(this._value,this.format.decimals),n=My(e._value,e.format.decimals);return Ey.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Ey.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(Ty.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Ey.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(Ty.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&py.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=Ey.from("1"+vy.substring(0,e),this.format),r=Ny.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&py.throwArgumentError("invalid byte width","width",e);return ey(uy.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Ey.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||function(e){return null!=e&&(uy.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Gf(e)||"bigint"==typeof e||Qf(e))}(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),Ey.fromString(wy(e,t),Ay.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=Ay.from(t),r=My(e,n.decimals);!n.signed&&r.lt(yy)&&gy("unsigned value cannot be negative","overflow","value",e);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=ey(i,n.width/8));const o=wy(r,n.decimals);return new Ey(fy,i,o,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=Ay.from(t);if(Yf(e).length>n.width/8)throw new Error("overflow");let r=uy.from(e);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),o=wy(r,n.decimals);return new Ey(fy,i,o,n)}static from(e,t){if("string"==typeof e)return Ey.fromString(e,t);if(Qf(e))return Ey.fromBytes(e,t);try{return Ey.fromValue(e,0,t)}catch(e){if(e.code!==_f.errors.INVALID_ARGUMENT)throw e}return py.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const Ty=Ey.from(1),Ny=Ey.from("0.5");var Iy=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const ky=new _f("properties/5.7.0");function Ly(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function xy(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Sy(e){return Iy(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function jy(e){const t={};for(const n in e)t[n]=e[n];return t}const Cy={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Dy(e){if(null==e||Cy[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;nzy(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&Ly(t,n,zy(r))}return t}return ky.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function zy(e){return Oy(e)}class _y{constructor(e){for(const t in e)this[t]=zy(e[t])}}const Py="abi/5.7.0",Ry=new _f(Py),By={};let Uy={calldata:!0,memory:!0,storage:!0},Wy={calldata:!0,memory:!0};function Qy(e,t){if("bytes"===e||"string"===e){if(Uy[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Wy[t])return!0;return(Uy[t]||"payable"===t)&&Ry.throwArgumentError("invalid modifier","name",t),!1}function Yy(e,t){for(let n in t)Ly(e,n,t[n])}const Fy=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Vy=new RegExp(/^(.*)\[([0-9]*)\]$/);class Hy{constructor(e,t){e!==By&&Ry.throwError("use fromString",_f.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Yy(this,t);let n=this.type.match(Vy);Yy(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Hy.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Fy.sighash),Fy[e]||Ry.throwArgumentError("invalid format type","format",e),e===Fy.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Fy.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Fy.full?", ":",")+")"):t+=this.type,e!==Fy.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Fy.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Hy.fromString(e,t):Hy.fromObject(e)}static fromObject(e){return Hy.isParamType(e)?e:new Hy(By,{name:e.name||null,type:rm(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Hy.fromObject):null})}static fromString(e,t){return n=function(e,t){let n=e;function r(t){Ry.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let n=0;nHy.fromString(e,t)))}class qy{constructor(e,t){e!==By&&Ry.throwError("use a static from method",_f.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Yy(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return qy.isFragment(e)?e:"string"==typeof e?qy.fromString(e):qy.fromObject(e)}static fromObject(e){if(qy.isFragment(e))return e;switch(e.type){case"function":return em.fromObject(e);case"event":return Zy.fromObject(e);case"constructor":return $y.fromObject(e);case"error":return nm.fromObject(e);case"fallback":case"receive":return null}return Ry.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Zy.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?em.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?$y.fromString(e.trim()):"error"===e.split(" ")[0]?nm.fromString(e.substring(5).trim()):Ry.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Zy extends qy{format(e){if(e||(e=Fy.sighash),Fy[e]||Ry.throwArgumentError("invalid format type","format",e),e===Fy.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Fy.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Fy.full?", ":",")+") ",e!==Fy.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Zy.fromString(e):Zy.fromObject(e)}static fromObject(e){if(Zy.isEventFragment(e))return e;"event"!==e.type&&Ry.throwArgumentError("invalid event object","value",e);const t={name:om(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Hy.fromObject):[],type:"event"};return new Zy(By,t)}static fromString(e){let t=e.match(am);t||Ry.throwArgumentError("invalid event string","value",e);let n=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:Ry.warn("unknown modifier: "+e)}})),Zy.fromObject({name:t[1].trim(),anonymous:n,inputs:Gy(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Jy(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&Ry.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||Ry.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=uy.from(n[1]),n[0]):e}function Xy(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Ky(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Ry.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Ry.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Ry.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Ry.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Ry.throwArgumentError("unable to determine stateMutability","value",e),t}class $y extends qy{format(e){if(e||(e=Fy.sighash),Fy[e]||Ry.throwArgumentError("invalid format type","format",e),e===Fy.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Fy.sighash&&Ry.throwError("cannot format a constructor for sighash",_f.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Fy.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?$y.fromString(e):$y.fromObject(e)}static fromObject(e){if($y.isConstructorFragment(e))return e;"constructor"!==e.type&&Ry.throwArgumentError("invalid constructor object","value",e);let t=Ky(e);t.constant&&Ry.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Hy.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?uy.from(e.gas):null};return new $y(By,n)}static fromString(e){let t={type:"constructor"},n=(e=Jy(e,t)).match(am);return n&&"constructor"===n[1].trim()||Ry.throwArgumentError("invalid constructor string","value",e),t.inputs=Gy(n[2].trim(),!1),Xy(n[3].trim(),t),$y.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class em extends $y{format(e){if(e||(e=Fy.sighash),Fy[e]||Ry.throwArgumentError("invalid format type","format",e),e===Fy.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Fy.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Fy.full?", ":",")+") ",e!==Fy.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?em.fromString(e):em.fromObject(e)}static fromObject(e){if(em.isFunctionFragment(e))return e;"function"!==e.type&&Ry.throwArgumentError("invalid function object","value",e);let t=Ky(e);const n={type:e.type,name:om(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Hy.fromObject):[],outputs:e.outputs?e.outputs.map(Hy.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?uy.from(e.gas):null};return new em(By,n)}static fromString(e){let t={type:"function"},n=(e=Jy(e,t)).split(" returns ");n.length>2&&Ry.throwArgumentError("invalid function string","value",e);let r=n[0].match(am);if(r||Ry.throwArgumentError("invalid function signature","value",e),t.name=r[1].trim(),t.name&&om(t.name),t.inputs=Gy(r[2],!1),Xy(r[3].trim(),t),n.length>1){let r=n[1].match(am);""==r[1].trim()&&""==r[3].trim()||Ry.throwArgumentError("unexpected tokens","value",e),t.outputs=Gy(r[2],!1)}else t.outputs=[];return em.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function tm(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Ry.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class nm extends qy{format(e){if(e||(e=Fy.sighash),Fy[e]||Ry.throwArgumentError("invalid format type","format",e),e===Fy.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Fy.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Fy.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?nm.fromString(e):nm.fromObject(e)}static fromObject(e){if(nm.isErrorFragment(e))return e;"error"!==e.type&&Ry.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:om(e.name),inputs:e.inputs?e.inputs.map(Hy.fromObject):[]};return tm(new nm(By,t))}static fromString(e){let t={type:"error"},n=e.match(am);return n||Ry.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&om(t.name),t.inputs=Gy(n[2],!1),tm(nm.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function rm(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const im=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function om(e){return e&&e.match(im)||Ry.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const am=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const sm=new _f(Py);class um{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){sm.throwArgumentError(e,this.localName,t)}}class cm{constructor(e){Ly(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Kf(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Ff(e._data))}writeBytes(e){let t=Yf(e);const n=t.length%this.wordSize;return n&&(t=Ff([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=Yf(uy.from(e));return t.length>this.wordSize&&sm.throwError("value out-of-bounds",_f.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Ff([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class lm{constructor(e,t,n,r){Ly(this,"_data",Yf(e)),Ly(this,"wordSize",t||32),Ly(this,"_coerceFunc",n),Ly(this,"allowLoose",r),this._offset=0}get data(){return Zf(this._data)}get consumed(){return this._offset}static coerce(e,t){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):lm.coerce(e,t)}_peekBytes(e,t,n){let r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?r=t:sm.throwError("data out-of-bounds",_f.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}subReader(e){return new lm(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}readValue(){return uy.from(this.readBytes(this.wordSize))}}var dm=lf((function(e){!function(){var t="input is invalid type",n="object"==typeof window,r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof k&&k.versions&&k.versions.node?r=uf:i&&(r=self);var o=!r.JS_SHA3_NO_COMMON_JS&&e.exports,a=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),u=[4,1024,262144,67108864],c=[0,8,16,24],l=[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],d=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],f={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var y=function(e,t,n){return function(r){return new j(e,t,e).update(r)[n]()}},m=function(e,t,n){return function(r,i){return new j(e,t,i).update(r)[n]()}},g=function(e,t,n){return function(t,r,i,o){return A["cshake"+e].update(t,r,i,o)[n]()}},v=function(e,t,n){return function(t,r,i,o){return A["kmac"+e].update(t,r,i,o)[n]()}},b=function(e,t,n,r){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function C(e,t,n){j.call(this,e,t,n)}j.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var i,o,s=this.blocks,u=this.byteCount,l=e.length,d=this.blockCount,h=0,p=this.s;h>2]|=e[h]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(s[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(this.start=i-u,this.block=s[d],i=0;i>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},j.prototype.encodeString=function(e){var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var i=0,o=e.length;if(n)i=o;else for(var s=0;s=57344?i+=3:(u=65536+((1023&u)<<10|1023&e.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(e),i},j.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];a%t==0&&(D(n),o=0)}return i&&(e=n[o],u+=s[e>>4&15]+s[15&e],i>1&&(u+=s[e>>12&15]+s[e>>8&15]),i>2&&(u+=s[e>>20&15]+s[e>>16&15])),u},j.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n==0&&D(r)}return o&&(e=s<<2,t=r[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},C.prototype=new j,C.prototype.finalize=function(){return this.encode(this.outputBits,!0),j.prototype.finalize.call(this)};var D=function(e){var t,n,r,i,o,a,s,u,c,d,h,p,f,y,m,g,v,b,w,M,A,E,T,N,I,k,L,x,S,j,C,D,O,z,_,P,R,B,U,W,Q,Y,F,V,H,G,q,Z,J,X,K,$,ee,te,ne,re,ie,oe,ae,se,ue,ce,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(p=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),n=(f=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|c>>>31),n=o^(c<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(d<<1|h>>>31),n=s^(h<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(p<<1|f>>>31),n=c^(f<<1|p>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(i<<1|o>>>31),n=h^(o<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,y=e[0],m=e[1],G=e[11]<<4|e[10]>>>28,q=e[10]<<4|e[11]>>>28,x=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,F=e[41]<<18|e[40]>>>14,z=e[2]<<1|e[3]>>>31,_=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,j=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,P=e[14]<<6|e[15]>>>26,R=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,K=e[35]<<15|e[34]>>>17,D=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,N=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,M=e[36]<<21|e[37]>>>11,A=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,H=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,L=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,W=e[38]<<8|e[39]>>>24,Q=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=y^~g&b,e[1]=m^~v&w,e[10]=N^~k&x,e[11]=I^~L&S,e[20]=z^~P&B,e[21]=_^~R&U,e[30]=V^~G&Z,e[31]=H^~q&J,e[40]=te^~re&oe,e[41]=ne^~ie&ae,e[2]=g^~b&M,e[3]=v^~w&A,e[12]=k^~x&j,e[13]=L^~S&C,e[22]=P^~B&W,e[23]=R^~U&Q,e[32]=G^~Z&X,e[33]=q^~J&K,e[42]=re^~oe&se,e[43]=ie^~ae&ue,e[4]=b^~M&E,e[5]=w^~A&T,e[14]=x^~j&D,e[15]=S^~C&O,e[24]=B^~W&Y,e[25]=U^~Q&F,e[34]=Z^~X&$,e[35]=J^~K&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&le,e[6]=M^~E&y,e[7]=A^~T&m,e[16]=j^~D&N,e[17]=C^~O&I,e[26]=W^~Y&z,e[27]=Q^~F&_,e[36]=X^~$&V,e[37]=K^~ee&H,e[46]=se^~ce&te,e[47]=ue^~le&ne,e[8]=E^~y&g,e[9]=T^~m&v,e[18]=D^~N&k,e[19]=O^~I&L,e[28]=Y^~z&P,e[29]=F^~_&R,e[38]=$^~V&G,e[39]=ee^~H&q,e[48]=ce^~te&re,e[49]=le^~ne&ie,e[0]^=l[r],e[1]^=l[r+1]};if(o)e.exports=A;else for(T=0;T>=8;return t}function ym(e,t,n){let r=0;for(let i=0;it+1+r&&pm.throwError("child data too short",_f.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function bm(e,t){if(0===e.length&&pm.throwError("data too short",_f.errors.BUFFER_OVERRUN,{}),e[t]>=248){const n=e[t]-247;t+1+n>e.length&&pm.throwError("data short segment too short",_f.errors.BUFFER_OVERRUN,{});const r=ym(e,t+1,n);return t+1+n+r>e.length&&pm.throwError("data long segment too short",_f.errors.BUFFER_OVERRUN,{}),vm(e,t,t+1+n,n+r)}if(e[t]>=192){const n=e[t]-192;return t+1+n>e.length&&pm.throwError("data array too short",_f.errors.BUFFER_OVERRUN,{}),vm(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;t+1+n>e.length&&pm.throwError("data array too short",_f.errors.BUFFER_OVERRUN,{});const r=ym(e,t+1,n);t+1+n+r>e.length&&pm.throwError("data array too short",_f.errors.BUFFER_OVERRUN,{});return{consumed:1+n+r,result:Zf(e.slice(t+1+n,t+1+n+r))}}if(e[t]>=128){const n=e[t]-128;t+1+n>e.length&&pm.throwError("data too short",_f.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:Zf(e.slice(t+1,t+1+n))}}return{consumed:1,result:Zf(e[t])}}function wm(e){const t=Yf(e),n=bm(t,0);return n.consumed!==t.length&&pm.throwArgumentError("invalid rlp data","data",e),n.result}const Mm=new _f("address/5.7.0");function Am(e){Gf(e,20)||Mm.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);const r=Yf(hm(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&r[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const Em={};for(let e=0;e<10;e++)Em[String(e)]=String(e);for(let e=0;e<26;e++)Em[String.fromCharCode(65+e)]=String(10+e);const Tm=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function Nm(e){let t=null;if("string"!=typeof e&&Mm.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Am(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Mm.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Em[e])).join("");for(;t.length>=Tm;){let e=t.substring(0,Tm);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}(e)&&Mm.throwArgumentError("bad icap checksum","address",e),n=e.substring(4),t=new ry(n,36).toString(16);t.length<40;)t="0"+t;t=Am("0x"+t)}else Mm.throwArgumentError("invalid address","address",e);var n;return t}function Im(e){let t=null;try{t=Nm(e.from)}catch(t){Mm.throwArgumentError("missing from address","transaction",e)}return Nm(Xf(hm(gm([t,Vf(Yf(uy.from(e.nonce).toHexString()))])),12))}class km extends um{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Nm(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Nm(ey(e.readValue().toHexString(),20))}}class Lm extends um{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const xm=new _f(Py);function Sm(e,t,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let e={};r=t.map((t=>{const r=t.localName;return r||xm.throwError("cannot encode object for signature with missing names",_f.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]&&xm.throwError("cannot encode object for signature with duplicate names",_f.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[r]=!0,n[r]}))}else xm.throwArgumentError("invalid tuple value","tuple",n);t.length!==r.length&&xm.throwArgumentError("types/value length mismatch","tuple",n);let i=new cm(e.wordSize),o=new cm(e.wordSize),a=[];t.forEach(((e,t)=>{let n=r[t];if(e.dynamic){let t=o.length;e.encode(o,n);let r=i.writeUpdatableValue();a.push((e=>{r(e+t)}))}else e.encode(i,n)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function jm(e,t){let n=[],r=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let n=e.readValue(),o=r.subReader(n.toNumber());try{i=t.decode(o)}catch(e){if(e.code===_f.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===_f.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&n.push(i)}));const i=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let r=e.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[t];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let e=0;e{throw t}})}return Object.freeze(n)}class Cm extends um{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;ne._data.length&&xm.throwError("insufficient data length",_f.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let e=0;e>6==2;r++)e++;return e}return e===Vm.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Fm||(Fm={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Vm||(Vm={}));const Gm=Object.freeze({error:function(e,t,n,r,i){return Ym.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:Hm,replace:function(e,t,n,r,i){return e===Vm.OVERLONG?(r.push(i),0):(r.push(65533),Hm(e,t,n))}});function qm(e,t){null==t&&(t=Gm.error),e=Yf(e);const n=[];let r=0;for(;r>7==0){n.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){r+=t(128==(192&i)?Vm.UNEXPECTED_CONTINUE:Vm.BAD_PREFIX,r-1,e,n);continue}o=3,a=65535}if(r-1+o>=e.length){r+=t(Vm.OVERRUN,r-1,e,n);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?r+=t(Vm.OUT_OF_RANGE,r-1-o,e,n,s):s>=55296&&s<=57343?r+=t(Vm.UTF16_SURROGATE,r-1-o,e,n,s):s<=a?r+=t(Vm.OVERLONG,r-1-o,e,n,s):n.push(s))}return n}function Zm(e,t=Fm.current){t!=Fm.current&&(Ym.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&r)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return Yf(n)}function Jm(e,t){return qm(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}class Xm extends Om{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Zm(t))}decode(e){return Jm(super.decode(e))}}class Km extends um{constructor(e,t){let n=!1;const r=[];e.forEach((e=>{e.dynamic&&(n=!0),r.push(e.type)}));super("tuple","tuple("+r.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[r]))})),Object.freeze(e)}encode(e,t){return Sm(e,this.coders,t)}decode(e){return e.coerce(this.name,jm(e,this.coders))}}const $m=new _f(Py),eg=new RegExp(/^bytes([0-9]*)$/),tg=new RegExp(/^(u?int)([0-9]*)$/);const ng=new class{constructor(e){Ly(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new km(e.name);case"bool":return new Dm(e.name);case"string":return new Xm(e.name);case"bytes":return new zm(e.name);case"array":return new Cm(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Km((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Pm(e.name)}let t=e.type.match(tg);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!=0)&&$m.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Qm(n/8,"int"===t[1],e.name)}if(t=e.type.match(eg),t){let n=parseInt(t[1]);return(0===n||n>32)&&$m.throwArgumentError("invalid bytes length","param",e),new _m(n,e.name)}return $m.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new lm(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new cm(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Hy.from(e))));return new Km(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&$m.throwError("types/values length mismatch",_f.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(Hy.from(e)))),r=new Km(n,"_"),i=this._getWriter();return r.encode(i,t),i.data}decode(e,t,n){const r=e.map((e=>this._getCoder(Hy.from(e))));return new Km(r,"_").decode(this._getReader(Yf(t),n))}};function rg(e){return hm(Zm(e))}const ig="hash/5.7.0";function og(e){e=atob(e);const t=[];for(let n=0;n0&&Array.isArray(e)?i(e,t-1):n.push(e)}))};return i(e,t),n}function ug(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),i=1,o=[0,1];for(let e=1;e>--u&1}const d=Math.pow(2,31),h=d>>>1,p=h>>1,f=d-1;let y=0;for(let e=0;e<31;e++)y=y<<1|l();let m=[],g=0,v=d;for(;;){let e=Math.floor(((y-g+1)*i-1)/v),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e>>1|l(),a=a<<1^h,s=(s^h)<<1|h|1;g=a,v=1+s-a}let b=r-4;return m.map((t=>{switch(t-b){case 3:return b+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return b+256+(e[s++]<<8|e[s++]);case 1:return b+e[s++];default:return t-1}}))}(e))}function cg(e){return 1&e?~e>>1:e>>1}function lg(e,t){let n=Array(e);for(let r=0,i=-1;rt[e])):n}function pg(e,t,n){let r=Array(e).fill(void 0).map((()=>[]));for(let i=0;ir[t].push(e)));return r}function fg(e,t){let n=1+t(),r=t(),i=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(n)}return t}(t);return sg(pg(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*r;return[o+t*n,a.map((e=>e+i))]}))})))}function yg(e,t){return pg(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const mg=ug(og("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O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5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),gg=new Set(hg(mg)),vg=new Set(hg(mg)),bg=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(fg(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(yg(n,e))}return function(e){const t={};for(let n=0;ne-t));return function n(){let r=[];for(;;){let i=hg(e,t);if(0==i.length)break;r.push({set:new Set(i),node:n()})}r.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:r,valid:o,fe0f:a,save:1==i,check:2==i}}()}(mg);function Mg(e){return function(e,t=Fm.current){return qm(Zm(e,t))}(e)}function Ag(e){return e.filter((e=>65039!=e))}function Eg(e){for(let t of e.split(".")){let e=Mg(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Tg(e){return Eg(function(e,t){let n=Mg(e).reverse(),r=[];for(;n.length;){let e=Ng(n);if(e){r.push(...t(e));continue}let i=n.pop();if(gg.has(i)){r.push(i);continue}if(vg.has(i))continue;let o=bg[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);r.push(...o)}return Eg(function(e){return e.normalize("NFC")}(String.fromCodePoint(...r)))}(e,Ag))}function Ng(e,t){var n;let r,i,o=wg,a=[],s=e.length;for(t&&(t.length=0);s;){let u=e[--s];if(o=null===(n=o.branches.find((e=>e.set.has(u))))||void 0===n?void 0:n.node,!o)break;if(o.save)i=u;else if(o.check&&u===i)break;a.push(u),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(r=a.slice(),2==o.valid&&r.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return r}const Ig=new _f(ig),kg=new Uint8Array(32);function Lg(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function xg(e){const t=Zm(Tg(e)),n=[];if(0===e.length)return n;let r=0;for(let e=0;e=t.length)throw new Error("invalid ENS name; empty component");return n.push(Lg(t.slice(r))),n}function Sg(e){"string"!=typeof e&&Ig.throwArgumentError("invalid ENS name; not a string","name",e);let t=kg;const n=xg(e);for(;n.length;)t=hm(Ff([t,hm(n.pop())]));return Zf(t)}kg.fill(0);var jg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const Cg=new _f(ig),Dg=new Uint8Array(32);Dg.fill(0);const Og=uy.from(-1),zg=uy.from(0),_g=uy.from(1),Pg=uy.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Rg=ey(_g.toHexString(),32),Bg=ey(zg.toHexString(),32),Ug={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Wg=["name","version","chainId","verifyingContract","salt"];function Qg(e){return function(t){return"string"!=typeof t&&Cg.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const Yg={name:Qg("name"),version:Qg("version"),chainId:function(e){try{return uy.from(e).toString()}catch(e){}return Cg.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Nm(e).toLowerCase()}catch(e){}return Cg.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Yf(e);if(32!==t.length)throw new Error("bad length");return Zf(t)}catch(e){}return Cg.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function Fg(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const n=""===t[1],r=parseInt(t[2]||"256");(r%8!=0||r>256||t[2]&&t[2]!==String(r))&&Cg.throwArgumentError("invalid numeric width","type",e);const i=Pg.mask(n?r-1:r),o=n?i.add(_g).mul(Og):zg;return function(t){const n=uy.from(t);return(n.lt(o)||n.gt(i))&&Cg.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),ey(n.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return(0===n||n>32||t[1]!==String(n))&&Cg.throwArgumentError("invalid bytes width","type",e),function(t){return Yf(t).length!==n&&Cg.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Yf(e),n=t.length%32;return n?Kf([t,Dg.slice(n)]):Zf(t)}(t)}}}switch(e){case"address":return function(e){return ey(Nm(e),32)};case"bool":return function(e){return e?Rg:Bg};case"bytes":return function(e){return hm(e)};case"string":return function(e){return rg(e)}}return null}function Vg(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class Hg{constructor(e){Ly(this,"types",Object.freeze(zy(e))),Ly(this,"_encoderCache",{}),Ly(this,"_types",{});const t={},n={},r={};Object.keys(e).forEach((e=>{t[e]={},n[e]=[],r[e]={}}));for(const r in e){const i={};e[r].forEach((o=>{i[o.name]&&Cg.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===r&&Cg.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);Fg(a)||(n[a]||Cg.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),n[a].push(r),t[r][a]=!0)}))}const i=Object.keys(n).filter((e=>0===n[e].length));0===i.length?Cg.throwArgumentError("missing primary type","types",e):i.length>1&&Cg.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),Ly(this,"primaryType",i[0]),function i(o,a){a[o]&&Cg.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{n[e]&&(i(e,a),Object.keys(a).forEach((t=>{r[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in r){const n=Object.keys(r[t]);n.sort(),this._types[t]=Vg(t,e[t])+n.map((t=>Vg(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=Fg(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],n=this.getEncoder(e),r=parseInt(t[3]);return t=>{r>=0&&t.length!==r&&Cg.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(n);return this._types[e]&&(i=i.map(hm)),hm(Kf(i))}}const n=this.types[e];if(n){const t=rg(this._types[e]);return e=>{const r=n.map((({name:t,type:n})=>{const r=this.getEncoder(n)(e[t]);return this._types[n]?hm(r):r}));return r.unshift(t),Kf(r)}}return Cg.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Cg.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return hm(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(Fg(e))return n(e,t);const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const e=r[1],i=parseInt(r[3]);return i>=0&&t.length!==i&&Cg.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,n)))}const i=this.types[e];return i?i.reduce(((e,{name:r,type:i})=>(e[r]=this._visit(i,t[r],n),e)),{}):Cg.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Hg(e)}static getPrimaryType(e){return Hg.from(e).primaryType}static hashStruct(e,t,n){return Hg.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){const r=Ug[n];r||Cg.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:r})}return t.sort(((e,t)=>Wg.indexOf(e.name)-Wg.indexOf(t.name))),Hg.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return Kf(["0x1901",Hg.hashDomain(e),Hg.from(t).hash(n)])}static hash(e,t,n){return hm(Hg.encode(e,t,n))}static resolveNames(e,t,n,r){return jg(this,void 0,void 0,(function*(){e=jy(e);const i={};e.verifyingContract&&!Gf(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=Hg.from(t);o.visit(n,((e,t)=>("address"!==e||Gf(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield r(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=o.visit(n,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:n}}))}static getPayload(e,t,n){Hg.hashDomain(e);const r={},i=[];Wg.forEach((t=>{const n=e[t];null!=n&&(r[t]=Yg[t](n),i.push({name:t,type:Ug[t]}))}));const o=Hg.from(t),a=jy(t);return a.EIP712Domain?Cg.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(n),{types:a,domain:r,primaryType:o.primaryType,message:o.visit(n,((e,t)=>{if(e.match(/^bytes(\d*)/))return Zf(Yf(t));if(e.match(/^u?int/))return uy.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Cg.throwArgumentError("invalid string","value",t),t}return Cg.throwArgumentError("unsupported type","type",e)}))}}}const Gg=new _f(Py);class qg extends _y{}class Zg extends _y{}class Jg extends _y{}class Xg extends _y{static isIndexed(e){return!(!e||!e._isIndexed)}}const Kg={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function $g(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return n.error=t,n}class ev{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,Ly(this,"fragments",t.map((e=>qy.from(e))).filter((e=>null!=e))),Ly(this,"_abiCoder",xy(new.target,"getAbiCoder")()),Ly(this,"functions",{}),Ly(this,"errors",{}),Ly(this,"events",{}),Ly(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void Gg.warn("duplicate definition - constructor"):void Ly(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let n=e.format();t[n]?Gg.warn("duplicate definition - "+n):t[n]=e})),this.deploy||Ly(this,"deploy",$y.from({payable:!1,type:"constructor"})),Ly(this,"_isInterface",!0)}format(e){e||(e=Fy.full),e===Fy.sighash&&Gg.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Fy.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return ng}static getAddress(e){return Nm(e)}static getSighash(e){return Xf(rg(e.format()),0,4)}static getEventTopic(e){return rg(e.format())}getFunction(e){if(Gf(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Gg.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===n.length?Gg.throwArgumentError("no matching function","name",t):n.length>1&&Gg.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}const t=this.functions[em.fromString(e).format()];return t||Gg.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Gf(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Gg.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===n.length?Gg.throwArgumentError("no matching event","name",t):n.length>1&&Gg.throwArgumentError("multiple matching events","name",t),this.events[n[0]]}const t=this.events[Zy.fromString(e).format()];return t||Gg.throwArgumentError("no matching event","signature",e),t}getError(e){if(Gf(e)){const t=xy(this.constructor,"getSighash");for(const n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}Gg.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===n.length?Gg.throwArgumentError("no matching error","name",t):n.length>1&&Gg.throwArgumentError("multiple matching errors","name",t),this.errors[n[0]]}const t=this.errors[em.fromString(e).format()];return t||Gg.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return xy(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),xy(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const n=Yf(t);return Zf(n.slice(0,4))!==this.getSighash(e)&&Gg.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Zf(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Zf(Ff([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const n=Yf(t);return Zf(n.slice(0,4))!==this.getSighash(e)&&Gg.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Zf(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Zf(Ff([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let n=Yf(t),r=null,i="",o=null,a=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(e){}break;case 4:{const e=Zf(n.slice(0,4)),t=Kg[e];if(t)o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.signature,t.reason&&(r=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return Gg.throwError("call revert exception"+i,_f.errors.CALL_EXCEPTION,{method:e.format(),data:Zf(t),errorArgs:o,errorName:a,errorSignature:s,reason:r})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Zf(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Gg.throwError("too many arguments for "+e.format(),_f.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let n=[];e.anonymous||n.push(this.getEventTopic(e));const r=(e,t)=>"string"===e.type?rg(t):"bytes"===e.type?hm(Zf(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=uy.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),ey(Zf(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?Gg.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((e=>r(o,e)))):n.push(r(o,t)):null!=t&&Gg.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const n=[],r=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Gg.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)n.push(rg(a));else if("bytes"===e.type)n.push(hm(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([e.type],[a]))}else r.push(e),i.push(a)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(e,t,n){if("string"==typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){let t=this.getEventTopic(e);Gf(n[0],32)&&n[0].toLowerCase()===t||Gg.throwError("fragment/topic mismatch",_f.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(r.push(Hy.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(r.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=n?this._abiCoder.decode(r,Ff(n)):null,s=this._abiCoder.decode(i,t,!0),u=[],c=0,l=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)u[t]=new Xg({_isIndexed:!0,hash:null});else if(o[t])u[t]=new Xg({_isIndexed:!0,hash:a[l++]});else try{u[t]=a[l++]}catch(e){u[t]=e}else try{u[t]=s[c++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){const n=u[t];n instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw $g(`property ${JSON.stringify(e.name)}`,n)}}):u[e.name]=n}}));for(let e=0;e{throw $g(`index ${e}`,t)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Zg({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:uy.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new qg({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=Zf(e);let n=this.getError(t.substring(0,10).toLowerCase());return n?new Jg({args:this._abiCoder.decode(n.inputs,"0x"+t.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var tv=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const nv=new _f("abstract-provider/5.7.0");class rv extends _y{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class iv{constructor(){nv.checkAbstract(new.target,iv),Ly(this,"_isProvider",!0)}getFeeData(){return tv(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield Sy({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let n=null,r=null,i=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,i=uy.from("1500000000"),r=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:n,maxFeePerGas:r,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var ov=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const av=new _f("abstract-signer/5.7.0"),sv=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],uv=[_f.errors.INSUFFICIENT_FUNDS,_f.errors.NONCE_EXPIRED,_f.errors.REPLACEMENT_UNDERPRICED];class cv{constructor(){av.checkAbstract(new.target,cv),Ly(this,"_isSigner",!0)}getBalance(e){return ov(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return ov(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return ov(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield Sy(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return ov(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield Sy(this.checkTransaction(e));return yield this.provider.call(n,t)}))}sendTransaction(e){return ov(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),n=yield this.signTransaction(t);return yield this.provider.sendTransaction(n)}))}getChainId(){return ov(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return ov(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return ov(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return ov(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===sv.indexOf(t)&&av.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=jy(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&av.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return ov(this,void 0,void 0,(function*(){const t=yield Sy(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>ov(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&av.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const n=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!n?0!==t.type&&1!==t.type||!n||av.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):av.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(n&&av.throwError("network does not support EIP-1559",_f.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):av.throwError("failed to get consistent fee data",_f.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(uv.indexOf(e.code)>=0)throw e;return av.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",_f.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&av.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield Sy(t)}))}_checkProvider(e){this.provider||av.throwError("missing provider",_f.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class lv extends cv{constructor(e,t){super(),Ly(this,"address",e),Ly(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{av.throwError(e,_f.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new lv(this.address,e)}}var dv=hv;function hv(e,t){if(!e)throw new Error(t||"Assertion failed")}hv.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var pv=[],fv=[],yv="undefined"!=typeof Uint8Array?Uint8Array:Array,mv=!1;function gv(){mv=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t>18&63]+pv[i>>12&63]+pv[i>>6&63]+pv[63&i]);return o.join("")}function bv(e){var t;mv||gv();for(var n=e.length,r=n%3,i="",o=[],a=16383,s=0,u=n-r;su?u:s+a));return 1===r?(t=e[n-1],i+=pv[t>>2],i+=pv[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=pv[t>>10],i+=pv[t>>4&63],i+=pv[t<<2&63],i+="="),o.push(i),o.join("")}function wv(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)}function Mv(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=f,a/=256,c-=8);e[n+p-f]|=128*y}var Av={}.toString,Ev=Array.isArray||function(e){return"[object Array]"==Av.call(e)};function Tv(){return Iv.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Nv(e,t){if(Tv()=Tv())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tv().toString(16)+" bytes");return 0|e}function Cv(e){return!(null==e||!e._isBuffer)}function Dv(e,t){if(Cv(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return ab(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return sb(e).length;default:if(r)return ab(e).length;t=(""+t).toLowerCase(),r=!0}}function Ov(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Zv(this,t,n);case"utf8":case"utf-8":return Vv(this,t,n);case"ascii":return Gv(this,t,n);case"latin1":case"binary":return qv(this,t,n);case"base64":return Fv(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Jv(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function zv(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=Iv.from(t,r)),Cv(t))return 0===t.length?-1:Pv(e,t,n,r,i);if("number"==typeof t)return t&=255,Iv.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Pv(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Pv(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var d=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function Fv(e,t,n){return 0===t&&n===e.length?bv(e):bv(e.slice(t,n))}function Vv(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=Hv)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},Iv.prototype.compare=function(e,t,n,r,i){if(!Cv(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=e.slice(t,n),l=0;li)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return Rv(this,e,t,n);case"utf8":case"utf-8":return Bv(this,e,t,n);case"ascii":return Uv(this,e,t,n);case"latin1":case"binary":return Wv(this,e,t,n);case"base64":return Qv(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yv(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Iv.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Hv=4096;function Gv(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function Kv(e,t,n,r,i,o){if(!Cv(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function $v(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function eb(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function tb(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function nb(e,t,n,r,i){return i||tb(e,0,n,4),Mv(e,t,n,r,23,4),n+4}function rb(e,t,n,r,i){return i||tb(e,0,n,8),Mv(e,t,n,r,52,8),n+8}Iv.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},Iv.prototype.readUInt8=function(e,t){return t||Xv(e,1,this.length),this[e]},Iv.prototype.readUInt16LE=function(e,t){return t||Xv(e,2,this.length),this[e]|this[e+1]<<8},Iv.prototype.readUInt16BE=function(e,t){return t||Xv(e,2,this.length),this[e]<<8|this[e+1]},Iv.prototype.readUInt32LE=function(e,t){return t||Xv(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Iv.prototype.readUInt32BE=function(e,t){return t||Xv(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Iv.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Xv(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},Iv.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Xv(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Iv.prototype.readInt8=function(e,t){return t||Xv(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Iv.prototype.readInt16LE=function(e,t){t||Xv(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Iv.prototype.readInt16BE=function(e,t){t||Xv(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Iv.prototype.readInt32LE=function(e,t){return t||Xv(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Iv.prototype.readInt32BE=function(e,t){return t||Xv(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Iv.prototype.readFloatLE=function(e,t){return t||Xv(e,4,this.length),wv(this,e,!0,23,4)},Iv.prototype.readFloatBE=function(e,t){return t||Xv(e,4,this.length),wv(this,e,!1,23,4)},Iv.prototype.readDoubleLE=function(e,t){return t||Xv(e,8,this.length),wv(this,e,!0,52,8)},Iv.prototype.readDoubleBE=function(e,t){return t||Xv(e,8,this.length),wv(this,e,!1,52,8)},Iv.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Kv(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},Iv.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,1,255,0),Iv.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Iv.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,2,65535,0),Iv.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$v(this,e,t,!0),t+2},Iv.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,2,65535,0),Iv.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$v(this,e,t,!1),t+2},Iv.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,4,4294967295,0),Iv.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):eb(this,e,t,!0),t+4},Iv.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,4,4294967295,0),Iv.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):eb(this,e,t,!1),t+4},Iv.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Kv(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},Iv.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Kv(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},Iv.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,1,127,-128),Iv.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Iv.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,2,32767,-32768),Iv.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$v(this,e,t,!0),t+2},Iv.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,2,32767,-32768),Iv.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$v(this,e,t,!1),t+2},Iv.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,4,2147483647,-2147483648),Iv.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):eb(this,e,t,!0),t+4},Iv.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Kv(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Iv.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):eb(this,e,t,!1),t+4},Iv.prototype.writeFloatLE=function(e,t,n){return nb(this,e,t,!0,n)},Iv.prototype.writeFloatBE=function(e,t,n){return nb(this,e,t,!1,n)},Iv.prototype.writeDoubleLE=function(e,t,n){return rb(this,e,t,!0,n)},Iv.prototype.writeDoubleBE=function(e,t,n){return rb(this,e,t,!1,n)},Iv.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!Iv.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function sb(e){return function(e){var t,n,r,i,o,a;mv||gv();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new yv(3*s/4-o),r=o>0?s-4:s;var u=0;for(t=0,n=0;t>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=fv[e.charCodeAt(t)]<<2|fv[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=fv[e.charCodeAt(t)]<<10|fv[e.charCodeAt(t+1)]<<4|fv[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(ib,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ub(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function cb(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var lb=function(e){return e instanceof Iv},db=lf((function(e,t){var n=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],r=0;r=a)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}})),u=i[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(n)?r.showHidden=n:n&&t._extend(r,n),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),u(r,e,r.depth)}function a(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function s(e,t){return e}function u(e,n,r){if(e.customInspect&&n&&M(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=u(e,i,r)),i}var o=function(e,t){if(m(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(f(t))return e.stylize(""+t,"number");if(h(t))return e.stylize(""+t,"boolean");if(p(t))return e.stylize("null","null")}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),0===a.length){if(M(n)){var v=n.name?": "+n.name:"";return e.stylize("[Function"+v+"]","special")}if(g(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(b(n))return e.stylize(Date.prototype.toString.call(n),"date");if(w(n))return c(n)}var A,E="",T=!1,N=["{","}"];(d(n)&&(T=!0,N=["[","]"]),M(n))&&(E=" [Function"+(n.name?": "+n.name:"")+"]");return g(n)&&(E=" "+RegExp.prototype.toString.call(n)),b(n)&&(E=" "+Date.prototype.toUTCString.call(n)),w(n)&&(E=" "+c(n)),0!==a.length||T&&0!=n.length?r<0?g(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),A=T?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(A,E,N)):N[0]+E+N[1]}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,r,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),I(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=p(n)?u(e,c.value,null):u(e,c.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),m(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function p(e){return null===e}function f(e){return"number"==typeof e}function y(e){return"string"==typeof e}function m(e){return void 0===e}function g(e){return v(e)&&"[object RegExp]"===A(e)}function v(e){return"object"==typeof e&&null!==e}function b(e){return v(e)&&"[object Date]"===A(e)}function w(e){return v(e)&&("[object Error]"===A(e)||e instanceof Error)}function M(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(m(r)&&(r=k.env.NODE_DEBUG||""),e=e.toUpperCase(),!i[e])if(new RegExp("\\b"+e+"\\b","i").test(r)){var n=k.pid;i[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=h,t.isNull=p,t.isNullOrUndefined=function(e){return null==e},t.isNumber=f,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=m,t.isRegExp=g,t.isObject=v,t.isDate=b,t.isError=w,t.isFunction=M,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=lb;var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":");return[e.getDate(),T[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",N(),t.format.apply(t,arguments))},t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t._extend=function(e,t){if(!t||!v(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}})),hb=lf((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}}));function pb(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function fb(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function yb(e){return 1===e.length?"0"+e:e}function mb(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var gb={inherits:lf((function(e){try{var t=db;if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=hb}})),toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,n[r++]=63&o|128):pb(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i>>0}return o},split32:function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,n){return e+t+n>>>0},sum32_4:function(e,t,n,r){return e+t+n+r>>>0},sum32_5:function(e,t,n,r,i){return e+t+n+r+i>>>0},sum64:function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o>>0,e[t+1]=o},sum64_hi:function(e,t,n,r){return(t+r>>>0>>0},sum64_lo:function(e,t,n,r){return t+r>>>0},sum64_4_hi:function(e,t,n,r,i,o,a,s){var u=0,c=t;return u+=(c=c+r>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0},sum64_5_hi:function(e,t,n,r,i,o,a,s,u,c){var l=0,d=t;return l+=(d=d+r>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,n,r,i,o,a,s,u,c){return t+r+o+s+c>>>0},rotr64_hi:function(e,t,n){return(t<<32-n|e>>>n)>>>0},rotr64_lo:function(e,t,n){return(e<<32-n|t>>>n)>>>0},shr64_hi:function(e,t,n){return e>>>n},shr64_lo:function(e,t,n){return(e<<32-n|t>>>n)>>>0}};function vb(){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}var bb=vb;vb.prototype.update=function(e,t){if(e=gb.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=gb.join32(e,0,e.length-n,this.endian);for(var r=0;r>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o>>3},g1_256:function(e){return Mb(e,17)^Mb(e,19)^e>>>10}},Ib=gb.rotl32,kb=gb.sum32,Lb=gb.sum32_5,xb=Nb.ft_1,Sb=wb.BlockHash,jb=[1518500249,1859775393,2400959708,3395469782];function Cb(){if(!(this instanceof Cb))return new Cb;Sb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}gb.inherits(Cb,Sb);var Db=Cb;Cb.blockSize=512,Cb.outSize=160,Cb.hmacStrength=80,Cb.padLength=64,Cb.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;rthis.blockSize&&(e=(new this.Hash).update(e).digest()),dv(e.length<=this.blockSize);for(var t=e.length;t>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),Gw=Yw((function(e,t){var n=t;n.assert=Fw,n.toArray=Hw.toArray,n.zero2=Hw.zero2,n.toHex=Hw.toHex,n.encode=Hw.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[0].push(a),s=0==(1&c)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new If(e,"hex","le")}})),qw=Gw.getNAF,Zw=Gw.getJSF,Jw=Gw.assert;function Xw(e,t){this.type=e,this.p=new If(t.p,16),this.red=t.prime?If.red(t.prime):If.mont(this.p),this.zero=new If(0).toRed(this.red),this.one=new If(1).toRed(this.red),this.two=new If(2).toRed(this.red),this.n=t.n&&new If(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Kw=Xw;function $w(e,t){this.curve=e,this.type=t,this.precomputed=null}Xw.prototype.point=function(){throw new Error("Not implemented")},Xw.prototype.validate=function(){throw new Error("Not implemented")},Xw.prototype._fixedNafMul=function(e,t){Jw(e.precomputed);var n=e._getDoubles(),r=qw(t,1,this._bitLength),i=(1<=o;u--)a=(a<<1)+r[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];Jw(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},Xw.prototype._wnafMulAdd=function(e,t,n,r,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,d=0;for(o=0;o=1;o-=2){var p=o-1,f=o;if(1===u[p]&&1===u[f]){var y=[t[p],null,null,t[f]];0===t[p].y.cmp(t[f].y)?(y[1]=t[p].add(t[f]),y[2]=t[p].toJ().mixedAdd(t[f].neg())):0===t[p].y.cmp(t[f].y.redNeg())?(y[1]=t[p].toJ().mixedAdd(t[f]),y[2]=t[p].add(t[f].neg())):(y[1]=t[p].toJ().mixedAdd(t[f]),y[2]=t[p].toJ().mixedAdd(t[f].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=Zw(n[p],n[f]);for(d=Math.max(g[0].length,d),l[p]=new Array(d),l[f]=new Array(d),a=0;a=0;o--){for(var A=0;o>=0;){var E=!0;for(a=0;a=0&&A++,w=w.dblp(A),o<0)break;for(a=0;a0?s=c[a][T-1>>1]:T<0&&(s=c[a][-T-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},$w.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i=0&&(o=t,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},nM.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),c=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},nM.prototype.pointFromX=function(e,t){(e=new If(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},nM.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},nM.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},iM.prototype.isInfinity=function(){return this.inf},iM.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},iM.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},iM.prototype.getX=function(){return this.x.fromRed()},iM.prototype.getY=function(){return this.y.fromRed()},iM.prototype.mul=function(e){return e=new If(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},iM.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},iM.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},iM.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},iM.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},iM.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},eM(oM,Kw.BasePoint),nM.prototype.jpoint=function(e,t,n){return new oM(this,e,t,n)},oM.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},oM.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},oM.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),d=r.redMul(c),h=u.redSqr().redIAdd(l).redISub(d).redISub(d),p=u.redMul(d.redISub(h)).redISub(o.redMul(l)),f=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,p,f)},oM.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=n.redMul(u),d=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(d)).redISub(i.redMul(c)),p=this.z.redMul(a);return this.curve.jpoint(d,h,p)},oM.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},oM.prototype.inspect=function(){return this.isInfinity()?"":""},oM.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var aM=Yw((function(e,t){var n=t;n.base=Kw,n.short=rM,n.mont=null,n.edwards=null})),sM=Yw((function(e,t){var n,r=t,i=Gw.assert;function o(e){"short"===e.type?this.curve=new aM.short(e):"edwards"===e.type?this.curve=new aM.edwards(e):this.curve=new aM.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new o(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Qw.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Qw.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Qw.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Qw.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Qw.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qw.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qw.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(e){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Qw.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function uM(e){if(!(this instanceof uM))return new uM(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Hw.toArray(e.entropy,e.entropyEnc||"hex"),n=Hw.toArray(e.nonce,e.nonceEnc||"hex"),r=Hw.toArray(e.pers,e.persEnc||"hex");Fw(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var cM=uM;uM.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},uM.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=Hw.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"};var pM=Gw.assert;function fM(e,t){if(e instanceof fM)return e;this._importDER(e,t)||(pM(e.r&&e.s,"Signature without r or s"),this.r=new If(e.r,16),this.s=new If(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var yM=fM;function mM(){this.place=0}function gM(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function vM(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}fM.prototype._importDER=function(e,t){e=Gw.toArray(e,t);var n=new mM;if(48!==e[n.place++])return!1;var r=gM(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=gM(e,n);if(!1===i)return!1;var o=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var a=gM(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var s=e.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new If(o),this.s=new If(s),this.recoveryParam=null,!0},fM.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=vM(t),n=vM(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];bM(r,t.length),(r=r.concat(t)).push(2),bM(r,n.length);var i=r.concat(n),o=[48];return bM(o,i.length),o=o.concat(i),Gw.encode(o,e)};var wM=function(){throw new Error("unsupported")},MM=Gw.assert;function AM(e){if(!(this instanceof AM))return new AM(e);"string"==typeof e&&(MM(Object.prototype.hasOwnProperty.call(sM,e),"Unknown curve "+e),e=sM[e]),e instanceof sM.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var EM=AM;AM.prototype.keyPair=function(e){return new hM(this,e)},AM.prototype.keyFromPrivate=function(e,t){return hM.fromPrivate(this,e,t)},AM.prototype.keyFromPublic=function(e,t){return hM.fromPublic(this,e,t)},AM.prototype.genKeyPair=function(e){e||(e={});for(var t=new cM({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||wM(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new If(2));;){var i=new If(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},AM.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},AM.prototype.sign=function(e,t,n,r){"object"==typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new If(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new cM({hash:this.hash,entropy:o,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new If(1)),c=0;;c++){var l=r.k?r.k(c):new If(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(0!==p.cmpn(0)){var f=l.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(f=f.umod(this.n)).cmpn(0)){var y=(d.getY().isOdd()?1:0)|(0!==h.cmp(p)?2:0);return r.canonical&&f.cmp(this.nh)>0&&(f=this.n.sub(f),y^=1),new yM({r:p,s:f,recoveryParam:y})}}}}}},AM.prototype.verify=function(e,t,n,r){e=this._truncateToN(new If(e,16)),n=this.keyFromPublic(n,r);var i=(t=new yM(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),c)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},AM.prototype.recoverPubKey=function(e,t,n,r){MM((3&n)===n,"The recovery param is more than two bits"),t=new yM(t,r);var i=this.n,o=new If(e),a=t.r,s=t.s,u=1&n,c=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(i),d=i.sub(o).mul(l).umod(i),h=s.mul(l).umod(i);return this.g.mulAdd(d,a,h)},AM.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new yM(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var TM=Yw((function(e,t){var n=t;n.version="6.5.4",n.utils=Gw,n.rand=function(){throw new Error("unsupported")},n.curve=aM,n.curves=sM,n.ec=EM,n.eddsa=null})).ec;const NM=new _f("signing-key/5.7.0");let IM=null;function kM(){return IM||(IM=new TM("secp256k1")),IM}class LM{constructor(e){Ly(this,"curve","secp256k1"),Ly(this,"privateKey",Zf(e)),32!==Jf(this.privateKey)&&NM.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=kM().keyFromPrivate(Yf(this.privateKey));Ly(this,"publicKey","0x"+t.getPublic(!1,"hex")),Ly(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Ly(this,"_isSigningKey",!0)}_addPoint(e){const t=kM().keyFromPublic(Yf(this.publicKey)),n=kM().keyFromPublic(Yf(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const t=kM().keyFromPrivate(Yf(this.privateKey)),n=Yf(e);32!==n.length&&NM.throwArgumentError("bad digest length","digest",e);const r=t.sign(n,{canonical:!0});return ty({recoveryParam:r.recoveryParam,r:ey("0x"+r.r.toString(16),32),s:ey("0x"+r.s.toString(16),32)})}computeSharedSecret(e){const t=kM().keyFromPrivate(Yf(this.privateKey)),n=kM().keyFromPublic(Yf(xM(e)));return ey("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function xM(e,t){const n=Yf(e);if(32===n.length){const e=new LM(n);return t?"0x"+kM().keyFromPrivate(n).getPublic(!0,"hex"):e.publicKey}return 33===n.length?t?Zf(n):"0x"+kM().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?t?"0x"+kM().keyFromPublic(n).getPublic(!0,"hex"):Zf(n):NM.throwArgumentError("invalid public or private key","key","[REDACTED]")}const SM=new _f("transactions/5.7.0");var jM;function CM(e){return"0x"===e?null:Nm(e)}function DM(e){return"0x"===e?Bm:uy.from(e)}function OM(e,t){return function(e){return Nm(Xf(hm(Xf(xM(e),1)),12))}(function(e,t){const n=ty(t),r={r:Yf(n.r),s:Yf(n.s)};return"0x"+kM().recoverPubKey(Yf(e),r,n.recoveryParam).encode("hex",!1)}(Yf(e),t))}function zM(e,t){const n=Vf(uy.from(e).toHexString());return n.length>32&&SM.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function _M(e,t){return{address:Nm(e),storageKeys:(t||[]).map(((t,n)=>(32!==Jf(t)&&SM.throwArgumentError("invalid access list storageKey",`accessList[${e}:${n}]`,t),t.toLowerCase())))}}function PM(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&SM.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),_M(e[0],e[1])):_M(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const n=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return _M(t,Object.keys(n).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function RM(e){return PM(e).map((e=>[e.address,e.storageKeys]))}function BM(e,t){if(null!=e.gasPrice){const t=uy.from(e.gasPrice),n=uy.from(e.maxFeePerGas||0);t.eq(n)||SM.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:n})}const n=[zM(e.chainId||0,"chainId"),zM(e.nonce||0,"nonce"),zM(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),zM(e.maxFeePerGas||0,"maxFeePerGas"),zM(e.gasLimit||0,"gasLimit"),null!=e.to?Nm(e.to):"0x",zM(e.value||0,"value"),e.data||"0x",RM(e.accessList||[])];if(t){const e=ty(t);n.push(zM(e.recoveryParam,"recoveryParam")),n.push(Vf(e.r)),n.push(Vf(e.s))}return Kf(["0x02",gm(n)])}function UM(e,t){const n=[zM(e.chainId||0,"chainId"),zM(e.nonce||0,"nonce"),zM(e.gasPrice||0,"gasPrice"),zM(e.gasLimit||0,"gasLimit"),null!=e.to?Nm(e.to):"0x",zM(e.value||0,"value"),e.data||"0x",RM(e.accessList||[])];if(t){const e=ty(t);n.push(zM(e.recoveryParam,"recoveryParam")),n.push(Vf(e.r)),n.push(Vf(e.s))}return Kf(["0x01",gm(n)])}function WM(e,t,n){try{const n=DM(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(e){SM.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=ey(t[1],32),e.s=ey(t[2],32);try{const t=hm(n(e));e.from=OM(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function QM(e){const t=Yf(e);if(t[0]>127)return function(e){const t=wm(e);9!==t.length&&6!==t.length&&SM.throwArgumentError("invalid raw transaction","rawTransaction",e);const n={nonce:DM(t[0]).toNumber(),gasPrice:DM(t[1]),gasLimit:DM(t[2]),to:CM(t[3]),value:DM(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=uy.from(t[6]).toNumber()}catch(e){return n}if(n.r=ey(t[7],32),n.s=ey(t[8],32),uy.from(n.r).isZero()&&uy.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let r=n.v-27;const i=t.slice(0,6);0!==n.chainId&&(i.push(Zf(n.chainId)),i.push("0x"),i.push("0x"),r-=2*n.chainId+8);const o=hm(gm(i));try{n.from=OM(o,{r:Zf(n.r),s:Zf(n.s),recoveryParam:r})}catch(e){}n.hash=hm(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){const t=wm(e.slice(1));8!==t.length&&11!==t.length&&SM.throwArgumentError("invalid component count for transaction type: 1","payload",Zf(e));const n={type:1,chainId:DM(t[0]).toNumber(),nonce:DM(t[1]).toNumber(),gasPrice:DM(t[2]),gasLimit:DM(t[3]),to:CM(t[4]),value:DM(t[5]),data:t[6],accessList:PM(t[7])};return 8===t.length||(n.hash=hm(e),WM(n,t.slice(8),UM)),n}(t);case 2:return function(e){const t=wm(e.slice(1));9!==t.length&&12!==t.length&&SM.throwArgumentError("invalid component count for transaction type: 2","payload",Zf(e));const n=DM(t[2]),r=DM(t[3]),i={type:2,chainId:DM(t[0]).toNumber(),nonce:DM(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:DM(t[4]),to:CM(t[5]),value:DM(t[6]),data:t[7],accessList:PM(t[8])};return 9===t.length||(i.hash=hm(e),WM(i,t.slice(9),BM)),i}(t)}return SM.throwError(`unsupported transaction type: ${t[0]}`,_f.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(jM||(jM={}));var YM=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const FM=new _f("contracts/5.7.0");function VM(e,t){return YM(this,void 0,void 0,(function*(){const n=yield t;"string"!=typeof n&&FM.throwArgumentError("invalid address or ENS name","name",n);try{return Nm(n)}catch(e){}e||FM.throwError("a provider or signer is needed to resolve ENS names",_f.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield e.resolveName(n);return null==r&&FM.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function HM(e,t,n){return YM(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>HM(e,Array.isArray(t)?t[r]:t[n.name],n)))):"address"===n.type?yield VM(e,t):"tuple"===n.type?yield HM(e,t,n.components):"array"===n.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>HM(e,t,n.arrayChildren)))):Promise.reject(FM.makeError("invalid value for array",_f.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function GM(e,t,n){return YM(this,void 0,void 0,(function*(){let r={};n.length===t.inputs.length+1&&"object"==typeof n[n.length-1]&&(r=jy(n.pop())),FM.checkArgumentCount(n.length,t.inputs.length,"passed to contract"),e.signer?r.from?r.from=Sy({override:VM(e.signer,r.from),signer:e.signer.getAddress()}).then((e=>YM(this,void 0,void 0,(function*(){return Nm(e.signer)!==e.override&&FM.throwError("Contract with a Signer cannot override from",_f.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):r.from=e.signer.getAddress():r.from&&(r.from=VM(e.provider,r.from));const i=yield Sy({args:HM(e.signer||e.provider,n,t.inputs),address:e.resolvedAddress,overrides:Sy(r)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=uy.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=uy.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=uy.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=uy.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=uy.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=PM(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const n=Yf(o);for(let t=0;tnull!=r[e]));return u.length&&FM.throwError(`cannot override ${u.map((e=>JSON.stringify(e))).join(",")}`,_f.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),a}))}function qM(e,t,n){const r=e.signer||e.provider;return function(...i){return YM(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=jy(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield GM(e,t,i),s=yield r.call(a,o);try{let r=e.interface.decodeFunctionResult(t,s);return n&&1===t.outputs.length&&(r=r[0]),r}catch(t){throw t.code===_f.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function ZM(e,t){return function(...n){return YM(this,void 0,void 0,(function*(){e.signer||FM.throwError("sending a transaction requires a signer",_f.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const r=yield GM(e,t,n),i=yield e.signer.sendTransaction(r);return function(e,t){const n=t.wait.bind(t);t.wait=t=>n(t).then((t=>(t.events=t.logs.map((n=>{let r=zy(n),i=null;try{i=e.interface.parseLog(n)}catch(e){}return i&&(r.args=i.args,r.decode=(t,n)=>e.interface.decodeEventLog(i.eventFragment,t,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>e.provider,r.getBlock=()=>e.provider.getBlock(t.blockHash),r.getTransaction=()=>e.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(t),r})),t)))}(e,i),i}))}}function JM(e,t,n){return t.constant?qM(e,t,n):ZM(e,t)}function XM(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class KM{constructor(e,t){Ly(this,"tag",e),Ly(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((n=>!(!t&&n.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const n=e.slice();return setTimeout((()=>{t.listener.apply(this,n)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class $M extends KM{constructor(){super("error",null)}}class eA extends KM{constructor(e,t,n,r){const i={address:e};let o=t.getEventTopic(n);r?(o!==r[0]&&FM.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super(XM(i),i),Ly(this,"address",e),Ly(this,"interface",t),Ly(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=function(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let i in r){const o=e.slice();o.push(i);try{n(o,r[i])}catch(e){t.push({path:o,error:e})}}};return n([],e),t}(e.args);if(t.length)throw t[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class tA extends KM{constructor(e,t){super("*",{address:e}),Ly(this,"address",e),Ly(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,n)=>this.interface.decodeEventLog(t.eventFragment,e,n),e.args=t.args}catch(e){}}}class nA extends class{constructor(e,t,n){Ly(this,"interface",xy(new.target,"getInterface")(t)),null==n?(Ly(this,"provider",null),Ly(this,"signer",null)):cv.isSigner(n)?(Ly(this,"provider",n.provider||null),Ly(this,"signer",n)):iv.isProvider(n)?(Ly(this,"provider",n),Ly(this,"signer",null)):FM.throwArgumentError("invalid signer or provider","signerOrProvider",n),Ly(this,"callStatic",{}),Ly(this,"estimateGas",{}),Ly(this,"functions",{}),Ly(this,"populateTransaction",{}),Ly(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const n=this.interface.events[t];Ly(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,e)}))),e[n.name]||(e[n.name]=[]),e[n.name].push(t)})),Object.keys(e).forEach((t=>{const n=e[t];1===n.length?Ly(this.filters,t,this.filters[n[0]]):FM.warn(`Duplicate definition of ${t} (${n.join(", ")})`)}))}if(Ly(this,"_runningEvents",{}),Ly(this,"_wrappedEmits",{}),null==e&&FM.throwArgumentError("invalid contract address or ENS name","addressOrName",e),Ly(this,"address",e),this.provider)Ly(this,"resolvedAddress",VM(this.provider,e));else try{Ly(this,"resolvedAddress",Promise.resolve(Nm(e)))}catch(e){FM.throwError("provider is required to use ENS name as contract address",_f.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const r={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])FM.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const n=t.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(e)}null==this[e]&&Ly(this,e,JM(this,t,!0)),null==this.functions[e]&&Ly(this.functions,e,JM(this,t,!1)),null==this.callStatic[e]&&Ly(this.callStatic,e,qM(this,t,!0)),null==this.populateTransaction[e]&&Ly(this.populateTransaction,e,function(e,t){return function(...n){return GM(e,t,n)}}(this,t)),null==this.estimateGas[e]&&Ly(this.estimateGas,e,function(e,t){const n=e.signer||e.provider;return function(...r){return YM(this,void 0,void 0,(function*(){n||FM.throwError("estimate require a provider or signer",_f.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield GM(e,t,r);return yield n.estimateGas(i)}))}}(this,t))}})),Object.keys(r).forEach((e=>{const t=r[e];if(t.length>1)return;e=e.substring(1);const n=t[0];try{null==this[e]&&Ly(this,e,this[n])}catch(e){}null==this.functions[e]&&Ly(this.functions,e,this.functions[n]),null==this.callStatic[e]&&Ly(this.callStatic,e,this.callStatic[n]),null==this.populateTransaction[e]&&Ly(this.populateTransaction,e,this.populateTransaction[n]),null==this.estimateGas[e]&&Ly(this.estimateGas,e,this.estimateGas[n])}))}static getContractAddress(e){return Im(e)}static getInterface(e){return ev.isInterface(e)?e:new ev(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&FM.throwError("contract not deployed",_f.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||FM.throwError("sending a transactions require a signer",_f.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=jy(e||{});return["from","to"].forEach((function(e){null!=t[e]&&FM.throwError("cannot override "+e,_f.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new lv(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Ly(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Xg.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new $M);if("event"===e)return this._normalizeRunningEvent(new KM("event",null));if("*"===e)return this._normalizeRunningEvent(new tA(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new eA(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const n=this.interface.getEvent(t);return this._normalizeRunningEvent(new eA(this.address,this.interface,n,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new KM(XM(t),t))}return this._normalizeRunningEvent(new tA(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,n){const r=zy(t);return r.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},r.getBlock=()=>this.provider.getBlock(t.blockHash),r.getTransaction=()=>this.provider.getTransaction(t.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(r),r}_addEventListener(e,t,n){if(this.provider||FM.throwError("events require a provider or a signer with a provider",_f.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const n=n=>{let r=this._wrapEvent(e,n,t);if(null==r.decodeError)try{const t=e.getEmit(r);this.emit(e.filter,...t)}catch(e){r.decodeError=e.error}null!=e.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[e.tag]=n,null!=e.filter&&this.provider.on(e.filter,n)}}queryFilter(e,t,n){const r=this._getRunningEvent(e),i=jy(r.filter);return"string"==typeof t&&Gf(t,32)?(null!=n&&FM.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(r,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const n=this._getRunningEvent(e),r=n.run(t)>0;return this._checkRunningEvents(n),r}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(t),this._checkRunningEvents(n),this}removeListener(e,t){return this.off(e,t)}}{}class rA{constructor(e){Ly(this,"alphabet",e),Ly(this,"base",e.length),Ly(this,"_alphabetMap",{}),Ly(this,"_leader",e.charAt(0));for(let t=0;t0;)n.push(r%this.base),r=r/this.base|0}let r="";for(let e=0;0===t[e]&&e=0;--e)r+=this.alphabet[n[e]];return r}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let n=0;n>=8;for(;i>0;)t.push(255&i),i>>=8}for(let n=0;e[n]===this._leader&&n{o[t.toLowerCase()]=e})):r.headers.keys().forEach((e=>{o[e.toLowerCase()]=r.headers.get(e)})),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:Yf(new Uint8Array(i))}}))}var yA=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const mA=new _f("web/5.7.1");function gA(e){return new Promise((t=>{setTimeout(t,e)}))}function vA(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Uf(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Jm(e)}catch(e){}return Zf(e)}return e}function bA(e,t,n){let r=null;if(null!=t){r=Zm(t);const n="string"==typeof e?{url:e}:jy(e);if(n.headers){0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length||(n.headers=jy(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return function(e,t,n){const r="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;mA.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;mA.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let u=null;const c={method:"GET"};let l=!1,d=12e4;if("string"==typeof e)u=e;else if("object"==typeof e){if(null!=e&&null!=e.url||mA.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&mA.throwError("basic authentication requires a secure https url",_f.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+ag(Zm(t))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(c.fetchOptions=jy(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p=u?u.match(h):null;if(p)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":p[1]||"text/plain"},body:p[2]?og(p[3]):(f=p[3],Zm(f.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return n&&(t=n(e.body,e)),Promise.resolve(t)}catch(e){mA.throwError("processing response error",_f.errors.SERVER_ERROR,{body:vA(p[1],p[2]),error:e,requestBody:null,requestMethod:"GET",url:u})}var f;t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const y={};Object.keys(s).forEach((e=>{const t=s[e];y[t.key]=t.value})),c.headers=y;const m=function(){let e=null;return{promise:new Promise((function(t,n){d&&(e=setTimeout((()=>{null!=e&&(e=null,n(mA.makeError("timeout",_f.errors.TIMEOUT,{requestBody:vA(c.body,y["content-type"]),requestMethod:c.method,timeout:d,url:u})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return yA(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(m.cancel(),mA.throwError("bad response",_f.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:vA(s,t.headers?t.headers["content-type"]:null),requestBody:vA(c.body,y["content-type"]),requestMethod:c.method,url:u})),n)try{const e=yield n(s,t);return m.cancel(),e}catch(n){if(n.throttleRetry&&e{let r=null;if(null!=e)try{r=JSON.parse(Jm(e))}catch(t){mA.throwError("invalid JSON",_f.errors.SERVER_ERROR,{body:e,error:t})}return n&&(r=n(r,t)),r}))}function wA(e,t){return t||(t={}),null==(t=jy(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(n,r){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&r(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let u=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(u++,u>s)return void(a()&&r(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&r(e)}))}()}))}for(var MA="qpzry9x8gf2tvdw0s3jn54khce6mua7l",AA={},EA=0;EA>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function IA(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=NA(t)^r>>5}for(t=NA(t),n=0;nt)return"Exceeds length limit";var n=e.toLowerCase(),r=e.toUpperCase();if(e!==n&&e!==r)return"Mixed-case string "+e;var i=(e=n).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=IA(o);if("string"==typeof s)return s;for(var u=[],c=0;c=a.length||u.push(d)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:u}}function LA(e,t,n,r){for(var i=0,o=0,a=(1<=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<=t)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var r=IA(e=e.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");r=NA(r)^a,i+=MA.charAt(a)}for(o=0;o<6;++o)r=NA(r);for(r^=1,o=0;o<6;++o){i+=MA.charAt(r>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=LA(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=LA(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=LA(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=LA(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}};const SA="providers/5.7.2",jA=new _f(SA);class CA{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),n=this.bigNumber.bind(this),r=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return e.transaction={hash:o,type:u,accessList:CA.allowNull(this.accessList.bind(this),null),blockHash:CA.allowNull(o,null),blockNumber:CA.allowNull(s,null),transactionIndex:CA.allowNull(s,null),confirmations:CA.allowNull(s,null),from:t,gasPrice:CA.allowNull(n),maxPriorityFeePerGas:CA.allowNull(n),maxFeePerGas:CA.allowNull(n),gasLimit:n,to:CA.allowNull(t,null),value:n,nonce:s,data:i,r:CA.allowNull(this.uint256),s:CA.allowNull(this.uint256),v:CA.allowNull(s),creates:CA.allowNull(t,null),raw:CA.allowNull(i)},e.transactionRequest={from:CA.allowNull(t),nonce:CA.allowNull(s),gasLimit:CA.allowNull(n),gasPrice:CA.allowNull(n),maxPriorityFeePerGas:CA.allowNull(n),maxFeePerGas:CA.allowNull(n),to:CA.allowNull(t),value:CA.allowNull(n),data:CA.allowNull((e=>this.data(e,!0))),type:CA.allowNull(s),accessList:CA.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:CA.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:CA.allowNull(this.address,null),from:CA.allowNull(this.address,null),contractAddress:CA.allowNull(t,null),transactionIndex:s,root:CA.allowNull(a),gasUsed:n,logsBloom:CA.allowNull(i),blockHash:o,transactionHash:o,logs:CA.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:CA.allowNull(s,null),cumulativeGasUsed:n,effectiveGasPrice:CA.allowNull(n),status:CA.allowNull(s),type:u},e.block={hash:CA.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:CA.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:CA.allowNull(t),extraData:i,transactions:CA.allowNull(CA.arrayOf(o)),baseFeePerGas:CA.allowNull(n)},e.blockWithTransactions=jy(e.block),e.blockWithTransactions.transactions=CA.allowNull(CA.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:CA.allowNull(r,void 0),toBlock:CA.allowNull(r,void 0),blockHash:CA.allowNull(o,void 0),address:CA.allowNull(t,void 0),topics:CA.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:CA.allowNull(s),blockHash:CA.allowNull(o),transactionIndex:s,removed:CA.allowNull(this.boolean.bind(this)),address:t,data:CA.allowFalsish(i,"0x"),topics:CA.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return PM(e||[])}number(e){return"0x"===e?0:uy.from(e).toNumber()}type(e){return"0x"===e||null==e?0:uy.from(e).toNumber()}bigNumber(e){return uy.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Gf(e))?e.toLowerCase():jA.throwArgumentError("invalid hash","value",e)}data(e,t){const n=this.hex(e,t);if(n.length%2!=0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Nm(e)}callAddress(e){if(!Gf(e,32))return null;const t=Nm(Xf(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return Im(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Gf(e))return $f(e);throw new Error("invalid blockTag")}hash(e,t){const n=this.hex(e,t);return 32!==Jf(n)?jA.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(null==e)return null;const t=uy.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Gf(e))throw new Error("invalid uint256");return ey(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const n=null!=e._difficulty?e._difficulty:e.difficulty,r=CA.check(t,e);return r._difficulty=null==n?null:uy.from(n),r}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return CA.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&uy.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=CA.check(this.formats.transaction,e);if(null!=e.chainId){let n=e.chainId;Gf(n)&&(n=uy.from(n).toNumber()),t.chainId=n}else{let n=e.networkId;null==n&&null==t.v&&(n=e.chainId),Gf(n)&&(n=uy.from(n).toNumber()),"number"!=typeof n&&null!=t.v&&(n=(t.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),t.chainId=n}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return QM(e)}receiptLog(e){return CA.check(this.formats.receiptLog,e)}receipt(e){const t=CA.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=uy.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&jA.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):jA.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&jA.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return CA.check(this.formats.filter,e)}filterLog(e){return CA.check(this.formats.filterLog,e)}static check(e,t){const n={};for(const r in e)try{const i=e[r](t[r]);void 0!==i&&(n[r]=i)}catch(e){throw e.checkKey=r,e.checkValue=t[r],e}return n}static allowNull(e,t){return function(n){return null==n?t:e(n)}}static allowFalsish(e,t){return function(n){return n?e(n):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const n=[];return t.forEach((function(t){n.push(e(t))})),n}}}var DA=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const OA=new _f(SA);function zA(e){return null==e?"null":(32!==Jf(e)&&OA.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function _A(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[zA(e)]=!0}));const n=Object.keys(t);return n.sort(),n.join("|")}return zA(e)})).join("&")}function PA(e){if("string"==typeof e){if(32===Jf(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+_A(e);if(rv.isForkEvent(e))throw OA.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+_A(e.topics||[])}throw new Error("invalid event - "+e)}function RA(){return(new Date).getTime()}function BA(e){return new Promise((t=>{setTimeout(t,e)}))}const UA=["block","network","pending","poll"];class WA{constructor(e,t,n){Ly(this,"tag",e),Ly(this,"listener",t),Ly(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],n=""===(r=e[2])?[]:r.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var r;const i={};return n.length>0&&(i.topics=n),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||UA.indexOf(this.tag)>=0}}const QA={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function YA(e){return ey(uy.from(e).toHexString(),32)}function FA(e){return iA.encode(Ff([e,Xf(oA(oA(e)),0,4)]))}const VA=new RegExp("^(ipfs)://(.*)$","i"),HA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),VA,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function GA(e,t){try{return Jm(qA(e,t))}catch(e){}return null}function qA(e,t){if("0x"===e)return null;const n=uy.from(Xf(e,t,t+32)).toNumber(),r=uy.from(Xf(e,n,n+32)).toNumber();return Xf(e,n+32,n+32+r)}function ZA(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):OA.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function JA(e){const t=Yf(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function XA(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function KA(e){const t=[];let n=0;for(let r=0;ruy.from(e).eq(1))).catch((e=>{if(e.code===_f.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return DA(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:Kf([e,Sg(this.name),t||"0x"])};let r=!1;var i;(yield this.supportsWildcard())&&(r=!0,n.data=Kf(["0x9061b923",KA([(i=this.name,Zf(Ff(xg(i).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),n.data])]));try{let e=yield this.provider.call(n);return Yf(e).length%32==4&&OA.throwError("resolver threw error",_f.errors.CALL_EXCEPTION,{transaction:n,data:e}),r&&(e=qA(e,0)),e}catch(e){if(e.code===_f.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return DA(this,void 0,void 0,(function*(){const n=yield this._fetch(e,t);return null!=n?qA(n,0):null}))}_getAddress(e,t){const n=QA[String(e)];if(null==n&&OA.throwError(`unsupported coin type: ${e}`,_f.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===n.ilk)return this.provider.formatter.address(t);const r=Yf(t);if(null!=n.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return FA(Ff([[n.p2pkh],"0x"+e[2]]))}}if(null!=n.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return FA(Ff([[n.p2sh],"0x"+e[2]]))}}if(null!=n.prefix){const e=r[1];let t=r[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&r.length===2+e&&e>=1&&e<=75){const e=xA.toWords(r.slice(2));return e.unshift(t),xA.encode(n.prefix,e)}}return null}getAddress(e){return DA(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===_f.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",YA(e));if(null==t||"0x"===t)return null;const n=this._getAddress(e,t);return null==n&&OA.throwError("invalid or unsupported coin data",_f.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),n}))}getAvatar(){return DA(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let n=0;ne[t]))}return OA.throwError("invalid or unsupported content hash data",_f.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return DA(this,void 0,void 0,(function*(){let t=Zm(e);t=Ff([YA(64),YA(t.length),t]),t.length%32!=0&&(t=Ff([t,ey("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Zf(t));return null==n||"0x"===n?null:Jm(n)}))}}let eE=null,tE=1;class nE extends iv{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Ly(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=xy(new.target,"getNetwork")(e);t?(Ly(this,"_network",t),this.emit("network",t,null)):OA.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return DA(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||OA.throwError("no network detected",_f.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:Ly(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return wA((()=>this._ready().then((e=>e),(e=>{if(e.code!==_f.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==eE&&(eE=new CA),eE}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in hA){const n=hA[t];if(n.chainId===e)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=hA[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=hA[e.name];if(!t)return"number"!=typeof e.chainId&&aA.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&aA.throwArgumentError("network chainId mismatch","network",e);let n=e._defaultProvider||null;var r;return null==n&&t._defaultProvider&&(n=(r=t._defaultProvider)&&"function"==typeof r.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:n}}(null==e?"homestead":e)}ccipReadFetch(e,t,n){return DA(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:r}),u=yield bA({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(u.data)return u.data;const c=u.message||"unknown error";if(u.status>=400&&u.status<500)return OA.throwError(`response not found during CCIP fetch: ${c}`,_f.errors.SERVER_ERROR,{url:t,errorMessage:c});o.push(c)}return OA.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,_f.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(e){return DA(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const n=yield t;if(RA()-n.respTime<=e)return n.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=RA(),n=Sy({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=RA();return(e=uy.from(e).toNumber()){this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return DA(this,void 0,void 0,(function*(){const e=tE++,t=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)OA.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",OA.makeError("network block skew detected",_f.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let e=this._emitted.block+1;e<=n;e++)this.emit("block",e);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&n-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((e=>{switch(e.type){case"tx":{const n=e.hash;let r=this.getTransactionReceipt(n).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+n]=e.blockNumber,this.emit(n,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(r);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);const r=e.filter;r.fromBlock=e._lastBlockNumber+1,r.toBlock=n;const i=r.toBlock-this._maxFilterBlockRange;i>r.fromBlock&&(r.fromBlock=i),r.fromBlock<0&&(r.fromBlock=0);const o=this.getLogs(r).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(r,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=n,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return DA(this,void 0,void 0,(function*(){return OA.throwError("provider does not support network detection",_f.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return DA(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield BA(0),this._network;const n=OA.makeError("underlying network changed",_f.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",n),n}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=RA();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,n){return DA(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,n||0,null)}))}_waitForTransaction(e,t,n,r){return DA(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const u=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},c=e=>{e.confirmations{this.removeListener(e,c)})),r){let n=r.startBlock,i=null;const c=a=>DA(this,void 0,void 0,(function*(){s||(yield BA(1e3),this.getTransactionCount(r.from).then((l=>DA(this,void 0,void 0,(function*(){if(!s){if(l<=r.nonce)n=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=n-3,i{s||this.once("block",c)})))}));if(s)return;this.once("block",c),a.push((()=>{this.removeListener("block",c)}))}if("number"==typeof n&&n>0){const e=setTimeout((()=>{u()||o(OA.makeError("timeout exceeded",_f.errors.TIMEOUT,{timeout:n}))}),n);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return DA(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return DA(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return uy.from(e)}catch(t){return OA.throwError("bad result from backend",_f.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return DA(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Sy({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getBalance",n);try{return uy.from(r)}catch(e){return OA.throwError("bad result from backend",_f.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:e})}}))}getTransactionCount(e,t){return DA(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Sy({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getTransactionCount",n);try{return uy.from(r).toNumber()}catch(e){return OA.throwError("bad result from backend",_f.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:e})}}))}getCode(e,t){return DA(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Sy({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getCode",n);try{return Zf(r)}catch(e){return OA.throwError("bad result from backend",_f.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:e})}}))}getStorageAt(e,t,n){return DA(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Sy({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((e=>$f(e)))}),i=yield this.perform("getStorageAt",r);try{return Zf(i)}catch(e){return OA.throwError("bad result from backend",_f.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:e})}}))}_wrapTransaction(e,t,n){if(null!=t&&32!==Jf(t))throw new Error("invalid response - sendTransaction");const r=e;return null!=t&&e.hash!==t&&OA.throwError("Transaction hash mismatch from Provider.sendTransaction.",_f.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),r.wait=(t,r)=>DA(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==r&&(r=0),0!==t&&null!=n&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const o=yield this._waitForTransaction(e.hash,t,r,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&OA.throwError("transaction failed",_f.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),r}sendTransaction(e){return DA(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>Zf(e))),n=this.formatter.transaction(e);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(n,e,r)}catch(e){throw e.transaction=n,e.transactionHash=n.hash,e}}))}_getTransactionRequest(e){return DA(this,void 0,void 0,(function*(){const t=yield e,n={};return["from","to"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?uy.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(n.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?Zf(e):null)))})),this.formatter.transactionRequest(yield Sy(n))}))}_getFilter(e){return DA(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((n=>{null!=e[n]&&(t[n]=e[n])})),["fromBlock","toBlock"].forEach((n=>{null!=e[n]&&(t[n]=this._getBlockTag(e[n]))})),this.formatter.filter(yield Sy(t))}))}_call(e,t,n){return DA(this,void 0,void 0,(function*(){n>=10&&OA.throwError("CCIP read exceeded maximum redirections",_f.errors.SERVER_ERROR,{redirects:n,transaction:e});const r=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(n>=0&&"latest"===t&&null!=r&&"0x556f1830"===i.substring(0,10)&&Jf(i)%32==4)try{const o=Xf(i,4),a=Xf(o,0,32);uy.from(a).eq(r)||OA.throwError("CCIP Read sender did not match",_f.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],u=uy.from(Xf(o,32,64)).toNumber(),c=uy.from(Xf(o,u,u+32)).toNumber(),l=Xf(o,u+32);for(let t=0;tDA(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",r);if(null==e)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(t){let t=null;for(let n=0;nthis._wrapTransaction(e))),n}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return DA(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return wA((()=>DA(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(e){return DA(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return wA((()=>DA(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return r}))),{oncePoll:this})}))}getLogs(e){return DA(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Sy({filter:this._getFilter(e)}),n=yield this.perform("getLogs",t);return n.forEach((e=>{null==e.removed&&(e.removed=!1)})),CA.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return DA(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return DA(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&OA.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return DA(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const n=yield this._getResolver(t,"getResolver");if(null!=n){const r=new $A(this,n,e);return t===e||(yield r.supportsWildcard())?r:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return DA(this,void 0,void 0,(function*(){null==t&&(t="ENS");const n=yield this.getNetwork();n.ensAddress||OA.throwError("network does not support ENS",_f.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name});try{const t=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Sg(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return DA(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Gf(e))throw t}"string"!=typeof e&&OA.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return DA(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(t,"lookupAddress");if(null==n)return null;const r=GA(yield this.call({to:n,data:"0x691f3431"+Sg(t).substring(2)}),0);return(yield this.resolveName(r))!=e?null:r}))}getAvatar(e){return DA(this,void 0,void 0,(function*(){let t=null;if(Gf(e)){const n=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(n,"getAvatar");if(!r)return null;t=new $A(this,r,n);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==_f.errors.CALL_EXCEPTION)throw e}try{const e=GA(yield this.call({to:r,data:"0x691f3431"+Sg(n).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==_f.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const n=yield t.getAvatar();return null==n?null:n.url}))}perform(e,t){return OA.throwError(e+" not implemented",_f.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,n){const r=new WA(PA(e),t,n);return this._events.push(r),this._startEvent(r),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let n=!1,r=[],i=PA(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),n=!0,!e.once||(r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),n}listenerCount(e){if(!e)return this._events.length;let t=PA(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=PA(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const n=[];let r=!1,i=PA(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!r||(r=!0,n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const n=PA(e);this._events=this._events.filter((e=>e.tag!==n||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var rE=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};const iE=new _f(SA),oE=["call","estimateGas"];function aE(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const n=Gf(e.data)?e.data:null;if(!t||n)return{message:e.message,data:n}}if("object"==typeof e){for(const n in e){const r=aE(e[n],t);if(r)return r}return null}if("string"==typeof e)try{return aE(JSON.parse(e),t)}catch(e){}return null}function sE(e,t,n){const r=n.transaction||n.signedTransaction;if("call"===e){const e=aE(t,!0);if(e)return e.data;iE.throwError("missing revert data in call exception; Transaction reverted without a reason string",_f.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:t})}if("estimateGas"===e){let n=aE(t.body,!1);null==n&&(n=aE(t,!1)),n&&iE.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",_f.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:e,transaction:r,error:t})}let i=t.message;throw t.code===_f.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&iE.throwError("insufficient funds for intrinsic transaction cost",_f.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),i.match(/nonce (is )?too low/i)&&iE.throwError("nonce has already been used",_f.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&iE.throwError("replacement fee too low",_f.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),i.match(/only replay-protected/i)&&iE.throwError("legacy pre-eip-155 transactions not supported",_f.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:r}),oE.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&iE.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",_f.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function uE(e){return new Promise((function(t){setTimeout(t,e)}))}function cE(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function lE(e){return e?e.toLowerCase():e}const dE={};class hE extends cv{constructor(e,t,n){if(super(),e!==dE)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Ly(this,"provider",t),null==n&&(n=0),"string"==typeof n?(Ly(this,"_address",this.provider.formatter.address(n)),Ly(this,"_index",null)):"number"==typeof n?(Ly(this,"_index",n),Ly(this,"_address",null)):iE.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return iE.throwError("cannot alter JSON-RPC Signer connection",_f.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new pE(dE,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&iE.throwError("unknown account #"+this._index,_f.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=jy(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const n=jy(e);n.from=t,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>rE(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&iE.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),Sy({tx:Sy(e),sender:t}).then((({tx:t,sender:n})=>{null!=t.from?t.from.toLowerCase()!==n&&iE.throwArgumentError("from address mismatch","transaction",e):t.from=n;const r=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&iE.throwError("user rejected transaction",_f.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),sE("sendTransaction",e,r))))}))}signTransaction(e){return iE.throwError("signing transactions is unsupported",_f.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return rE(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield wA((()=>rE(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(n);if(null!==e)return this.provider._wrapTransaction(e,n,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=n,e}}))}signMessage(e){return rE(this,void 0,void 0,(function*(){const t="string"==typeof e?Zm(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Zf(t),n.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&iE.throwError("user rejected signing",_f.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),t}}))}_legacySignMessage(e){return rE(this,void 0,void 0,(function*(){const t="string"==typeof e?Zm(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Zf(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&iE.throwError("user rejected signing",_f.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),t}}))}_signTypedData(e,t,n){return rE(this,void 0,void 0,(function*(){const r=yield Hg.resolveNames(e,t,n,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Hg.getPayload(r.domain,t,r.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&iE.throwError("user rejected signing",_f.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:r.domain,types:t,value:r.value}}),e}}))}unlock(e){return rE(this,void 0,void 0,(function*(){const t=this.provider,n=yield this.getAddress();return t.send("personal_unlockAccount",[n.toLowerCase(),e,null])}))}}class pE extends hE{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const fE={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class yE extends nE{constructor(e,t){let n=t;null==n&&(n=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(n),e||(e=xy(this.constructor,"defaultUrl")()),Ly(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(jy(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return rE(this,void 0,void 0,(function*(){yield uE(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=xy(this.constructor,"getNetwork");try{return t(uy.from(e).toNumber())}catch(t){return iE.throwError("could not detect network",_f.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return iE.throwError("could not detect network",_f.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new hE(dE,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:zy(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(r&&this._cache[e])return this._cache[e];const i=bA(this.connection,JSON.stringify(n),cE).then((e=>(this.emit("debug",{action:"response",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:n,provider:this}),e}));return r&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[lE(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[lE(t.address),t.blockTag]];case"getCode":return["eth_getCode",[lE(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[lE(t.address),ey(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[xy(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[xy(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=lE(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return rE(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&uy.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((t=jy(t)).transaction=jy(e),delete t.transaction.type)}}const n=this.prepareRequest(e,t);null==n&&iE.throwError(e+" not implemented",_f.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(n){return sE(e,n,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;let r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return uE(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((e=>{}))}(),n})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const n=jy(fE);if(t)for(const e in t)t[e]&&(n[e]=!0);var r,i;i=n,(r=e)&&"object"==typeof r||ky.throwArgumentError("invalid object","object",r),Object.keys(r).forEach((e=>{i[e]||ky.throwArgumentError("invalid object key - "+e,"transaction:"+e,r)}));const o={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const n=$f(uy.from(e[t]));"gasLimit"===t&&(t="gas"),o[t]=n})),["from","to","data"].forEach((function(t){null!=e[t]&&(o[t]=Zf(e[t]))})),e.accessList&&(o.accessList=PM(e.accessList)),o}}const mE=new _f(SA);let gE=1;function vE(e,t){const n="Web3LegacyFetcher";return function(e,r){const i={method:e,params:r,id:gE++,jsonrpc:"2.0"};return new Promise(((e,r)=>{this.emit("debug",{action:"request",fetcher:n,request:zy(i),provider:this}),t(i,((t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:n,error:t,request:i,provider:this}),r(t);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,r(e)}e(o.result)}))}))}}class bE extends yE{constructor(e,t){null==e&&mE.throwArgumentError("missing provider","provider",e);let n=null,r=null,i=null;"function"==typeof e?(n="unknown:",r=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),i=e,e.request?(""===n&&(n="eip-1193:"),r=function(e){return function(t,n){null==n&&(n=[]);const r={method:t,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:zy(r),provider:this}),e.request(r).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:e,provider:this}),e}))}}(e)):e.sendAsync?r=vE(0,e.sendAsync.bind(e)):e.send?r=vE(0,e.send.bind(e)):mE.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,t),Ly(this,"jsonRpcFetchFunc",r),Ly(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const wE=new RegExp("^bytes([0-9]+)$"),ME=new RegExp("^(u?int)([0-9]*)$"),AE=new RegExp("^(.*)\\[([0-9]*)\\]$"),EE=new _f("solidity/5.7.0");function TE(e,t,n){switch(e){case"address":return n?Hf(t,32):Yf(t);case"string":return Zm(t);case"bytes":return Yf(t);case"bool":return t=t?"0x01":"0x00",n?Hf(t,32):Yf(t)}let r=e.match(ME);if(r){let i=parseInt(r[2]||"256");return(r[2]&&String(i)!==r[2]||i%8!=0||0===i||i>256)&&EE.throwArgumentError("invalid number type","type",e),n&&(i=256),Hf(t=uy.from(t).toTwos(i),i/8)}if(r=e.match(wE),r){const i=parseInt(r[1]);return(String(i)!==r[1]||0===i||i>32)&&EE.throwArgumentError("invalid bytes type","type",e),Yf(t).byteLength!==i&&EE.throwArgumentError(`invalid value for ${e}`,"value",t),n?Yf((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if(r=e.match(AE),r&&Array.isArray(t)){const n=r[1];parseInt(r[2]||String(t.length))!=t.length&&EE.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(TE(n,e,!0))})),Ff(i)}return EE.throwArgumentError("invalid type","type",e)}function NE(e,t){e.length!=t.length&&EE.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const n=[];return e.forEach((function(e,r){n.push(TE(e,t[r]))})),Zf(Ff(n))}const IE=new _f("units/5.7.0"),kE=["wei","kwei","mwei","gwei","szabo","finney","ether"];function LE(e,t){if("string"==typeof t){const e=kE.indexOf(t);-1!==e&&(t=3*e)}return wy(e,null!=t?t:18)}function xE(e,t){if("string"!=typeof e&&IE.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=kE.indexOf(t);-1!==e&&(t=3*e)}return My(e,null!=t?t:18)}let SE,jE=()=>SE||(SE="object"==typeof r?r:window,SE);const CE=()=>(void 0===jE()._Web3ClientConfiguration&&(jE()._Web3ClientConfiguration={}),jE()._Web3ClientConfiguration);function DE(e){let t,n=e[0],r=1;for(;rn.call(t,...e))),t=void 0)}return n}class OE extends yE{constructor(e,t,n,r){super(e),this._network=t,this._endpoint=e,this._endpoints=n,this._failover=r,this._pendingBatch=[]}detectNetwork(){return Promise.resolve(sf.findByName(this._network).id)}requestChunk(e,t){try{const n=e.map((e=>e.request));return bA(t,JSON.stringify(n)).then((t=>{e.forEach(((e,n)=>{const r=t[n];if(DE([r,"optionalAccess",e=>e.error])){const t=new Error(r.error.message);t.code=r.error.code,t.data=r.error.data,e.reject(t)}else DE([r,"optionalAccess",e=>e.result])?e.resolve(r.result):e.reject()}))})).catch((t=>{if(t&&"SERVER_ERROR"==t.code){const t=this._endpoints.indexOf(this._endpoint)+1;this._failover(),this._endpoint=t>=this._endpoints.length?this._endpoints[0]:this._endpoints[t],this.requestChunk(e,this._endpoint)}else e.forEach((e=>{e.reject(t)}))}))}catch(t){e.forEach((e=>{e.reject()}))}}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const r={request:n,resolve:null,reject:null},i=new Promise(((e,t)=>{r.resolve=e,r.reject=t}));return this._pendingBatch.push(r),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=[],this._pendingBatchAggregator=null;const t=[];for(let n=0;n(e.map((e=>e.request)),this.requestChunk(e,this._endpoint))))}),CE().batchInterval||10)),i}}const zE=()=>(null==jE()._Web3ClientProviders&&(jE()._Web3ClientProviders={}),jE()._Web3ClientProviders),_E=(e,t)=>{void 0===zE()[e]&&(zE()[e]=[]);const n=zE()[e].indexOf(t);n>-1&&zE()[e].splice(n,1),zE()[e].unshift(t)},PE=async(e,t,n=!0)=>{let r;zE()[e]=t.map(((r,i)=>new OE(r,e,t,(()=>{1===zE()[e].length?PE(e,t,n):zE()[e].splice(i,1)}))));let i=jE();if(null==i.fetch||void 0!==k&&k.env&&"test"==k.env.NODE_ENV||void 0!==i.cy||!1===n)r=zE()[e][0];else{let n=await Promise.all(t.map((e=>new Promise((async t=>{let n=(new Date).getTime();setTimeout((()=>t(900)),900);if(!(await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({method:"net_version",id:1,jsonrpc:"2.0"})})).ok)return t(999);let r=(new Date).getTime();t(r-n)})))));const i=Math.min(...n),o=n.indexOf(i);r=zE()[e][o]}_E(e,r)};var RE={getProvider:async e=>{let t=zE();if(t&&t[e])return t[e][0];let n=jE();return n._Web3ClientGetProviderPromise&&n._Web3ClientGetProviderPromise[e]||(n._Web3ClientGetProviderPromise||(n._Web3ClientGetProviderPromise={}),n._Web3ClientGetProviderPromise[e]=new Promise((async t=>{await PE(e,sf[e].endpoints),t(jE()._Web3ClientProviders[e][0])}))),await n._Web3ClientGetProviderPromise[e]},getProviders:async e=>{let t=zE();if(t&&t[e])return t[e];let n=jE();return n._Web3ClientGetProvidersPromise&&n._Web3ClientGetProvidersPromise[e]||(n._Web3ClientGetProvidersPromise||(n._Web3ClientGetProvidersPromise={}),n._Web3ClientGetProvidersPromise[e]=new Promise((async t=>{await PE(e,sf[e].endpoints),t(jE()._Web3ClientProviders[e])}))),await n._Web3ClientGetProvidersPromise[e]},setProviderEndpoints:PE,setProvider:_E};class BE extends ud{constructor(e,t,n,r){super(e),this._provider=new ud(e),this._network=t,this._endpoint=e,this._endpoints=n,this._failover=r,this._pendingBatch=[],this._rpcRequest=this._rpcRequestReplacement.bind(this)}requestChunk(e){const t=e.map((e=>e.request)),n=t=>{if(t&&["Failed to fetch","limit reached","504","503","502","500","429","426","422","413","409","408","406","405","404","403","402","401","400"].some((e=>t.toString().match(e)))){const t=this._endpoints.indexOf(this._endpoint)+1;this._endpoint=t>=this._endpoints.length?this._endpoints[0]:this._endpoints[t],this._provider=new ud(this._endpoint),this.requestChunk(e)}else e.forEach((e=>{e.reject(t)}))};try{return this._provider._rpcBatchRequest(t).then((t=>{e.forEach(((e,n)=>{const r=t[n];if(function(e){let t,n=e[0],r=1;for(;rn.call(t,...e))),t=void 0)}return n}([r,"optionalAccess",e=>e.error])){const t=new Error(r.error.message);t.code=r.error.code,t.data=r.error.data,e.reject(t)}else r?e.resolve(r):e.reject()}))})).catch(n)}catch(e){return n(e)}}_rpcRequestReplacement(e,t){const n={methodName:e,args:t};null==this._pendingBatch&&(this._pendingBatch=[]);const r={request:n,resolve:null,reject:null},i=new Promise(((e,t)=>{r.resolve=e,r.reject=t}));return this._pendingBatch.push(r),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=[],this._pendingBatchAggregator=null;const t=[];for(let n=0;n(e.map((e=>e.request)),this.requestChunk(e))))}),CE().batchInterval||10)),i}}const UE=()=>(null==jE()._Web3ClientProviders&&(jE()._Web3ClientProviders={}),jE()._Web3ClientProviders),WE=(e,t)=>{void 0===UE()[e]&&(UE()[e]=[]);const n=UE()[e].indexOf(t);n>-1&&UE()[e].splice(n,1),UE()[e].unshift(t)},QE=async(e,t,n=!0)=>{let r;UE()[e]=t.map(((r,i)=>new BE(r,e,t,(()=>{1===UE()[e].length?QE(e,t,n):UE()[e].splice(i,1)}))));let i=jE();if(null==i.fetch||void 0!==k&&k.env&&"test"==k.env.NODE_ENV||void 0!==i.cy||!1===n)r=UE()[e][0];else{let n=await Promise.all(t.map((e=>new Promise((async t=>{let n=(new Date).getTime();setTimeout((()=>t(900)),900);if(!(await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({method:"getIdentity",id:1,jsonrpc:"2.0"})})).ok)return t(999);let r=(new Date).getTime();t(r-n)})))));const i=Math.min(...n),o=n.indexOf(i);r=UE()[e][o]}WE(e,r)};var YE={getProvider:async e=>{let t=UE();if(t&&t[e])return t[e][0];let n=jE();return n._Web3ClientGetProviderPromise&&n._Web3ClientGetProviderPromise[e]||(n._Web3ClientGetProviderPromise||(n._Web3ClientGetProviderPromise={}),n._Web3ClientGetProviderPromise[e]=new Promise((async t=>{await QE(e,sf[e].endpoints),t(jE()._Web3ClientProviders[e][0])}))),await n._Web3ClientGetProviderPromise[e]},getProviders:async e=>{let t=UE();if(t&&t[e])return t[e];let n=jE();return n._Web3ClientGetProvidersPromise&&n._Web3ClientGetProvidersPromise[e]||(n._Web3ClientGetProvidersPromise||(n._Web3ClientGetProvidersPromise={}),n._Web3ClientGetProvidersPromise[e]=new Promise((async t=>{await QE(e,sf[e].endpoints),t(jE()._Web3ClientProviders[e])}))),await n._Web3ClientGetProvidersPromise[e]},setProviderEndpoints:QE,setProvider:WE};let FE=["ethereum","bsc","polygon","solana","fantom","arbitrum","avalanche","gnosis","optimism","base"];FE.evm=["ethereum","bsc","polygon","fantom","arbitrum","avalanche","gnosis","optimism","base"],FE.solana=["solana"];let VE=()=>(null==jE()._Web3ClientCacheStore&&(jE()._Web3ClientCacheStore={}),jE()._Web3ClientCacheStore),HE=()=>(null==jE()._Web3ClientPromiseStore&&(jE()._Web3ClientPromiseStore={}),jE()._Web3ClientPromiseStore),GE=function({key:e}){HE()[e]=void 0},qE=function({call:e,key:t,expires:n=0}){return new Promise(((r,i)=>{let o,a=function({key:e}){return HE()[e]}({key:t=JSON.stringify(t)});if(a)return a.then(r).catch(i);(function({key:e,promise:t}){return HE()[e]=t,t})({key:t,promise:new Promise(((a,s)=>0===n?e().then((e=>{r(e),a(e)})).catch((e=>{i(e),s(e)})):(o=function({key:e,expires:t}){let n=VE()[e];if(function(e){let t,n=e[0],r=1;for(;rn.call(t,...e))),t=void 0)}return n}([n,"optionalAccess",e=>e.expiresAt])>Date.now())return n.value}({key:t,expires:n}),o?(r(o),a(o),o):void e().then((e=>{e&&function({key:e,value:t,expires:n}){VE()[e]={expiresAt:Date.now()+n,value:t}}({key:t,value:e,expires:n}),r(e),a(e)})).catch((e=>{i(e),s(e)})))))}).then((()=>{GE({key:t})})).catch((()=>{GE({key:t})}))}))};const ZE=async e=>{if(FE.evm.includes(e))return await RE.getProvider(e);if(FE.solana.includes(e))return await YE.getProvider(e);throw"Unknown blockchain: "+e},JE=e=>`(${e.map((e=>"tuple"===e.type?JE(e.components):e.type)).join(",")})`;var XE=({provider:e,from:t,to:n,value:r,method:i,api:o,params:a})=>{if(void 0===o)return e.estimateGas({from:t,to:n,value:r});{let s=new nA(n,o,e),u=s.interface.fragments.find((e=>e.name==i)),c=(({contract:e,method:t,params:n})=>{let r=e.interface.fragments.find((e=>e.name==t));return n instanceof Array?n:n instanceof Object?r.inputs.map((e=>n[e.name])):void 0})({contract:s,method:i,params:a});void 0===s[i]&&(i=`${i}(${u.inputs.map((e=>"tuple"===e.type?JE(e.components):e.type)).join(",")})`);let l=s.estimateGas[i];return c?l(...c,{from:t,value:r}):l({from:t,value:r})}};let KE=async function({blockchain:e,from:t,to:n,value:r,method:i,api:o,params:a,cache:s}){if(!FE.includes(e))throw"Unknown blockchain: "+e;void 0===r&&(r="0");const u=await ZE(e);return await qE({expires:s||0,key:[e,t,n,r,i,a],call:async()=>XE({provider:u,from:t,to:n,value:r,method:i,api:o,params:a})})};const $E=({address:e,api:t,method:n,params:r,provider:i,block:o})=>{const a=new nA(e,t,i),s=(({contract:e,method:t,params:n})=>e.interface.fragments.find((e=>e.name==t)).inputs.map(((e,t)=>Array.isArray(n)?n[t]:n[e.name])))({contract:a,method:n,params:r}),u=a.interface.fragments.find((e=>e.name===n));return void 0===a[n]&&(n=`${n}(${u.inputs.map((e=>e.type)).join(",")})`),u&&"nonpayable"===u.stateMutability?a.callStatic[n](...s,{blockTag:o}):a[n](...s,{blockTag:o})},eT=({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a})=>n?$E({address:t,api:n,method:r,params:i,provider:a,block:o}):"latestBlockNumber"===r?a.getBlockNumber():"balance"===r?(({address:e,provider:t})=>t.getBalance(e))({address:t,provider:a}):"transactionCount"===r?(({address:e,provider:t})=>t.getTransactionCount(e))({address:t,provider:a}):void 0;const tT=async({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a,providers:s})=>{try{if(null==r||"getAccountInfo"===r)return null==n&&(n=vp),await(async({address:e,api:t,method:n,params:r,provider:i,block:o})=>{const a=await i.getAccountInfo(new lu(e));if(a&&a.data)return t.decode(a.data)})({address:t,api:n,method:r,params:i,provider:a,block:o});if("getProgramAccounts"===r)return await a.getProgramAccounts(new lu(t),i).then((e=>n?e.map((e=>(e.data=n.decode(e.account.data),e))):e));if("getTokenAccountBalance"===r)return await a.getTokenAccountBalance(new lu(t));if("latestBlockNumber"===r)return await a.getSlot(i||void 0);if("balance"===r)return await(({address:e,provider:t})=>t.getBalance(new lu(e)))({address:t,provider:a})}catch(u){if(s&&u&&["Failed to fetch","limit reached","504","503","502","500","429","426","422","413","409","408","406","405","404","403","402","401","400"].some((e=>u.toString().match(e)))){let u=s[s.indexOf(a)+1]||s[0];return tT({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:u,providers:s})}throw u}};const nT=async function(e,t){const{blockchain:n,address:r,method:i}=(e=>{if("object"==typeof e)return e;let t=e.match(/(?\w+):\/\/(?[\w\d]+)(\/(?[\w\d]+)*)?/);return null==t.groups.part2?t.groups.part1.match(/\d/)?{blockchain:t.groups.blockchain,address:t.groups.part1}:{blockchain:t.groups.blockchain,method:t.groups.part1}:{blockchain:t.groups.blockchain,address:t.groups.part1,method:t.groups.part2}})(e),{api:o,params:a,cache:s,block:u,timeout:c,strategy:l,cacheKey:d}=("object"==typeof e?e:t)||{};return await qE({expires:s||0,key:d||[n,r,i,a,u],call:async()=>{if(FE.evm.includes(n))return await(async({blockchain:e,address:t,api:n,method:r,params:i,block:o,timeout:a,strategy:s})=>{if(s=s||CE().strategy||"failover",a=a||CE().timeout||void 0,"fastest"===s){const s=await RE.getProviders(e);let u=[];const c=s.map((a=>new Promise((s=>{u.push(eT({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a}).then(s))})))),l=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a||1e4)));return u=Promise.all(u.map((e=>new Promise((t=>{e.catch(t)}))))).then((()=>{})),Promise.race([...c,l,u])}{const s=await RE.getProvider(e),u=eT({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:s});return a?(a=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a))),Promise.race([u,a])):u}})({blockchain:n,address:r,api:o,method:i,params:a,block:u,strategy:l,timeout:c});if(FE.solana.includes(n))return await(async({blockchain:e,address:t,api:n,method:r,params:i,block:o,timeout:a,strategy:s})=>{s=s||CE().strategy||"failover",a=a||CE().timeout||void 0;const u=await YE.getProviders(e);if("fastest"===s){let s=[];const c=u.map((a=>new Promise((u=>{s.push(tT({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:a}).then(u))})))),l=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a||1e4)));return s=Promise.all(s.map((e=>new Promise((t=>{e.catch(t)}))))).then((()=>{})),Promise.race([...c,l,s])}{const s=await YE.getProvider(e),c=tT({blockchain:e,address:t,api:n,method:r,params:i,block:o,provider:s,providers:u});return a?(a=new Promise(((e,t)=>setTimeout((()=>{t(new Error("Web3ClientTimeout"))}),a))),Promise.race([c,a])):c}})({blockchain:n,address:r,api:o,method:i,params:a,block:u,strategy:l,timeout:c});throw"Unknown blockchain: "+n}})};var rT=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=92)}([function(e,t,n){(function(e){n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return u})),n.d(t,"i",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"e",(function(){return p})),n.d(t,"d",(function(){return f})),n.d(t,"o",(function(){return y})),n.d(t,"n",(function(){return m})),n.d(t,"p",(function(){return g})),n.d(t,"A",(function(){return v})),n.d(t,"z",(function(){return b})),n.d(t,"B",(function(){return w})),n.d(t,"v",(function(){return M})),n.d(t,"u",(function(){return A})),n.d(t,"s",(function(){return N})),n.d(t,"r",(function(){return I})),n.d(t,"t",(function(){return k})),n.d(t,"q",(function(){return L})),n.d(t,"m",(function(){return x})),n.d(t,"l",(function(){return S})),n.d(t,"k",(function(){return j})),n.d(t,"j",(function(){return C})),n.d(t,"x",(function(){return O})),n.d(t,"a",(function(){return z})),n.d(t,"y",(function(){return _})),n.d(t,"w",(function(){return P}));var r=n(22),i=n.n(r),o=n(49),a=n.n(o);function s(e){return new Uint8Array(e)}function u(e,t=!1){const n=e.toString("hex");return t?z(n):n}function c(e){return e.toString("utf8")}function l(e){return e.readUIntBE(0,e.length)}function d(e){return a()(e)}function h(e,t=!1){return u(d(e),t)}function p(e){return c(d(e))}function f(e){return l(d(e))}function y(t){return e.from(O(t),"hex")}function m(e){return s(y(e))}function g(e){return c(y(e))}function v(t){return e.from(t,"utf8")}function b(e){return s(v(e))}function w(e,t=!1){return u(v(e),t)}function M(e){return d(T(E(e)))}function A(e){return T(E(e))}function E(e){return D((e>>>0).toString(2))}function T(e){return new Uint8Array(function(e,t=8){const n=D(e).match(new RegExp(`.{${t}}`,"gi"));return Array.from(n||[])}(e).map((e=>parseInt(e,2))))}function N(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function I(t){return e.isBuffer(t)}function k(e){return i.a.strict(e)&&!I(e)}function L(e){return!k(e)&&!I(e)&&void 0!==e.byteLength}function x(e){return I(e)?"buffer":k(e)?"typed-array":L(e)?"array-buffer":Array.isArray(e)?"array":typeof e}function S(e){return function(e){return!("string"!=typeof e||!new RegExp(/^[01]+$/).test(e))&&e.length%8==0}(e)?"binary":N(e)?"hex":"utf8"}function j(...t){return e.concat(t)}function C(...e){let t=[];return e.forEach((e=>t=t.concat(Array.from(e)))),new Uint8Array([...t])}function D(e,t=8,n="0"){return function(e,t,n="0"){return function(e,t,n,r="0"){const i=t-e.length;let o=e;if(i>0){const t=r.repeat(i);o=n?t+e:e+t}return o}(e,t,!0,n)}(e,function(e,t=8){const n=e%t;return n?(e-n)/t*t+t:e}(e.length,t),n)}function O(e){return e.replace(/^0x/,"")}function z(e){return e.startsWith("0x")?e:"0x"+e}function _(e){return(e=D(e=O(e),2))&&(e=z(e)),e}function P(e){const t=e.startsWith("0x");return e=(e=O(e)).startsWith("0")?e.substring(1):e,t?z(e):e}}).call(this,n(18).Buffer)},function(e,t,n){n.d(t,"g",(function(){return r.detectEnv})),n.d(t,"r",(function(){return r.isMobile})),n.d(t,"m",(function(){return r.isBrowser})),n.d(t,"k",(function(){return r.getLocation})),n.d(t,"i",(function(){return r.getClientMeta})),n.d(t,"B",(function(){return r.setLocal})),n.d(t,"j",(function(){return r.getLocal})),n.d(t,"A",(function(){return r.removeLocal})),n.d(t,"v",(function(){return r.mobileLinkChoiceKey})),n.d(t,"C",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return h})),n.d(t,"f",(function(){return p})),n.d(t,"w",(function(){return N})),n.d(t,"x",(function(){return I})),n.d(t,"z",(function(){return m})),n.d(t,"D",(function(){return g})),n.d(t,"h",(function(){return k})),n.d(t,"u",(function(){return C})),n.d(t,"y",(function(){return D})),n.d(t,"l",(function(){return x})),n.d(t,"a",(function(){return S})),n.d(t,"o",(function(){return b})),n.d(t,"q",(function(){return w})),n.d(t,"p",(function(){return M})),n.d(t,"n",(function(){return A})),n.d(t,"s",(function(){return E})),n.d(t,"t",(function(){return T}));var r=n(21);const i=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],o=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];var a=n(16),s=n.n(a),u=n(0);function c(e){return u.b(new Uint8Array(e))}function l(e,t){return u.c(new Uint8Array(e),!t)}function d(e){return u.f(e).buffer}function h(e){return u.n(e).buffer}function p(e,t){const n=u.x(u.y(new s.a(e).toString(16)));return t?n:u.a(n)}var f=n(50);function y(e){return u.y(e)}const m=n(51).payloadId;function g(){return((e,t)=>{for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t})()}function v(e,t){return u.s(e,t)}function b(e){return void 0!==e.method}function w(e){return void 0!==e.result}function M(e){return void 0!==e.error}function A(e){return void 0!==e.event}function E(e){return i.includes(e)||e.startsWith("wc_")}function T(e){return!!e.method.startsWith("wc_")||!o.includes(e.method)}function N(e){var t,n;return(n=e)&&n.length&&!v(e[0])&&(e[0]=(t=e[0],u.B(t,!0))),e}function I(e){if(void 0!==e.type&&"0"!==e.type)return e;if(void 0===e.from||!(t=e.from)||"0x"!==t.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(t)||!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t)&&t!==function(e){e=Object(u.x)(e.toLowerCase());const t=Object(u.x)(Object(f.keccak_256)((n=e,u.A(n))));var n;let r="";for(let n=0;n7?r+=e[n].toUpperCase():r+=e[n];return Object(u.a)(r)}(t))throw new Error("Transaction object must include a valid 'from' value.");var t;function n(e){let t=e;var n;return("number"==typeof e||"string"==typeof e&&!function(e){return""===e||"string"==typeof e&&""===e.trim()}(e))&&(v(e)?"string"==typeof e&&(t=y(e)):t=p(e)),"string"==typeof t&&(n=t,t=u.w(u.a(n))),t}const r={from:y(e.from),to:void 0===e.to?void 0:y(e.to),gasPrice:void 0===e.gasPrice?"":n(e.gasPrice),gas:void 0===e.gas?void 0===e.gasLimit?"":n(e.gasLimit):n(e.gas),value:void 0===e.value?"":n(e.value),nonce:void 0===e.nonce?"":n(e.nonce),data:void 0===e.data?"":y(e.data)||"0x"},i=["gasPrice","gas","value","nonce"];return Object.keys(r).forEach((e=>{(void 0===r[e]||"string"==typeof r[e]&&!r[e].trim().length)&&i.includes(e)&&delete r[e]})),r}function k(e){const t=e.message||"Failed or Rejected Request";let n=-32e3;if(e&&!e.code)switch(t){case"Parse error":n=-32700;break;case"Invalid request":n=-32600;break;case"Method not found":n=-32601;break;case"Invalid params":n=-32602;break;case"Internal error":n=-32603;break;default:n=-32e3}const r={code:n,message:t};return e.data&&(r.data=e.data),r}var L=n(23);function x(e){const t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return void 0!==t?e.substr(t):""}function S(e,t){let n=j(e);return n=Object.assign(Object.assign({},n),t),function(e){return L.stringify(e)}(n)}function j(e){return L.parse(e)}function C(e){return void 0!==e.bridge}function D(e){const t=e.indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),i=function(e){const t=e.split("@");return{handshakeTopic:t[0],version:parseInt(t[1],10)}}(e.substring(t+1,n)),o=function(e){const t=j(e);return{key:t.key||"",bridge:t.bridge||""}}(void 0!==n?e.substr(n):"");return Object.assign(Object.assign({protocol:r},i),o)}},function(e,t,n){n.d(t,"b",(function(){return i})),n.d(t,"g",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"i",(function(){return c})),n.d(t,"j",(function(){return l})),n.d(t,"h",(function(){return r})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return f}));const r=512,i=256,o=256,a="AES-CBC",s="SHA-"+i,u="HMAC",c="SHA-256",l="SHA-512",d="encrypt",h="decrypt",p="sign",f="verify"},function(e,t,n){n.d(t,"b",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"a",(function(){return u}));const r="INTERNAL_ERROR",i="SERVER_ERROR",o=[-32700,-32600,-32601,-32602,-32603],a=[-32e3,-32099],s={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[r]:{code:-32603,message:"Internal error"},[i]:{code:-32e3,message:"Server error"}},u=i},function(e,t,n){function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function i(e){const t=r(e);if(!t)throw new Error(e+" is not defined in Window");return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=i,t.getDocumentOrThrow=function(){return i("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return i("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return i("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return i("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return i("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(67),t),i(n(68),t)},function(e,t,n){n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return d}));var r=n(5),i=n(2);async function o(e,t=i.a){return r.getSubtleCrypto().importKey("raw",e,function(e){return e===i.a?{length:i.b,name:i.a}:{hash:{name:i.f},name:i.e}}(t),!0,function(e){return e===i.a?[i.d,i.c]:[i.k,i.l]}(t))}async function a(e,t,n){const a=r.getSubtleCrypto(),s=await o(t,i.a),u=await a.encrypt({iv:e,name:i.a},s,n);return new Uint8Array(u)}async function s(e,t,n){const a=r.getSubtleCrypto(),s=await o(t,i.a),u=await a.decrypt({iv:e,name:i.a},s,n);return new Uint8Array(u)}async function u(e,t){const n=r.getSubtleCrypto(),a=await o(e,i.e),s=await n.sign({length:i.g,name:i.e},a,t);return new Uint8Array(s)}async function c(e,t){const n=r.getSubtleCrypto(),a=await o(e,i.e),s=await n.sign({length:i.h,name:i.e},a,t);return new Uint8Array(s)}async function l(e){const t=r.getSubtleCrypto(),n=await t.digest({name:i.i},e);return new Uint8Array(n)}async function d(e){const t=r.getSubtleCrypto(),n=await t.digest({name:i.j},e);return new Uint8Array(n)}},function(e,t){var n,r=[0,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];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return r[e]},t.getBCHDigit=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},t.isKanjiModeEnabled=function(){return void 0!==n},t.toSJIS=function(e){return n(e)}},function(e,t,n){var r=n(44),i=n(45);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!r.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}},function(e,t,n){n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(3);function i(e){return r.c.includes(e)}function o(e){return Object.keys(r.f).includes(e)?r.f[e]:r.f[r.a]}function a(e){return Object.values(r.f).find((t=>t.code===e))||r.f[r.a]}},function(e,t,n){var r=n(19);o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}();var i=o.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function o(e,t,n){return o.TYPED_ARRAY_SUPPORT||this instanceof o?"number"==typeof e?u(this,e):function(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(n<0||t.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function s(e,t){var n;return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t)).__proto__=o.prototype:(null===(n=e)&&(n=new o(t)),n.length=t),n}function u(e,t){var n=s(e,t<0?0:0|a(t));if(!o.TYPED_ARRAY_SUPPORT)for(var r=0;r55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function d(e){return o.isBuffer(e)?e.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!=typeof e&&(e=""+e),0===e.length?0:l(e).length)}o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),o.prototype.write=function(e,t,n){void 0===t||void 0===n&&"string"==typeof t?(n=this.length,t=0):isFinite(t)&&(t|=0,isFinite(n)?n|=0:n=void 0);var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,n,r){return function(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}(l(t,e.length-n),e,n,r)}(this,e,t,n)},o.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i1)for(var n=1;n=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function u(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=6)i=s(e,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==t&&(i=s(e,t,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","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"],l=[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],d=[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];function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=h;p++){var f=c-p|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],p=d[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modn(p).toString(e);n=(f=f.idivn(p)).isZero()?y+n:c[h-y.length]+y+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,M=b>>>13,A=0|a[4],E=8191&A,T=A>>>13,N=0|a[5],I=8191&N,k=N>>>13,L=0|a[6],x=8191&L,S=L>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],z=8191&O,_=O>>>13,P=0|a[9],R=8191&P,B=P>>>13,U=0|s[0],W=8191&U,Q=U>>>13,Y=0|s[1],F=8191&Y,V=Y>>>13,H=0|s[2],G=8191&H,q=H>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,K=0|s[4],$=8191&K,ee=K>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,pe=0|s[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,W))|0)+((8191&(i=(i=Math.imul(d,Q))+Math.imul(h,W)|0))<<13)|0;c=((o=Math.imul(h,Q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,W),i=(i=Math.imul(f,Q))+Math.imul(y,W)|0,o=Math.imul(y,Q);var ge=(c+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,F)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,W),i=(i=Math.imul(g,Q))+Math.imul(v,W)|0,o=Math.imul(v,Q),r=r+Math.imul(f,F)|0,i=(i=i+Math.imul(f,V)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,V)|0;var ve=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,W),i=(i=Math.imul(w,Q))+Math.imul(M,W)|0,o=Math.imul(M,Q),r=r+Math.imul(g,F)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,F)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,i=(i=i+Math.imul(f,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0;var be=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,W),i=(i=Math.imul(E,Q))+Math.imul(T,W)|0,o=Math.imul(T,Q),r=r+Math.imul(w,F)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,W),i=(i=Math.imul(I,Q))+Math.imul(k,W)|0,o=Math.imul(k,Q),r=r+Math.imul(E,F)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var Me=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,W),i=(i=Math.imul(x,Q))+Math.imul(S,W)|0,o=Math.imul(S,Q),r=r+Math.imul(I,F)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0;var Ae=(c+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(C,W),i=(i=Math.imul(C,Q))+Math.imul(D,W)|0,o=Math.imul(D,Q),r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,F)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var Ee=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,W),i=(i=Math.imul(z,Q))+Math.imul(_,W)|0,o=Math.imul(_,Q),r=r+Math.imul(C,F)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,F)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Te=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,W),i=(i=Math.imul(R,Q))+Math.imul(B,W)|0,o=Math.imul(B,Q),r=r+Math.imul(z,F)|0,i=(i=i+Math.imul(z,V)|0)+Math.imul(_,F)|0,o=o+Math.imul(_,V)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,r=r+Math.imul(f,de)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ne=(c+(r=r+Math.imul(d,fe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ye)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(B,F)|0,o=Math.imul(B,V),r=r+Math.imul(z,G)|0,i=(i=i+Math.imul(z,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Ie=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,q))+Math.imul(B,G)|0,o=Math.imul(B,q),r=r+Math.imul(z,J)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var ke=(c+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(v,fe)|0))<<13)|0;c=((o=o+Math.imul(v,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,J),i=(i=Math.imul(R,X))+Math.imul(B,J)|0,o=Math.imul(B,X),r=r+Math.imul(z,$)|0,i=(i=i+Math.imul(z,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(D,ne)|0,o=o+Math.imul(D,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Le=(c+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(M,fe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(R,$),i=(i=Math.imul(R,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(z,ne)|0,i=(i=i+Math.imul(z,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var xe=(c+(r=r+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(T,fe)|0))<<13)|0;c=((o=o+Math.imul(T,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,ne),i=(i=Math.imul(R,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(z,oe)|0,i=(i=i+Math.imul(z,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Se=(c+(r=r+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,fe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(z,ue)|0,i=(i=i+Math.imul(z,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var je=(c+(r=r+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(S,fe)|0))<<13)|0;c=((o=o+Math.imul(S,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(z,de)|0,i=(i=i+Math.imul(z,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ce=(c+(r=r+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,fe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(R,de),i=(i=Math.imul(R,he))+Math.imul(B,de)|0,o=Math.imul(B,he);var De=(c+(r=r+Math.imul(z,fe)|0)|0)+((8191&(i=(i=i+Math.imul(z,ye)|0)+Math.imul(_,fe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Oe=(c+(r=Math.imul(R,fe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(B,fe)|0))<<13)|0;return c=((o=Math.imul(B,ye))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=Ae,u[7]=Ee,u[8]=Te,u[9]=Ne,u[10]=Ie,u[11]=ke,u[12]=Le,u[13]=xe,u[14]=Se,u[15]=je,u[16]=Ce,u[17]=De,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function f(e,t,n){return(new y).mulp(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):f(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!=(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;0==(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(n.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(n.iushrn(f);f-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):n.strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,i=o}i>>>=22,e.words[r-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),f=a;0!==p.cmp(s);){for(var y=p,m=0;0!==y.cmp(s);m++)y=y.redSqr();r(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(54)(e))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(60);r.__exportStar(n(61),t),r.__exportStar(n(62),t)},function(e,t,n){(function(e){ /*! * The buffer module from node.js, for the browser. diff --git a/package.evm.json b/package.evm.json index 6d126b5c..4a9d32d4 100644 --- a/package.evm.json +++ b/package.evm.json @@ -1,7 +1,7 @@ { "name": "@depay/widgets-evm", "moduleName": "DePayWidgets", - "version": "12.3.9", + "version": "12.3.10", "description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.", "main": "./dist/umd/index.js", "module": "./dist/esm/index.js", @@ -30,7 +30,7 @@ "@depay/walletconnect-v1": "^1.8.0", "@depay/walletconnect-v2": "^2.9.2", "@depay/web3-assets-evm": "^7.2.0", - "@depay/web3-blockchains": "^9.2.6", + "@depay/web3-blockchains": "^9.2.7", "@depay/web3-client-evm": "^10.18.4", "@depay/web3-exchanges-evm": "^13.7.0", "@depay/web3-payments-evm": "^13.6.5", diff --git a/package.json b/package.json index dd186cc6..20a577b7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@depay/widgets", "moduleName": "DePayWidgets", - "version": "12.3.9", + "version": "12.3.10", "description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.", "main": "./dist/umd/index.js", "module": "./dist/esm/index.js", @@ -44,7 +44,7 @@ "@depay/walletconnect-v1": "^1.8.0", "@depay/walletconnect-v2": "^2.9.2", "@depay/web3-assets": "^7.2.0", - "@depay/web3-blockchains": "^9.2.6", + "@depay/web3-blockchains": "^9.2.7", "@depay/web3-client": "^10.18.4", "@depay/web3-exchanges": "^13.7.0", "@depay/web3-payments": "^13.6.5", diff --git a/package.solana.json b/package.solana.json index 7bbebd77..ac30db05 100644 --- a/package.solana.json +++ b/package.solana.json @@ -1,7 +1,7 @@ { "name": "@depay/widgets-solana", "moduleName": "DePayWidgets", - "version": "12.3.9", + "version": "12.3.10", "description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.", "main": "./dist/umd/index.js", "module": "./dist/esm/index.js", @@ -31,7 +31,7 @@ "@depay/walletconnect-v1": "^1.8.0", "@depay/walletconnect-v2": "^2.9.2", "@depay/web3-assets-solana": "^7.2.0", - "@depay/web3-blockchains": "^9.2.6", + "@depay/web3-blockchains": "^9.2.7", "@depay/web3-client-solana": "^10.18.4", "@depay/web3-exchanges-solana": "^13.7.0", "@depay/web3-payments-solana": "^13.6.5", diff --git a/yarn.lock b/yarn.lock index 9a2cd765..41c2b0a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1306,10 +1306,10 @@ resolved "https://registry.yarnpkg.com/@depay/web3-blockchains/-/web3-blockchains-9.2.0.tgz#22ed38c94fc61293f117419ae118320d96588e37" integrity sha512-w7UOZqsCjNg+wwfhQ5vF1vV0qTcMJpIJj8dMmGo31PWu7eiL301zYfVEWyxPUDd4xIJY3hcUeB78xapfhrxKRQ== -"@depay/web3-blockchains@^9.2.6": - version "9.2.6" - resolved "https://registry.yarnpkg.com/@depay/web3-blockchains/-/web3-blockchains-9.2.6.tgz#75f90c2026d01542d61c626463ca50fda0833399" - integrity sha512-AdBolc8RO2eaXg9GbjOG4dUGEIfYPcst9uwUaTGsX8fVL5VvTPuQvWXFQP42Z+7Em3i0Z2a7D6jJ3EpI4vg+JQ== +"@depay/web3-blockchains@^9.2.7": + version "9.2.7" + resolved "https://registry.yarnpkg.com/@depay/web3-blockchains/-/web3-blockchains-9.2.7.tgz#299fddc8250b3f946336072b7df0349fbd882323" + integrity sha512-CitCrdKH6ZRDVke5VjpEE+TGJFmYDIDU6BhmGd1hYHo7B/t7wugM5UB75p+atM+PaWfXv0DKyDvc/AKqihyKSQ== "@depay/web3-client@^10.18.4": version "10.18.4"