forked from bombastictranz/bitcoincom-solidity-swap
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fcf75e44-0a96fc136a52c08f1256.js.download
3 lines (3 loc) · 162 KB
/
fcf75e44-0a96fc136a52c08f1256.js.download
1
2
3
/*! For license information please see fcf75e44-0a96fc136a52c08f1256.js.LICENSE.txt */
"use strict";(self.webpackChunkbitcoincom_verse_dex=self.webpackChunkbitcoincom_verse_dex||[]).push([[479],{75450:function(t,e,r){r.d(e,{B95:function(){return ro},BwD:function(){return S},D6H:function(){return Oi},DJo:function(){return si},DQe:function(){return c},DaH:function(){return y},DdM:function(){return qi},E0T:function(){return I},E12:function(){return Bi},EJd:function(){return Vi},H1S:function(){return w},H4H:function(){return Xi},HhN:function(){return B},Ih8:function(){return Ti},IkP:function(){return pi},JTI:function(){return Zi},L5o:function(){return Ui},M_r:function(){return Di},NmC:function(){return fi},O6B:function(){return fo},ONw:function(){return oo},PMr:function(){return Gi},Q01:function(){return Yi},Y31:function(){return vi},YmJ:function(){return Si},Z26:function(){return Ki},alS:function(){return eo},bW6:function(){return C},c4l:function(){return ui},gn4:function(){return E},hA9:function(){return bi},hHR:function(){return Wi},iPz:function(){return M},ing:function(){return Ji},jUY:function(){return A},kCb:function(){return xi},naP:function(){return Qi},nfW:function(){return $i},o8e:function(){return ki},ouN:function(){return yi},p8o:function(){return to},qJM:function(){return gi},rFo:function(){return no},rVF:function(){return Ei},rjm:function(){return Ii},wvx:function(){return hi}});var n=r(66736),i=r(62873),o=r(20416),s=(r(87338),r(15501),r(512),r(31416),r(73294)),f=(r(57664),r(37466)),u=(r(93368),r(34155)),h=r(48764).Buffer;const a=":";function c(t){const[e,r]=t.split(a);return{namespace:e,reference:r}}function l(t,e){return t.includes(":")?[t]:e.chains||[]}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const d="ReactNative",p={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};function m(){return typeof u<"u"&&typeof u.versions<"u"&&typeof u.versions.node<"u"}function g(){return!(0,i.getDocument)()&&!!(0,i.getNavigator)()&&navigator.product===d}function A(){return!m()&&!!(0,i.getNavigator)()&&!!(0,i.getDocument)()}function v(){return g()?p.reactNative:m()?p.node:A()?p.browser:p.unknown}function y(){return(0,o.D)()||{name:"",description:"",url:"",icons:[""]}}function b(t,e){return t.filter((t=>e.includes(t))).length===t.length}function w(t=n.FIVE_MINUTES,e){const r=(0,n.toMiliseconds)(t||n.FIVE_MINUTES);let i,o,s;return{resolve:t=>{s&&i&&(clearTimeout(s),i(t))},reject:t=>{s&&o&&(clearTimeout(s),o(t))},done:()=>new Promise(((t,n)=>{s=setTimeout((()=>{n(new Error(e))}),r),i=t,o=n}))}}function M(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if("topic"===e&&"string"==typeof r)n.topic=r;else{if("id"!==e||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);n.id=Number(r)}return n}function E(t,e){return(0,n.fromMiliseconds)((e||Date.now())+(0,n.toMiliseconds)(t))}function S(t){return Date.now()>=(0,n.toMiliseconds)(t)}function I(t,e){return`${t}${e?`:${e}`:""}`}function N(t=[],e=[]){return[...new Set([...t,...e])]}async function B({id:t,topic:e,wcDeepLink:n}){try{if(!n)return;const i="string"==typeof n?JSON.parse(n):n;let o=i?.href;if("string"!=typeof o)return;o.endsWith("/")&&(o=o.slice(0,-1));const s=`${o}/wc?requestId=${t}&sessionTopic=${e}`,f=v();f===p.browser?s.startsWith("https://")||s.startsWith("http://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):f===p.reactNative&&typeof(null==r.g?void 0:r.g.Linking)<"u"&&await r.g.Linking.openURL(s)}catch(i){console.error(i)}}async function C(t,e){try{return await t.getItem(e)||(A()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}var _=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{};var x,O={exports:{}};x=O,function(){var t="input is invalid type",e="object"==typeof window,r=e?window:{};r.JS_SHA3_NO_WINDOW&&(e=!1);var n=!e&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof u&&u.versions&&u.versions.node?r=_:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&x.exports,o=!r.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",s="0123456789abcdef".split(""),f=[4,1024,262144,67108864],h=[0,8,16,24],a=[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],c=[224,256,384,512],l=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};(r.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),o&&(r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var m=function(t,e,r){return function(n){return new R(t,e,t).update(n)[r]()}},g=function(t,e,r){return function(n,i){return new R(t,e,i).update(n)[r]()}},A=function(t,e,r){return function(e,n,i,o){return M["cshake"+t].update(e,n,i,o)[r]()}},v=function(t,e,r){return function(e,n,i,o){return M["kmac"+t].update(e,n,i,o)[r]()}},y=function(t,e,r,n){for(var i=0;i<d.length;++i){var o=d[i];t[o]=e(r,n,o)}return t},b=function(t,e){var r=m(t,e,"hex");return r.create=function(){return new R(t,e,t)},r.update=function(t){return r.create().update(t)},y(r,m,t,e)},w=[{name:"keccak",padding:[1,256,65536,16777216],bits:c,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:c,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:l,createMethod:function(t,e){var r=g(t,e,"hex");return r.create=function(r){return new R(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},y(r,g,t,e)}},{name:"cshake",padding:f,bits:l,createMethod:function(t,e){var r=p[t],n=A(t,0,"hex");return n.create=function(n,i,o){return i||o?new R(t,e,n).bytepad([i,o],r):M["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},y(n,A,t,e)}},{name:"kmac",padding:f,bits:l,createMethod:function(t,e){var r=p[t],n=v(t,0,"hex");return n.create=function(n,i,o){return new U(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},y(n,v,t,e)}}],M={},E=[],S=0;S<w.length;++S)for(var I=w[S],N=I.bits,B=0;B<N.length;++B){var C=I.name+"_"+N[B];if(E.push(C),M[C]=I.createMethod(N[B],I.padding),"sha3"!==I.name){var O=I.name+N[B];E.push(O),M[O]=M[C]}}function R(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function U(t,e,r){R.call(this,t,e,r)}R.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var i,s,f=this.blocks,u=this.byteCount,a=e.length,c=this.blockCount,l=0,d=this.s;l<a;){if(this.reset)for(this.reset=!1,f[0]=this.block,i=1;i<c+1;++i)f[i]=0;if(r)for(i=this.start;l<a&&i<u;++l)f[i>>2]|=e[l]<<h[3&i++];else for(i=this.start;l<a&&i<u;++l)(s=e.charCodeAt(l))<128?f[i>>2]|=s<<h[3&i++]:s<2048?(f[i>>2]|=(192|s>>6)<<h[3&i++],f[i>>2]|=(128|63&s)<<h[3&i++]):s<55296||s>=57344?(f[i>>2]|=(224|s>>12)<<h[3&i++],f[i>>2]|=(128|s>>6&63)<<h[3&i++],f[i>>2]|=(128|63&s)<<h[3&i++]):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++l)),f[i>>2]|=(240|s>>18)<<h[3&i++],f[i>>2]|=(128|s>>12&63)<<h[3&i++],f[i>>2]|=(128|s>>6&63)<<h[3&i++],f[i>>2]|=(128|63&s)<<h[3&i++]);if(this.lastByteIndex=i,i>=u){for(this.start=i-u,this.block=f[c],i=0;i<c;++i)d[i]^=f[i];k(d),this.reset=!0}else this.start=i}return this},R.prototype.encode=function(t,e){var r=255&t,n=1,i=[r];for(r=255&(t>>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},R.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var i=0,s=e.length;if(r)i=s;else for(var f=0;f<e.length;++f){var u=e.charCodeAt(f);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&e.charCodeAt(++f)),i+=4)}return i+=this.encode(8*i),this.update(e),i},R.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var i=e-r%e,o=[];return o.length=i,this.update(o),this},R.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];k(n)}},R.prototype.toString=R.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,f=0,u="";f<n;){for(o=0;o<e&&f<n;++o,++f)t=r[o],u+=s[t>>4&15]+s[15&t]+s[t>>12&15]+s[t>>8&15]+s[t>>20&15]+s[t>>16&15]+s[t>>28&15]+s[t>>24&15];f%e==0&&(k(r),o=0)}return i&&(t=r[o],u+=s[t>>4&15]+s[15&t],i>1&&(u+=s[t>>12&15]+s[t>>8&15]),i>2&&(u+=s[t>>20&15]+s[t>>16&15])),u},R.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,f=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(f);for(var u=new Uint32Array(t);s<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&k(r)}return i&&(u[o]=r[o],t=t.slice(0,f)),t},R.prototype.buffer=R.prototype.arrayBuffer,R.prototype.digest=R.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,f=0,u=[];f<i;){for(s=0;s<r&&f<i;++s,++f)t=f<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;f%r==0&&k(n)}return o&&(t=f<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},U.prototype=new R,U.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var k=function(t){var e,r,n,i,o,s,f,u,h,c,l,d,p,m,g,A,v,y,b,w,M,E,S,I,N,B,C,_,x,O,R,U,k,D,P,T,F,q,z,L,H,j,Q,J,K,G,Y,V,X,W,Z,$,tt,et,rt,nt,it,ot,st,ft,ut,ht,at;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],f=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|f>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(f<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|h>>>31),r=o^(h<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(c<<1|l>>>31),r=f^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(d<<1|p>>>31),r=h^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],g=t[1],G=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,_=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,ft=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,j=t[40]<<18|t[41]>>>14,Q=t[41]<<18|t[40]>>>14,D=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,A=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,at=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,T=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,U=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,I=t[6]<<28|t[7]>>>4,N=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,q=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,J=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,B=t[18]<<20|t[19]>>>12,C=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,L=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~A&y,t[1]=g^~v&b,t[10]=I^~B&_,t[11]=N^~C&x,t[20]=D^~T&q,t[21]=P^~F&z,t[30]=J^~G&V,t[31]=K^~Y&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=A^~y&w,t[3]=v^~b&M,t[12]=B^~_&O,t[13]=C^~x&R,t[22]=T^~q&L,t[23]=F^~z&H,t[32]=G^~V&W,t[33]=Y^~X&Z,t[42]=nt^~ot&ft,t[43]=it^~st&ut,t[4]=y^~w&E,t[5]=b^~M&S,t[14]=_^~O&U,t[15]=x^~R&k,t[24]=q^~L&j,t[25]=z^~H&Q,t[34]=V^~W&$,t[35]=X^~Z&tt,t[44]=ot^~ft&ht,t[45]=st^~ut&at,t[6]=w^~E&m,t[7]=M^~S&g,t[16]=O^~U&I,t[17]=R^~k&N,t[26]=L^~j&D,t[27]=H^~Q&P,t[36]=W^~$&J,t[37]=Z^~tt&K,t[46]=ft^~ht&et,t[47]=ut^~at&rt,t[8]=E^~m&A,t[9]=S^~g&v,t[18]=U^~I&B,t[19]=k^~N&C,t[28]=j^~D&T,t[29]=Q^~P&F,t[38]=$^~J&G,t[39]=tt^~K&Y,t[48]=ht^~et&nt,t[49]=at^~rt&it,t[0]^=a[n],t[1]^=a[n+1]};if(i)x.exports=M;else for(S=0;S<E.length;++S)r[E[S]]=M[E[S]]}();var R=O.exports;let U=!1,k=!1;const D={debug:1,default:2,info:2,warning:3,error:4,off:5};let P=D.default,T=null;const F=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch{t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(x){return x.message}return null}();var q,z;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(q||(q={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(z||(z={}));const L="0123456789abcdef";class H{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==D[r]&&this.throwArgumentError("invalid log level name","logLevel",t),!(P>D[r])&&console.log.apply(console,e)}debug(...t){this._log(H.levels.DEBUG,t)}info(...t){this._log(H.levels.INFO,t)}warn(...t){this._log(H.levels.WARNING,t)}makeError(t,e,r){if(k)return this.makeError("censored error",e,{});e||(e=H.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t<e.length;t++)r+=L[e[t]>>4],r+=L[15&e[t]];n.push(t+"=Uint8Array(0x"+r+")")}else n.push(t+"="+JSON.stringify(e))}catch{n.push(t+"="+JSON.stringify(r[t].toString()))}})),n.push(`code=${e}`),n.push(`version=${this.version}`);const i=t;let o="";switch(e){case z.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case z.CALL_EXCEPTION:case z.INSUFFICIENT_FUNDS:case z.MISSING_NEW:case z.NONCE_EXPIRED:case z.REPLACEMENT_UNDERPRICED:case z.TRANSACTION_REPLACED:case z.UNPREDICTABLE_GAS_LIMIT:o=e}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(t+=" ("+n.join(", ")+")");const s=new Error(t);return s.reason=i,s.code=e,Object.keys(r).forEach((function(t){s[t]=r[t]})),s}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,H.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){F&&this.throwError("platform missing String.prototype.normalize",H.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:F})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,H.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,H.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",t<e&&this.throwError("missing argument"+r,H.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+r,H.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",H.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",H.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",H.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return T||(T=new H("logger/5.7.0")),T}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",H.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),U){if(!t)return;this.globalLogger().throwError("error censorship permanent",H.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}k=!!t,U=!!e}static setLogLevel(t){const e=D[t.toLowerCase()];null!=e?P=e:H.globalLogger().warn("invalid log level - "+t)}static from(t){return new H(t)}}H.errors=z,H.levels=q;const j=new H("bytes/5.7.0");function Q(t){return!!t.toHexString}function J(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return J(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function K(t){return"number"==typeof t&&t==t&&t%1==0}function G(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!K(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!K(r)||r<0||r>=256)return!1}return!0}function Y(t,e){if(e||(e={}),"number"==typeof t){j.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),J(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Q(t)&&(t=t.toHexString()),V(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":j.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let t=0;t<r.length;t+=2)n.push(parseInt(r.substring(t,t+2),16));return J(new Uint8Array(n))}return G(t)?J(new Uint8Array(t)):j.throwArgumentError("invalid arrayify value","value",t)}function V(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const X="0123456789abcdef";function W(t,e){if(e||(e={}),"number"==typeof t){j.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=X[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Q(t))return t.toHexString();if(V(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":j.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(G(t)){let e="0x";for(let r=0;r<t.length;r++){let n=t[r];e+=X[(240&n)>>4]+X[15&n]}return e}return j.throwArgumentError("invalid hexlify value","value",t)}function Z(t,e,r){return"string"!=typeof t?t=W(t):(!V(t)||t.length%2)&&j.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function $(t,e){for("string"!=typeof t?t=W(t):V(t)||j.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&j.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function tt(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(function(t){return V(t)&&!(t.length%2)||G(t)}(t)){let r=Y(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=W(r.slice(0,32)),e.s=W(r.slice(32,64))):65===r.length?(e.r=W(r.slice(0,32)),e.s=W(r.slice(32,64)),e.v=r[64]):j.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:j.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=W(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=function(t,e){(t=Y(t)).length>e&&j.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),J(r)}(Y(e._vs),32);e._vs=W(r);const n=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=n:e.recoveryParam!==n&&j.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const i=W(r);null==e.s?e.s=i:e.s!==i&&j.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?j.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&j.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&V(e.r)?e.r=$(e.r,32):j.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&V(e.s)?e.s=$(e.s,32):j.throwArgumentError("signature missing or invalid s","signature",t);const r=Y(e.s);r[0]>=128&&j.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=W(r);e._vs&&(V(e._vs)||j.throwArgumentError("signature invalid _vs","signature",t),e._vs=$(e._vs,32)),null==e._vs?e._vs=n:e._vs!==n&&j.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function et(t){return"0x"+R.keccak_256(Y(t))}var rt={exports:{}},nt=function(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),r}(Object.freeze({__proto__:null,default:{}}));!function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o=typeof window<"u"&&typeof window.Buffer<"u"?window.Buffer:nt.Buffer}catch{}function s(t,e){var n=t.charCodeAt(e);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+t)}function f(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function u(t,e,n,i){for(var o=0,s=0,f=Math.min(t.length,n),u=e;u<f;u++){var h=t.charCodeAt(u)-48;o*=i,s=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&s<i,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,n):(this._parseBase(t,e,i),"le"===n&&this._initArray(this.toArray(),e,n)))},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,f=0;if("be"===n)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<f&67108863,this.words[o+1]=s>>>26-f&67108863,(f+=24)>=26&&(f-=26,o++);else if("le"===n)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<f&67108863,this.words[o+1]=s>>>26-f&67108863,(f+=24)>=26&&(f-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=f(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=f(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,f=Math.min(o,o-s)+r,h=0,a=r;a<f;a+=n)h=u(t,a,a+n,e),this.imuln(i),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var c=1;for(h=u(t,a,t.length,e),a=0;a<s;a++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){h(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&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},typeof Symbol<"u"&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=a}catch{i.prototype.inspect=a}else i.prototype.inspect=a;function a(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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];i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s<this.length;s++){var f=this.words[s],u=(16777215&(f<<i|o)).toString(16);o=f>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?c[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],a=d[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(a).toString(t);n=(p=p.idivn(a)).isZero()?m+n:c[h-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,f=67108863&s,u=s/67108864|0;r.words[0]=f;for(var h=1;h<n;h++){for(var a=u>>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;a+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|a}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}i.prototype.toArrayLike=function(t,e,n){this._strip();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");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<i:this.words[n]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,r){var n,i,o,s=t.words,f=e.words,u=r.words,h=0,a=0|s[0],c=8191&a,l=a>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],A=8191&g,v=g>>>13,y=0|s[3],b=8191&y,w=y>>>13,M=0|s[4],E=8191&M,S=M>>>13,I=0|s[5],N=8191&I,B=I>>>13,C=0|s[6],_=8191&C,x=C>>>13,O=0|s[7],R=8191&O,U=O>>>13,k=0|s[8],D=8191&k,P=k>>>13,T=0|s[9],F=8191&T,q=T>>>13,z=0|f[0],L=8191&z,H=z>>>13,j=0|f[1],Q=8191&j,J=j>>>13,K=0|f[2],G=8191&K,Y=K>>>13,V=0|f[3],X=8191&V,W=V>>>13,Z=0|f[4],$=8191&Z,tt=Z>>>13,et=0|f[5],rt=8191&et,nt=et>>>13,it=0|f[6],ot=8191&it,st=it>>>13,ft=0|f[7],ut=8191&ft,ht=ft>>>13,at=0|f[8],ct=8191&at,lt=at>>>13,dt=0|f[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(c,L))|0)+((8191&(i=(i=Math.imul(c,H))+Math.imul(l,L)|0))<<13)|0;h=((o=Math.imul(l,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,L),i=(i=Math.imul(p,H))+Math.imul(m,L)|0,o=Math.imul(m,H);var At=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(A,L),i=(i=Math.imul(A,H))+Math.imul(v,L)|0,o=Math.imul(v,H),n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,J)|0;var vt=(h+(n=n+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(l,G)|0))<<13)|0;h=((o=o+Math.imul(l,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(b,L),i=(i=Math.imul(b,H))+Math.imul(w,L)|0,o=Math.imul(w,H),n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Y)|0;var yt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,X)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(E,L),i=(i=Math.imul(E,H))+Math.imul(S,L)|0,o=Math.imul(S,H),n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,W)|0;var bt=(h+(n=n+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(N,L),i=(i=Math.imul(N,H))+Math.imul(B,L)|0,o=Math.imul(B,H),n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var wt=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(_,L),i=(i=Math.imul(_,H))+Math.imul(x,L)|0,o=Math.imul(x,H),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,L),i=(i=Math.imul(R,H))+Math.imul(U,L)|0,o=Math.imul(U,H),n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,Y)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,L),i=(i=Math.imul(D,H))+Math.imul(P,L)|0,o=Math.imul(P,H),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,J)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var St=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,L),i=(i=Math.imul(F,H))+Math.imul(q,L)|0,o=Math.imul(q,H),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(U,G)|0,o=o+Math.imul(U,Y)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var It=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,J))+Math.imul(q,Q)|0,o=Math.imul(q,J),n=n+Math.imul(D,G)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(U,X)|0,o=o+Math.imul(U,W)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ht)|0,n=n+Math.imul(A,ct)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Nt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,Y))+Math.imul(q,G)|0,o=Math.imul(q,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(U,$)|0,o=o+Math.imul(U,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(w,ct)|0,o=o+Math.imul(w,lt)|0;var Bt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,W))+Math.imul(q,X)|0,o=Math.imul(q,W),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,lt)|0;var Ct=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(w,pt)|0))<<13)|0;h=((o=o+Math.imul(w,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,tt))+Math.imul(q,$)|0,o=Math.imul(q,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(N,ct)|0,i=(i=i+Math.imul(N,lt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,lt)|0;var _t=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(q,rt)|0,o=Math.imul(q,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,n=n+Math.imul(_,ct)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,lt)|0;var xt=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(F,ot),i=(i=Math.imul(F,st))+Math.imul(q,ot)|0,o=Math.imul(q,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,lt)|0;var Ot=(h+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,ut),i=(i=Math.imul(F,ht))+Math.imul(q,ut)|0,o=Math.imul(q,ht),n=n+Math.imul(D,ct)|0,i=(i=i+Math.imul(D,lt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(F,ct),i=(i=Math.imul(F,lt))+Math.imul(q,ct)|0,o=Math.imul(q,lt);var Ut=(h+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Ut>>>26)|0,Ut&=67108863;var kt=(h+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,mt))+Math.imul(q,pt)|0))<<13)|0;return h=((o=Math.imul(q,mt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,u[0]=gt,u[1]=At,u[2]=vt,u[3]=yt,u[4]=bt,u[5]=wt,u[6]=Mt,u[7]=Et,u[8]=St,u[9]=It,u[10]=Nt,u[11]=Bt,u[12]=Ct,u[13]=_t,u[14]=xt,u[15]=Ot,u[16]=Rt,u[17]=Ut,u[18]=kt,0!==h&&(u[19]=h,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var f=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var a=o-h,c=(0|t.words[a])*(0|e.words[h]),l=67108863&c;f=67108863&(l=l+f|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=f,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function A(t,e,r){return g(t,e,r)}Math.imul||(m=p),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?g(this,t,e):A(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),A(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var n=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&n);n>>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var o=r.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var f=this.words[e]&o,u=(0|this.words[e])-f<<n;this.words[e]=u|s,s=f>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,n){var i;r("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),f=67108863^67108863>>>o<<o,u=n;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0!==s)if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var a=0;for(h=this.length-1;h>=0&&(0!==a||h>=i);h--){var c=0|this.words[h];this.words[h]=a<<26-o|c>>>o,a=c&f}return u&&0!==a&&(u.words[u.length++]=a),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;return!(this.length<=n)&&!!(this.words[n]&i)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,o=t.length+n;this._expand(o);var s,f=0;for(i=0;i<t.length;i++){s=(0|this.words[i+n])+f;var u=(0|t.words[i])*e;f=((s-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&s}for(;i<this.length-n;i++)f=(s=(0|this.words[i+n])+f)>>26,this.words[i+n]=67108863&s;if(0===f)return this._strip();for(r(-1===f),f=0,i=0;i<this.length;i++)f=(s=-(0|this.words[i])+f)>>26,this.words[i]=67108863&s;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var f,u=n.length-o.length;if("mod"!==e){(f=new i(null)).length=u+1,f.words=new Array(f.length);for(var h=0;h<f.length;h++)f.words[h]=0}var a=n.clone()._ishlnsubmul(o,1,u);0===a.negative&&(n=a,f&&(f.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[o.length+c])+(0|n.words[o.length+c-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(o,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,c),n.isZero()||(n.negative^=1);f&&(f.words[c]=l)}return f&&f._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:f||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(f=this.neg().divmod(t,e),"mod"!==e&&(o=f.div.neg()),"div"!==e&&(s=f.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(f=this.divmod(t.neg(),e),"mod"!==e&&(o=f.div.neg()),{div:o,mod:f.mod}):this.negative&t.negative?(f=this.neg().divmod(t.neg(),e),"div"!==e&&(s=f.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:f.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,f},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/t|0,n=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),f=new i(0),u=new i(1),h=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++h;for(var a=n.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;!(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(a),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(f.isOdd()||u.isOdd())&&(f.iadd(a),u.isub(c)),f.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(f),s.isub(u)):(n.isub(e),f.isub(o),u.isub(s))}return{a:f,b:u,gcd:n.iushln(h)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,n=this,o=t.clone();n=0!==n.negative?n.umod(t):n.clone();for(var s=new i(1),f=new i(0),u=o.clone();n.cmpn(1)>0&&o.cmpn(1)>0;){for(var h=0,a=1;!(n.words[0]&a)&&h<26;++h,a<<=1);if(h>0)for(n.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;!(o.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(o.iushrn(c);c-- >0;)f.isOdd()&&f.iadd(u),f.iushrn(1);n.cmp(o)>=0?(n.isub(o),s.isub(f)):(o.isub(n),f.isub(s))}return(e=0===n.cmpn(1)?s:f).cmpn(0)<0&&e.iadd(t),e},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var f=0|this.words[s];o=(f+=o)>>>26,f&=67108863,this.words[s]=f}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new S(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){S.call(this,t),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)}y.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},n(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,y),n(M,y),n(E,y),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var f=new i(1).toRed(this),u=f.redNeg(),h=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new i(2*a*a).toRed(this);0!==this.pow(a,h).cmp(u);)a.redIAdd(u);for(var c=this.pow(a,o),l=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(f);){for(var m=d,g=0;0!==m.cmp(f);g++)m=m.redSqr();r(g<p);var A=this.pow(c,new i(1).iushln(p-g-1));l=l.redMul(A),c=A.redSqr(),d=d.redMul(c),p=g}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var o=r[0],s=0,f=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],a=u-1;a>=0;a--){var c=h>>a&1;(o!==r[0]&&(o=this.sqr(o)),0!==c||0!==s)?(s<<=1,s|=c,(4===++f||0===n&&0===a)&&(o=this.mul(o,r[s]),f=0,s=0)):f=0}u=26}return o},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new I(t)},n(I,S),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).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)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,_)}(rt);var it=rt.exports;const ot="bignumber/5.7.0";var st=it.BN;const ft=new H(ot),ut={},ht=9007199254740991;let at=!1;class ct{constructor(t,e){t!==ut&&ft.throwError("cannot call constructor directly; use BigNumber.from",H.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return dt(pt(this).fromTwos(t))}toTwos(t){return dt(pt(this).toTwos(t))}abs(){return"-"===this._hex[0]?ct.from(this._hex.substring(1)):this}add(t){return dt(pt(this).add(pt(t)))}sub(t){return dt(pt(this).sub(pt(t)))}div(t){return ct.from(t).isZero()&&mt("division-by-zero","div"),dt(pt(this).div(pt(t)))}mul(t){return dt(pt(this).mul(pt(t)))}mod(t){const e=pt(t);return e.isNeg()&&mt("division-by-zero","mod"),dt(pt(this).umod(e))}pow(t){const e=pt(t);return e.isNeg()&&mt("negative-power","pow"),dt(pt(this).pow(e))}and(t){const e=pt(t);return(this.isNegative()||e.isNeg())&&mt("unbound-bitwise-result","and"),dt(pt(this).and(e))}or(t){const e=pt(t);return(this.isNegative()||e.isNeg())&&mt("unbound-bitwise-result","or"),dt(pt(this).or(e))}xor(t){const e=pt(t);return(this.isNegative()||e.isNeg())&&mt("unbound-bitwise-result","xor"),dt(pt(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&mt("negative-width","mask"),dt(pt(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&mt("negative-width","shl"),dt(pt(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&mt("negative-width","shr"),dt(pt(this).shrn(t))}eq(t){return pt(this).eq(pt(t))}lt(t){return pt(this).lt(pt(t))}lte(t){return pt(this).lte(pt(t))}gt(t){return pt(this).gt(pt(t))}gte(t){return pt(this).gte(pt(t))}isNegative(){return"-"===this._hex[0]}isZero(){return pt(this).isZero()}toNumber(){try{return pt(this).toNumber()}catch{mt("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return ft.throwError("this platform does not support BigInt",H.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?at||(at=!0,ft.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?ft.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",H.errors.UNEXPECTED_ARGUMENT,{}):ft.throwError("BigNumber.toString does not accept parameters",H.errors.UNEXPECTED_ARGUMENT,{})),pt(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof ct)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new ct(ut,lt(t)):t.match(/^-?[0-9]+$/)?new ct(ut,lt(new st(t))):ft.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&mt("underflow","BigNumber.from",t),(t>=ht||t<=-ht)&&mt("overflow","BigNumber.from",t),ct.from(String(t));const e=t;if("bigint"==typeof e)return ct.from(e.toString());if(G(e))return ct.from(W(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return ct.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(V(t)||"-"===t[0]&&V(t.substring(1))))return ct.from(t)}return ft.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function lt(t){if("string"!=typeof t)return lt(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&ft.throwArgumentError("invalid hex","value",t),"0x00"===(t=lt(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function dt(t){return ct.from(lt(t))}function pt(t){const e=ct.from(t).toHexString();return"-"===e[0]?new st("-"+e.substring(3),16):new st(e.substring(2),16)}function mt(t,e,r){const n={fault:t,operation:e};return null!=r&&(n.value=r),ft.throwError(t,H.errors.NUMERIC_FAULT,n)}const gt=new H(ot),At={},vt=ct.from(0),yt=ct.from(-1);function bt(t,e,r,n){const i={fault:e,operation:r};return void 0!==n&&(i.value=n),gt.throwError(t,H.errors.NUMERIC_FAULT,i)}let wt="0";for(;wt.length<256;)wt+=wt;function Mt(t){if("number"!=typeof t)try{t=ct.from(t).toNumber()}catch{}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+wt.substring(0,t):gt.throwArgumentError("invalid decimal size","decimals",t)}function Et(t,e){null==e&&(e=0);const r=Mt(e),n=(t=ct.from(t)).lt(vt);n&&(t=t.mul(yt));let i=t.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=t.div(r).toString();return t=1===r.length?o:o+"."+i,n&&(t="-"+t),t}function St(t,e){null==e&&(e=0);const r=Mt(e);("string"!=typeof t||!t.match(/^-?[0-9.]+$/))&>.throwArgumentError("invalid decimal value","value",t);const n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&>.throwArgumentError("missing value","value",t);const i=t.split(".");i.length>2&>.throwArgumentError("too many decimal points","value",t);let o=i[0],s=i[1];for(o||(o="0"),s||(s="0");"0"===s[s.length-1];)s=s.substring(0,s.length-1);for(s.length>r.length-1&&bt("fractional component exceeds decimals","underflow","parseFixed"),""===s&&(s="0");s.length<r.length-1;)s+="0";const f=ct.from(o),u=ct.from(s);let h=f.mul(r).add(u);return n&&(h=h.mul(yt)),h}class It{constructor(t,e,r,n){t!==At&>.throwError("cannot use FixedFormat constructor; use FixedFormat.from",H.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=e,this.width=r,this.decimals=n,this.name=(e?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=Mt(n),Object.freeze(this)}static from(t){if(t instanceof It)return t;"number"==typeof t&&(t=`fixed128x${t}`);let e=!0,r=128,n=18;if("string"==typeof t){if("fixed"!==t)if("ufixed"===t)e=!1;else{const i=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||gt.throwArgumentError("invalid fixed format","format",t),e="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}}else if(t){const i=(e,r,n)=>null==t[e]?n:(typeof t[e]!==r&>.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),r=i("width","number",r),n=i("decimals","number",n)}return r%8&>.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&>.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new It(At,e,r,n)}}class Nt{constructor(t,e,r,n){t!==At&>.throwError("cannot use FixedNumber constructor; use FixedNumber.from",H.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&>.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=St(this._value,this.format.decimals),r=St(t._value,t.format.decimals);return Nt.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=St(this._value,this.format.decimals),r=St(t._value,t.format.decimals);return Nt.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=St(this._value,this.format.decimals),r=St(t._value,t.format.decimals);return Nt.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=St(this._value,this.format.decimals),r=St(t._value,t.format.decimals);return Nt.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Nt.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(Bt.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Nt.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(Bt.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&>.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=Nt.from("1"+wt.substring(0,t),this.format),n=Ct.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&>.throwArgumentError("invalid byte width","width",t);return $(ct.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return Nt.fromString(this._value,t)}static fromValue(t,e,r){return null==r&&null!=e&&!function(t){return null!=t&&(ct.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||V(t)||"bigint"==typeof t||G(t))}(e)&&(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),Nt.fromString(Et(t,e),It.from(r))}static fromString(t,e){null==e&&(e="fixed");const r=It.from(e),n=St(t,r.decimals);!r.signed&&n.lt(vt)&&bt("unsigned value cannot be negative","overflow","value",t);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=$(i,r.width/8));const o=Et(n,r.decimals);return new Nt(At,i,o,r)}static fromBytes(t,e){null==e&&(e="fixed");const r=It.from(e);if(Y(t).length>r.width/8)throw new Error("overflow");let n=ct.from(t);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=Et(n,r.decimals);return new Nt(At,i,o,r)}static from(t,e){if("string"==typeof t)return Nt.fromString(t,e);if(G(t))return Nt.fromBytes(t,e);try{return Nt.fromValue(t,0,e)}catch(r){if(r.code!==H.errors.INVALID_ARGUMENT)throw r}return gt.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const Bt=Nt.from(1),Ct=Nt.from("0.5"),_t=new H("strings/5.7.0");var xt,Ot;function Rt(t,e,r,n,i){if(t===Ot.BAD_PREFIX||t===Ot.UNEXPECTED_CONTINUE){let t=0;for(let n=e+1;n<r.length&&r[n]>>6==2;n++)t++;return t}return t===Ot.OVERRUN?r.length-e-1:0}function Ut(t,e=xt.current){e!=xt.current&&(_t.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const e=t.charCodeAt(n);if(e<128)r.push(e);else if(e<2048)r.push(e>>6|192),r.push(63&e|128);else if(55296==(64512&e)){n++;const i=t.charCodeAt(n);if(n>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&e)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(e>>12|224),r.push(e>>6&63|128),r.push(63&e|128)}return Y(r)}function kt(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,n={};return t.split(",").forEach((t=>{let i=t.split(":");r+=parseInt(i[0],16),n[r]=e(i[1])})),n}function Dt(t){let e=0;return t.split(",").map((t=>{let r=t.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=e+parseInt(r[0],16);return e=parseInt(r[1],16),{l:n,h:e}}))}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(xt||(xt={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(Ot||(Ot={})),Object.freeze({error:function(t,e,r,n,i){return _t.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:Rt,replace:function(t,e,r,n,i){return t===Ot.OVERLONG?(n.push(i),0):(n.push(65533),Rt(t,e,r))}}),Dt("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),kt("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),kt("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),kt("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e})),Dt("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const Pt="hash/5.7.0";function Tt(t,e){null==e&&(e=1);const r=[],n=r.forEach,i=function(t,e){n.call(t,(function(t){e>0&&Array.isArray(t)?i(t,e-1):r.push(t)}))};return i(t,e),r}function Ft(t){return function(t){let e=0;return()=>t[e++]}(function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,o=[0,1];for(let b=1;b<n;b++)o.push(i+=r());let s=r(),f=e;e+=s;let u=0,h=0;function a(){return 0==u&&(h=h<<8|t[e++],u=8),h>>--u&1}const c=Math.pow(2,31),l=c>>>1,d=l>>1,p=c-1;let m=0;for(let b=0;b<31;b++)m=m<<1|a();let g=[],A=0,v=c;for(;;){let t=Math.floor(((m-A+1)*i-1)/v),e=0,r=n;for(;r-e>1;){let n=e+r>>>1;t<o[n]?r=n:e=n}if(0==e)break;g.push(e);let s=A+Math.floor(v*o[e]/i),f=A+Math.floor(v*o[e+1]/i)-1;for(;!((s^f)&l);)m=m<<1&p|a(),s=s<<1&p,f=f<<1&p|1;for(;s&~f&d;)m=m&l|m<<1&p>>>1|a(),s=s<<1^l,f=(f^l)<<1|l|1;A=s,v=1+f-s}let y=n-4;return g.map((e=>{switch(e-y){case 3:return y+65792+(t[f++]<<16|t[f++]<<8|t[f++]);case 2:return y+256+(t[f++]<<8|t[f++]);case 1:return y+t[f++];default:return e-1}}))}(t))}function qt(t){return 1&t?~t>>1:t>>1}function zt(t,e){let r=Array(t);for(let n=0,i=-1;n<t;n++)r[n]=i+=1+e();return r}function Lt(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=qt(e());return r}function Ht(t,e){let r=zt(t(),t),n=t(),i=zt(n,t),o=function(t,e){let r=Array(t);for(let n=0;n<t;n++)r[n]=1+e();return r}(n,t);for(let s=0;s<n;s++)for(let t=0;t<o[s];t++)r.push(i[s]+t);return e?r.map((t=>e[t])):r}function jt(t,e,r){let n=Array(t).fill(void 0).map((()=>[]));for(let i=0;i<e;i++)Lt(t,r).forEach(((t,e)=>n[e].push(t)));return n}function Qt(t,e){let r=1+e(),n=e(),i=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return Tt(jt(i.length,1+t,e).map(((t,e)=>{const o=t[0],s=t.slice(1);return Array(i[e]).fill(void 0).map(((t,e)=>{let i=e*n;return[o+e*r,s.map((t=>t+i))]}))})))}function Jt(t,e){return jt(1+e(),1+t,e).map((t=>[t[0],t.slice(1)]))}const Kt=Ft(function(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return Y(e)}("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhU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RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="));new Set(Ht(Kt)),new Set(Ht(Kt)),function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(Qt(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(Jt(r,t))}(function(t){const e={};for(let r=0;r<t.length;r++){const n=t[r];e[n[0]]=n[1]}})(Tt(e))}(Kt),function(t){let e=Ht(t).sort(((t,e)=>t-e));(function r(){let n=[];for(;;){let i=Ht(t,e);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((t,e)=>e.set.size-t.set.size));let i=t(),o=i%3;i=i/3|0;let s=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:s,save:1==i,check:2==i}})()}(Kt),new H(Pt);new Uint8Array(32).fill(0);const Gt="Ethereum Signed Message:\n";function Yt(t){return"string"==typeof t&&(t=Ut(t)),et(function(t){const e=t.map((t=>Y(t))),r=e.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(r);return e.reduce(((t,e)=>(n.set(e,t),t+e.length)),0),J(n)}([Ut(Gt),Ut(String(t.length)),t]))}new H("rlp/5.7.0");const Vt=new H("address/5.7.0");function Xt(t){V(t,20)||Vt.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=Y(et(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&n[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Wt={};for(let uo=0;uo<10;uo++)Wt[String(uo)]=String(uo);for(let uo=0;uo<26;uo++)Wt[String.fromCharCode(65+uo)]=String(10+uo);const Zt=Math.floor(function(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}(9007199254740991));function $t(t){let e=null;if("string"!=typeof t&&Vt.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=Xt(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Vt.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>Wt[t])).join("");for(;e.length>=Zt;){let t=e.substring(0,Zt);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&Vt.throwArgumentError("bad icap checksum","address",t),e=function(t){return new st(t,36).toString(16)}(t.substring(4));e.length<40;)e="0"+e;e=Xt("0x"+e)}else Vt.throwArgumentError("invalid address","address",t);return e}function te(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new H("properties/5.7.0"),new H(Pt);new Uint8Array(32).fill(0),ct.from(-1);const ee=ct.from(0),re=ct.from(1);ct.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),$(re.toHexString(),32),$(ee.toHexString(),32);var ne={},ie={},oe=se;function se(t,e){if(!t)throw new Error(e||"Assertion failed")}se.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var fe={exports:{}};"function"==typeof Object.create?fe.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:fe.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var ue=oe,he=fe.exports;function ae(t,e){return!(55296!=(64512&t.charCodeAt(e))||e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function ce(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function le(t){return 1===t.length?"0"+t:t}function de(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}ie.inherits=he,ie.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):ae(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},ie.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=le(t[r].toString(16));return e},ie.htonl=ce,ie.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=ce(i)),r+=de(i.toString(16))}return r},ie.zero2=le,ie.zero8=de,ie.join32=function(t,e,r,n){var i=r-e;ue(i%4==0);for(var o=new Array(i/4),s=0,f=e;s<o.length;s++,f+=4){var u;u="big"===n?t[f]<<24|t[f+1]<<16|t[f+2]<<8|t[f+3]:t[f+3]<<24|t[f+2]<<16|t[f+1]<<8|t[f],o[s]=u>>>0}return o},ie.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},ie.rotr32=function(t,e){return t>>>e|t<<32-e},ie.rotl32=function(t,e){return t<<e|t>>>32-e},ie.sum32=function(t,e){return t+e>>>0},ie.sum32_3=function(t,e,r){return t+e+r>>>0},ie.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},ie.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},ie.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},ie.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},ie.sum64_lo=function(t,e,r,n){return e+n>>>0},ie.sum64_4_hi=function(t,e,r,n,i,o,s,f){var u=0,h=e;return u+=(h=h+n>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,t+r+i+s+(u+=(h=h+f>>>0)<f?1:0)>>>0},ie.sum64_4_lo=function(t,e,r,n,i,o,s,f){return e+n+o+f>>>0},ie.sum64_5_hi=function(t,e,r,n,i,o,s,f,u,h){var a=0,c=e;return a+=(c=c+n>>>0)<e?1:0,a+=(c=c+o>>>0)<o?1:0,a+=(c=c+f>>>0)<f?1:0,t+r+i+s+u+(a+=(c=c+h>>>0)<h?1:0)>>>0},ie.sum64_5_lo=function(t,e,r,n,i,o,s,f,u,h){return e+n+o+f+h>>>0},ie.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},ie.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},ie.shr64_hi=function(t,e,r){return t>>>r},ie.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var pe={},me=ie,ge=oe;function Ae(){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}pe.BlockHash=Ae,Ae.prototype.update=function(t,e){if(t=me.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=me.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},Ae.prototype.digest=function(t){return this.update(this._pad()),ge(null===this.pending),this._digest(t)},Ae.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var ve={},ye={},be=ie.rotr32;function we(t,e,r){return t&e^~t&r}function Me(t,e,r){return t&e^t&r^e&r}function Ee(t,e,r){return t^e^r}ye.ft_1=function(t,e,r,n){return 0===t?we(e,r,n):1===t||3===t?Ee(e,r,n):2===t?Me(e,r,n):void 0},ye.ch32=we,ye.maj32=Me,ye.p32=Ee,ye.s0_256=function(t){return be(t,2)^be(t,13)^be(t,22)},ye.s1_256=function(t){return be(t,6)^be(t,11)^be(t,25)},ye.g0_256=function(t){return be(t,7)^be(t,18)^t>>>3},ye.g1_256=function(t){return be(t,17)^be(t,19)^t>>>10};var Se=ie,Ie=pe,Ne=ye,Be=Se.rotl32,Ce=Se.sum32,_e=Se.sum32_5,xe=Ne.ft_1,Oe=Ie.BlockHash,Re=[1518500249,1859775393,2400959708,3395469782];function Ue(){if(!(this instanceof Ue))return new Ue;Oe.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Se.inherits(Ue,Oe);var ke=Ue;Ue.blockSize=512,Ue.outSize=160,Ue.hmacStrength=80,Ue.padLength=64,Ue.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=Be(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],s=this.h[2],f=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var h=~~(n/20),a=_e(Be(i,5),xe(h,o,s,f),u,r[n],Re[h]);u=f,f=s,s=Be(o,30),o=i,i=a}this.h[0]=Ce(this.h[0],i),this.h[1]=Ce(this.h[1],o),this.h[2]=Ce(this.h[2],s),this.h[3]=Ce(this.h[3],f),this.h[4]=Ce(this.h[4],u)},Ue.prototype._digest=function(t){return"hex"===t?Se.toHex32(this.h,"big"):Se.split32(this.h,"big")};var De=ie,Pe=pe,Te=ye,Fe=oe,qe=De.sum32,ze=De.sum32_4,Le=De.sum32_5,He=Te.ch32,je=Te.maj32,Qe=Te.s0_256,Je=Te.s1_256,Ke=Te.g0_256,Ge=Te.g1_256,Ye=Pe.BlockHash,Ve=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Xe(){if(!(this instanceof Xe))return new Xe;Ye.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Ve,this.W=new Array(64)}De.inherits(Xe,Ye);var We=Xe;Xe.blockSize=512,Xe.outSize=256,Xe.hmacStrength=192,Xe.padLength=64,Xe.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=ze(Ge(r[n-2]),r[n-7],Ke(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],s=this.h[2],f=this.h[3],u=this.h[4],h=this.h[5],a=this.h[6],c=this.h[7];for(Fe(this.k.length===r.length),n=0;n<r.length;n++){var l=Le(c,Je(u),He(u,h,a),this.k[n],r[n]),d=qe(Qe(i),je(i,o,s));c=a,a=h,h=u,u=qe(f,l),f=s,s=o,o=i,i=qe(l,d)}this.h[0]=qe(this.h[0],i),this.h[1]=qe(this.h[1],o),this.h[2]=qe(this.h[2],s),this.h[3]=qe(this.h[3],f),this.h[4]=qe(this.h[4],u),this.h[5]=qe(this.h[5],h),this.h[6]=qe(this.h[6],a),this.h[7]=qe(this.h[7],c)},Xe.prototype._digest=function(t){return"hex"===t?De.toHex32(this.h,"big"):De.split32(this.h,"big")};var Ze=ie,$e=We;function tr(){if(!(this instanceof tr))return new tr;$e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Ze.inherits(tr,$e);var er=tr;tr.blockSize=512,tr.outSize=224,tr.hmacStrength=192,tr.padLength=64,tr.prototype._digest=function(t){return"hex"===t?Ze.toHex32(this.h.slice(0,7),"big"):Ze.split32(this.h.slice(0,7),"big")};var rr=ie,nr=pe,ir=oe,or=rr.rotr64_hi,sr=rr.rotr64_lo,fr=rr.shr64_hi,ur=rr.shr64_lo,hr=rr.sum64,ar=rr.sum64_hi,cr=rr.sum64_lo,lr=rr.sum64_4_hi,dr=rr.sum64_4_lo,pr=rr.sum64_5_hi,mr=rr.sum64_5_lo,gr=nr.BlockHash,Ar=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function vr(){if(!(this instanceof vr))return new vr;gr.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Ar,this.W=new Array(160)}rr.inherits(vr,gr);var yr=vr;function br(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function wr(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function Mr(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function Er(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function Sr(t,e){var r=or(t,e,28)^or(e,t,2)^or(e,t,7);return r<0&&(r+=4294967296),r}function Ir(t,e){var r=sr(t,e,28)^sr(e,t,2)^sr(e,t,7);return r<0&&(r+=4294967296),r}function Nr(t,e){var r=or(t,e,14)^or(t,e,18)^or(e,t,9);return r<0&&(r+=4294967296),r}function Br(t,e){var r=sr(t,e,14)^sr(t,e,18)^sr(e,t,9);return r<0&&(r+=4294967296),r}function Cr(t,e){var r=or(t,e,1)^or(t,e,8)^fr(t,e,7);return r<0&&(r+=4294967296),r}function _r(t,e){var r=sr(t,e,1)^sr(t,e,8)^ur(t,e,7);return r<0&&(r+=4294967296),r}function xr(t,e){var r=or(t,e,19)^or(e,t,29)^fr(t,e,6);return r<0&&(r+=4294967296),r}function Or(t,e){var r=sr(t,e,19)^sr(e,t,29)^ur(t,e,6);return r<0&&(r+=4294967296),r}vr.blockSize=1024,vr.outSize=512,vr.hmacStrength=192,vr.padLength=128,vr.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=xr(r[n-4],r[n-3]),o=Or(r[n-4],r[n-3]),s=r[n-14],f=r[n-13],u=Cr(r[n-30],r[n-29]),h=_r(r[n-30],r[n-29]),a=r[n-32],c=r[n-31];r[n]=lr(i,o,s,f,u,h,a,c),r[n+1]=dr(i,o,s,f,u,h,a,c)}},vr.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],f=this.h[4],u=this.h[5],h=this.h[6],a=this.h[7],c=this.h[8],l=this.h[9],d=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],A=this.h[14],v=this.h[15];ir(this.k.length===r.length);for(var y=0;y<r.length;y+=2){var b=A,w=v,M=Nr(c,l),E=Br(c,l),S=br(c,l,d,p,m),I=wr(c,l,d,p,m,g),N=this.k[y],B=this.k[y+1],C=r[y],_=r[y+1],x=pr(b,w,M,E,S,I,N,B,C,_),O=mr(b,w,M,E,S,I,N,B,C,_);b=Sr(n,i),w=Ir(n,i),M=Mr(n,i,o,s,f),E=Er(n,i,o,s,f,u);var R=ar(b,w,M,E),U=cr(b,w,M,E);A=m,v=g,m=d,g=p,d=c,p=l,c=ar(h,a,x,O),l=cr(a,a,x,O),h=f,a=u,f=o,u=s,o=n,s=i,n=ar(x,O,R,U),i=cr(x,O,R,U)}hr(this.h,0,n,i),hr(this.h,2,o,s),hr(this.h,4,f,u),hr(this.h,6,h,a),hr(this.h,8,c,l),hr(this.h,10,d,p),hr(this.h,12,m,g),hr(this.h,14,A,v)},vr.prototype._digest=function(t){return"hex"===t?rr.toHex32(this.h,"big"):rr.split32(this.h,"big")};var Rr=ie,Ur=yr;function kr(){if(!(this instanceof kr))return new kr;Ur.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Rr.inherits(kr,Ur);var Dr=kr;kr.blockSize=1024,kr.outSize=384,kr.hmacStrength=192,kr.padLength=128,kr.prototype._digest=function(t){return"hex"===t?Rr.toHex32(this.h.slice(0,12),"big"):Rr.split32(this.h.slice(0,12),"big")},ve.sha1=ke,ve.sha224=er,ve.sha256=We,ve.sha384=Dr,ve.sha512=yr;var Pr={},Tr=ie,Fr=pe,qr=Tr.rotl32,zr=Tr.sum32,Lr=Tr.sum32_3,Hr=Tr.sum32_4,jr=Fr.BlockHash;function Qr(){if(!(this instanceof Qr))return new Qr;jr.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Jr(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function Kr(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Gr(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Tr.inherits(Qr,jr),Pr.ripemd160=Qr,Qr.blockSize=512,Qr.outSize=160,Qr.hmacStrength=192,Qr.padLength=64,Qr.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],s=this.h[4],f=r,u=n,h=i,a=o,c=s,l=0;l<80;l++){var d=zr(qr(Hr(r,Jr(l,n,i,o),t[Yr[l]+e],Kr(l)),Xr[l]),s);r=s,s=o,o=qr(i,10),i=n,n=d,d=zr(qr(Hr(f,Jr(79-l,u,h,a),t[Vr[l]+e],Gr(l)),Wr[l]),c),f=c,c=a,a=qr(h,10),h=u,u=d}d=Lr(this.h[1],i,a),this.h[1]=Lr(this.h[2],o,c),this.h[2]=Lr(this.h[3],s,f),this.h[3]=Lr(this.h[4],r,u),this.h[4]=Lr(this.h[0],n,h),this.h[0]=d},Qr.prototype._digest=function(t){return"hex"===t?Tr.toHex32(this.h,"little"):Tr.split32(this.h,"little")};var Yr=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Vr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Xr=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Wr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Zr=ie,$r=oe;function tn(t,e,r){if(!(this instanceof tn))return new tn(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Zr.toArray(e,r))}var en=tn;function rn(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e??r.path)}},r.exports),r.exports}tn.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),$r(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},tn.prototype.update=function(t,e){return this.inner.update(t,e),this},tn.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=ie,e.common=pe,e.sha=ve,e.ripemd=Pr,e.hmac=en,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(ne);var nn=on;function on(t,e){if(!t)throw new Error(e||"Assertion failed")}on.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var sn=rn((function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}})),fn=rn((function(t,e){var r=e;r.assert=nn,r.toArray=sn.toArray,r.zero2=sn.zero2,r.toHex=sn.toHex,r.encode=sn.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var f,u=o.andln(i-1);o.isOdd()?(f=u>(i>>1)-1?(i>>1)-u:u,o.isubn(f)):f=0,n[s]=f,o.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,f,u=t.andln(3)+i&3,h=e.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),1&u?s=3!==(n=t.andln(7)+i&7)&&5!==n||2!==h?u:-u:s=0,r[0].push(s),1&h?f=3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?h:-h:f=0,r[1].push(f),2*i===s+1&&(i=1-i),2*o===f+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new it(t,"hex","le")}})),un=fn.getNAF,hn=fn.getJSF,an=fn.assert;function cn(t,e){this.type=t,this.p=new it(e.p,16),this.red=e.prime?it.red(e.prime):it.mont(this.p),this.zero=new it(0).toRed(this.red),this.one=new it(1).toRed(this.red),this.two=new it(2).toRed(this.red),this.n=e.n&&new it(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ln=cn;function dn(t,e){this.curve=t,this.type=e,this.precomputed=null}cn.prototype.point=function(){throw new Error("Not implemented")},cn.prototype.validate=function(){throw new Error("Not implemented")},cn.prototype._fixedNafMul=function(t,e){an(t.precomputed);var r=t._getDoubles(),n=un(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,s,f=[];for(o=0;o<n.length;o+=r.step){s=0;for(var u=o+r.step-1;u>=o;u--)s=(s<<1)+n[u];f.push(s)}for(var h=this.jpoint(null,null,null),a=this.jpoint(null,null,null),c=i;c>0;c--){for(o=0;o<f.length;o++)(s=f[o])===c?a=a.mixedAdd(r.points[o]):s===-c&&(a=a.mixedAdd(r.points[o].neg()));h=h.add(a)}return h.toP()},cn.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=un(e,r,this._bitLength),s=this.jpoint(null,null,null),f=o.length-1;f>=0;f--){for(var u=0;f>=0&&0===o[f];f--)u++;if(f>=0&&u++,s=s.dblp(u),f<0)break;var h=o[f];an(0!==h),s="affine"===t.type?h>0?s.mixedAdd(i[h-1>>1]):s.mixedAdd(i[-h-1>>1].neg()):h>0?s.add(i[h-1>>1]):s.add(i[-h-1>>1].neg())}return"affine"===t.type?s.toP():s},cn.prototype._wnafMulAdd=function(t,e,r,n,i){var o,s,f,u=this._wnafT1,h=this._wnafT2,a=this._wnafT3,c=0;for(o=0;o<n;o++){var l=(f=e[o])._getNAFPoints(t);u[o]=l.wnd,h[o]=l.points}for(o=n-1;o>=1;o-=2){var d=o-1,p=o;if(1===u[d]&&1===u[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],A=hn(r[d],r[p]);for(c=Math.max(A[0].length,c),a[d]=new Array(c),a[p]=new Array(c),s=0;s<c;s++){var v=0|A[0][s],y=0|A[1][s];a[d][s]=g[3*(v+1)+(y+1)],a[p][s]=0,h[d]=m}}else a[d]=un(r[d],u[d],this._bitLength),a[p]=un(r[p],u[p],this._bitLength),c=Math.max(a[d].length,c),c=Math.max(a[p].length,c)}var b=this.jpoint(null,null,null),w=this._wnafT4;for(o=c;o>=0;o--){for(var M=0;o>=0;){var E=!0;for(s=0;s<n;s++)w[s]=0|a[s][o],0!==w[s]&&(E=!1);if(!E)break;M++,o--}if(o>=0&&M++,b=b.dblp(M),o<0)break;for(s=0;s<n;s++){var S=w[s];0!==S&&(S>0?f=h[s][S-1>>1]:S<0&&(f=h[s][-S-1>>1].neg()),b="affine"===f.type?b.mixedAdd(f):b.add(f))}}for(o=0;o<n;o++)h[o]=null;return i?b:b.toP()},cn.BasePoint=dn,dn.prototype.eq=function(){throw new Error("Not implemented")},dn.prototype.validate=function(){return this.curve.validate(this)},cn.prototype.decodePoint=function(t,e){t=fn.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?an(t[t.length-1]%2==0):7===t[0]&&an(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},dn.prototype.encodeCompressed=function(t){return this.encode(t,!0)},dn.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},dn.prototype.encode=function(t,e){return fn.encode(this._encode(e),t)},dn.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},dn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},dn.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},dn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},dn.prototype._getBeta=function(){return null},dn.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var pn=rn((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}})),mn=fn.assert;function gn(t){ln.call(this,"short",t),this.a=new it(t.a,16).toRed(this.red),this.b=new it(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}pn(gn,ln);var An=gn;function vn(t,e,r,n){ln.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new it(e,16),this.y=new it(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function yn(t,e,r,n){ln.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new it(0)):(this.x=new it(e,16),this.y=new it(r,16),this.z=new it(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}gn.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new it(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new it(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],mn(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new it(t.a,16),b:new it(t.b,16)}})):this._getEndoBasis(r)}}},gn.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:it.mont(t),r=new it(2).toRed(e).redInvm(),n=r.redNeg(),i=new it(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},gn.prototype._getEndoBasis=function(t){for(var e,r,n,i,o,s,f,u,h,a=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=t,l=this.n.clone(),d=new it(1),p=new it(0),m=new it(0),g=new it(1),A=0;0!==c.cmpn(0);){var v=l.div(c);u=l.sub(v.mul(c)),h=m.sub(v.mul(d));var y=g.sub(v.mul(p));if(!n&&u.cmp(a)<0)e=f.neg(),r=d,n=u.neg(),i=h;else if(n&&2==++A)break;f=u,l=c,c=u,m=d,d=h,g=p,p=y}o=u.neg(),s=h;var b=n.sqr().add(i.sqr());return o.sqr().add(s.sqr()).cmp(b)>=0&&(o=e,s=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:i},{a:o,b:s}]},gn.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),f=o.mul(n.a),u=i.mul(r.b),h=o.mul(n.b);return{k1:t.sub(s).sub(f),k2:u.add(h).neg()}},gn.prototype.pointFromX=function(t,e){(t=new it(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},gn.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},gn.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),f=t[o],u=f._getBeta();s.k1.negative&&(s.k1.ineg(),f=f.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=f,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,n,i,2*o,r),a=0;a<2*o;a++)n[a]=null,i[a]=null;return h},pn(vn,ln.BasePoint),gn.prototype.point=function(t,e,r){return new vn(this,t,e,r)},gn.prototype.pointFromJSON=function(t,e){return vn.fromJSON(this,t,e)},vn.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},vn.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},vn.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},vn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},vn.prototype.isInfinity=function(){return this.inf},vn.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},vn.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},vn.prototype.getX=function(){return this.x.fromRed()},vn.prototype.getY=function(){return this.y.fromRed()},vn.prototype.mul=function(t){return t=new it(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},vn.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},vn.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},vn.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},vn.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},vn.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},pn(yn,ln.BasePoint),gn.prototype.jpoint=function(t,e,r){return new yn(this,t,e,r)},yn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},yn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},yn.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),f=n.redSub(i),u=o.redSub(s);if(0===f.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=f.redSqr(),a=h.redMul(f),c=n.redMul(h),l=u.redSqr().redIAdd(a).redISub(c).redISub(c),d=u.redMul(c.redISub(l)).redISub(o.redMul(a)),p=this.z.redMul(t.z).redMul(f);return this.curve.jpoint(l,d,p)},yn.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),f=i.redSub(o);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),a=r.redMul(u),c=f.redSqr().redIAdd(h).redISub(a).redISub(a),l=f.redMul(a.redISub(c)).redISub(i.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(c,l,d)},yn.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,f=this.z,u=f.redSqr().redSqr(),h=s.redAdd(s);for(e=0;e<t;e++){var a=o.redSqr(),c=h.redSqr(),l=c.redSqr(),d=a.redAdd(a).redIAdd(a).redIAdd(n.redMul(u)),p=o.redMul(c),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),A=d.redMul(g);A=A.redIAdd(A).redISub(l);var v=h.redMul(f);e+1<t&&(u=u.redMul(l)),o=m,f=v,h=A}return this.curve.jpoint(o,h.redMul(i),f)},yn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},yn.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var f=n.redAdd(n).redIAdd(n),u=f.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=u,e=f.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var a=this.x.redSqr(),c=this.y.redSqr(),l=c.redSqr(),d=this.x.redAdd(c).redSqr().redISub(a).redISub(l);d=d.redIAdd(d);var p=a.redAdd(a).redIAdd(a),m=p.redSqr(),g=l.redIAdd(l);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},yn.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var f=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=f.redSqr().redISub(s).redISub(s);t=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=f.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var a=this.z.redSqr(),c=this.y.redSqr(),l=this.x.redMul(c),d=this.x.redSub(a).redMul(this.x.redAdd(a));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),m=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(a);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},yn.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),f=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),h=(u=u.redIAdd(u)).redMul(s),a=f.redSqr().redISub(h.redAdd(h)),c=h.redISub(a),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=f.redMul(c).redISub(l),p=r.redAdd(r).redMul(n);return this.curve.jpoint(a,d,p)},yn.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),f=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=i.redIAdd(s).redSqr().redISub(o).redISub(f).redISub(u),a=e.redMul(h);a=(a=a.redIAdd(a)).redIAdd(a);var c=this.x.redMul(f).redISub(a);c=(c=c.redIAdd(c)).redIAdd(c);var l=this.y.redMul(h.redMul(u.redISub(h)).redISub(s.redMul(f)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(f);return this.curve.jpoint(c,l,d)},yn.prototype.mul=function(t,e){return t=new it(t,e),this.curve._wnafMul(this,t)},yn.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},yn.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},yn.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},yn.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var bn=rn((function(t,e){var r=e;r.base=ln,r.short=An,r.mont=null,r.edwards=null})),wn=rn((function(t,e){var r,n=e,i=fn.assert;function o(t){"short"===t.type?this.curve=new bn.short(t):"edwards"===t.type?this.curve=new bn.edwards(t):this.curve=new bn.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new o(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,s("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:ne.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:ne.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:ne.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:ne.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"]}),s("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:ne.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ne.sha256,gRed:!1,g:["9"]}),s("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:ne.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch{r=void 0}s("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:ne.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Mn(t){if(!(this instanceof Mn))return new Mn(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=sn.toArray(t.entropy,t.entropyEnc||"hex"),r=sn.toArray(t.nonce,t.nonceEnc||"hex"),n=sn.toArray(t.pers,t.persEnc||"hex");nn(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var En=Mn;Mn.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Mn.prototype._hmac=function(){return new ne.hmac(this.hash,this.K)},Mn.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},Mn.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=sn.toArray(t,e),r=sn.toArray(r,n),nn(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},Mn.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=sn.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(r),this._reseed++,sn.encode(o,e)};var Sn=fn.assert;function In(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var Nn=In;In.fromPublic=function(t,e,r){return e instanceof In?e:new In(t,{pub:e,pubEnc:r})},In.fromPrivate=function(t,e,r){return e instanceof In?e:new In(t,{priv:e,privEnc:r})},In.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},In.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},In.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},In.prototype._importPrivate=function(t,e){this.priv=new it(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},In.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?Sn(t.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&Sn(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},In.prototype.derive=function(t){return t.validate()||Sn(t.validate(),"public point not validated"),t.mul(this.priv).getX()},In.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},In.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},In.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Bn=fn.assert;function Cn(t,e){if(t instanceof Cn)return t;this._importDER(t,e)||(Bn(t.r&&t.s,"Signature without r or s"),this.r=new it(t.r,16),this.s=new it(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var _n=Cn;function xn(){this.place=0}function On(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function Rn(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function Un(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}Cn.prototype._importDER=function(t,e){t=fn.toArray(t,e);var r=new xn;if(48!==t[r.place++])return!1;var n=On(t,r);if(!1===n||n+r.place!==t.length||2!==t[r.place++])return!1;var i=On(t,r);if(!1===i)return!1;var o=t.slice(r.place,i+r.place);if(r.place+=i,2!==t[r.place++])return!1;var s=On(t,r);if(!1===s||t.length!==s+r.place)return!1;var f=t.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new it(o),this.s=new it(f),this.recoveryParam=null,!0},Cn.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=Rn(e),r=Rn(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];Un(n,e.length),(n=n.concat(e)).push(2),Un(n,r.length);var i=n.concat(r),o=[48];return Un(o,i.length),o=o.concat(i),fn.encode(o,t)};var kn=function(){throw new Error("unsupported")},Dn=fn.assert;function Pn(t){if(!(this instanceof Pn))return new Pn(t);"string"==typeof t&&(Dn(Object.prototype.hasOwnProperty.call(wn,t),"Unknown curve "+t),t=wn[t]),t instanceof wn.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var Tn=Pn;Pn.prototype.keyPair=function(t){return new Nn(this,t)},Pn.prototype.keyFromPrivate=function(t,e){return Nn.fromPrivate(this,t,e)},Pn.prototype.keyFromPublic=function(t,e){return Nn.fromPublic(this,t,e)},Pn.prototype.genKeyPair=function(t){t||(t={});for(var e=new En({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||kn(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new it(2));;){var i=new it(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Pn.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},Pn.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new it(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),s=t.toArray("be",i),f=new En({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new it(1)),h=0;;h++){var a=n.k?n.k(h):new it(f.generate(this.n.byteLength()));if(!((a=this._truncateToN(a,!0)).cmpn(1)<=0||a.cmp(u)>=0)){var c=this.g.mul(a);if(!c.isInfinity()){var l=c.getX(),d=l.umod(this.n);if(0!==d.cmpn(0)){var p=a.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(c.getY().isOdd()?1:0)|(0!==l.cmp(d)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new _n({r:d,s:p,recoveryParam:m})}}}}}},Pn.prototype.verify=function(t,e,r,n){t=this._truncateToN(new it(t,16)),r=this.keyFromPublic(r,n);var i=(e=new _n(e,"hex")).r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,f=o.invm(this.n),u=f.mul(t).umod(this.n),h=f.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),h)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},Pn.prototype.recoverPubKey=function(t,e,r,n){Dn((3&r)===r,"The recovery param is more than two bits"),e=new _n(e,n);var i=this.n,o=new it(t),s=e.r,f=e.s,u=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var a=e.r.invm(i),c=i.sub(o).mul(a).umod(i),l=f.mul(a).umod(i);return this.g.mulAdd(c,s,l)},Pn.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new _n(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Fn=rn((function(t,e){var r=e;r.version="6.5.4",r.utils=fn,r.rand=function(){throw new Error("unsupported")},r.curve=bn,r.curves=wn,r.ec=Tn,r.eddsa=null})).ec;const qn=new H("signing-key/5.7.0");let zn=null;function Ln(){return zn||(zn=new Fn("secp256k1")),zn}class Hn{constructor(t){te(this,"curve","secp256k1"),te(this,"privateKey",W(t)),32!==function(t){if("string"!=typeof t)t=W(t);else if(!V(t)||t.length%2)return null;return(t.length-2)/2}(this.privateKey)&&qn.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=Ln().keyFromPrivate(Y(this.privateKey));te(this,"publicKey","0x"+e.getPublic(!1,"hex")),te(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),te(this,"_isSigningKey",!0)}_addPoint(t){const e=Ln().keyFromPublic(Y(this.publicKey)),r=Ln().keyFromPublic(Y(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){const e=Ln().keyFromPrivate(Y(this.privateKey)),r=Y(t);32!==r.length&&qn.throwArgumentError("bad digest length","digest",t);const n=e.sign(r,{canonical:!0});return tt({recoveryParam:n.recoveryParam,r:$("0x"+n.r.toString(16),32),s:$("0x"+n.s.toString(16),32)})}computeSharedSecret(t){const e=Ln().keyFromPrivate(Y(this.privateKey)),r=Ln().keyFromPublic(Y(jn(t)));return $("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function jn(t,e){const r=Y(t);if(32===r.length){const t=new Hn(r);return e?"0x"+Ln().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?W(r):"0x"+Ln().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+Ln().keyFromPublic(r).getPublic(!0,"hex"):W(r):qn.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Qn;function Jn(t,e){return function(t){return $t(Z(et(Z(jn(t),1)),12))}(function(t,e){const r=tt(e),n={r:Y(r.r),s:Y(r.s)};return"0x"+Ln().recoverPubKey(Y(t),n,r.recoveryParam).encode("hex",!1)}(Y(t),e))}new H("transactions/5.7.0"),function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(Qn||(Qn={}));const Kn="https://rpc.walletconnect.com/v1";async function Gn(t,e,r,n,i,o){switch(r.t){case"eip191":return function(t,e,r){return Jn(Yt(e),r).toLowerCase()===t.toLowerCase()}(t,e,r.s);case"eip1271":return await async function(t,e,r,n,i,o){try{const s="0x1626ba7e",f="0000000000000000000000000000000000000000000000000000000000000040",u="0000000000000000000000000000000000000000000000000000000000000041",h=r.substring(2),a=s+Yt(e).substring(2)+f+u+h,c=await fetch(`${o||Kn}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:Yn(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:a},"latest"]})}),{result:l}=await c.json();return!!l&&l.slice(0,s.length).toLowerCase()===s.toLowerCase()}catch(s){return console.error("isValidEip1271Signature: ",s),!1}}(t,e,r.s,n,i,o);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function Yn(){return Date.now()+Math.floor(1e3*Math.random())}var Vn=Object.defineProperty,Xn=Object.defineProperties,Wn=Object.getOwnPropertyDescriptors,Zn=Object.getOwnPropertySymbols,$n=Object.prototype.hasOwnProperty,ti=Object.prototype.propertyIsEnumerable,ei=(t,e,r)=>e in t?Vn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ri=(t,e)=>{for(var r in e||(e={}))$n.call(e,r)&&ei(t,r,e[r]);if(Zn)for(var r of Zn(e))ti.call(e,r)&&ei(t,r,e[r]);return t},ni=(t,e)=>Xn(t,Wn(e));const ii=t=>t?.split(":"),oi=t=>{const e=t&&ii(t);if(e)return t.includes("did:pkh:")?e[3]:e[1]},si=t=>{const e=t&&ii(t);if(e)return e[2]+":"+e[3]},fi=t=>{const e=t&&ii(t);if(e)return e.pop()};async function ui(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,o=hi(i,i.iss),s=fi(i.iss);return await Gn(s,o,n,oi(i.iss),r)}const hi=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=fi(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const o=`URI: ${t.aud||t.uri}`,s=`Version: ${t.version}`,f=`Chain ID: ${oi(e)}`,u=`Nonce: ${t.nonce}`,h=`Issued At: ${t.iat}`,a=t.resources?`Resources:${t.resources.map((t=>`\n- ${t}`)).join("")}`:void 0,c=bi(t.resources);if(c){i=Ai(i,di(c))}return[r,n,"",i,"",o,s,f,u,h,a].filter((t=>null!=t)).join("\n")};function ai(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(null==e||!e.length)throw new Error("No resources found in `att` property");e.forEach((e=>{const r=t.att[e];if(Array.isArray(r))throw new Error(`Resource must be an object: ${e}`);if("object"!=typeof r)throw new Error(`Resource must be an object: ${e}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${e}`);Object.keys(r).forEach((t=>{const e=r[t];if(!Array.isArray(e))throw new Error(`Ability limits ${t} must be an array of objects, found: ${e}`);if(!e.length)throw new Error(`Value of ${t} is empty array, must be an array with objects`);e.forEach((e=>{if("object"!=typeof e)throw new Error(`Ability limits (${t}) must be an array of objects, found: ${e}`)}))}))}))}function ci(t,e,r={}){e=e?.sort(((t,e)=>t.localeCompare(e)));const n=e.map((e=>({[`${t}/${e}`]:[r]})));return Object.assign({},...n)}function li(t){return ai(t),`urn:recap:${function(t){return h.from(JSON.stringify(t)).toString("base64")}(t).replace(/=/g,"")}`}function di(t){const e=function(t){return JSON.parse(h.from(t,"base64").toString("utf-8"))}(t.replace("urn:recap:",""));return ai(e),e}function pi(t,e,r){const n=function(t,e,r,n={}){return r?.sort(((t,e)=>t.localeCompare(e))),{att:{[t]:ci(e,r,n)}}}(t,e,r);return li(n)}function mi(t){return t&&t.includes("urn:recap:")}function gi(t,e){const r=function(t,e){ai(t),ai(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort(((t,e)=>t.localeCompare(e))),n={att:{}};return r.forEach((r=>{var i,o;Object.keys((null==(i=t.att)?void 0:i[r])||{}).concat(Object.keys((null==(o=e.att)?void 0:o[r])||{})).sort(((t,e)=>t.localeCompare(e))).forEach((i=>{var o,s;n.att[r]=ni(ri({},n.att[r]),{[i]:(null==(o=t.att[r])?void 0:o[i])||(null==(s=e.att[r])?void 0:s[i])})}))})),n}(di(t),di(e));return li(r)}function Ai(t="",e){ai(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach((t=>{const r=Object.keys(e.att[t]).map((t=>({ability:t.split("/")[0],action:t.split("/")[1]})));r.sort(((t,e)=>t.action.localeCompare(e.action)));const o={};r.forEach((t=>{o[t.ability]||(o[t.ability]=[]),o[t.ability].push(t.action)}));const s=Object.keys(o).map((e=>(i++,`(${i}) '${e}': '${o[e].join("', '")}' for '${t}'.`)));n.push(s.join(", ").replace(".,","."))}));return`${t?t+" ":""}${`${r}${n.join(" ")}`}`}function vi(t){var e;const r=di(t);ai(r);const n=null==(e=r.att)?void 0:e.eip155;return n?Object.keys(n).map((t=>t.split("/")[1])):[]}function yi(t){const e=di(t);ai(e);const r=[];return Object.values(e.att).forEach((t=>{Object.values(t).forEach((t=>{var e;null!=(e=t?.[0])&&e.chains&&r.push(t[0].chains)}))})),[...new Set(r.flat())]}function bi(t){if(!t)return;const e=t?.[t.length-1];return mi(e)?e:void 0}const wi="base16",Mi="utf8",Ei=1;function Si(t){const e=(0,s.vp)((0,f.mL)(t,wi));return(0,f.BB)(e,wi)}function Ii(t){const e=(0,s.vp)((0,f.mL)(t,Mi));return(0,f.BB)(e,wi)}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Ni(t){const e=[];return t.forEach((t=>{const[r,n]=t.split(":");e.push(`${r}:${n}`)})),e}function Bi(t,e){const r=function(t){const e={};return t?.forEach((t=>{const[r,n]=t.split(":");e[r]||(e[r]={accounts:[],chains:[],events:[]}),e[r].accounts.push(t),e[r].chains.push(`${r}:${n}`)})),e}(e=e.map((t=>t.replace("did:pkh:",""))));for(const[n,i]of Object.entries(r))i.methods?i.methods=N(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const Ci={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},_i={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function xi(t,e){const{message:r,code:n}=_i[t];return{message:e?`${r} ${e}`:r,code:n}}function Oi(t,e){const{message:r,code:n}=Ci[t];return{message:e?`${r} ${e}`:r,code:n}}function Ri(t,e){return!!Array.isArray(t)&&(!(typeof e<"u"&&t.length)||t.every(e))}function Ui(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function ki(t){return typeof t>"u"}function Di(t,e){return!(!e||!ki(t))||"string"==typeof t&&!!t.trim().length}function Pi(t,e){return!(!e||!ki(t))||"number"==typeof t&&!isNaN(t)}function Ti(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return!!b(i,n)&&(n.forEach((e=>{const{accounts:n,methods:i,events:s}=t.namespaces[e],f=Ni(n),u=r[e];b(l(e,u),f)&&b(u.methods,i)&&b(u.events,s)||(o=!1)})),o)}function Fi(t){return!(!Di(t,!1)||!t.includes(":"))&&2===t.split(":").length}function qi(t,e){let r=null;return Di(t?.publicKey,!1)||(r=xi("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function zi(t){let e=!0;return Ri(t)?t.length&&(e=t.every((t=>Di(t,!1)))):e=!1,e}function Li(t,e,r){let n=null;return Object.entries(t).forEach((([t,i])=>{if(n)return;const o=function(t,e,r){let n=null;return Ri(e)&&e.length?e.forEach((t=>{n||Fi(t)||(n=Oi("UNSUPPORTED_CHAINS",`${r}, chain ${t} should be a string and conform to "namespace:chainId" format`))})):Fi(t)||(n=Oi("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}(t,l(t,i),`${e} ${r}`);o&&(n=o)})),n}function Hi(t,e){let r=null;return Ri(t)?t.forEach((t=>{r||function(t){if(Di(t,!1)&&t.includes(":")){const e=t.split(":");if(3===e.length){const t=e[0]+":"+e[1];return!!e[2]&&Fi(t)}}return!1}(t)||(r=Oi("UNSUPPORTED_ACCOUNTS",`${e}, account ${t} should be a string and conform to "namespace:chainId:address" format`))})):r=Oi("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function ji(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const n=function(t,e){let r=null;return zi(t?.methods)?zi(t?.events)||(r=Oi("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Oi("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}(t,`${e}, namespace`);n&&(r=n)})),r}function Qi(t,e,r){let n=null;if(t&&Ui(t)){const i=ji(t,e);i&&(n=i);const o=Li(t,e,r);o&&(n=o)}else n=xi("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function Ji(t,e){let r=null;if(t&&Ui(t)){const n=ji(t,e);n&&(r=n);const i=function(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const n=Hi(t?.accounts,`${e} namespace`);n&&(r=n)})),r}(t,e);i&&(r=i)}else r=xi("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Ki(t){return Di(t.protocol,!0)}function Gi(t,e){let r=!1;return e&&!t?r=!0:t&&Ri(t)&&t.length&&t.forEach((t=>{r=Ki(t)})),r}function Yi(t){return"number"==typeof t}function Vi(t){return typeof t<"u"&&null!==typeof t}function Xi(t){return!!(t&&"object"==typeof t&&t.code&&Pi(t.code,!1)&&t.message&&Di(t.message,!1))}function Wi(t){return!(ki(t)||!Di(t.method,!1))}function Zi(t){return!(ki(t)||ki(t.result)&&ki(t.error)||!Pi(t.id,!1)||!Di(t.jsonrpc,!1))}function $i(t){return!(ki(t)||!Di(t.name,!1))}function to(t,e){return!(!Fi(e)||!function(t){const e=[];return Object.values(t).forEach((t=>{e.push(...Ni(t.accounts))})),e}(t).includes(e))}function eo(t,e,r){return!!Di(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{Ni(t.accounts).includes(e)&&r.push(...t.methods)})),r}(t,e).includes(r)}function ro(t,e,r){return!!Di(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{Ni(t.accounts).includes(e)&&r.push(...t.events)})),r}(t,e).includes(r)}function no(t,e,r){let n=null;const i=function(t){const e={};return Object.keys(t).forEach((r=>{var n;r.includes(":")?e[r]=t[r]:null==(n=t[r].chains)||n.forEach((n=>{e[n]={methods:t[r].methods,events:t[r].events}}))})),e}(t),o=function(t){const e={};return Object.keys(t).forEach((r=>{if(r.includes(":"))e[r]=t[r];else{const n=Ni(t[r].accounts);n?.forEach((n=>{e[n]={accounts:t[r].accounts.filter((t=>t.includes(`${n}:`))),methods:t[r].methods,events:t[r].events}}))}})),e}(e),s=Object.keys(i),f=Object.keys(o),u=io(Object.keys(t)),h=io(Object.keys(e)),a=u.filter((t=>!h.includes(t)));return a.length&&(n=xi("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${a.toString()}\n Received: ${Object.keys(e).toString()}`)),b(s,f)||(n=xi("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${s.toString()}\n Approved: ${f.toString()}`)),Object.keys(e).forEach((t=>{if(!t.includes(":")||n)return;const i=Ni(e[t].accounts);i.includes(t)||(n=xi("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${t}\n Required: ${t}\n Approved: ${i.toString()}`))})),s.forEach((t=>{n||(b(i[t].methods,o[t].methods)?b(i[t].events,o[t].events)||(n=xi("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${t}`)):n=xi("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${t}`))})),n}function io(t){return[...new Set(t.map((t=>t.includes(":")?t.split(":")[0]:t)))]}function oo(t,e){return Pi(t,!1)&&t<=e.max&&t>=e.min}const so={};class fo{static get(t){return so[t]}static set(t,e){so[t]=e}static delete(t){delete so[t]}}}}]);
//# sourceMappingURL=fcf75e44-0a96fc136a52c08f1256.js.map